123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- /*!
- * filename: ej2-base.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.base=function(e){"use strict";function t(){tt=!1}function r(e,t){var r=t;return r.unshift(void 0),new(Function.prototype.bind.apply(e,r))}function n(e){var t,r=new Uint16Array(5);(window.msCrypto||window.crypto).getRandomValues(r);var n="ej2"+C(r),i=function(r){r.source===window&&"string"==typeof r.data&&r.data.length<=32&&r.data===n&&(e(),t())};return window.addEventListener("message",i,!1),window.postMessage(n,"*"),t=function(){window.removeEventListener("message",i),e=i=n=void 0}}function i(e,t){for(var r=t,n=e.replace(/\[/g,".").replace(/\]/g,"").split("."),i=0;i<n.length&&!h(r);i++)r=r[n[i]];return r}function o(e,t,r){var n,i,o=e.replace(/\[/g,".").replace(/\]/g,"").split("."),a=r||{},s=a,l=o.length;for(n=0;n<l;n++)i=o[n],n+1===l?s[i]=void 0===t?{}:t:p(s[i])&&(s[i]={}),s=s[i];return a}function a(e,t){delete e[t]}function s(e){var t={};return!p(e)&&e.constructor===t.constructor}function l(e,t){return e[t]}function c(e,t){if(!p(t))for(var r=e,n=t,i=0,o=Object.keys(t);i<o.length;i++){var a=o[i];p(r.deepMerge)||-1===r.deepMerge.indexOf(a)||!s(n[a])&&!Array.isArray(n[a])?r[a]=n[a]:u(r[a],r[a],n[a],!0)}}function u(e,t,r,n){var i=e&&"object"==typeof e?e:{},o=arguments.length;n&&(o-=1);for(var a=arguments,l=1;l<o;l++)!function(e){if(!a[e])return"continue";var t=a[e];Object.keys(t).forEach(function(e){var r,o=i[e],a=t[e],l=Array.isArray(a)&&Array.isArray(o)&&a.length!==o.length,c=!w()||!(o instanceof Event||l);n&&c&&(s(a)||Array.isArray(a))?s(a)?(r=o||{},Array.isArray(r)&&r.hasOwnProperty("isComplexArray")?u(r,{},a,n):i[e]=u(r,{},a,n)):(r=w()?o&&Object.keys(a).length:o||[],i[e]=u([],r,a,n)):i[e]=a})}(l);return i}function p(e){return void 0===e||null===e}function h(e){return void 0===e}function d(e){return e+"_"+et++}function m(e,t){var r;return function(){var n=this,i=arguments,o=function(){return r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function f(e){for(var t=[],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];t.push(encodeURIComponent(i)+"="+encodeURIComponent(""+e[i]))}return t.join("&")}function g(e){var t=Object.prototype.toString;return"[object Array]"===t.call(e)&&"[object Object]"===t.call(e[0])}function v(e,t){var r=e;return r===t||!(r===document||!r)&&v(r.parentNode,t)}function y(e){try{throw new Error(e)}catch(e){throw e.message+"\n"+e.stack}}function b(e,t){var r=document.createElement("div"),n=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("base, link, style")),i=[].slice.call(document.getElementsByTagName("body")[0].querySelectorAll("link, style"));if(i.length)for(var o=0,a=i.length;o<a;o++)n.push(i[o]);var s="";p(t)&&(t=window.open("","print","height=452,width=1024,tabbar=no")),r.appendChild(e.cloneNode(!0));for(var l=0,a=n.length;l<a;l++)s+=n[l].outerHTML;t.document.write("<!DOCTYPE html> <html><head>"+s+"</head><body>"+r.innerHTML+"<script> (function() { window.ready = true; })(); <\/script></body></html>"),t.document.close(),t.focus();var c=setInterval(function(){t.ready&&(t.print(),t.close(),clearInterval(c))},500);return t}function M(e){var t=e+"";return t.match(/auto|%|px|vh|vm|vmax|vmin|em/)?t:t+"px"}function D(){tt=!0}function w(){return tt}function E(e){return e instanceof Node||!w()||p(e.xPath)?e:document.evaluate(e.xPath,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}function P(e,t){var r="string"==typeof e?document.querySelector(e):e;if(r[Qe])for(var n=0,i=r[Qe];n<i.length;n++){var o=i[n];if(o instanceof t)return o}return null}function S(e,t){var r="string"==typeof e?document.querySelector(e):e;r[Qe]?r[Qe].push(t):r[Qe]=[t]}function O(){if("undefined"!=typeof window){var e=new Uint16Array(5);return(window.msCrypto||window.crypto).getRandomValues(e)}}function C(e){for(var t="",r=0;r<5;r++)t+=(r?",":"")+e[r];return t}function T(e){return i(e||"",at)}function j(t){e.defaultCulture=t,Mt.notify("notifyExternalChange",{locale:e.defaultCulture})}function x(t){e.defaultCurrencyCode=t,Mt.notify("notifyExternalChange",{currencyCode:e.defaultCurrencyCode})}function N(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e;r<n.length;r++){var i=n[r];u(Dt,i,{},!0)}}function F(t){void 0===t&&(t=!0),e.rightToLeft=t,Mt.notify("notifyExternalChange",{enableRtl:e.rightToLeft})}function A(t,r){var n=e.IntlBase.getDependables(Dt,t,"",!0)[wt[0]],o=e.IntlBase.getDependables(Dt,t,"")[wt[1]],a=i("defaultNumberingSystem",n),s=w()?i("numberSymbols",n):i("symbols-numberSystem-"+a,n),l=e.IntlBase.getSymbolPattern(r||"decimal",a,n,!1);return u(s,e.IntlBase.getFormatData(l,!0,"",!0),{dateSeparator:e.IntlBase.getDateSeparator(o)})}function R(t,r){var n=e.IntlBase.getDependables(Dt,t,"",!0);return e.IntlBase.getCurrencySymbol(n.numericObject,r)}function I(t){return e.IntlBase.getDependables(Dt,"",t,!1)[wt[1]]}function H(e,t,r){var n='var str="'+L(e,"data",t,r)+'"; return str;';return new Function("data",n).bind(t)}function L(e,t,r,n){var i=0,o=[],a=e.match(/class="([^\"]+|)\s{2}/g),s="";return a&&a.forEach(function(t){s=t.replace(/\s\s+/g," "),e=e.replace(t,s)}),e.replace(Ft,"").replace(Yt,"'$1'").replace(Xt,function(e,a,s,l){var c=/\@|\#|\$/gm,u=a.match(Bt);if(u){var p=u[1];if(It.test(a))a='";} '+a.replace(u[1],p.replace(zt,function(e){return e=e.trim(),k(e,!At.test(e)&&-1===o.indexOf(e),t,o,n)}))+'{ \n str = str + "';else if(Rt.test(a))a='"; '+a.replace(u[1],p.replace(_t,function(e){return Y(e,t,o,n)}))+'{ \n str = str + "';else if(Lt.test(a)){var h=u[1].split(" of ");a='"; '+a.replace(u[1],function(e){return o.push(h[0]),o.push(h[0]+"Index"),"var i"+(i+=1)+"=0; i"+i+" < "+k(h[1],!0,t,o,n)+".length; i"+i+"++"})+"{ \n "+h[0]+"= "+k(h[1],!0,t,o,n)+"[i"+i+"]; \n var "+h[0]+"Index=i"+i+'; \n str = str + "'}else{var d=a.split("("),m=r&&r.hasOwnProperty(d[0])?"this.":"global";m=/\./.test(d[0])?"":m;var f=u[1].split(",");0===u[1].length||/data/.test(f[0])||/window./.test(f[0])||(u[1]="global"===m?t+"."+u[1]:u[1]);var g=/\@|\$|\#/gm,v=/\]\./gm;Kt.test(a)&&v.test(a)||g.test(a)?/\@|\$|\#|\]\./gm.test(a)&&(a='"+ '+("global"===m?"":m)+a.replace(u[1],p.replace(Ut,function(e){return Y(e,t,o,n)}))+'+ "'):a='" + '+("global"===m?"":m)+a.replace(p,k(u[1].replace(/,( |)data.|,/gi,","+t+".").replace(/,( |)data.window/gi,",window"),"global"!==m,t,o,n))+'+"'}}else Ht.test(a)?a='"; '+a.replace(Ht,'} else { \n str = str + "'):a.match(kt)?a=a.replace(kt,'"; \n } \n str = str + "'):c.test(a)?(a.match($t)&&(a=z(a)),a='"+'+G(a,-1===o.indexOf(a),t,o)+'"]+"'):a=a.match($t)?'"+'+G(a=z(a),-1===o.indexOf(a),t,o)+'"]+"':'"+'+k(a.replace(/\,/gi,"+"+t+"."),-1===o.indexOf(a),t,o,n)+'+"';return a})}function k(e,t,r,n,i){return!t||Gt.test(e)||-1!==n.indexOf(e.split(".")[0])||i?e:r+"."+e}function B(e,t,r,n){var i=/^\..*/gm;return!t||Gt.test(e)||-1!==n.indexOf(e.split(".")[0])||i.test(e)?e:r+"."+e}function G(e,t,r,n){return t&&!Gt.test(e)&&-1===n.indexOf(e.split(".")[0])?r+'["'+e:e}function z(e){return e=e.match(Vt)?e:e.replace($t,"\\\\")}function Y(e,t,r,n){if(e=e.trim(),/\window\./gm.test(e))return e;var i=/'|"/gm;return/\@|\$|\#/gm.test(e)&&(e=G(e,-1===r.indexOf(e),t,r)+'"]'),Wt.test(e)?B(e,!i.test(e)&&-1===r.indexOf(e),t,r):k(e,!i.test(e)&&-1===r.indexOf(e),t,r,n)}function _(){return"-"+Math.random().toString(36).substr(2,5)}function X(e,t,r){var n=Qt.compile(e,t,r);return function(e,t,r,i,o,a,s){var l=n(e,t,r,s);if(w()&&!o){var c=i+_();if(Jt[i]||(Jt[i]=[]),p(a))e.BlazorTemplateId=c,Jt[i].push(e);else for(var u=0,h=Object.keys(Jt[i][a]);u<h.length;u++){var d=h[u];"BlazorTemplateId"!==d&&e[d]&&(Jt[i][a][d]=e[d]),"BlazorTemplateId"===d&&(c=Jt[i][a][d])}return"rowTemplate"===r?[K("tr",{id:c,className:"e-blazor-template"})]:[K("div",{id:c,className:"e-blazor-template"})]}if("string"==typeof l){if(Zt.test(l))return(m=K("svg",{innerHTML:l})).childNodes;var m=K(qt.test(l)?"table":"div",{innerHTML:l});return m.childNodes}return l}}function W(e,t,r,n,i){if(w()){window.sfBlazor.updateTemplate(t,Jt[e],e,r,i),!1!==n&&(Jt[e]=[])}}function $(e,t,r){var n=document.getElementById(e);if(n)for(var i=n.getElementsByClassName("blazor-inner-template"),o=0;o<i.length;o++){var a=" ";a=p(r)?i[o].getAttribute("data-templateId"):i[r].getAttribute("data-templateId");var s=document.getElementById(a);if(s)for(var l=s.childNodes.length,c=0;c<l;c++)p(r)?i[o].appendChild(s.childNodes[0]):(i[r].appendChild(s.childNodes[0]),o=i.length)}}function V(e){Qt.compile=e.compile}function U(){return Qt.compile}function K(e,t){var r=gr.test(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return void 0===t?r:(r.innerHTML=t.innerHTML?t.innerHTML:"",void 0!==t.className&&(r.className=t.className),void 0!==t.id&&(r.id=t.id),void 0!==t.styles&&r.setAttribute("style",t.styles),void 0!==t.attrs&&oe(r,t.attrs),r)}function q(e,t){for(var r=J(t),n=0,a=e;n<a.length;n++)for(var l=a[n],c=0,u=r;c<u.length;c++){var h=u[c];if(s(l)){var d=i("attributes.className",l);p(d)?o("attributes.className",h,l):new RegExp("\\b"+h+"\\b","i").test(d)||o("attributes.className",d+" "+h,l)}else l.classList.contains(h)||l.classList.add(h)}return e}function Z(e,t){for(var r=J(t),n=0,a=e;n<a.length;n++){var l=a[n],c=s(l);if(c?i("attributes.className",l):""!==l.className)for(var u=0,p=r;u<p.length;u++){var h=p[u];if(c){var d=i("attributes.className",l).split(" "),m=d.indexOf(h);-1!==m&&d.splice(m,1),o("attributes.className",d.join(" "),l)}else l.classList.remove(h)}}return e}function J(e){var t=[];return"string"==typeof e?t.push(e):t=e,t}function Q(e){var t=e;return""===t.style.visibility&&t.offsetWidth>0}function ee(e,t,r){if(s(t))jt.prepend(e,t);else{for(var n=document.createDocumentFragment(),i=0,o=e;i<o.length;i++){var a=o[i];n.appendChild(a)}t.insertBefore(n,t.firstElementChild),r&&re(t)}return e}function te(e,t,r){if(s(t))jt.append(e,t);else{for(var n=document.createDocumentFragment(),i=0,o=e;i<o.length;i++){var a=o[i];n.appendChild(a)}t.appendChild(n),r&&re(t)}return e}function re(e){e.querySelectorAll("script").forEach(function(e){var t=document.createElement("script");t.text=e.innerHTML,document.head.appendChild(t),ne(t)})}function ne(e){if(s(e))return jt.detach(e);var t=e.parentNode;return t?t.removeChild(e):void 0}function ie(e){if(s(e))jt.detach(e);else{var t=e.parentNode;Nt.clearEvents(e),t.removeChild(e)}}function oe(e,t){for(var r=e,n=0,i=Object.keys(t);n<i.length;n++){var o=i[n];if(s(r)){var a=o;"tabindex"===o&&(a="tabIndex"),r.attributes[a]=t[o]}else r.setAttribute(o,t[o])}return r}function ae(e,t,r){return void 0===t&&(t=document),s(t)&&r?jt.vDomSelector({ele:t,selector:e,selectAll:!1}):(e=le(e),t.querySelector(e))}function se(e,t,r){return void 0===t&&(t=document),s(t)&&!r?jt.vDomSelector({ele:t,selector:e,selectAll:!0}):(e=le(e),t.querySelectorAll(e))}function le(e){var t=/(!|"|\$|%|&|'|\(|\)|\*|\/|:|;|<|=|\?|@|\]|\^|`|{|}|\||\+|~)/g;if(e.match(/#[0-9]/g)||e.match(t)){for(var r=e.split(","),n=0;n<r.length;n++){for(var i=r[n].split(" "),o=0;o<i.length;o++)if(i[o].indexOf("#")>-1&&!i[o].match(/\[.*\]/)){var a=i[o].split("#");if(a[1].match(/^\d/)||a[1].match(t)){var s=i[o].split(".");s[0]=s[0].replace(/#/,"[id='")+"']",i[o]=s.join(".")}}r[n]=i.join(" ")}return r.join(",")}return e}function ce(e,t){var r=e;if("function"==typeof r.closest)return r.closest(t);for(;r&&1===r.nodeType;){if(me(r,t))return r;r=r.parentNode}return null}function ue(e){for(var t=[],r=0,n=Array.prototype.slice.call(e.parentNode.childNodes);r<n.length;r++){var i=n[r];i.nodeType===Node.ELEMENT_NODE&&e!==i&&t.push(i)}return t}function pe(e,t,r){var n,o=s(e);return n=o?i("attributes."+t,e):e.getAttribute(t),p(n)&&r&&(o?e.attributes[t]=r:e.setAttribute(t,r.toString()),n=r),n}function he(e,t){void 0!==t&&(s(e)?jt.setStyleAttribute(e,t):Object.keys(t).forEach(function(r){e.style[r]=t[r]}))}function de(e,t,r){q([e],t),Z([e],r)}function me(e,t){var r=e.matches||e.msMatchesSelector||e.webkitMatchesSelector;return r?r.call(e,t):-1!==[].indexOf.call(document.querySelectorAll(t),e)}function fe(e,t){if(s(e))if(""===t)e.children=[];else{var r=jt.ConvertHTMLToJSon(t);r.length&&(jt.assignParent(r,e),e.children=r)}else e.innerHTML=t}function ge(e,t){return s(e)?new RegExp("\\b"+t+"\\b","i").test(e.attributes.className):e.classList.contains(t)}function ve(e,t){return s(e)?t?u({},{},e,!0):{tagName:e.tagName,attributes:e.attributes}:e.cloneNode(t)}function ye(e,t){var r,n,i="string"==typeof e?document.getElementById(e):e;for(n=0;n<i.ej2_instances.length;n++)if(r=i.ej2_instances[n],"string"==typeof t){if(t===r.getModuleName())return r}else if(r instanceof t)return r}function be(e){for(var t=[].slice.call(e.getElementsByClassName("e-control")),r=0;r<t.length;r++){var n=t[r].classList[1].split("e-")[1],i=ye(t[r],n);h(i)||i.destroy()}}function Me(e,t,n,i){return e.properties.hasOwnProperty(t)&&e.properties[t]instanceof i||(e.properties[t]=r(i,[e,t,n])),e.properties[t]}function De(e,t,n,i,o,a){for(var s=[],l=n?n.length:0,c=0;c<l;c++){var u=i;if(a&&(u=i(n[c],e)),o){var p=r(u,[e,t,{},!0]);p.setProperties(n[c],!0),s.push(p)}else s.push(r(u,[e,t,n[c],!1]))}return s}function we(e,t){return function(){return this.properties.hasOwnProperty(t)||(this.properties[t]=e),this.properties[t]}}function Ee(e,t){return function(r){if(this.properties[t]!==r){var n=this.properties.hasOwnProperty(t)?this.properties[t]:e;this.saveChanges(t,r,n),this.properties[t]=r}}}function Pe(e,t,r){return function(){return Me(this,t,e,r)}}function Se(e,t,r){return function(n){Me(this,t,e,r).setProperties(n)}}function Oe(e,t,r){return function(){var n=r({});return this.properties.hasOwnProperty(t)?this.properties[t]:Me(this,t,e,n)}}function Ce(e,t,r){return function(n){var i=r(n,this);Me(this,t,e,i).setProperties(n)}}function Te(e,t,r){return function(){var n=this;if(!this.properties.hasOwnProperty(t)){var i=De(this,t,e,r,!1);this.properties[t]=i}var o=void 0!==this.controlParent&&this.controlParent.ignoreCollectionWatch||this.ignoreCollectionWatch;return this.properties[t].hasOwnProperty("push")||o||["push","pop"].forEach(function(e){var i={value:Fe(e,t,r,n.properties[t]).bind(n),configurable:!0};Object.defineProperty(n.properties[t],e,i)}),this.properties[t].hasOwnProperty("isComplexArray")||Object.defineProperty(this.properties[t],"isComplexArray",{value:!0}),this.properties[t]}}function je(e,t,r){return function(n){this.isComplexArraySetter=!0;var i=De(this,t,e,r,!1),o=De(this,t,n,r,!0);this.isComplexArraySetter=!1,this.saveChanges(t,o,i),this.properties[t]=o}}function xe(e,t,r){return function(n){var i=this.properties.hasOwnProperty(t)?this.properties[t]:e,o=De(this,t,n,r,!0,!0);this.saveChanges(t,o,i),this.properties[t]=o}}function Ne(e,t,r){return function(){var n=r({});if(!this.properties.hasOwnProperty(t)){var i=De(this,t,e,n,!1);this.properties[t]=i}return this.properties[t]}}function Fe(e,t,r,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=this.propName?this.getParentKey()+"."+t+"-":t+"-";switch(e){case"push":for(var a=0;a<r.length;a++){Array.prototype[e].apply(n,[r[a]]);var s=Ae(o+(n.length-1),r[a],!this.controlParent,e);this.serverDataBind(s,r[a],!1,e)}break;case"pop":Array.prototype[e].apply(n);var l=Ae(o+n.length,null,!this.controlParent,e);this.serverDataBind(l,{ejsAction:"pop"},!1,e)}return n}}function Ae(e,t,r,n){var i=e;if(r&&(i={},i[e]=t,t&&"object"==typeof t)){i[e].ejsAction=n}return i}function Re(e){return function(t,r){var n={set:Ee(e,r),get:we(e,r),enumerable:!0,configurable:!0};Object.defineProperty(t,r,n),ze(t,r,"prop",e)}}function Ie(e,t){return function(r,n){var i={set:Se(e,n,t),get:Pe(e,n,t),enumerable:!0,configurable:!0};Object.defineProperty(r,n,i),ze(r,n,"complexProp",e,t)}}function He(e){return function(t,r){var n={set:Ce({},r,e),get:Oe({},r,e),enumerable:!0,configurable:!0};Object.defineProperty(t,r,n),ze(t,r,"complexProp",{},e)}}function Le(e,t){return function(r,n){var i={set:je(e,n,t),get:Te(e,n,t),enumerable:!0,configurable:!0};Object.defineProperty(r,n,i),ze(r,n,"colProp",e,t)}}function ke(e){return function(t,r){var n={set:xe([],r,e),get:Ne([],r,e),enumerable:!0,configurable:!0};Object.defineProperty(t,r,n),ze(t,r,"colProp",{},e)}}function Be(){return function(e,t){var r={set:function(e){var r=this.properties[t];if(r!==e){var n=Xe(this,t);!1===h(r)&&n.context.removeEventListener(n.prefix,r),n.context.addEventListener(n.prefix,e),this.properties[t]=e}},get:we(void 0,t),enumerable:!0,configurable:!0};Object.defineProperty(e,t,r),ze(e,t,"event")}}function Ge(e){}function ze(e,t,r,n,i){h(e.propList)&&(e.propList={props:[],complexProps:[],colProps:[],events:[],propNames:[],complexPropNames:[],colPropNames:[],eventNames:[]}),e.propList[r+"s"].push({propertyName:t,defaultValue:n,type:i}),e.propList[r+"Names"].push(t)}function Ye(e){if(h(e.prototype.builderObject)){e.prototype.builderObject={properties:{},propCollections:[],add:function(){this.isPropertyArray=!0,this.propCollections.push(u({},this.properties,{}))}};for(var t=/complex/,r=0,n=Object.keys(e.prototype.propList);r<n.length;r++)for(var i=n[r],o=0,a=e.prototype.propList[i];o<a.length;o++)!function(r){t.test(i)?e.prototype.builderObject[r.propertyName]=function(e){var t={};c(t,Ye(r.type)),e(t);var n;return n=t.isPropertyArray?t.propCollections:u({},t.properties,{}),this.properties[r.propertyName]=n,t.properties={},t.propCollections=[],t.isPropertyArray=!1,this}:e.prototype.builderObject[r.propertyName]=function(e){return this.properties[r.propertyName]=e,this}}(a[o])}return e.prototype.builderObject}function _e(e){var t=function(e){return this.element=e,this};return function(r){return t.prototype.hasOwnProperty("create")||((t.prototype=Ye(e)).create=function(){var t=u({},{},this.properties);return this.properties={},new e(t,this.element)}),new t(r)}}function Xe(e,t){if(!1===e.hasOwnProperty("parentObj"))return{context:e,prefix:t};var r=i("propName",e);return r&&(t=r+"-"+t),Xe(i("parentObj",e),t)}function We(t,r,n){var i=$e(r);return!1===i.rippleFlag||void 0===i.rippleFlag&&!e.isRippleEnabled?Function:(t.setAttribute("data-ripple","true"),Nt.add(t,"mousedown",Ve,{parent:t,rippleOptions:i}),Nt.add(t,"mouseup",Ue,{parent:t,rippleOptions:i,done:n}),Nt.add(t,"mouseleave",Ke,{parent:t,rippleOptions:i}),xt.isPointer&&Nt.add(t,"transitionend",Ke,{parent:t,rippleOptions:i}),function(){t.removeAttribute("data-ripple"),Nt.remove(t,"mousedown",Ve),Nt.remove(t,"mouseup",Ue),Nt.remove(t,"mouseleave",Ke),Nt.remove(t,"transitionend",Ke)})}function $e(e){return{selector:e&&e.selector?e.selector:null,ignore:e&&e.ignore?e.ignore:null,rippleFlag:e&&e.rippleFlag,isCenterRipple:e&&e.isCenterRipple,duration:e&&e.duration?e.duration:350}}function Ve(e){var t=e.target,r=this.rippleOptions.selector,n=r?ce(t,r):t;if(!(!n||this.rippleOptions&&ce(t,this.rippleOptions.ignore))){var i=n.getBoundingClientRect(),o=e.pageX-document.body.scrollLeft,a=e.pageY-(!document.body.scrollTop&&document.documentElement?document.documentElement.scrollTop:document.body.scrollTop),s=Math.max(Math.abs(o-i.left),Math.abs(o-i.right)),l=Math.max(Math.abs(a-i.top),Math.abs(a-i.bottom)),c=Math.sqrt(s*s+l*l),u=2*c+"px",p=o-i.left-c,h=a-i.top-c;this.rippleOptions&&this.rippleOptions.isCenterRipple&&(p=0,h=0,u="100%"),n.classList.add("e-ripple");var d=K("div",{className:"e-ripple-element",styles:"width: "+u+";height: "+u+";left: "+p+"px;top: "+h+"px;transition-duration: "+this.rippleOptions.duration.toString()+"ms;"});n.appendChild(d),window.getComputedStyle(d).getPropertyValue("opacity"),d.style.transform="scale(1)",n!==this.parent&&Nt.add(n,"mouseleave",Ke,{parent:this.parent,rippleOptions:this.rippleOptions})}}function Ue(e){qe(e,this)}function Ke(e){qe(e,this)}function qe(e,t){var r=t.rippleOptions.duration,n=e.target,i=t.rippleOptions.selector,o=i?ce(n,i):n;if(o&&(!o||-1!==o.className.indexOf("e-ripple"))){var a=se(".e-ripple-element",o),s=a[a.length-1];s&&(s.style.opacity="0.5"),t.parent!==o&&Nt.remove(o,"mouseleave",Ke),setTimeout(function(){s&&s.parentNode&&s.parentNode.removeChild(s),o.getElementsByClassName("e-ripple-element").length||o.classList.remove("e-ripple"),t.done&&t.done(e)},r)}}function Ze(t){return e.isRippleEnabled=t,e.isRippleEnabled}function Je(t){e.versionBasedStatePersistence=t}var Qe="ej2_instances",et=0,tt=!1,rt={latn:{_digits:"0123456789",_type:"numeric"}},nt={decimal:".",group:",",percentSign:"%",plusSign:"+",minusSign:"-",infinity:"∞",nan:"NaN",exponential:"E"},it=[0,1,2,3,4,5,6,7,8,9],ot=function(){function e(){}return e.getMainObject=function(e,t){return i(w()?t:"main."+t,e)},e.getNumberingSystem=function(e){return i("supplemental.numberingSystems",e)||this.numberingSystems},e.reverseObject=function(e,t){for(var r={},n=0,i=t||Object.keys(e);n<i.length;n++){var o=i[n];r.hasOwnProperty(e[o])||(r[e[o]]=o)}return r},e.getSymbolRegex=function(e){var t=e.map(function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}).join("|");return new RegExp(t,"g")},e.getSymbolMatch=function(e){for(var t={},r=0,n=Object.keys(nt);r<n.length;r++){var i=n[r];t[e[i]]=nt[i]}return t},e.constructRegex=function(e){for(var t=e.length,r="",n=0;n<t;n++)r+=n!==t-1?e[n]+"|":e[n];return r},e.convertValueParts=function(e,t,r){return e.replace(t,function(e){return r[e]})},e.getDefaultNumberingSystem=function(e){var t={};return t.obj=i("numbers",e),t.nSystem=i("defaultNumberingSystem",t.obj),t},e.getCurrentNumericOptions=function(e,t,r,n){var o={},a=this.getDefaultNumberingSystem(e);if(!h(a.nSystem)||n){var s=n?i("obj.mapperDigits",a):i(a.nSystem+"._digits",t);h(s)||(o.numericPair=this.reverseObject(s,it),o.numberParseRegex=new RegExp(this.constructRegex(s),"g"),o.numericRegex="["+s[0]+"-"+s[9]+"]",r&&(o.numericRegex=s[0]+"-"+s[9],o.symbolNumberSystem=i(n?"numberSymbols":"symbols-numberSystem-"+a.nSystem,a.obj),o.symbolMatch=this.getSymbolMatch(o.symbolNumberSystem),o.numberSystem=a.nSystem))}return o},e.getNumberMapper=function(e,t,r){var n={mapper:{}},o=this.getDefaultNumberingSystem(e);if(!h(o.nSystem)){n.numberSystem=o.nSystem,n.numberSymbols=i("symbols-numberSystem-"+o.nSystem,o.obj),n.timeSeparator=i("timeSeparator",n.numberSymbols);var a=i(o.nSystem+"._digits",t);if(!h(a))for(var s=0,l=it;s<l.length;s++){var c=l[s];n.mapper[c]=a[c]}}return n},e.nPair="numericPair",e.nRegex="numericRegex",e.numberingSystems=rt,e}(),at={DJF:"Fdj",ERN:"Nfk",ETB:"Br",NAD:"$",ZAR:"R",XAF:"FCFA",GHS:"GH₵",XDR:"XDR",AED:"د.إ.",BHD:"د.ب.",DZD:"د.ج.",EGP:"ج.م.",ILS:"₪",IQD:"د.ع.",JOD:"د.ا.",KMF:"CF",KWD:"د.ك.",LBP:"ل.ل.",LYD:"د.ل.",MAD:"د.م.",MRU:"أ.م.",OMR:"ر.ع.",QAR:"ر.ق.",SAR:"ر.س.",SDG:"ج.س.",SOS:"S",SSP:"£",SYP:"ل.س.",TND:"د.ت.",YER:"ر.ي.",CLP:"$",INR:"₹",TZS:"TSh",EUR:"€",AZN:"₼",RUB:"₽",BYN:"Br",ZMW:"K",BGN:"лв.",NGN:"₦",XOF:"CFA",BDT:"৳",CNY:"¥",BAM:"КМ",UGX:"USh",USD:"$",CZK:"Kč",GBP:"£",DKK:"kr.",KES:"Ksh",CHF:"CHF",MVR:"ރ.",BTN:"Nu.",XCD:"EC$",AUD:"$",BBD:"$",BIF:"FBu",BMD:"$",BSD:"$",BWP:"P",BZD:"$",CAD:"$",NZD:"$",FJD:"$",FKP:"£",GIP:"£",GMD:"D",GYD:"$",HKD:"$",IDR:"Rp",JMD:"$",KYD:"$",LRD:"$",MGA:"Ar",MOP:"MOP$",MUR:"Rs",MWK:"MK",MYR:"RM",PGK:"K",PHP:"₱",PKR:"Rs",RWF:"RF",SBD:"$",SCR:"SR",SEK:"kr",SGD:"$",SHP:"£",SLL:"Le",ANG:"NAf.",SZL:"E",TOP:"T$",TTD:"$",VUV:"VT",WST:"WS$",ARS:"$",BOB:"Bs",BRL:"R$",COP:"$",CRC:"₡",CUP:"$",DOP:"$",GTQ:"Q",HNL:"L",MXN:"$",NIO:"C$",PAB:"B/.",PEN:"S/",PYG:"₲",UYU:"$",VES:"Bs.S",IRR:"ريال",GNF:"FG",CDF:"FC",HTG:"G",XPF:"FCFP",HRK:"kn",HUF:"Ft",AMD:"֏",ISK:"kr",JPY:"¥",GEL:"₾",CVE:"",KZT:"₸",KHR:"៛",KPW:"₩",KRW:"₩",KGS:"сом",AOA:"Kz",LAK:"₭",MZN:"MTn",MKD:"ден",MNT:"₮",BND:"$",MMK:"K",NOK:"kr",NPR:"रु",AWG:"Afl.",SRD:"$",PLN:"zł",AFN:"؋",STN:"Db",MDL:"L",RON:"lei",UAH:"₴",LKR:"රු.",ALL:"Lekë",RSD:"дин.",TJS:"смн",THB:"฿",TMT:"m.",TRY:"₺",UZS:"сўм",VND:"₫",TWD:"NT$"};!function(e){function t(e){var t=e.getDate(),r=e.getMonth(),i=e.getFullYear(),o=r+1,a=i;o<3&&(a-=1,o+=12);var s=Math.floor(a/100),l=s-Math.floor(s/4)-2,c=Math.floor(365.25*(a+4716))+Math.floor(30.6001*(o+1))+t-l-1524,u=c+(l=(s=Math.floor((c-1867216.25)/36524.25))-Math.floor(s/4)+1)+1524,p=Math.floor((u-122.1)/365.25),h=Math.floor(365.25*p),d=Math.floor((u-h)/30.6001);t=u-h-Math.floor(30.6001*d),(r=Math.floor((u-h)/20.6001))>13&&(p+=1,r-=12),r-=1,i=p-4716;var m=c-24e5,f=c-1948084,g=Math.floor(f/10631);f-=10631*g;var v=Math.floor((f-.1335)/(10631/30)),y=30*g+v;f-=Math.floor(v*(10631/30)+.1335);var b=Math.floor((f+28.5001)/29.5);13===b&&(b=12);for(var M=f-Math.floor(29.5001*b-29),D=0;D<n.length&&!(n[D]>m);D++);var w=D+16260,E=Math.floor((w-1)/12),P=E+1,S=w-12*E,O=m-n[D-1]+1;return(O+"").length>2&&(O=M,S=b,P=y),{year:P,month:S,date:O}}function r(e,t,r){var i=r+n[12*(e-1)+1+(t-1)-16260-1]-1+24e5,o=Math.floor(i+.5),a=Math.floor((o-1867216.25)/36524.25),s=(a=o+1+a-Math.floor(a/4))+1524,l=Math.floor((s-122.1)/365.25),c=Math.floor(365.25*l),u=Math.floor((s-c)/30.6001),p=s-c-Math.floor(30.6001*u),h=u-(u>13.5?13:1),d=l-(h>2.5?4716:4715);return d<=0&&h--,new Date(d+"/"+h+"/"+p)}var n=[28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990];e.getHijriDate=t,e.toGregorian=r}(e.HijriParser||(e.HijriParser={}));var st=["sun","mon","tue","wed","thu","fri","sat"],lt={m:"getMinutes",h:"getHours",H:"getHours",s:"getSeconds",d:"getDate",f:"getMilliseconds"},ct={M:"month",d:"day",E:"weekday",c:"weekday",y:"year",m:"minute",h:"hour",H:"hour",s:"second",L:"month",a:"designator",z:"timeZone",Z:"timeZone",G:"era",f:"milliseconds"},ut=function(){function t(){}return t.dateFormat=function(t,r,n){var o=this,a=e.IntlBase.getDependables(n,t,r.calendar),s=i("parserObject.numbers",a),l=a.dateObject,c={isIslamic:e.IntlBase.islamicRegex.test(r.calendar)};w()&&r.isServerRendered&&(r=e.IntlBase.compareBlazorDateFormats(r,t));var p=r.format||e.IntlBase.getResultantPattern(r.skeleton,a.dateObject,r.type,!1,w()?t:"");if(c.dateSeperator=w()?i("dateSeperator",l):e.IntlBase.getDateSeparator(a.dateObject),h(p))y("Format options or type given must be invalid");else{p=e.IntlBase.ConvertDateToWeekFormat(p),w()&&(p=p.replace(/tt/,"a")),c.pattern=p,c.numMapper=w()?u({},s):ot.getNumberMapper(a.parserObject,ot.getNumberingSystem(n));for(var d=0,m=p.match(/\/MMMMM|MMMM|MMM|a|LLLL|LLL|EEEEE|EEEE|E|K|cccc|ccc|WW|W|G+|z+/gi)||[];d<m.length;d++){var f=m[d],g=f.length,v=f[0];switch("K"===v&&(v="h"),v){case"E":case"c":w()?c.weekday=i("days."+e.IntlBase.monthIndex[g],l):c.weekday=a.dateObject[e.IntlBase.days]["stand-alone"][e.IntlBase.monthIndex[g]];break;case"M":case"L":w()?c.month=i("months."+e.IntlBase.monthIndex[g],l):c.month=a.dateObject[e.IntlBase.month]["stand-alone"][e.IntlBase.monthIndex[g]];break;case"a":c.designator=w()?i("dayPeriods",l):i("dayPeriods.format.wide",l);break;case"G":var b=g<=3?"eraAbbr":4===g?"eraNames":"eraNarrow";c.era=w()?i("eras",l):i("eras."+b,a.dateObject);break;case"z":c.timeZone=i("dates.timeZoneNames",a.parserObject)}}}return function(e){return isNaN(e.getDate())?null:o.intDateFormatter(e,c)}},t.intDateFormatter=function(t,r){for(var n="",i=r.pattern.match(e.IntlBase.dateParseRegex),o=this.getCurrentDateValue(t,r.isIslamic),a=0,s=i;a<s.length;a++){var l=s[a],c=l.length,u=l[0];"K"===u&&(u="h");var h=void 0,d="",m=void 0,f=void 0,g="";switch(u){case"M":case"L":h=o.month,c>2?n+=r.month[h]:m=!0;break;case"E":case"c":n+=r.weekday[st[t.getDay()]];break;case"H":case"h":case"m":case"s":case"d":case"f":if(m=!0,"d"===u)h=o.date;else if("f"===u){m=!1,f=!0;var v=(d=(d=t[lt[u]]().toString()).substring(0,c)).length;if(c!==v){if(c>3)continue;for(var y=0;y<c-v;y++)d="0"+d.toString()}g+=d}else h=t[lt[u]]();"h"===u&&(h=h%12||12);break;case"y":f=!0,g+=o.year,2===c&&(g=g.substr(g.length-2));break;case"a":var b=t.getHours()<12?"am":"pm";n+=r.designator[b];break;case"G":var M=t.getFullYear()<0?0:1,D=r.era[M];p(D)&&(D=r.era[M?0:1]),n+=D||"";break;case"'":n+="''"===l?"'":l.replace(/\'/g,"");break;case"z":var w=t.getTimezoneOffset(),E=c<4?"+H;-H":r.timeZone.hourFormat;E=E.replace(/:/g,r.numMapper.timeSeparator),0===w?n+=r.timeZone.gmtZeroFormat:(f=!0,g=this.getTimeZoneValue(w,E)),g=r.timeZone.gmtFormat.replace(/\{0\}/,g);break;case":":n+=r.numMapper.numberSymbols.timeSeparator;break;case"/":n+=r.dateSeperator;break;case"W":m=!0,h=e.IntlBase.getWeekOfYear(t);break;default:n+=l}m&&(f=!0,g=this.checkTwodigitNumber(h,c)),f&&(n+=ot.convertValueParts(g,e.IntlBase.latnParseRegex,r.numMapper.mapper))}return n},t.getCurrentDateValue=function(t,r){return r?e.HijriParser.getHijriDate(t):{year:t.getFullYear(),month:t.getMonth()+1,date:t.getDate()}},t.checkTwodigitNumber=function(e,t){var r=e+"";return 2===t&&2!==r.length?"0"+r:r},t.getTimeZoneValue=function(e,t){var r=this,n=t.split(";")[e>0?1:0],i=Math.abs(e);return n=n.replace(/HH?|mm/g,function(e){var t=e.length,n=-1!==e.indexOf("H");return r.checkTwodigitNumber(Math.floor(n?i/60:i%60),t)})},t}(),pt={ms:"minimumSignificantDigits",ls:"maximumSignificantDigits",mf:"minimumFractionDigits",lf:"maximumFractionDigits"},ht=["infinity","nan","group","decimal","exponential"],dt=function(){function t(){}return t.numberFormatter=function(t,r,n){var o,a=this,s=u({},r),l={},c={},p=e.IntlBase.getDependables(n,t,"",!0),d=p.numericObject;c.numberMapper=w()?u({},d):ot.getNumberMapper(p.parserObject,ot.getNumberingSystem(n),!0),c.currencySymbol=w()?i("currencySymbol",d):e.IntlBase.getCurrencySymbol(p.numericObject,s.currency||e.defaultCurrencyCode,r.altSymbol),c.percentSymbol=w()?i("numberSymbols.percentSign",d):c.numberMapper.numberSymbols.percentSign,c.minusSymbol=w()?i("numberSymbols.minusSign",d):c.numberMapper.numberSymbols.minusSign;var m=c.numberMapper.numberSymbols;if(r.format&&!e.IntlBase.formatRegex.test(r.format))l=e.IntlBase.customFormat(r.format,c,p.numericObject);else{if(u(s,e.IntlBase.getProperNumericSkeleton(r.format||"N")),s.isCurrency="currency"===s.type,s.isPercent="percent"===s.type,w()||(o=e.IntlBase.getSymbolPattern(s.type,c.numberMapper.numberSystem,p.numericObject,s.isAccount)),s.groupOne=this.checkValueRange(s.maximumSignificantDigits,s.minimumSignificantDigits,!0),this.checkValueRange(s.maximumFractionDigits,s.minimumFractionDigits,!1,!0),h(s.fractionDigits)||(s.minimumFractionDigits=s.maximumFractionDigits=s.fractionDigits),h(s.useGrouping)&&(s.useGrouping=!0),s.isCurrency&&!w()&&(o=o.replace(/\u00A4/g,e.IntlBase.defaultCurrency)),w())l.nData=u({},{},i(s.type+"nData",d)),l.pData=u({},{},i(s.type+"pData",d)),"currency"===s.type&&r.currency&&e.IntlBase.replaceBlazorCurrency([l.pData,l.nData],c.currencySymbol,r.currency);else{var f=o.split(";");l.nData=e.IntlBase.getFormatData(f[1]||"-"+f[0],!0,c.currencySymbol),l.pData=e.IntlBase.getFormatData(f[0],!1,c.currencySymbol),s.useGrouping&&(s.groupSeparator=m[ht[2]],s.groupData=this.getGroupingDetails(f[0]))}if(h(s.minimumFractionDigits)&&(s.minimumFractionDigits=l.nData.minimumFraction),h(s.maximumFractionDigits)){var g=l.nData.maximumFraction;s.maximumFractionDigits=h(g)&&s.isPercent?0:g}var v=s.minimumFractionDigits,y=s.maximumFractionDigits;h(v)||h(y)||v>y&&(s.maximumFractionDigits=v)}return u(l.nData,s),u(l.pData,s),function(e){return isNaN(e)?m[ht[1]]:isFinite(e)?a.intNumberFormatter(e,l,c):m[ht[0]]}},t.getGroupingDetails=function(t){var r={},n=t.match(e.IntlBase.negativeDataRegex);if(n&&n[4]){var i=n[4],o=i.lastIndexOf(",");if(-1!==o){var a=i.split(".")[0];r.primary=a.length-o-1;var s=i.lastIndexOf(",",o-1);-1!==s&&(r.secondary=o-1-s)}}return r},t.checkValueRange=function(e,t,r,n){var i=n?"f":"s",o=0,a=pt["l"+i],s=pt["m"+i];if(h(e)||(this.checkRange(e,a,n),o++),h(t)||(this.checkRange(t,s,n),o++),2===o){if(!(e<t))return!0;y(s+"specified must be less than the"+a)}else r&&1===o&&y("Both"+s+"and"+s+"must be present");return!1},t.checkRange=function(e,t,r){var n=r?[0,20]:[1,21];(e<n[0]||e>n[1])&&y(t+"value must be within the range"+n[0]+"to"+n[1])},t.intNumberFormatter=function(t,r,n){var i;if(!h(r.nData.type)){t<0?(t*=-1,i=r.nData):i=0===t?r.zeroData||r.pData:r.pData;var o="";return i.isPercent&&(t*=100),i.groupOne?o=this.processSignificantDigits(t,i.minimumSignificantDigits,i.maximumSignificantDigits):(o=this.processFraction(t,i.minimumFractionDigits,i.maximumFractionDigits),i.minimumIntegerDigits&&(o=this.processMinimumIntegers(o,i.minimumIntegerDigits))),"scientific"===i.type&&(o=(o=t.toExponential(i.maximumFractionDigits)).replace("e",n.numberMapper.numberSymbols[ht[4]])),o=o.replace(".",n.numberMapper.numberSymbols[ht[3]]),i.useGrouping&&(o=this.groupNumbers(o,i.groupData.primary,i.groupSeparator||",",n.numberMapper.numberSymbols[ht[3]]||".",i.groupData.secondary)),o=ot.convertValueParts(o,e.IntlBase.latnParseRegex,n.numberMapper.mapper),"N/A"===i.nlead?i.nlead:i.nlead+o+i.nend}},t.processSignificantDigits=function(e,t,r){var n=e+"";return n.length<t?e.toPrecision(t):(n=e.toPrecision(r),+n+"")},t.groupNumbers=function(e,t,r,n,i){for(var o=!p(i)&&0!==i,a=e.split(n),s=a[0],l=s.length,c="";l>t;)c=s.slice(l-t,l)+(c.length?r+c:""),l-=t,o&&(t=i,o=!1);return a[0]=s.slice(0,l)+(c.length?r:"")+c,a.join(n)},t.processFraction=function(e,t,r){var n=(e+"").split(".")[1],i=n?n.length:0;if(t&&i<t){var o="";if(0!==i){o+=e;for(var a=0;a<t-i;a++)o+="0";return o}return o=e.toFixed(t),e.toFixed(t)}return!p(r)&&(i>r||0===r)?e.toFixed(r):e+""},t.processMinimumIntegers=function(e,t){var r=e.split("."),n=r[0],i=n.length;if(i<t){for(var o=0;o<t-i;o++)n="0"+n;r[0]=n}return r.join(".")},t}(),mt=/^[0-9]*$/,ft={minute:"setMinutes",hour:"setHours",second:"setSeconds",day:"setDate",month:"setMonth",milliseconds:"setMilliseconds"},gt=function(){function t(){}return t.dateParser=function(t,r,n){var o=this,a=e.IntlBase.getDependables(n,t,r.calendar),s=ot.getCurrentNumericOptions(a.parserObject,ot.getNumberingSystem(n),!1,w()),l={};w()&&r.isServerRendered&&(r=e.IntlBase.compareBlazorDateFormats(r,t));var c,u=r.format||e.IntlBase.getResultantPattern(r.skeleton,a.dateObject,r.type,!1,w()?t:""),d="";if(h(u))y("Format options or type given must be invalid");else{u=e.IntlBase.ConvertDateToWeekFormat(u),l={isIslamic:e.IntlBase.islamicRegex.test(r.calendar),pattern:u,evalposition:{},culture:t};for(var m=u.match(e.IntlBase.dateParseRegex)||[],f=m.length,g=0,v=0,b=!1,M=s.numericRegex,D=w()?a.parserObject.numbers:ot.getNumberMapper(a.parserObject,ot.getNumberingSystem(n)),E=0;E<f;E++){var P=m[E],S=P.length,O="K"===P[0]?"h":P[0],C=void 0,T=void 0,j=ct[O],x=2===S?"":"?";switch(b&&(g=v,b=!1),O){case"E":case"c":var N=void 0;N=w()?i("days."+e.IntlBase.monthIndex[S],a.dateObject):a.dateObject[e.IntlBase.days]["stand-alone"][e.IntlBase.monthIndex[S]];var F=ot.reverseObject(N);d+="("+Object.keys(F).join("|")+")";break;case"M":case"L":case"d":case"m":case"s":case"h":case"H":case"f":if(T=!0,("M"===O||"L"===O)&&S>2){var A=void 0;A=w()?i("months."+e.IntlBase.monthIndex[S],a.dateObject):a.dateObject.months["stand-alone"][e.IntlBase.monthIndex[S]],l[j]=ot.reverseObject(A),d+="("+Object.keys(l[j]).join("|")+")"}else if("f"===O){if(S>3)continue;C=!0,d+="("+M+M+"?"+M+"?)"}else C=!0,d+="("+M+M+x+")";"h"===O&&(l.hour12=!0);break;case"W":d+="("+M+(1===S?"?":"")+M+")";break;case"y":T=C=!0,d+=2===S?"("+M+M+")":"("+M+"{"+S+",})";break;case"a":T=!0;var R=w()?i("dayPeriods",a.dateObject):i("dayPeriods.format.wide",a.dateObject);l[j]=ot.reverseObject(R),d+="("+Object.keys(l[j]).join("|")+")";break;case"G":T=!0;var I=S<=3?"eraAbbr":4===S?"eraNames":"eraNarrow";l[j]=ot.reverseObject(w()?i("eras",a.dateObject):i("eras."+I,a.dateObject)),d+="("+Object.keys(l[j]).join("|")+"?)";break;case"z":T=0!==(new Date).getTimezoneOffset(),l[j]=i("dates.timeZoneNames",a.parserObject);var H=l[j],L=(c=S<4)?"+H;-H":H.hourFormat;L=L.replace(/:/g,D.timeSeparator),d+="("+this.parseTimeZoneRegx(L,H,M)+")?",b=!0,v=c?6:12;break;case"'":d+="("+P.replace(/\'/g,"")+")?";break;default:d+="([\\D])"}T&&(l.evalposition[j]={isNumber:C,pos:E+1+g,hourOnly:c}),E!==f-1||p(d)||(l.parserRegex=new RegExp("^"+d+"$","i"))}}return function(t){var r=o.internalDateParse(t,l,s);if(p(r)||!Object.keys(r).length)return null;if(l.isIslamic){var n={},i=r.year,a=r.day,c=r.month,u=i?i+"":"",h=2===u.length;i&&c&&a&&!h||(n=e.HijriParser.getHijriDate(new Date)),h&&(i=parseInt((n.year+"").slice(0,2)+u,10));var d=e.HijriParser.toGregorian(i||n.year,c||n.month,a||n.date);r.year=d.getFullYear(),r.month=d.getMonth()+1,r.day=d.getDate()}return o.getDateObject(r)}},t.getDateObject=function(e,t){var r=t||new Date;r.setMilliseconds(0);var n=["hour","minute","second","milliseconds","month","day"],i=e.year,o=e.designator,a=e.timeZone;h(i)||((i+"").length<=2&&(i+=100*Math.floor(r.getFullYear()/100)),r.setFullYear(i));for(var s=0,l=n;s<l.length;s++){var c=l[s],u=e[c];if(h(u)&&"day"===c&&r.setDate(1),!h(u))if("month"===c){if((u-=1)<0||u>11)return new Date("invalid");var p=r.getDate();r.setDate(1),r[ft[c]](u);var d=new Date(r.getFullYear(),u+1,0).getDate();r.setDate(p<d?p:d)}else{if("day"===c){var m=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();if(u<1||u>m)return null}r[ft[c]](u)}}if(!h(o)){var f=r.getHours();"pm"===o?r.setHours(f+(12===f?0:12)):12===f&&r.setHours(0)}if(!h(a)){var g=a-r.getTimezoneOffset();0!==g&&r.setMinutes(r.getMinutes()+g)}return r},t.internalDateParse=function(e,t,r){var n=e.match(t.parserRegex),i={hour:0,minute:0,second:0};r.numericRegex;if(p(n))return null;for(var o=0,a=Object.keys(t.evalposition);o<a.length;o++){var s=a[o],l=t.evalposition[s],c=n[l.pos];if(l.isNumber)i[s]=this.internalNumberParser(c,r);else if("timeZone"!==s||h(c))c="month"!==s||t.isIslamic||"en"!==t.culture&&"en-GB"!==t.culture&&"en-US"!==t.culture?c:c[0].toUpperCase()+c.substring(1).toLowerCase(),i[s]=t[s][c];else{var u=l.pos,d=void 0,m=n[u+1],f=!h(m);l.hourOnly?d=60*this.getZoneValue(f,m,n[u+4],r):(d=60*this.getZoneValue(f,m,n[u+7],r),d+=this.getZoneValue(f,n[u+4],n[u+10],r)),p(d)||(i[s]=d)}}return t.hour12&&(i.hour12=!0),i},t.internalNumberParser=function(e,t){return e=ot.convertValueParts(e,t.numberParseRegex,t.numericPair),mt.test(e)?+e:null},t.parseTimeZoneRegx=function(e,t,r){var n,i,o=t.gmtFormat,a="("+r+")("+r+")";return n=e.replace("+","\\+"),n=-1!==e.indexOf("HH")?n.replace(/HH|mm/g,"("+a+")"):n.replace(/H|m/g,"("+a+"?)"),i=n.split(";").map(function(e){return o.replace("{0}",e)}),n=i.join("|")+"|"+t.gmtZeroFormat},t.getZoneValue=function(e,t,r,n){var i=e?t:r;if(!i)return 0;var o=this.internalNumberParser(i,n);return e?-o:o},t}(),vt=["minusSign","infinity"],yt=function(){function t(){}return t.numberParser=function(t,r,n){var o,a=this,s=e.IntlBase.getDependables(n,t,"",!0),l={custom:!0};e.IntlBase.formatRegex.test(r.format)||!r.format?(u(l,e.IntlBase.getProperNumericSkeleton(r.format||"N")),l.custom=!1,l.fractionDigits||r.maximumFractionDigits&&(l.maximumFractionDigits=r.maximumFractionDigits)):u(l,e.IntlBase.customFormat(r.format,null,null));var c=i("numbers",s.parserObject);o=ot.getCurrentNumericOptions(s.parserObject,ot.getNumberingSystem(n),!0,w()),l.symbolRegex=ot.getSymbolRegex(Object.keys(o.symbolMatch)),l.infinity=o.symbolNumberSystem[vt[1]];var p;if(w())l.nData=u({},{},i(l.type+"nData",c)),l.pData=u({},{},i(l.type+"pData",c)),"currency"===l.type&&r.currency&&e.IntlBase.replaceBlazorCurrency([l.pData,l.nData],i("currencySymbol",c),r.currency);else if(p=e.IntlBase.getSymbolPattern(l.type,o.numberSystem,s.numericObject,l.isAccount)){var h=(p=p.replace(/\u00A4/g,e.IntlBase.defaultCurrency)).split(";");l.nData=e.IntlBase.getFormatData(h[1]||"-"+h[0],!0,""),l.pData=e.IntlBase.getFormatData(h[0],!0,"")}return function(e){return a.getParsedNumber(e,l,o)}},t.getParsedNumber=function(e,t,r){var n,i,o,a,s,l;if(-1!==e.indexOf(t.infinity))return 1/0;e=ot.convertValueParts(e,t.symbolRegex,r.symbolMatch),0===(e=ot.convertValueParts(e,r.numberParseRegex,r.numericPair)).indexOf(".")&&(e="0"+e);var c=e.match(/^([^0-9]*)(([0-9,]*[0-9]+)(\.[0-9]+)?)([Ee][+-]?[0-9]+)?([^0-9]*)$/);if(p(c))return NaN;a=c[1],o=c[2];var u=c[5];return s=c[6],n=t.custom?a===t.nData.nlead&&s===t.nData.nend:-1!==a.indexOf(t.nData.nlead)&&-1!==s.indexOf(t.nData.nend),i=n?t.nData.isPercent:t.pData.isPercent,o=o.replace(/,/g,""),u&&(o+=u),l=+o,("percent"===t.type||i)&&(l/=100),(t.custom||t.fractionDigits)&&(l=parseFloat(l.toFixed(t.custom?n?t.nData.maximumFractionDigits:t.pData.maximumFractionDigits:t.fractionDigits))),t.maximumFractionDigits&&(l=this.convertMaxFracDigits(o,t,l,n)),n&&(l*=-1),l},t.convertMaxFracDigits=function(e,t,r,n){var i=e.split(".");return i[1]&&i[1].length>t.maximumFractionDigits&&(r=+r.toFixed(t.custom?n?t.nData.maximumFractionDigits:t.pData.maximumFractionDigits:t.maximumFractionDigits)),r},t}(),bt=function(){function e(e){this.ranArray=[],this.boundedEvents={},p(e)||(this.context=e)}return e.prototype.on=function(e,t,r,n){if(!p(t)){var i=r||this.context;if(this.notExist(e))return void(this.boundedEvents[e]=[{handler:t,context:i}]);p(n)?this.isHandlerPresent(this.boundedEvents[e],t)||this.boundedEvents[e].push({handler:t,context:i}):-1===this.ranArray.indexOf(n)&&(this.ranArray.push(n),this.boundedEvents[e].push({handler:t,context:i,id:n}))}},e.prototype.off=function(e,t,r){if(!this.notExist(e)){var n=i(e,this.boundedEvents);if(t){for(var o=0;o<n.length;o++)if(r){if(n[o].id===r){n.splice(o,1);var a=this.ranArray.indexOf(r);-1!==a&&this.ranArray.splice(a,1);break}}else if(t===n[o].handler){n.splice(o,1);break}}else delete this.boundedEvents[e]}},e.prototype.notify=function(e,t,r,n){if(this.notExist(e))return void(r&&r.call(this,t));t&&(t.name=e);var o=i(e,this.boundedEvents).slice(0);if(window.Blazor)return this.blazorCallback(o,t,r,n,0);for(var a=0,s=o;a<s.length;a++){var l=s[a];l.handler.call(l.context,t)}r&&r.call(this,t)},e.prototype.blazorCallback=function(e,t,r,n,i){var o=this,a=i===e.length-1;if(i<e.length){var s=e[i],l=s.handler.call(s.context,t);if(l&&"function"==typeof l.then){if(!r)return l;l.then(function(l){if(l="string"==typeof l&&o.isJson(l)?JSON.parse(l,o.dateReviver):l,u(t,t,l,!0),!r||!a)return o.blazorCallback(e,t,r,n,i+1);r.call(s.context,t)}).catch(function(e){n&&n.call(s.context,"string"==typeof e&&o.isJson(e)?JSON.parse(e,o.dateReviver):e)})}else{if(!r||!a)return this.blazorCallback(e,t,r,n,i+1);r.call(s.context,t)}}},e.prototype.dateReviver=function(e,t){return w&&"string"==typeof t&&null!==t.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/)?new Date(t):t},e.prototype.isJson=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},e.prototype.destroy=function(){this.boundedEvents=this.context=void 0},e.prototype.notExist=function(e){return!1===this.boundedEvents.hasOwnProperty(e)||this.boundedEvents[e].length<=0},e.prototype.isHandlerPresent=function(e,t){for(var r=0,n=e;r<n.length;r++)if(n[r].handler===t)return!0;return!1},e}(),Mt=new bt;e.rightToLeft=!1;var Dt={};e.defaultCulture="en-US",e.defaultCurrencyCode="USD";var wt=["numericObject","dateObject"],Et=function(){function t(e){e&&(this.culture=e)}return t.prototype.getDateFormat=function(e){return ut.dateFormat(this.getCulture(),e||{type:"date",skeleton:"short"},Dt)},t.prototype.getNumberFormat=function(t){return t&&!t.currency&&(t.currency=e.defaultCurrencyCode),w()&&t&&!t.format&&(t.minimumFractionDigits=0),dt.numberFormatter(this.getCulture(),t||{},Dt)},t.prototype.getDateParser=function(e){return gt.dateParser(this.getCulture(),e||{skeleton:"short",type:"date"},Dt)},t.prototype.getNumberParser=function(e){return w()&&e&&!e.format&&(e.minimumFractionDigits=0),yt.numberParser(this.getCulture(),e||{format:"N"},Dt)},t.prototype.formatNumber=function(e,t){return this.getNumberFormat(t)(e)},t.prototype.formatDate=function(e,t){return this.getDateFormat(t)(e)},t.prototype.parseDate=function(e,t){return this.getDateParser(t)(e)},t.prototype.parseNumber=function(e,t){return this.getNumberParser(t)(e)},t.prototype.getDatePattern=function(t,r){return e.IntlBase.getActualDateTimeFormat(this.getCulture(),t,Dt,r)},t.prototype.getNumberPattern=function(t,r){return e.IntlBase.getActualNumberFormat(this.getCulture(),t,Dt,r)},t.prototype.getFirstDayOfWeek=function(){return e.IntlBase.getWeekData(this.getCulture(),Dt)},t.prototype.getCulture=function(){return this.culture||e.defaultCulture},t}(),Pt={"en-US":{d:"M/d/y",D:"EEEE, MMMM d, y",f:"EEEE, MMMM d, y h:mm a",F:"EEEE, MMMM d, y h:mm:s a",g:"M/d/y h:mm a",G:"M/d/yyyy h:mm:ss tt",m:"MMMM d",M:"MMMM d",r:"ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",R:"ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"h:mm tt",T:"h:m:s tt",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",U:"dddd, MMMM d, yyyy h:mm:ss tt",y:"MMMM yyyy",Y:"MMMM yyyy"}};!function(t){function r(e,r,n,o,a){var l,c=n||"date";if(a)l=s({skeleton:e},a).format||s({skeleton:"d"},"en-US").format;else{if(-1!==t.basicPatterns.indexOf(e)){if(l=i(c+"Formats."+e,r),"dateTime"===c){var u=i("dateFormats."+e,r),p=i("timeFormats."+e,r);l=l.replace("{1}",u).replace("{0}",p)}}else l=i("dateTimeFormats.availableFormats."+e,r);h(l)&&"yMd"===e&&(l="M/d/y")}return l}function n(e,r,n,o){var a={},s=n||"gregorian";if(a.parserObject=ot.getMainObject(e,r)||(w()?t.blazorDefaultObject:t.defaultObject),o)a.numericObject=i("numbers",a.parserObject);else{var l=w()?"dates":"dates.calendars."+s;a.dateObject=i(l,a.parserObject)}return a}function o(e,t,r,n){return i(e+"Formats-numberSystem-"+t+(n?".accounting":".standard"),r)||(n?i(e+"Formats-numberSystem-"+t+".standard",r):"")}function a(e){var r=e.match(t.dateConverterMapper);if(r&&w()){var n=3===r[0].length?"EEE":"EEEE";return e.replace(t.dateConverterMapper,n)}return e}function s(e,t){var r=e.format||e.skeleton,n=i((t||"en-US")+"."+r,Pt);return n||(n=i("en-US."+r,Pt)),n&&(n=a(n),e.format=n.replace(/tt/,"a")),e}function l(e){var r=e.match(t.formatRegex),n={},i=r[1].toUpperCase();return n.isAccount="A"===i,n.type=t.patternMatcher[i],e.length>1&&(n.fractionDigits=parseInt(r[2],10)),n}function c(e,r,n,i){var o=i?{}:{nlead:"",nend:""},a=e.match(t.customRegex);if(a){i||(o.nlead=d(a[1],n),o.nend=d(a[10],n),o.groupPattern=a[4]);var s=a[7];if(s&&r){var l=s.match(x);p(l)?o.minimumFraction=0:o.minimumFraction=l.length,o.maximumFraction=s.length-1}}return o}function d(e,r){return e?e.replace(t.defaultCurrency,r):""}function m(e,t,r){return i("currencies."+t+(r?"."+r:".symbol"),e)||i("currencies."+t+".symbol-alt-narrow",e)||"$"}function f(e,t,r){for(var n={},i=e.split(";"),o=["pData","nData","zeroData"],a=0;a<i.length;a++)n[o[a]]=g(i[a],t,r);return p(n.nData)&&(n.nData=u({},n.pData),n.nData.nlead=p(t)?"-"+n.nData.nlead:t.minusSymbol+n.nData.nlead),n}function g(e,r,n){var i={type:"decimal",minimumFractionDigits:0,maximumFractionDigits:0},a=e.match(t.customRegex);if(p(a)||""===a[5]&&"N/A"!==e)return i.type=void 0,i;i.nlead=a[1],i.nend=a[10];var s=a[6];i.useGrouping=-1!==s.indexOf(","),s=s.replace(/,/g,"");var l=a[7];if(-1!==s.indexOf("0")&&(i.minimumIntegerDigits=s.length-s.indexOf("0")),p(l)||(i.minimumFractionDigits=l.lastIndexOf("0"),i.maximumFractionDigits=l.lastIndexOf("#"),-1===i.minimumFractionDigits&&(i.minimumFractionDigits=0),(-1===i.maximumFractionDigits||i.maximumFractionDigits<i.minimumFractionDigits)&&(i.maximumFractionDigits=i.minimumFractionDigits)),p(r)?u(i,v([i.nlead,i.nend],"%","%")):(u(i,v([i.nlead,i.nend],"$",r.currencySymbol)),i.isCurrency||u(i,v([i.nlead,i.nend],"%",r.percentSymbol))),!p(n)){var c=o(i.type,r.numberMapper.numberSystem,n,!1);i.useGrouping&&(i.groupSeparator=r.numberMapper.numberSymbols[N[2]],i.groupData=dt.getGroupingDetails(c.split(";")[0])),i.nlead=i.nlead.replace(/\'/g,""),i.nend=i.nend.replace(/\'/g,"")}return i}function v(e,t,r){for(var n={nlead:e[0],nend:e[1]},i=0;i<2;i++){var o=e[i],a=o.indexOf(t);if(-1!==a&&(a<o.indexOf("'")||a>o.lastIndexOf("'"))){n[H[i]]=o.substr(0,a)+r+o.substr(a+1),n[H[t]]=!0,n.type=n.isCurrency?"currency":"percent";break}}return n}function y(e){var t=(i("dateFormats.short",e)||"").match(/[dM]([^dM])[dM]/i);return t?t[1]:"/"}function b(e,t,o,a){var l=n(o,e,t.calendar);w()&&(t=s(t,e));var c=t.format||r(t.skeleton,l.dateObject,t.type);if(a){if(-1!==(c=c.replace(F,function(e){return A[e]})).indexOf("z")){var u=c.match(/z/g).length,p=void 0,h={timeZone:{}};h.numMapper=ot.getNumberMapper(l.parserObject,ot.getNumberingSystem(o)),h.timeZone=i("dates.timeZoneNames",l.parserObject);var d=(new Date).getTimezoneOffset(),m=u<4?"+H;-H":h.timeZone.hourFormat;m=m.replace(/:/g,h.numMapper.timeSeparator),0===d?p=h.timeZone.gmtZeroFormat:(p=ut.getTimeZoneValue(d,m),p=h.timeZone.gmtFormat.replace(/\{0\}/,p)),c=c.replace(/[z]+/,'"'+p+'"')}c=c.replace(/ $/,"")}return c}function M(e,t){if(-1!==e.indexOf(",")){var r=e.split(",");e=r[0]+i("numberMapper.numberSymbols.group",t)+r[1].replace(".",i("numberMapper.numberSymbols.decimal",t))}else e=e.replace(".",i("numberMapper.numberSymbols.decimal",t));return e}function D(r,a,s,p){var h,d=n(s,r,"",!0),f={custom:!0},g=d.numericObject,v={},y=(a.format||"").match(t.currencyFormatRegex),b=t.formatRegex.test(a.format)?l(a.format||"N"):{},D={};if(y){D.numberMapper=w()?u({},d.numericObject):ot.getNumberMapper(d.parserObject,ot.getNumberingSystem(s),!0);var O=w()?i("currencySymbol",d.numericObject):m(d.numericObject,a.currency||e.defaultCurrencyCode,a.altSymbol),C=o("currency",D.numberMapper.numberSystem,d.numericObject,/a/i.test(a.format)),T=(C=C.replace(/\u00A4/g,O)).split(";");v.hasNegativePattern=!!w()||T.length>1,v.nData=w()?i(b.type+"nData",g):c(T[1]||"-"+T[0],!0,O),v.pData=w()?i(b.type+"pData",g):c(T[0],!1,O),y[2]||a.minimumFractionDigits||a.maximumFractionDigits||(h=c(C.split(";")[0],!0,"",!0).minimumFraction)}var j;if(t.formatRegex.test(a.format)||!a.format){if(u(f,l(a.format||"N")),f.custom=!1,j="###0",f.fractionDigits||a.minimumFractionDigits||a.maximumFractionDigits||h){f.fractionDigits&&(a.minimumFractionDigits=a.maximumFractionDigits=f.fractionDigits),j=E(j,h||f.fractionDigits||a.minimumFractionDigits||0,a.maximumFractionDigits||0)}if(a.minimumIntegerDigits&&(j=P(j,a.minimumIntegerDigits)),a.useGrouping&&(j=S(j)),"currency"===f.type||f.type&&w()){w()&&"currency"!==f.type&&(v.pData=i(f.type+"pData",g),v.nData=i(f.type+"nData",g));var x=j;j=v.pData.nlead+x+v.pData.nend,(v.hasNegativePattern||w())&&(j+=";"+v.nData.nlead+x+v.nData.nend)}"percent"!==f.type||w()||(j+=" %")}else j=a.format.replace(/\'/g,'"');return Object.keys(D).length>0&&(j=p?j:M(j,D)),j}function E(e,t,r){e+=".";for(var n=0;n<t;n++)e+="0";if(t<r)for(var i=r-t,o=0;o<i;o++)e+="#";return e}function P(e,t){for(var r=e.split("."),n="",i=0;i<t;i++)n+="0";return r[1]?n+"."+r[1]:n}function S(e){var t=e.split("."),r=t[0],n=3-r.length%3;e="";for(var i=(r=(n&&1===n?"#":2===n?"##":"")+r).length-1;i>0;i-=3)e=","+r[i-2]+r[i-1]+r[i]+e;return e=e.slice(1),t[1]?e+"."+t[1]:e}function O(e,t){var r=R,n=i("supplemental.weekData.firstDay",t),o=e;return/en-/.test(o)&&(o=o.slice(3)),o=o.slice(0,2).toUpperCase()+o.substr(2),n&&(r=n[o]||R),I[r]}function C(e,t,r){var n=T(r);if(t!==n)for(var i=0,o=e;i<o.length;i++){var a=o[i];a.nend=a.nend.replace(t,n),a.nlead=a.nlead.replace(t,n)}}function j(e){var t,r=new Date(e.getFullYear(),0,1),n=r.getDay();n=n>=0?n:n+7;var i=Math.floor((e.getTime()-r.getTime()-6e4*(e.getTimezoneOffset()-r.getTimezoneOffset()))/864e5)+1;if(n<4){if((t=Math.floor((i+n-1)/7)+1)>52){var o=new Date(e.getFullYear()+1,0,1).getDay();t=(o=o>=0?o:o+7)<4?1:53}}else t=Math.floor((i+n-1)/7);return t}t.negativeDataRegex=/^(('[^']+'|''|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/,t.customRegex=/^(('[^']+'|''|[^*#@0,.])*)(\*.)?((([0#,]*[0,]*[0#]*)(\.[0#]*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/,t.latnParseRegex=/0|1|2|3|4|5|6|7|8|9/g;var x=/[0-9]/g;t.defaultCurrency="$";var N=["infinity","nan","group","decimal"],F=/G|M|L|H|c|'| a|yy|y|EEEE|E/g,A={G:"",M:"m",L:"m",H:"h",c:"d","'":'"'," a":" AM/PM",yy:"yy",y:"yyyy",EEEE:"dddd",E:"ddd"};t.dateConverterMapper=/dddd|ddd/gi;var R="sun";t.islamicRegex=/^islamic/;var I={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};t.formatRegex=/(^[ncpae]{1})([0-1]?[0-9]|20)?$/i,t.currencyFormatRegex=/(^[ca]{1})([0-1]?[0-9]|20)?$/i,t.curWithoutNumberRegex=/(c|a)$/gi;var H={$:"isCurrency","%":"isPercent","-":"isNegative",0:"nlead",1:"nend"};t.dateParseRegex=/([a-z])\1*|'([^']|'')+'|''|./gi,t.basicPatterns=["short","medium","long","full"],t.defaultObject={dates:{calendars:{gregorian:{months:{"stand-alone":{abbreviated:{1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"},narrow:{1:"J",2:"F",3:"M",4:"A",5:"M",6:"J",7:"J",8:"A",9:"S",10:"O",11:"N",12:"D"},wide:{1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"}}},days:{"stand-alone":{abbreviated:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},narrow:{sun:"S",mon:"M",tue:"T",wed:"W",thu:"T",fri:"F",sat:"S"},short:{sun:"Su",mon:"Mo",tue:"Tu",wed:"We",thu:"Th",fri:"Fr",sat:"Sa"},wide:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"}}},dayPeriods:{format:{wide:{am:"AM",pm:"PM"}}},eras:{eraNames:{0:"Before Christ","0-alt-variant":"Before Common Era",1:"Anno Domini","1-alt-variant":"Common Era"},eraAbbr:{0:"BC","0-alt-variant":"BCE",1:"AD","1-alt-variant":"CE"},eraNarrow:{0:"B","0-alt-variant":"BCE",1:"A","1-alt-variant":"CE"}},dateFormats:{full:"EEEE, MMMM d, y",long:"MMMM d, y",medium:"MMM d, y",short:"M/d/yy"},timeFormats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats:{full:"{1} 'at' {0}",long:"{1} 'at' {0}",medium:"{1}, {0}",short:"{1}, {0}",availableFormats:{d:"d",E:"ccc",Ed:"d E",Ehm:"E h:mm a",EHm:"E HH:mm",Ehms:"E h:mm:ss a",EHms:"E HH:mm:ss",Gy:"y G",GyMMM:"MMM y G",GyMMMd:"MMM d, y G",GyMMMEd:"E, MMM d, y G",h:"h a",H:"HH",hm:"h:mm a",Hm:"HH:mm",hms:"h:mm:ss a",Hms:"HH:mm:ss",hmsv:"h:mm:ss a v",Hmsv:"HH:mm:ss v",hmv:"h:mm a v",Hmv:"HH:mm v",M:"L",Md:"M/d",MEd:"E, M/d",MMM:"LLL",MMMd:"MMM d",MMMEd:"E, MMM d",MMMMd:"MMMM d",ms:"mm:ss",y:"y",yM:"M/y",yMd:"M/d/y",yMEd:"E, M/d/y",yMMM:"MMM y",yMMMd:"MMM d, y",yMMMEd:"E, MMM d, y",yMMMM:"MMMM y"}}},islamic:{months:{"stand-alone":{abbreviated:{1:"Muh.",2:"Saf.",3:"Rab. I",4:"Rab. II",5:"Jum. I",6:"Jum. II",7:"Raj.",8:"Sha.",9:"Ram.",10:"Shaw.",11:"Dhuʻl-Q.",12:"Dhuʻl-H."},narrow:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},wide:{1:"Muharram",2:"Safar",3:"Rabiʻ I",4:"Rabiʻ II",5:"Jumada I",6:"Jumada II",7:"Rajab",8:"Shaʻban",9:"Ramadan",10:"Shawwal",11:"Dhuʻl-Qiʻdah",12:"Dhuʻl-Hijjah"}}},days:{"stand-alone":{abbreviated:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},narrow:{sun:"S",mon:"M",tue:"T",wed:"W",thu:"T",fri:"F",sat:"S"},short:{sun:"Su",mon:"Mo",tue:"Tu",wed:"We",thu:"Th",fri:"Fr",sat:"Sa"},wide:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"}}},dayPeriods:{format:{wide:{am:"AM",pm:"PM"}}},eras:{eraNames:{0:"AH"},eraAbbr:{0:"AH"},eraNarrow:{0:"AH"}},dateFormats:{full:"EEEE, MMMM d, y G",long:"MMMM d, y G",medium:"MMM d, y G",short:"M/d/y GGGGG"},timeFormats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats:{full:"{1} 'at' {0}",long:"{1} 'at' {0}",medium:"{1}, {0}",short:"{1}, {0}",availableFormats:{d:"d",E:"ccc",Ed:"d E",Ehm:"E h:mm a",EHm:"E HH:mm",Ehms:"E h:mm:ss a",EHms:"E HH:mm:ss",Gy:"y G",GyMMM:"MMM y G",GyMMMd:"MMM d, y G",GyMMMEd:"E, MMM d, y G",h:"h a",H:"HH",hm:"h:mm a",Hm:"HH:mm",hms:"h:mm:ss a",Hms:"HH:mm:ss",M:"L",Md:"M/d",MEd:"E, M/d",MMM:"LLL",MMMd:"MMM d",MMMEd:"E, MMM d",MMMMd:"MMMM d",ms:"mm:ss",y:"y G",yyyy:"y G",yyyyM:"M/y GGGGG",yyyyMd:"M/d/y GGGGG",yyyyMEd:"E, M/d/y GGGGG",yyyyMMM:"MMM y G",yyyyMMMd:"MMM d, y G",yyyyMMMEd:"E, MMM d, y G",yyyyMMMM:"MMMM y G",yyyyQQQ:"QQQ y G",yyyyQQQQ:"QQQQ y G"}}}},timeZoneNames:{hourFormat:"+HH:mm;-HH:mm",gmtFormat:"GMT{0}",gmtZeroFormat:"GMT"}},numbers:{currencies:{USD:{displayName:"US Dollar",symbol:"$","symbol-alt-narrow":"$"},EUR:{displayName:"Euro",symbol:"€","symbol-alt-narrow":"€"},GBP:{displayName:"British Pound","symbol-alt-narrow":"£"}},defaultNumberingSystem:"latn",minimumGroupingDigits:"1","symbols-numberSystem-latn":{decimal:".",group:",",list:";",percentSign:"%",plusSign:"+",minusSign:"-",exponential:"E",superscriptingExponent:"×",perMille:"‰",infinity:"∞",nan:"NaN",timeSeparator:":"},"decimalFormats-numberSystem-latn":{standard:"#,##0.###"},"percentFormats-numberSystem-latn":{standard:"#,##0%"},"currencyFormats-numberSystem-latn":{standard:"¤#,##0.00",accounting:"¤#,##0.00;(¤#,##0.00)"},"scientificFormats-numberSystem-latn":{standard:"#E0"}}},t.blazorDefaultObject={numbers:{mapper:{0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},mapperDigits:"0123456789",numberSymbols:{decimal:".",group:",",plusSign:"+",minusSign:"-",percentSign:"%",nan:"NaN",timeSeparator:":",infinity:"∞"},timeSeparator:":",currencySymbol:"$",currencypData:{nlead:"$",nend:"",groupSeparator:",",groupData:{primary:3},maximumFraction:2,minimumFraction:2},percentpData:{nlead:"",nend:"%",groupSeparator:",",groupData:{primary:3},maximumFraction:2,minimumFraction:2},percentnData:{nlead:"-",nend:"%",groupSeparator:",",groupData:{primary:3},maximumFraction:2,minimumFraction:2},currencynData:{nlead:"($",nend:")",groupSeparator:",",groupData:{primary:3},maximumFraction:2,minimumFraction:2},decimalnData:{nlead:"-",nend:"",groupData:{primary:3},maximumFraction:2,minimumFraction:2},decimalpData:{nlead:"",nend:"",groupData:{primary:3},maximumFraction:2,minimumFraction:2}},dates:{dayPeriods:{am:"AM",pm:"PM"},dateSeperator:"/",days:{abbreviated:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},short:{sun:"Su",mon:"Mo",tue:"Tu",wed:"We",thu:"Th",fri:"Fr",sat:"Sa"},wide:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"}},months:{abbreviated:{1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"},wide:{1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"}},eras:{1:"AD"}}},t.monthIndex={3:"abbreviated",4:"wide",5:"narrow",1:"abbreviated"},t.month="months",t.days="days",t.patternMatcher={C:"currency",P:"percent",N:"decimal",A:"currency",E:"scientific"},t.getResultantPattern=r,t.getDependables=n,t.getSymbolPattern=o,t.ConvertDateToWeekFormat=a,t.compareBlazorDateFormats=s,t.getProperNumericSkeleton=l,t.getFormatData=c,t.getCurrencySymbol=m,t.customFormat=f,t.isCurrencyPercent=v,t.getDateSeparator=y,t.getActualDateTimeFormat=b,t.getActualNumberFormat=D,t.getWeekData=O,t.replaceBlazorCurrency=C,t.getWeekOfYear=j}(e.IntlBase||(e.IntlBase={}));var St=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot="GET",Ct=function(){function e(e,t,r,n){this.mode=!0,this.emitError=!0,this.options={},"string"==typeof e?(this.url=e,this.type=t?t.toUpperCase():Ot,this.mode=!!p(r)||r):"object"==typeof e&&(this.options=e,c(this,this.options)),this.type=this.type?this.type.toUpperCase():Ot,this.contentType=void 0!==this.contentType?this.contentType:n}return e.prototype.send=function(e){var t=this;this.data=p(e)?this.data:e;var r={cancel:!1,httpRequest:null};return new Promise(function(e,n){t.httpRequest=new XMLHttpRequest,t.httpRequest.onreadystatechange=function(){t.stateChange(e,n)},p(t.onLoad)||(t.httpRequest.onload=t.onLoad),p(t.onProgress)||(t.httpRequest.onprogress=t.onProgress),p(t.onAbort)||(t.httpRequest.onabort=t.onAbort),p(t.onError)||(t.httpRequest.onerror=t.onError),p(t.onUploadProgress)||(t.httpRequest.upload.onprogress=t.onUploadProgress),t.httpRequest.open(t.type,t.url,t.mode),p(t.data)||null===t.contentType||t.httpRequest.setRequestHeader("Content-Type",t.contentType||"application/json; charset=utf-8"),t.beforeSend&&(r.httpRequest=t.httpRequest,t.beforeSend(r)),r.cancel||t.httpRequest.send(p(t.data)?null:t.data)})},e.prototype.successHandler=function(e){return this.onSuccess&&this.onSuccess(e,this),e},e.prototype.failureHandler=function(e){return this.onFailure&&this.onFailure(this.httpRequest),e},e.prototype.stateChange=function(e,t){var r=this.httpRequest.responseText;if(this.dataType&&"json"===this.dataType.toLowerCase())if(""===r)r=void 0;else try{r=JSON.parse(r)}catch(e){}4===this.httpRequest.readyState&&(this.httpRequest.status>=200&&this.httpRequest.status<=299||304===this.httpRequest.status?e(this.successHandler(r)):this.emitError?t(new Error(this.failureHandler(this.httpRequest.statusText))):e())},e.prototype.getResponseHeader=function(e){var t,r;t={};for(var n=St.exec(this.httpRequest.getAllResponseHeaders());n;)t[n[1].toLowerCase()]=n[2],n=St.exec(this.httpRequest.getAllResponseHeaders());return r=t[e.toLowerCase()],p(r)?null:r},e}(),Tt={OPERA:/(opera|opr)(?:.*version|)[ \/]([\w.]+)/i,EDGE:/(edge)(?:.*version|)[ \/]([\w.]+)/i,CHROME:/(chrome|crios)[ \/]([\w.]+)/i,PANTHOMEJS:/(phantomjs)[ \/]([\w.]+)/i,SAFARI:/(safari)[ \/]([\w.]+)/i,WEBKIT:/(webkit)[ \/]([\w.]+)/i,MSIE:/(msie|trident) ([\w.]+)/i,MOZILLA:/(mozilla)(?:.*? rv:([\w.]+)|)/i};"undefined"!=typeof window&&(window.browserDetails=window.browserDetails||{});var jt,xt=function(){function e(){}return e.extractBrowserDetail=function(){for(var t={culture:{}},r=[],n=0,i=Object.keys(Tt);n<i.length;n++){var o=i[n];if(r=e.userAgent.match(Tt[o])){if(t.name="opr"===r[1].toLowerCase()?"opera":r[1].toLowerCase(),t.name="crios"===r[1].toLowerCase()?"chrome":t.name,t.version=r[2],t.culture.name=t.culture.language=navigator.language,e.userAgent.match(/Trident\/7\./)){t.name="msie";break}var a=e.userAgent.match(/(version)[ \/]([\w.]+)/i);"safari"===t.name&&a&&(t.version=a[2]);break}}return t},e.getEvent=function(t){var r={start:{isPointer:"pointerdown",isTouch:"touchstart",isDevice:"mousedown"},move:{isPointer:"pointermove",isTouch:"touchmove",isDevice:"mousemove"},end:{isPointer:"pointerup",isTouch:"touchend",isDevice:"mouseup"},cancel:{isPointer:"pointercancel",isTouch:"touchcancel",isDevice:"mouseleave"}};return e.isPointer&&!e.isWindows?r[t].isPointer:e.isTouch?r[t].isTouch+(e.isDevice?"":" "+r[t].isDevice):r[t].isDevice},e.getTouchStartEvent=function(){return e.getEvent("start")},e.getTouchEndEvent=function(){return e.getEvent("end")},e.getTouchMoveEvent=function(){return e.getEvent("move")},e.getTouchCancelEvent=function(){return e.getEvent("cancel")},e.getValue=function(t,r){var n=window.browserDetails;return void 0===n[t]?n[t]=r.test(e.userAgent):n[t]},Object.defineProperty(e,"userAgent",{get:function(){return e.uA},set:function(t){e.uA=t,window.browserDetails={}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"info",{get:function(){return h(window.browserDetails.info)?window.browserDetails.info=e.extractBrowserDetail():window.browserDetails.info},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isIE",{get:function(){return e.getValue("isIE",/msie|trident/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isTouch",{get:function(){return h(window.browserDetails.isTouch)?window.browserDetails.isTouch="ontouchstart"in window.navigator||window&&window.navigator&&window.navigator.maxTouchPoints>0||"ontouchstart"in window:window.browserDetails.isTouch},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isPointer",{get:function(){return h(window.browserDetails.isPointer)?window.browserDetails.isPointer="pointerEnabled"in window.navigator:window.browserDetails.isPointer},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isMSPointer",{get:function(){return h(window.browserDetails.isMSPointer)?window.browserDetails.isMSPointer="msPointerEnabled"in window.navigator:window.browserDetails.isMSPointer},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isDevice",{get:function(){return e.getValue("isDevice",/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isIos",{get:function(){return e.getValue("isIos",/(ipad|iphone|ipod touch)/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isIos7",{get:function(){return e.getValue("isIos7",/(ipad|iphone|ipod touch);.*os 7_\d|(ipad|iphone|ipod touch);.*os 8_\d/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isAndroid",{get:function(){return e.getValue("isAndroid",/android/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isWebView",{get:function(){return h(window.browserDetails.isWebView)?(window.browserDetails.isWebView=!(h(window.cordova)&&h(window.PhoneGap)&&h(window.phonegap)&&"object"!==window.forge),window.browserDetails.isWebView):window.browserDetails.isWebView},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isWindows",{get:function(){return e.getValue("isWindows",/trident|windows phone|edge/i)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"touchStartEvent",{get:function(){return h(window.browserDetails.touchStartEvent)?window.browserDetails.touchStartEvent=e.getTouchStartEvent():window.browserDetails.touchStartEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e,"touchMoveEvent",{get:function(){return h(window.browserDetails.touchMoveEvent)?window.browserDetails.touchMoveEvent=e.getTouchMoveEvent():window.browserDetails.touchMoveEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e,"touchEndEvent",{get:function(){return h(window.browserDetails.touchEndEvent)?window.browserDetails.touchEndEvent=e.getTouchEndEvent():window.browserDetails.touchEndEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e,"touchCancelEvent",{get:function(){return h(window.browserDetails.touchCancelEvent)?window.browserDetails.touchCancelEvent=e.getTouchCancelEvent():window.browserDetails.touchCancelEvent},enumerable:!0,configurable:!0}),e.uA="undefined"!=typeof navigator?navigator.userAgent:"",e}(),Nt=function(){function e(){}return e.addOrGetEventData=function(e){return"__eventList"in e?e.__eventList.events:(e.__eventList={},e.__eventList.events=[])},e.add=function(t,r,n,i,o){var a,s=e.addOrGetEventData(t);a=o?m(n,o):n,i&&(a=a.bind(i));for(var l=r.split(" "),c=0;c<l.length;c++)s.push({name:l[c],listener:n,debounce:a}),xt.isIE?t.addEventListener(l[c],a):t.addEventListener(l[c],a,{passive:!1});return a},e.remove=function(t,r,n){for(var i=e.addOrGetEventData(t),o=r.split(" "),a=0;a<o.length;a++)!function(e){var r,a=-1;i&&0!==i.length&&i.some(function(t,i){return t.name===o[e]&&t.listener===n&&(a=i,r=t.debounce,!0)}),-1!==a&&i.splice(a,1),r&&t.removeEventListener(o[e],r)}(a)},e.clearEvents=function(t){var r,n;n=u([],n,r=e.addOrGetEventData(t));for(var i=0;i<n.length;i++)t.removeEventListener(n[i].name,n[i].debounce),r.shift()},e.trigger=function(t,r,n){for(var i=0,o=e.addOrGetEventData(t);i<o.length;i++){var a=o[i];a.name===r&&a.debounce.call(this,n)}},e}(),Ft=new RegExp("\\n|\\r|\\s\\s+","g"),At=new RegExp(/'|"/g),Rt=new RegExp("if ?\\("),It=new RegExp("else if ?\\("),Ht=new RegExp("else"),Lt=new RegExp("for ?\\("),kt=new RegExp("(/if|/for)"),Bt=new RegExp("\\((.*)\\)",""),Gt=new RegExp("^[0-9]+$","g"),zt=new RegExp("[\\w\"'.\\s+]+","g"),Yt=new RegExp('"(.*?)"',"g"),_t=new RegExp("[\\w\"'@#$.\\s+]+","g"),Xt=new RegExp("\\${([^}]*)}","g"),Wt=/^\..*/gm,$t=/\\/gi,Vt=/\\\\/gi,Ut=new RegExp("[\\w\"'@#$.\\s+]+","g"),Kt=/\window\./gm,qt=/^[\n\r.]+\<tr|^\<tr/,Zt=/^[\n\r.]+\<svg|^\<path|^\<g/,Jt={},Qt={compile:(new(function(){function e(){}return e.prototype.compile=function(e,t,r){return void 0===t&&(t={}),H(e,t)},e}())).compile},er=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tr=/(?:#([\w-]+)|(\w+)|\.([\w-]+))/g,rr=/^(\.|#)/,nr={".":"className","#":"id"},ir="(?=.*?\\b{value}\\b)",or={className:"attributes.className",id:"attributes.id",tagName:"tagName"},ar=["area","base","basefont","br","col","frame","hr","img","input","link","meta","param","embed","command","keygen","source","track","wbr"],sr=["a","address","article","applet","aside","audio","blockquote","button","canvas","center","dd","del","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","ins","isindex","li","map","menu","noframes","noscript","object","ol","output","p","pre","section","script","table","tbody","td","tfoot","th","thead","tr","ul","video"],lr=["abbr","acronym","applet","b","basefont","bdo","big","br","button","cite","code","del","dfn","em","font","i","iframe","img","input","ins","kbd","label","map","object","q","s","samp","script","select","small","span","strike","strong","sub","sup","textarea","tt","u","var"],cr=["colgroup","dd","dt","li","options","p","td","tfoot","th","thead","tr"],ur=["checked","compact","declare","defer","disabled","ismap","multiple","nohref","noresize","noshade","nowrap","readonly","selected"],pr=["Script","style"],hr={tabindex:"tabIndex"},dr=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,mr=/^<\/([-A-Za-z0-9_]+)[^>]*>/,fr=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;!function(e){function t(e,t){var r=[],n=u({},{},t,!0);if(!p(t)&&Object.keys(t).length&&(n.innerHTML&&(r=d(n.innerHTML),delete n.innerHTML),n.attrs&&(u(n,n.attrs),delete n.attrs),n.styles)){for(var i=n.styles.split(";"),o={},a=0,s=i.length;a<s;a++){var l=i[a].split(":");o[l[0]]=l[1]}delete n.styles,n.style=o}return{tagName:e,attributes:n||{},children:r}}function r(e,t){t&&e&&e.forEach(function(e){return s(e)&&(e.parent&&a(e),e.parent=t),e})}function n(e,t){r(e,t),t.children?t.children=t.children.concat(e):t.children=[].concat(e)}function o(e,t){if(r(e,t),t.children&&t.children.length)for(var n=e.length-1;n>=0;n--)t.children.unshift(e[n]);else t.children=[],t.children.concat(e)}function a(e){var t=e.parent;if(t){var r=t.children.indexOf(e);-1!==r&&t.children.splice(r)}return t}function l(e){for(var t=e.ele,r=e.selector,n=e.selectAll,i=e.immediateParent,o=r.split(" "),a=t,s=0,u=o.length;s<u;s++){var p=!1,d=a,m=o[s],f=[];if(er.test(m))c(m,f);else if(-1===m.indexOf(">"))for(var g=0,v=m.match(tr);g<v.length;g++)c(v[g],f);else if(-1!==m.indexOf(">")){p=!0;for(var y=t,b=void 0,M=0,D=0,w=m.split(">");D<w.length;D++){var E=w[D];if(!y)break;if(y.length){for(var P=[],S=0,O=y;S<O.length;S++){var C=O[S];P=P.concat(l({ele:C,selector:E,selectAll:n,immediateParent:!!M}))}b=P}else b=l({ele:y,selector:E,selectAll:n,immediateParent:!!M});M++,y=b}b&&(a=b)}if(!p)if(d.length){for(var T=[],j=0,x=d;j<x.length;j++){var N=x[j];T=T.concat(h(N,f,n,i))}a=T}else a=h(d,f,n,i)}return n?a:a[0]||null}function c(e,t){var r=e.match(rr),n={};if(r){var i=nr[r[0]];if("className"===i){var o=t.filter(function(e){return e.hasOwnProperty("className")})[0],a=!1;o||(a=!0,o={});var s=o[i]||"";o[i]=s+ir.replace("{value}",e.replace(".","")),a&&t.push(o)}else n[i]=e.replace(r[0],""),t.push(n)}else t.push({tagName:e})}function h(e,t,r,n){if(e.children){var o=e.children.filter(function(e){if("string"!=typeof e){for(var r=!0,n=0,o=t;n<o.length;n++){var a=o[n],s=Object.keys(a)[0],l=a[s],c=i(or[s],e);if("className"===s){if(!new RegExp("^"+l+".*$").test(c)){r=!1;break}}else if(c!==l){r=!1;break}}return r}return!1});return n||o.length&&!r||e.children.forEach(function(e){s(e)&&(o=o.concat(h(e,t,r)))}),o}return[]}function d(e){function t(e,t,n){if(t=t.toLowerCase(),f(sr,t))for(;m(a)&&f(lr,m(a));)r("",m(a));f(cr,t)&&m(a)&&r("",t);var i=f(ar,t);i||a.push(t);var l={};n.replace(fr,function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=r[2]?r[2]:r[3]?r[3]:r[4]?r[4]:f(ur,t)?t:"";if("style"===t){for(var o=i.split(";"),a={},s=0,c=o.length;s<c;s++){var u=o[s].split(":");a[u[0]]=u[1]}i=a}t=hr[t]||t,l[t]=i}),l["data-id"]=_();var c={tagName:t,attributes:l};if(i){var u=s[0]||o;void 0===u.children&&(u.children=[]),c.parent=u,u.children.push(c)}else s.unshift(c)}function r(e,t){var r;if(t)for(r=a.length-1;r>=0&&a[r]!==t;r--);else r=0;if(r>=0){for(var n=s.length-1;n>=r;n--){var i=s.shift();if(0===s.length)o.push(i);else{var l=s[0];void 0===l.children&&(l.children=[]),i.parent=l,l.children.push(i)}}a.length=r}}function n(e){if(0===s.length)o.push(e);else{var t=s[0];void 0===t.children&&(t.children=[]),t.children.push(e)}}for(var i,o=[],a=[],s=[];e;){i=!0;var l=m(a);if(l&&f(pr,l))e=e.replace(new RegExp("([\\s\\S]*?)</"+m(s)+"[^>]*>"),function(e,t){return t=t.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,"$1$2"),n(t),""}),r("",m(a));else{if(0===e.indexOf("</"))(c=e.match(mr))&&(e=e.substring(c[0].length),c[0].replace(mr,r)),i=!1;else if(0===e.indexOf("<")){var c=e.match(dr);c&&(e=e.substring(c[0].length),c[0].replace(dr,t)),i=!1}if(i){var u=e.indexOf("<"),p=u<0?e:e.substring(0,u);e=u<0?"":e.substring(u),n(p)}}}return o}function m(e){return e[e.length-1]}function f(e,t){return-1!==e.indexOf(t)}function g(e,t){return s(e)?t?u({},{},e,!0):{tagName:e.tagName,attributes:e.attributes}:e.cloneNode(t)}function v(e,t){e.attributes.style?e.attributes.style=u({},t):e.attributes.style=u(e.attributes.style,t)}e.createElement=t,e.assignParent=r,e.append=n,e.prepend=o,e.detach=a,e.vDomSelector=l,e.accessElement=h,e.ConvertHTMLToJSon=d,e.cloneNode=g,e.setStyleAttribute=v}(jt||(jt={}));var gr=/^svg|^path|^g/,vr=new RegExp("]"),yr=function(){function e(e,t){this.isRendered=!1,this.isComplexArraySetter=!1,this.isServerRendered=!1,this.allowServerDataBinding=!0,this.isProtectedOnChange=!0,this.properties={},this.changedProperties={},this.oldProperties={},this.bulkChanges={},this.refreshing=!1,this.ignoreCollectionWatch=!1,this.finalUpdate=function(){},this.childChangedProperties={},this.modelObserver=new bt(this),h(t)||(this.element="string"==typeof t?document.querySelector(t):t,p(this.element)||(this.isProtectedOnChange=!1,this.addInstance())),h(e)||this.setProperties(e,!0),this.isDestroyed=!1}return e.prototype.setProperties=function(e,t){var r=this.isProtectedOnChange;this.isProtectedOnChange=!!t,c(this,e),!0!==t?(c(this.changedProperties,e),this.dataBind()):w()&&this.isRendered&&this.serverDataBind(e),this.finalUpdate(),this.changedProperties={},this.oldProperties={},this.isProtectedOnChange=r},e.callChildDataBind=function(e,t){for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t[i]instanceof Array)for(var o=0,a=t[i];o<a.length;o++){var s=a[o];void 0!==s.dataBind&&s.dataBind()}else t[i].dataBind()}},e.prototype.clearChanges=function(){this.finalUpdate(),this.changedProperties={},this.oldProperties={},this.childChangedProperties={}},e.prototype.dataBind=function(){if(e.callChildDataBind(this.childChangedProperties,this),Object.getOwnPropertyNames(this.changedProperties).length){var t=this.isProtectedOnChange,r=this.changedProperties,n=this.oldProperties;this.clearChanges(),this.isProtectedOnChange=!0,this.onPropertyChanged(r,n),this.isProtectedOnChange=t}},e.prototype.serverDataBind=function(e){if(w()){e=e||{},u(this.bulkChanges,{},e,!0);this.allowServerDataBinding&&window.sfBlazor.updateModel&&(window.sfBlazor.updateModel(this),this.bulkChanges={})}},e.prototype.saveChanges=function(e,t,r){if(w()){var i={};i[e]=t,this.serverDataBind(i)}this.isProtectedOnChange||(this.oldProperties[e]=r,this.changedProperties[e]=t,this.finalUpdate(),this.finalUpdate=n(this.dataBind.bind(this)))},e.prototype.addEventListener=function(e,t){this.modelObserver.on(e,t)},e.prototype.removeEventListener=function(e,t){this.modelObserver.off(e,t)},e.prototype.trigger=function(e,t,r,n){var o=this;if(!0!==this.isDestroyed){var a=this.isProtectedOnChange;this.isProtectedOnChange=!1;var s=this.modelObserver.notify(e,t,r,n);if(vr.test(e)){var l=i(e,this);if(l){if(window.Blazor){var c=l.call(this,t);c&&"function"==typeof c.then?r?c.then(function(e){r&&(e="string"==typeof e&&o.modelObserver.isJson(e)?JSON.parse(e):e,r.call(o,e))}).catch(function(e){n&&(e="string"==typeof e&&o.modelObserver.isJson(e)?JSON.parse(e):e,n.call(o,e))}):s=c:r&&r.call(this,t)}else l.call(this,t),r&&r.call(this,t)}else r&&r.call(this,t)}return this.isProtectedOnChange=a,s}},e.prototype.addInstance=function(){var e="e-"+this.getModuleName().toLowerCase();q([this.element],["e-lib",e]),p(this.element.ej2_instances)?o("ej2_instances",[this],this.element):this.element.ej2_instances.push(this)},e.prototype.destroy=function(){var e=this;this.element.ej2_instances=this.element.ej2_instances.filter(function(t){return t!==e}),Z([this.element],["e-"+this.getModuleName()]),0===this.element.ej2_instances.length&&Z([this.element],["e-lib"]),this.clearChanges(),this.modelObserver.destroy(),this.isDestroyed=!0},e}(),br=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mr=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Dr=function(e){function t(t){var r=e.call(this,t,void 0)||this;return r.easing={ease:"cubic-bezier(0.250, 0.100, 0.250, 1.000)",linear:"cubic-bezier(0.250, 0.250, 0.750, 0.750)",easeIn:"cubic-bezier(0.420, 0.000, 1.000, 1.000)",easeOut:"cubic-bezier(0.000, 0.000, 0.580, 1.000)",easeInOut:"cubic-bezier(0.420, 0.000, 0.580, 1.000)",elasticInOut:"cubic-bezier(0.5,-0.58,0.38,1.81)",elasticIn:"cubic-bezier(0.17,0.67,0.59,1.81)",elasticOut:"cubic-bezier(0.7,-0.75,0.99,1.01)"},r}br(t,e),r=t,t.prototype.animate=function(e,t){t=t||{};var n=this.getModel(t);if("string"==typeof e)for(var i=0,o=Array.prototype.slice.call(se(e,document));i<o.length;i++){var a=o[i];n.element=a,r.delayAnimation(n)}else n.element=e,r.delayAnimation(n)},t.stop=function(e,t){e.style.animation="",e.removeAttribute("e-animate");var r=e.getAttribute("e-animation-id");if(r){var n=parseInt(r,10);cancelAnimationFrame(n),e.removeAttribute("e-animation-id")}t&&t.end&&t.end.call(this,t)},t.delayAnimation=function(e){e.delay?setTimeout(function(){r.applyAnimation(e)},e.delay):r.applyAnimation(e)},t.applyAnimation=function(e){var t=this;e.timeStamp=0;var r=0,n=0,i=0,o=0,a=e.duration;e.element.setAttribute("e-animate","true");var s=function(l){try{if(l){o=0===o?l:o,e.timeStamp=l+e.timeStamp-o,o=l,!r&&e.begin&&e.begin.call(t,e),r+=1;var c=e.timeStamp/r;e.timeStamp<a&&e.timeStamp+c<a&&e.element.getAttribute("e-animate")?(e.element.style.animation=e.name+" "+e.duration+"ms "+e.timingFunction,e.progress&&e.progress.call(t,e),requestAnimationFrame(s)):(cancelAnimationFrame(n),e.element.removeAttribute("e-animation-id"),e.element.removeAttribute("e-animate"),e.element.style.animation="",e.end&&e.end.call(t,e))}else i=performance.now(),n=requestAnimationFrame(s),e.element.setAttribute("e-animation-id",n.toString())}catch(r){cancelAnimationFrame(n),e.element.removeAttribute("e-animation-id"),e.fail&&e.fail.call(t,r)}};s()},t.prototype.getModel=function(e){return{name:e.name||this.name,delay:e.delay||this.delay,duration:void 0!==e.duration?e.duration:this.duration,begin:e.begin||this.begin,end:e.end||this.end,fail:e.fail||this.fail,progress:e.progress||this.progress,timingFunction:this.easing[e.timingFunction]?this.easing[e.timingFunction]:e.timingFunction||this.easing[this.timingFunction]}},t.prototype.onPropertyChanged=function(e,t){},t.prototype.getModuleName=function(){return"animation"},t.prototype.destroy=function(){};var r;return Mr([Re("FadeIn")],t.prototype,"name",void 0),Mr([Re(400)],t.prototype,"duration",void 0),Mr([Re("ease")],t.prototype,"timingFunction",void 0),Mr([Re(0)],t.prototype,"delay",void 0),Mr([Be()],t.prototype,"progress",void 0),Mr([Be()],t.prototype,"begin",void 0),Mr([Be()],t.prototype,"end",void 0),Mr([Be()],t.prototype,"fail",void 0),t=r=Mr([Ge],t)}(yr);e.isRippleEnabled=!1;var wr,Er=function(){function e(e){this.loadedModules=[],this.parent=e}return e.prototype.inject=function(e,t){var n=e.length;if(0===n)return void this.clean();this.loadedModules.length&&this.clearUnusedModule(e);for(var i=0;i<n;i++)for(var a=e[i],s=0,l=t;s<l.length;s++){var c=l[s],u=a.member;if(c.prototype.getModuleName()===a.member&&!this.isModuleLoaded(u)){var p=r(c,a.args),h=this.getMemberName(u);a.isProperty?o(h,c,this.parent):o(h,p,this.parent);var d=a;d.member=h,this.loadedModules.push(d)}}},e.prototype.clean=function(){for(var e=0,t=this.loadedModules;e<t.length;e++){var r=t[e];r.isProperty||i(r.member,this.parent).destroy()}this.loadedModules=[]},e.prototype.clearUnusedModule=function(e){for(var t=this,r=e.map(function(e){return t.getMemberName(e.member)}),n=0,o=this.loadedModules.filter(function(e){return-1===r.indexOf(e.member)});n<o.length;n++){var s=o[n];s.isProperty||i(s.member,this.parent).destroy(),this.loadedModules.splice(this.loadedModules.indexOf(s),1),a(this.parent,s.member)}},e.prototype.getMemberName=function(e){return e[0].toLowerCase()+e.substring(1)+"Module"},e.prototype.isModuleLoaded=function(e){for(var t=0,r=this.loadedModules;t<r.length;t++)if(r[t].member===this.getMemberName(e))return!0;return!1},e}(),Pr=function(){function e(e,t,r,n){this.isComplexArraySetter=!1,this.properties={},this.changedProperties={},this.childChangedProperties={},this.oldProperties={},this.finalUpdate=function(){},this.callChildDataBind=i("callChildDataBind",yr),this.parentObj=e,this.controlParent=this.parentObj.controlParent||this.parentObj,this.propName=t,this.isParentArray=n,this.setProperties(r,!0)}return e.prototype.updateChange=function(e,t){!0===e?this.parentObj.childChangedProperties[t]=e:delete this.parentObj.childChangedProperties[t],this.parentObj.updateChange&&this.parentObj.updateChange(e,this.parentObj.propName)},e.prototype.updateTimeOut=function(){if(this.parentObj.updateTimeOut)this.parentObj.finalUpdate(),this.parentObj.updateTimeOut();else{var e=setTimeout(this.parentObj.dataBind.bind(this.parentObj)),t=function(){clearTimeout(e)};this.finalUpdate=t}},e.prototype.clearChanges=function(){this.finalUpdate(),this.updateChange(!1,this.propName),this.oldProperties={},this.changedProperties={}},e.prototype.setProperties=function(e,t){!0===t?(c(this,e),this.updateChange(!1,this.propName),this.clearChanges()):c(this,e)},e.prototype.dataBind=function(){if(this.callChildDataBind(this.childChangedProperties,this),this.isParentArray){var e=this.parentObj[this.propName].indexOf(this);Object.keys(this.changedProperties).length&&(o(this.propName+"."+e,this.changedProperties,this.parentObj.changedProperties),o(this.propName+"."+e,this.oldProperties,this.parentObj.oldProperties))}else this.parentObj.changedProperties[this.propName]=this.changedProperties,this.parentObj.oldProperties[this.propName]=this.oldProperties;this.clearChanges()},e.prototype.saveChanges=function(e,t,r,n){this.controlParent.isProtectedOnChange||(n||this.serverDataBind(e,t,!0),this.oldProperties[e]=r,this.changedProperties[e]=t,this.updateChange(!0,this.propName),this.finalUpdate(),this.updateTimeOut())},e.prototype.serverDataBind=function(e,t,r,n){if(w()&&!this.parentObj.isComplexArraySetter){var i,o={},a=r?this.getParentKey(!0)+"."+e:e;if(-1!==a.indexOf(".")){var s=a.split(".");i=o;for(var l=0;l<s.length;l++){var c=l===s.length-1;i[s[l]]=c?t:{},i=c?i:i[s[l]]}}else o[a]={},i=o[a],o[a][e]=t;if(this.isParentArray){i.ejsAction=n||"none"}this.controlParent.serverDataBind(o)}},e.prototype.getParentKey=function(e){var t="",r=this.propName;if(this.isParentArray){t=this.parentObj[this.propName].indexOf(this);var n=this.parentObj[this.propName].length;n=e?n:n>0?n-1:0,r+=t=-1!==t?"-"+t:"-"+n}return this.controlParent!==this.parentObj&&(r=this.parentObj.getParentKey()+"."+this.propName+t),r},e}(),Sr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Or=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Cr=0,Tr=0;e.versionBasedStatePersistence=!1;var jr=function(t){function r(r,n){var i=t.call(this,r,n)||this;return i.randomId=O(),i.isStringTemplate=!1,i.needsID=!1,i.isReactHybrid=!1,p(i.enableRtl)&&i.setProperties({enableRtl:e.rightToLeft},!0),p(i.locale)&&i.setProperties({locale:e.defaultCulture},!0),i.moduleLoader=new Er(i),i.localObserver=new bt(i),Mt.on("notifyExternalChange",i.detectFunction,i,i.randomId),h(n)||i.appendTo(),i}return Sr(r,t),r.prototype.requiredModules=function(){return[]},r.prototype.destroy=function(){this.isDestroyed||(this.enablePersistence&&this.setPersistData(),this.localObserver.destroy(),this.refreshing||(Z([this.element],["e-control"]),this.trigger("destroyed",{cancel:!1}),t.prototype.destroy.call(this),this.moduleLoader.clean(),Mt.off("notifyExternalChange",this.detectFunction,this.randomId)))},r.prototype.refresh=function(){this.refreshing=!0,this.moduleLoader.clean(),this.destroy(),this.clearChanges(),this.localObserver=new bt(this),this.preRender(),this.injectModules(),this.render(),this.refreshing=!1},r.prototype.accessMount=function(){this.mount&&!this.isReactHybrid&&this.mount()},r.prototype.getRootElement=function(){return this.isReactHybrid?this.actualElement:this.element},r.prototype.getLocalData=function(){var t=this.getModuleName()+this.element.id;return e.versionBasedStatePersistence?window.localStorage.getItem(t+this.ej2StatePersistenceVersion):window.localStorage.getItem(t)},r.prototype.appendTo=function(e){if(p(e)||"string"!=typeof e?p(e)||(this.element=e):this.element=ae(e,document),!p(this.element)){var r="e-"+this.getModuleName().toLowerCase();q([this.element],["e-control",r]),this.isProtectedOnChange=!1,this.needsID&&!this.element.id&&(this.element.id=this.getUniqueID(this.getModuleName())),this.enablePersistence&&(this.mergePersistData(),window.addEventListener("unload",this.setPersistData.bind(this)));var n=i("ej2_instances",this.element);n&&-1!==n.indexOf(this)||t.prototype.addInstance.call(this),this.preRender(),this.injectModules(),this.render(),this.mount?this.accessMount():this.trigger("created")}},r.prototype.renderComplete=function(e){if(w()){window.sfBlazor.renderComplete(this.element,e)}this.isRendered=!0},r.prototype.dataBind=function(){this.injectModules(),t.prototype.dataBind.call(this)},r.prototype.on=function(e,t,r){if("string"==typeof e)this.localObserver.on(e,t,r);else for(var n=0,i=e;n<i.length;n++){var o=i[n];this.localObserver.on(o.event,o.handler,o.context)}},r.prototype.off=function(e,t){if("string"==typeof e)this.localObserver.off(e,t);else for(var r=0,n=e;r<n.length;r++){var i=n[r];this.localObserver.off(i.event,i.handler)}},r.prototype.notify=function(e,t){!0!==this.isDestroyed&&this.localObserver.notify(e,t)},r.prototype.getInjectedModules=function(){return this.injectedModules},r.Inject=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.prototype.injectedModules||(this.prototype.injectedModules=[]);for(var r=0;r<e.length;r++)-1===this.prototype.injectedModules.indexOf(e[r])&&this.prototype.injectedModules.push(e[r])},r.prototype.createElement=function(e,t,r){return r&&this.isReactHybrid?(t&&(t={}),t["data-id"]=_(),jt.createElement(e,t)):K(e,t)},r.prototype.triggerStateChange=function(e,t){this.isReactHybrid&&(this.setState(),this.currentContext={calls:e,args:t})},r.prototype.injectModules=function(){this.injectedModules&&this.injectedModules.length&&this.moduleLoader.inject(this.requiredModules(),this.injectedModules)},r.prototype.detectFunction=function(e){var t=Object.keys(e);t.length&&(this[t[0]]=e[t[0]])},r.prototype.mergePersistData=function(){var t;p(t=e.versionBasedStatePersistence?window.localStorage.getItem(this.getModuleName()+this.element.id+this.ej2StatePersistenceVersion):window.localStorage.getItem(this.getModuleName()+this.element.id))||""===t||this.setProperties(JSON.parse(t),!0)},r.prototype.setPersistData=function(){this.isDestroyed||(e.versionBasedStatePersistence?window.localStorage.setItem(this.getModuleName()+this.element.id+this.ej2StatePersistenceVersion,this.getPersistData()):window.localStorage.setItem(this.getModuleName()+this.element.id,this.getPersistData()))},r.prototype.renderReactTemplates=function(){},r.prototype.clearTemplate=function(e,t){},r.prototype.getUniqueID=function(e){return this.isHistoryChanged()&&(Cr=0),wr=this.pageID(location.href),Tr=history.length,e+"_"+wr+"_"+Cr++},r.prototype.pageID=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return Math.abs(t)},r.prototype.isHistoryChanged=function(){return wr!==this.pageID(location.href)||Tr!==history.length},r.prototype.addOnPersist=function(e){for(var t=this,r={},n=0,a=e;n<a.length;n++){var s=a[n],l=void 0;h(l=i(s,this))||o(s,this.getActualProperties(l),r)}return JSON.stringify(r,function(e,r){return t.getActualProperties(r)})},r.prototype.getActualProperties=function(e){return e instanceof Pr?i("properties",e):e},r.prototype.ignoreOnPersist=function(e){return JSON.stringify(this.iterateJsonProperties(this.properties,e))},r.prototype.iterateJsonProperties=function(e,t){for(var r={},n=this,i=0,o=Object.keys(e);i<o.length;i++)!function(i){if(-1===t.indexOf(i)){var o=e[i];if("object"!=typeof o||o instanceof Array)r[i]=o;else{var a=t.filter(function(e){return new RegExp(i+".").test(e)}).map(function(e){return e.replace(i+".","")});r[i]=n.iterateJsonProperties(n.getActualProperties(o),a)}}}(o[i]);return r},Or([Re(!1)],r.prototype,"enablePersistence",void 0),Or([Re()],r.prototype,"enableRtl",void 0),Or([Re()],r.prototype,"locale",void 0),r=Or([Ge],r)}(yr);!function(){"undefined"!=typeof window&&window.addEventListener("popstate",function(){Cr=0})}();var xr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nr=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Fr={left:0,top:0,bottom:0,right:0},Ar={isDragged:!1},Rr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xr(t,e),Nr([Re(0)],t.prototype,"left",void 0),Nr([Re(0)],t.prototype,"top",void 0),t}(Pr),Ir=function(e){function t(t,n){var i=e.call(this,n,t)||this;return i.dragLimit=r.getDefaultPosition(),i.borderWidth=r.getDefaultPosition(),i.padding=r.getDefaultPosition(),i.diffX=0,i.prevLeft=0,i.prevTop=0,i.dragProcessStarted=!1,i.tapHoldTimer=0,i.externalInitialize=!1,i.diffY=0,i.parentScrollX=0,i.parentScrollY=0,i.droppables={},i.bind(),i}xr(t,e),r=t,t.prototype.bind=function(){this.toggleEvents(),xt.isIE&&q([this.element],"e-block-touch"),this.droppables[this.scope]={}},t.getDefaultPosition=function(){return u({},Fr)},t.prototype.toggleEvents=function(e){var t;h(this.handle)||(t=ae(this.handle,this.element));var r=this.enableTapHold&&xt.isDevice&&xt.isTouch?this.mobileInitialize:this.initialize;e?Nt.remove(t||this.element,xt.touchStartEvent,r):Nt.add(t||this.element,xt.touchStartEvent,r,this)},t.prototype.mobileInitialize=function(e){var t=this,r=e.currentTarget;this.tapHoldTimer=setTimeout(function(){t.externalInitialize=!0,t.removeTapholdTimer(),t.initialize(e,r)},this.tapHoldThreshold),Nt.add(document,xt.touchMoveEvent,this.removeTapholdTimer,this),Nt.add(document,xt.touchEndEvent,this.removeTapholdTimer,this)},t.prototype.removeTapholdTimer=function(){clearTimeout(this.tapHoldTimer),Nt.remove(document,xt.touchMoveEvent,this.removeTapholdTimer),Nt.remove(document,xt.touchEndEvent,this.removeTapholdTimer)},t.prototype.getScrollableParent=function(e,t){var r={vertical:"scrollHeight",horizontal:"scrollWidth"},n={vertical:"clientHeight",horizontal:"clientWidth"};return p(e)?null:e[r[t]]>e[n[t]]&&("vertical"===t?e.scrollTop>0:e.scrollLeft>0)?("vertical"===t?(this.parentScrollY=this.parentScrollY+(0===this.parentScrollY?e.scrollTop:e.scrollTop-this.parentScrollY),this.tempScrollHeight=e.scrollHeight):(this.parentScrollX=this.parentScrollX+(0===this.parentScrollX?e.scrollLeft:e.scrollLeft-this.parentScrollX),this.tempScrollWidth=e.scrollWidth),p(e)?e:this.getScrollableParent(e.parentNode,t)):this.getScrollableParent(e.parentNode,t)},t.prototype.getScrollableValues=function(){this.parentScrollX=0,this.parentScrollY=0;this.element.classList.contains("e-dialog")&&this.element.classList.contains("e-dlg-modal"),this.getScrollableParent(this.element.parentNode,"vertical"),this.getScrollableParent(this.element.parentNode,"horizontal")},t.prototype.initialize=function(e,t){if(this.currentStateTarget=e.target,!this.isDragStarted()){if(this.isDragStarted(!0),this.externalInitialize=!1,this.target=e.currentTarget||t,this.dragProcessStarted=!1,this.abort){var r=this.abort;"string"==typeof r&&(r=[r]);for(var n=0;n<r.length;n++)if(!p(ce(e.target,r[n])))return void(this.isDragStarted()&&this.isDragStarted(!0))}this.preventDefault&&!h(e.changedTouches)&&"touchstart"!==e.type&&e.preventDefault(),this.element.setAttribute("aria-grabbed","true");var i=this.getCoordinates(e);if(this.initialPosition={x:i.pageX,y:i.pageY},!this.clone){var o=this.element.getBoundingClientRect();this.getScrollableValues(),e.clientX===e.pageX&&(this.parentScrollX=0),e.clientY===e.pageY&&(this.parentScrollY=0),this.relativeXPosition=i.pageX-(o.left+this.parentScrollX),this.relativeYPosition=i.pageY-(o.top+this.parentScrollY)}this.externalInitialize?this.intDragStart(e):(Nt.add(document,xt.touchMoveEvent,this.intDragStart,this),Nt.add(document,xt.touchEndEvent,this.intDestroy,this)),this.toggleEvents(!0),"touchstart"!==e.type&&this.isPreventSelect&&document.body.classList.add("e-prevent-select"),this.externalInitialize=!1,Nt.trigger(document.documentElement,xt.touchStartEvent,e)}},t.prototype.intDragStart=function(e){this.removeTapholdTimer();var t=!h(e.changedTouches);if(!t||1===e.changedTouches.length){t&&e.preventDefault();var r,n=this.getCoordinates(e),i=getComputedStyle(this.element);this.margin={left:parseInt(i.marginLeft,10),top:parseInt(i.marginTop,10),right:parseInt(i.marginRight,10),bottom:parseInt(i.marginBottom,10)};var o=this.element;if(this.clone&&this.dragTarget){var a=ce(e.target,this.dragTarget);p(a)||(o=a)}this.isReplaceDragEle&&(o=this.currentStateCheck(e.target,o)),this.offset=this.calculateParentPosition(o),this.position=this.getMousePosition(e,this.isDragScroll);var s=this.initialPosition.x-n.pageX,l=this.initialPosition.y-n.pageY;if(Math.sqrt(s*s+l*l)>=this.distance||this.externalInitialize){var c=this.getHelperElement(e);if(!c||p(c))return;var u=this.helperElement=c;if(this.parentClientRect=this.calculateParentPosition(u.offsetParent),this.dragStart){var d={event:e,element:o,target:this.getProperTargetElement(e),bindEvents:w()?this.bindDragEvents.bind(this):null,dragElement:u};this.trigger("dragStart",d)}this.dragArea?this.setDragArea():(this.dragLimit={left:0,right:0,bottom:0,top:0},this.borderWidth={top:0,left:0}),r={left:this.position.left-this.parentClientRect.left,top:this.position.top-this.parentClientRect.top},this.clone&&!this.enableTailMode&&(this.diffX=this.position.left-this.offset.left,this.diffY=this.position.top-this.offset.top),this.getScrollableValues();var m=getComputedStyle(o),f=parseFloat(m.marginTop);this.clone&&0!==f&&(r.top+=f);var g=this.getProcessedPositionValue({top:r.top-this.diffY+"px",left:r.left-this.diffX+"px"});this.dragElePosition={top:r.top,left:r.left},he(u,this.getDragPosition({position:"absolute",left:g.left,top:g.top})),Nt.remove(document,xt.touchMoveEvent,this.intDragStart),Nt.remove(document,xt.touchEndEvent,this.intDestroy),w()||this.bindDragEvents(u)}}},t.prototype.bindDragEvents=function(e){Q(e)?(Nt.add(document,xt.touchMoveEvent,this.intDrag,this),Nt.add(document,xt.touchEndEvent,this.intDragStop,this),this.setGlobalDroppables(!1,this.element,e)):(this.toggleEvents(),document.body.classList.remove("e-prevent-select"))},t.prototype.elementInViewport=function(e){for(this.top=e.offsetTop,this.left=e.offsetLeft,this.width=e.offsetWidth,this.height=e.offsetHeight;e.offsetParent;)e=e.offsetParent,this.top+=e.offsetTop,this.left+=e.offsetLeft;return this.top>=window.pageYOffset&&this.left>=window.pageXOffset&&this.top+this.height<=window.pageYOffset+window.innerHeight&&this.left+this.width<=window.pageXOffset+window.innerWidth},t.prototype.getProcessedPositionValue=function(e){return this.queryPositionInfo?this.queryPositionInfo(e):e},t.prototype.calculateParentPosition=function(e){if(p(e))return{left:0,top:0};var t=e.getBoundingClientRect(),r=getComputedStyle(e);return{left:t.left+window.pageXOffset-parseInt(r.marginLeft,10),top:t.top+window.pageYOffset-parseInt(r.marginTop,10)}},t.prototype.intDrag=function(e){if(h(e.changedTouches)||1===e.changedTouches.length){var t,r;this.position=this.getMousePosition(e,this.isDragScroll);var n=this.getDocumentWidthHeight("Height");n<this.position.top&&(this.position.top=n);var i=this.getDocumentWidthHeight("Width");if(i<this.position.left&&(this.position.left=i),this.drag){var o=this.getProperTargetElement(e);this.trigger("drag",{event:e,element:this.element,target:o})}var a=this.checkTargetElement(e);if(a.target&&a.instance){var s=!0;this.hoverObject&&(this.hoverObject.instance!==a.instance?this.triggerOutFunction(e,a):s=!1),s&&(a.instance.dragData[this.scope]=this.droppables[this.scope],a.instance.intOver(e,a.target),this.hoverObject=a)}else this.hoverObject&&this.triggerOutFunction(e,a);var l=this.droppables[this.scope].helper;this.parentClientRect=this.calculateParentPosition(this.helperElement.offsetParent);var c=this.parentClientRect.left,u=this.parentClientRect.top,d=this.getCoordinates(e),m=d.pageX,f=d.pageY,g=this.position.left-this.diffX,v=this.position.top-this.diffY,y=getComputedStyle(l),b=parseFloat(y.marginTop);if(this.dragArea){if(this.pageX!==m||this.skipDistanceCheck){var M=l.offsetWidth+(parseFloat(y.marginLeft)+parseFloat(y.marginRight));t=this.dragLimit.left>g&&g>0?this.dragLimit.left:this.dragLimit.right+window.pageXOffset<g+M&&g>0?g-(g-this.dragLimit.right)+window.pageXOffset-M:g<0?this.dragLimit.left:g}if(this.pageY!==f||this.skipDistanceCheck){var D=l.offsetHeight+(parseFloat(y.marginTop)+parseFloat(y.marginBottom));r=this.dragLimit.top>v&&v>0?this.dragLimit.top:this.dragLimit.bottom+window.pageYOffset<v+D&&v>0?v-(v-this.dragLimit.bottom)+window.pageYOffset-D:v<0?this.dragLimit.top:v}}else t=g,r=v;var w=u+this.borderWidth.top,E=c+this.borderWidth.left;this.dragProcessStarted&&(p(r)&&(r=this.prevTop),p(t)&&(t=this.prevLeft));var P,S;if(this.dragArea){if(this.dragLimit.top=this.clone?this.dragLimit.top:0,P=r-w<0?this.dragLimit.top:r-w,S=t-E<0?this.dragElePosition.left:t-E,b>0&&(this.clone&&(P+=this.element.offsetTop,v<0&&(this.element.offsetTop+v>=0?P=this.element.offsetTop+v:P-=this.element.offsetTop),P=this.dragLimit.bottom<P?this.dragLimit.bottom:P),r-w<0))if(v+b+(l.offsetHeight-w)>=0){var O=this.dragLimit.top+v-w;O+b+w<0?P-=b+w:P=O}else P-=b+w}else P=r-w,S=t-E;var C=this.getProcessedPositionValue({top:P+"px",left:S+"px"});he(l,this.getDragPosition(C)),!this.elementInViewport(l)&&this.enableAutoScroll&&this.helperElement.scrollIntoView(),this.dragProcessStarted=!0,this.prevLeft=t,this.prevTop=r,this.position.left=t,this.position.top=r,this.pageX=m,this.pageY=f}},t.prototype.triggerOutFunction=function(e,t){this.hoverObject.instance.intOut(e,t.target),this.hoverObject.instance.dragData[this.scope]=null,this.hoverObject=null},t.prototype.getDragPosition=function(e){var t=u({},e);return this.axis&&("x"===this.axis?delete t.top:"y"===this.axis&&delete t.left),t},t.prototype.getDocumentWidthHeight=function(e){var t=document.body,r=document.documentElement;return Math.max(t["scroll"+e],r["scroll"+e],t["offset"+e],r["offset"+e],r["client"+e])},t.prototype.intDragStop=function(e){if(this.dragProcessStarted=!1,h(e.changedTouches)||1===e.changedTouches.length){if(-1!==["touchend","pointerup","mouseup"].indexOf(e.type)){if(this.dragStop){var t=this.getProperTargetElement(e);this.trigger("dragStop",{event:e,element:this.element,target:t,helper:this.helperElement})}this.intDestroy(e)}else this.element.setAttribute("aria-grabbed","false");var r=this.checkTargetElement(e);r.target&&r.instance&&(r.instance.dragStopCalled=!0,r.instance.dragData[this.scope]=this.droppables[this.scope],r.instance.intDrop(e,r.target)),this.setGlobalDroppables(!0),document.body.classList.remove("e-prevent-select")}},t.prototype.intDestroy=function(e){this.dragProcessStarted=!1,this.toggleEvents(),document.body.classList.remove("e-prevent-select"),this.element.setAttribute("aria-grabbed","false"),Nt.remove(document,xt.touchMoveEvent,this.intDragStart),Nt.remove(document,xt.touchEndEvent,this.intDragStop),Nt.remove(document,xt.touchEndEvent,this.intDestroy),Nt.remove(document,xt.touchMoveEvent,this.intDrag),this.isDragStarted()&&this.isDragStarted(!0)},t.prototype.onPropertyChanged=function(e,t){},t.prototype.getModuleName=function(){return"draggable"},t.prototype.isDragStarted=function(e){return e&&(Ar.isDragged=!Ar.isDragged),Ar.isDragged},t.prototype.setDragArea=function(){var e,t,r,n=0,i=0;if(r="string"===typeof this.dragArea?ae(this.dragArea):this.dragArea){var o=r.getBoundingClientRect();e=r.scrollWidth?r.scrollWidth:o.right-o.left,t=r.scrollHeight?r.scrollHeight:o.bottom-o.top;for(var a=["Top","Left","Bottom","Right"],s=getComputedStyle(r),l=0;l<a.length;l++){var c=a[l],u=s["border"+c+"Width"],p=s["padding"+c],h=c.toLowerCase();this.borderWidth[h]=isNaN(parseFloat(u))?0:parseFloat(u),this.padding[h]=isNaN(parseFloat(p))?0:parseFloat(p)}n=o.top,i=o.left,this.dragLimit.left=i+this.borderWidth.left+this.padding.left,this.dragLimit.top=r.offsetTop+this.borderWidth.top+this.padding.top,this.dragLimit.right=i+e-(this.borderWidth.right+this.padding.right),this.dragLimit.bottom=n+t-(this.borderWidth.bottom+this.padding.bottom)}},t.prototype.getProperTargetElement=function(e){var t,r=this.getCoordinates(e),n=this.helperElement.style.pointerEvents||"";return v(e.target,this.helperElement)||-1!==e.type.indexOf("touch")?(this.helperElement.style.pointerEvents="none",t=document.elementFromPoint(r.clientX,r.clientY),this.helperElement.style.pointerEvents=n):t=e.target,t},t.prototype.currentStateCheck=function(e,t){return p(this.currentStateTarget)||this.currentStateTarget===e?p(t)?e:t:this.currentStateTarget},t.prototype.getMousePosition=function(e,t){var r,n,i=void 0!==e.srcElement?e.srcElement:e.target,o=this.getCoordinates(e),a=p(i.offsetParent);return t?(r=this.clone?o.pageX:o.pageX+(a?0:i.offsetParent.scrollLeft)-this.relativeXPosition,n=this.clone?o.pageY:o.pageY+(a?0:i.offsetParent.scrollTop)-this.relativeYPosition):(r=this.clone?o.pageX:o.pageX+window.pageXOffset-this.relativeXPosition,n=this.clone?o.pageY:o.pageY+window.pageYOffset-this.relativeYPosition),!this.clone&&this.dragArea&&(this.getScrollableValues(),n-=this.tempScrollHeight?this.parentScrollY:0,r-=this.tempScrollWidth?this.parentScrollX:0),{left:r-(this.margin.left+this.cursorAt.left),top:n-(this.margin.top+this.cursorAt.top)}},t.prototype.getCoordinates=function(e){return e.type.indexOf("touch")>-1?e.changedTouches[0]:e},t.prototype.getHelperElement=function(e){var t;return this.clone?this.helper?t=this.helper({sender:e,element:this.target}):(t=K("div",{className:"e-drag-helper e-block-touch",innerHTML:"Draggable"}),document.body.appendChild(t)):t=this.element,t},t.prototype.setGlobalDroppables=function(e,t,r){this.droppables[this.scope]=e?null:{draggable:t,helper:r,draggedElement:this.element}},t.prototype.checkTargetElement=function(e){var t=this.getProperTargetElement(e),r=this.getDropInstance(t);if(!r&&t&&!p(t.parentNode)){var n=ce(t.parentNode,".e-droppable")||t.parentElement;n&&(r=this.getDropInstance(n))}return{target:t,instance:r}},t.prototype.getDropInstance=function(e){var t,r=e&&e.ej2_instances;if(r)for(var n=0,i=r;n<i.length;n++){var o=i[n];if("droppable"===o.getModuleName()){t=o;break}}return t},t.prototype.destroy=function(){this.toggleEvents(!0),e.prototype.destroy.call(this)};var r;return Nr([Ie({},Rr)],t.prototype,"cursorAt",void 0),Nr([Re(!0)],t.prototype,"clone",void 0),Nr([Re()],t.prototype,"dragArea",void 0),Nr([Re()],t.prototype,"isDragScroll",void 0),Nr([Re()],t.prototype,"isReplaceDragEle",void 0),Nr([Re(!0)],t.prototype,"isPreventSelect",void 0),Nr([Be()],t.prototype,"drag",void 0),Nr([Be()],t.prototype,"dragStart",void 0),Nr([Be()],t.prototype,"dragStop",void 0),Nr([Re(1)],t.prototype,"distance",void 0),Nr([Re()],t.prototype,"handle",void 0),Nr([Re()],t.prototype,"abort",void 0),Nr([Re()],t.prototype,"helper",void 0),Nr([Re("default")],t.prototype,"scope",void 0),Nr([Re("")],t.prototype,"dragTarget",void 0),Nr([Re()],t.prototype,"axis",void 0),Nr([Re()],t.prototype,"queryPositionInfo",void 0),Nr([Re(!1)],t.prototype,"enableTailMode",void 0),Nr([Re(!1)],t.prototype,"skipDistanceCheck",void 0),Nr([Re(!0)],t.prototype,"preventDefault",void 0),Nr([Re(!1)],t.prototype,"enableAutoScroll",void 0),Nr([Re(!1)],t.prototype,"enableTapHold",void 0),Nr([Re(750)],t.prototype,"tapHoldThreshold",void 0),t=r=Nr([Ge],t)}(yr),Hr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lr=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},kr=function(e){function t(t,r){var n=e.call(this,r,t)||this;return n.mouseOver=!1,n.dragData={},n.dragStopCalled=!1,n.bind(),n}return Hr(t,e),t.prototype.bind=function(){this.wireEvents()},t.prototype.wireEvents=function(){Nt.add(this.element,xt.touchEndEvent,this.intDrop,this)},t.prototype.onPropertyChanged=function(e,t){},t.prototype.getModuleName=function(){return"droppable"},t.prototype.intOver=function(e,t){if(!this.mouseOver){var r=this.dragData[this.scope];this.trigger("over",{event:e,target:t,dragData:r}),this.mouseOver=!0}},t.prototype.intOut=function(e,t){this.mouseOver&&(this.trigger("out",{evt:e,target:t}),this.mouseOver=!1)},t.prototype.intDrop=function(e,t){if(this.dragStopCalled){this.dragStopCalled=!1;var r,n=!0,i=this.dragData[this.scope],o=!!i&&(i.helper&&Q(i.helper));o&&(r=this.isDropArea(e,i.helper,t),this.accept&&(n=me(i.helper,this.accept))),o&&this.drop&&r.canDrop&&n&&this.trigger("drop",{event:e,target:r.target,droppedElement:i.helper,dragData:i}),this.mouseOver=!1}},t.prototype.isDropArea=function(e,t,r){var n={canDrop:!0,target:r||e.target},i="touchend"===e.type;if(i||n.target===t){t.style.display="none";var o=i?e.changedTouches[0]:e,a=document.elementFromPoint(o.clientX,o.clientY);n.canDrop=!1,n.canDrop=v(a,this.element),n.canDrop&&(n.target=a),t.style.display=""}return n},t.prototype.destroy=function(){Nt.remove(this.element,xt.touchEndEvent,this.intDrop),e.prototype.destroy.call(this)},Lr([Re()],t.prototype,"accept",void 0),Lr([Re("default")],t.prototype,"scope",void 0),Lr([Be()],t.prototype,"drop",void 0),Lr([Be()],t.prototype,"over",void 0),Lr([Be()],t.prototype,"out",void 0),t=Lr([Ge],t)}(yr),Br=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gr=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},zr={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,space:32,escape:27,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,semicolon:186,plus:187,comma:188,minus:189,dot:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},Yr=function(e){function t(t,n){var i=e.call(this,n,t)||this;return i.keyPressHandler=function(e){for(var t=e.altKey,n=e.ctrlKey,o=e.shiftKey,a=e.which,s=0,l=Object.keys(i.keyConfigs);s<l.length;s++)for(var c=l[s],u=0,p=i.keyConfigs[c].split(",");u<p.length;u++){var h=p[u],d=r.getKeyConfigData(h.trim());t===d.altKey&&n===d.ctrlKey&&o===d.shiftKey&&a===d.keyCode&&(e.action=c,i.keyAction&&i.keyAction(e))}},i.bind(),i}Br(t,e),r=t,t.prototype.destroy=function(){this.unwireEvents(),e.prototype.destroy.call(this)},t.prototype.onPropertyChanged=function(e,t){},t.prototype.bind=function(){this.wireEvents()},t.prototype.getModuleName=function(){return"keyboard"},t.prototype.wireEvents=function(){this.element.addEventListener(this.eventName,this.keyPressHandler)},t.prototype.unwireEvents=function(){this.element.removeEventListener(this.eventName,this.keyPressHandler)},t.getKeyConfigData=function(e){if(e in this.configCache)return this.configCache[e];var t=e.toLowerCase().split("+"),n={altKey:-1!==t.indexOf("alt"),ctrlKey:-1!==t.indexOf("ctrl"),shiftKey:-1!==t.indexOf("shift"),keyCode:null};return t[t.length-1].length>1&&Number(t[t.length-1])?n.keyCode=Number(t[t.length-1]):n.keyCode=r.getKeyCode(t[t.length-1]),r.configCache[e]=n,n},t.getKeyCode=function(e){return zr[e]||e.toUpperCase().charCodeAt(0)};var r;return t.configCache={},Gr([Re({})],t.prototype,"keyConfigs",void 0),Gr([Re("keyup")],t.prototype,"eventName",void 0),Gr([Be()],t.prototype,"keyAction",void 0),t=r=Gr([Ge],t)}(yr),_r=function(){function t(t,r,n){this.controlName=t,this.localeStrings=r,this.setLocale(n||e.defaultCulture)}return t.prototype.setLocale=function(e){var r=this.intGetControlConstant(t.locale,e);this.currentLocale=r||this.localeStrings},t.load=function(e){this.locale=u(this.locale,e,{},!0)},t.prototype.getConstant=function(e){return p(this.currentLocale[e])?this.localeStrings[e]||"":this.currentLocale[e]},t.prototype.intGetControlConstant=function(e,t){return e[t]?e[t][this.controlName]:null},t.locale={},t}(),Xr=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wr=function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},$r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Xr(t,e),Wr([Re(50)],t.prototype,"swipeThresholdDistance",void 0),t}(Pr),Vr=/(Up|Down)/,Ur=function(e){function t(t,r){var n=e.call(this,r,t)||this;return n.touchAction=!0,n.tapCount=0,n.startEvent=function(e){if(!0===n.touchAction){var t=n.updateChangeTouches(e);void 0!==e.changedTouches&&(n.touchAction=!1),n.isTouchMoved=!1,n.movedDirection="",n.startPoint=n.lastMovedPoint={clientX:t.clientX,clientY:t.clientY},n.startEventData=t,n.hScrollLocked=n.vScrollLocked=!1,n.tStampStart=Date.now(),n.timeOutTapHold=setTimeout(function(){n.tapHoldEvent(e)},n.tapHoldThreshold),Nt.add(n.element,xt.touchMoveEvent,n.moveEvent,n),Nt.add(n.element,xt.touchEndEvent,n.endEvent,n),Nt.add(n.element,xt.touchCancelEvent,n.cancelEvent,n)}},n.moveEvent=function(e){var t=n.updateChangeTouches(e);n.movedPoint=t,n.isTouchMoved=!(t.clientX===n.startPoint.clientX&&t.clientY===n.startPoint.clientY);var r={};n.isTouchMoved&&(clearTimeout(n.timeOutTapHold),n.calcScrollPoints(e),r=u(r,{},{startEvents:n.startEventData,originalEvent:e,startX:n.startPoint.clientX,startY:n.startPoint.clientY,distanceX:n.distanceX,distanceY:n.distanceY,scrollDirection:n.scrollDirection,velocity:n.getVelocity(t)}),n.trigger("scroll",r),n.lastMovedPoint={clientX:t.clientX,clientY:t.clientY})},n.cancelEvent=function(e){clearTimeout(n.timeOutTapHold),clearTimeout(n.timeOutTap),n.tapCount=0,n.swipeFn(e),Nt.remove(n.element,xt.touchCancelEvent,n.cancelEvent)},n.endEvent=function(e){n.swipeFn(e),n.isTouchMoved||"function"==typeof n.tap&&(n.trigger("tap",{originalEvent:e,tapCount:++n.tapCount}),n.timeOutTap=setTimeout(function(){n.tapCount=0},n.tapThreshold)),n.modeclear()},n.swipeFn=function(e){clearTimeout(n.timeOutTapHold),clearTimeout(n.timeOutTap);var t=n.updateChangeTouches(e),r=t.clientX-n.startPoint.clientX,i=t.clientY-n.startPoint.clientY;r=Math.floor(r<0?-1*r:r),i=Math.floor(i<0?-1*i:r),n.isTouchMoved=r>1||i>1,/Mozilla|Firefox/.test(xt.userAgent)&&0===t.clientX&&0===t.clientY&&"mouseup"===e.type&&(n.isTouchMoved=!1),n.endPoint=t,n.calcPoints(e);var o={originalEvent:e,startEvents:n.startEventData,startX:n.startPoint.clientX,startY:n.startPoint.clientY,distanceX:n.distanceX,distanceY:n.distanceY,swipeDirection:n.movedDirection,velocity:n.getVelocity(t)};if(n.isTouchMoved){var a=void 0,s=n.swipeSettings.swipeThresholdDistance;a=u(a,n.defaultArgs,o);var l=!1,c=n.element,p=n.isScrollable(c),h=Vr.test(n.movedDirection);(s<n.distanceX&&!h||s<n.distanceY&&h)&&(l=!p||n.checkSwipe(c,h)),l&&n.trigger("swipe",a)}n.modeclear()},n.modeclear=function(){n.modeClear=setTimeout(function(){n.touchAction=!0},"function"!=typeof n.tap?0:20),n.lastTapTime=(new Date).getTime(),Nt.remove(n.element,xt.touchMoveEvent,n.moveEvent),Nt.remove(n.element,xt.touchEndEvent,n.endEvent),Nt.remove(n.element,xt.touchCancelEvent,n.cancelEvent)},n.bind(),n}return Xr(t,e),t.prototype.onPropertyChanged=function(e,t){},t.prototype.bind=function(){this.wireEvents(),xt.isIE&&this.element.classList.add("e-block-touch")},t.prototype.destroy=function(){this.unwireEvents(),e.prototype.destroy.call(this)},t.prototype.wireEvents=function(){Nt.add(this.element,xt.touchStartEvent,this.startEvent,this)},t.prototype.unwireEvents=function(){Nt.remove(this.element,xt.touchStartEvent,this.startEvent)},t.prototype.getModuleName=function(){return"touch"},t.prototype.isScrollable=function(e){var t=getComputedStyle(e),r=t.overflow+t.overflowX+t.overflowY;return!!/(auto|scroll)/.test(r)},t.prototype.tapHoldEvent=function(e){this.tapCount=0,this.touchAction=!0;var t;Nt.remove(this.element,xt.touchMoveEvent,this.moveEvent),Nt.remove(this.element,xt.touchEndEvent,this.endEvent),t={originalEvent:e},this.trigger("tapHold",t),Nt.remove(this.element,xt.touchCancelEvent,this.cancelEvent)},t.prototype.calcPoints=function(e){var t=this.updateChangeTouches(e);this.defaultArgs={originalEvent:e},this.distanceX=Math.abs(Math.abs(t.clientX)-Math.abs(this.startPoint.clientX)),this.distanceY=Math.abs(Math.abs(t.clientY)-Math.abs(this.startPoint.clientY)),this.distanceX>this.distanceY?this.movedDirection=t.clientX>this.startPoint.clientX?"Right":"Left":this.movedDirection=t.clientY<this.startPoint.clientY?"Up":"Down"},t.prototype.calcScrollPoints=function(e){var t=this.updateChangeTouches(e);this.defaultArgs={originalEvent:e},this.distanceX=Math.abs(Math.abs(t.clientX)-Math.abs(this.lastMovedPoint.clientX)),this.distanceY=Math.abs(Math.abs(t.clientY)-Math.abs(this.lastMovedPoint.clientY)),(this.distanceX>this.distanceY||!0===this.hScrollLocked)&&!1===this.vScrollLocked?(this.scrollDirection=t.clientX>this.lastMovedPoint.clientX?"Right":"Left",this.hScrollLocked=!0):(this.scrollDirection=t.clientY<this.lastMovedPoint.clientY?"Up":"Down",this.vScrollLocked=!0)},t.prototype.getVelocity=function(e){var t=e.clientX,r=e.clientY,n=Date.now(),i=t-this.startPoint.clientX,o=r-this.startPoint.clientX,a=n-this.tStampStart;return Math.sqrt(i*i+o*o)/a},t.prototype.checkSwipe=function(e,t){var r=["scroll","offset"],n=t?["Height","Top"]:["Width","Left"];return e[r[0]+n[0]]<=e[r[1]+n[0]]||(0===e[r[0]+n[1]]||e[r[1]+n[0]]+e[r[0]+n[1]]>=e[r[0]+n[0]])},t.prototype.updateChangeTouches=function(e){return e.changedTouches&&0!==e.changedTouches.length?e.changedTouches[0]:e},Wr([Be()],t.prototype,"tap",void 0),Wr([Be()],t.prototype,"tapHold",void 0),Wr([Be()],t.prototype,"swipe",void 0),Wr([Be()],t.prototype,"scroll",void 0),Wr([Re(350)],t.prototype,"tapThreshold",void 0),Wr([Re(750)],t.prototype,"tapHoldThreshold",void 0),Wr([Ie({},$r)],t.prototype,"swipeSettings",void 0),t=Wr([Ge],t)}(yr),Kr=["script","style","iframe[src]",'link[href*="javascript:"]','object[type="text/x-scriptlet"]','object[data^="data:text/html;base64"]','img[src^="data:text/html;base64"]','[src^="javascript:"]','[dynsrc^="javascript:"]','[lowsrc^="javascript:"]','[type^="application/x-shockwave-flash"]'],qr=[{attribute:"href",selector:'[href*="javascript:"]'},{attribute:"background",selector:'[background^="javascript:"]'},{attribute:"style",selector:'[style*="javascript:"]'},{attribute:"style",selector:'[style*="expression("]'},{attribute:"href",selector:'a[href^="data:text/html;base64"]'}],Zr=["onchange","onclick","onmouseover","onmouseout","onkeydown","onload","onerror","onblur","onfocus","onbeforeload","onbeforeunload","onkeyup","onsubmit","onafterprint","onbeforeonload","onbeforeprint","onblur","oncanplay","oncanplaythrough","onchange","onclick","oncontextmenu","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onerror","onfocus","onformchange","onforminput","onhaschange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onoffline","onoine","ononline","onpagehide","onpageshow","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreadystatechange","onredo","onresize","onscroll","onseeked","onseeking","onselect","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","onundo","onunload","onvolumechange","onwaiting","onmouseenter","onmouseleave","onmousewheel","onstart","onpropertychange"],Jr=function(){function e(){}return e.beforeSanitize=function(){return{selectors:{tags:Kr,attributes:qr}}},e.sanitize=function(e){var t=this.beforeSanitize();return this.serializeValue(t,e)},e.serializeValue=function(e,t){this.removeAttrs=e.selectors.attributes,this.removeTags=e.selectors.tags,this.wrapElement=document.createElement("div"),this.wrapElement.innerHTML=t,this.removeXssTags(),this.removeJsEvents(),this.removeXssAttrs();var r=this.wrapElement.innerHTML;return this.removeElement(),r},e.removeElement=function(){for(var e=this.wrapElement.children,t=0;t<e.length;t++)for(var r=e[t].attributes,n=0;n<r.length;n++)this.wrapElement.children[t].removeAttribute(r[n].localName)},e.removeXssTags=function(){var e=this.wrapElement.querySelectorAll(this.removeTags.join(","));e.length>0&&e.forEach(function(e){ne(e)})},e.removeJsEvents=function(){var e=this.wrapElement.querySelectorAll("["+Zr.join("],[")+"]");e.length>0&&e.forEach(function(e){Zr.forEach(function(t){e.hasAttribute(t)&&e.removeAttribute(t)})})},e.removeXssAttrs=function(){var e=this;this.removeAttrs.forEach(function(t,r){var n=e.wrapElement.querySelectorAll(t.selector);n.length>0&&n.forEach(function(e){e.removeAttribute(t.attribute)})})},e}();return e.blazorCultureFormats=Pt,e.Ajax=Ct,e.Animation=Dr,e.rippleEffect=We,e.enableRipple=Ze,e.Base=yr,e.getComponent=ye,e.removeChildInstance=be,e.Browser=xt,e.enableVersionBasedPersistence=Je,e.Component=jr,e.ChildProperty=Pr,e.Position=Rr,e.Draggable=Ir,e.Droppable=kr,e.EventHandler=Nt,e.onIntlChange=Mt,e.cldrData=Dt,e.Internationalization=Et,e.setCulture=j,e.setCurrencyCode=x,e.loadCldr=N,e.enableRtl=F,e.getNumericObject=A,e.getNumberDependable=R,e.getDefaultDateObject=I,e.KeyboardEvents=Yr,e.L10n=_r,e.ModuleLoader=Er,e.Property=Re,e.Complex=Ie,e.ComplexFactory=He,e.Collection=Le,e.CollectionFactory=ke,e.Event=Be,e.NotifyPropertyChanges=Ge,e.CreateBuilder=_e,e.SwipeSettings=$r,e.Touch=Ur,e.blazorTemplates=Jt,e.getRandomId=_,e.compile=X,e.updateBlazorTemplate=W,e.resetBlazorTemplate=$,e.setTemplateEngine=V,e.getTemplateEngine=U,e.disableBlazorMode=t,e.createInstance=r,e.setImmediate=n,e.getValue=i,e.setValue=o,e.deleteObject=a,e.isObject=s,e.getEnumValue=l,e.merge=c,e.extend=u,e.isNullOrUndefined=p,e.isUndefined=h,e.getUniqueID=d,e.debounce=m,e.queryParams=f,e.isObjectArray=g,e.compareElementParent=v,e.throwError=y,e.print=b,e.formatUnit=M,e.enableBlazorMode=D,e.isBlazor=w,e.getElement=E,e.getInstance=P,e.addInstance=S,e.uniqueID=O,e.createElement=K,e.addClass=q,e.removeClass=Z,e.isVisible=Q,e.prepend=ee,e.append=te,e.detach=ne,e.remove=ie,e.attributes=oe,e.select=ae,e.selectAll=se,e.closest=ce,e.siblings=ue,e.getAttributeOrDefault=pe,e.setStyleAttribute=he,e.classList=de,e.matches=me,e.includeInnerHTML=fe,e.containsClass=ge,e.cloneNode=ve,e.Observer=bt,e.SanitizeHtmlHelper=Jr,e}({}),this.ejs=ej;
- /*!
- * filename: ej2-data.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.data=function(e,t){"use strict";var r=function(){function e(e){return this.subQuery=null,this.isChild=!1,this.distincts=[],this.queries=[],this.key="",this.fKey="","string"==typeof e?this.fromTable=e:e&&e instanceof Array&&(this.lookups=e),this.expands=[],this.sortedColumns=[],this.groupedColumns=[],this.subQuery=null,this.isChild=!1,this.params=[],this.lazyLoad=[],this}return e.prototype.setKey=function(e){return this.key=e,this},e.prototype.using=function(e){return this.dataManager=e,this},e.prototype.execute=function(e,t,r,n){return e=e||this.dataManager,e?e.executeQuery(this,t,r,n):a.throwError('Query - execute() : dataManager needs to be is set using "using" function or should be passed as argument')},e.prototype.executeLocal=function(e){return e=e||this.dataManager,e?e.executeLocal(this):a.throwError('Query - executeLocal() : dataManager needs to be is set using "using" function or should be passed as argument')},e.prototype.clone=function(){var t=new e;return t.queries=this.queries.slice(0),t.key=this.key,t.isChild=this.isChild,t.dataManager=this.dataManager,t.fromTable=this.fromTable,t.params=this.params.slice(0),t.expands=this.expands.slice(0),t.sortedColumns=this.sortedColumns.slice(0),t.groupedColumns=this.groupedColumns.slice(0),t.subQuerySelector=this.subQuerySelector,t.subQuery=this.subQuery,t.fKey=this.fKey,t.isCountRequired=this.isCountRequired,t.distincts=this.distincts.slice(0),t.lazyLoad=this.lazyLoad.slice(0),t},e.prototype.from=function(e){return this.fromTable=e,this},e.prototype.addParams=function(e,t){return"function"==typeof t?this.params.push({key:e,fn:t}):this.params.push({key:e,value:t}),this},e.prototype.distinct=function(e){return this.distincts="string"==typeof e?[].slice.call([e],0):e.slice(0),this},e.prototype.expand=function(e){return this.expands="string"==typeof e?[].slice.call([e],0):e.slice(0),this},e.prototype.where=function(e,t,r,o,a){t=t?t.toLowerCase():null;var s=null;return"string"==typeof e?s=new n(e,t,r,o,a):e instanceof n&&(s=e),this.queries.push({fn:"onWhere",e:s}),this},e.prototype.search=function(e,t,r,n,o){"string"==typeof t&&(t=[t]),r&&"none"!==r||(r="contains");var s=a.fnOperators[r];return this.queries.push({fn:"onSearch",e:{fieldNames:t,operator:r,searchKey:e,ignoreCase:n,ignoreAccent:o,comparer:s}}),this},e.prototype.sortBy=function(e,t,r){return this.sortByForeignKey(e,t,r)},e.prototype.sortByForeignKey=function(r,n,o,s){var i,u,c=t.isNullOrUndefined(s)?"ascending":s;if("string"==typeof r&&a.endsWith(r.toLowerCase()," desc")&&(r=r.replace(/ desc$/i,""),n="descending"),n&&"string"!=typeof n||(c=n?n.toLowerCase():"ascending",n=a.fnSort(n)),o){i=e.filterQueries(this.queries,"onSortBy");for(var l=0;l<i.length;l++)if("string"==typeof(u=i[l].e.fieldName)){if(u===r)return this}else if(u instanceof Array)for(var p=0;p<u.length;p++)if(u[p]===r||r.toLowerCase()===u[p]+" desc")return this}return this.queries.push({fn:"onSortBy",e:{fieldName:r,comparer:n,direction:c}}),this},e.prototype.sortByDesc=function(e){return this.sortBy(e,"descending")},e.prototype.group=function(e,t,r){return this.sortBy(e,null,!0),this.queries.push({fn:"onGroup",e:{fieldName:e,comparer:t||null,format:r||null}}),this},e.prototype.page=function(e,t){return this.queries.push({fn:"onPage",e:{pageIndex:e,pageSize:t}}),this},e.prototype.range=function(e,t){return this.queries.push({fn:"onRange",e:{start:e,end:t}}),this},e.prototype.take=function(e){return this.queries.push({fn:"onTake",e:{nos:e}}),this},e.prototype.skip=function(e){return this.queries.push({fn:"onSkip",e:{nos:e}}),this},e.prototype.select=function(e){return"string"==typeof e&&(e=[].slice.call([e],0)),this.queries.push({fn:"onSelect",e:{fieldNames:e}}),this},e.prototype.hierarchy=function(e,t){return this.subQuerySelector=t,this.subQuery=e,this},e.prototype.foreignKey=function(e){return this.fKey=e,this},e.prototype.requiresCount=function(){return this.isCountRequired=!0,this},e.prototype.aggregate=function(e,t){return this.queries.push({fn:"onAggregates",e:{field:t,type:e}}),this},e.filterQueries=function(e,t){return e.filter(function(e){return e.fn===t})},e.filterQueryLists=function(e,t){for(var r=e.filter(function(e){return-1!==t.indexOf(e.fn)}),n={},o=0;o<r.length;o++)n[r[o].fn]||(n[r[o].fn]=r[o].e);return n},e}(),n=function(){function e(t,r,n,o,s){return void 0===o&&(o=!1),this.ignoreAccent=!1,this.isComplex=!1,"string"==typeof t?(this.field=t,this.operator=r.toLowerCase(),this.value=n,this.ignoreCase=o,this.ignoreAccent=s,this.isComplex=!1,this.comparer=a.fnOperators.processOperator(this.operator)):(t instanceof e&&n instanceof e||n instanceof Array)&&(this.isComplex=!0,this.condition=r.toLowerCase(),this.predicates=[t],n instanceof Array?[].push.apply(this.predicates,n):this.predicates.push(n)),this}return e.and=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.combinePredicates([].slice.call(t,0),"and")},e.prototype.and=function(t,r,n,o,a){return e.combine(this,t,r,n,"and",o,a)},e.or=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.combinePredicates([].slice.call(t,0),"or")},e.prototype.or=function(t,r,n,o,a){return e.combine(this,t,r,n,"or",o,a)},e.fromJson=function(e){if(e instanceof Array){for(var t=[],r=0,n=e.length;r<n;r++)t.push(this.fromJSONData(e[r]));return t}var o=e;return this.fromJSONData(o)},e.prototype.validate=function(e){var t,r,n=this.predicates?this.predicates:[];if(!this.isComplex&&this.comparer)return this.comparer.call(this,a.getObject(this.field,e),this.value,this.ignoreCase,this.ignoreAccent);t="and"===this.condition;for(var o=0;o<n.length;o++)if(r=n[o].validate(e),t){if(!r)return!1}else if(r)return!0;return t},e.prototype.toJson=function(){var e,t;if(this.isComplex){e=[],t=this.predicates;for(var r=0;r<t.length;r++)e.push(t[r].toJson())}return{isComplex:this.isComplex,field:this.field,operator:this.operator,value:this.value,ignoreCase:this.ignoreCase,ignoreAccent:this.ignoreAccent,condition:this.condition,predicates:e}},e.combinePredicates=function(t,r){if(1===t.length){if(!(t[0]instanceof Array))return t[0];t=t[0]}return new e(t[0],r,t.slice(1))},e.combine=function(t,r,n,o,s,i,u){return r instanceof e?e[s](t,r):"string"==typeof r?e[s](t,new e(r,n,o,i,u)):a.throwError("Predicate - "+s+" : invalid arguments")},e.fromJSONData=function(t){for(var r=t.predicates||[],n=r.length,o=[],a=0;a<n;a++)o.push(this.fromJSONData(r[a]));return t.isComplex?new e(o[0],t.condition,o.slice(1)):new e(t.field,t.operator,t.value,t.ignoreCase,t.ignoreAccent)},e}(),o={GroupGuid:"{271bbba0-1ee7}"},a=function(){function e(){}return e.getValue=function(e,t){return"function"==typeof e?e.call(t||{}):e},e.endsWith=function(e,t){return e.slice&&e.slice(-t.length)===t},e.startsWith=function(e,t){return e.slice(0,t.length)===t},e.fnSort=function(t){return t=t?e.toLowerCase(t):"ascending","ascending"===t?this.fnAscending:this.fnDescending},e.fnAscending=function(e,r){return t.isNullOrUndefined(e)&&t.isNullOrUndefined(r)?-1:null===r||void 0===r?-1:"string"==typeof e?e.localeCompare(r):null===e||void 0===e?1:e-r},e.fnDescending=function(e,r){return t.isNullOrUndefined(e)&&t.isNullOrUndefined(r)?-1:null===r||void 0===r?1:"string"==typeof e?-1*e.localeCompare(r):null===e||void 0===e?-1:r-e},e.extractFields=function(e,t){for(var r={},n=0;n<t.length;n++)r=this.setValue(t[n],this.getObject(t[n],e),r);return r},e.select=function(e,t){for(var r=[],n=0;n<e.length;n++)r.push(this.extractFields(e[n],t));return r},e.group=function(r,n,a,s,i,u,c){s=s||1;var l=r;if(l.GroupGuid===o.GroupGuid){for(var p=this,d=0;d<l.length;d++)!function(e){if(t.isNullOrUndefined(i))l[e].items=p.group(l[e].items,n,a,l.level+1,null,u,c),l[e].count=l[e].items.length;else{var r=-1,o=i.filter(function(t){return t.key===l[e].key});r=i.indexOf(o[0]),l[e].items=p.group(l[e].items,n,a,l.level+1,i[r].items,u,c),l[e].count=i[r].count}}(d);return l.childLevels+=1,l}var h={},f=[];f.GroupGuid=o.GroupGuid,f.level=s,f.childLevels=0,f.records=l;for(var g=this,y=0;y<l.length;y++)!function(e){var r=g.getVal(l,e,n);if(t.isNullOrUndefined(u)||(r=u(r,n)),!h[r]&&(h[r]={key:r,count:0,items:[],aggregates:{},field:n},f.push(h[r]),!t.isNullOrUndefined(i))){var o=i.filter(function(e){return e.key===h[r].key});h[r].count=o[0].count}h[r].count=t.isNullOrUndefined(i)?h[r].count+=1:h[r].count,(!c||c&&a.length)&&h[r].items.push(l[e])}(y);if(a&&a.length)for(y=0;y<f.length;y++)!function(r){for(var n={},o=void 0,s=a,u=0;u<a.length;u++)if(o=e.aggregates[a[u].type],t.isNullOrUndefined(i))o&&(n[s[u].field+" - "+s[u].type]=o(f[r].items,s[u].field));else{var c=i.filter(function(e){return e.key===f[r].key});o&&(n[s[u].field+" - "+s[u].type]=o(c[0].items,s[u].field))}f[r].aggregates=n}(y);if(c&&f.length&&a.length)for(y=0;y<f.length;y++)f[y].items=[];return l.length&&f||l},e.buildHierarchy=function(e,t,r,n,o){var a,s={};for(n.result&&(n=n.result),n.GroupGuid&&this.throwError("DataManager: Do not have support Grouping in hierarchy"),a=0;a<n.length;a++)(s[i=this.getObject(e,n[a])]||(s[i]=[])).push(n[a]);for(a=0;a<r.length;a++){var i=this.getObject(o||e,r[a]);r[a][t]=s[i]}},e.getFieldList=function(e,t,r){if(void 0===r&&(r=""),void 0===t||null===t)return this.getFieldList(e,[],r);for(var n=e,o=0,a=Object.keys(e);o<a.length;o++){var s=a[o];"object"!=typeof n[s]||n[s]instanceof Array?t.push(r+s):this.getFieldList(n[s],t,r+s+".")}return t},e.getObject=function(e,t){if(!e)return t;if(t){if(-1===e.indexOf("."))return t[e];for(var r=t,n=e.split("."),o=0;o<n.length&&null!=r;o++)r=r[n[o]];return r}},e.setValue=function(e,r,n){var o,a,s=e.toString().split("."),i=n||{},u=i,c=s.length;for(o=0;o<c;o++)a=s[o],o+1===c?u[a]=void 0===r?void 0:r:t.isNullOrUndefined(u[a])&&(u[a]={}),u=u[a];return i},e.sort=function(e,t,r){if(e.length<=1)return e;var n=parseInt((e.length/2).toString(),10),o=e.slice(0,n),a=e.slice(n);return o=this.sort(o,t,r),a=this.sort(a,t,r),this.merge(o,a,t,r)},e.ignoreDiacritics=function(t){return"string"!=typeof t?t:t.split("").map(function(t){return t in e.diacritics?e.diacritics[t]:t}).join("")},e.merge=function(e,t,r,n){for(var o,a=[];e.length>0||t.length>0;)o=e.length>0&&t.length>0?n?n(this.getVal(e,0,r),this.getVal(t,0,r),e[0],t[0])<=0?e:t:e[0][r]<e[0][r]?e:t:e.length>0?e:t,a.push(o.shift());return a},e.getVal=function(e,t,r){return r?this.getObject(r,e[t]):e[t]},e.toLowerCase=function(e){return e?"string"==typeof e?e.toLowerCase():e.toString():0===e||!1===e?e.toString():""},e.callAdaptorFunction=function(e,r,n,o){if(r in e){var a=e[r](n,o);t.isNullOrUndefined(a)||(n=a)}return n},e.getAddParams=function(t,r,n){var o={};return e.callAdaptorFunction(t,"addParams",{dm:r,query:n,params:n.params,reqParams:o}),o},e.isPlainObject=function(e){return!!e&&e.constructor===Object},e.isCors=function(){var e=null;try{e=new window.XMLHttpRequest}catch(e){}return!!e&&"withCredentials"in e},e.getGuid=function(e){var t;return(e||"")+"00000000-0000-4000-0000-000000000000".replace(/0/g,function(e,r){if("crypto"in window&&"getRandomValues"in crypto){var n=new Uint8Array(1);window.crypto.getRandomValues(n),t=n[0]%16|0}else t=16*Math.random()|0;return"0123456789abcdef"[19===r?3&t|8:t]})},e.isNull=function(e){return void 0===e||null===e},e.getItemFromComparer=function(r,n,o){var a,s,i,u=0,c="string"==typeof e.getVal(r,0,n);if(r.length)for(;t.isNullOrUndefined(a)&&u<r.length;)a=e.getVal(r,u,n),i=r[u++];for(;u<r.length;u++)s=e.getVal(r,u,n),t.isNullOrUndefined(s)||(c&&(a=+a,s=+s),o(a,s)>0&&(a=s,i=r[u]));return i},e.distinct=function(r,n,o){o=!t.isNullOrUndefined(o)&&o;var a,s=[],i={};return r.forEach(function(t,u){(a="object"==typeof r[u]?e.getVal(r,u,n):r[u])in i||(s.push(o?r[u]:a),i[a]=1)}),s},e.serverTimezoneOffset=null,e.timeZoneHandling=!0,e.throwError=function(e){try{throw new Error(e)}catch(e){throw e.message+"\n"+e.stack}},e.aggregates={sum:function(t,r){for(var n,o=0,a="number"!=typeof e.getVal(t,0,r),s=0;s<t.length;s++)n=e.getVal(t,s,r),isNaN(n)||null===n||(a&&(n=+n),o+=n);return o},average:function(t,r){return e.aggregates.sum(t,r)/t.length},min:function(t,r){var n;return"function"==typeof r&&(n=r,r=null),e.getObject(r,e.getItemFromComparer(t,r,n||e.fnAscending))},max:function(t,r){var n;return"function"==typeof r&&(n=r,r=null),e.getObject(r,e.getItemFromComparer(t,r,n||e.fnDescending))},truecount:function(e,t){return new m(e).executeLocal((new r).where(t,"equal",!0,!0)).length},falsecount:function(e,t){return new m(e).executeLocal((new r).where(t,"equal",!1,!0)).length},count:function(e,t){return e.length}},e.operatorSymbols={"<":"lessthan",">":"greaterthan","<=":"lessthanorequal",">=":"greaterthanorequal","==":"equal","!=":"notequal","*=":"contains","$=":"endswith","^=":"startswith"},e.odBiOperator={"<":" lt ",">":" gt ","<=":" le ",">=":" ge ","==":" eq ","!=":" ne ",lessthan:" lt ",lessthanorequal:" le ",greaterthan:" gt ",greaterthanorequal:" ge ",equal:" eq ",notequal:" ne "},e.odUniOperator={"$=":"endswith","^=":"startswith","*=":"substringof",endswith:"endswith",startswith:"startswith",contains:"substringof"},e.odv4UniOperator={"$=":"endswith","^=":"startswith","*=":"contains",endswith:"endswith",startswith:"startswith",contains:"contains"},e.diacritics={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},e.fnOperators={equal:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),n?e.toLowerCase(t)===e.toLowerCase(r):t===r},notequal:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),!e.fnOperators.equal(t,r,n)},lessthan:function(t,r,n){return n?e.toLowerCase(t)<e.toLowerCase(r):t<r},greaterthan:function(t,r,n){return n?e.toLowerCase(t)>e.toLowerCase(r):t>r},lessthanorequal:function(t,r,n){return n?e.toLowerCase(t)<=e.toLowerCase(r):t<=r},greaterthanorequal:function(t,r,n){return n?e.toLowerCase(t)>=e.toLowerCase(r):t>=r},contains:function(r,n,o,a){return a&&(r=e.ignoreDiacritics(r),n=e.ignoreDiacritics(n)),o?!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(n)&&-1!==e.toLowerCase(r).indexOf(e.toLowerCase(n)):!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(n)&&-1!==r.toString().indexOf(n)},notnull:function(e){return null!==e},isnull:function(e){return null===e},startswith:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),n?t&&r&&e.startsWith(e.toLowerCase(t),e.toLowerCase(r)):t&&r&&e.startsWith(t,r)},endswith:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),n?t&&r&&e.endsWith(e.toLowerCase(t),e.toLowerCase(r)):t&&r&&e.endsWith(t,r)},processSymbols:function(t){var r=e.operatorSymbols[t];return r?e.fnOperators[r]:e.throwError("Query - Process Operator : Invalid operator")},processOperator:function(t){var r=e.fnOperators[t];return r||e.fnOperators.processSymbols(t)}},e.parse={parseJson:function(t){return"string"==typeof t?t=JSON.parse(t,e.parse.jsonReviver):t instanceof Array?e.parse.iterateAndReviveArray(t):"object"==typeof t&&null!==t&&e.parse.iterateAndReviveJson(t),t},iterateAndReviveArray:function(t){for(var r=0;r<t.length;r++)"object"==typeof t[r]&&null!==t[r]?e.parse.iterateAndReviveJson(t[r]):"string"!=typeof t[r]||/^[\s]*\[|^[\s]*\{(.)+:|\"/g.test(t[r])?t[r]=e.parse.parseJson(t[r]):t[r]=e.parse.jsonReviver("",t[r])},iterateAndReviveJson:function(t){for(var r,n=0,o=Object.keys(t);n<o.length;n++){var a=o[n];e.startsWith(a,"__")||("object"==typeof(r=t[a])?r instanceof Array?e.parse.iterateAndReviveArray(r):r&&e.parse.iterateAndReviveJson(r):t[a]=e.parse.jsonReviver(t[a],r))}},jsonReviver:function(t,r){if("string"==typeof r){var n=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(r),o=e.timeZoneHandling?e.serverTimezoneOffset:null;if(n)return e.dateParse.toTimeZone(new Date(parseInt(n[1],10)),o,!0);if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(r)){var a=r.indexOf("Z")>-1||r.indexOf("z")>-1,s=r.split(/[^0-9.]/);if(a)r=e.dateParse.toTimeZone(new Date(parseInt(s[0],10),parseInt(s[1],10)-1,parseInt(s[2],10),parseInt(s[3],10),parseInt(s[4],10),parseInt(s[5],10)),e.serverTimezoneOffset,!1);else{var i=new Date(parseInt(s[0],10),parseInt(s[1],10)-1,parseInt(s[2],10),parseInt(s[3],10),parseInt(s[4],10),parseInt(s[5],10)),u=parseInt(s[6],10),c=parseInt(s[7],10);if(isNaN(u)&&isNaN(c))return i;r.indexOf("+")>-1?i.setHours(i.getHours()-u,i.getMinutes()-c):i.setHours(i.getHours()+u,i.getMinutes()+c),r=e.dateParse.toTimeZone(i,e.serverTimezoneOffset,!1)}null==e.serverTimezoneOffset&&(r=e.dateParse.addSelfOffset(r))}}return r},isJson:function(t){return"string"==typeof t[0]?t:e.parse.parseJson(t)},isGuid:function(e){return null!=/[A-Fa-f0-9]{8}(?:-[A-Fa-f0-9]{4}){3}-[A-Fa-f0-9]{12}/i.exec(e)},replacer:function(t,r){return e.isPlainObject(t)?e.parse.jsonReplacer(t,r):t instanceof Array?e.parse.arrayReplacer(t):t instanceof Date?e.parse.jsonReplacer({val:t},r).val:t},jsonReplacer:function(t,r){for(var n,o=0,a=Object.keys(t);o<a.length;o++){var s=a[o];if((n=t[s])instanceof Date){var i=n;null==e.serverTimezoneOffset?t[s]=e.dateParse.toTimeZone(i,null).toJSON():(i=new Date(+i+36e5*e.serverTimezoneOffset),t[s]=e.dateParse.toTimeZone(e.dateParse.addSelfOffset(i),null).toJSON())}}return t},arrayReplacer:function(t){for(var r=0;r<t.length;r++)e.isPlainObject(t[r])?t[r]=e.parse.jsonReplacer(t[r]):t[r]instanceof Date&&(t[r]=e.parse.jsonReplacer({date:t[r]}).date);return t},jsonDateReplacer:function(t,r){if("value"===t&&r){if("string"==typeof r){var n=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(r);if(n)r=e.dateParse.toTimeZone(new Date(parseInt(n[1],10)),null,!0);else if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(r)){var o=r.split(/[^0-9]/);r=e.dateParse.toTimeZone(new Date(parseInt(o[0],10),parseInt(o[1],10)-1,parseInt(o[2],10),parseInt(o[3],10),parseInt(o[4],10),parseInt(o[5],10)),null,!0)}}if(r instanceof Date)return r=e.dateParse.addSelfOffset(r),null===e.serverTimezoneOffset?e.dateParse.toTimeZone(e.dateParse.addSelfOffset(r),null).toJSON():(r=e.dateParse.toTimeZone(r,r.getTimezoneOffset()/60*2-e.serverTimezoneOffset,!1)).toJSON()}return r}},e.dateParse={addSelfOffset:function(e){return new Date(+e-6e4*e.getTimezoneOffset())},toUTC:function(e){return new Date(+e+6e4*e.getTimezoneOffset())},toTimeZone:function(t,r,n){if(null===r)return t;var o=n?e.dateParse.toUTC(t):t;return new Date(+o-36e5*r)},toLocalTime:function(e){var t=e,r=-t.getTimezoneOffset(),n=r>=0?"+":"-",o=function(e){var t=Math.floor(Math.abs(e));return(t<10?"0":"")+t};return t.getFullYear()+"-"+o(t.getMonth()+1)+"-"+o(t.getDate())+"T"+o(t.getHours())+":"+o(t.getMinutes())+":"+o(t.getSeconds())+n+o(r/60)+":"+o(r%60)}},e}(),s=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i={GroupGuid:"{271bbba0-1ee7}"},u=function(){function e(t){this.options={from:"table",requestType:"json",sortBy:"sorted",select:"select",skip:"skip",group:"group",take:"take",search:"search",count:"requiresCounts",where:"where",aggregates:"aggregates",expand:"expand"},this.type=e,this.dataSource=t,this.pvt={}}return e.prototype.processResponse=function(e,t,r,n){return e},e}(),c=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.processQuery=function(e,t){for(var r,n,o,a=e.dataSource.json.slice(0),s=a.length,i=!0,u={},c=0,l=[],p=0;p<t.lazyLoad.length;p++)c++,u[t.lazyLoad[p].key]=t.lazyLoad[p].value;for(var d={},p=0;p<t.queries.length;p++)"onPage"!==(n=t.queries[p]).fn&&"onGroup"!==n.fn||!t.lazyLoad.length?(r=this[n.fn].call(this,a,n.e,t),"onAggregates"===n.fn?d[n.e.field+" - "+n.e.type]=r:a=void 0!==r?r:a,"onPage"!==n.fn&&"onSkip"!==n.fn&&"onTake"!==n.fn&&"onRange"!==n.fn||(i=!1),i&&(s=a.length)):("onGroup"===n.fn&&l.push(n.e),"onPage"===n.fn&&(o=n.e));if(c){var h={query:t,lazyLoad:u,result:a,group:l,page:o},f=this.lazyLoadGroup(h);a=f.result,s=f.count}return t.isCountRequired&&(a={result:a,count:s,aggregates:d}),a},n.prototype.lazyLoadGroup=function(e){var r=0,n=this.getAggregate(e.query),o=e.result;if(t.isNullOrUndefined(e.lazyLoad.onDemandGroupInfo)){u=e.group[0].fieldName;r=(o=a.group(o,u,n,null,null,e.group[0].comparer,!0)).length;c=o;e.page&&(o=this.onPage(o,e.page,e.query)),this.formGroupResult(o,c)}else{for(var s=e.lazyLoad.onDemandGroupInfo,i=s.where.length-1;i>=0;i--)o=this.onWhere(o,s.where[i]);if(e.group.length!==s.level){var u=e.group[s.level].fieldName;o=a.group(o,u,n,null,null,e.group[0].comparer,!0)}r=o.length;var c=o;o=(o=o.slice(s.skip)).slice(0,s.take),e.group.length!==s.level&&this.formGroupResult(o,c)}return{result:o,count:r}},n.prototype.formGroupResult=function(e,t){if(e.length&&t.length){e.GroupGuid=t.GroupGuid,e.childLevels=t.childLevels,e.level=t.level,e.records=t.records}return e},n.prototype.getAggregate=function(e){var t=r.filterQueries(e.queries,"onAggregates"),n=[];if(t.length)for(var o=void 0,s=0;s<t.length;s++)o=t[s].e,n.push({type:o.type,field:a.getValue(o.field,e)});return n},n.prototype.batchRequest=function(e,t,r){var n,o=t.deletedRecords.length;for(n=0;n<t.addedRecords.length;n++)this.insert(e,t.addedRecords[n]);for(n=0;n<t.changedRecords.length;n++)this.update(e,r.key,t.changedRecords[n]);for(n=0;n<o;n++)this.remove(e,r.key,t.deletedRecords[n]);return t},n.prototype.onWhere=function(e,t){return e&&e.length?e.filter(function(e){if(t)return t.validate(e)}):e},n.prototype.onAggregates=function(e,t){var r=a.aggregates[t.type];return e&&r&&0!==e.length?r(e,t.field):null},n.prototype.onSearch=function(e,t){return e&&e.length?(0===t.fieldNames.length&&a.getFieldList(e[0],t.fieldNames),e.filter(function(e){for(var r=0;r<t.fieldNames.length;r++)if(t.comparer.call(e,a.getObject(t.fieldNames[r],e),t.searchKey,t.ignoreCase,t.ignoreAccent))return!0;return!1})):e},n.prototype.onSortBy=function(e,t,r){if(!e||!e.length)return e;var n,o=a.getValue(t.fieldName,r);if(!o)return e.sort(t.comparer);if(o instanceof Array){for(var s=(o=o.slice(0)).length-1;s>=0;s--)o[s]&&(n=t.comparer,a.endsWith(o[s]," desc")&&(n=a.fnSort("descending"),o[s]=o[s].replace(" desc","")),e=a.sort(e,o[s],n));return e}return a.sort(e,o,t.comparer)},n.prototype.onGroup=function(e,t,r){if(!e||!e.length)return e;var n=this.getAggregate(r);return a.group(e,a.getValue(t.fieldName,r),n,null,null,t.comparer)},n.prototype.onPage=function(e,t,r){var n=a.getValue(t.pageSize,r),o=(a.getValue(t.pageIndex,r)-1)*n,s=o+n;return e&&e.length?e.slice(o,s):e},n.prototype.onRange=function(e,t){return e&&e.length?e.slice(a.getValue(t.start),a.getValue(t.end)):e},n.prototype.onTake=function(e,t){return e&&e.length?e.slice(0,a.getValue(t.nos)):e},n.prototype.onSkip=function(e,t){return e&&e.length?e.slice(a.getValue(t.nos)):e},n.prototype.onSelect=function(e,t){return e&&e.length?a.select(e,a.getValue(t.fieldNames)):e},n.prototype.insert=function(e,r,n,o,a){return t.isNullOrUndefined(a)?e.dataSource.json.push(r):e.dataSource.json.splice(a,0,r)},n.prototype.remove=function(e,t,r,n){var o,s=e.dataSource.json;for("object"!=typeof r||r instanceof Date||(r=a.getObject(t,r)),o=0;o<s.length&&a.getObject(t,s[o])!==r;o++);return o!==s.length?s.splice(o,1):null},n.prototype.update=function(e,r,n,o){var a,s,i=e.dataSource.json;for(t.isNullOrUndefined(r)||(s=t.getValue(r,n)),a=0;a<i.length&&(t.isNullOrUndefined(r)||t.getValue(r,i[a])!==s);a++);return a<i.length?t.merge(i[a],n):null},n}(u),l=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return s(o,e),o.prototype.processQuery=function(e,t,n){var o,s,i=this.getQueryRequest(t),u=r.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),c=t.params,l=e.dataSource.url,p=null,d=this.options,h={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};"onPage"in u?(o=u.onPage,s=((s=a.getValue(o.pageIndex,t))-1)*(p=a.getValue(o.pageSize,t))):"onRange"in u&&(s=(o=u.onRange).start,p=o.end-o.start);for(v=0;v<i.sorts.length;v++)o=a.getValue(i.sorts[v].e.fieldName,t),h.sorts.push(a.callAdaptorFunction(this,"onEachSort",{name:o,direction:i.sorts[v].e.direction},t));n&&(o=this.getFiltersFrom(n,t))&&h.filters.push(a.callAdaptorFunction(this,"onEachWhere",o.toJson(),t));for(v=0;v<i.filters.length;v++){h.filters.push(a.callAdaptorFunction(this,"onEachWhere",i.filters[v].e.toJson(),t));for(var f=0,g="object"==typeof h.filters[v]?Object.keys(h.filters[v]):[];f<g.length;f++){O=g[f];a.isNull(h[O])&&delete h[O]}}for(v=0;v<i.searches.length;v++)o=i.searches[v].e,h.searches.push(a.callAdaptorFunction(this,"onEachSearch",{fields:o.fieldNames,operator:o.operator,key:o.searchKey,ignoreCase:o.ignoreCase},t));for(v=0;v<i.groups.length;v++)h.groups.push(a.getValue(i.groups[v].e.fieldName,t));for(v=0;v<i.aggregates.length;v++)o=i.aggregates[v].e,h.aggregates.push({type:o.type,field:a.getValue(o.field,t)});var y={};if(this.getRequestQuery(d,t,u,h,y),a.callAdaptorFunction(this,"addParams",{dm:e,query:t,params:c,reqParams:y}),t.lazyLoad.length)for(var v=0;v<t.lazyLoad.length;v++)y[t.lazyLoad[v].key]=t.lazyLoad[v].value;for(var m=0,S=Object.keys(y);m<S.length;m++){var O=S[m];(a.isNull(y[O])||""===y[O]||0===y[O].length)&&delete y[O]}d.skip in y&&d.take in y||null===p||(y[d.skip]=a.callAdaptorFunction(this,"onSkip",s,t),y[d.take]=a.callAdaptorFunction(this,"onTake",p,t));var b=this.pvt;return this.pvt={},"json"===this.options.requestType?{data:JSON.stringify(y,a.parse.jsonDateReplacer),url:l,pvtData:b,type:"POST",contentType:"application/json; charset=utf-8"}:(o=this.convertToQueryString(y,t,e),o=(-1!==e.dataSource.url.indexOf("?")?"&":"/")+o,{type:"GET",url:o.length?l.replace(/\/*$/,o):l,pvtData:b})},o.prototype.getRequestQuery=function(e,t,r,n,o){var s=o;s[e.from]=t.fromTable,e.apply&&t.distincts.length&&(s[e.apply]="onDistinct"in this?a.callAdaptorFunction(this,"onDistinct",t.distincts):""),!t.distincts.length&&e.expand&&(s[e.expand]="onExpand"in this&&"onSelect"in r?a.callAdaptorFunction(this,"onExpand",{selects:a.getValue(r.onSelect.fieldNames,t),expands:t.expands},t):t.expands),s[e.select]="onSelect"in r&&!t.distincts.length?a.callAdaptorFunction(this,"onSelect",a.getValue(r.onSelect.fieldNames,t),t):"",s[e.count]=t.isCountRequired?a.callAdaptorFunction(this,"onCount",t.isCountRequired,t):"",s[e.search]=n.searches.length?a.callAdaptorFunction(this,"onSearch",n.searches,t):"",s[e.skip]="onSkip"in r?a.callAdaptorFunction(this,"onSkip",a.getValue(r.onSkip.nos,t),t):"",s[e.take]="onTake"in r?a.callAdaptorFunction(this,"onTake",a.getValue(r.onTake.nos,t),t):"",s[e.where]=n.filters.length||n.searches.length?a.callAdaptorFunction(this,"onWhere",n.filters,t):"",s[e.sortBy]=n.sorts.length?a.callAdaptorFunction(this,"onSortBy",n.sorts,t):"",s[e.group]=n.groups.length?a.callAdaptorFunction(this,"onGroup",n.groups,t):"",s[e.aggregates]=n.aggregates.length?a.callAdaptorFunction(this,"onAggregates",n.aggregates,t):"",s.param=[]},o.prototype.convertToQueryString=function(e,t,r){return""},o.prototype.processResponse=function(e,r,n,o,s,i){if(o&&o.getResponseHeader("Content-Type")&&-1!==o.getResponseHeader("Content-Type").indexOf("application/json")){var u=a.timeZoneHandling;r&&!r.timeZoneHandling&&(a.timeZoneHandling=!1),e=a.parse.parseJson(e),a.timeZoneHandling=u}var c=s,l=c.pvtData||{},p=e?e.groupDs:[];if(o&&o.getResponseHeader("Content-Type")&&-1!==o.getResponseHeader("Content-Type").indexOf("xml"))return n.isCountRequired?{result:[],count:0}:[];var d=JSON.parse(c.data);if(d&&"batch"===d.action&&e&&e.addedRecords)return i.addedRecords=e.addedRecords,i;e&&e.d&&(e=e.d);var h={};e&&"count"in e&&(h.count=e.count),h.result=e&&e.result?e.result:e;var f=!1;if(Array.isArray(e.result)&&e.result.length){if(t.isNullOrUndefined(e.result[0].key)||(h.result=this.formRemoteGroupedData(h.result,1,l.groups.length-1)),n&&n.lazyLoad.length&&l.groups.length)for(var g=0;g<n.lazyLoad.length;g++)if("onDemandGroupInfo"===n.lazyLoad[g].key){var y=n.lazyLoad[g].value.level;l.groups.length===y&&(f=!0)}}return f||this.getAggregateResult(l,e,h,p,n),a.isNull(h.count)?h.result:{result:h.result,count:h.count,aggregates:h.aggregates}},o.prototype.formRemoteGroupedData=function(e,r,n){for(var o=0;o<e.length;o++)e[o].items.length&&Object.keys(e[o].items[0]).indexOf("key")>-1&&this.formRemoteGroupedData(e[o].items,r+1,n-1);return e.GroupGuid=i.GroupGuid,e.level=r,e.childLevels=n,e.records=e[0].items.length?this.getGroupedRecords(e,!t.isNullOrUndefined(e[0].items.records)):[],e},o.prototype.getGroupedRecords=function(e,t){for(var r=[],n=0;n<e.length;n++)if(t)r=r.concat(e[n].items.records);else for(var o=0;o<e[n].items.length;o++)r.push(e[n].items[o]);return r},o.prototype.onGroup=function(e){return this.pvt.groups=e,e},o.prototype.onAggregates=function(e){this.pvt.aggregates=e},o.prototype.batchRequest=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.batchUrl||e.dataSource.crudUrl||e.dataSource.removeUrl||e.dataSource.url,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(t.extend({},{changed:r.changedRecords,added:r.addedRecords,deleted:r.deletedRecords,action:"batch",table:n[void 0],key:n[void 0]},a.getAddParams(this,e,o)))}},o.prototype.beforeSend=function(e,t){},o.prototype.insert=function(e,r,n,o){return{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{value:r,table:n,action:"insert"},a.getAddParams(this,e,o)))}},o.prototype.remove=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.removeUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{key:n,keyColumn:r,table:o,action:"remove"},a.getAddParams(this,e,s)))}},o.prototype.update=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{value:n,action:"update",keyColumn:r,key:a.getObject(r,n),table:o},a.getAddParams(this,e,s)))}},o.prototype.getFiltersFrom=function(e,t){var r,o=t.fKey,s=o,i=t.key,u=[];"object"!=typeof e[0]&&(s=null);for(var c=0;c<e.length;c++)r="object"==typeof e[0]?a.getObject(i||s,e[c]):e[c],u.push(new n(o,"equal",r));return n.or(u)},o.prototype.getAggregateResult=function(e,n,o,s,i){var u=n;if(n&&n.result&&(u=n.result),e&&e.aggregates&&e.aggregates.length){var c=e.aggregates,l=void 0,p=u,d={};n.aggregate&&(p=n.aggregate);for(g=0;g<c.length;g++)(l=a.aggregates[c[g].type])&&(d[c[g].field+" - "+c[g].type]=l(p,c[g].field));o.aggregates=d}var h=Array.isArray(n.result)&&n.result.length&&!t.isNullOrUndefined(n.result[0].key);if(e&&e.groups&&e.groups.length&&!h){for(var f=e.groups,g=0;g<f.length;g++){t.isNullOrUndefined(s)||(s=a.group(s,f[g]));var y=r.filterQueries(i.queries,"onGroup")[g].e;u=a.group(u,f[g],e.aggregates,null,s,y.comparer)}o.result=u}return o},o.prototype.getQueryRequest=function(e){var t={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};return t.sorts=r.filterQueries(e.queries,"onSortBy"),t.groups=r.filterQueries(e.queries,"onGroup"),t.filters=r.filterQueries(e.queries,"onWhere"),t.searches=r.filterQueries(e.queries,"onSearch"),t.aggregates=r.filterQueries(e.queries,"onAggregates"),t},o.prototype.addParams=function(e){var t=e.reqParams;e.params.length&&(t.params={});for(var r=0,n=e.params;r<n.length;r++){var o=n[r];if(t[o.key])throw new Error("Query() - addParams: Custom Param is conflicting other request arguments");t[o.key]=o.value,o.fn&&(t[o.key]=o.fn.call(e.query,o.key,e.query,e.dm)),t.params[o.key]=t[o.key]}},o}(u),p=function(e){function r(r){var n=e.call(this)||this;return n.options=t.extend({},n.options,{requestType:"get",accept:"application/json;odata=light;q=1,application/json;odata=verbose;q=0.5",multipartAccept:"multipart/mixed",sortBy:"$orderby",select:"$select",skip:"$skip",take:"$top",count:"$inlinecount",where:"$filter",expand:"$expand",batch:"$batch",changeSet:"--changeset_",batchPre:"batch_",contentId:"Content-Id: ",batchContent:"Content-Type: multipart/mixed; boundary=",changeSetContent:"Content-Type: application/http\nContent-Transfer-Encoding: binary ",batchChangeSetContentType:"Content-Type: application/json; charset=utf-8 ",updateType:"PUT"}),t.extend(n.options,r||{}),n}return s(r,e),r.prototype.getModuleName=function(){return"ODataAdaptor"},r.prototype.onPredicate=function(e,n,o){var s,i,u="",c=e.value,l=typeof c,p=e.field?r.getField(e.field):null;if(c instanceof Date&&(c="datetime'"+a.parse.replacer(c)+"'"),"string"===l&&(c="'"+(c=encodeURIComponent(c))+"'",o&&(p="cast("+p+", 'Edm.String')"),a.parse.isGuid(c)&&(i="guid"),e.ignoreCase&&(i||(p="tolower("+p+")"),c=c.toLowerCase())),s=a.odBiOperator[e.operator])return u+=p,u+=s,i&&(u+=i),u+c;if("substringof"===(s=t.isNullOrUndefined(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?a.odUniOperator[e.operator]:a.odv4UniOperator[e.operator])){var d=c;c=p,p=d}return u+=s+"(",u+=p+",",i&&(u+=i),u+=c+")"},r.prototype.addParams=function(t){e.prototype.addParams.call(this,t),delete t.reqParams.params},r.prototype.onComplexPredicate=function(e,t,r){for(var n=[],o=0;o<e.predicates.length;o++)n.push("("+this.onEachWhere(e.predicates[o],t,r)+")");return n.join(" "+e.condition+" ")},r.prototype.onEachWhere=function(e,t,r){return e.isComplex?this.onComplexPredicate(e,t,r):this.onPredicate(e,t,r)},r.prototype.onWhere=function(e){return this.pvt.search&&e.push(this.onEachWhere(this.pvt.search,null,!0)),e.join(" and ")},r.prototype.onEachSearch=function(e){e.fields&&0===e.fields.length&&a.throwError("Query() - Search : oData search requires list of field names to search");for(var t=this.pvt.search||[],r=0;r<e.fields.length;r++)t.push(new n(e.fields[r],e.operator,e.key,e.ignoreCase));this.pvt.search=t},r.prototype.onSearch=function(e){return this.pvt.search=n.or(this.pvt.search),""},r.prototype.onEachSort=function(e){var t=[];if(e.name instanceof Array)for(var n=0;n<e.name.length;n++)t.push(r.getField(e.name[n])+("descending"===e.direction?" desc":""));else t.push(r.getField(e.name)+("descending"===e.direction?" desc":""));return t.join(",")},r.prototype.onSortBy=function(e){return e.reverse().join(",")},r.prototype.onGroup=function(e){return this.pvt.groups=e,[]},r.prototype.onSelect=function(e){for(var t=0;t<e.length;t++)e[t]=r.getField(e[t]);return e.join(",")},r.prototype.onAggregates=function(e){return this.pvt.aggregates=e,""},r.prototype.onCount=function(e){return!0===e?"allpages":""},r.prototype.beforeSend=function(e,t,r){a.endsWith(r.url,this.options.batch)&&"post"===r.type.toLowerCase()?(t.setRequestHeader("Accept",this.options.multipartAccept),t.setRequestHeader("DataServiceVersion","2.0"),t.overrideMimeType("text/plain; charset=x-user-defined")):t.setRequestHeader("Accept",this.options.accept),t.setRequestHeader("DataServiceVersion","2.0"),t.setRequestHeader("MaxDataServiceVersion","2.0")},r.prototype.processResponse=function(e,r,n,o,s,i){if(s&&"GET"===s.type&&!this.rootUrl&&e["odata.metadata"]){var u=e["odata.metadata"].split("/$metadata#");this.rootUrl=u[0],this.resourceTableName=u[1]}if(!t.isNullOrUndefined(e.d)){var c=n&&n.isCountRequired?e.d.results:e.d;if(!t.isNullOrUndefined(c))for(var l=0;l<c.length;l++)t.isNullOrUndefined(c[l].__metadata)||delete c[l].__metadata}var p=s&&s.pvtData,d=this.processBatchResponse(e,n,o,s,i);if(d)return d;var h=o&&s.getResponseHeader("DataServiceVersion"),f=null,g=h&&parseInt(h,10)||2;if(n&&n.isCountRequired){(e.__count||e["odata.count"])&&(f=e.__count||e["odata.count"]),e.d&&(e=e.d),(e.__count||e["odata.count"])&&(f=e.__count||e["odata.count"])}3===g&&e.value&&(e=e.value),e.d&&(e=e.d),g<3&&e.results&&(e=e.results);var y={};return y.count=f,y.result=e,this.getAggregateResult(p,e,y,null,n),a.isNull(f)?y.result:{result:y.result,count:y.count,aggregates:y.aggregates}},r.prototype.convertToQueryString=function(e,t,r){var n=[],o=e.table||"";delete e.table,r.dataSource.requiresFormat&&(e.$format="json");for(var a=0,s=Object.keys(e);a<s.length;a++){var i=s[a];n.push(i+"="+e[i])}return n=n.join("&"),r.dataSource.url&&-1!==r.dataSource.url.indexOf("?")&&!o?n:n.length?o+"?"+n:o||""},r.prototype.localTimeReplacer=function(e,r){for(var n=0,o=t.isNullOrUndefined(r)?[]:Object.keys(r);n<o.length;n++){var s=o[n];r[s]instanceof Date&&(r[s]=a.dateParse.toLocalTime(r[s]))}return r},r.prototype.insert=function(e,t,r){return{url:(e.dataSource.insertUrl||e.dataSource.url).replace(/\/*$/,r?"/"+r:""),data:JSON.stringify(t,this.options.localTime?this.localTimeReplacer:null)}},r.prototype.remove=function(e,t,r,n){var o;return o="string"!=typeof r||a.parse.isGuid(r)?"("+r+")":"('"+r+"')",{type:"DELETE",url:(e.dataSource.removeUrl||e.dataSource.url).replace(/\/*$/,n?"/"+n:"")+o}},r.prototype.update=function(e,r,n,o,s,i){"PATCH"!==this.options.updateType||t.isNullOrUndefined(i)||(n=this.compareAndRemove(n,i,r));var u;return u="string"!=typeof n[r]||a.parse.isGuid(n[r])?"("+n[r]+")":"('"+n[r]+"')",{type:this.options.updateType,url:(e.dataSource.updateUrl||e.dataSource.url).replace(/\/*$/,o?"/"+o:"")+u,data:JSON.stringify(n,this.options.localTime?this.localTimeReplacer:null),accept:this.options.accept}},r.prototype.batchRequest=function(e,t,r,n,o){var s=r.guid=a.getGuid(this.options.batchPre),i=this.rootUrl?this.rootUrl+"/"+this.options.batch:e.dataSource.url.replace(/\/*$/,"/"+this.options.batch);r.url=this.resourceTableName?this.resourceTableName:r.url;var u={url:r.url,key:r.key,cid:1,cSet:a.getGuid(this.options.changeSet)},c="--"+s+"\n";return c+="Content-Type: multipart/mixed; boundary="+u.cSet.replace("--","")+"\n",this.pvt.changeSet=0,c+=this.generateInsertRequest(t.addedRecords,u,e),c+=this.generateUpdateRequest(t.changedRecords,u,e,o?o.changedRecords:[]),c+=this.generateDeleteRequest(t.deletedRecords,u,e),c+=u.cSet+"--\n",c+="--"+s+"--",{type:"POST",url:i,dataType:"json",contentType:"multipart/mixed; charset=UTF-8;boundary="+s,data:c}},r.prototype.generateDeleteRequest=function(e,t,r){if(!e)return"";var n={method:"DELETE ",url:function(e,t,r){var n=a.getObject(r,e[t]);return"number"==typeof n||a.parse.isGuid(n)?"("+n+")":n instanceof Date?"("+e[t][r].toJSON()+")":"('"+n+"')"},data:function(e,t){return""}};return this.generateBodyContent(e,t,n,r)+"\n"},r.prototype.generateInsertRequest=function(e,t,r){if(!e)return"";var n={method:"POST ",url:function(e,t,r){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};return this.generateBodyContent(e,t,n,r)},r.prototype.generateUpdateRequest=function(e,t,r,n){var o=this;if(!e)return"";e.forEach(function(e){return e=o.compareAndRemove(e,n.filter(function(r){return a.getObject(t.key,r)===a.getObject(t.key,e)})[0],t.key)});var s={method:this.options.updateType+" ",url:function(e,t,r){return"number"==typeof e[t][r]||a.parse.isGuid(e[t][r])?"("+e[t][r]+")":e[t][r]instanceof Date?"("+e[t][r].toJSON()+")":"('"+e[t][r]+"')"},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};return this.generateBodyContent(e,t,s,r)},r.getField=function(e){return e.replace(/\./g,"/")},r.prototype.generateBodyContent=function(e,r,n,o){for(var a="",s=0;s<e.length;s++)a+="\n"+r.cSet+"\n",a+=this.options.changeSetContent+"\n\n",a+=n.method,"POST "===n.method?a+=(o.dataSource.insertUrl||o.dataSource.crudUrl||r.url)+n.url(e,s,r.key)+" HTTP/1.1\n":"PUT "===n.method||"PATCH "===n.method?a+=(o.dataSource.updateUrl||o.dataSource.crudUrl||r.url)+n.url(e,s,r.key)+" HTTP/1.1\n":"DELETE "===n.method&&(a+=(o.dataSource.removeUrl||o.dataSource.crudUrl||r.url)+n.url(e,s,r.key)+" HTTP/1.1\n"),a+="Accept: "+this.options.accept+"\n",a+="Content-Id: "+this.pvt.changeSet+++"\n",a+=this.options.batchChangeSetContentType+"\n",t.isNullOrUndefined(e[s]["@odata.etag"])?a+="\n":(a+="If-Match: "+e[s]["@odata.etag"]+"\n\n",delete e[s]["@odata.etag"]),a+=n.data(e,s);return a},r.prototype.processBatchResponse=function(e,r,n,o,s){if(n&&n.getResponseHeader("Content-Type")&&-1!==n.getResponseHeader("Content-Type").indexOf("xml"))return r.isCountRequired?{result:[],count:0}:[];if(o&&this.options.batch&&a.endsWith(o.url,this.options.batch)&&"post"===o.type.toLowerCase()){var i=n.getResponseHeader("Content-Type"),u=void 0,c=void 0,l=e+"";if(i=i.substring(i.indexOf("=batchresponse")+1),(l=l.split(i)).length<2)return{};l=l[1];var p=/(?:\bContent-Type.+boundary=)(changesetresponse.+)/i.exec(l);p&&l.replace(p[0],"");for(var d=p?p[1]:"",h=(l=l.split(d)).length;h>-1;h--)/\bContent-ID:/i.test(l[h])&&/\bHTTP.+201/.test(l[h])&&(u=parseInt(/\bContent-ID: (\d+)/i.exec(l[h])[1],10),s.addedRecords[u]&&(c=a.parse.parseJson(/^\{.+\}/m.exec(l[h])[0]),t.extend({},s.addedRecords[u],this.processResponse(c))));return s}return null},r.prototype.compareAndRemove=function(e,r,n){var o=this;return t.isNullOrUndefined(r)?e:(Object.keys(e).forEach(function(t){t!==n&&"@odata.etag"!==t&&(a.isPlainObject(e[t])?(o.compareAndRemove(e[t],r[t]),0===Object.keys(e[t]).filter(function(e){return"@odata.etag"!==e}).length&&delete e[t]):e[t]===r[t]?delete e[t]:e[t]&&r[t]&&e[t].valueOf()===r[t].valueOf()&&delete e[t])}),e)},r}(l),d=function(e){function n(r){var n=e.call(this,r)||this;return n.options=t.extend({},n.options,{requestType:"get",accept:"application/json, text/javascript, */*; q=0.01",multipartAccept:"multipart/mixed",sortBy:"$orderby",select:"$select",skip:"$skip",take:"$top",count:"$count",search:"$search",where:"$filter",expand:"$expand",batch:"$batch",changeSet:"--changeset_",batchPre:"batch_",contentId:"Content-Id: ",batchContent:"Content-Type: multipart/mixed; boundary=",changeSetContent:"Content-Type: application/http\nContent-Transfer-Encoding: binary ",batchChangeSetContentType:"Content-Type: application/json; charset=utf-8 ",updateType:"PATCH",localTime:!1,apply:"$apply"}),t.extend(n.options,r||{}),n}return s(n,e),n.prototype.getModuleName=function(){return"ODataV4Adaptor"},n.prototype.onCount=function(e){return!0===e?"true":""},n.prototype.onPredicate=function(t,n,o){var s="",i=t.value,u=i instanceof Date;if(n instanceof r)for(var c=this.getQueryRequest(n),l=0;l<c.filters.length;l++)c.filters[l].e.key===t.value&&(o=!0);return s=e.prototype.onPredicate.call(this,t,n,o),u&&(s=s.replace(/datetime'(.*)'$/,"$1")),a.parse.isGuid(i)&&(s=s.replace("guid","").replace(/'/g,"")),s},n.prototype.onEachSearch=function(e){var t=this.pvt.searches||[];t.push(e.key),this.pvt.searches=t},n.prototype.onSearch=function(e){return this.pvt.searches.join(" OR ")},n.prototype.onExpand=function(e){var t=this,r={},n={},o=e.expands.slice(),a=[];return e.selects.filter(function(e){return e.indexOf(".")>-1}).forEach(function(e){var t=e.split(".");t[0]in r||(r[t[0]]=[]),r[t[0]].push(t[1])}),Object.keys(r).forEach(function(e){-1===o.indexOf(e)&&o.push(e)}),o.forEach(function(e){n[e]=e in r?e+"("+t.options.select+"="+r[e].join(",")+")":e}),Object.keys(n).forEach(function(e){return a.push(n[e])}),a.join(",")},n.prototype.onDistinct=function(e){return"groupby(("+e.map(function(e){return p.getField(e)}).join(",")+"))"},n.prototype.onSelect=function(t){return e.prototype.onSelect.call(this,t.filter(function(e){return-1===e.indexOf(".")}))},n.prototype.beforeSend=function(e,t,r){"POST"!==r.type&&"PUT"!==r.type&&"PATCH"!==r.type||t.setRequestHeader("Prefer","return=representation"),t.setRequestHeader("Accept",this.options.accept)},n.prototype.processResponse=function(r,n,o,s,i,u){if(i&&"GET"===i.type&&!this.rootUrl&&r["@odata.context"]){var c=r["@odata.context"].split("/$metadata#");this.rootUrl=c[0],this.resourceTableName=c[1]}var l=i&&i.pvtData,p=e.prototype.processBatchResponse.call(this,r,o,s,i,u);if(p)return p;var d=null;o&&o.isCountRequired&&"@odata.count"in r&&(d=r["@odata.count"]),r=t.isNullOrUndefined(r.value)?r:r.value;var h={};return h.count=d,h.result=r,this.getAggregateResult(l,r,h,null,o),a.isNull(d)?h.result:{result:h.result,count:d,aggregates:h.aggregates}},n}(p),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.getModuleName=function(){return"WebApiAdaptor"},t.prototype.insert=function(e,t,r){return{type:"POST",url:e.dataSource.url,data:JSON.stringify(t)}},t.prototype.remove=function(e,t,r,n){return{type:"DELETE",url:e.dataSource.url+"/"+r,data:JSON.stringify(r)}},t.prototype.update=function(e,t,r,n){return{type:"PUT",url:e.dataSource.url,data:JSON.stringify(r)}},t.prototype.batchRequest=function(e,t,r){var n=this,o=r.guid=a.getGuid(this.options.batchPre),s=e.dataSource.url.replace(/\/*$/,"/"+this.options.batch);r.url=this.resourceTableName?this.resourceTableName:r.url;for(var i=[],u=0,c=t.addedRecords.length;u<c;u++)!function(n,a){t.addedRecords.forEach(function(a,s){var u={method:"POST ",url:function(e,t,r){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("POST /api/"+(e.dataSource.insertUrl||e.dataSource.crudUrl||r.url)+u.url(t.addedRecords,n,r.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",a?JSON.stringify(a):"")})}(u);for(var u=0,c=t.changedRecords.length;u<c;u++)!function(a,s){t.changedRecords.forEach(function(s,u){var c={method:n.options.updateType+" ",url:function(e,t,r){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("PUT /api/"+(e.dataSource.updateUrl||e.dataSource.crudUrl||r.url)+c.url(t.changedRecords,a,r.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",s?JSON.stringify(s):"")})}(u);for(var u=0,c=t.deletedRecords.length;u<c;u++)!function(n,s){t.deletedRecords.forEach(function(s,u){var c={mtd:"DELETE ",url:function(e,t,r){var n=a.getObject(r,e[t]);return"number"==typeof n||a.parse.isGuid(n)?"/"+n:n instanceof Date?"/"+e[t][r].toJSON():"/'"+n+"'"},data:function(e,t){return""}};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("DELETE /api/"+(e.dataSource.removeUrl||e.dataSource.crudUrl||r.url)+c.url(t.deletedRecords,n,r.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",s?JSON.stringify(s):"")})}(u);return i.push("--"+o+"--",""),{type:"POST",url:s,contentType:"multipart/mixed; boundary="+o,data:i.join("\r\n")}},t.prototype.beforeSend=function(e,t,r){t.setRequestHeader("Accept","application/json, text/javascript, */*; q=0.01")},t.prototype.processResponse=function(e,t,r,n,o,s){var i=o&&o.pvtData,u=null,c={};if(o&&"post"!==o.type.toLowerCase()){var l=n&&o.getResponseHeader("DataServiceVersion"),p=l&&parseInt(l,10)||2;r&&r.isCountRequired&&(a.isNull(e.Count)||(u=e.Count)),p<3&&e.Items&&(e=e.Items),c.count=u,c.result=e,this.getAggregateResult(i,e,c,null,r)}return c.result=c.result||e,a.isNull(u)?c.result:{result:c.result,count:c.count,aggregates:c.aggregates}},t}(p),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.processQuery=function(e,t,r){var n=(new l).processQuery(e,t,r),o=a.parse.parseJson(n.data),s={};if(o.param)for(var i=0;i<o.param.length;i++){var u=o.param[i],c=Object.keys(u)[0];s[c]=u[c]}s.value=o;return{data:JSON.stringify(s),url:n.url,pvtData:n.pvtData,type:"POST",contentType:"application/json; charset=utf-8"}},t}(l),g=function(e){function r(){var r=e.call(this)||this;return t.setValue("beforeSend",l.prototype.beforeSend,r),r}return s(r,e),r.prototype.insert=function(e,r,n,o,s){return this.pvt.position=s,this.updateType="add",{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{value:r,table:n,action:"insert"},a.getAddParams(this,e,o)))}},r.prototype.remove=function(r,n,o,s,i){return e.prototype.remove.call(this,r,n,o),{type:"POST",url:r.dataSource.removeUrl||r.dataSource.crudUrl||r.dataSource.url,data:JSON.stringify(t.extend({},{key:o,keyColumn:n,table:s,action:"remove"},a.getAddParams(this,r,i)))}},r.prototype.update=function(e,r,n,o,s){return this.updateType="update",this.updateKey=r,{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{value:n,action:"update",keyColumn:r,key:n[r],table:o},a.getAddParams(this,e,s)))}},r.prototype.processResponse=function(t,r,n,o,a,s,i){var u;if(t=a?JSON.parse(a.data):t,"add"===this.updateType&&e.prototype.insert.call(this,r,t,null,null,this.pvt.position),"update"===this.updateType&&e.prototype.update.call(this,r,this.updateKey,t),this.updateType=void 0,t.added)for(u=0;u<t.added.length;u++)e.prototype.insert.call(this,r,t.added[u]);if(t.changed)for(u=0;u<t.changed.length;u++)e.prototype.update.call(this,r,i.key,t.changed[u]);if(t.deleted)for(u=0;u<t.deleted.length;u++)e.prototype.remove.call(this,r,i.key,t.deleted[u]);return t},r.prototype.batchRequest=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.batchUrl||e.dataSource.crudUrl||e.dataSource.url,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(t.extend({},{changed:r.changedRecords,added:r.addedRecords,deleted:r.deletedRecords,action:"batch",table:n.url,key:n.key},a.getAddParams(this,e,o)))}},r.prototype.addParams=function(e){(new l).addParams(e)},r}(c),y=function(e){function r(r){var n=e.call(this)||this;return n.options=t.extend({},n.options,{getData:new Function,addRecord:new Function,updateRecord:new Function,deleteRecord:new Function,batchUpdate:new Function}),t.extend(n.options,r||{}),n}return s(r,e),r.prototype.getModuleName=function(){return"CustomDataAdaptor"},r}(l),v=function(e){function n(r,n,o){var s=e.call(this)||this;s.isCrudAction=!1,s.isInsertAction=!1,t.isNullOrUndefined(r)||(s.cacheAdaptor=r),s.pageSize=o,s.guidId=a.getGuid("cacheAdaptor");var i={keys:[],results:[]};window.localStorage.setItem(s.guidId,JSON.stringify(i));var u=s.guidId;return t.isNullOrUndefined(n)||setInterval(function(){var e;e=a.parse.parseJson(window.localStorage.getItem(u));for(var t=[],r=0;r<e.results.length;r++){var o=+new Date,s=+new Date(e.results[r].timeStamp);e.results[r].timeStamp=o-s,o-s>n&&t.push(r)}for(r=0;r<t.length;r++)e.results.splice(t[r],1),e.keys.splice(t[r],1);window.localStorage.removeItem(u),window.localStorage.setItem(u,JSON.stringify(e))},n),s}return s(n,e),n.prototype.generateKey=function(e,t){var n=this.getQueryRequest(t),o=r.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),a=e;"onPage"in o&&(a+=o.onPage.pageIndex),n.sorts.forEach(function(e){a+=e.e.direction+e.e.fieldName}),n.groups.forEach(function(e){a+=e.e.fieldName}),n.searches.forEach(function(e){a+=e.e.searchKey});for(var s=0;s<n.filters.length;s++){var i=n.filters[s];if(i.e.isComplex){var u=t.clone();u.queries=[];for(var c=0;c<i.e.predicates.length;c++)u.queries.push({fn:"onWhere",e:i.e.predicates[c],filter:t.queries.filter});a+=i.e.condition+this.generateKey(e,u)}else a+=i.e.field+i.e.operator+i.e.value}return a},n.prototype.processQuery=function(e,t,r){var n,o=this.generateKey(e.dataSource.url,t),s=(n=a.parse.parseJson(window.localStorage.getItem(this.guidId)))?n.results[n.keys.indexOf(o)]:null;return null==s||this.isCrudAction||this.isInsertAction?(this.isCrudAction=null,this.isInsertAction=null,this.cacheAdaptor.processQuery.apply(this.cacheAdaptor,[].slice.call(arguments,0))):s},n.prototype.processResponse=function(e,t,r,n,o,s){if(this.isInsertAction||o&&this.cacheAdaptor.options.batch&&a.endsWith(o.url,this.cacheAdaptor.options.batch)&&"post"===o.type.toLowerCase())return this.cacheAdaptor.processResponse(e,t,r,n,o,s);e=this.cacheAdaptor.processResponse.apply(this.cacheAdaptor,[].slice.call(arguments,0));var i=r?this.generateKey(t.dataSource.url,r):t.dataSource.url,u={},c=(u=a.parse.parseJson(window.localStorage.getItem(this.guidId))).keys.indexOf(i);for(-1!==c&&(u.results.splice(c,1),u.keys.splice(c,1)),u.results[u.keys.push(i)-1]={keys:i,result:e.result,timeStamp:new Date,count:e.count};u.results.length>this.pageSize;)u.results.splice(0,1),u.keys.splice(0,1);return window.localStorage.setItem(this.guidId,JSON.stringify(u)),e},n.prototype.beforeSend=function(e,r,n){!t.isNullOrUndefined(this.cacheAdaptor.options.batch)&&a.endsWith(n.url,this.cacheAdaptor.options.batch)&&"post"===n.type.toLowerCase()&&r.setRequestHeader("Accept",this.cacheAdaptor.options.multipartAccept),e.dataSource.crossDomain||r.setRequestHeader("Accept",this.cacheAdaptor.options.accept)},n.prototype.update=function(e,t,r,n){return this.isCrudAction=!0,this.cacheAdaptor.update(e,t,r,n)},n.prototype.insert=function(e,t,r){return this.isInsertAction=!0,this.cacheAdaptor.insert(e,t,r)},n.prototype.remove=function(e,t,r,n){return this.isCrudAction=!0,this.cacheAdaptor.remove(e,t,r,n)},n.prototype.batchRequest=function(e,t,r){return this.cacheAdaptor.batchRequest(e,t,r)},n}(l),m=function(){function e(e,n,o){var s=this;this.dateParse=!0,this.timeZoneHandling=!0,this.requests=[],e||this.dataSource||(e=[]),o=o||e.adaptor,e&&!1===e.timeZoneHandling&&(this.timeZoneHandling=e.timeZoneHandling);var i;return e instanceof Array?i={json:e,offline:!0}:"object"==typeof e?(e.json||(e.json=[]),i={url:e.url,insertUrl:e.insertUrl,removeUrl:e.removeUrl,updateUrl:e.updateUrl,crudUrl:e.crudUrl,batchUrl:e.batchUrl,json:e.json,headers:e.headers,accept:e.accept,data:e.data,timeTillExpiration:e.timeTillExpiration,cachingPageSize:e.cachingPageSize,enableCaching:e.enableCaching,requestType:e.requestType,key:e.key,crossDomain:e.crossDomain,jsonp:e.jsonp,dataType:e.dataType,offline:void 0!==e.offline?e.offline:!(e.adaptor instanceof g||e.adaptor instanceof y)&&!e.url,requiresFormat:e.requiresFormat}):a.throwError("DataManager: Invalid arguments"),void 0!==i.requiresFormat||a.isCors()||(i.requiresFormat=!!t.isNullOrUndefined(i.crossDomain)||i.crossDomain),void 0===i.dataType&&(i.dataType="json"),this.dataSource=i,this.defaultQuery=n,i.url&&i.offline&&!i.json.length?(this.isDataAvailable=!1,this.adaptor=o||new p,this.dataSource.offline=!1,this.ready=this.executeQuery(n||new r),this.ready.then(function(e){s.dataSource.offline=!0,s.isDataAvailable=!0,i.json=e.result,s.adaptor=new c})):this.adaptor=i.offline?new c:new p,!i.jsonp&&this.adaptor instanceof p&&(i.jsonp="callback"),this.adaptor=o||this.adaptor,i.enableCaching&&(this.adaptor=new v(this.adaptor,i.timeTillExpiration,i.cachingPageSize)),this}return e.prototype.setDefaultQuery=function(e){return this.defaultQuery=e,this},e.prototype.executeLocal=function(n){this.defaultQuery||n instanceof r||a.throwError("DataManager - executeLocal() : A query is required to execute"),this.dataSource.json||a.throwError("DataManager - executeLocal() : Json data is required to execute"),n=n||this.defaultQuery;var o=this.adaptor.processQuery(this,n);if(n.subQuery){var s=n.subQuery.fromTable,i=n.subQuery.lookups,u=n.isCountRequired?o.result:o;i&&i instanceof Array&&a.buildHierarchy(n.subQuery.fKey,s,u,i,n.subQuery.key);for(var c=0;c<u.length;c++)u[c][s]instanceof Array&&(u[c]=t.extend({},{},u[c]),u[c][s]=this.adaptor.processResponse(n.subQuery.using(new e(u[c][s].slice(0))).executeLocal(),this,n))}return this.adaptor.processResponse(o,this,n)},e.prototype.executeQuery=function(n,o,s,i){var u=this;"function"==typeof n&&(i=s,s=o,o=n,n=null),n||(n=this.defaultQuery),n instanceof r||a.throwError("DataManager - executeQuery() : A query is required to execute");var c=new S,l={query:n};if(!this.dataSource.offline&&void 0!==this.dataSource.url&&""!==this.dataSource.url||!t.isNullOrUndefined(this.adaptor.makeRequest)||this.isCustomDataAdaptor(this.adaptor)){var p=this.adaptor.processQuery(this,n);t.isNullOrUndefined(this.adaptor.makeRequest)?!t.isNullOrUndefined(p.url)||this.isCustomDataAdaptor(this.adaptor)?this.makeRequest(p,c,l,n):(l=e.getDeferedArgs(n,p,l),c.resolve(l)):this.adaptor.makeRequest(p,c,l,n)}else e.nextTick(function(){var t=u.executeLocal(n);l=e.getDeferedArgs(n,t,l),c.resolve(l)});return(o||s)&&c.promise.then(o,s),i&&c.promise.then(i,i),c.promise},e.getDeferedArgs=function(e,t,r){return e.isCountRequired?(r.result=t.result,r.count=t.count,r.aggregates=t.aggregates):r.result=t,r},e.nextTick=function(e){(window.setImmediate||window.setTimeout)(e,0)},e.prototype.extendRequest=function(e,r,n){return t.extend({},{type:"GET",dataType:this.dataSource.dataType,crossDomain:this.dataSource.crossDomain,jsonp:this.dataSource.jsonp,cache:!0,processData:!1,onSuccess:r,onFailure:n},e)},e.prototype.makeRequest=function(e,r,n,o){var s=this,i=!!o.subQuerySelector,u=function(e){n.error=e,r.reject(n)},c=function(e,t,o,a,s,i,u){n.xhr=o,n.count=t?parseInt(t.toString(),10):0,n.result=e,n.request=a,n.aggregates=i,n.actual=s,n.virtualSelectRecords=u,r.resolve(n)},l=function(e,t){var r=new S,l={parent:n};o.subQuery.isChild=!0;var p=s.adaptor.processQuery(s,o.subQuery,e?s.adaptor.processResponse(e):t),d=s.makeRequest(p,r,l,o.subQuery);return i||r.then(function(t){e&&(a.buildHierarchy(o.subQuery.fKey,o.subQuery.fromTable,e,t,o.subQuery.key),c(e,t.count,t.xhr))},u),d},p=function(e,r){s.isCustomDataAdaptor(s.adaptor)&&(r=t.extend({},s.ajaxReqOption,r)),-1===r.httpRequest.getResponseHeader("Content-Type").indexOf("xml")&&s.dateParse&&(e=a.parse.parseJson(e));var n=s.adaptor.processResponse(e,s,o,r.httpRequest,r),u=0,p=null,d=e.virtualSelectRecords;if(o.isCountRequired&&(u=n.count,p=n.aggregates,n=n.result),!o.subQuery)return void c(n,u,r.httpRequest,r.type,e,p,d);i||l(n,r)},d=this.extendRequest(e,p,u);if(this.isCustomDataAdaptor(this.adaptor)){this.ajaxReqOption=d;var h=d;this.adaptor.options.getData({data:h.data,onSuccess:h.onSuccess,onFailure:h.onFailure})}else{var f=new t.Ajax(d);f.beforeSend=function(){s.beforeSend(f.httpRequest,f)},(d=f.send()).catch(function(e){return!0}),this.requests.push(f)}if(i){var g=o.subQuerySelector.call(this,{query:o.subQuery,parent:o});g&&g.length?Promise.all([d,l(null,g)]).then(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=s.adaptor.processResponse(r[0],s,o,s.requests[0].httpRequest,s.requests[0]),u=0;o.isCountRequired&&(u=n.count,n=n.result);var l=s.adaptor.processResponse(r[1],s,o.subQuery,s.requests[1].httpRequest,s.requests[1]);u=0,o.subQuery.isCountRequired&&(u=l.count,l=l.result),a.buildHierarchy(o.subQuery.fKey,o.subQuery.fromTable,n,l,o.subQuery.key),i=!1,c(n,u,s.requests[0].httpRequest)}):i=!1}return d},e.prototype.beforeSend=function(e,t){this.adaptor.beforeSend(this,e,t);for(var r,n=this.dataSource.headers,o=0;n&&o<n.length;o++){r=[];for(var a=0,s=Object.keys(n[o]);a<s.length;a++){var i=s[a];r.push(i),e.setRequestHeader(i,n[o][i])}}},e.prototype.saveChanges=function(e,n,o,a,s){var i=this;o instanceof r&&(a=o,o=null);var u={url:o,key:n||this.dataSource.key},c=this.adaptor.batchRequest(this,e,u,a||new r,s);if(this.dataSource.offline)return c;if(t.isNullOrUndefined(this.adaptor.doAjaxRequest)){if(this.isCustomDataAdaptor(this.adaptor))return this.doAjaxRequest(c,this.adaptor.options.batchUpdate);var l=new S,p=new t.Ajax(c);return p.beforeSend=function(){i.beforeSend(p.httpRequest,p)},p.onSuccess=function(t,r){l.resolve(i.adaptor.processResponse(t,i,null,r.httpRequest,r,e,u))},p.onFailure=function(e){l.reject([{error:e}])},p.send().catch(function(e){return!0}),l.promise}return this.adaptor.doAjaxRequest(c)},e.prototype.insert=function(e,n,o,a){n instanceof r&&(o=n,n=null);var s=this.adaptor.insert(this,e,n,o,a);return this.dataSource.offline?s:t.isNullOrUndefined(this.adaptor.doAjaxRequest)?this.doAjaxRequest(s,this.adaptor.options.addRecord):this.adaptor.doAjaxRequest(s)},e.prototype.remove=function(e,n,o,s){"object"==typeof n&&(n=a.getObject(e,n)),o instanceof r&&(s=o,o=null);var i=this.adaptor.remove(this,e,n,o,s);if(this.dataSource.offline)return i;if(t.isNullOrUndefined(this.adaptor.doAjaxRequest)){var u=this.adaptor.options.deleteRecord;return this.doAjaxRequest(i,u)}return this.adaptor.doAjaxRequest(i)},e.prototype.update=function(e,n,o,a,s){o instanceof r&&(a=o,o=null);var i=this.adaptor.update(this,e,n,o,a,s);if(this.dataSource.offline)return i;if(t.isNullOrUndefined(this.adaptor.doAjaxRequest)){var u=this.adaptor.options.updateRecord;return this.doAjaxRequest(i,u)}return this.adaptor.doAjaxRequest(i)},e.prototype.isCustomDataAdaptor=function(e){return this.adaptor.getModuleName&&"CustomDataAdaptor"===this.adaptor.getModuleName()},e.prototype.successFunc=function(e,r){this.isCustomDataAdaptor(this.adaptor)&&(r=t.extend({},this.ajaxReqOption,r));try{a.parse.parseJson(e)}catch(t){e=[]}e=this.adaptor.processResponse(a.parse.parseJson(e),this,null,r.httpRequest,r),this.ajaxDeffered.resolve(e)},e.prototype.failureFunc=function(e){this.ajaxDeffered.reject([{error:e}])},e.prototype.doAjaxRequest=function(e,r){var n=this;if(e=t.extend({},{type:"POST",contentType:"application/json; charset=utf-8",processData:!1},e),this.ajaxDeffered=new S,this.isCustomDataAdaptor(this.adaptor))this.ajaxReqOption=e,r.call(this,{data:e.data,onSuccess:this.successFunc.bind(this),onFailure:this.failureFunc.bind(this)});else{var o=new t.Ajax(e);o.beforeSend=function(){n.beforeSend(o.httpRequest,o)},o.onSuccess=this.successFunc.bind(this),o.onFailure=this.failureFunc.bind(this),o.send().catch(function(e){return!0})}return this.ajaxDeffered.promise},e}(),S=function(){function e(){var e=this;this.promise=new Promise(function(t,r){e.resolve=t,e.reject=r}),this.then=this.promise.then.bind(this.promise),this.catch=this.promise.catch.bind(this.promise)}return e}();return e.DataManager=m,e.Deferred=S,e.Query=r,e.Predicate=n,e.Adaptor=u,e.JsonAdaptor=c,e.UrlAdaptor=l,e.ODataAdaptor=p,e.ODataV4Adaptor=d,e.WebApiAdaptor=h,e.WebMethodAdaptor=f,e.RemoteSaveAdaptor=g,e.CustomDataAdaptor=y,e.CacheAdaptor=v,e.DataUtil=a,e}({},ej.base),this.ejs=ej;
- /*!
- * filename: ej2-file-utils.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.fileutils=function(t){"use strict";function e(t,e){if(null===t||void 0===t)throw new Error("ArgumentException: "+e+" cannot be null or undefined")}var n=function(){function t(){}return t.save=function(t,e){if(null===t||void 0===t||""===t)throw new Error("ArgumentException: fileName cannot be undefined, null or empty");var n=t.substring(t.lastIndexOf(".")+1,t.length),i=this.getMimeType(n);if(""!==i&&(e=new Blob([e],{type:i})),this.isMicrosoftBrowser)navigator.msSaveBlob(e,t);else{var r=document.createElementNS("http://www.w3.org/1999/xhtml","a");this.saveInternal(t,n,e,r,"download"in r)}},t.saveInternal=function(t,e,n,i,r){if(r){i.download=t;var o=window.URL.createObjectURL(n);i.href=o;var s=document.createEvent("MouseEvent");s.initEvent("click",!0,!0),i.dispatchEvent(s),setTimeout(function(){window.URL.revokeObjectURL(o),o=void 0})}else if("docx"!==e&&"xlsx"!==e){var a=window.URL.createObjectURL(n);window.open(a,"_blank")||(window.location.href=a)}else{var h=new FileReader;h.onloadend=function(){window.open(h.result,"_blank")||(window.location.href=h.result)},h.readAsDataURL(n)}},t.getMimeType=function(t){var e="";switch(t){case"html":e="text/html";break;case"pdf":e="application/pdf";break;case"docx":e="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"xlsx":e="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"txt":e="text/plain"}return e},t}(),i=function(){function t(){this.contentPos=0,this.bufferText="",this.bufferBlob=new Blob([""],{type:"text/plain"}),this.currentState="Initial",this.namespaceStack=[],this.namespaceStack.push(new r),this.namespaceStack[0].set("xmlns","http://www.w3.org/2000/xmlns/","Special"),this.namespaceStack.push(new r),this.namespaceStack[1].set("xml","http://www.w3.org/XML/1998/namespace","Special"),this.namespaceStack.push(new r),this.namespaceStack[2].set("","","Implied"),this.elementStack=[],this.elementStack.push(new o),this.elementStack[0].set("","","",this.namespaceStack.length-1),this.attributeStack=[],n.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),t.prototype.writeProcessingInstruction=function(t,e){if(void 0===t||null===t||0===t.length)throw new Error("ArgumentException: name should not be undefined, null or empty");if(this.checkName(t),void 0!==e&&null!==e||(e=""),3===t.length&&"xml"===t&&"Initial"!==this.currentState)throw new Error("InvalidArgumentException: Cannot write XML declaration.WriteStartDocument method has already written it");if("Initial"!==this.currentState||void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");this.writeStartDocument(),this.writeProcessingInstructionInternal(t,e)},t.prototype.writeStartDocument=function(t){if("Initial"!==this.currentState||void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");this.currentState="StartDocument",this.rawText('<?xml version="1.0" encoding="utf-8'),null!==t&&void 0!==t&&(this.rawText('" standalone="'),this.rawText(t?"yes":"no")),this.rawText('"?>')},t.prototype.writeEndDocument=function(){for(;this.elementStack.length-1>0;)this.writeEndElement();this.currentState="EndDocument",this.flush()},t.prototype.writeStartElement=function(t,e,n){if(void 0===this.bufferBlob)throw new Error("InvalidOperationException: Wrong Token");if(void 0===e||null===e||0===e.length)throw new Error("ArgumentException: localName cannot be undefined, null or empty");if(this.checkName(e),"Initial"===this.currentState&&this.writeStartDocument(),"StartElement"===this.currentState&&this.startElementContent(),this.currentState="StartElement",void 0===t||null===t)void 0!==n&&null!==n&&(t=this.lookupPrefix(n)),void 0!==t&&null!==t||(t="");else if(t.length>0&&(void 0!==n&&null!==n||(n=this.lookupNamespace(t)),void 0===n||null===n||void 0!==n&&0===n.length))throw new Error("ArgumentException: Cannot use a prefix with an empty namespace");void 0!==n&&null!==n||(n=this.lookupNamespace(t)),this.writeStartElementInternal(t,e,n)},t.prototype.writeEndElement=function(){"StartElement"===this.currentState?(this.startElementContent(),this.currentState="ElementContent"):"ElementContent"===this.currentState&&(this.currentState="ElementContent"),this.currentState="EndElement";var t=this.elementStack.length-1;this.writeEndElementInternal(this.elementStack[t].prefix,this.elementStack[t].localName),this.namespaceStack.splice(this.elementStack[t].previousTop+1),this.elementStack.splice(t),this.bufferText.length>10240&&this.flush()},t.prototype.writeElementString=function(t,e,n,i){this.writeStartElement(t,e,n),void 0!==i&&null!==i&&0!==i.length&&this.writeString(i),this.writeEndElement()},t.prototype.writeAttributeString=function(t,e,n,i){this.writeStartAttribute(t,e,n,i),this.writeStringInternal(i,!0),this.writeEndAttribute()},t.prototype.writeString=function(t){this.writeInternal(t,!1)},t.prototype.writeRaw=function(t){this.writeInternal(t,!0)},t.prototype.writeInternal=function(t,e){if(void 0!==t&&null!==t){if("StartElement"!==this.currentState&&"ElementContent"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");"StartElement"===this.currentState&&this.startElementContent(),this.currentState="ElementContent",e?this.rawText(t):this.writeStringInternal(t,!1)}},t.prototype.save=function(t){for(;this.elementStack.length-1>0;)this.writeEndElement();""!==this.bufferText&&this.flush(),n.save(t,this.buffer)},t.prototype.destroy=function(){this.bufferBlob=void 0;for(t=0;t<this.namespaceStack.length;t++)this.namespaceStack[t].destroy();this.namespaceStack=[];for(var t=0;t<this.elementStack.length;t++)this.elementStack[t].destroy();this.elementStack=[],this.bufferText="",this.contentPos=0},t.prototype.flush=function(){void 0!==this.bufferBlob&&(this.bufferBlob=new Blob([this.bufferBlob,this.bufferText],{type:"text/plain"}),this.bufferText="")},t.prototype.writeProcessingInstructionInternal=function(t,e){this.bufferText+="<?",this.rawText(t),e.length>0&&(this.bufferText+=" ",e=e.replace(/\?\>/g,"? >"),this.bufferText+=e),this.bufferText+="?",this.bufferText+=">"},t.prototype.writeStartAttribute=function(t,e,n,i){if(void 0===e||null===e||0===e.length){if("xmlns"!==t)throw new Error("ArgumentException: localName cannot be undefined, null or empty");e="xmlns",t=""}if("StartElement"!==this.currentState)throw new Error("InvalidOperationException: Wrong Token");this.checkName(e),this.writeStartAttributePrefixAndNameSpace(t,e,n,i)},t.prototype.writeStartAttributePrefixAndNameSpace=function(t,e,n,i){void 0!==t&&null!==t||(void 0!==n&&null!==n&&("xmlns"===e&&"http://www.w3.org/2000/xmlns/"===n||(t=this.lookupPrefix(n))),void 0!==t&&null!==t||(t="")),void 0!==n&&null!==n||(void 0!==t&&null!==t&&t.length>0&&(n=this.lookupNamespace(t)),void 0!==n&&null!==n||(n="")),this.writeStartAttributeSpecialAttribute(t,e,n,i)},t.prototype.writeStartAttributeSpecialAttribute=function(t,e,n,i){if(0===t.length){if("x"===e[0]&&"xmlns"===e)return this.skipPushAndWrite(t,e,n),void this.pushNamespaceExplicit("",i);n.length>0&&(t=this.lookupPrefix(n))}else{if("x"===t[0]){if("xmlns"===t)return this.skipPushAndWrite(t,e,n),void this.pushNamespaceExplicit(e,i);if("xml"===t&&("space"===e||"lang"===e))return void this.skipPushAndWrite(t,e,n)}0===n.length&&(t="")}void 0!==t&&null!==t&&0!==t.length&&this.pushNamespaceImplicit(t,n),this.skipPushAndWrite(t,e,n)},t.prototype.writeEndAttribute=function(){this.currentState="StartElement",this.bufferText+='"'},t.prototype.writeStartElementInternal=function(t,e,n){this.bufferText+="<",t.length>0&&(this.rawText(t),this.bufferText+=":"),this.rawText(e);var i=this.elementStack.length;this.elementStack.push(new o),this.elementStack[i].set(t,e,n,this.namespaceStack.length-1),this.pushNamespaceImplicit(t,n);for(var r=0;r<this.attributeStack.length;r++)this.attributeStack[r].destroy();this.attributeStack=[]},t.prototype.writeEndElementInternal=function(t,e){this.contentPos!==this.bufferText.length+1?(this.bufferText+="</",void 0!==t&&null!==t&&0!==t.length&&(this.rawText(t),this.bufferText+=":"),this.rawText(e),this.bufferText+=">"):(this.bufferText=this.bufferText.substring(0,this.bufferText.length-1),this.bufferText+=" />")},t.prototype.writeStartAttributeInternal=function(t,e,n){this.bufferText+=" ",void 0!==t&&null!==t&&t.length>0&&(this.rawText(t),this.bufferText+=":"),this.rawText(e),this.bufferText+="=",this.bufferText+='"'},t.prototype.writeNamespaceDeclaration=function(t,e){this.writeStartNamespaceDeclaration(t),this.writeStringInternal(e,!0),this.bufferText+='"'},t.prototype.writeStartNamespaceDeclaration=function(t){void 0===t||null===t||0===t.length?this.rawText(' xmlns="'):(this.rawText(" xmlns:"),this.rawText(t),this.bufferText+="=",this.bufferText+='"')},t.prototype.writeStringInternal=function(t,e){null!==t&&void 0!==t||(t=""),t=(t=(t=t.replace(/\&/g,"&")).replace(/\</g,"<")).replace(/\>/g,">"),e&&(t=t.replace(/\"/g,""")),this.bufferText+=t,e||(this.contentPos=0)},t.prototype.startElementContent=function(){for(var t=this.elementStack[this.elementStack.length-1].previousTop,e=this.namespaceStack.length-1;e>t;e--)"NeedToWrite"===this.namespaceStack[e].kind&&this.writeNamespaceDeclaration(this.namespaceStack[e].prefix,this.namespaceStack[e].namespaceUri);this.bufferText+=">",this.contentPos=this.bufferText.length+1},t.prototype.rawText=function(t){this.bufferText+=t},t.prototype.addNamespace=function(t,e,n){var i=this.namespaceStack.length;this.namespaceStack.push(new r),this.namespaceStack[i].set(t,e,n)},t.prototype.lookupPrefix=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].namespaceUri===t)return this.namespaceStack[e].prefix},t.prototype.lookupNamespace=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].prefix===t)return this.namespaceStack[e].namespaceUri},t.prototype.lookupNamespaceIndex=function(t){for(var e=this.namespaceStack.length-1;e>=0;e--)if(this.namespaceStack[e].prefix===t)return e;return-1},t.prototype.pushNamespaceImplicit=function(t,e){var n,i=this.lookupNamespaceIndex(t);if(-1!==i){if(i>this.elementStack[this.elementStack.length-1].previousTop){if(this.namespaceStack[i].namespaceUri!==e)throw new Error("XmlException namespace Uri needs to be the same as the one that is already declared");return}if("Special"===this.namespaceStack[i].kind){if("xml"!==t)throw new Error('InvalidArgumentException: Prefix "xmlns" is reserved for use by XML.');if(e!==this.namespaceStack[i].namespaceUri)throw new Error("InvalidArgumentException: Xml String");n="Implied"}else n=this.namespaceStack[i].namespaceUri===e?"Implied":"NeedToWrite"}else{if("http://www.w3.org/XML/1998/namespace"===e&&"xml"!==t||"http://www.w3.org/2000/xmlns/"===e&&"xmlns"!==t)throw new Error("InvalidArgumentException");n="NeedToWrite"}this.addNamespace(t,e,n)},t.prototype.pushNamespaceExplicit=function(t,e){var n=this.lookupNamespaceIndex(t);if(-1!==n&&n>this.elementStack[this.elementStack.length-1].previousTop)return void(this.namespaceStack[n].kind="Written");this.addNamespace(t,e,"Written")},t.prototype.addAttribute=function(t,e,n){var i=this.attributeStack.length;this.attributeStack.push(new s),this.attributeStack[i].set(t,e,n);for(var r=0;r<i;r++)if(this.attributeStack[r].isDuplicate(t,e,n))throw new Error("XmlException: duplicate attribute name")},t.prototype.skipPushAndWrite=function(t,e,n){this.addAttribute(t,e,n),this.writeStartAttributeInternal(t,e,n)},t.prototype.checkName=function(t){if(/[ !@#$%^&*()+\=\[\]{};':"\\|,<>\/?]/.test(t))throw new Error("InvalidArgumentException: invalid name character")},t}(),r=function(){function t(){}return t.prototype.set=function(t,e,n){this.prefix=t,this.namespaceUri=e,this.kind=n},t.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.kind=void 0},t}(),o=function(){function t(){}return t.prototype.set=function(t,e,n,i){this.previousTop=i,this.prefix=t,this.namespaceUri=n,this.localName=e},t.prototype.destroy=function(){this.previousTop=void 0,this.prefix=void 0,this.localName=void 0,this.namespaceUri=void 0},t}(),s=function(){function t(){}return t.prototype.set=function(t,e,n){this.prefix=t,this.namespaceUri=n,this.localName=e},t.prototype.isDuplicate=function(t,e,n){return this.localName===e&&(this.prefix===t||this.namespaceUri===n)},t.prototype.destroy=function(){this.prefix=void 0,this.namespaceUri=void 0,this.localName=void 0},t}(),a=function(){function t(t){this.emitBOM=!0,this.encodingType="Ansi",this.initBOM(t)}return Object.defineProperty(t.prototype,"includeBom",{get:function(){return this.emitBOM},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.encodingType},set:function(t){this.encodingType=t},enumerable:!0,configurable:!0}),t.prototype.initBOM=function(t){this.emitBOM=void 0===t||null===t||t},t.prototype.getByteCount=function(t){return e(t,"string"),""===t?this.utf8Len(t.charCodeAt(0)):(null!==this.type&&void 0!==this.type||(this.type="Ansi"),this.getByteCountInternal(t,0,t.length))},t.prototype.utf8Len=function(t){return t<=127?1:t<=2047?2:t<=65535?3:t<=2097151?4:0},t.prototype.isHighSurrogate=function(t){return t>=55296&&t<=56319},t.prototype.toCodepoint=function(t,e){return((t=(1023&t)<<10)|1023&e)+65536},t.prototype.getByteCountInternal=function(t,e,n){var i=0;if("Utf8"===this.encodingType||"Unicode"===this.encodingType){for(var r="Utf8"===this.encodingType,o=0;o<n;o++){var s=t.charCodeAt(r?e:e++);if(this.isHighSurrogate(s))if(r){var a=s,h=t.charCodeAt(++e);i+=this.utf8Len(this.toCodepoint(a,h))}else i+=4,++o;else i+=r?this.utf8Len(s):2;r&&e++}return i}return i=n},t.prototype.getBytes=function(t,n,i){if(e(t,"string"),e(n,"charIndex"),e(i,"charCount"),n<0||i<0)throw new RangeError("Argument Out Of Range Exception: charIndex or charCount is less than zero");if(t.length-n<i)throw new RangeError("Argument Out Of Range Exception: charIndex and charCount do not denote a valid range in string");if(""===t)return new ArrayBuffer(0);null!==this.type&&void 0!==this.type||(this.type="Ansi");var r=this.getByteCountInternal(t,n,i);switch(this.type){case"Utf8":return this.getBytesOfUtf8Encoding(r,t,n,i);case"Unicode":return this.getBytesOfUnicodeEncoding(r,t,n,i);default:return this.getBytesOfAnsiEncoding(r,t,n,i)}},t.prototype.getString=function(t,n,i){if(e(t,"bytes"),e(n,"index"),e(i,"count"),n<0||i<0)throw new RangeError("Argument Out Of Range Exception: index or count is less than zero");if(t.byteLength-n<i)throw new RangeError("Argument Out Of Range Exception: index and count do not denote a valid range in bytes");if(0===t.byteLength||0===i)return"";null!==this.type&&void 0!==this.type||(this.type="Ansi");var r="",o=new Uint8Array(t);switch(this.type){case"Utf8":return this.getStringOfUtf8Encoding(o,n,i);case"Unicode":var s=new Uint16Array(t);return r=this.getStringofUnicodeEncoding(s,n,i);default:for(var a=n,h=0;h<i;h++){var c=o[a];r+=String.fromCharCode(c),a++}return r}},t.prototype.getBytesOfAnsiEncoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint8Array(r),s=0,a=0;a<i;a++){var h=e.charCodeAt(n++);o[s]=h<2048?h:63,s++}return r},t.prototype.getBytesOfUtf8Encoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint8Array(r),s=n,a=0,h=0;h<i;h++){var c=e.charCodeAt(s);c<=127?o[a]=c:c<2048?(o[a]=192|c>>6,o[++a]=128|63&c):c<55296||c>=57344?(o[a]=224|c>>12,o[++a]=128|c>>6&63,o[++a]=128|63&c):(o[a]=239,o[++a]=191,o[++a]=189),++a,++s}return r},t.prototype.getBytesOfUnicodeEncoding=function(t,e,n,i){for(var r=new ArrayBuffer(t),o=new Uint16Array(r),s=0;s<i;s++){var a=e.charCodeAt(s);o[s]=a}return r},t.prototype.getStringOfUtf8Encoding=function(t,e,n){var i=0,r=e,o="";for(i;i<n;i++){for(var s=t[r++];r>t.length;)return o;s>127&&(s>191&&s<224&&r<n?s=(31&s)<<6|63&t[r]:s>223&&s<240&&r<t.byteLength?s=(15&s)<<12|(63&t[r])<<6|63&t[++r]:s>239&&s<248&&r<t.byteLength&&(s=(7&s)<<18|(63&t[r])<<12|(63&t[++r])<<6|63&t[++r]),++r),o+=String.fromCharCode(s)}return o},t.prototype.getStringofUnicodeEncoding=function(t,e,n){if(n>t.length)throw new RangeError("ArgumentOutOfRange_Count");for(var i=new Uint16Array(n),r=0;r<n&&r<t.length;r++)i[r]=t[e++];return String.fromCharCode.apply(null,i)},t.prototype.destroy=function(){this.emitBOM=void 0,this.encodingType=void 0},t}(),h=function(){function t(t){this.bufferBlob=new Blob([""]),this.bufferText="",this.init(t),n.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"buffer",{get:function(){return this.flush(),this.bufferBlob},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"encoding",{get:function(){return this.enc},enumerable:!0,configurable:!0}),t.prototype.init=function(t){null===t||void 0===t?(this.enc=new a(!1),this.enc.type="Utf8"):(this.enc=t,this.setBomByte())},t.prototype.setBomByte=function(){if(this.encoding.includeBom)switch(this.encoding.type){case"Unicode":var t=new ArrayBuffer(2),e=new Uint8Array(t);e[0]=255,e[1]=254,this.bufferBlob=new Blob([t]);break;case"Utf8":var n=new ArrayBuffer(3),i=new Uint8Array(n);i[0]=239,i[1]=187,i[2]=191,this.bufferBlob=new Blob([n]);break;default:this.bufferBlob=new Blob([""])}},t.prototype.save=function(t){""!==this.bufferText&&this.flush(),n.save(t,this.buffer)},t.prototype.write=function(t){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");e(t,"string"),this.bufferText+=t,this.bufferText.length>=10240&&this.flush()},t.prototype.flush=function(){if(void 0!==this.bufferText&&null!==this.bufferText&&0!==this.bufferText.length){var t=this.encoding.getBytes(this.bufferText,0,this.bufferText.length);this.bufferText="",this.bufferBlob=new Blob([this.bufferBlob,t])}},t.prototype.writeLine=function(t){if(void 0===this.encoding)throw new Error("Object Disposed Exception: current writer is disposed");e(t,"string"),this.bufferText=this.bufferText+t+"\r\n",this.bufferText.length>=10240&&this.flush()},t.prototype.destroy=function(){this.bufferBlob=void 0,this.bufferText=void 0,this.enc instanceof a&&this.enc.destroy(),this.enc=void 0},t}();return t.XmlWriter=i,t.Namespace=r,t.XmlElement=o,t.XmlAttribute=s,t.StreamWriter=h,t.Encoding=a,t.validateNullOrUndefined=e,t.Save=n,t}({}),this.ejs=ej;
- /*!
- * filename: ej2-compression.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.compression=function(t,e){"use strict";var i=new Int16Array(286),r=new Uint8Array(286),n=new Int16Array(30),s=new Uint8Array(30),h=function(){function t(e){this.pendingBuffer=new Uint8Array(65536),this.pendingBufLength=0,this.pendingBufCache=0,this.pendingBufBitsInCache=0,this.bufferPosition=0,this.extraBits=0,this.currentHash=0,this.matchStart=0,this.matchLength=0,this.matchPrevAvail=!1,this.blockStart=0,this.stringStart=0,this.lookAhead=0,this.totalBytesIn=0,this.inputOffset=0,this.inputEnd=0,this.windowSize=32768,this.windowMask=this.windowSize-1,this.hashSize=32768,this.hashMask=this.hashSize-1,this.hashShift=Math.floor(17/3),this.maxDist=this.windowSize-262,this.checkSum=1,this.noWrap=!1,t.isHuffmanTreeInitiated||(t.initHuffmanTree(),t.isHuffmanTreeInitiated=!0),this.treeLiteral=new o(this,286,257,15),this.treeDistances=new o(this,30,1,15),this.treeCodeLengths=new o(this,19,4,7),this.arrDistances=new Uint16Array(16384),this.arrLiterals=new Uint8Array(16384),this.stream=[],this.dataWindow=new Uint8Array(2*this.windowSize),this.hashHead=new Int16Array(this.hashSize),this.hashPrevious=new Int16Array(this.windowSize),this.blockStart=this.stringStart=1,this.noWrap=e,e||this.writeZLibHeader()}return Object.defineProperty(t.prototype,"compressedData",{get:function(){return this.stream},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"getCompressedString",{get:function(){var t="";if(void 0!==this.stream)for(var e=0;e<this.stream.length;e++)t+=String.fromCharCode.apply(null,this.stream[e]);return t},enumerable:!0,configurable:!0}),t.prototype.write=function(t,i,r){if(void 0===t||null===t)throw new Error("ArgumentException: data cannot null or undefined");var n=i+r;if(0>i||i>n||n>t.length)throw new Error("ArgumentOutOfRangeException: Offset or length is incorrect");if("string"==typeof t){var s=new e.Encoding(!1);s.type="Utf8",n=i+(t=new Uint8Array(s.getBytes(t,0,t.length))).length}for(this.inputBuffer=t,this.inputOffset=i,this.inputEnd=n,this.noWrap||(this.checkSum=a.checksumUpdate(this.checkSum,this.inputBuffer,this.inputOffset,n));this.inputEnd!==this.inputOffset||0!==this.pendingBufLength;)this.pendingBufferFlush(),this.compressData(!1)},t.prototype.writeZLibHeader=function(){var t=30720;t|=64,t+=31-t%31,this.pendingBufferWriteShortBytes(t)},t.prototype.pendingBufferWriteShortBytes=function(t){this.pendingBuffer[this.pendingBufLength++]=t>>8,this.pendingBuffer[this.pendingBufLength++]=t},t.prototype.compressData=function(t){var e;do{this.fillWindow();var i=t&&this.inputEnd===this.inputOffset;e=this.compressSlow(i,t)}while(0===this.pendingBufLength&&e);return e},t.prototype.compressSlow=function(t,e){if(this.lookAhead<262&&!t)return!1;for(;this.lookAhead>=262||t;){if(0===this.lookAhead)return this.lookAheadCompleted(e);this.stringStart>=2*this.windowSize-262&&this.slideWindow();var i=this.matchStart,r=this.matchLength;if(this.lookAhead>=3&&this.discardMatch(),r>=3&&this.matchLength<=r?r=this.matchPreviousBest(i,r):this.matchPreviousAvailable(),this.bufferPosition>=16384)return this.huffmanIsFull(e)}return!0},t.prototype.discardMatch=function(){var t=this.insertString();0!==t&&this.stringStart-t<=this.maxDist&&this.findLongestMatch(t)&&this.matchLength<=5&&3===this.matchLength&&this.stringStart-this.matchStart>4096&&(this.matchLength=2)},t.prototype.matchPreviousAvailable=function(){this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!0,this.stringStart++,this.lookAhead--},t.prototype.matchPreviousBest=function(t,e){this.huffmanTallyDist(this.stringStart-1-t,e),e-=2;do{this.stringStart++,--this.lookAhead>=3&&this.insertString()}while(--e>0);return this.stringStart++,this.lookAhead--,this.matchPrevAvail=!1,this.matchLength=2,e},t.prototype.lookAheadCompleted=function(t){return this.matchPrevAvail&&this.huffmanTallyLit(255&this.dataWindow[this.stringStart-1]),this.matchPrevAvail=!1,this.huffmanFlushBlock(this.dataWindow,this.blockStart,this.stringStart-this.blockStart,t),this.blockStart=this.stringStart,!1},t.prototype.huffmanIsFull=function(t){var e=this.stringStart-this.blockStart;this.matchPrevAvail&&e--;var i=t&&0===this.lookAhead&&!this.matchPrevAvail;return this.huffmanFlushBlock(this.dataWindow,this.blockStart,e,i),this.blockStart+=e,!i},t.prototype.fillWindow=function(){for(this.stringStart>=this.windowSize+this.maxDist&&this.slideWindow();this.lookAhead<262&&this.inputOffset<this.inputEnd;){var t=2*this.windowSize-this.lookAhead-this.stringStart;t>this.inputEnd-this.inputOffset&&(t=this.inputEnd-this.inputOffset),this.dataWindow.set(this.inputBuffer.subarray(this.inputOffset,this.inputOffset+t),this.stringStart+this.lookAhead),this.inputOffset+=t,this.totalBytesIn+=t,this.lookAhead+=t}this.lookAhead>=3&&this.updateHash()},t.prototype.slideWindow=function(){this.dataWindow.set(this.dataWindow.subarray(this.windowSize,this.windowSize+this.windowSize),0),this.matchStart-=this.windowSize,this.stringStart-=this.windowSize,this.blockStart-=this.windowSize;for(t=0;t<this.hashSize;++t){e=65535&this.hashHead[t];this.hashHead[t]=e>=this.windowSize?e-this.windowSize:0}for(var t=0;t<this.windowSize;t++){var e=65535&this.hashPrevious[t];this.hashPrevious[t]=e>=this.windowSize?e-this.windowSize:0}},t.prototype.insertString=function(){var t,e=(this.currentHash<<this.hashShift^this.dataWindow[this.stringStart+2])&this.hashMask;return this.hashPrevious[this.stringStart&this.windowMask]=t=this.hashHead[e],this.hashHead[e]=this.stringStart,this.currentHash=e,65535&t},t.prototype.findLongestMatch=function(t){var e,i=4096,r=258,n=this.stringStart,s=this.stringStart+this.matchLength,h=Math.max(this.matchLength,2),o=Math.max(this.stringStart-this.maxDist,0),a=this.stringStart+258-1,f=this.dataWindow[s-1],u=this.dataWindow[s],d=this.dataWindow;h>=32&&(i>>=2),r>this.lookAhead&&(r=this.lookAhead);do{if(d[t+h]===u&&d[t+h-1]===f&&d[t]===d[n]&&d[t+1]===d[n+1]){for(e=t+2,n+=2;d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&d[++n]===d[++e]&&n<a;);if(n>s){if(this.matchStart=t,s=n,(h=n-this.stringStart)>=r)break;f=d[s-1],u=d[s]}n=this.stringStart}}while((t=65535&this.hashPrevious[t&this.windowMask])>o&&0!=--i);return this.matchLength=Math.min(h,this.lookAhead),this.matchLength>=3},t.prototype.updateHash=function(){this.currentHash=this.dataWindow[this.stringStart]<<this.hashShift^this.dataWindow[this.stringStart+1]},t.prototype.huffmanTallyLit=function(t){return this.arrDistances[this.bufferPosition]=0,this.arrLiterals[this.bufferPosition++]=t,this.treeLiteral.codeFrequencies[t]++,this.bufferPosition>=16384},t.prototype.huffmanTallyDist=function(t,e){this.arrDistances[this.bufferPosition]=t,this.arrLiterals[this.bufferPosition++]=e-3;var i=this.huffmanLengthCode(e-3);this.treeLiteral.codeFrequencies[i]++,i>=265&&i<285&&(this.extraBits+=Math.floor((i-261)/4));var r=this.huffmanDistanceCode(t-1);return this.treeDistances.codeFrequencies[r]++,r>=4&&(this.extraBits+=Math.floor(r/2-1)),this.bufferPosition>=16384},t.prototype.huffmanFlushBlock=function(t,e,h,a){this.treeLiteral.codeFrequencies[256]++,this.treeLiteral.buildTree(),this.treeDistances.buildTree(),this.treeLiteral.calculateBLFreq(this.treeCodeLengths),this.treeDistances.calculateBLFreq(this.treeCodeLengths),this.treeCodeLengths.buildTree();for(var f=4,u=18;u>f;u--)this.treeCodeLengths.codeLengths[o.huffCodeLengthOrders[u]]>0&&(f=u+1);for(var d=14+3*f+this.treeCodeLengths.getEncodedLength()+this.treeLiteral.getEncodedLength()+this.treeDistances.getEncodedLength()+this.extraBits,c=this.extraBits,u=0;u<286;u++)c+=this.treeLiteral.codeFrequencies[u]*r[u];for(u=0;u<30;u++)c+=this.treeDistances.codeFrequencies[u]*s[u];d>=c&&(d=c),e>=0&&h+4<d>>3?this.huffmanFlushStoredBlock(t,e,h,a):d==c?(this.pendingBufferWriteBits(2+(a?1:0),3),this.treeLiteral.setStaticCodes(i,r),this.treeDistances.setStaticCodes(n,s),this.huffmanCompressBlock(),this.huffmanReset()):(this.pendingBufferWriteBits(4+(a?1:0),3),this.huffmanSendAllTrees(f),this.huffmanCompressBlock(),this.huffmanReset())},t.prototype.huffmanFlushStoredBlock=function(t,e,i,r){this.pendingBufferWriteBits(0+(r?1:0),3),this.pendingBufferAlignToByte(),this.pendingBufferWriteShort(i),this.pendingBufferWriteShort(~i),this.pendingBufferWriteByteBlock(t,e,i),this.huffmanReset()},t.prototype.huffmanLengthCode=function(t){if(255===t)return 285;for(var e=257;t>=8;)e+=4,t>>=1;return e+t},t.prototype.huffmanDistanceCode=function(t){for(var e=0;t>=4;)e+=2,t>>=1;return e+t},t.prototype.huffmanSendAllTrees=function(t){this.treeCodeLengths.buildCodes(),this.treeLiteral.buildCodes(),this.treeDistances.buildCodes(),this.pendingBufferWriteBits(this.treeLiteral.treeLength-257,5),this.pendingBufferWriteBits(this.treeDistances.treeLength-1,5),this.pendingBufferWriteBits(t-4,4);for(var e=0;e<t;e++)this.pendingBufferWriteBits(this.treeCodeLengths.codeLengths[o.huffCodeLengthOrders[e]],3);this.treeLiteral.writeTree(this.treeCodeLengths),this.treeDistances.writeTree(this.treeCodeLengths)},t.prototype.huffmanReset=function(){this.bufferPosition=0,this.extraBits=0,this.treeLiteral.reset(),this.treeDistances.reset(),this.treeCodeLengths.reset()},t.prototype.huffmanCompressBlock=function(){for(var t=0;t<this.bufferPosition;t++){var e=255&this.arrLiterals[t],i=this.arrDistances[t];if(0!=i--){var r=this.huffmanLengthCode(e);this.treeLiteral.writeCodeToStream(r);var n=Math.floor((r-261)/4);n>0&&n<=5&&this.pendingBufferWriteBits(e&(1<<n)-1,n);var s=this.huffmanDistanceCode(i);this.treeDistances.writeCodeToStream(s),(n=Math.floor(s/2-1))>0&&this.pendingBufferWriteBits(i&(1<<n)-1,n)}else this.treeLiteral.writeCodeToStream(e)}this.treeLiteral.writeCodeToStream(256)},t.prototype.pendingBufferWriteBits=function(t,e){var i=new Uint32Array(1);i[0]=this.pendingBufCache|t<<this.pendingBufBitsInCache,this.pendingBufCache=i[0],this.pendingBufBitsInCache+=e,this.pendingBufferFlushBits()},t.prototype.pendingBufferFlush=function(t){if(this.pendingBufferFlushBits(),this.pendingBufLength>0){var e=new Uint8Array(this.pendingBufLength);e.set(this.pendingBuffer.subarray(0,this.pendingBufLength),0),this.stream.push(e)}this.pendingBufLength=0},t.prototype.pendingBufferFlushBits=function(){for(var t=0;this.pendingBufBitsInCache>=8&&this.pendingBufLength<65536;)this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache,this.pendingBufCache>>=8,this.pendingBufBitsInCache-=8,t++;return t},t.prototype.pendingBufferWriteByteBlock=function(t,e,i){var r=t.subarray(e,e+i);this.pendingBuffer.set(r,this.pendingBufLength),this.pendingBufLength+=i},t.prototype.pendingBufferWriteShort=function(t){this.pendingBuffer[this.pendingBufLength++]=t,this.pendingBuffer[this.pendingBufLength++]=t>>8},t.prototype.pendingBufferAlignToByte=function(){this.pendingBufBitsInCache>0&&(this.pendingBuffer[this.pendingBufLength++]=this.pendingBufCache),this.pendingBufCache=0,this.pendingBufBitsInCache=0},t.initHuffmanTree=function(){for(var t=0;t<144;)i[t]=o.bitReverse(48+t<<8),r[t++]=8;for(;t<256;)i[t]=o.bitReverse(256+t<<7),r[t++]=9;for(;t<280;)i[t]=o.bitReverse(-256+t<<9),r[t++]=7;for(;t<286;)i[t]=o.bitReverse(-88+t<<8),r[t++]=8;for(t=0;t<30;t++)n[t]=o.bitReverse(t<<11),s[t]=5},t.prototype.close=function(){do{this.pendingBufferFlush(!0),this.compressData(!0)||(this.pendingBufferFlush(!0),this.pendingBufferAlignToByte(),this.noWrap||(this.pendingBufferWriteShortBytes(this.checkSum>>16),this.pendingBufferWriteShortBytes(65535&this.checkSum)),this.pendingBufferFlush(!0))}while(this.inputEnd!==this.inputOffset||0!==this.pendingBufLength)},t.prototype.destroy=function(){this.stream=[],this.stream=void 0,this.pendingBuffer=void 0,this.treeLiteral=void 0,this.treeDistances=void 0,this.treeCodeLengths=void 0,this.arrLiterals=void 0,this.arrDistances=void 0,this.hashHead=void 0,this.hashPrevious=void 0,this.dataWindow=void 0,this.inputBuffer=void 0,this.pendingBufLength=void 0,this.pendingBufCache=void 0,this.pendingBufBitsInCache=void 0,this.bufferPosition=void 0,this.extraBits=void 0,this.currentHash=void 0,this.matchStart=void 0,this.matchLength=void 0,this.matchPrevAvail=void 0,this.blockStart=void 0,this.stringStart=void 0,this.lookAhead=void 0,this.totalBytesIn=void 0,this.inputOffset=void 0,this.inputEnd=void 0,this.windowSize=void 0,this.windowMask=void 0,this.hashSize=void 0,this.hashMask=void 0,this.hashShift=void 0,this.maxDist=void 0,this.checkSum=void 0,this.noWrap=void 0},t.isHuffmanTreeInitiated=!1,t}(),o=function(){function t(t,e,i,r){this.writer=t,this.codeMinCount=i,this.maxLength=r,this.codeFrequency=new Uint16Array(e),this.lengthCount=new Int32Array(r)}return Object.defineProperty(t.prototype,"treeLength",{get:function(){return this.codeCount},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeLengths",{get:function(){return this.codeLength},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"codeFrequencies",{get:function(){return this.codeFrequency},enumerable:!0,configurable:!0}),t.prototype.setStaticCodes=function(t,e){var i=new Int16Array(t.length);i.set(t,0),this.codes=i;var r=new Uint8Array(e.length);r.set(e,0),this.codeLength=r},t.prototype.reset=function(){for(var t=0;t<this.codeFrequency.length;t++)this.codeFrequency[t]=0;this.codes=void 0,this.codeLength=void 0},t.prototype.writeCodeToStream=function(t){this.writer.pendingBufferWriteBits(65535&this.codes[t],this.codeLength[t])},t.prototype.buildCodes=function(){var e=new Int32Array(this.maxLength);this.codes=new Int16Array(this.codeCount);for(var i=0,r=0;r<this.maxLength;r++)e[r]=i,i+=this.lengthCount[r]<<15-r;for(var n=0;n<this.codeCount;n++){var s=this.codeLength[n];s>0&&(this.codes[n]=t.bitReverse(e[s-1]),e[s-1]+=1<<16-s)}},t.bitReverse=function(e){return t.reverseBits[15&e]<<12|t.reverseBits[e>>4&15]<<8|t.reverseBits[e>>8&15]<<4|t.reverseBits[e>>12]},t.prototype.getEncodedLength=function(){for(var t=0,e=0;e<this.codeFrequency.length;e++)t+=this.codeFrequency[e]*this.codeLength[e];return t},t.prototype.calculateBLFreq=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var h=this.codeLength[s];for(0===h?(e=138,i=3):(e=6,i=3,n!==h&&(t.codeFrequency[h]++,r=0)),n=h,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););r<i?t.codeFrequency[n]+=r:0!==n?t.codeFrequency[16]++:r<=10?t.codeFrequency[17]++:t.codeFrequency[18]++}},t.prototype.writeTree=function(t){for(var e,i,r,n=-1,s=0;s<this.codeCount;){r=1;var h=this.codeLength[s];for(0===h?(e=138,i=3):(e=6,i=3,n!==h&&(t.writeCodeToStream(h),r=0)),n=h,s++;s<this.codeCount&&n===this.codeLength[s]&&(s++,!(++r>=e)););if(r<i)for(;r-- >0;)t.writeCodeToStream(n);else 0!==n?(t.writeCodeToStream(16),this.writer.pendingBufferWriteBits(r-3,2)):r<=10?(t.writeCodeToStream(17),this.writer.pendingBufferWriteBits(r-3,3)):(t.writeCodeToStream(18),this.writer.pendingBufferWriteBits(r-11,7))}},t.prototype.buildTree=function(){for(var t=this.codeFrequency.length,e=new Int32Array(t),i=0,r=0,n=0;n<t;n++){var s=this.codeFrequency[n];if(0!==s){for(var h=i++,o=0;h>0&&this.codeFrequency[e[o=Math.floor((h-1)/2)]]>s;)e[h]=e[o],h=o;e[h]=n,r=n}}for(;i<2;)e[i++]=r<2?++r:0;this.codeCount=Math.max(r+1,this.codeMinCount);for(var a=i,f=new Int32Array(4*i-2),u=new Int32Array(2*i-1),d=0;d<i;d++){var c=e[d],p=2*d;f[p]=c,f[p+1]=-1,u[d]=this.codeFrequency[c]<<8,e[d]=d}this.constructHuffmanTree(e,i,u,a,f),this.buildLength(f)},t.prototype.constructHuffmanTree=function(t,e,i,r,n){do{for(var s=t[0],h=t[--e],o=i[h],a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>o;)t[f]=t[a];t[f]=h;var u=t[0];n[2*(h=r++)]=s,n[2*h+1]=u;var d=Math.min(255&i[s],255&i[u]);for(i[h]=o=i[s]+i[u]-d+1,a=0,f=1;f<e;)f+1<e&&i[t[f]]>i[t[f+1]]&&f++,t[a]=t[f],f=2*(a=f)+1;for(;(f=a)>0&&i[t[a=Math.floor((f-1)/2)]]>o;)t[f]=t[a];t[f]=h}while(e>1)},t.prototype.buildLength=function(t){this.codeLength=new Uint8Array(this.codeFrequency.length);for(var e=Math.floor(t.length/2),i=Math.floor((e+1)/2),r=0,n=0;n<this.maxLength;n++)this.lengthCount[n]=0;if(0!==(r=this.calculateOptimalCodeLength(t,r,e))){var s=this.maxLength-1;do{for(;0===this.lengthCount[--s];);do{this.lengthCount[s]--,this.lengthCount[++s]++,r-=1<<this.maxLength-1-s}while(r>0&&s<this.maxLength-1)}while(r>0);this.recreateTree(t,r,i)}},t.prototype.recreateTree=function(t,e,i){this.lengthCount[this.maxLength-1]+=e,this.lengthCount[this.maxLength-2]-=e;for(var r=2*i,n=this.maxLength;0!==n;n--)for(var s=this.lengthCount[n-1];s>0;){var h=2*t[r++];-1===t[h+1]&&(this.codeLength[t[h]]=n,s--)}},t.prototype.calculateOptimalCodeLength=function(t,e,i){var r=new Int32Array(i);r[i-1]=0;for(var n=i-1;n>=0;n--){var s=2*n+1;if(-1!==t[s])(h=r[n]+1)>this.maxLength&&(h=this.maxLength,e++),r[t[s-1]]=r[t[s]]=h;else{var h=r[n];this.lengthCount[h-1]++,this.codeLength[t[s-1]]=r[n]}}return e},t.reverseBits=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],t.huffCodeLengthOrders=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],t}(),a=function(){function t(){}return t.checksumUpdate=function(e,i,r,n){var s=new Uint32Array(1);s[0]=e;for(var h=s[0],o=s[0]=65535&h,a=s[0]=h>>t.checkSumBitOffset;n>0;){var f=Math.min(n,t.checksumIterationCount);for(n-=f;--f>=0;)a+=o+=s[0]=255&i[r++];o%=t.checksumBase,a%=t.checksumBase}return h=a<<t.checkSumBitOffset|o},t.checkSumBitOffset=16,t.checksumBase=65521,t.checksumIterationCount=3800,t}(),f=[],u=function(){function t(){0===f.length&&t.initCrc32Table(),this.files=[],this.level="Normal",e.Save.isMicrosoftBrowser=!!navigator.msSaveBlob}return Object.defineProperty(t.prototype,"compressionLevel",{get:function(){return this.level},set:function(t){this.level=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return void 0===this.files?0:this.files.length},enumerable:!0,configurable:!0}),t.prototype.addItem=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: item cannot be null or undefined");for(var e=0;e<this.files.length;e++){var i=this.files[e];if(i instanceof d&&i.name===t.name)throw new Error("item with same name already exist")}this.files.push(t)},t.prototype.addDirectory=function(t){if(null===t||void 0===t)throw new Error("ArgumentException: string cannot be null or undefined");if(0===t.length)throw new Error("ArgumentException: string cannot be empty");if("/"!==t.slice(-1)&&(t+="/"),-1!==this.files.indexOf(t))throw new Error("item with same name already exist");this.files.push(t)},t.prototype.getItem=function(t){if(t>=0&&t<this.files.length)return this.files[t]},t.prototype.contains=function(t){return-1!==this.files.indexOf(t)},t.prototype.save=function(t){if(null===t||void 0===t||0===t.length)throw new Error("ArgumentException: fileName cannot be null or undefined");if(0===this.files.length)throw new Error("InvalidOperation");var e=this;return new Promise(function(i,r){e.saveInternal(t,!1).then(function(){i(e)})})},t.prototype.saveAsBlob=function(){var t=this;return new Promise(function(e,i){t.saveInternal("",!0).then(function(t){e(t)})})},t.prototype.saveInternal=function(t,e){var i=this,r=this;return new Promise(function(n,s){for(var h=[],o=0,a=0;a<r.files.length;a++)i.getCompressedData(i.files[a]).then(function(i){if(o=r.constructZippedObject(h,i,o,i.isDirectory),h.length===r.files.length){var s=r.writeZippedContent(t,h,o,e);n(s)}})})},t.prototype.destroy=function(){if(void 0!==this.files&&this.files.length>0){for(var t=0;t<this.files.length;t++){var e=this.files[t];e instanceof d&&e.destroy(),e=void 0}this.files=[]}this.files=void 0,this.level=void 0},t.prototype.getCompressedData=function(t){var e=this;return new Promise(function(i,r){if(t instanceof d){var n=new FileReader;n.onload=function(){var r=new Uint8Array(n.result),s={fileName:t.name,crc32Value:0,compressedData:[],compressedSize:void 0,uncompressedDataSize:r.length,compressionType:void 0,isDirectory:!1};if("Normal"===e.level){e.compressData(r,s,f);for(var h=0,o=0;o<s.compressedData.length;o++)h+=s.compressedData[o].length;s.compressedSize=h,s.compressionType="\b\0"}else s.compressedSize=r.length,s.crc32Value=e.calculateCrc32Value(0,r,f),s.compressionType="\0\0",s.compressedData.push(r);i(s)},n.readAsArrayBuffer(t.data)}else i({fileName:t,crc32Value:0,compressedData:"",compressedSize:0,uncompressedDataSize:0,compressionType:"\0\0",isDirectory:!0})})},t.prototype.compressData=function(t,e,i){var r=new h(!0),n=0,s=0;do{if(n>=t.length){r.close();break}s=Math.min(t.length,n+16384);var o=t.subarray(n,s);e.crc32Value=this.calculateCrc32Value(e.crc32Value,o,i),r.write(o,0,s-n),n=s}while(n<=t.length);e.compressedData=r.compressedData,r.destroy()},t.prototype.constructZippedObject=function(t,e,i,r){var n=0,s=new Date;r&&(n|=16),n|=0;var h=this.writeHeader(e,s),o="PK"+h+e.fileName,a=this.writeCentralDirectory(e,h,i,n);return t.push({localHeader:o,centralDir:a,compressedData:e}),i+o.length+e.compressedSize},t.prototype.writeHeader=function(t,e){var i="";return i+="\n\0\0\0",i+=t.compressionType,i+=this.getBytes(this.getModifiedTime(e),2),i+=this.getBytes(this.getModifiedDate(e),2),i+=this.getBytes(t.crc32Value,4),i+=this.getBytes(t.compressedSize,4),i+=this.getBytes(t.uncompressedDataSize,4),i+=this.getBytes(t.fileName.length,2),i+=this.getBytes(0,2)},t.prototype.writeZippedContent=function(t,i,r,n){for(var s=0,h=[],o=0;o<i.length;o++){var a=i[o];for(s+=a.centralDir.length,h.push(this.getArrayBuffer(a.localHeader));a.compressedData.compressedData.length;)h.push(a.compressedData.compressedData.shift().buffer)}for(o=0;o<i.length;o++)h.push(this.getArrayBuffer(i[o].centralDir));h.push(this.getArrayBuffer(this.writeFooter(i,s,r)));var f=new Blob(h,{type:"application/zip"});return n||e.Save.save(t,f),f},t.prototype.writeCentralDirectory=function(t,e,i,r){return"PK"+this.getBytes(20,2)+e+this.getBytes(0,2)+"\0\0\0\0"+this.getBytes(r,4)+this.getBytes(i,4)+t.fileName},t.prototype.writeFooter=function(t,e,i){return"PK\0\0\0\0"+this.getBytes(t.length,2)+this.getBytes(t.length,2)+this.getBytes(e,4)+this.getBytes(i,4)+this.getBytes(0,2)},t.prototype.getArrayBuffer=function(t){for(var e=new Uint8Array(t.length),i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e.buffer},t.prototype.getBytes=function(t,e){for(var i="",r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i},t.prototype.getModifiedTime=function(t){var e=t.getHours();return e<<=6,e|=t.getMinutes(),e<<=5,e|=t.getSeconds()/2},t.prototype.getModifiedDate=function(t){var e=t.getFullYear()-1980;return e<<=4,e|=t.getMonth()+1,e<<=5,e|=t.getDate()},t.prototype.calculateCrc32Value=function(t,e,i){t^=-1;for(var r=0;r<e.length;r++)t=t>>>8^i[255&(t^e[r])];return-1^t},t.initCrc32Table=function(){for(var t,e=0;e<256;e++){t=e;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;f[e]=t}},t}(),d=function(){function t(t,e){if(null===t||void 0===t)throw new Error("ArgumentException: data cannot be null or undefined");if(null===e||void 0===e)throw new Error("ArgumentException: string cannot be null or undefined");if(0===e.length)throw new Error("string cannot be empty");this.data=t,this.name=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.fileName},set:function(t){this.fileName=t},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.fileName=void 0,this.data=void 0},t}();return t.ZipArchive=u,t.ZipArchiveItem=d,t.CompressedStreamWriter=h,t.CompressorHuffmanTree=o,t.ChecksumCalculator=a,t}({},ej.fileutils),this.ejs=ej;
- /*!
- * filename: ej2-buttons.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.buttons=function(e,t){"use strict";function i(e,i,s,n,r,a){var l=n;if(n.tagName===i){var o=t.getValue("ej2_instances",n);l=e("input",{attrs:{type:s}});for(var c=["change","cssClass","label","labelPosition","id"],h=0,p=n.attributes.length;h<p;h++)-1===c.indexOf(n.attributes[h].nodeName)&&l.setAttribute(n.attributes[h].nodeName,n.attributes[h].nodeValue);t.attributes(n,{class:r,role:a,"aria-checked":"false"}),n.appendChild(l),t.setValue("ej2_instances",o,l),t.deleteObject(n,"ej2_instances")}return l}function s(e){for(var t,i=e.childNodes,s=0;s<i.length;s++)if(3===(t=i[s]).nodeType)return t;return null}function n(e,i,s){"INPUT"===s?(i.parentNode.insertBefore(e.element,i),t.detach(i),e.element.checked=!1,["name","value","disabled"].forEach(function(t){e.element.removeAttribute(t)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="")}function r(e,s,n,r,a){r=i(e.createElement,s,"checkbox",r,n,a),e.element=r,"checkbox"!==e.element.getAttribute("type")&&e.element.setAttribute("type","checkbox"),e.element.id||(e.element.id=t.getUniqueID("e-"+a))}function a(e,i,s){void 0===i&&(i=!1),void 0===s&&(s={});var n=e("div",{className:"e-checkbox-wrapper e-css"});if(s.cssClass&&t.addClass([n],s.cssClass.split(" ")),s.enableRtl&&n.classList.add("e-rtl"),i){var r=e("span",{className:"e-ripple-container"});t.rippleEffect(r,{isCenterRipple:!0,duration:400}),n.appendChild(r)}var a=e("span",{className:"e-frame e-icons"});if(s.checked&&a.classList.add("e-check"),n.appendChild(a),s.label){var l=e("span",{className:"e-label"});s.disableHtmlEncode?l.textContent=s.label:l.innerHTML=s.label,n.appendChild(l)}return n}function l(e,t){if(t){var i=document.createEvent("MouseEvents");i.initEvent(e.type,!1,!0),t.dispatchEvent(i)}}function o(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}var c=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),h=function(e,t,i,s){var n,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},p=new t.Observer,d={RTL:"e-rtl",BUTTON:"e-btn",PRIMARY:"e-primary",ICONBTN:"e-icon-btn"},u=function(e){function i(t,i){return e.call(this,t,i)||this}return c(i,e),i.prototype.preRender=function(){},i.prototype.render=function(){this.initialize(),this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+d.BUTTON}),this.renderComplete()},i.prototype.initialize=function(){if(this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),this.isPrimary&&this.element.classList.add(d.PRIMARY),!t.isBlazor()||t.isBlazor()&&"progress-btn"!==this.getModuleName()){if(this.content){var e=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.content):this.content;this.element.innerHTML=e}this.setIconCss()}this.enableRtl&&this.element.classList.add(d.RTL),this.disabled?this.controlStatus(this.disabled):this.wireEvents()},i.prototype.controlStatus=function(e){this.element.disabled=e},i.prototype.setIconCss=function(){if(this.iconCss){var e=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(e.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add(d.ICONBTN);var t=this.element.childNodes[0];!t||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t)}},i.prototype.wireEvents=function(){this.isToggle&&t.EventHandler.add(this.element,"click",this.btnClickHandler,this)},i.prototype.unWireEvents=function(){this.isToggle&&t.EventHandler.remove(this.element,"click",this.btnClickHandler)},i.prototype.btnClickHandler=function(){this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active")},i.prototype.destroy=function(){var i=[d.PRIMARY,d.RTL,d.ICONBTN,"e-success","e-info","e-danger","e-warning","e-flat","e-outline","e-small","e-bigger","e-active","e-round","e-top-icon-btn","e-bottom-icon-btn"];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),e.prototype.destroy.call(this),t.removeClass([this.element],i),this.element.getAttribute("class")||this.element.removeAttribute("class"),this.disabled&&this.element.removeAttribute("disabled"),this.content&&(this.element.innerHTML=this.element.innerHTML.replace(this.content,""));var s=this.element.querySelector("span.e-btn-icon");s&&t.detach(s),this.unWireEvents(),t.isRippleEnabled&&this.removeRippleEffect()},i.prototype.getModuleName=function(){return"btn"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.Inject=function(){},i.prototype.onPropertyChanged=function(e,i){for(var n=this.element.querySelector("span.e-btn-icon"),r=0,a=Object.keys(e);r<a.length;r++)switch(a[r]){case"isPrimary":e.isPrimary?this.element.classList.add(d.PRIMARY):this.element.classList.remove(d.PRIMARY);break;case"disabled":this.controlStatus(e.disabled);break;case"iconCss":n?e.iconCss?(n.className="e-btn-icon "+e.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?n.classList.add("e-icon-left"):n.classList.add("e-icon-right"))):t.detach(n):this.setIconCss();break;case"iconPosition":t.removeClass([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(n=this.element.querySelector("span.e-btn-icon"))&&t.detach(n),this.setIconCss();break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?this.element.classList.add(d.RTL):this.element.classList.remove(d.RTL);break;case"content":s(this.element)||this.element.classList.remove(d.ICONBTN),(!t.isBlazor()||t.isBlazor()&&!this.isServerRendered&&"progress-btn"!==this.getModuleName())&&(this.enableHtmlSanitizer&&(e.content=t.SanitizeHtmlHelper.sanitize(e.content)),this.element.innerHTML=e.content,this.setIconCss());break;case"isToggle":e.isToggle?t.EventHandler.add(this.element,"click",this.btnClickHandler,this):(t.EventHandler.remove(this.element,"click",this.btnClickHandler),t.removeClass([this.element],["e-active"]))}},i.prototype.click=function(){this.element.click()},i.prototype.focusIn=function(){this.element.focus()},h([t.Property("Left")],i.prototype,"iconPosition",void 0),h([t.Property("")],i.prototype,"iconCss",void 0),h([t.Property(!1)],i.prototype,"disabled",void 0),h([t.Property(!1)],i.prototype,"isPrimary",void 0),h([t.Property("")],i.prototype,"cssClass",void 0),h([t.Property("")],i.prototype,"content",void 0),h([t.Property(!1)],i.prototype,"isToggle",void 0),h([t.Property()],i.prototype,"locale",void 0),h([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),h([t.Event()],i.prototype,"created",void 0),i=h([t.NotifyPropertyChanges],i)}(t.Component),m=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),f=function(e,t,i,s){var n,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},v="e-frame",y="e-ripple-container",b="e-checkbox-wrapper",g=["title","class","style","disabled","readonly","name","value"],C=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFocused=!1,s.isMouseClick=!1,s}return m(s,e),s.prototype.changeState=function(e){var i,s,n=this.getWrapper().getElementsByClassName(v)[0];t.isRippleEnabled&&(s=this.getWrapper().getElementsByClassName(y)[0]),"check"===e?(n.classList.remove("e-stop"),n.classList.add("e-check"),s&&(s.classList.remove("e-ripple-stop"),s.classList.add("e-ripple-check")),i="true",this.element.checked=!0):"uncheck"===e?(t.removeClass([n],["e-check","e-stop"]),s&&t.removeClass([s],["e-ripple-check","e-ripple-stop"]),i="false",this.element.checked=!1):(n.classList.remove("e-check"),n.classList.add("e-stop"),s&&(s.classList.remove("e-ripple-check"),s.classList.add("e-ripple-stop")),i="mixed",this.element.indeterminate=!0),this.getWrapper().setAttribute("aria-checked",i)},s.prototype.clickHandler=function(e){this.isMouseClick&&(this.focusOutHandler(),this.isMouseClick=!1),this.indeterminate?(this.changeState(this.checked?"check":"uncheck"),this.indeterminate=!1,this.element.indeterminate=!1):this.checked?(this.changeState("uncheck"),this.checked=!1):(this.changeState("check"),this.checked=!0);var t={checked:this.updateVueArrayModel(!1),event:e};this.trigger("change",t),e.stopPropagation()},s.prototype.destroy=function(){var i=this,s=this.getWrapper();e.prototype.destroy.call(this),this.wrapper&&(s=this.wrapper,this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(this.getWrapper()&&s.parentNode&&s.parentNode.insertBefore(this.element,s),t.detach(s),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach(function(e){i.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML=""))},s.prototype.focusHandler=function(){this.isFocused=!0},s.prototype.focusOutHandler=function(){var e=this.getWrapper();e&&e.classList.remove("e-focus"),this.isFocused=!1},s.prototype.getModuleName=function(){return"checkbox"},s.prototype.getPersistData=function(){return this.addOnPersist(["checked","indeterminate"])},s.prototype.getWrapper=function(){return this.element&&this.element.parentElement?this.element.parentElement.parentElement:null},s.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&(this.element.setAttribute("value",this.value),this.isVue&&"boolean"==typeof this.value&&!0===this.value&&this.setProperties({checked:!0},!0)),this.checked&&this.changeState("check"),this.indeterminate&&this.changeState(),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains(b)||(e=this.createElement("div",{className:b,attrs:{role:"checkbox","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var i=this.createElement("label",{attrs:{for:this.element.id}}),s=this.createElement("span",{className:"e-icons "+v});if(e.classList.add("e-wrapper"),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),e.appendChild(i),i.appendChild(this.element),o(this,i),i.appendChild(s),t.isRippleEnabled){var n=this.createElement("span",{className:y});"Before"===this.labelPosition?i.appendChild(n):i.insertBefore(n,s),t.rippleEffect(n,{duration:400,isCenterRipple:!0})}this.label&&this.setText(this.label)},s.prototype.keyUpHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},s.prototype.labelMouseDownHandler=function(e){this.isMouseClick=!0,l(e,this.getWrapper().getElementsByClassName(y)[0])},s.prototype.labelMouseUpHandler=function(e){this.isMouseClick=!0;var t=this.getWrapper().getElementsByClassName(y)[0];if(t){for(var i=t.querySelectorAll(".e-ripple-element"),s=0;s<i.length-1;s++)t.removeChild(t.childNodes[s]);l(e,t)}},s.prototype.onPropertyChanged=function(e,i){for(var s=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"checked":this.indeterminate=!1,this.element.indeterminate=!1,this.changeState(e.checked?"check":"uncheck");break;case"indeterminate":e.indeterminate?this.changeState():(this.element.indeterminate=!1,this.changeState(this.checked?"check":"uncheck"));break;case"disabled":e.disabled?(this.setDisabled(),this.wrapper=this.getWrapper(),this.unWireEvents()):(this.element.disabled=!1,s.classList.remove("e-checkbox-disabled"),s.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":i.cssClass&&t.removeClass([s],i.cssClass.split(" ")),e.cssClass&&t.addClass([s],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?s.classList.add("e-rtl"):s.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":var a=s.getElementsByClassName("e-label")[0],l=s.getElementsByTagName("label")[0];t.detach(a),"After"===e.labelPosition?l.appendChild(a):l.insertBefore(a,s.getElementsByClassName(v)[0]);break;case"name":this.element.setAttribute("name",e.name);break;case"value":if(this.isVue&&"object"==typeof e.value)break;this.element.setAttribute("value",e.value);break;case"htmlAttributes":this.updateHtmlAttributeToWrapper()}},s.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=i(this.createElement,"EJS-CHECKBOX","checkbox",e,b,"checkbox"),this.element=e,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},s.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.updateHtmlAttributeToWrapper(),this.updateVueArrayModel(!0),this.renderComplete(),this.wrapper=this.getWrapper()},s.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add("e-checkbox-disabled"),e.setAttribute("aria-disabled","true")},s.prototype.setText=function(e){var i=this.getWrapper();if(i){var s=i.getElementsByClassName("e-label")[0];if(s)s.textContent=e;else{e=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e,s=this.createElement("span",{className:"e-label",innerHTML:e});var n=i.getElementsByTagName("label")[0];"Before"===this.labelPosition?n.insertBefore(s,i.getElementsByClassName(v)[0]):n.appendChild(s)}}},s.prototype.changeHandler=function(e){e.stopPropagation()},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.element.checked=this.initialCheckedValue},s.prototype.unWireEvents=function(){var e=this.wrapper;t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var i=e.getElementsByTagName("label")[0];t.EventHandler.remove(i,"mousedown",this.labelMouseDownHandler),t.EventHandler.remove(i,"mouseup",this.labelMouseUpHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.remove(this.element,"change",this.changeHandler)},s.prototype.wireEvents=function(){var e=this.getWrapper();t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=e.getElementsByTagName("label")[0];t.EventHandler.add(i,"mousedown",this.labelMouseDownHandler,this),t.EventHandler.add(i,"mouseup",this.labelMouseUpHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.add(this.element,"change",this.changeHandler,this)},s.prototype.updateVueArrayModel=function(e){if(this.isVue&&"object"==typeof this.value){var t=this.element.value;if(t&&this.value){if(!e){var i=this.value.indexOf(t);return this.checked?i<0&&this.value.push(t):i>-1&&this.value.splice(i,1),this.value}for(var s=0;s<this.value.length;s++)t===this.value[s]&&(this.changeState("check"),this.setProperties({checked:!0},!0))}}return this.element.checked},s.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(g.indexOf(s)>-1){var n=this.getWrapper();"class"===s?t.addClass([n],this.htmlAttributes[s].split(" ")):"title"===s?n.setAttribute(s,this.htmlAttributes[s]):"style"===s?this.getWrapper().getElementsByClassName(v)[0].setAttribute(s,this.htmlAttributes[s]):this.element.setAttribute(s,this.htmlAttributes[s])}}},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()},f([t.Event()],s.prototype,"change",void 0),f([t.Event()],s.prototype,"created",void 0),f([t.Property(!1)],s.prototype,"checked",void 0),f([t.Property("")],s.prototype,"cssClass",void 0),f([t.Property(!1)],s.prototype,"disabled",void 0),f([t.Property(!1)],s.prototype,"indeterminate",void 0),f([t.Property("")],s.prototype,"label",void 0),f([t.Property("After")],s.prototype,"labelPosition",void 0),f([t.Property("")],s.prototype,"name",void 0),f([t.Property("")],s.prototype,"value",void 0),f([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),f([t.Property({})],s.prototype,"htmlAttributes",void 0),s=f([t.NotifyPropertyChanges],s)}(t.Component),k=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),E=function(e,t,i,s){var n,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},H=["title","class","style","disabled","readonly","name","value"],S=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFocused=!1,s}k(s,e),n=s,s.prototype.changeHandler=function(e){this.checked=!0,this.dataBind();var t=this.element.getAttribute("value");t=this.isVue&&t?this.element.value:this.value,this.trigger("change",{value:t,event:e}),"EJS-RADIOBUTTON"===this.tagName&&e.stopPropagation()},s.prototype.updateChange=function(){for(var e,i,s=this.getRadioGroup(),r=0;r<s.length;r++)(e=s[r])!==this.element&&((i=t.getInstance(e,n)).checked=!1,"EJS-RADIOBUTTON"===this.tagName&&(i.angularValue=this.value))},s.prototype.destroy=function(){var i=this,s=this.element.parentElement;e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(s.parentNode&&s.parentNode.insertBefore(this.element,s),t.detach(s),this.element.checked=!1,["name","value","disabled"].forEach(function(e){i.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML="")},s.prototype.focusHandler=function(){this.isFocused=!0},s.prototype.focusOutHandler=function(){var e=this.getLabel();e&&e.classList.remove("e-focus")},s.prototype.getModuleName=function(){return"radio"},s.prototype.getSelectedValue=function(){for(var e,t=this.getRadioGroup(),i=0,s=t.length;i<s;i++)if((e=t[i]).checked)return e.value;return""},s.prototype.getRadioGroup=function(){return document.querySelectorAll('input.e-radio[name="'+this.element.getAttribute("name")+'"]')},s.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},s.prototype.getWrapper=function(){return this.element?this.element.parentElement:null},s.prototype.getLabel=function(){return this.element?this.element.nextElementSibling:null},s.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.updateHtmlAttribute(),this.name&&this.element.setAttribute("name",this.name);var e=this.element.getAttribute("value");this.isVue&&e&&e===this.value&&(this.checked=!0),(this.isVue?this.value&&!e:this.value)&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},s.prototype.initWrapper=function(){var e,i=this.element.parentElement;i.classList.contains("e-radio-wrapper")||(i=this.createElement("div",{className:"e-radio-wrapper"}),this.element.parentNode.insertBefore(i,this.element));var s=this.createElement("label",{attrs:{for:this.element.id}});i.appendChild(this.element),i.appendChild(s),t.isRippleEnabled&&(e=this.createElement("span",{className:"e-ripple-container"}),s.appendChild(e),t.rippleEffect(e,{duration:400,isCenterRipple:!0})),i.classList.add("e-wrapper"),this.enableRtl&&s.classList.add("e-rtl"),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),this.label&&this.setText(this.label)},s.prototype.keyUpHandler=function(){this.isFocused&&this.getLabel().classList.add("e-focus")},s.prototype.labelRippleHandler=function(e){l(e,this.getLabel().getElementsByClassName("e-ripple-container")[0])},s.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&t.attributes(this.element,{checked:"true"})},s.prototype.onPropertyChanged=function(e,i){for(var s=this.getWrapper(),n=this.getLabel(),r=0,a=Object.keys(e);r<a.length;r++)switch(a[r]){case"checked":e.checked&&this.updateChange(),this.element.checked=e.checked;break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,this.wireEvents());break;case"cssClass":i.cssClass&&t.removeClass([s],i.cssClass.split(" ")),e.cssClass&&t.addClass([s],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?n.classList.add("e-rtl"):n.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":"Before"===e.labelPosition?n.classList.add("e-right"):n.classList.remove("e-right");break;case"name":this.element.setAttribute("name",e.name);break;case"value":if(!t.isNullOrUndefined(this.htmlAttributes)&&this.htmlAttributes.value)break;this.element.setAttribute("value",e.value);break;case"htmlAttributes":this.updateHtmlAttribute()}},s.prototype.preRender=function(){var e=this.element;if(this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=i(this.createElement,"EJS-RADIOBUTTON","radio",e,"e-radio-wrapper","radio"),this.element=e,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),"EJS-RADIOBUTTON"===this.tagName){var s=this.element.getAttribute("formcontrolname");s&&(this.setProperties({name:s},!0),this.element.setAttribute("name",s))}},s.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},s.prototype.setDisabled=function(){this.element.disabled=!0},s.prototype.setText=function(e){var i=this.getLabel(),s=i.getElementsByClassName("e-label")[0];s?s.textContent=e:(e=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e,s=this.createElement("span",{className:"e-label",innerHTML:e}),i.appendChild(s)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},s.prototype.updateHtmlAttribute=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(H.indexOf(s)>-1){var n=this.element.parentElement;"class"===s?t.addClass([n],this.htmlAttributes[s].split(" ")):"title"===s||"style"===s?n.setAttribute(s,this.htmlAttributes[s]):this.element.setAttribute(s,this.htmlAttributes[s])}}},s.prototype.unWireEvents=function(){var e=this.getLabel();t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler);var i=e.getElementsByClassName("e-label")[0];i&&(t.EventHandler.remove(i,"mousedown",this.labelRippleHandler),t.EventHandler.remove(i,"mouseup",this.labelRippleHandler)),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},s.prototype.wireEvents=function(){var e=this.getLabel();t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var i=e.getElementsByClassName("e-label")[0];i&&(t.EventHandler.add(i,"mousedown",this.labelRippleHandler,this),t.EventHandler.add(i,"mouseup",this.labelRippleHandler,this)),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},s.prototype.click=function(){this.element.click()},s.prototype.focusIn=function(){this.element.focus()};var n;return E([t.Event()],s.prototype,"change",void 0),E([t.Event()],s.prototype,"created",void 0),E([t.Property(!1)],s.prototype,"checked",void 0),E([t.Property("")],s.prototype,"cssClass",void 0),E([t.Property(!1)],s.prototype,"disabled",void 0),E([t.Property("")],s.prototype,"label",void 0),E([t.Property("After")],s.prototype,"labelPosition",void 0),E([t.Property("")],s.prototype,"name",void 0),E([t.Property("")],s.prototype,"value",void 0),E([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),E([t.Property({})],s.prototype,"htmlAttributes",void 0),s=n=E([t.NotifyPropertyChanges],s)}(t.Component),A=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),P=function(e,t,i,s){var n,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},L="e-ripple-container",N=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.isFocused=!1,s.isDrag=!1,s}return A(i,e),i.prototype.changeState=function(e){var i,s,n=this.getWrapper(),r=n.querySelector(".e-switch-inner"),a=n.querySelector(".e-switch-handle");t.isRippleEnabled&&(s=n.getElementsByClassName(L)[0]),e?(t.addClass([r,a],"e-switch-active"),i="true",this.element.checked=!0,this.checked=!0,s&&t.addClass([s],["e-ripple-check"])):(t.removeClass([r,a],"e-switch-active"),i="false",this.element.checked=!1,this.checked=!1,s&&t.removeClass([s],["e-ripple-check"])),n.setAttribute("aria-checked",i)},i.prototype.clickHandler=function(e){this.isDrag=!1,this.focusOutHandler(),this.changeState(!this.checked),this.element.focus();var t={checked:this.element.checked,event:e};this.trigger("change",t)},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),n(this,this.getWrapper(),this.tagName)},i.prototype.focusHandler=function(){this.isFocused=!0},i.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus")},i.prototype.getModuleName=function(){return"switch"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},i.prototype.getWrapper=function(){return this.element.parentElement},i.prototype.initialize=function(){t.isNullOrUndefined(this.initialSwitchCheckedValue)&&(this.initialSwitchCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState(!0),this.disabled&&this.setDisabled(),(this.onLabel||this.offLabel)&&this.setLabel(this.onLabel,this.offLabel)},i.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains("e-switch-wrapper")||(e=this.createElement("div",{className:"e-switch-wrapper",attrs:{role:"switch","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var i=this.createElement("span",{className:"e-switch-inner"}),s=this.createElement("span",{className:"e-switch-on"}),n=this.createElement("span",{className:"e-switch-off"}),r=this.createElement("span",{className:"e-switch-handle"});if(e.appendChild(this.element),o(this,e),i.appendChild(s),i.appendChild(n),e.appendChild(i),e.appendChild(r),t.isRippleEnabled){var a=this.createElement("span",{className:L});r.appendChild(a),t.rippleEffect(a,{duration:400,isCenterRipple:!0})}e.classList.add("e-wrapper"),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" "))},i.prototype.onPropertyChanged=function(e,i){for(var s=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"checked":this.changeState(e.checked);break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,s.classList.remove("e-switch-disabled"),s.setAttribute("aria-disabled","false"),this.wireEvents());break;case"value":this.element.setAttribute("value",e.value);break;case"name":this.element.setAttribute("name",e.name);break;case"onLabel":case"offLabel":this.setLabel(e.onLabel,e.offLabel);break;case"enableRtl":e.enableRtl?s.classList.add("e-rtl"):s.classList.remove("e-rtl");break;case"cssClass":i.cssClass&&t.removeClass([s],i.cssClass.split(" ")),e.cssClass&&t.addClass([s],e.cssClass.split(" "))}},i.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,r(this,"EJS-SWITCH","e-switch-wrapper",e,this.getModuleName())},i.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},i.prototype.rippleHandler=function(e){l(e,this.getWrapper().getElementsByClassName(L)[0]),"mousedown"===e.type&&e.currentTarget.classList.contains("e-switch-wrapper")&&1===e.which&&(this.isDrag=!0,this.isFocused=!1)},i.prototype.rippleTouchHandler=function(e){var t=this.getWrapper().getElementsByClassName(L)[0];if(t){var i=document.createEvent("MouseEvents");i.initEvent(e,!1,!0),t.dispatchEvent(i)}},i.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add("e-switch-disabled"),e.setAttribute("aria-disabled","true")},i.prototype.setLabel=function(e,t){var i=this.getWrapper();e&&(i.querySelector(".e-switch-on").textContent=e),t&&(i.querySelector(".e-switch-off").textContent=t)},i.prototype.switchFocusHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},i.prototype.switchMouseUp=function(e){var t=e.target;"touchmove"===e.type&&e.preventDefault(),"touchstart"===e.type&&(this.isDrag=!0,this.rippleTouchHandler("mousedown")),this.isDrag&&("mouseup"===e.type&&t.className.indexOf("e-switch")<0||"touchend"===e.type)&&(this.clickHandler(e),this.rippleTouchHandler("mouseup"),e.preventDefault())},i.prototype.formResetHandler=function(){this.checked=this.initialSwitchCheckedValue,this.element.checked=this.initialSwitchCheckedValue},i.prototype.toggle=function(){this.clickHandler()},i.prototype.wireEvents=function(){var e=this.getWrapper();this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyUpHandler=this.switchFocusHandler.bind(this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"mouseup",this.delegateMouseUpHandler,this),t.EventHandler.add(this.element,"keyup",this.delegateKeyUpHandler,this),t.EventHandler.add(e,"mousedown mouseup",this.rippleHandler,this),t.EventHandler.add(e,"touchstart touchmove touchend",this.switchMouseUp,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},i.prototype.unWireEvents=function(){var e=this.getWrapper();t.EventHandler.remove(e,"click",this.clickHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"mouseup",this.delegateMouseUpHandler),t.EventHandler.remove(this.element,"keyup",this.delegateKeyUpHandler),t.EventHandler.remove(e,"mousedown mouseup",this.rippleHandler),t.EventHandler.remove(e,"touchstart touchmove touchend",this.switchMouseUp),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},i.prototype.click=function(){this.element.click()},i.prototype.focusIn=function(){this.element.focus()},P([t.Event()],i.prototype,"change",void 0),P([t.Event()],i.prototype,"created",void 0),P([t.Property(!1)],i.prototype,"checked",void 0),P([t.Property("")],i.prototype,"cssClass",void 0),P([t.Property(!1)],i.prototype,"disabled",void 0),P([t.Property("")],i.prototype,"name",void 0),P([t.Property("")],i.prototype,"onLabel",void 0),P([t.Property("")],i.prototype,"offLabel",void 0),P([t.Property("")],i.prototype,"value",void 0),i=P([t.NotifyPropertyChanges],i)}(t.Component),x=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),T=function(e,t,i,s){var n,r=arguments.length,a=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},w={chipSet:"e-chip-set",chip:"e-chip",avatar:"e-chip-avatar",text:"e-chip-text",icon:"e-chip-icon",delete:"e-chip-delete",deleteIcon:"e-dlt-btn",multiSelection:"e-multi-selection",singleSelection:"e-selection",active:"e-active",chipWrapper:"e-chip-avatar-wrap",iconWrapper:"e-chip-icon-wrap",focused:"e-focused",disabled:"e-disabled",rtl:"e-rtl"},O=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.multiSelectedChip=[],s}return x(i,e),i.prototype.preRender=function(){},i.prototype.chipType=function(){return this.chips&&this.chips.length&&this.chips.length>0},i.prototype.render=function(){this.type=this.chips.length?"chipset":this.text||this.element.innerText?"chip":"chipset",t.isBlazor()&&this.isServerRendered||(this.setAttributes(),this.createChip(),this.setRtl(),this.select(this.selectedChips,void 0)),this.wireEvent(!1),this.rippleFunction=t.rippleEffect(this.element,{selector:".e-chip"}),this.renderComplete()},i.prototype.createChip=function(){if(this.innerText=this.element.innerText.trim(),t.isBlazor())for(var e=this.element.querySelectorAll(".e-chip"),i=0;i<e.length;i++)null!=e[i]&&t.detach(e[i]);else this.element.innerHTML="";this.chipCreation("chip"===this.type?[this.innerText?this.innerText:this.text]:this.chips)},i.prototype.setAttributes=function(){"chip"===this.type?(this.element.tabIndex=0,this.element.setAttribute("role","option")):(this.element.classList.add(w.chipSet),this.element.setAttribute("role","listbox"),"Multiple"===this.selection?(this.element.classList.add(w.multiSelection),this.element.setAttribute("aria-multiselectable","true")):"Single"===this.selection?(this.element.classList.add(w.singleSelection),this.element.setAttribute("aria-multiselectable","false")):this.element.setAttribute("aria-multiselectable","false"))},i.prototype.setRtl=function(){this.element.classList[this.enableRtl?"add":"remove"](w.rtl)},i.prototype.chipCreation=function(e){for(var i=[],s=0;s<e.length;s++){var n=this.getFieldValues(e[s]),r=this.elementCreation(n),a=(w.chip+" "+(n.enabled?" ":w.disabled)+" "+(n.avatarIconCss||n.avatarText?w.chipWrapper:n.leadingIconCss?w.iconWrapper:" ")+" "+n.cssClass).split(" ").filter(function(e){return e});if(this.chipType()){var l=this.createElement("DIV",{className:a.join(" "),attrs:{tabIndex:"0",role:"option","aria-label":n.text,"aria-selected":"false"}});n.value&&l.setAttribute("data-value",n.value.toString()),t.append(r,l),i.push(l)}else i=r,t.addClass([this.element],a),this.element.setAttribute("aria-label",n.text),n.value&&this.element.setAttribute("data-value",n.value.toString())}t.append(i,this.element)},i.prototype.getFieldValues=function(e){var i=!("false"===this.enabled.toString());return{text:"object"==typeof e?e.text?e.text.toString():this.text.toString():this.chipType()?e.toString():this.innerText?this.innerText:this.text.toString(),cssClass:"object"==typeof e&&e.cssClass?e.cssClass.toString():this.cssClass.toString(),leadingIconCss:"object"==typeof e&&e.leadingIconCss?e.leadingIconCss.toString():this.leadingIconCss.toString(),avatarIconCss:"object"==typeof e&&e.avatarIconCss?e.avatarIconCss.toString():this.avatarIconCss.toString(),avatarText:"object"==typeof e&&e.avatarText?e.avatarText.toString():this.avatarText.toString(),trailingIconCss:"object"==typeof e&&e.trailingIconCss?e.trailingIconCss.toString():this.trailingIconCss.toString(),enabled:"object"==typeof e?t.isNullOrUndefined(e.enabled)?i:"false"!==e.enabled.toString():i,value:"object"==typeof e&&e.value?e.value.toString():null,leadingIconUrl:"object"==typeof e&&e.leadingIconUrl?e.leadingIconUrl.toString():this.leadingIconUrl,trailingIconUrl:"object"==typeof e&&e.trailingIconUrl?e.trailingIconUrl.toString():this.trailingIconUrl}},i.prototype.elementCreation=function(e){var t=[];if(e.avatarText||e.avatarIconCss){var i=(w.avatar+" "+e.avatarIconCss).trim(),s=this.createElement("span",{className:i});s.innerText=e.avatarText,t.push(s)}else if(e.leadingIconCss){var i=(w.icon+" "+e.leadingIconCss).trim(),n=this.createElement("span",{className:i});t.push(n)}else if(e.leadingIconUrl){i=(w.avatar+" image-url").trim();(n=this.createElement("span",{className:i})).style.backgroundImage="url("+e.leadingIconUrl+")",t.push(n)}var r=this.createElement("span",{className:w.text});if(r.innerText=e.text,t.push(r),e.trailingIconCss||this.chipType()&&this.enableDelete){var i=(w.delete+" "+(e.trailingIconCss?e.trailingIconCss:w.deleteIcon)).trim(),a=this.createElement("span",{className:i});t.push(a)}else if(e.trailingIconUrl){var i="trailing-icon-url".trim(),l=this.createElement("span",{className:i});l.style.backgroundImage="url("+e.trailingIconUrl+")",t.push(l)}return t},i.prototype.find=function(e){var t,i=e instanceof HTMLElement?e:this.element.querySelectorAll("."+w.chip)[e];return i&&this.chipType()&&((t={text:void 0,index:void 0,element:void 0,data:void 0}).index=Array.prototype.slice.call(this.element.querySelectorAll("."+w.chip)).indexOf(i),t.text="object"==typeof this.chips[t.index]?this.chips[t.index].text?this.chips[t.index].text.toString():"":this.chips[t.index].toString(),t.data=this.chips[t.index],t.element=i),t},i.prototype.add=function(e){var t;if("chip"!==this.type){var i=e instanceof Array?e:[e];(t=this.chips).push.apply(t,i),this.chipCreation(i)}},i.prototype.select=function(e,t){this.onSelect(e,!1,t)},i.prototype.multiSelection=function(e){for(var t=this.element.querySelectorAll(".e-chip"),i=0;i<e.length;i++)if("string"==typeof e[i]){for(var s=0;s<t.length;s++)if(e[i]!==s&&e[i]===t[s].attributes[5].value){this.multiSelectedChip.push(s);break}}else this.multiSelectedChip.push(e[i])},i.prototype.onSelect=function(e,t,i){var s,n,r;if(this.chipType()&&"None"!==this.selection){if(t)for(var a=this.element.querySelectorAll("."+w.chip),l=0;l<a.length;l++)a[l].setAttribute("aria-selected","false"),a[l].classList.remove(w.active);for(var o=e instanceof Array?e:[e],l=0;l<o.length;l++){var c=o[l]instanceof HTMLElement?o[l]:this.element.querySelectorAll("."+w.chip)[o[l]];if("index"!==i)for(var h=0;h<this.chips.length;h++){n=this.element.querySelectorAll("."+w.chip)[h];var p=this.getFieldValues(this.chips[h]);"value"===i?null!==p.value&&(r=n.dataset.value):"text"===i&&(r=n.innerText),r===o[l].toString()&&(s=h,c=this.element.querySelectorAll("."+w.chip)[s])}c instanceof HTMLElement&&this.selectionHandler(c)}}},i.prototype.remove=function(e){var t=this;if(this.chipType()){var i=e instanceof Array?e:[e],s=[],n=this.element.querySelectorAll("."+w.chip);i.forEach(function(e){var t=e instanceof HTMLElement?e:n[e];t instanceof HTMLElement&&s.push(t)}),s.forEach(function(e){var i=t.element.querySelectorAll("."+w.chip),s=Array.prototype.slice.call(i).indexOf(e);t.deleteHandler(e,s)})}},i.prototype.getSelectedChips=function(){var e;if(this.chipType()&&"None"!==this.selection){for(var i={texts:[],Indexes:[],data:[],elements:[]},s=this.element.querySelectorAll("."+w.active),n=0;n<s.length;n++){var r=s[n];i.elements.push(r);var a=Array.prototype.slice.call(this.element.querySelectorAll("."+w.chip)).indexOf(r);i.Indexes.push(a),i.data.push(this.chips[a]);var l="object"==typeof this.chips[a]?this.chips[a].text?this.chips[a].text.toString():null:this.chips[a].toString();i.texts.push(l)}var o={text:i.texts[0],index:i.Indexes[0],data:i.data[0],element:i.elements[0]};e=t.isNullOrUndefined(o.index)?void 0:"Multiple"===this.selection?i:o}return e},i.prototype.wireEvent=function(e){e?(t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"keydown",this.keyHandler),t.EventHandler.remove(this.element,"keyup",this.keyHandler)):(t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyHandler,this),t.EventHandler.add(this.element,"keyup",this.keyHandler,this))},i.prototype.keyHandler=function(e){e.target.classList.contains(w.chip)&&("keydown"===e.type?13===e.keyCode?this.clickHandler(e):46===e.keyCode&&this.enableDelete&&this.clickHandler(e,!0):9===e.keyCode&&this.focusInHandler(e.target))},i.prototype.focusInHandler=function(e){e.classList.contains(w.focused)||e.classList.add(w.focused)},i.prototype.focusOutHandler=function(e){var i=t.closest(e.target,"."+w.chip),s=this.chipType()?this.element.querySelector("."+w.focused):this.element.classList.contains(w.focused)?this.element:null;i&&s&&s.classList.remove(w.focused)},i.prototype.clickHandler=function(e,i){var s=this;void 0===i&&(i=!1);var n=t.closest(e.target,"."+w.chip);if(n){var r=void 0;if(this.chipType())r=this.find(n);else{var a=Array.prototype.slice.call(this.element.querySelectorAll("."+w.chip)).indexOf(n);r={text:this.innerText?this.innerText:this.text,element:n,data:this.text,index:a}}r.event=e,r.cancel=!1,this.trigger("beforeClick",r,function(n){n.cancel||(n.element=t.isBlazor()?t.getElement(n.element):n.element,s.clickEventHandler(n.element,e,i))})}},i.prototype.clickEventHandler=function(e,i,s){var n=this;if(this.chipType()){var r=this.find(e);if(r.event=i,(i.target.classList.contains(w.deleteIcon)?i.target:s?e.querySelector("."+w.deleteIcon):void 0)&&this.enableDelete){r.cancel=!1;var a=r;this.trigger("delete",a,function(i){if(!i.cancel){i.element=t.isBlazor()?t.getElement(i.element):i.element,n.deleteHandler(i.element,i.index),n.selectionHandler(e),r.selected=i.element.classList.contains(w.active);var s=r;n.trigger("click",s)}})}else if("None"!==this.selection){this.selectionHandler(e),r.selected=e.classList.contains(w.active);var l=r;this.trigger("click",l)}else{this.focusInHandler(e);o=r;this.trigger("click",o)}}else{this.focusInHandler(e);var o={text:this.innerText?this.innerText:this.text,element:e,data:this.text,event:i};this.trigger("click",o)}},i.prototype.selectionHandler=function(e){if("Single"===this.selection){var t=this.element.querySelector("."+w.active);t&&t!==e&&(t.classList.remove(w.active),t.setAttribute("aria-selected","false")),this.setProperties({selectedChips:null},!0)}else this.setProperties({selectedChips:[]},!0);e.classList.contains(w.active)?(e.classList.remove(w.active),e.setAttribute("aria-selected","false")):(e.classList.add(w.active),e.setAttribute("aria-selected","true")),this.updateSelectedChips()},i.prototype.updateSelectedChips=function(){for(var e,t=this.element.querySelectorAll(".e-chip"),i=[],s=[],n=null,r=0;r<t.length;r++){var a=this.element.querySelectorAll(".e-chip")[r];if("true"===a.getAttribute("aria-selected")){if(e=a.getAttribute("data-value"),"Single"===this.selection&&a.classList.contains("e-active")){n=e||r;break}n=e?s.push(e):i.push(r)}}this.setProperties({selectedChips:"Single"===this.selection?n:e?s:i},!0)},i.prototype.deleteHandler=function(e,i){this.allowServerDataBinding=!0,this.chips.splice(i,1),this.setProperties({chips:this.chips},!0),this.serverDataBind(),this.allowServerDataBinding=!1,t.isBlazor()&&this.isServerRendered||t.detach(e)},i.prototype.destroy=function(){if(t.removeClass([this.element],[w.chipSet,w.chip,w.rtl,w.multiSelection,w.singleSelection,w.disabled,w.chipWrapper,w.iconWrapper,w.active,w.focused].concat(this.cssClass.toString().split(" ").filter(function(e){return e}))),this.removeMultipleAttributes(["tabindex","role","aria-label","aria-multiselectable"],this.element),this.wireEvent(!0),this.rippleFunction(),t.isBlazor())for(var i=this.chipType()?this.element.querySelectorAll(".e-chip"):this.element.querySelectorAll(".e-chip-text"),s=0;s<i.length;s++)null!=i[s]&&t.detach(i[s]);else e.prototype.destroy.call(this),this.element.innerHTML="",this.element.innerText=this.innerText},i.prototype.removeMultipleAttributes=function(e,t){e.forEach(function(e){t.removeAttribute(e)})},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.getModuleName=function(){return"chip-list"},i.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"chips":case"text":case"avatarText":case"avatarIconCss":case"leadingIconCss":case"trailingIconCss":case"selection":case"enableDelete":case"enabled":t.isBlazor()&&this.isServerRendered||(this.isServerRendered=!1,this.refresh(),this.isServerRendered=!0);break;case"cssClass":t.isBlazor()&&this.isServerRendered||(this.chipType()?(this.isServerRendered=!1,this.refresh(),this.isServerRendered=!0):(t.removeClass([this.element],i.cssClass.toString().split(" ").filter(function(e){return e})),t.addClass([this.element],e.cssClass.toString().split(" ").filter(function(e){return e}))));break;case"selectedChips":t.removeClass(this.element.querySelectorAll(".e-active"),"e-active"),"Multiple"===this.selection?(this.multiSelectedChip=[],this.multiSelection(e.selectedChips),this.onSelect(this.multiSelectedChip,!0,void 0),this.updateSelectedChips()):this.onSelect(e.selectedChips,!0,void 0);break;case"enableRtl":this.setRtl()}},T([t.Property([])],i.prototype,"chips",void 0),T([t.Property("")],i.prototype,"text",void 0),T([t.Property("")],i.prototype,"avatarText",void 0),T([t.Property("")],i.prototype,"avatarIconCss",void 0),T([t.Property("")],i.prototype,"leadingIconCss",void 0),T([t.Property("")],i.prototype,"trailingIconCss",void 0),T([t.Property("")],i.prototype,"leadingIconUrl",void 0),T([t.Property("")],i.prototype,"trailingIconUrl",void 0),T([t.Property("")],i.prototype,"cssClass",void 0),T([t.Property(!0)],i.prototype,"enabled",void 0),T([t.Property([])],i.prototype,"selectedChips",void 0),T([t.Property("None")],i.prototype,"selection",void 0),T([t.Property(!1)],i.prototype,"enableDelete",void 0),T([t.Event()],i.prototype,"created",void 0),T([t.Event()],i.prototype,"click",void 0),T([t.Event()],i.prototype,"beforeClick",void 0),T([t.Event()],i.prototype,"delete",void 0),i=T([t.NotifyPropertyChanges],i)}(t.Component),R=function(){function e(){}return e}();return e.wrapperInitialize=i,e.getTextNode=s,e.destroy=n,e.preRender=r,e.createCheckBox=a,e.rippleMouseHandler=l,e.setHiddenInput=o,e.buttonObserver=p,e.Button=u,e.CheckBox=C,e.RadioButton=S,e.Switch=N,e.classNames=w,e.ChipList=O,e.Chip=R,e}({},ej.base),this.ejs=ej;
- /*!
- * filename: ej2-popups.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.popups=function(t,e,i){"use strict";function o(t,i){var o=!1,n={left:0,top:0},s=t;if(!t||!i)return n;for(e.isNullOrUndefined(i.offsetParent)&&"fixed"===i.style.position&&(o=!0);(i.offsetParent||o)&&t&&i.offsetParent!==t;)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;for(t=s;(i.offsetParent||o)&&t&&i.offsetParent!==t;)n.left-=t.scrollLeft,n.top-=t.scrollTop,t=t.parentElement;return n}function n(t,e,i,o,n){if(Zt=void 0,Zt=n,ae=!!o,!t)return{left:0,top:0};e||(e="left"),i||(i="top"),Kt=t.ownerDocument,Gt=t;var s={left:0,top:0};return l(e.toLowerCase(),i.toLowerCase(),s)}function s(t,e){e.left=t}function r(t,e){e.top=t}function l(t,e,i){switch(Wt=Gt.getBoundingClientRect(),e+t){case"topcenter":s(m(),i),r(c(),i);break;case"topright":s(f(),i),r(c(),i);break;case"centercenter":s(m(),i),r(p(),i);break;case"centerright":s(f(),i),r(p(),i);break;case"centerleft":s(u(),i),r(p(),i);break;case"bottomcenter":s(m(),i),r(d(),i);break;case"bottomright":s(f(),i),r(d(),i);break;case"bottomleft":s(u(),i),r(d(),i);break;default:case"topleft":s(u(),i),r(c(),i)}return i}function a(){return Kt.documentElement.scrollTop||Kt.body.scrollTop}function h(){return Kt.documentElement.scrollLeft||Kt.body.scrollLeft}function d(){return ae?Wt.bottom:Wt.bottom+a()}function p(){return c()+Wt.height/2}function c(){return ae?Wt.top:Wt.top+a()}function u(){return Wt.left+h()}function f(){var t=Gt&&Gt.classList.contains("e-date-range-wrapper")?Zt?Zt.width:0:Zt&&Wt.width>=Zt.width?Zt.width:0;return Wt.right+h()-t}function m(){return u()+Wt.width/2}function g(t,e,i,o){if(void 0===e&&(e=null),void 0===i&&(i={X:!1,Y:!1}),!i.Y&&!i.X)return{left:0,top:0};var s=t.getBoundingClientRect();if(Qt=e,Jt=t.ownerDocument,o||(o=n(t,"left","top")),i.X){var r=Qt?T():A(),l=B(),a=R(),h=l-o.left,d=o.left+s.width-a;s.width>r?o.left=h>0&&d<=0?a-s.width:d>0&&h<=0?l:h>d?a-s.width:l:h>0?o.left+=h:d>0&&(o.left-=d)}if(i.Y){var p=Qt?P():L(),c=U(),u=k(),f=c-o.top,m=o.top+s.height-u;s.height>p?o.top=f>0&&m<=0?u-s.height:m>0&&f<=0?c:f>m?u-s.height:c:f>0?o.top+=f:m>0&&(o.top-=m)}return o}function v(t,e,i,o){void 0===e&&(e=null);var s=n(t,"left","top");i&&(s.left=i),o&&(s.top=o);var r=[];Qt=e,Jt=t.ownerDocument;var l=t.getBoundingClientRect(),a=s.top,h=s.left,d=s.left+l.width,p=N(a,s.top+l.height),c=C(h,d);return p.topSide&&r.push("top"),c.rightSide&&r.push("right"),c.leftSide&&r.push("left"),p.bottomSide&&r.push("bottom"),r}function y(t,e,i,o,n,s,r,l,a){if(void 0===r&&(r=null),void 0===l&&(l={X:!0,Y:!0}),e&&t&&n&&s&&(l.X||l.Y)){var h,d={TL:null,TR:null,BL:null,BR:null},p={TL:null,TR:null,BL:null,BR:null};if("none"===window.getComputedStyle(t).display){var c=t.style.visibility;t.style.visibility="hidden",t.style.display="block",h=t.getBoundingClientRect(),t.style.removeProperty("display"),t.style.visibility=c}else h=t.getBoundingClientRect();var u={posX:n,posY:s,offsetX:i,offsetY:o,position:{left:0,top:0}};Qt=r,Jt=e.ownerDocument,E(e,d,u,a,h),O(p,u,h),l.X&&w(e,p,d,u,h,!0),l.Y&&d.TL.top>-1&&S(e,p,d,u,h,!0),b(t,u,h)}}function b(t,e,i){var o=0,s=0;if(null!=t.offsetParent&&("absolute"===getComputedStyle(t.offsetParent).position||"relative"===getComputedStyle(t.offsetParent).position)){var r=n(t.offsetParent,"left","top",!1,i);o=r.left,s=r.top}t.style.top=e.position.top+e.offsetY-s+"px",t.style.left=e.position.left+e.offsetX-o+"px"}function E(t,e,i,o,s){i.position=n(t,i.posX,i.posY,o,s),e.TL=n(t,"left","top",o,s),e.TR=n(t,"right","top",o,s),e.BR=n(t,"left","bottom",o,s),e.BL=n(t,"right","bottom",o,s)}function O(t,e,i){t.TL={top:e.position.top+e.offsetY,left:e.position.left+e.offsetX},t.TR={top:t.TL.top,left:t.TL.left+i.width},t.BL={top:t.TL.top+i.height,left:t.TL.left},t.BR={top:t.TL.top+i.height,left:t.TL.left+i.width}}function C(t,e){var i=!1,o=!1;return t-M()<B()&&(i=!0),e>R()&&(o=!0),{leftSide:i,rightSide:o}}function w(t,e,i,o,s,r){var l=C(e.TL.left,e.TR.left);i.TL.left-M()<=B()&&(l.leftSide=!1),i.TR.left>R()&&(l.rightSide=!1),(l.leftSide&&!l.rightSide||!l.leftSide&&l.rightSide)&&("right"===o.posX?o.posX="left":o.posX="right",o.offsetX=o.offsetX+s.width,o.offsetX=-1*o.offsetX,o.position=n(t,o.posX,o.posY,!1),O(e,o,s),r&&w(t,e,i,o,s,!1))}function S(t,e,i,o,s,r){var l=N(e.TL.top,e.BL.top);i.TL.top-z()<=U()&&(l.topSide=!1),i.BL.top>=k()&&t.getBoundingClientRect().bottom<window.innerHeight&&(l.bottomSide=!1),(l.topSide&&!l.bottomSide||!l.topSide&&l.bottomSide)&&("top"===o.posY?o.posY="bottom":o.posY="top",o.offsetY=o.offsetY+s.height,o.offsetY=-1*o.offsetY,o.position=n(t,o.posX,o.posY,!1,s),O(e,o,s),r&&S(t,e,i,o,s,!1))}function N(t,e){var i=!1,o=!1;return t-z()<U()&&(i=!0),e>k()&&(o=!0),{topSide:i,bottomSide:o}}function T(){return Qt.getBoundingClientRect().width}function P(){return Qt.getBoundingClientRect().height}function x(){return Qt.getBoundingClientRect().left}function H(){return Qt.getBoundingClientRect().top}function U(){return Qt?H():0}function B(){return Qt?x():0}function R(){return Qt?M()+x()+T():M()+A()}function k(){return Qt?z()+H()+P():z()+L()}function z(){return Jt.documentElement.scrollTop||Jt.body.scrollTop}function M(){return Jt.documentElement.scrollLeft||Jt.body.scrollLeft}function L(){return window.innerHeight}function A(){var t=window.innerWidth,i=document.documentElement.getBoundingClientRect();return t-(t-(e.isNullOrUndefined(document.documentElement)?0:i.width))}function I(t,e){for(var i=getComputedStyle(t),o=[],n=/(auto|scroll)/,s=t.parentElement;s&&"HTML"!==s.tagName;){var r=getComputedStyle(s);"absolute"===i.position&&"static"===r.position||!n.test(r.overflow+r.overflowY+r.overflowX)||o.push(s),s=s.parentElement}return e||o.push(document),o}function Y(t){for(var i=t.parentElement,o=[];i&&"BODY"!==i.tagName;){var n=document.defaultView.getComputedStyle(i,null).getPropertyValue("z-index"),s=document.defaultView.getComputedStyle(i,null).getPropertyValue("position");"auto"!==n&&"static"!==s&&o.push(n),i=i.parentElement}for(var r=[],l=0;l<document.body.children.length;l++)if(!t.isEqualNode(document.body.children[l])){var n=document.defaultView.getComputedStyle(document.body.children[l],null).getPropertyValue("z-index"),s=document.defaultView.getComputedStyle(document.body.children[l],null).getPropertyValue("position");"auto"!==n&&"static"!==s&&r.push(n)}r.push("999");var a=[];if(!e.isNullOrUndefined(t.parentElement)&&"BODY"!==t.parentElement.tagName)for(var h=[].slice.call(t.parentElement.children),l=0;l<h.length;l++)if(!t.isEqualNode(h[l])){var n=document.defaultView.getComputedStyle(h[l],null).getPropertyValue("z-index"),s=document.defaultView.getComputedStyle(h[l],null).getPropertyValue("position");"auto"!==n&&"static"!==s&&a.push(n)}var d=o.concat(r,a),p=Math.max.apply(Math,d)+1;return p>2147483647?2147483647:p}function X(t){void 0===t&&(t=["*"]);for(var e=[],i=0;i<t.length;i++)for(var o=document.getElementsByTagName(t[i]),n=0;n<o.length;n++){var s=document.defaultView.getComputedStyle(o[n],null).getPropertyValue("z-index"),r=document.defaultView.getComputedStyle(o[n],null).getPropertyValue("position");"auto"!==s&&"static"!==r&&e.push(s)}var l=Math.max.apply(Math,e)+1;return l>2147483647?2147483647:l}function D(t){Te=t.resizeBegin,Pe=t.resizing,xe=t.resizeComplete,$t=q(t.element),se=q(t.boundary);for(var i=t.direction.split(" "),o=0;o<i.length;o++)if(be.indexOf(i[o])>=0&&i[o])j(i[o]);else if(""!==i[o].trim()){var n=e.createElement("div",{className:"e-icons "+me+" e-"+i[o]});$t.appendChild(n)}ee=t.minHeight,oe=t.minWidth,ne=t.maxWidth,ie=t.maxHeight,t.proxy&&t.proxy.element&&t.proxy.element.classList.contains("e-dialog")?F(t.proxy):F()}function j(t){Z();var i=e.createElement("span",{attrs:{unselectable:"on",contenteditable:"false"}});i.setAttribute("class","e-dialog-border-resize e-"+t),"south"===t&&(i.style.height="2px",i.style.width="100%",i.style.bottom="0px",i.style.left="0px"),"north"===t&&(i.style.height="2px",i.style.width="100%",i.style.top="0px",i.style.left="0px"),"east"===t&&(i.style.height="100%",i.style.width="2px",i.style.right="0px",i.style.top="0px"),"west"===t&&(i.style.height="100%",i.style.width="2px",i.style.left="0px",i.style.top="0px"),$t.appendChild(i)}function q(t){var i;return e.isNullOrUndefined(t)||(i="string"==typeof t?document.querySelector(t):t),i}function F(t){e.isNullOrUndefined(t)&&(t=this);for(var i=$t.querySelectorAll("."+me),o=0;o<i.length;o++){te=i[o],e.EventHandler.add(te,"mousedown",V,t);s="msie"===e.Browser.info.name?"pointerdown":"touchstart";e.EventHandler.add(te,s,G,t)}var n=$t.querySelectorAll(".e-dialog-border-resize");if(!e.isNullOrUndefined(n))for(o=0;o<n.length;o++){te=n[o],e.EventHandler.add(te,"mousedown",V,t);var s="msie"===e.Browser.info.name?"pointerdown":"touchstart";e.EventHandler.add(te,s,G,t)}}function _(t){return t.indexOf("mouse")>-1?"mouse":"touch"}function V(t){if(t.preventDefault(),$t=t.target.parentElement,Z(),Se=t.pageX,Ne=t.pageY,t.target.classList.add(ge),e.isNullOrUndefined(Te)||(le=this,!0!==Te(t,le))){var i=e.isNullOrUndefined(se)?document:se;e.EventHandler.add(i,"mousemove",K,this),e.EventHandler.add(document,"mouseup",W,this);for(var o=0;o<ve.length;o++)He=!$t.classList.contains(ve[o])}}function W(t){var i="msie"===e.Browser.info.name?"pointermove":"touchmove",o="msie"===e.Browser.info.name?"pointerup":"touchend",n=e.isNullOrUndefined(se)?document:se,s="msie"===e.Browser.info.name?"pointerdown":"touchstart";e.EventHandler.remove(n,"mousemove",K),e.EventHandler.remove(n,i,K),e.EventHandler.remove(n,s,K),e.isNullOrUndefined(document.body.querySelector("."+ge))||document.body.querySelector("."+ge).classList.remove(ge),e.isNullOrUndefined(xe)||xe(t,le=this),e.EventHandler.remove(document,"mouseup",W),e.EventHandler.remove(document,o,W)}function Z(){Ee=parseFloat(getComputedStyle($t,null).getPropertyValue("width").replace("px","")),Oe=parseFloat(getComputedStyle($t,null).getPropertyValue("height").replace("px","")),Ce=$t.getBoundingClientRect().left,we=$t.getBoundingClientRect().top}function G(t){$t=t.target.parentElement,Z();var i=t.touches?t.changedTouches[0]:t;if(Se=i.pageX,Ne=i.pageY,e.isNullOrUndefined(Te)||(le=this,!0!==Te(t,le))){var o="msie"===e.Browser.info.name?"pointermove":"touchmove",n="msie"===e.Browser.info.name?"pointerup":"touchend",s=e.isNullOrUndefined(se)?document:se;e.EventHandler.add(s,o,K,this),e.EventHandler.add(document,n,W)}}function K(t){if(t.target.classList.contains(me)&&t.target.classList.contains(ge)?te=t.target:e.isNullOrUndefined(document.body.querySelector("."+ge))||(te=document.body.querySelector("."+ge)),!e.isNullOrUndefined(te)){for(var i="",o=0;o<fe.length;o++)te.classList.contains("e-"+fe[o])&&(i=fe[o]);switch(e.isNullOrUndefined(Pe)||Pe(t,le=this),i){case"south":Q(t);break;case"north":$(t);break;case"west":tt(t);break;case"east":et(t);break;case"south-east":Q(t),et(t);break;case"south-west":Q(t),tt(t);break;case"north-east":$(t),et(t);break;case"north-west":$(t),tt(t)}}}function J(t){return t.getBoundingClientRect()}function Q(t){var i,o=document.documentElement.clientHeight,n=!1,s=(t.touches?t.changedTouches[0]:t).pageY,r=J($t);e.isNullOrUndefined(se)||(i=J(se)),e.isNullOrUndefined(se)?e.isNullOrUndefined(se)&&(o-s>=0||r.top<0)&&(n=!0):n=!0;var l=Oe+(s-Ne);l=l>ee?l:ee;var a=0;e.isNullOrUndefined(se)||(a=i.top);var h=e.isNullOrUndefined(se)?0:se.offsetHeight-se.clientHeight,d=r.top-a-h/2;if(d=d<0?0:d,r.top>0&&d+l>ie){if(n=!1,$t.classList.contains(ye))return;return void($t.style.height=ie-parseInt(d.toString(),10)+"px")}var p=0;if(n){r.top<0&&o+(r.height+r.top)>0&&l+(p=r.top)<=30&&(l=r.height-(r.height+r.top)+30),l+r.top>=ie&&($t.style.height=r.height+(o-(r.height+r.top))+"px");var c=e.isNullOrUndefined(se)?p:d;l>=ee&&l+c<=ie&&($t.style.height=l+"px")}}function $(t){var i,o=!1,n="mouse"===_(t.type)?t.pageY:t.touches[0].pageY,s=J($t);e.isNullOrUndefined(se)||(i=J(se)),!e.isNullOrUndefined(se)&&s.top-i.top>0?o=!0:e.isNullOrUndefined(se)&&n>0&&(o=!0);var r=Oe-(n-Ne);if(o&&r>=ee&&r<=ie){var l=0;e.isNullOrUndefined(se)||(l=i.top);var a=we-l+(n-Ne);a=a>0?a:1,$t.style.height=r+"px",$t.style.top=a+"px"}}function tt(t){var i,o=document.documentElement.clientWidth,n=!1;e.isNullOrUndefined(se)||(i=J(se));var s="mouse"===_(t.type)?t.pageX:t.touches[0].pageX,r=J($t),l=e.isNullOrUndefined(se)?0:se.offsetWidth-se.clientWidth,a=e.isNullOrUndefined(se)?0:i.left,h=e.isNullOrUndefined(se)?0:i.width;e.isNullOrUndefined(re)&&(e.isNullOrUndefined(se)?re=o:(re=r.left-a-l/2+r.width,re+=h-l-re)),!e.isNullOrUndefined(se)&&Math.floor(r.left-i.left+r.width+(i.right-r.right))-l<=ne?n=!0:e.isNullOrUndefined(se)&&s>=0&&(n=!0);var d=Ee-(s-Se);if(He&&(d=d>re?re:d),n&&d>=oe&&d<=ne){var p=0;e.isNullOrUndefined(se)||(p=i.left);var c=Ce-p+(s-Se);c=c>0?c:1,d!==Ue&&Be&&($t.style.width=d+"px"),He&&($t.style.left=c+"px",Be=1!==c)}Ue=d}function et(t){var i,o=document.documentElement.clientWidth,n=!1;e.isNullOrUndefined(se)||(i=J(se));var s=(t.touches?t.changedTouches[0]:t).pageX,r=J($t);!e.isNullOrUndefined(se)&&(r.left-i.left+r.width<=ne||r.right-i.left>=r.width)?n=!0:e.isNullOrUndefined(se)&&o-s>0&&(n=!0);var l=Ee+(s-Se),a=0;if(e.isNullOrUndefined(se)||(a=i.left),r.left-a+l>ne){if(n=!1,$t.classList.contains(ye))return;$t.style.width=ne-(r.left-a)+"px"}n&&l>=oe&&l<=ne&&($t.style.width=l+"px")}function it(t){ee=t}function ot(t){ne=t}function nt(t){ie=t}function st(){for(var t=$t.querySelectorAll("."+me),i=0;i<t.length;i++)e.detach(t[i]);var o=$t.querySelectorAll(".e-dialog-border-resize");if(!e.isNullOrUndefined(o))for(i=0;i<o.length;i++)e.detach(o[i])}function rt(t,e,i,o){switch(t){case"Create":lt({type:o,target:document.querySelector(e.target),cssClass:e.cssClass,label:e.label,width:e.width});break;case"Show":Dt(document.querySelector(i));break;case"Hide":qt(document.querySelector(i));break;case"Set":Ft({cssClass:e.cssClass,type:o})}}function lt(t,i){if(t.target){var o,n=e.isNullOrUndefined(i)?e.createElement:i,s=xt(t.target,n);if(e.isNullOrUndefined(t.cssClass)||s.wrap.classList.add(t.cssClass),e.isNullOrUndefined(t.template)&&e.isNullOrUndefined(mi)){var r=e.isNullOrUndefined(t.type)?mt(s.wrap):t.type;o=wt(e.isNullOrUndefined(t.width)?void 0:t.width,r),gt(r,s.wrap,o,n),e.isNullOrUndefined(t.label)||at(s.inner_wrap,t.label,n)}else{var l=e.isNullOrUndefined(t.template)?mi:t.template;s.wrap.classList.add(fi),Ct(s.wrap,l,gi)}s.wrap.classList.add(ii),s=null}}function at(t,e,i){var o=i("div",{});return o.classList.add(ui),o.innerHTML=e,t.appendChild(o),o}function ht(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"Material",radius:e},Pt(t,o,i,oi),Bt(e,t,"Material",oi)}function dt(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"Bootstrap4",radius:e},Pt(t,o,i,li),Bt(e,t,"Bootstrap4",li)}function pt(t,e,i){var o={};Ke[e].timeOut=0,o[e]=St(e,i,0,0),Ht({uniqueID:e,container:t,globalInfo:o,timeOutVar:0})}function ct(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"Fabric",radius:e},Tt(t,o,ni,i),At(e,t,ni)}function ut(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"Tailwind",radius:e},Tt(t,o,si,i),At(e,t,si)}function ft(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"HighContrast",radius:e},Tt(t,o,ai,i),At(e,t,ai)}function mt(t){return window.getComputedStyle(t,":after").getPropertyValue("content").replace(/['"]+/g,"")}function gt(t,i,o,n){var s=i.querySelector("."+di),r=s.querySelector("svg");switch(e.isNullOrUndefined(r)||s.removeChild(r),t){case"Material":ht(s,o,n);break;case"Fabric":ct(s,o,n);break;case"Bootstrap":vt(s,o,n);break;case"HighContrast":ft(s,o,n);break;case"Bootstrap4":dt(s,o,n);break;case"Tailwind":case"Tailwind-dark":ut(s,o,n)}}function vt(t,e,i){var o=Nt();Ke[o]={timeOut:0,type:"Bootstrap",radius:e},yt(t,o,i),bt(t,e)}function yt(t,e,i){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("id",e),o.setAttribute("class",ri),o.setAttribute("viewBox","0 0 64 64"),t.insertBefore(o,t.firstChild);for(var n=0;n<=7;n++){var s=document.createElementNS("http://www.w3.org/2000/svg","circle");s.setAttribute("class",pi+"_"+n),s.setAttribute("r","2"),s.setAttribute("transform","translate(32,32)"),o.appendChild(s)}}function bt(t,e){var i=t.querySelector("svg.e-spin-bootstrap");i.style.width=i.style.height=e+"px";for(var o=90,n=0;n<=7;n++){var s=It(0,0,24,o),r=i.querySelector("."+pi+"_"+n);r.setAttribute("cx",s.x+""),r.setAttribute("cy",s.y+""),o=o>=360?0:o,o+=45}}function Et(t,e){function i(t){o.push(t),t===s&&1!==l||(t<=n&&t>1&&!r?t=parseFloat((t-.2).toFixed(2)):1===t?(t=7,t=parseFloat((t+.2).toFixed(2)),r=!0):t<8&&r?8===(t=parseFloat((t+.2).toFixed(2)))&&(r=!1):t<=8&&!r&&(t=parseFloat((t-.2).toFixed(2))),++l,i(t))}var o=[],n=t,s=e,r=!1,l=1;return i(n),o}function Ot(t){for(var e=t.querySelector("svg.e-spin-bootstrap").getAttribute("id"),i=1;i<=8;i++)!function(t,e,i,o,n){function s(e){Ke[n].isAnimate&&(++r,t.setAttribute("r",e+""),r>=o.length&&(r=0),Ke[n].timeOut=setTimeout(s.bind(null,o[r]),18))}var r=0;s(e)}(t.getElementsByClassName("e-path-circle_"+(8===i?0:i))[0],i,0,Et(i,i),e)}function Ct(t,i,o){e.isNullOrUndefined(o)||t.classList.add(o),t.querySelector(".e-spinner-inner").innerHTML=i}function wt(t,e){var i;switch(e){case"Material":i=Je;break;case"Fabric":i=Qe;break;case"Tailwind":case"Tailwind-dark":i=Qe;break;case"Bootstrap4":i=ti;break;default:i=$e}return t=t?parseFloat(t+""):i,"Bootstrap"===e?t:t/2}function St(t,e,i,o){return{radius:e,count:i,previousId:o}}function Nt(){for(var t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function Tt(t,e,i,o){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("id",e),n.setAttribute("class",i);var s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("class",pi);var r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("class",ci),t.insertBefore(n,t.firstChild),n.appendChild(s),n.appendChild(r)}function Pt(t,e,i,o){var n=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("class",o),n.setAttribute("id",e),s.setAttribute("class",pi),t.insertBefore(n,t.firstChild),n.appendChild(s)}function xt(t,e){var i=e("div",{}),o=e("div",{});return i.classList.add(hi),o.classList.add(di),t.appendChild(i),i.appendChild(o),{wrap:i,inner_wrap:o}}function Ht(t){Ut(1,149,Lt,1333,t.globalInfo[t.uniqueID].count,75,t),t.globalInfo[t.uniqueID].count=++t.globalInfo[t.uniqueID].count%4}function Ut(t,i,o,n,s,r,l){function a(e){var i=Math.max(0,Math.min((new Date).getTime()-p,n));h(o(i,t,c,n),e.container),d===e.globalInfo[e.uniqueID].previousId&&i<n?Ke[e.uniqueID].timeOut=setTimeout(a.bind(null,e),1):Ht(e)}function h(t,i){if(!e.isNullOrUndefined(i.querySelector("svg.e-spin-material"))&&!e.isNullOrUndefined(i.querySelector("svg.e-spin-material").querySelector("path.e-path-circle"))){var o=i.querySelector("svg.e-spin-material").querySelector("path.e-path-circle");o.setAttribute("stroke-dashoffset",Mt(u,f,t,r)+""),o.setAttribute("transform","rotate("+m+" "+u/2+" "+u/2+")")}}var d=++l.globalInfo[l.uniqueID].previousId,p=(new Date).getTime(),c=i-t,u=Rt(2*l.globalInfo[l.uniqueID].radius+""),f=zt(u),m=-90*(l.globalInfo[l.uniqueID].count||0);a(l)}function Bt(t,e,i,o){var n=2*t,s=e.querySelector("svg."+o),r=s.querySelector("path.e-path-circle"),l=zt(n),a=n/2+"px";s.setAttribute("viewBox","0 0 "+n+" "+n),s.style.width=s.style.height=n+"px",s.style.transformOrigin=a+" "+a+" "+a,r.setAttribute("d",kt(n,l)),"Material"===i&&(r.setAttribute("stroke-width",l+""),r.setAttribute("stroke-dasharray",(n-l)*Math.PI*.75+""),r.setAttribute("stroke-dashoffset",Mt(n,l,1,75)+""))}function Rt(t){return parseFloat(t)}function kt(t,e){var i=t/2,o=e/2;return"M"+i+","+o+"A"+(i-o)+","+(i-o)+" 0 1 1 "+o+","+i}function zt(t){return.1*t}function Mt(t,e,i,o){return(t-e)*Math.PI*(3*o/100-i/100)}function Lt(t,e,i,o){var n=(t/=o)*t,s=n*t;return e+i*(6*s*n+-15*n*n+10*s)}function At(t,e,i){var o=t,n=t,s=2*t,r=e.querySelector("."+i),l=r.querySelector(".e-path-circle"),a=r.querySelector(".e-path-arc"),h=s/2+"px";l.setAttribute("d",Xt(o,n,t)),a.setAttribute("d",Yt(o,n,t,315,45)),r.setAttribute("viewBox","0 0 "+s+" "+s),r.style.transformOrigin=h+" "+h+" "+h,r.style.width=r.style.height=s+"px"}function It(t,e,i,o){var n=(o-90)*Math.PI/180;return{x:t+i*Math.cos(n),y:e+i*Math.sin(n)}}function Yt(t,e,i,o,n){var s=It(t,e,i,n),r=It(t,e,i,o);return["M",s.x,s.y,"A",i,i,0,0,0,r.x,r.y].join(" ")}function Xt(t,e,i){return["M",t,e,"m",-i,0,"a",i,i,0,1,0,2*i,0,"a",i,i,0,1,0,2*-i,0].join(" ")}function Dt(t){jt(t,!1),t=null}function jt(t,i){var o;if(t&&(o=t.classList.contains(hi)?t:t.querySelector("."+hi)),t&&o){var n=o.querySelector("."+di);if(i?!o.classList.contains(fi)&&!o.classList.contains(ii):!o.classList.contains(fi)&&!o.classList.contains(ei)){var s=o.querySelector("svg");if(e.isNullOrUndefined(s))return;var r=s.getAttribute("id");switch(Ke[r].isAnimate=!i,Ke[r].type){case"Material":i?clearTimeout(Ke[r].timeOut):pt(n,r,Ke[r].radius);break;case"Bootstrap":i?clearTimeout(Ke[r].timeOut):Ot(n)}}i?e.classList(o,[ii],[ei]):e.classList(o,[ei],[ii]),t=null}}function qt(t){jt(t,!0),t=null}function Ft(t,i){var o=e.isNullOrUndefined(i)?e.createElement:i;void 0!==t.template&&(mi=t.template,void 0!==t.template&&(gi=t.cssClass));for(var n=document.querySelectorAll("."+hi),s=0;s<n.length;s++)_t(t.template,n[s],t.type,t.cssClass,o)}function _t(t,i,o,n,s){e.isNullOrUndefined(t)&&!i.classList.contains(fi)?(Vt(i,o,n,s),i.classList.contains(ei)?(i.classList.remove(ei),Dt(i)):(i.classList.remove(ii),qt(i))):(mi=t,e.isNullOrUndefined(n)||(gi=n))}function Vt(t,i,o,n){e.isNullOrUndefined(o)||t.classList.add(o);var s=t.querySelector("svg"),r="Bootstrap"===i?parseFloat(s.style.height):parseFloat(s.style.height)/2;if(s.getAttribute("class").split(/\s/).indexOf("e-spin-material")>=0){var l=s.getAttribute("id");clearTimeout(Ke[l].timeOut)}gt(i,t,r,n)}var Wt,Zt,Gt,Kt,Jt,Qt,$t,te,ee,ie,oe,ne,se,re,le,ae=!1,he=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),de=function(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r},pe=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return he(i,t),de([e.Property("left")],i.prototype,"X",void 0),de([e.Property("top")],i.prototype,"Y",void 0),i}(e.ChildProperty),ce={ROOT:"e-popup",RTL:"e-rtl",OPEN:"e-popup-open",CLOSE:"e-popup-close"},ue=function(t){function i(e,i){return t.call(this,i,e)||this}return he(i,t),i.prototype.onPropertyChanged=function(t,i){for(var o=0,n=Object.keys(t);o<n.length;o++)switch(n[o]){case"width":e.setStyleAttribute(this.element,{width:e.formatUnit(t.width)});break;case"height":e.setStyleAttribute(this.element,{height:e.formatUnit(t.height)});break;case"zIndex":e.setStyleAttribute(this.element,{zIndex:t.zIndex});break;case"enableRtl":this.setEnableRtl();break;case"position":case"relateTo":this.refreshPosition();break;case"offsetX":var s=t.offsetX-i.offsetX;this.element.style.left=(parseInt(this.element.style.left,10)+s).toString()+"px";break;case"offsetY":var r=t.offsetY-i.offsetY;this.element.style.top=(parseInt(this.element.style.top,10)+r).toString()+"px";break;case"content":this.setContent();break;case"actionOnScroll":"none"!==t.actionOnScroll?this.wireScrollEvents():this.unwireScrollEvents()}},i.prototype.getModuleName=function(){return"popup"},i.prototype.resolveCollision=function(){this.checkCollision()},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.destroy=function(){this.element.classList.remove(ce.ROOT,ce.RTL,ce.OPEN,ce.CLOSE),this.unwireEvents(),t.prototype.destroy.call(this)},i.prototype.render=function(){this.element.classList.add(ce.ROOT);var t={};1e3!==this.zIndex&&(t.zIndex=this.zIndex),"auto"!==this.width&&(t.width=e.formatUnit(this.width)),"auto"!==this.height&&(t.height=e.formatUnit(this.height)),e.setStyleAttribute(this.element,t),this.fixedParent=!1,this.setEnableRtl(),this.setContent()},i.prototype.wireEvents=function(){e.Browser.isDevice&&e.EventHandler.add(window,"orientationchange",this.orientationOnChange,this),"none"!==this.actionOnScroll&&this.wireScrollEvents()},i.prototype.wireScrollEvents=function(){if(this.getRelateToElement())for(var t=0,i=this.getScrollableParent(this.getRelateToElement());t<i.length;t++){var o=i[t];e.EventHandler.add(o,"scroll",this.scrollRefresh,this)}},i.prototype.unwireEvents=function(){e.Browser.isDevice&&e.EventHandler.remove(window,"orientationchange",this.orientationOnChange),"none"!==this.actionOnScroll&&this.unwireScrollEvents()},i.prototype.unwireScrollEvents=function(){if(this.getRelateToElement())for(var t=0,i=this.getScrollableParent(this.getRelateToElement());t<i.length;t++){var o=i[t];e.EventHandler.remove(o,"scroll",this.scrollRefresh)}},i.prototype.getRelateToElement=function(){var t=""===this.relateTo||e.isNullOrUndefined(this.relateTo)?document.body:this.relateTo;return this.setProperties({relateTo:t},!0),"string"==typeof this.relateTo?document.querySelector(this.relateTo):this.relateTo},i.prototype.scrollRefresh=function(t){if("reposition"===this.actionOnScroll?e.isNullOrUndefined(this.element)||this.element.offsetParent===t.target||this.element.offsetParent&&"BODY"===this.element.offsetParent.tagName&&null==t.target.parentElement||this.refreshPosition():"hide"===this.actionOnScroll&&this.hide(),"none"!==this.actionOnScroll&&this.getRelateToElement()){var i=this.isElementOnViewport(this.getRelateToElement(),t.target);i||this.targetInvisibleStatus?i&&(this.targetInvisibleStatus=!1):(this.trigger("targetExitViewport"),this.targetInvisibleStatus=!0)}},i.prototype.isElementOnViewport=function(t,e){for(var i=this.getScrollableParent(t),o=0;o<i.length;o++)if(!this.isElementVisible(t,i[o]))return!1;return!0},i.prototype.isElementVisible=function(t,i){var o=this.checkGetBoundingClientRect(t);if(!o.height||!o.width)return!1;if(e.isNullOrUndefined(this.checkGetBoundingClientRect(i))){var s=window,r={top:s.scrollY,left:s.scrollX,right:s.scrollX+s.outerWidth,bottom:s.scrollY+s.outerHeight},l=n(t),a={top:l.top,left:l.left,right:l.left+o.width,bottom:l.top+o.height},h={top:r.bottom-a.top,left:r.right-a.left,bottom:a.bottom-r.top,right:a.right-r.left};return h.top>0&&h.left>0&&h.right>0&&h.bottom>0}var d=i.getBoundingClientRect();return!(o.bottom<d.top||o.bottom>d.bottom||o.right>d.right||o.left<d.left)},i.prototype.preRender=function(){},i.prototype.setEnableRtl=function(){this.reposition(),this.enableRtl?this.element.classList.add(ce.RTL):this.element.classList.remove(ce.RTL)},i.prototype.setContent=function(){e.isNullOrUndefined(this.content)||(this.element.innerHTML="","string"==typeof this.content?this.element.textContent=this.content:this.element.appendChild(this.content))},i.prototype.orientationOnChange=function(){var t=this;setTimeout(function(){t.refreshPosition()},200)},i.prototype.refreshPosition=function(t,i){e.isNullOrUndefined(t)||this.checkFixedParent(t),this.reposition(),i||this.checkCollision()},i.prototype.reposition=function(){var t,i,o=this.getRelateToElement();if("number"==typeof this.position.X&&"number"==typeof this.position.Y)t={left:this.position.X,top:this.position.Y};else if("string"==typeof this.position.X&&"number"==typeof this.position.Y||"number"==typeof this.position.X&&"string"==typeof this.position.Y){var n=void 0,s=this.element.style.display;this.element.style.display="block",this.element.classList.contains("e-dlg-modal")&&(n=this.element.parentElement.style.display,this.element.parentElement.style.display="block"),i=this.getAnchorPosition(o,this.element,this.position,this.offsetX,this.offsetY),t="string"==typeof this.position.X?{left:i.left,top:this.position.Y}:{left:this.position.X,top:i.top},this.element.style.display=s,this.element.classList.contains("e-dlg-modal")&&(this.element.parentElement.style.display=n)}else if(o){s=this.element.style.display;this.element.style.display="block",t=this.getAnchorPosition(o,this.element,this.position,this.offsetX,this.offsetY),this.element.style.display=s}else t={left:0,top:0};e.isNullOrUndefined(t)||(this.element.style.left=t.left+"px",this.element.style.top=t.top+"px")},i.prototype.checkGetBoundingClientRect=function(t){try{return t.getBoundingClientRect()}catch(t){return null}},i.prototype.getAnchorPosition=function(t,i,s,r,l){var a=this.checkGetBoundingClientRect(i),h=this.checkGetBoundingClientRect(t);if(e.isNullOrUndefined(a)||e.isNullOrUndefined(h))return null;var d=t,p={left:0,top:0};switch(i.offsetParent&&"BODY"===i.offsetParent.tagName&&"BODY"===t.tagName?p=n(t):(i.classList.contains("e-dlg-modal")&&"BODY"!==d.tagName&&(i=i.parentElement),p=o(d,i)),s.X){default:case"left":break;case"center":i.classList.contains("e-dlg-modal")&&"BODY"===d.tagName&&"container"===this.targetType?p.left+=window.innerWidth/2-a.width/2:"container"===this.targetType?p.left+=h.width/2-a.width/2:p.left+=h.width/2;break;case"right":i.classList.contains("e-dlg-modal")&&"BODY"===d.tagName&&"container"===this.targetType?p.left+=window.innerWidth-a.width:"container"===this.targetType?p.left+=h.width-a.width:p.left+=h.width}switch(s.Y){default:case"top":break;case"center":i.classList.contains("e-dlg-modal")&&"BODY"===d.tagName&&"container"===this.targetType?p.top+=window.innerHeight/2-a.height/2:"container"===this.targetType?p.top+=h.height/2-a.height/2:p.top+=h.height/2;break;case"bottom":i.classList.contains("e-dlg-modal")&&"BODY"===d.tagName&&"container"===this.targetType?p.top+=window.innerHeight-a.height:"container"===this.targetType?p.top+=h.height-a.height:p.top+=h.height}return p.left+=r,p.top+=l,p},i.prototype.callFlip=function(t){var e=this.getRelateToElement();y(this.element,e,this.offsetX,this.offsetY,this.position.X,this.position.Y,this.viewPortElement,t,this.fixedParent)},i.prototype.callFit=function(t){if(0!==v(this.element,this.viewPortElement).length)if(e.isNullOrUndefined(this.viewPortElement)){var i=g(this.element,this.viewPortElement,t);t.X&&(this.element.style.left=i.left+"px"),t.Y&&(this.element.style.top=i.top+"px")}else{var o=this.checkGetBoundingClientRect(this.element),n=this.checkGetBoundingClientRect(this.viewPortElement);if(e.isNullOrUndefined(o)||e.isNullOrUndefined(n))return null;t&&!0===t.Y&&(n.top>o.top?this.element.style.top="0px":n.bottom<o.bottom&&(this.element.style.top=parseInt(this.element.style.top,10)-(o.bottom-n.bottom)+"px")),t&&!0===t.X&&(n.right<o.right?this.element.style.left=parseInt(this.element.style.left,10)-(o.right-n.right)+"px":n.left>o.left&&(this.element.style.left=parseInt(this.element.style.left,10)+(n.left-o.left)+"px"))}},i.prototype.checkCollision=function(){var t=this.collision.X,e=this.collision.Y;"none"===t&&"none"===e||("flip"===t&&"flip"===e?this.callFlip({X:!0,Y:!0}):"fit"===t&&"fit"===e?this.callFit({X:!0,Y:!0}):("flip"===t?this.callFlip({X:!0,Y:!1}):"flip"===e&&this.callFlip({Y:!0,X:!1}),"fit"===t?this.callFit({X:!0,Y:!1}):"fit"===e&&this.callFit({X:!1,Y:!0})))},i.prototype.show=function(t,i){var o=this;if(this.wireEvents(),1e3===this.zIndex||!e.isNullOrUndefined(i)){var n=e.isNullOrUndefined(i)?this.element:i;this.zIndex=Y(n),e.setStyleAttribute(this.element,{zIndex:this.zIndex})}t=e.isNullOrUndefined(t)||"object"!=typeof t?this.showAnimation:t,"none"===this.collision.X&&"none"===this.collision.Y||(e.removeClass([this.element],ce.CLOSE),e.addClass([this.element],ce.OPEN),this.checkCollision(),e.removeClass([this.element],ce.OPEN),e.addClass([this.element],ce.CLOSE)),e.isNullOrUndefined(t)?(e.removeClass([this.element],ce.CLOSE),e.addClass([this.element],ce.OPEN),this.trigger("open")):(t.begin=function(){o.isDestroyed||(e.removeClass([o.element],ce.CLOSE),e.addClass([o.element],ce.OPEN))},t.end=function(){o.isDestroyed||o.trigger("open")},new e.Animation(t).animate(this.element))},i.prototype.hide=function(t){var i=this;t=e.isNullOrUndefined(t)||"object"!=typeof t?this.hideAnimation:t,e.isNullOrUndefined(t)?(e.removeClass([this.element],ce.OPEN),e.addClass([this.element],ce.CLOSE),this.trigger("close")):(t.end=function(){i.isDestroyed||(e.removeClass([i.element],ce.OPEN),e.addClass([i.element],ce.CLOSE),i.trigger("close"))},new e.Animation(t).animate(this.element)),this.unwireEvents()},i.prototype.getScrollableParent=function(t){return this.checkFixedParent(t),I(t,this.fixedParent)},i.prototype.checkFixedParent=function(t){for(var i=t.parentElement;i&&"HTML"!==i.tagName;){var o=getComputedStyle(i);"fixed"===o.position&&!e.isNullOrUndefined(this.element)&&this.element.offsetParent&&"BODY"===this.element.offsetParent.tagName&&(this.element.style.top=window.scrollY>parseInt(this.element.style.top)?e.formatUnit(window.scrollY-parseInt(this.element.style.top)):e.formatUnit(parseInt(this.element.style.top)-window.scrollY),this.element.style.position="fixed",this.fixedParent=!0),i=i.parentElement,!e.isNullOrUndefined(this.element)&&e.isNullOrUndefined(this.element.offsetParent)&&"fixed"===o.position&&"fixed"===this.element.style.position&&(this.fixedParent=!0)}},de([e.Property("auto")],i.prototype,"height",void 0),de([e.Property("auto")],i.prototype,"width",void 0),de([e.Property(null)],i.prototype,"content",void 0),de([e.Property("container")],i.prototype,"targetType",void 0),de([e.Property(null)],i.prototype,"viewPortElement",void 0),de([e.Property({X:"none",Y:"none"})],i.prototype,"collision",void 0),de([e.Property("")],i.prototype,"relateTo",void 0),de([e.Complex({},pe)],i.prototype,"position",void 0),de([e.Property(0)],i.prototype,"offsetX",void 0),de([e.Property(0)],i.prototype,"offsetY",void 0),de([e.Property(1e3)],i.prototype,"zIndex",void 0),de([e.Property(!1)],i.prototype,"enableRtl",void 0),de([e.Property("reposition")],i.prototype,"actionOnScroll",void 0),de([e.Property(null)],i.prototype,"showAnimation",void 0),de([e.Property(null)],i.prototype,"hideAnimation",void 0),de([e.Event()],i.prototype,"open",void 0),de([e.Event()],i.prototype,"close",void 0),de([e.Event()],i.prototype,"targetExitViewport",void 0),i=de([e.NotifyPropertyChanges],i)}(e.Component),fe=["north-west","north","north-east","west","east","south-west","south","south-east"],me="e-resize-handle",ge="e-focused-handle",ve=["e-restrict-left"],ye="e-resize-viewport",be=["north","west","east","south"],Ee=0,Oe=0,Ce=0,we=0,Se=0,Ne=0,Te=null,Pe=null,xe=null,He=!0,Ue=0,Be=!0,Re=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ke=function(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r},ze=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Re(i,t),ke([e.Property(!0)],i.prototype,"isFlat",void 0),ke([e.Property()],i.prototype,"buttonModel",void 0),ke([e.Property("Button")],i.prototype,"type",void 0),ke([e.Event()],i.prototype,"click",void 0),i}(e.ChildProperty),Me=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Re(i,t),ke([e.Property("Fade")],i.prototype,"effect",void 0),ke([e.Property(400)],i.prototype,"duration",void 0),ke([e.Property(0)],i.prototype,"delay",void 0),i}(e.ChildProperty),Le="e-dialog",Ae="e-dlg-target",Ie="e-scroll-disabled",Ye="e-dlg-fullscreen",Xe="Information",De="e-scroll-disabled",je="e-alert-dialog",qe="e-confirm-dialog",Fe="user action",_e=function(t){function o(e,i){var o=t.call(this,e,i)||this;return o.dlgClosedBy=Fe,o}return Re(o,t),o.prototype.render=function(){this.initialize(),this.initRender(),this.wireEvents(),"100%"===this.width&&(this.element.style.width=""),""!==this.minHeight&&(this.element.style.minHeight=e.formatUnit(this.minHeight)),this.enableResize&&(this.setResize(),"None"===this.animationSettings.effect&&this.getMinHeight()),this.renderComplete()},o.prototype.preRender=function(){var t=this;this.headerContent=null,this.allowMaxHeight=!0,this.preventVisibility=!0,this.clonedEle=this.element.cloneNode(!0),this.closeIconClickEventHandler=function(e){t.dlgClosedBy="close icon",t.hide(e)},this.dlgOverlayClickEventHandler=function(e){t.dlgClosedBy="overlayClick",e.preventFocus=!1,t.trigger("overlayClick",e,function(e){e.preventFocus||t.focusContent(),t.dlgClosedBy=Fe})};var i={close:"Close"};if(this.l10n=new e.L10n("dialog",i,this.locale),this.checkPositionData(),e.isNullOrUndefined(this.target)){var o=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.target=document.body,this.isProtectedOnChange=o}},o.prototype.isNumberValue=function(t){return/^[-+]?\d*\.?\d+$/.test(t)},o.prototype.checkPositionData=function(){if(!e.isNullOrUndefined(this.position)){if(!e.isNullOrUndefined(this.position.X)&&"number"!=typeof this.position.X&&(t=this.isNumberValue(this.position.X))){i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.position.X=parseFloat(this.position.X),this.isProtectedOnChange=i}if(!e.isNullOrUndefined(this.position.Y)&&"number"!=typeof this.position.Y){var t=this.isNumberValue(this.position.Y);if(t){var i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.position.Y=parseFloat(this.position.Y),this.isProtectedOnChange=i}}}},o.prototype.getEle=function(t,e){for(var i=void 0,o=0;o<t.length;o++)if(t[o].classList.contains(e)){i=t[o];break}return i},o.prototype.getMinHeight=function(){var t="0px",i="0px";e.isNullOrUndefined(this.element.querySelector(".e-dlg-header-content"))||(t=getComputedStyle(this.headerContent).height);var o=this.getEle(this.element.children,"e-footer-content");e.isNullOrUndefined(o)||(i=getComputedStyle(o).height);var n=parseInt(t.slice(0,t.indexOf("p")),10),s=parseInt(i.slice(0,i.indexOf("p")),10);return it(n+30+(isNaN(s)?0:s)),n+30+s},o.prototype.onResizeStart=function(t,e){return e.trigger("resizeStart",t),t.cancel},o.prototype.onResizing=function(t,e){e.trigger("resizing",t)},o.prototype.onResizeComplete=function(t,e){e.trigger("resizeStop",t)},o.prototype.setResize=function(){if(this.enableResize){if(this.isBlazorServerRender()&&!e.isNullOrUndefined(this.element.querySelector(".e-icons.e-resize-handle")))return;this.element.classList.add("e-dlg-resizable");for(var t=getComputedStyle(this.element).minHeight,i=getComputedStyle(this.element).minWidth,o="",n=0;n<this.resizeHandles.length;n++){if("All"===this.resizeHandles[n]){o="south north east west north-east north-west south-east south-west";break}var s="";switch(this.resizeHandles[n].toString()){case"SouthEast":s="south-east";break;case"SouthWest":s="south-west";break;case"NorthEast":s="north-east";break;case"NorthWest":s="north-west";break;default:s=this.resizeHandles[n].toString()}o+=s.toLocaleLowerCase()+" "}this.enableRtl&&"south-east"===o.trim()?o="south-west":this.enableRtl&&"south-west"===o.trim()&&(o="south-east"),this.isModal&&this.enableRtl?this.element.classList.add("e-restrict-left"):this.isModal&&this.target===document.body&&this.element.classList.add("e-resize-viewport"),D({element:this.element,direction:o,minHeight:parseInt(t.slice(0,i.indexOf("p")),10),maxHeight:this.targetEle.clientHeight,minWidth:parseInt(i.slice(0,i.indexOf("p")),10),maxWidth:this.targetEle.clientWidth,boundary:this.target===document.body?null:this.targetEle,resizeBegin:this.onResizeStart.bind(this),resizeComplete:this.onResizeComplete.bind(this),resizing:this.onResizing.bind(this),proxy:this}),this.wireWindowResizeEvent()}else st(),this.unWireWindowResizeEvent(),this.isModal?this.element.classList.remove("e-restrict-left"):this.element.classList.remove("e-resize-viewport"),this.element.classList.remove("e-dlg-resizable")},o.prototype.getFocusElement=function(t){var e=t.querySelectorAll('input,select,textarea,button:enabled,a,[contenteditable="true"],[tabindex]');return{element:e[e.length-1]}},o.prototype.keyDown=function(t){var i=this;if(9===t.keyCode&&this.isModal){var o=void 0;e.isNullOrUndefined(this.btnObj)||(o=this.btnObj[this.btnObj.length-1]),e.isNullOrUndefined(this.btnObj)&&!e.isNullOrUndefined(this.ftrTemplateContent)&&(o=this.getFocusElement(this.ftrTemplateContent)),e.isNullOrUndefined(this.btnObj)&&e.isNullOrUndefined(this.ftrTemplateContent)&&!e.isNullOrUndefined(this.contentEle)&&(o=this.getFocusElement(this.contentEle)),e.isNullOrUndefined(o)||document.activeElement!==o.element||t.shiftKey||(t.preventDefault(),this.focusableElements(this.element).focus()),document.activeElement===this.focusableElements(this.element)&&t.shiftKey&&(t.preventDefault(),e.isNullOrUndefined(o)||o.element.focus())}var n=document.activeElement,s=["input","textarea"].indexOf(n.tagName.toLowerCase())>-1,r=!1;if(s||(r=n.hasAttribute("contenteditable")&&"true"===n.getAttribute("contenteditable")),27===t.keyCode&&this.closeOnEscape&&(this.dlgClosedBy="escape",this.hide(t)),13===t.keyCode&&!t.ctrlKey&&"textarea"!==n.tagName.toLowerCase()&&s&&!e.isNullOrUndefined(this.primaryButtonEle)||13===t.keyCode&&t.ctrlKey&&("textarea"===n.tagName.toLowerCase()||r)&&!e.isNullOrUndefined(this.primaryButtonEle)){var l;this.buttons.some(function(t,i){l=i;var o=t.buttonModel;return!e.isNullOrUndefined(o)&&!0===o.isPrimary})&&"function"==typeof this.buttons[l].click&&setTimeout(function(){i.buttons[l].click.call(i,t)})}},o.prototype.initialize=function(){e.isNullOrUndefined(this.target)||(this.targetEle="string"==typeof this.target?document.querySelector(this.target):this.target),this.isBlazorServerRender()||e.addClass([this.element],Le),e.Browser.isDevice&&e.addClass([this.element],"e-device"),this.isBlazorServerRender()||this.setCSSClass(),this.setMaxHeight()},o.prototype.initRender=function(){var t=this;if(this.initialRender=!0,this.isBlazorServerRender()||e.attributes(this.element,{role:"dialog"}),1e3===this.zIndex?(this.setzIndex(this.element,!1),this.calculatezIndex=!0):this.calculatezIndex=!1,this.isBlazorServerRender()&&e.isNullOrUndefined(this.headerContent)&&(this.headerContent=this.element.getElementsByClassName("e-dlg-header-content")[0]),this.isBlazorServerRender()&&e.isNullOrUndefined(this.contentEle)&&(this.contentEle=this.element.querySelector("#"+this.element.id+"_dialog-content")),this.isBlazorServerRender()||(this.setTargetContent(),""===this.header||e.isNullOrUndefined(this.header)||this.setHeader(),this.showCloseIcon&&this.renderCloseIcon(),this.setContent(),""===this.footerTemplate||e.isNullOrUndefined(this.footerTemplate)?e.isNullOrUndefined(this.buttons[0].buttonModel)||this.setButton():this.setFooterTemplate()),this.isBlazorServerRender()&&(e.isNullOrUndefined(this.buttons[0].buttonModel)||""!==this.footerTemplate||this.setButton()),this.allowDragging&&!e.isNullOrUndefined(this.headerContent)&&this.setAllowDragging(),this.isBlazorServerRender()||(e.attributes(this.element,{"aria-modal":this.isModal?"true":"false"}),this.isModal&&this.setIsModal()),this.isBlazorServerRender()&&e.isNullOrUndefined(this.dlgContainer)){this.dlgContainer=this.element.parentElement;for(var i=0,o=this.dlgContainer.children;i<o.length;i++)o[i].classList.contains("e-dlg-overlay")&&(this.dlgOverlay=o[i])}if(!0!==this.element.classList.contains(je)&&!0!==this.element.classList.contains(qe)&&!e.isNullOrUndefined(this.element.parentElement)){var n=this.isModal?this.dlgContainer.parentElement:this.element.parentElement;this.refElement=this.createElement("div",{className:"e-dlg-ref-element"}),n.insertBefore(this.refElement,this.isModal?this.dlgContainer:this.element)}e.isNullOrUndefined(this.targetEle)||(this.isModal?this.targetEle.appendChild(this.dlgContainer):this.targetEle.appendChild(this.element)),this.popupObj=new ue(this.element,{height:this.height,width:this.width,zIndex:this.zIndex,relateTo:this.target,actionOnScroll:"none",enableRtl:this.enableRtl,open:function(e){var i={container:t.isModal?t.dlgContainer:t.element,element:t.element,target:t.target,preventFocus:!1};t.enableResize&&t.resetResizeIcon(),t.trigger("open",i,function(e){e.preventFocus||t.focusContent()})},close:function(i){t.isModal&&e.addClass([t.dlgOverlay],"e-fade"),t.unBindEvent(t.element),t.isModal&&(t.dlgContainer.style.display="none"),t.trigger("close",t.closeArgs);var o=document.activeElement;e.isNullOrUndefined(o)||e.isNullOrUndefined(o.blur)||o.blur(),e.isNullOrUndefined(t.storeActiveElement)||e.isNullOrUndefined(t.storeActiveElement.focus)||t.storeActiveElement.focus()}}),this.positionChange(),this.setEnableRTL(),this.isBlazorServerRender()||(e.addClass([this.element],"e-popup-close"),this.isModal&&this.setOverlayZindex()),this.visible?this.show():this.isModal&&(this.dlgOverlay.style.display="none"),this.initialRender=!1},o.prototype.resetResizeIcon=function(){var t=this.getMinHeight();if(this.targetEle.offsetHeight<t){var i=this.enableRtl?"e-south-west":"e-south-east",o=this.element.querySelector("."+i);e.isNullOrUndefined(o)||(o.style.bottom="-"+t.toString()+"px")}},o.prototype.setOverlayZindex=function(t){var i;i=e.isNullOrUndefined(t)?parseInt(this.element.style.zIndex,10)?parseInt(this.element.style.zIndex,10):this.zIndex:t,this.dlgOverlay.style.zIndex=(i-1).toString(),this.dlgContainer.style.zIndex=i.toString()},o.prototype.positionChange=function(){this.isModal&&(isNaN(parseFloat(this.position.X))||isNaN(parseFloat(this.position.Y)))?!isNaN(parseFloat(this.position.X))&&isNaN(parseFloat(this.position.Y))||isNaN(parseFloat(this.position.X))&&!isNaN(parseFloat(this.position.Y))?this.setPopupPosition():(this.element.style.top="0px",this.element.style.left="0px",this.dlgContainer.classList.add("e-dlg-"+this.position.X+"-"+this.position.Y)):this.setPopupPosition()},o.prototype.setPopupPosition=function(){this.popupObj.setProperties({position:{X:this.position.X,Y:this.position.Y}})},o.prototype.setAllowDragging=function(){var t=this;this.dragObj=new e.Draggable(this.element,{clone:!1,isDragScroll:!0,abort:".e-dlg-closeicon-btn",handle:".e-dlg-header-content",dragStart:function(i){t.trigger("dragStart",i,function(t){e.isBlazor()&&t.bindEvents(i.dragElement)})},dragStop:function(i){t.isModal&&(e.isNullOrUndefined(t.position)||t.dlgContainer.classList.remove("e-dlg-"+t.position.X+"-"+t.position.Y),t.element.style.position="relative"),t.trigger("dragStop",i),t.element.classList.remove("e-restrict-left")},drag:function(e){t.trigger("drag",e)}}),e.isNullOrUndefined(this.targetEle)||(this.dragObj.dragArea=this.targetEle)},o.prototype.setButton=function(){if(!this.isBlazorServerRender()){this.buttonContent=[],this.btnObj=[];for(s=0;s<this.buttons.length;s++){var t=e.isNullOrUndefined(this.buttons[s].type)?"button":this.buttons[s].type.toLowerCase(),o=this.createElement("button",{attrs:{type:t}});this.buttonContent.push(o.outerHTML)}this.setFooterTemplate()}for(var n,s=0,r=this.element.children;s<r.length;s++)r[s].classList.contains("e-footer-content")&&(n=r[s].querySelectorAll("button"));for(s=0;s<this.buttons.length;s++)this.isBlazorServerRender()||(this.btnObj[s]=new i.Button(this.buttons[s].buttonModel)),this.isBlazorServerRender()&&(this.ftrTemplateContent=this.element.querySelector(".e-footer-content")),!e.isNullOrUndefined(this.ftrTemplateContent)&&n.length>0&&("function"==typeof this.buttons[s].click&&e.EventHandler.add(n[s],"click",this.buttons[s].click,this),"object"==typeof this.buttons[s].click&&e.EventHandler.add(n[s],"click",this.buttonClickHandler.bind(this,s),this)),this.isBlazorServerRender()||e.isNullOrUndefined(this.ftrTemplateContent)||(this.btnObj[s].appendTo(this.ftrTemplateContent.children[s]),this.buttons[s].isFlat&&this.btnObj[s].element.classList.add("e-flat"),this.primaryButtonEle=this.element.getElementsByClassName("e-primary")[0])},o.prototype.buttonClickHandler=function(t){this.trigger("buttons["+t+"].click",{})},o.prototype.setContent=function(){e.attributes(this.element,{"aria-describedby":this.element.id+"_dialog-content"}),this.contentEle=this.createElement("div",{className:"e-dlg-content",id:this.element.id+"_dialog-content"}),this.innerContentElement?this.contentEle.appendChild(this.innerContentElement):(e.isNullOrUndefined(this.content)||""===this.content)&&this.initialRender||("string"!=typeof this.content||e.isBlazor()?this.content instanceof HTMLElement?this.contentEle.appendChild(this.content):this.setTemplate(this.content,this.contentEle,"content"):this.contentEle.innerHTML=this.sanitizeHelper(this.content)),e.isNullOrUndefined(this.headerContent)?this.element.insertBefore(this.contentEle,this.element.children[0]):this.element.insertBefore(this.contentEle,this.element.children[1]),"auto"===this.height&&(this.isBlazorServerRender()||!e.Browser.isIE||""!==this.element.style.width||e.isNullOrUndefined(this.width)||(this.element.style.width=e.formatUnit(this.width)),this.setMaxHeight())},o.prototype.setTemplate=function(t,i,o){var n,s;s=i.classList.contains("e-dlg-header")?this.element.id+"header":i.classList.contains("e-footer-content")?this.element.id+"footerTemplate":this.element.id+"content";var r;e.isNullOrUndefined(t.outerHTML)?"string"!=typeof t||e.isBlazor()&&!this.isStringTemplate?(n=e.compile(t),r=t):i.innerHTML=this.sanitizeHelper(t):i.appendChild(t);var l=[];if(!e.isNullOrUndefined(n)){for(var a=0,h=n({},this,o,s,!(e.isBlazor()&&!this.isStringTemplate&&0===r.indexOf("<div>Blazor"))||this.isStringTemplate);a<h.length;a++){var d=h[a];l.push(d)}e.append([].slice.call(l),i)}},o.prototype.sanitizeHelper=function(t){if(this.enableHtmlSanitizer){var i=e.SanitizeHtmlHelper.beforeSanitize(),o={cancel:!1,helper:null};e.extend(i,i,o),this.trigger("beforeSanitizeHtml",i),i.cancel&&!e.isNullOrUndefined(i.helper)?t=i.helper(t):i.cancel||(t=e.SanitizeHtmlHelper.serializeValue(i,t))}return t},o.prototype.setMaxHeight=function(){if(this.allowMaxHeight){var t=this.element.style.display;this.element.style.display="none",this.element.style.maxHeight=!e.isNullOrUndefined(this.target)&&this.targetEle.offsetHeight<window.innerHeight?this.targetEle.offsetHeight-20+"px":window.innerHeight-20+"px",this.element.style.display=t,e.Browser.isIE&&"auto"===this.height&&!e.isNullOrUndefined(this.contentEle)&&this.element.offsetHeight<this.contentEle.offsetHeight&&(this.element.style.height="inherit")}},o.prototype.setEnableRTL=function(){this.isBlazorServerRender()||(this.enableRtl?e.addClass([this.element],"e-rtl"):e.removeClass([this.element],"e-rtl")),e.isNullOrUndefined(this.element.querySelector(".e-resize-handle"))||(st(),this.setResize())},o.prototype.setTargetContent=function(){var t=this;if(e.isNullOrUndefined(this.content)||""===this.content){var i=""!==this.element.innerHTML.replace(/\s|<(\/?|\/?)(!--!--)>/g,"");(this.element.children.length>0||i)&&(this.innerContentElement=document.createDocumentFragment(),[].slice.call(this.element.childNodes).forEach(function(e){8!==e.nodeType&&t.innerContentElement.appendChild(e)}))}},o.prototype.setHeader=function(){this.headerEle?this.headerEle.innerHTML="":this.headerEle=this.createElement("div",{id:this.element.id+"_title",className:"e-dlg-header"}),this.createHeaderContent(),this.headerContent.appendChild(this.headerEle),this.setTemplate(this.header,this.headerEle,"header"),e.attributes(this.element,{"aria-labelledby":this.element.id+"_title"}),this.element.insertBefore(this.headerContent,this.element.children[0])},o.prototype.setFooterTemplate=function(){this.ftrTemplateContent?this.ftrTemplateContent.innerHTML="":this.ftrTemplateContent=this.createElement("div",{className:"e-footer-content"}),""===this.footerTemplate||e.isNullOrUndefined(this.footerTemplate)?this.ftrTemplateContent.innerHTML=this.buttonContent.join(""):this.setTemplate(this.footerTemplate,this.ftrTemplateContent,"footerTemplate"),this.element.appendChild(this.ftrTemplateContent)},o.prototype.createHeaderContent=function(){e.isNullOrUndefined(this.headerContent)&&(this.headerContent=this.createElement("div",{id:this.element.id+"_dialog-header",className:"e-dlg-header-content"}))},o.prototype.renderCloseIcon=function(){this.closeIcon=this.createElement("button",{className:"e-dlg-closeicon-btn",attrs:{type:"button"}}),this.closeIconBtnObj=new i.Button({cssClass:"e-flat",iconCss:"e-icon-dlg-close e-icons"}),this.closeIconTitle(),e.isNullOrUndefined(this.headerContent)?(this.createHeaderContent(),e.prepend([this.closeIcon],this.headerContent),this.element.insertBefore(this.headerContent,this.element.children[0])):e.prepend([this.closeIcon],this.headerContent),this.closeIconBtnObj.appendTo(this.closeIcon)},o.prototype.closeIconTitle=function(){this.l10n.setLocale(this.locale);var t=this.l10n.getConstant("close");this.closeIcon.setAttribute("title",t),this.closeIcon.setAttribute("aria-label",t)},o.prototype.setCSSClass=function(t){this.cssClass&&e.addClass([this.element],this.cssClass.split(" ")),t&&e.removeClass([this.element],t.split(" "))},o.prototype.setIsModal=function(){this.dlgContainer=this.createElement("div",{className:"e-dlg-container"}),this.element.classList.remove("e-popup-open"),this.element.parentNode.insertBefore(this.dlgContainer,this.element),this.dlgContainer.appendChild(this.element),e.addClass([this.element],"e-dlg-modal"),this.dlgOverlay=this.createElement("div",{className:"e-dlg-overlay"}),this.dlgOverlay.style.zIndex=(this.zIndex-1).toString(),this.dlgContainer.appendChild(this.dlgOverlay)},o.prototype.getValidFocusNode=function(t){for(var e,i=0;i<t.length;i++){if(((e=t[i]).clientHeight>0||"a"===e.tagName.toLowerCase()&&e.hasAttribute("href"))&&e.tabIndex>-1&&!e.disabled&&!this.disableElement(e,'[disabled],[aria-disabled="true"],[type="hidden"]'))return e;e=null}return e},o.prototype.focusableElements=function(t){if(!e.isNullOrUndefined(t)){var i=t.querySelectorAll('input,select,textarea,button,a,[contenteditable="true"],[tabindex]');return this.getValidFocusNode(i)}return null},o.prototype.getAutoFocusNode=function(t){var i=t.querySelector(".e-dlg-closeicon-btn"),o=t.querySelectorAll("[autofocus]"),n=this.getValidFocusNode(o);if(e.isBlazor()&&(this.primaryButtonEle=this.element.getElementsByClassName("e-primary")[0]),e.isNullOrUndefined(n)){if(n=this.focusableElements(this.contentEle),!e.isNullOrUndefined(n))return i=n;if(!e.isNullOrUndefined(this.primaryButtonEle))return this.element.querySelector(".e-primary")}else i=n;return i},o.prototype.disableElement=function(t,e){var i=t?t.matches||t.webkitMatchesSelector||t.msGetRegionContent:null;if(i)for(;t;t=t.parentNode)if(t instanceof Element&&i.call(t,e))return t;return null},o.prototype.focusContent=function(){var t=this.getAutoFocusNode(this.element),i=e.isNullOrUndefined(t)?this.element:t,o=e.Browser.userAgent;(o.indexOf("MSIE ")>0||o.indexOf("Trident/")>0)&&this.element.focus(),i.focus(),this.bindEvent(this.element)},o.prototype.bindEvent=function(t){e.EventHandler.add(t,"keydown",this.keyDown,this)},o.prototype.unBindEvent=function(t){e.EventHandler.remove(t,"keydown",this.keyDown)},o.prototype.updateSanitizeContent=function(){this.isBlazorServerRender()||(this.contentEle.innerHTML=this.sanitizeHelper(this.content))},o.prototype.isBlazorServerRender=function(){return e.isBlazor()&&this.isServerRendered},o.prototype.getModuleName=function(){return"dialog"},o.prototype.onPropertyChanged=function(t,i){if(this.element.classList.contains(Le))for(var o=0,n=Object.keys(t);o<n.length;o++)switch(n[o]){case"content":e.isNullOrUndefined(this.content)||""===this.content?e.isNullOrUndefined(this.contentEle)||(e.detach(this.contentEle),this.contentEle=null):(this.isBlazorServerRender()&&(this.contentEle=this.element.querySelector(".e-dlg-content")),e.isNullOrUndefined(this.contentEle)||"dialog"===this.contentEle.getAttribute("role")?this.isBlazorServerRender()&&!e.isNullOrUndefined(this.element.querySelector(".e-dlg-content"))||this.setContent():(this.isBlazorServerRender()||(this.contentEle.innerHTML=""),"function"==typeof this.content?(this.clearTemplate(["content"]),e.detach(this.contentEle),this.contentEle=null,this.setContent()):"string"==typeof this.content?this.isBlazorServerRender()&&""===this.contentEle.innerText?this.contentEle.insertAdjacentHTML("beforeend",this.sanitizeHelper(this.content)):this.updateSanitizeContent():this.contentEle.appendChild(this.content),this.setMaxHeight()));break;case"header":""===this.header||e.isNullOrUndefined(this.header)?this.headerEle&&(e.detach(this.headerEle),this.headerEle=null):this.isBlazorServerRender()&&!e.isNullOrUndefined(this.element.querySelector(".e-dlg-header-content"))||this.setHeader();break;case"footerTemplate":if(""===this.footerTemplate||e.isNullOrUndefined(this.footerTemplate)){if(!this.ftrTemplateContent)return;e.detach(this.ftrTemplateContent),this.ftrTemplateContent=null,this.buttons=[{}]}else this.isBlazorServerRender()&&!e.isNullOrUndefined(this.element.querySelector(".e-footer-content"))||this.setFooterTemplate(),this.buttons=[{}];break;case"showCloseIcon":this.element.getElementsByClassName("e-icon-dlg-close").length>0?this.showCloseIcon||""!==this.header&&!e.isNullOrUndefined(this.header)?this.showCloseIcon?this.isBlazorServerRender()&&this.wireEvents():e.detach(this.closeIcon):(e.detach(this.headerContent),this.headerContent=null):(this.isBlazorServerRender()||this.renderCloseIcon(),this.wireEvents());break;case"locale":this.showCloseIcon&&this.closeIconTitle();break;case"visible":this.visible?this.show():this.hide();break;case"isModal":this.updateIsModal();break;case"height":e.setStyleAttribute(this.element,{height:e.formatUnit(t.height)});break;case"width":e.setStyleAttribute(this.element,{width:e.formatUnit(t.width)});break;case"zIndex":this.popupObj.zIndex=this.zIndex,this.isModal&&this.setOverlayZindex(this.zIndex),this.element.style.zIndex!==this.zIndex.toString()&&(this.calculatezIndex=!1);break;case"cssClass":this.setCSSClass(i.cssClass);break;case"buttons":var s=this.buttons.length;e.isNullOrUndefined(this.ftrTemplateContent)||this.isBlazorServerRender()||(e.detach(this.ftrTemplateContent),this.ftrTemplateContent=null);for(var r=0;r<s;r++)e.isNullOrUndefined(this.buttons[r].buttonModel)||(this.footerTemplate="",this.setButton());break;case"allowDragging":this.allowDragging&&!e.isNullOrUndefined(this.headerContent)?this.setAllowDragging():this.dragObj.destroy();break;case"target":this.setTarget(t.target);break;case"position":if(this.checkPositionData(),this.isModal){var l=e.isNullOrUndefined(i.position.X)?this.position.X:i.position.X,a=e.isNullOrUndefined(i.position.Y)?this.position.Y:i.position.Y;this.dlgContainer.classList.contains("e-dlg-"+l+"-"+a)&&this.dlgContainer.classList.remove("e-dlg-"+l+"-"+a)}this.positionChange();break;case"enableRtl":this.setEnableRTL();break;case"enableResize":this.setResize()}},o.prototype.setTarget=function(t){this.popupObj.relateTo=t,this.target=t,this.targetEle="string"==typeof this.target?document.querySelector(this.target):this.target,this.dragObj&&(this.dragObj.dragArea=this.targetEle),this.setMaxHeight(),this.isModal&&this.updateIsModal(),this.enableResize&&this.setResize()},o.prototype.updateIsModal=function(){if(this.element.setAttribute("aria-modal",this.isModal?"true":"false"),this.isModal)this.setIsModal(),this.element.style.top="0px",this.element.style.left="0px",e.isNullOrUndefined(this.targetEle)||this.targetEle.appendChild(this.dlgContainer);else{for(e.removeClass([this.element],"e-dlg-modal"),e.removeClass([document.body],[Ae,Ie]),e.detach(this.dlgOverlay);this.dlgContainer.firstChild;)this.dlgContainer.parentElement.insertBefore(this.dlgContainer.firstChild,this.dlgContainer);this.dlgContainer.parentElement.removeChild(this.dlgContainer)}this.visible&&this.show(),this.positionChange(),this.isModal&&this.dlgOverlay&&e.EventHandler.add(this.dlgOverlay,"click",this.dlgOverlayClickEventHandler,this)},o.prototype.setzIndex=function(t,e){var i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.zIndex=Y(t),this.isProtectedOnChange=i,e&&(this.popupObj.zIndex=this.zIndex)},o.prototype.windowResizeHandler=function(){ot(this.targetEle.clientWidth),nt(this.targetEle.clientHeight),this.setMaxHeight()},o.prototype.getPersistData=function(){return this.addOnPersist([])},o.prototype.destroy=function(){if(!this.isDestroyed){var i=["e-rtl","e-dlg-modal","e-dlg-resizable","e-restrict-left",Ye,"e-device"],o=["role","aria-modal","aria-labelledby","aria-describedby","aria-grabbed","tabindex","style"];if(e.removeClass([this.targetEle],[Ae,Ie]),!e.isNullOrUndefined(this.element)&&this.element.classList.contains(Ye)&&e.removeClass([document.body],[Ae,Ie]),this.isModal&&e.removeClass([e.isNullOrUndefined(this.targetEle)?document.body:this.targetEle],Ie),this.unWireEvents(),!e.isNullOrUndefined(this.btnObj))for(n=0;n<this.btnObj.length;n++)this.btnObj[n].destroy();if(e.isNullOrUndefined(this.dragObj)||this.dragObj.destroy(),!e.isNullOrUndefined(this.popupObj.element)&&this.popupObj.element.classList.contains("e-popup")&&this.popupObj.destroy(),e.removeClass([this.element],i),e.isNullOrUndefined(this.cssClass)||""===this.cssClass||e.removeClass([this.element],this.cssClass.split(" ")),e.isNullOrUndefined(this.refElement)||e.isNullOrUndefined(this.refElement.parentElement)||(this.refElement.parentElement.insertBefore(this.isModal?this.dlgContainer:this.element,this.refElement),e.detach(this.refElement),this.refElement=void 0),this.isModal&&!this.isBlazorServerRender()&&(e.detach(this.dlgOverlay),this.dlgContainer.parentNode.insertBefore(this.element,this.dlgContainer),e.detach(this.dlgContainer)),this.isBlazorServerRender()||(this.element.innerHTML=this.clonedEle.innerHTML),this.isBlazorServerRender()&&!e.isNullOrUndefined(this.element.children))for(n=0;n<=this.element.children.length;n++)n-=n,e.detach(this.element.children[n]);for(var n=0;n<o.length;n++)this.element.removeAttribute(o[n]);this.isBlazorServerRender()?this.isDestroyed=!0:t.prototype.destroy.call(this),this.isReact&&this.clearTemplate()}},o.prototype.wireWindowResizeEvent=function(){window.addEventListener("resize",this.windowResizeHandler.bind(this))},o.prototype.unWireWindowResizeEvent=function(){window.removeEventListener("resize",this.windowResizeHandler.bind(this))},o.prototype.wireEvents=function(){this.isBlazorServerRender()&&this.showCloseIcon&&(this.closeIcon=this.element.getElementsByClassName("e-dlg-closeicon-btn")[0]),this.showCloseIcon&&e.EventHandler.add(this.closeIcon,"click",this.closeIconClickEventHandler,this),this.isModal&&this.dlgOverlay&&e.EventHandler.add(this.dlgOverlay,"click",this.dlgOverlayClickEventHandler,this)},o.prototype.unWireEvents=function(){if(this.showCloseIcon&&e.EventHandler.remove(this.closeIcon,"click",this.closeIconClickEventHandler),this.isModal&&e.EventHandler.remove(this.dlgOverlay,"click",this.dlgOverlayClickEventHandler),this.buttons.length>0&&!e.isNullOrUndefined(this.buttons[0].buttonModel)&&""===this.footerTemplate)for(var t=0;t<this.buttons.length;t++)"function"==typeof this.buttons[t].click&&e.EventHandler.remove(this.ftrTemplateContent.children[t],"click",this.buttons[t].click)},o.prototype.refreshPosition=function(){this.popupObj.refreshPosition()},o.prototype.show=function(t){var i=this;if(this.element.classList.contains(Le)){if(!this.element.classList.contains("e-popup-open")||!e.isNullOrUndefined(t)){e.isNullOrUndefined(t)||this.fullScreen(t);var o=e.isBlazor()?{cancel:!1,element:this.element,container:this.isModal?this.dlgContainer:this.element,maxHeight:this.element.style.maxHeight}:{cancel:!1,element:this.element,container:this.isModal?this.dlgContainer:this.element,target:this.target,maxHeight:this.element.style.maxHeight};this.trigger("beforeOpen",o,function(t){if(!t.cancel){i.element.style.maxHeight!==o.maxHeight&&(i.allowMaxHeight=!1,i.element.style.maxHeight=o.maxHeight),i.storeActiveElement=document.activeElement,i.element.tabIndex=-1,i.isModal&&!e.isNullOrUndefined(i.dlgOverlay)&&(i.dlgOverlay.style.display="block",i.dlgContainer.style.display="flex",e.removeClass([i.dlgOverlay],"e-fade"),e.isNullOrUndefined(i.targetEle)?e.addClass([document.body],[Ae,Ie]):(i.targetEle===document.body?i.dlgContainer.style.position="fixed":i.dlgContainer.style.position="absolute",i.dlgOverlay.style.position="absolute",i.element.style.position="relative",e.addClass([i.targetEle],[Ae,Ie])));var n={name:i.animationSettings.effect+"In",duration:i.animationSettings.duration,delay:i.animationSettings.delay},s=i.isModal?i.element.parentElement:i.element;i.calculatezIndex&&(i.setzIndex(s,!0),e.setStyleAttribute(i.element,{zIndex:i.zIndex}),i.isModal&&i.setOverlayZindex(i.zIndex)),"None"===i.animationSettings.effect?i.popupObj.show():i.popupObj.show(n),i.dialogOpen=!0;var r=i.isProtectedOnChange;i.isProtectedOnChange=!0,i.visible=!0,i.preventVisibility=!0,i.isProtectedOnChange=r}})}this.isReact&&this.renderReactTemplates()}},o.prototype.hide=function(t){var i=this;if(this.element.classList.contains(Le)&&this.preventVisibility){var o=e.isBlazor()?{cancel:!1,isInteracted:!!t,element:this.element,container:this.isModal?this.dlgContainer:this.element,event:t}:{cancel:!1,isInteracted:!!t,element:this.element,target:this.target,container:this.isModal?this.dlgContainer:this.element,event:t,closedBy:this.dlgClosedBy};this.closeArgs=o,this.trigger("beforeClose",o,function(t){if(!t.cancel){i.isModal&&(e.isNullOrUndefined(i.targetEle)?e.removeClass([document.body],[Ae,Ie]):e.removeClass([i.targetEle],[Ae,Ie]));var o={name:i.animationSettings.effect+"Out",duration:i.animationSettings.duration,delay:i.animationSettings.delay};"None"===i.animationSettings.effect?i.popupObj.hide():i.popupObj.hide(o),i.dialogOpen=!1;var n=i.isProtectedOnChange;i.isProtectedOnChange=!0,i.visible=!1,i.preventVisibility=!1,i.isProtectedOnChange=n}i.dlgClosedBy=Fe})}},o.prototype.fullScreen=function(t){this.element.offsetTop,this.element.offsetLeft;if(t){e.addClass([this.element],Ye);var i=this.element.style.display;this.element.style.display="none",this.element.style.maxHeight=e.isNullOrUndefined(this.target)?window.innerHeight+"px":this.targetEle.offsetHeight+"px",this.element.style.display=i,e.addClass([document.body],[Ae,Ie]),this.allowDragging&&!e.isNullOrUndefined(this.dragObj)&&this.dragObj.destroy()}else e.removeClass([this.element],Ye),e.removeClass([document.body],[Ae,Ie]),this.allowDragging&&!e.isNullOrUndefined(this.headerContent)&&this.setAllowDragging();return t},o.prototype.getButtons=function(t){return e.isNullOrUndefined(t)?this.btnObj:this.btnObj[t]},ke([e.Property("")],o.prototype,"content",void 0),ke([e.Property(!0)],o.prototype,"enableHtmlSanitizer",void 0),ke([e.Property(!1)],o.prototype,"showCloseIcon",void 0),ke([e.Property(!1)],o.prototype,"isModal",void 0),ke([e.Property("")],o.prototype,"header",void 0),ke([e.Property(!0)],o.prototype,"visible",void 0),ke([e.Property(!1)],o.prototype,"enableResize",void 0),ke([e.Property(["South-East"])],o.prototype,"resizeHandles",void 0),ke([e.Property("auto")],o.prototype,"height",void 0),ke([e.Property("")],o.prototype,"minHeight",void 0),ke([e.Property("100%")],o.prototype,"width",void 0),ke([e.Property("")],o.prototype,"cssClass",void 0),ke([e.Property(1e3)],o.prototype,"zIndex",void 0),ke([e.Property(null)],o.prototype,"target",void 0),ke([e.Property("")],o.prototype,"footerTemplate",void 0),ke([e.Property(!1)],o.prototype,"allowDragging",void 0),ke([e.Collection([{}],ze)],o.prototype,"buttons",void 0),ke([e.Property(!0)],o.prototype,"closeOnEscape",void 0),ke([e.Complex({},Me)],o.prototype,"animationSettings",void 0),ke([e.Complex({X:"center",Y:"center"},pe)],o.prototype,"position",void 0),ke([e.Event()],o.prototype,"created",void 0),ke([e.Event()],o.prototype,"open",void 0),ke([e.Event()],o.prototype,"beforeSanitizeHtml",void 0),ke([e.Event()],o.prototype,"beforeOpen",void 0),ke([e.Event()],o.prototype,"close",void 0),ke([e.Event()],o.prototype,"beforeClose",void 0),ke([e.Event()],o.prototype,"dragStart",void 0),ke([e.Event()],o.prototype,"dragStop",void 0),ke([e.Event()],o.prototype,"drag",void 0),ke([e.Event()],o.prototype,"overlayClick",void 0),ke([e.Event()],o.prototype,"resizeStart",void 0),ke([e.Event()],o.prototype,"resizing",void 0),ke([e.Event()],o.prototype,"resizeStop",void 0),ke([e.Event()],o.prototype,"destroyed",void 0),o=ke([e.NotifyPropertyChanges],o)}(e.Component);!function(t){function i(t){var i=e.createElement("div",{className:je});document.body.appendChild(i);var o,r=[{buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}}];return o="string"==typeof t?n({content:t,position:{X:"center",Y:"top"},isModal:!0,header:Xe,buttons:r},i):n(s(t),i),o.close=function(){t&&t.close&&t.close.apply(o),o.destroy(),o.element.classList.contains("e-dlg-modal")?(o.element.parentElement.remove(),o.target.classList.remove(De)):o.element.remove()},o}function o(t){var i=e.createElement("div",{className:qe});document.body.appendChild(i);var o,s=[{buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}},{buttonModel:{content:"Cancel"},click:function(){this.hide()}}];return o="string"==typeof t?n({position:{X:"center",Y:"top"},content:t,isModal:!0,header:Xe,buttons:s},i):n(r(t),i),o.close=function(){t&&t.close&&t.close.apply(o),o.destroy(),o.element.classList.contains("e-dlg-modal")?(o.element.parentElement.remove(),o.target.classList.remove(De)):o.element.remove()},o}function n(t,e){var i=new _e(t);return i.appendTo(e),i}function s(t){var e={};return e.buttons=[],e=l(e,t),e=a(e,t)}function r(t){var e={};return e.buttons=[],e=l(e,t),e=h(e,t)}function l(t,i){return t.header=e.isNullOrUndefined(i.title)?Xe:i.title,t.content=e.isNullOrUndefined(i.content)?"":i.content,t.isModal=!!e.isNullOrUndefined(i.isModal)||i.isModal,t.showCloseIcon=!e.isNullOrUndefined(i.showCloseIcon)&&i.showCloseIcon,t.allowDragging=!e.isNullOrUndefined(i.isDraggable)&&i.isDraggable,t.closeOnEscape=!e.isNullOrUndefined(i.closeOnEscape)&&i.closeOnEscape,t.position=e.isNullOrUndefined(i.position)?{X:"center",Y:"top"}:i.position,t.animationSettings=e.isNullOrUndefined(i.animationSettings)?{effect:"Fade",duration:400,delay:0}:i.animationSettings,t.cssClass=e.isNullOrUndefined(i.cssClass)?"":i.cssClass,t.zIndex=e.isNullOrUndefined(i.zIndex)?1e3:i.zIndex,t.open=e.isNullOrUndefined(i.open)?null:i.open,t}function a(t,i){var o=[{buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}}];return e.isNullOrUndefined(i.okButton)?t.buttons=o:t.buttons[0]=d(t.buttons[0],i.okButton,o[0]),t}function h(t,i){var o={buttonModel:{isPrimary:!0,content:"OK"},click:function(){this.hide()}},n={buttonModel:{content:"Cancel"},click:function(){this.hide()}};return e.isNullOrUndefined(i.okButton)?t.buttons[0]=o:t.buttons[0]=d(t.buttons[0],i.okButton,o),e.isNullOrUndefined(i.cancelButton)?t.buttons[1]=n:t.buttons[1]=d(t.buttons[1],i.cancelButton,n),t}function d(t,i,o){var n=o;return e.isNullOrUndefined(i.text)||(n.buttonModel.content=i.text),e.isNullOrUndefined(i.icon)||(n.buttonModel.iconCss=i.icon),e.isNullOrUndefined(i.cssClass)||(n.buttonModel.cssClass=i.cssClass),e.isNullOrUndefined(i.click)||(n.click=i.click),n}t.alert=i,t.confirm=o}(t.DialogUtility||(t.DialogUtility={}));var Ve=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),We=function(t,e,i,o){var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r},Ze=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Ve(i,t),We([e.Property({effect:"FadeIn",duration:150,delay:0})],i.prototype,"open",void 0),We([e.Property({effect:"FadeOut",duration:150,delay:0})],i.prototype,"close",void 0),i}(e.ChildProperty),Ge=function(t){function i(e,i){var o=t.call(this,e,i)||this;return o.isBlazorTooltip=!1,o.contentTargetValue=null,o.contentEvent=null,o.contentAnimation=null,o.mouseMoveEvent=null,o.mouseMoveTarget=null,o}return Ve(i,t),i.prototype.initialize=function(){this.formatPosition(),this.isServerRender()||e.addClass([this.element],"e-tooltip")},i.prototype.isServerRender=function(){return e.isBlazor()&&this.isServerRendered},i.prototype.formatPosition=function(){var t,e;0===this.position.indexOf("Top")||0===this.position.indexOf("Bottom")?(t=this.position.split(/(?=[A-Z])/),this.tooltipPositionY=t[0],this.tooltipPositionX=t[1]):(e=this.position.split(/(?=[A-Z])/),this.tooltipPositionX=e[0],this.tooltipPositionY=e[1])},i.prototype.renderArrow=function(){if(this.setTipClass(this.position),this.isServerRender()){var t=this.tooltipEle.querySelector(".e-arrow-tip");e.addClass([t.querySelector(".e-arrow-tip-outer")],this.tipClass),e.addClass([t.querySelector(".e-arrow-tip-inner")],this.tipClass),this.tooltipEle.appendChild(t)}else(t=this.createElement("div",{className:"e-arrow-tip "+this.tipClass})).appendChild(this.createElement("div",{className:"e-arrow-tip-outer "+this.tipClass})),t.appendChild(this.createElement("div",{className:"e-arrow-tip-inner "+this.tipClass})),this.tooltipEle.appendChild(t)},i.prototype.setTipClass=function(t){0===t.indexOf("Right")?this.tipClass="e-tip-left":0===t.indexOf("Bottom")?this.tipClass="e-tip-top":0===t.indexOf("Left")?this.tipClass="e-tip-right":this.tipClass="e-tip-bottom"},i.prototype.renderPopup=function(t){var e=this.mouseTrail?{top:0,left:0}:this.getTooltipPosition(t);this.tooltipEle.classList.remove("e-lib"),this.popupObj=new ue(this.tooltipEle,{height:this.height,width:this.width,position:{X:e.left,Y:e.top},enableRtl:this.enableRtl,open:this.openPopupHandler.bind(this),close:this.closePopupHandler.bind(this)})},i.prototype.getTooltipPosition=function(t){this.tooltipEle.style.display="block";var e=n(t,this.tooltipPositionX,this.tooltipPositionY),i=this.calculateTooltipOffset(this.position),o=this.collisionFlipFit(t,e.left+i.left,e.top+i.top);return this.tooltipEle.style.display="",o},i.prototype.reposition=function(t){var e=this.getTooltipPosition(t);this.popupObj.position={X:e.left,Y:e.top},this.popupObj.dataBind()},i.prototype.openPopupHandler=function(){!this.mouseTrail&&this.needTemplateReposition()&&this.reposition(this.findTarget()),this.trigger("afterOpen",this.tooltipEventArgs)},i.prototype.closePopupHandler=function(){e.resetBlazorTemplate(this.element.id+"content","Content"),this.clearTemplate(["content"]),this.clear(),this.trigger("afterClose",this.tooltipEventArgs)},i.prototype.calculateTooltipOffset=function(t){var e={top:0,left:0},i=this.tooltipEle.offsetWidth,o=this.tooltipEle.offsetHeight,n=this.tooltipEle.querySelector(".e-arrow-tip"),s=n?n.offsetWidth:0,r=n?n.offsetHeight:0,l=this.showTipPointer?0:8,a=r/2+2+(this.tooltipEle.offsetHeight-this.tooltipEle.clientHeight),h=s/2+2+(this.tooltipEle.offsetWidth-this.tooltipEle.clientWidth);switch(this.mouseTrail&&(l+=2),t){case"RightTop":e.left+=s+l,e.top-=o-a;break;case"RightCenter":e.left+=s+l,e.top-=o/2;break;case"RightBottom":e.left+=s+l,e.top-=a;break;case"BottomRight":e.top+=r+l,e.left-=h;break;case"BottomCenter":e.top+=r+l,e.left-=i/2;break;case"BottomLeft":e.top+=r+l,e.left-=i-h;break;case"LeftBottom":e.left-=s+i+l,e.top-=a;break;case"LeftCenter":e.left-=s+i+l,e.top-=o/2;break;case"LeftTop":e.left-=s+i+l,e.top-=o-a;break;case"TopLeft":e.top-=o+r+l,e.left-=i-h;break;case"TopRight":e.top-=o+r+l,e.left-=h;break;default:e.top-=o+r+l,e.left-=i/2}return e.left+=this.offsetX,e.top+=this.offsetY,e},i.prototype.updateTipPosition=function(t){var i=this.tooltipEle.querySelectorAll(".e-arrow-tip,.e-arrow-tip-outer,.e-arrow-tip-inner"),o=["e-tip-bottom","e-tip-top","e-tip-left","e-tip-right"];e.removeClass(i,o),this.setTipClass(t),e.addClass(i,this.tipClass)},i.prototype.adjustArrow=function(t,e,i,o){if(!1!==this.showTipPointer){this.updateTipPosition(e);var n,s;this.tooltipEle.style.display="block";var r=this.tooltipEle.clientWidth,l=this.tooltipEle.clientHeight,a=this.tooltipEle.querySelector(".e-arrow-tip"),h=this.tooltipEle.querySelector(".e-arrow-tip-inner"),d=a.offsetWidth,p=a.offsetHeight;if(this.tooltipEle.style.display="","e-tip-bottom"===this.tipClass||"e-tip-top"===this.tipClass)"e-tip-bottom"===this.tipClass?(s="99.9%",h.style.top="-"+(p-2)+"px"):(s=-(p-1)+"px",h.style.top="-"+(p-6)+"px"),t&&(n=(c="Center"!==i||r>t.offsetWidth||this.mouseTrail)&&"Left"===i||!c&&"End"===this.tipPointerPosition?r-d-2+"px":c&&"Right"===i||!c&&"Start"===this.tipPointerPosition?"2px":r/2-d/2+"px");else{"e-tip-right"===this.tipClass?(n="99.9%",h.style.left="-"+(d-2)+"px"):(n=-(d-1)+"px",h.style.left=d-2-d+"px");var c="Center"!==o||l>t.offsetHeight||this.mouseTrail;s=c&&"Top"===o||!c&&"End"===this.tipPointerPosition?l-p-2+"px":c&&"Bottom"===o||!c&&"Start"===this.tipPointerPosition?"2px":l/2-p/2+"px"}a.style.top=s,a.style.left=n}},i.prototype.renderContent=function(t){var i=this.tooltipEle.querySelector(".e-tip-content");if(this.cssClass&&e.addClass([this.tooltipEle],this.cssClass.split(" ")),t&&!e.isNullOrUndefined(t.getAttribute("title"))&&(t.setAttribute("data-content",t.getAttribute("title")),t.removeAttribute("title")),e.isNullOrUndefined(this.content))t&&!e.isNullOrUndefined(t.getAttribute("data-content"))&&(i.innerHTML=t.getAttribute("data-content"));else if(this.isBlazorTooltip||!this.isServerRender())if(i.innerHTML="",this.content instanceof HTMLElement)i.appendChild(this.content);else if("string"==typeof this.content&&this.content.indexOf("<div>Blazor")<0)this.enableHtmlSanitizer&&this.setProperties({content:e.SanitizeHtmlHelper.sanitize(this.content)},!0),i[this.enableHtmlParse?"innerHTML":"textContent"]=this.content;else{var o=e.compile(this.content)({},this,"content",this.element.id+"content",void 0,void 0,i);o&&e.append(o,i),this.renderReactTemplates(),"string"==typeof this.content&&this.content.indexOf("<div>Blazor")>=0&&(this.isBlazorTemplate=!0,e.updateBlazorTemplate(this.element.id+"content","Content",this))}},i.prototype.renderCloseIcon=function(){if(this.isSticky){var t=this.createElement("div",{className:"e-icons e-tooltip-close"});this.tooltipEle.appendChild(t),e.EventHandler.add(t,e.Browser.touchStartEvent,this.onStickyClose,this)}},i.prototype.addDescribedBy=function(t,i){var o=(t.getAttribute("aria-describedby")||"").split(/\s+/);o.indexOf(i)<0&&o.push(i),e.attributes(t,{"aria-describedby":o.join(" ").trim(),"data-tooltip-id":i})},i.prototype.removeDescribedBy=function(t){var e=t.getAttribute("data-tooltip-id"),i=(t.getAttribute("aria-describedby")||"").split(/\s+/),o=i.indexOf(e);-1!==o&&i.splice(o,1),t.removeAttribute("data-tooltip-id");var n=i.join(" ").trim();n?t.setAttribute("aria-describedby",n):t.removeAttribute("aria-describedby")},i.prototype.tapHoldHandler=function(t){clearTimeout(this.autoCloseTimer),this.targetHover(t.originalEvent)},i.prototype.touchEndHandler=function(t){var e=this;if(!this.isSticky){var i=function(){e.close()};this.autoCloseTimer=setTimeout(i,1500)}},i.prototype.targetClick=function(t){var i;i=this.target?e.closest(t.target,this.target):this.element,e.isNullOrUndefined(i)||(null===i.getAttribute("data-tooltip-id")?this.targetHover(t):this.isSticky||this.hideTooltip(this.animation.close,t,i))},i.prototype.targetHover=function(t){var i;if(i=this.target?e.closest(t.target,this.target):this.element,!(e.isNullOrUndefined(i)||null!==i.getAttribute("data-tooltip-id")&&0===this.closeDelay)){for(var o=0,n=[].slice.call(document.querySelectorAll("[data-tooltip-id= "+this.ctrlId+"_content]"));o<n.length;o++){var s=n[o];this.restoreElement(s)}this.showTooltip(i,this.animation.open,t)}},i.prototype.mouseMoveBeforeOpen=function(t){this.mouseMoveEvent=t},i.prototype.mouseMoveBeforeRemove=function(){this.mouseMoveTarget&&e.EventHandler.remove(this.mouseMoveTarget,"mousemove touchstart",this.mouseMoveBeforeOpen)},i.prototype.showTooltip=function(t,i,o){var n=this;clearTimeout(this.showTimer),clearTimeout(this.hideTimer),this.openDelay&&this.mouseTrail&&(this.mouseMoveBeforeRemove(),this.mouseMoveTarget=t,e.EventHandler.add(this.mouseMoveTarget,"mousemove touchstart",this.mouseMoveBeforeOpen,this)),this.tooltipEventArgs={type:o?o.type:null,cancel:!1,target:t,event:o||null,element:this.tooltipEle,isInteracted:!e.isNullOrUndefined(o)};var s=function(e){n.beforeRenderCallback(e,t,o,i)};this.trigger("beforeRender",this.tooltipEventArgs,s.bind(this))},i.prototype.beforeRenderCallback=function(t,i,o,n){var s=!1;if(t.cancel)this.isHidden=!0,this.clear(),this.mouseMoveBeforeRemove();else if(this.isHidden=!1,e.isNullOrUndefined(this.tooltipEle)){if(this.isServerRender()){this.contentTargetValue=i,this.contentEvent=o,this.contentAnimation=n;var r={enableTooltip:"true"};this.interopAdaptor.invokeMethodAsync("OnTooltipServerCall",r),s=!0}else this.ctrlId=this.element.getAttribute("id")?e.getUniqueID(this.element.getAttribute("id")):e.getUniqueID("tooltip"),this.tooltipEle=this.createElement("div",{className:"e-tooltip-wrap e-popup e-lib",attrs:{role:"tooltip","aria-hidden":"false",id:this.ctrlId+"_content"},styles:"width:"+e.formatUnit(this.width)+";height:"+e.formatUnit(this.height)+";position:absolute;"}),this.beforeRenderBlazor(i,this);s||this.afterRenderBlazor(i,o,n,this)}else this.isServerRender()&&(e.addClass([this.tooltipEle],"e-popup-open"),document.body.appendChild(this.tooltipEle),this.renderCloseIcon(),this.renderPopup(i)),i&&(this.adjustArrow(i,this.position,this.tooltipPositionX,this.tooltipPositionY),this.addDescribedBy(i,this.ctrlId+"_content"),this.renderContent(i),e.Animation.stop(this.tooltipEle),this.reposition(i),this.afterRenderBlazor(i,o,n,this))},i.prototype.contentUpdated=function(t){e.isNullOrUndefined(this.tooltipEle)&&this.isServerRender()&&(this.ctrlId=this.element.id,this.tooltipEle=document.querySelector("#"+this.ctrlId+"_content"),this.tooltipEle&&(this.tooltipEle.setAttribute("style","width:"+e.formatUnit(this.width)+";height:"+e.formatUnit(this.height)+";position:absolute;"),this.beforeRenderBlazor(this.contentTargetValue,this),this.afterRenderBlazor(this.contentTargetValue,this.contentEvent,this.contentAnimation,this),this.contentTargetValue=this.contentEvent=this.contentAnimation=null))},i.prototype.beforeRenderBlazor=function(t,i){t&&(e.Browser.isDevice&&e.addClass([i.tooltipEle],"e-bigger"),"auto"!==i.width&&(i.tooltipEle.style.maxWidth=e.formatUnit(i.width)),this.isServerRender()||i.tooltipEle.appendChild(i.createElement("div",{className:"e-tip-content"})),document.body.appendChild(i.tooltipEle),e.removeClass([i.tooltipEle],"e-hidden"),i.addDescribedBy(t,i.ctrlId+"_content"),i.renderContent(t),e.addClass([i.tooltipEle],"e-popup-open"),i.showTipPointer&&i.renderArrow(),i.renderCloseIcon(),i.renderPopup(t),i.adjustArrow(t,i.position,i.tooltipPositionX,i.tooltipPositionY),e.Animation.stop(i.tooltipEle),i.reposition(t))},i.prototype.afterRenderBlazor=function(t,i,o,n){if(t){e.removeClass([n.tooltipEle],"e-popup-open"),e.addClass([n.tooltipEle],"e-popup-close"),n.tooltipEventArgs={type:i?i.type:null,cancel:!1,target:t,event:i||null,element:n.tooltipEle,isInteracted:!e.isNullOrUndefined(i)},n.needTemplateReposition()&&!n.mouseTrail&&(n.tooltipEle.style.display="none");var s=function(e){n.beforeOpenCallback(e,t,o,i)};n.trigger("beforeOpen",n.tooltipEventArgs,s.bind(n))}},i.prototype.beforeOpenCallback=function(t,i,o,n){var s=this;if(t.cancel)this.isHidden=!0,this.clear(),this.mouseMoveBeforeRemove(),this.restoreElement(i);else{var r={name:o.effect,duration:o.duration,delay:o.delay,timingFunction:"easeOut"};if("None"===o.effect&&(r=void 0),this.openDelay>0){var l=function(){s.mouseTrail&&e.EventHandler.add(i,"mousemove touchstart mouseenter",s.onMouseMove,s),s.popupObj&&(s.popupObj.show(r,i),s.mouseMoveEvent&&s.mouseTrail&&s.onMouseMove(s.mouseMoveEvent))};this.showTimer=setTimeout(l,this.openDelay)}else this.popupObj&&this.popupObj.show(r,i)}n&&this.wireMouseEvents(n,i)},i.prototype.needTemplateReposition=function(){var t=this;return!e.isNullOrUndefined(t.viewContainerRef)&&"string"!=typeof t.viewContainerRef||this.isServerRender()&&this.isBlazorTemplate},i.prototype.checkCollision=function(t,e,i){var o={left:e,top:i,position:this.position,horizontal:this.tooltipPositionX,vertical:this.tooltipPositionY},n=v(this.tooltipEle,this.checkCollideTarget(),e,i);return n.length>0&&(o.horizontal=n.indexOf("left")>=0?"Right":n.indexOf("right")>=0?"Left":this.tooltipPositionX,o.vertical=n.indexOf("top")>=0?"Bottom":n.indexOf("bottom")>=0?"Top":this.tooltipPositionY),o},i.prototype.collisionFlipFit=function(t,e,i){var o=this.checkCollision(t,e,i),s=o.position;if(this.tooltipPositionY!==o.vertical&&(s=0===this.position.indexOf("Bottom")||0===this.position.indexOf("Top")?o.vertical+this.tooltipPositionX:this.tooltipPositionX+o.vertical),this.tooltipPositionX!==o.horizontal&&(0===s.indexOf("Left")&&(o.vertical="LeftTop"===s||"LeftCenter"===s?"Top":"Bottom",s=o.vertical+"Left"),0===s.indexOf("Right")&&(o.vertical="RightTop"===s||"RightCenter"===s?"Top":"Bottom",s=o.vertical+"Right"),o.horizontal=this.tooltipPositionX),this.tooltipEventArgs={type:null,cancel:!1,target:t,event:null,element:this.tooltipEle,collidedPosition:s},this.trigger("beforeCollision",this.tooltipEventArgs),o.position!==s){var r=n(t,o.horizontal,o.vertical);this.adjustArrow(t,s,o.horizontal,o.vertical);var l=this.calculateTooltipOffset(s);l.top-=-1!=="TopBottom".indexOf(this.position.split(/(?=[A-Z])/)[0])&&-1!=="TopBottom".indexOf(s.split(/(?=[A-Z])/)[0])?2*this.offsetY:0,l.left-=-1!=="RightLeft".indexOf(this.position.split(/(?=[A-Z])/)[0])&&-1!=="RightLeft".indexOf(s.split(/(?=[A-Z])/)[0])?2*this.offsetX:0,o.position=s,o.left=r.left+l.left,o.top=r.top+l.top}else this.adjustArrow(t,s,o.horizontal,o.vertical);var a={left:o.left,top:o.top},h=g(this.tooltipEle,this.checkCollideTarget(),{X:!0,Y:!1},a).left;if(this.tooltipEle.style.display="block",this.showTipPointer&&(0===s.indexOf("Bottom")||0===s.indexOf("Top"))){var d=this.tooltipEle.querySelector(".e-arrow-tip"),p=parseInt(d.style.left,10)-(h-o.left);p<0?p=0:p+d.offsetWidth>this.tooltipEle.clientWidth&&(p=this.tooltipEle.clientWidth-d.offsetWidth),d.style.left=p.toString()+"px"}return this.tooltipEle.style.display="",a.left=h,a},i.prototype.checkCollideTarget=function(){return!this.windowCollision&&this.target?this.element:null},i.prototype.hideTooltip=function(t,e,i){var o=this;if(this.closeDelay>0){clearTimeout(this.hideTimer),clearTimeout(this.showTimer);var n=function(){o.closeDelay&&o.tooltipEle&&o.isTooltipOpen||o.tooltipHide(t,e,i)};this.hideTimer=setTimeout(n,this.closeDelay)}else this.tooltipHide(t,e,i)},i.prototype.tooltipHide=function(t,i,o){var n,s=this;n=i?this.target?o||i.target:this.element:document.querySelector("[data-tooltip-id= "+this.ctrlId+"_content]"),this.tooltipEventArgs={type:i?i.type:null,cancel:!1,target:n,event:i||null,element:this.tooltipEle,isInteracted:!e.isNullOrUndefined(i)},this.trigger("beforeClose",this.tooltipEventArgs,function(e){e.cancel?s.isHidden=!1:s.isServerRender()?s.blazorHide(t,n):(s.mouseMoveBeforeRemove(),s.popupHide(t,n))})},i.prototype.blazorHide=function(t,e){var i=this,o=function(){i.popupHide(t,e)};this.popupObj?this.popupHide(t,e):setTimeout(o,200)},i.prototype.popupHide=function(t,e){e&&this.restoreElement(e),this.isHidden=!0;var i={name:t.effect,duration:t.duration,delay:t.delay,timingFunction:"easeIn"};"None"===t.effect&&(i=void 0),this.popupObj&&this.popupObj.hide(i)},i.prototype.restoreElement=function(t){this.unwireMouseEvents(t),e.isNullOrUndefined(t.getAttribute("data-content"))||(t.setAttribute("title",t.getAttribute("data-content")),t.removeAttribute("data-content")),this.removeDescribedBy(t)},i.prototype.clear=function(){if(this.tooltipEle&&(e.removeClass([this.tooltipEle],"e-popup-close"),e.addClass([this.tooltipEle],"e-popup-open")),this.isHidden){if(this.popupObj&&this.popupObj.destroy(),this.isServerRender()&&this.tooltipEle){this.tooltipEle.style.display="none";var t={enableTooltip:"false"};this.interopAdaptor.invokeMethodAsync("OnTooltipServerCall",t),e.remove(this.tooltipEle)}else this.tooltipEle&&e.remove(this.tooltipEle);this.tooltipEle=null,this.popupObj=null}},i.prototype.tooltipHover=function(t){this.tooltipEle&&(this.isTooltipOpen=!0)},i.prototype.tooltipMouseOut=function(t){this.isTooltipOpen=!1,this.hideTooltip(this.animation.close,t,this.findTarget())},i.prototype.onMouseOut=function(t){var i=t.relatedTarget;if(i&&!this.mouseTrail){var o=e.closest(i,".e-tooltip-wrap.e-lib.e-popup");o?e.EventHandler.add(o,"mouseleave",this.tooltipElementMouseOut,this):(this.hideTooltip(this.animation.close,t,this.findTarget()),0===this.closeDelay&&this.clear())}else this.hideTooltip(this.animation.close,t,this.findTarget()),this.clear()},i.prototype.tooltipElementMouseOut=function(t){this.hideTooltip(this.animation.close,t,this.findTarget()),e.EventHandler.remove(this.element,"mouseleave",this.tooltipElementMouseOut),this.clear()},i.prototype.onStickyClose=function(t){this.close()},i.prototype.onMouseMove=function(t){var i=0,o=0;t.type.indexOf("touch")>-1?(t.preventDefault(),i=t.touches[0].pageX,o=t.touches[0].pageY):(i=t.pageX,o=t.pageY),e.Animation.stop(this.tooltipEle),e.removeClass([this.tooltipEle],"e-popup-close"),e.addClass([this.tooltipEle],"e-popup-open"),this.adjustArrow(t.target,this.position,this.tooltipPositionX,this.tooltipPositionY);var n=this.calculateTooltipOffset(this.position),s=i+n.left+this.offsetX,r=o+n.top+this.offsetY,l=this.checkCollision(t.target,s,r);if(this.tooltipPositionX!==l.horizontal||this.tooltipPositionY!==l.vertical){var a=0===this.position.indexOf("Bottom")||0===this.position.indexOf("Top")?l.vertical+l.horizontal:l.horizontal+l.vertical;l.position=a,this.adjustArrow(t.target,l.position,l.horizontal,l.vertical);var h=this.calculateTooltipOffset(l.position);l.left=i+h.left-this.offsetX,l.top=o+h.top-this.offsetY}this.tooltipEle.style.left=l.left+"px",this.tooltipEle.style.top=l.top+"px"},i.prototype.keyDown=function(t){this.tooltipEle&&27===t.keyCode&&this.close()},i.prototype.touchEnd=function(t){this.tooltipEle&&null===e.closest(t.target,".e-tooltip")&&!this.isSticky&&this.close()},i.prototype.scrollHandler=function(t){this.tooltipEle&&(e.closest(t.target,".e-tooltip-wrap.e-lib.e-popup")||this.close())},i.prototype.render=function(){this.initialize(),this.wireEvents(this.opensOn),this.renderComplete()},i.prototype.preRender=function(){this.tipClass="e-tip-bottom",this.tooltipPositionX="Center",this.tooltipPositionY="Top",this.isHidden=!0},i.prototype.wireEvents=function(t){for(var i=0,o=this.getTriggerList(t);i<o.length;i++){var n=o[i];if("Custom"===n)return;"Focus"===n&&this.wireFocusEvents(),"Click"===n&&e.EventHandler.add(this.element,e.Browser.touchStartEvent,this.targetClick,this),"Hover"===n&&(e.Browser.isDevice?(this.touchModule=new e.Touch(this.element,{tapHoldThreshold:500,tapHold:this.tapHoldHandler.bind(this)}),e.EventHandler.add(this.element,e.Browser.touchEndEvent,this.touchEndHandler,this)):(e.EventHandler.add(this.element,"mouseover",this.targetHover,this),this.isServerRender()&&!this.isSticky&&e.EventHandler.add(this.element,"mouseleave",this.onMouseOut,this)))}e.EventHandler.add(document,"touchend",this.touchEnd,this),e.EventHandler.add(document,"scroll wheel",this.scrollHandler,this),e.EventHandler.add(document,"keydown",this.keyDown,this)},i.prototype.getTriggerList=function(t){return"Auto"===t&&(t=e.Browser.isDevice?"Hover":"Hover Focus"),t.split(" ")},i.prototype.wireFocusEvents=function(){if(e.isNullOrUndefined(this.target))e.EventHandler.add(this.element,"focus",this.targetHover,this);else for(var t=0,i=[].slice.call(this.element.querySelectorAll(this.target));t<i.length;t++){var o=i[t];e.EventHandler.add(o,"focus",this.targetHover,this)}},i.prototype.wireMouseEvents=function(t,i){this.tooltipEle&&(this.isSticky||("focus"===t.type&&e.EventHandler.add(i,"blur",this.onMouseOut,this),"mouseover"===t.type&&(this.isServerRender()||e.EventHandler.add(i,"mouseleave",this.onMouseOut,this)),this.closeDelay&&(e.EventHandler.add(this.tooltipEle,"mouseenter",this.tooltipHover,this),e.EventHandler.add(this.tooltipEle,"mouseleave",this.tooltipMouseOut,this))),this.mouseTrail&&0===this.openDelay&&e.EventHandler.add(i,"mousemove touchstart mouseenter",this.onMouseMove,this))},i.prototype.unwireEvents=function(t){for(var i=0,o=this.getTriggerList(t);i<o.length;i++){var n=o[i];if("Custom"===n)return;"Focus"===n&&this.unwireFocusEvents(),"Click"===n&&e.EventHandler.remove(this.element,e.Browser.touchStartEvent,this.targetClick),"Hover"===n&&(e.Browser.isDevice?(this.touchModule&&this.touchModule.destroy(),e.EventHandler.remove(this.element,e.Browser.touchEndEvent,this.touchEndHandler)):(e.EventHandler.remove(this.element,"mouseover",this.targetHover),this.isServerRender()&&!this.isSticky&&e.EventHandler.remove(this.element,"mouseleave",this.onMouseOut)))}e.EventHandler.remove(document,"touchend",this.touchEnd),e.EventHandler.remove(document,"scroll wheel",this.scrollHandler),e.EventHandler.remove(document,"keydown",this.keyDown)},i.prototype.unwireFocusEvents=function(){if(e.isNullOrUndefined(this.target))e.EventHandler.remove(this.element,"focus",this.targetHover);else for(var t=0,i=[].slice.call(this.element.querySelectorAll(this.target));t<i.length;t++){var o=i[t];e.EventHandler.remove(o,"focus",this.targetHover)}},i.prototype.unwireMouseEvents=function(t){if(!this.isSticky){for(var i=0,o=this.getTriggerList(this.opensOn);i<o.length;i++){var n=o[i];"Focus"===n&&e.EventHandler.remove(t,"blur",this.onMouseOut),"Hover"!==n||e.Browser.isDevice||this.isServerRender()||e.EventHandler.remove(t,"mouseleave",this.onMouseOut)}this.closeDelay&&(e.EventHandler.remove(t,"mouseenter",this.tooltipHover),e.EventHandler.remove(t,"mouseleave",this.tooltipMouseOut))}this.mouseTrail&&e.EventHandler.remove(t,"mousemove touchstart mouseenter",this.onMouseMove)},i.prototype.findTarget=function(){return document.querySelector("[data-tooltip-id= "+this.ctrlId+"_content]")},i.prototype.getModuleName=function(){return"tooltip"},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.onPropertyChanged=function(t,i){for(var o=this.findTarget(),n=0,s=Object.keys(t);n<s.length;n++)switch(s[n]){case"width":this.tooltipEle&&o&&(this.tooltipEle.style.width=this.tooltipEle.style.maxWidth=e.formatUnit(t.width),this.reposition(o));break;case"height":this.tooltipEle&&o&&(this.tooltipEle.style.height=e.formatUnit(t.height),this.reposition(o));break;case"content":if(this.tooltipEle)this.isServerRender()&&(this.isBlazorTooltip=!0),this.renderContent();else if(this.isServerRender()){var r={content:t.content};this.interopAdaptor.invokeMethodAsync("OnTooltipServerCall",r)}break;case"opensOn":this.unwireEvents(i.opensOn),this.wireEvents(t.opensOn);break;case"position":if(this.formatPosition(),this.tooltipEle&&o){var l=this.tooltipEle.querySelector(".e-arrow-tip-inner");l.style.top=l.style.left=null,this.reposition(o)}break;case"tipPointerPosition":this.tooltipEle&&o&&this.reposition(o);break;case"offsetX":if(this.tooltipEle){var a=t.offsetX-i.offsetX;this.tooltipEle.style.left=(parseInt(this.tooltipEle.style.left,10)+a).toString()+"px"}break;case"offsetY":if(this.tooltipEle){var h=t.offsetY-i.offsetY;this.tooltipEle.style.top=(parseInt(this.tooltipEle.style.top,10)+h).toString()+"px"}break;case"cssClass":this.tooltipEle&&(i.cssClass&&e.removeClass([this.tooltipEle],i.cssClass.split(" ")),t.cssClass&&e.addClass([this.tooltipEle],t.cssClass.split(" ")));break;case"enableRtl":this.tooltipEle&&(this.enableRtl?e.addClass([this.tooltipEle],"e-rtl"):e.removeClass([this.tooltipEle],"e-rtl"))}},i.prototype.open=function(t,i){e.isNullOrUndefined(i)&&(i=this.animation.open),e.isNullOrUndefined(t)&&(t=this.element),"none"!==t.style.display&&this.showTooltip(t,i)},i.prototype.close=function(t){t||(t=this.animation.close),this.hideTooltip(t)},i.prototype.refresh=function(t){this.tooltipEle&&this.renderContent(t),this.popupObj&&t&&this.reposition(t)},i.prototype.destroy=function(){if(this.isServerRender()||(t.prototype.destroy.call(this),this.tooltipEle&&e.remove(this.tooltipEle)),this.isServerRender()&&this.tooltipEle){var i=document.querySelector("#"+this.ctrlId+"_content_placeholder");i&&i.appendChild(this.tooltipEle)}this.popupObj&&this.popupObj.destroy(),e.removeClass([this.element],"e-tooltip"),this.unwireEvents(this.opensOn),this.unwireMouseEvents(this.element),this.tooltipEle=null,this.popupObj=null},We([e.Property("auto")],i.prototype,"width",void 0),We([e.Property("auto")],i.prototype,"height",void 0),We([e.Property()],i.prototype,"content",void 0),We([e.Property()],i.prototype,"target",void 0),We([e.Property("TopCenter")],i.prototype,"position",void 0),We([e.Property(0)],i.prototype,"offsetX",void 0),We([e.Property(0)],i.prototype,"offsetY",void 0),We([e.Property(!0)],i.prototype,"showTipPointer",void 0),We([e.Property(!0)],i.prototype,"enableHtmlParse",void 0),We([e.Property(!1)],i.prototype,"windowCollision",void 0),We([e.Property("Auto")],i.prototype,"tipPointerPosition",void 0),We([e.Property("Auto")],i.prototype,"opensOn",void 0),We([e.Property(!1)],i.prototype,"mouseTrail",void 0),We([e.Property(!1)],i.prototype,"isSticky",void 0),We([e.Complex({},Ze)],i.prototype,"animation",void 0),We([e.Property(0)],i.prototype,"openDelay",void 0),We([e.Property(0)],i.prototype,"closeDelay",void 0),We([e.Property()],i.prototype,"cssClass",void 0),We([e.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),We([e.Event()],i.prototype,"beforeRender",void 0),We([e.Event()],i.prototype,"beforeOpen",void 0),We([e.Event()],i.prototype,"afterOpen",void 0),We([e.Event()],i.prototype,"beforeClose",void 0),We([e.Event()],i.prototype,"afterClose",void 0),We([e.Event()],i.prototype,"beforeCollision",void 0),We([e.Event()],i.prototype,"created",void 0),We([e.Event()],i.prototype,"destroyed",void 0),i=We([e.NotifyPropertyChanges],i)}(e.Component),Ke={},Je=30,Qe=30,$e=30,ti=36,ei="e-spin-show",ii="e-spin-hide",oi="e-spin-material",ni="e-spin-fabric",si="e-spin-tailwind",ri="e-spin-bootstrap",li="e-spin-bootstrap4",ai="e-spin-high-contrast",hi="e-spinner-pane",di="e-spinner-inner",pi="e-path-circle",ci="e-path-arc",ui="e-spin-label",fi="e-spin-template",mi=null,gi=null;return t.PositionData=pe,t.Popup=ue,t.getScrollableParent=I,t.getZindexPartial=Y,t.getMaxZindex=X,t.calculateRelativeBasedPosition=o,t.calculatePosition=n,t.fit=g,t.isCollide=v,t.flip=y,t.ButtonProps=ze,t.AnimationSettings=Me,t.Dialog=_e,t.Animation=Ze,t.Tooltip=Ge,t.Spinner=rt,t.createSpinner=lt,t.showSpinner=Dt,t.hideSpinner=qt,t.setSpinner=Ft,t}({},ej.base,ej.buttons),this.ejs=ej;
- /*!
- * filename: ej2-splitbuttons.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.splitbuttons=function(e,t,i,s){"use strict";function n(e,i){for(var s=t.extend({},e),n=0,o=Object.keys(s);n<o.length;n++){var r=o[n];i.indexOf(r)<0&&t.deleteObject(s,r)}return s}function o(e,i){var s=40===i?0:e.childElementCount-1,n=s,o=e.querySelector(".e-selected");o&&o.classList.remove("e-selected");for(var a=0,p=e.children.length;a<p;a++)e.children[a].classList.contains("e-focused")&&(n=a,e.children[a].classList.remove("e-focused"),40===i?n++:n--,n===(40===i?e.childElementCount:-1)&&(n=s));-1!==(n=r(e,e.children[n],n,i))&&(t.addClass([e.children[n]],"e-focused"),e.children[n].focus())}function r(e,t,i,s,n){if(void 0===n&&(n=0),(t.classList.contains("e-separator")||t.classList.contains("e-disabled"))&&(i===(40===s?e.childElementCount-1:0)?i=40===s?0:e.childElementCount-1:40===s?i++:i--),(t=e.children[i]).classList.contains("e-separator")||t.classList.contains("e-disabled")){if(++n===e.childElementCount)return i=-1;i=r(e,t,i,s,n)}return i}function a(e){var t=[].slice.call(e.getElementsByClassName("e-blank-icon"));if(t.length){var i=e.querySelector(".e-item:not(.e-blank-icon):not(.e-separator)");i.classList.contains("e-url")&&(i=i.querySelector(".e-menu-url"));var s,n=i.querySelector(".e-menu-icon"),o=e.classList.contains("e-rtl");s=o?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"};var r=parseInt(getComputedStyle(n).fontSize,10)+parseInt(getComputedStyle(n)[s.margin],10)+parseInt(getComputedStyle(i).paddingLeft,10)+"px";t.forEach(function(e){e.classList.contains("e-url")?e.querySelector(".e-menu-url").style[s.padding]=r:e.style[s.padding]=r})}}function p(e,s,n){void 0===s&&(s={});var o,r,a,p;t.isNullOrUndefined(n)&&(n=t.createElement);var l=document.querySelector(e);t.addClass([l],["e-btn-group","e-css"]),l.setAttribute("role","group");var c=l.children;s.buttons=s.buttons||[];for(var h=0,d=0;d<c.length;h++,d++)o=c[d],null!==(p=s.buttons[h])&&("BUTTON"===o.tagName?r=o:(r=n("label"),(a=c[d+1])?l.insertBefore(r,a):l.appendChild(r),o.id&&r.setAttribute("for",o.id),p&&p.disabled&&(o.disabled=!0),d++),s.cssClass&&p&&!p.cssClass&&(p.cssClass=s.cssClass),new i.Button(p||{},r));return l}var l=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),c=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},h=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return l(i,e),c([t.Property("")],i.prototype,"iconCss",void 0),c([t.Property("")],i.prototype,"id",void 0),c([t.Property(!1)],i.prototype,"separator",void 0),c([t.Property("")],i.prototype,"text",void 0),c([t.Property("")],i.prototype,"url",void 0),c([t.Property(!1)],i.prototype,"disabled",void 0),i}(t.ChildProperty),d=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),u=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},m={DISABLED:"e-disabled",FOCUS:"e-focused",ICON:"e-menu-icon",ITEM:"e-item",POPUP:"e-dropdown-popup",RTL:"e-rtl",SEPARATOR:"e-separator",VERTICAL:"e-vertical"},y=function(e){function r(t,i){var s=e.call(this,t,i)||this;return s.isPopupCreated=!0,s}return d(r,e),r.prototype.preRender=function(){},r.prototype.getPersistData=function(){return this.addOnPersist([])},r.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.closePopup()},r.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},r.prototype.addItems=function(e,t){for(var i,s=this.items.length,n=0,o=this.items.length;n<o;n++)if(t===this.items[n].text){s=n;break}for(var r=e.length-1;r>=0;r--)i=new h(this,"items",e[r],!0),this.items.splice(s,0,i);this.canOpen()||this.createItems()},r.prototype.removeItems=function(e,t){for(var i=!1,s=0,n=e.length;s<n;s++)for(var o=0,r=this.items.length;o<r;o++)if(e[s]===(t?this.items[o].id:this.items[o].text)){this.items.splice(o,1),i=!0;break}i&&this.getULElement()&&this.createItems()},r.prototype.createPopup=function(){var e,i=this.createElement("div",{className:m.POPUP,id:this.element.id+"-popup"});document.body.appendChild(i),this.dropDown=new s.Popup(i,{relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),t.attributes(this.element,(e={},e["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e["aria-owns"]=this.getPopUpElement().id,e.type="button",e["aria-label"]=this.element.textContent+" dropdownbutton",e)),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),this.isPopupCreated=!0},r.prototype.getTargetElement=function(){return"string"==typeof this.target?t.select(this.target):this.target},r.prototype.createItems=function(e){var i,s,n,o,r=this.items,p=this.hasIcon(this.items,"iconCss"),l=this.getULElement();l?l.innerHTML="":l=this.createElement("ul",{attrs:{role:"menu",tabindex:"0"}});for(var c=0;c<r.length;c++){s=r[c];var h=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(s.text):s.text;n=this.createElement("li",{innerHTML:s.url?"":h,className:s.separator?m.ITEM+" "+m.SEPARATOR:m.ITEM,attrs:{role:"menuItem",tabindex:"-1"},id:s.id?s.id:t.getUniqueID("e-"+this.getModuleName()+"-item")}),s.url&&(n.appendChild(this.createAnchor(s)),n.classList.add("e-url")),s.iconCss?(i=this.createElement("span",{className:m.ICON+" "+s.iconCss}),s.url?n.childNodes[0].appendChild(i):n.insertBefore(i,n.childNodes[0])):p&&!s.separator&&n.classList.add("e-blank-icon"),s.disabled&&n.classList.add("e-disabled"),o={item:s,element:n},this.trigger("beforeItemRender",o),l.appendChild(n)}e&&this.getPopUpElement().appendChild(l),p&&a(this.getPopUpElement())},r.prototype.hasIcon=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][t])return!0;return!1},r.prototype.createAnchor=function(e){var i=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:i,attrs:{href:e.url}})},r.prototype.initialize=function(){this.button=new i.Button({iconCss:this.iconCss,iconPosition:this.iconPosition,cssClass:this.cssClass,content:this.content,disabled:this.disabled,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence}),this.button.createElement=this.createElement,this.button.appendTo(this.element),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.appendArrowSpan(),this.setActiveElem([this.element]),this.target||!this.createPopupOnClick?this.createPopup():this.isPopupCreated=!1},r.prototype.appendArrowSpan=function(){this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(this.cssClass.indexOf(m.VERTICAL)>-1?"bottom":"right")+" e-caret"}))},r.prototype.setActiveElem=function(e){this.activeElem=e},r.prototype.getModuleName=function(){return"dropdown-btn"},r.prototype.canOpen=function(){var e=!1;return this.isPopupCreated&&(e=this.getPopUpElement().classList.contains("e-popup-close")),e},r.prototype.destroy=function(){var i=this;if(e.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName()){var s;this.element.querySelector("span.e-caret")&&t.detach(this.element.querySelector("span.e-caret")),this.cssClass&&(s=this.cssClass.split(" ")),this.button.destroy(),s&&t.removeClass([this.element],s),t.removeClass(this.activeElem,["e-active"]),(this.element.getAttribute("class")?["aria-haspopup","aria-expanded","aria-owns","type"]:["aria-haspopup","aria-expanded","aria-owns","type","class"]).forEach(function(e){i.element.removeAttribute(e)}),this.destroyPopup(),this.isPopupCreated=!1,this.disabled||this.unWireEvents()}},r.prototype.destroyPopup=function(){if(this.isPopupCreated){if(this.dropDown.destroy(),this.getPopUpElement()){var e=document.getElementById(this.getPopUpElement().id);e&&(t.removeClass([e],["e-popup-open","e-popup-close"]),t.detach(e))}t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.isPopupCreated&&(this.dropDown=void 0)}this.isPopupCreated=!1},r.prototype.getPopUpElement=function(){var e=null;return this.dropDown&&(e=this.dropDown.element),e},r.prototype.getULElement=function(){var e=null;return this.getPopUpElement()&&(e=this.getPopUpElement().children[0]),e},r.prototype.wireEvents=function(){this.delegateMousedownHandler=this.mousedownHandler.bind(this),t.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this)},r.prototype.popupWireEvents=function(){var e=this.getPopUpElement();t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.rippleFn=t.rippleEffect(e,{selector:"."+m.ITEM})},r.prototype.keyBoardHandler=function(e){if(e.target!==this.element||9!==e.keyCode&&(e.altKey||40!==e.keyCode)&&38!==e.keyCode)switch(e.keyCode){case 38:case 40:!e.altKey||38!==e.keyCode&&40!==e.keyCode?this.upDownKeyHandler(e):this.keyEventHandler(e);break;case 9:case 13:case 27:case 32:this.keyEventHandler(e)}},r.prototype.upDownKeyHandler=function(e){(!this.target||38!==e.keyCode&&40!==e.keyCode)&&(e.preventDefault(),o(this.getULElement(),e.keyCode))},r.prototype.keyEventHandler=function(e){(!this.target||13!==e.keyCode&&9!==e.keyCode)&&(9!==e.keyCode&&e.preventDefault(),27===e.keyCode||38===e.keyCode||9===e.keyCode?this.canOpen()||this.closePopup(e,this.element):this.clickHandler(e))},r.prototype.getLI=function(e){return"LI"===e.tagName?e:t.closest(e,"li")},r.prototype.mousedownHandler=function(e){var i=e.target;!this.dropDown||this.canOpen()||t.closest(i,'[id="'+this.getPopUpElement().id+'"]')||t.closest(i,'[id="'+this.element.id+'"]')||this.closePopup(e)},r.prototype.clickHandler=function(e){var i=e.target;if(t.closest(i,'[id="'+this.element.id+'"]'))!this.createPopupOnClick||this.target?this.getPopUpElement().classList.contains("e-popup-close")?this.openPopUp(e):this.closePopup(e):this.isPopupCreated?this.closePopup(e,this.activeElem[0]):(this.createPopup(),this.openPopUp(e));else if(t.closest(i,'[id="'+this.getPopUpElement().id+'"]')){var s=void 0,n=void 0,o=void 0,r=this.getLI(i);r&&(n=Array.prototype.indexOf.call(this.getULElement().children,r),(o=this.items[n])&&(s={element:r,item:o},this.trigger("select",s)),this.closePopup(e,this.activeElem[0]))}},r.prototype.openPopUp=function(e){var i=this;void 0===e&&(e=null),this.target||this.createItems(!0);var s=this.getULElement();this.popupWireEvents();var n={element:s,items:this.items,event:e,cancel:!1};this.trigger("beforeOpen",n,function(e){if(!e.cancel){var s=i.getULElement();i.dropDown.show(null,i.element),t.addClass([i.element],"e-active"),i.element.setAttribute("aria-expanded","true"),s.focus();var n={element:s,items:i.items};i.trigger("open",n)}})},r.prototype.closePopup=function(e,i){var s=this;void 0===e&&(e=null);var n={element:this.getULElement(),items:this.items,event:e,cancel:!1};this.trigger("beforeClose",n,function(e){if(!e.cancel){var n=s.getULElement(),o=n.querySelector(".e-selected");o&&o.classList.remove("e-selected"),s.dropDown.hide(),t.removeClass(s.activeElem,"e-active"),s.element.setAttribute("aria-expanded","false"),i&&i.focus();var r={element:n,items:s.items};s.trigger("close",r),!s.target&&n&&t.detach(n),s.target||s.createPopupOnClick&&s.destroyPopup(),s.target&&(s.isPopupCreated=!s.createPopupOnClick)}})},r.prototype.unWireEvents=function(){t.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),this.isPopupCreated&&(t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler))},r.prototype.onPropertyChanged=function(e,i){var s=["content","cssClass","iconCss","iconPosition","disabled","enableRtl"];this.button.setProperties(n(e,s));var o;this.isPopupCreated&&(o=this.getPopUpElement(),this.dropDown.setProperties(n(e,["enableRtl"])));for(var r=0,a=Object.keys(e);r<a.length;r++)switch(a[r]){case"content":this.element.querySelector("span.e-caret")||this.appendArrowSpan();break;case"disabled":e.disabled?(this.unWireEvents(),this.isPopupCreated&&!this.canOpen()&&this.closePopup()):this.wireEvents();break;case"cssClass":if(e.cssClass.indexOf(m.VERTICAL)>-1){var p=this.element.querySelector("span.e-caret");t.classList(p,["e-icon-bottom"],["e-icon-right"])}this.isPopupCreated&&(i.cssClass&&t.removeClass([o],i.cssClass.split(" ")),e.cssClass&&t.addClass([o],e.cssClass.split(" ")));break;case"target":this.dropDown.content=this.getTargetElement(),this.dropDown.dataBind();break;case"items":this.isPopupCreated&&this.getULElement()&&this.createItems();break;case"createPopupOnClick":e.createPopupOnClick?this.destroyPopup():this.createPopup()}},r.prototype.focusIn=function(){this.element.focus()},u([t.Property("")],r.prototype,"content",void 0),u([t.Property("")],r.prototype,"cssClass",void 0),u([t.Property(!1)],r.prototype,"disabled",void 0),u([t.Property("")],r.prototype,"iconCss",void 0),u([t.Property("Left")],r.prototype,"iconPosition",void 0),u([t.Property(!1)],r.prototype,"enableHtmlSanitizer",void 0),u([t.Collection([],h)],r.prototype,"items",void 0),u([t.Property(!1)],r.prototype,"createPopupOnClick",void 0),u([t.Property("")],r.prototype,"target",void 0),u([t.Event()],r.prototype,"beforeItemRender",void 0),u([t.Event()],r.prototype,"beforeOpen",void 0),u([t.Event()],r.prototype,"beforeClose",void 0),u([t.Event()],r.prototype,"close",void 0),u([t.Event()],r.prototype,"open",void 0),u([t.Event()],r.prototype,"select",void 0),u([t.Event()],r.prototype,"created",void 0),r=u([t.NotifyPropertyChanges],r)}(t.Component),f=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),v=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},g="e-rtl",b="EJS-SPLITBUTTON",C=function(e){function s(t,i){return e.call(this,t,i)||this}return f(s,e),s.prototype.preRender=function(){var e=this.element;if(e.tagName===b){for(var i=t.getValue("ej2_instances",e),s=this.createElement("button",{attrs:{type:"button"}}),n=this.createElement(b,{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,r=e.attributes.length;o<r;o++)s.setAttribute(e.attributes[o].nodeName,e.attributes[o].nodeValue);e.parentNode.insertBefore(n,e),t.detach(e),e=s,n.appendChild(e),t.setValue("ej2_instances",i,e),this.wrapper=n,this.element=e}this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},s.prototype.render=function(){this.initWrapper(),this.createPrimaryButton(),this.renderControl()},s.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},s.prototype.addItems=function(t,i){e.prototype.addItems.call(this,t,i),this.secondaryBtnObj.items=this.items},s.prototype.removeItems=function(t,i){e.prototype.removeItems.call(this,t,i),this.secondaryBtnObj.items=this.items},s.prototype.initWrapper=function(){this.wrapper||(this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.element.parentNode.insertBefore(this.wrapper,this.element)),this.element.classList.remove("e-"+this.getModuleName()),this.enableRtl&&this.wrapper.classList.add(g),this.cssClass&&t.addClass([this.wrapper],this.cssClass.split(" "))},s.prototype.createPrimaryButton=function(){var e={cssClass:this.cssClass,enableRtl:this.enableRtl,iconCss:this.iconCss,iconPosition:this.iconPosition,content:this.content,disabled:this.disabled};this.primaryBtnObj=new i.Button(e),this.primaryBtnObj.createElement=this.createElement,this.primaryBtnObj.appendTo(this.element),this.element.classList.add("e-"+this.getModuleName()),this.element.type="button",this.wrapper.appendChild(this.element)},s.prototype.createSecondaryButton=function(){var e=this,t=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"});this.wrapper.appendChild(t);var i={cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target,createPopupOnClick:this.createPopupOnClick};i.beforeItemRender=function(t){e.createPopupOnClick&&(e.secondaryBtnObj.dropDown.relateTo=e.wrapper,e.dropDown=e.secondaryBtnObj.dropDown),e.trigger("beforeItemRender",t)},i.open=function(t){e.trigger("open",t)},i.close=function(t){e.trigger("close",t)},i.select=function(t){e.trigger("select",t)},i.beforeOpen=function(t){var i=new P;return e.trigger("beforeOpen",t,function(e){i.resolve(e)}),i},i.beforeClose=function(t){var i=new P;return e.trigger("beforeClose",t,function(e){i.resolve(e)}),i},this.secondaryBtnObj=new y(i),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(t),this.createPopupOnClick||(this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown),this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right")},s.prototype.setAria=function(){t.attributes(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent+" splitbutton","aria-owns":this.element.id+"_dropdownbtn-popup"})},s.prototype.getModuleName=function(){return"split-btn"},s.prototype.toggle=function(){this.secondaryBtnObj.toggle()},s.prototype.destroy=function(){var i=this,s=[g];if(this.cssClass&&(s=s.concat(this.cssClass.split(" "))),this.element){var n=document.getElementById(this.element.id);n&&n.parentElement===this.wrapper&&(this.wrapper.tagName===b?(this.wrapper.innerHTML="",t.removeClass([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),t.removeClass([this.wrapper],this.cssClass.split(" "))):(t.removeClass([this.element],s),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach(function(e){i.element.removeAttribute(e)}),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),t.remove(this.wrapper)),this.unWireEvents())}this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),e.prototype.destroy.call(this),this.element.getAttribute("class")||this.element.removeAttribute("class")},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),new t.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow"}})},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),t.getInstance(this.element,t.KeyboardEvents).destroy()},s.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},s.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e)}},s.prototype.onPropertyChanged=function(e,i){var s=["content","iconCss","iconPosition","cssClass","disabled","enableRtl"];this.primaryBtnObj.setProperties(n(e,s)),s=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl","createPopupOnClick"],Object.keys(e).indexOf("items")>-1&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(n(e,s));for(var o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"cssClass":i.cssClass&&t.removeClass([this.wrapper],i.cssClass.split(" ")),t.addClass([this.wrapper],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?t.addClass([this.wrapper],g):t.removeClass([this.wrapper],g)}},s.prototype.focusIn=function(){this.element.focus()},v([t.Property("")],s.prototype,"content",void 0),v([t.Property("")],s.prototype,"cssClass",void 0),v([t.Property(!1)],s.prototype,"disabled",void 0),v([t.Property("")],s.prototype,"iconCss",void 0),v([t.Property("Left")],s.prototype,"iconPosition",void 0),v([t.Property(!1)],s.prototype,"createPopupOnClick",void 0),v([t.Collection([],h)],s.prototype,"items",void 0),v([t.Property("")],s.prototype,"target",void 0),v([t.Event()],s.prototype,"beforeItemRender",void 0),v([t.Event()],s.prototype,"beforeOpen",void 0),v([t.Event()],s.prototype,"beforeClose",void 0),v([t.Event()],s.prototype,"click",void 0),v([t.Event()],s.prototype,"close",void 0),v([t.Event()],s.prototype,"open",void 0),v([t.Event()],s.prototype,"select",void 0),v([t.Event()],s.prototype,"created",void 0),s=v([t.NotifyPropertyChanges],s)}(y),P=function(){function e(){var e=this;this.promise=new Promise(function(t,i){e.resolve=t,e.reject=i}),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)}return e}(),E=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),w=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},O="e-btn-content",k=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return E(i,e),w([t.Property(null)],i.prototype,"template",void 0),w([t.Property(16)],i.prototype,"width",void 0),w([t.Property("Left")],i.prototype,"position",void 0),i}(t.ChildProperty),S=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return E(i,e),w([t.Property(400)],i.prototype,"duration",void 0),w([t.Property("None")],i.prototype,"effect",void 0),w([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),L=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.step=1,s}return E(i,e),i.prototype.preRender=function(){e.prototype.preRender.call(this)},i.prototype.render=function(){t.isBlazor()&&(this.isServerRendered=!1),e.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},i.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},i.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},i.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},i.prototype.getModuleName=function(){return"progress-btn"},i.prototype.destroy=function(){var i=this,s=["e-hide-spinner","e-progress-active","e-round-corner","e-"+e.prototype.getModuleName.call(this),"e-spin-"+this.spinSettings.position.toLowerCase()];e.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(s=s.concat(this.cssClass.split(" "))),t.removeClass([this.element],s),(this.element.getAttribute("class")?["aria-label","aria-valuemin","aria-valuemax","aria-valuenow"]:["aria-label","aria-valuemin","aria-valuemax","aria-valuenow","class"]).forEach(function(e){i.element.removeAttribute(e)}),this.disabled&&this.element.removeAttribute("disabled")},i.prototype.init=function(){this.element.classList.add("e-"+e.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},i.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),s.createSpinner({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},i.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},i.prototype.getProgress=function(){return this.element.getElementsByClassName("e-progress")[0]},i.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(O)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},i.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:"e-progress"}))},i.prototype.setContent=function(){var e;t.isBlazor()?(e=this.content,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.content)),this.setContentIcon(e)):(e=this.element.innerHTML,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:O,innerHTML:e})))},i.prototype.setContentIcon=function(e){var t=this.createElement("span",{className:O,innerHTML:e});if(this.iconCss){var i=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(i.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add("e-icon-btn");var s=t.childNodes[0];!s||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?t.appendChild(i):t.insertBefore(i,s)}this.element.appendChild(t)},i.prototype.clickHandler=function(){this.element.classList.contains("e-progress-active")||this.startProgress()},i.prototype.startProgress=function(e,t){var i=this.element.classList,n=i.contains("e-vertical");i.add("e-progress-active"),i.contains("e-hide-spinner")||s.showSpinner(this.element),this.startAnimate(Date.now(),t||0,t?Date.now()-1*this.duration/100:Date.now(),e||0,0,this.step,0,n),this.startContAnimate()},i.prototype.startAnimate=function(e,t,i,s,n,o,r,a){var p=this;try{var l=e-i,c=this.duration*o/100,h=l?l<c?l-c:l%c:0;this.progressTime=t=t+l-h,i=e-h,s+=(l-h)/this.duration*100;var d={percent:n=(t-r)%c==0||100===s?s:n,currentDuration:t,step:o};this.eIsVertical=a,0===s?this.trigger("begin",d,function(e){p.successCallback(e,s,n,t,r,h,i)}):100===s||t===this.duration?this.trigger("end",d,function(e){p.successCallback(e,s,n,t,r,h,i)}):this.trigger("progress",d,function(e){p.successCallback(e,s,n,t,r,h,i)})}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},i.prototype.successCallback=function(e,t,i,s,n,o,r){var a=this,p=t,l=i,c=o,h=s,d=n,u=r,m=this.eIsVertical;p!==e.percent&&e.percent!==l&&(p=e.percent),this.percent=p,this.step=e.step,(h-d)%(this.duration*e.step/100)!=0&&100!==p||(this.timerId=requestAnimationFrame(function(){a.enableProgress&&(a.getProgress().style[m?"height":"width"]=p+"%"),a.element.setAttribute("aria-valuenow",p.toString())}),l=p,d=h),this.isPaused||(h<this.duration&&p<100?this.interval=window.setTimeout(function(){a.startAnimate(Date.now(),h,u,p,l,e.step,d,m)},this.duration/100-c):this.interval=window.setTimeout(function(){a.progressTime=a.percent=0,a.enableProgress&&(a.getProgress().style[m?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()},100))},i.prototype.startContAnimate=function(){var e=this,i=this.element.getElementsByClassName(O)[0];"None"!==this.animationSettings.effect?new t.Animation({}).animate(i,{duration:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){i.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},i.prototype.finishProgress=function(){var e=this.element.classList,t=e.contains("e-vertical");e.add("e-progress-active");for(var i=this.percent;i<100;i++)(i+=10)>100&&(i=100),this.enableProgress&&(this.getProgress().style[t?"height":"width"]=this.percent<100?i+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin();var s={step:this.step,currentDuration:this.progressTime,percent:100};clearTimeout(this.interval),this.trigger("end",s),this.progressTime=this.percent=0},i.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(O)[0],t=this.getSpinner();t.style.width=Math.max(t.offsetWidth,e.offsetWidth)+"px",t.style.height=Math.max(t.offsetHeight,e.offsetHeight)+"px",e.classList.add("e-cont-animate")},i.prototype.hideSpin=function(){var e=this.element.getElementsByClassName(O)[0];if(this.element.classList.contains("e-hide-spinner")||s.hideSpinner(this.element),this.element.classList.remove("e-progress-active"),"None"!==this.animationSettings.effect&&e.classList.remove("e-animate-end"),"Center"===this.spinSettings.position){var t=this.getSpinner();e.classList.remove("e-cont-animate"),t.style.width="auto",t.style.height="auto"}},i.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(O)[0],t=this.element.getElementsByClassName("e-btn-icon")[0];!e.childNodes[0]||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?e.appendChild(t):e.insertBefore(t,e.childNodes[0])},i.prototype.setAria=function(){t.attributes(this.element,{"aria-label":this.element.textContent+" progress","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":"0"})},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler)},i.prototype.onPropertyChanged=function(i,n){var o=this.element,r=!1;this.element.querySelector(".e-spinner-pane").classList.contains("e-spin-show")&&(r=!0),e.prototype.onPropertyChanged.call(this,i,n);for(var a=0,p=Object.keys(i);a<p.length;a++)switch(p[a]){case"content":if(t.isBlazor()){var l=this.element.querySelector(".e-btn-content");this.iconCss?"Left"===this.iconPosition||"Top"===this.iconPosition?l.childNodes[1].textContent=this.content:l.childNodes[0].textContent=this.content:l.textContent=this.content}else this.setContent(),this.createSpinner(),r&&(s.showSpinner(this.element),r=!1),this.enableProgress&&this.createProgress();o.setAttribute("aria-label",o.textContent+" progress");break;case"iconCss":n.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":i.enableProgress?this.createProgress():t.remove(this.getProgress());break;case"spinSettings":i.spinSettings.position&&(o.classList.remove("e-spin-"+n.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(i.spinSettings.template||i.spinSettings.width)&&(o.removeChild(this.getSpinner()),this.createSpinner())}},i.prototype.focusIn=function(){this.element.focus()},w([t.Property(!1)],i.prototype,"enableProgress",void 0),w([t.Property(2e3)],i.prototype,"duration",void 0),w([t.Property("Left")],i.prototype,"iconPosition",void 0),w([t.Property("")],i.prototype,"iconCss",void 0),w([t.Property(!1)],i.prototype,"disabled",void 0),w([t.Property(!1)],i.prototype,"isPrimary",void 0),w([t.Property("")],i.prototype,"cssClass",void 0),w([t.Property("")],i.prototype,"content",void 0),w([t.Property(!1)],i.prototype,"isToggle",void 0),w([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),w([t.Complex({},k)],i.prototype,"spinSettings",void 0),w([t.Complex({},S)],i.prototype,"animationSettings",void 0),w([t.Event()],i.prototype,"created",void 0),w([t.Event()],i.prototype,"begin",void 0),w([t.Event()],i.prototype,"progress",void 0),w([t.Event()],i.prototype,"end",void 0),w([t.Event()],i.prototype,"fail",void 0),i=w([t.NotifyPropertyChanges],i)}(i.Button);return e.getModel=n,e.upDownKeyHandler=o,e.setBlankIconStyle=a,e.Item=h,e.DropDownButton=y,e.SplitButton=C,e.Deferred=P,e.createButtonGroup=p,e.SpinSettings=k,e.AnimationSettings=S,e.ProgressButton=L,e}({},ej.base,ej.buttons,ej.popups),this.ejs=ej;
- /*!
- * filename: ej2-inputs.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.inputs=function(e,t,i,s){"use strict";function n(){if(t.attributes(this.element,{role:"textbox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive","aria-valuenow":""}),this.mask){for(var e=this.mask.split("]"),i=0;i<e.length;i++)if("\\"===e[i][e[i].length-1]){e[i]=e[i]+"]";for(var s=e[i].split("["),n=0;n<s.length;n++)"\\"===s[n][s[n].length-1]&&(s[n]=s[n]+"["),m.call(this,s[n])}else if((s=e[i].split("[")).length>1)for(var a=!1,n=0;n<s.length;n++)"\\"===s[n]?(this.customRegExpCollec.push("["),this.hiddenMask+=s[n]+"["):""===s[n]?a=!0:""!==s[n]&&a||n===s.length-1?(this.customRegExpCollec.push("["+s[n]+"]"),this.hiddenMask+=this.promptChar,a=!1):m.call(this,s[n]);else m.call(this,s[0]);if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!t.isNullOrUndefined(this.customCharacters))for(i=0;i<this.promptMask.length;i++)t.isNullOrUndefined(this.customCharacters[this.promptMask[i]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[i],"g"),this.promptChar));var r=0;if(this.hiddenMask.match(new RegExp(/\\/)))for(i=0;i<this.hiddenMask.length;i++){n=0;i>=1&&(n=i),n-=r=this.hiddenMask.length-this.promptMask.length,i>0&&"\\"!==this.hiddenMask[i-1]&&(">"===this.hiddenMask[i]||"<"===this.hiddenMask[i]||"|"===this.hiddenMask[i])&&(this.promptMask=this.promptMask.substring(0,n)+this.promptMask.substring(i+1-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(i+1-r,this.escapeMaskValue.length)),"\\"===this.hiddenMask[i]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[i+1]+this.promptMask.substring(i+2-r,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[i+1]+this.escapeMaskValue.substring(i+2-r,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");t.attributes(this.element,{"aria-invalid":"false"})}}function a(){I.call(this,this.promptMask),D.call(this,this.value)}function r(){t.EventHandler.add(this.element,"keydown",k,this),t.EventHandler.add(this.element,"keypress",L,this),t.EventHandler.add(this.element,"keyup",A,this),t.EventHandler.add(this.element,"input",T,this),t.EventHandler.add(this.element,"focus",g,this),t.EventHandler.add(this.element,"blur",b,this),t.EventHandler.add(this.element,"paste",E,this),t.EventHandler.add(this.element,"cut",C,this),t.EventHandler.add(this.element,"drop",S,this),t.EventHandler.add(this.element,"mousedown",v,this),t.EventHandler.add(this.element,"mouseup",f,this),this.enabled&&(o.call(this),this.formElement&&t.EventHandler.add(this.formElement,"reset",u,this))}function l(){t.EventHandler.remove(this.element,"keydown",k),t.EventHandler.remove(this.element,"keypress",L),t.EventHandler.remove(this.element,"keyup",A),t.EventHandler.remove(this.element,"input",T),t.EventHandler.remove(this.element,"focus",g),t.EventHandler.remove(this.element,"blur",b),t.EventHandler.remove(this.element,"paste",E),t.EventHandler.remove(this.element,"cut",C),t.EventHandler.remove(this.element,"mousedown",v),t.EventHandler.remove(this.element,"mouseup",f),this.formElement&&t.EventHandler.remove(this.formElement,"reset",u)}function o(){this.showClearButton&&t.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",h,this)}function h(e){e.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")||(d.call(this,e),this.value="")}function d(e){var t=this.element.value;I.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),B.call(this,e,t),this.element.setSelectionRange(0,0)}function u(){"EJS-MASKEDTEXTBOX"===this.element.tagName?I.call(this,this.promptMask):this.value=this.initInputValue}function c(e){return e.value}function p(e,i){var s="",n=0,a=!1,r=t.isNullOrUndefined(i)?t.isNullOrUndefined(e)||t.isNullOrUndefined(this)?i:e.value:i;if(r!==this.promptMask)for(var l=0;l<this.customRegExpCollec.length;l++)a&&(a=!1),">"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--l,a=!0),a||r[l]!==this.promptChar&&!t.isNullOrUndefined(this.customRegExpCollec[n])&&(this._callPasteHandler||!t.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[n]])||this.customRegExpCollec[n].length>2&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!t.isNullOrUndefined(this.customCharacters)&&!t.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[n]]))&&""!==r&&(s+=r[l]),++n;return(null===this.mask||""===this.mask&&void 0!==this.value)&&(s=r),s}function m(e){for(var t=0;t<e.length;t++)this.hiddenMask+=e[t],"\\"!==e[t]&&this.customRegExpCollec.push(e[t])}function v(){this.isClicked=!0}function f(){this.isClicked=!1}function g(e){var i=this,s=this.element,n=0,a=p.call(this,s),r=!1,l=!1,o={selectionStart:s.selectionStart,event:e,value:this.value,maskedValue:s.value,container:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||y.call(this,o,s),this.mask&&(null!==a&&""!==a||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===i.promptMask.length||s.value[s.selectionStart]===i.promptChar)r=!0;else for(var e=s.selectionStart;e<i.promptMask.length;e++){if(s.value[e]===i.promptChar){r=!0;break}if(s.value[e]!==i.promptMask[e]){r=!1;break}}}),setTimeout(function(){var e=s.selectionStart-1;if(e===i.promptMask.length-1||s.value[e]===i.promptChar)l=!0;else for(var t=e;t>=0;t--){if(s.value[t]===i.promptChar){l=!0;break}if(s.value[t]!==i.promptMask[t]){l=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===a||""===a)&&null!==this.placeholder&&""!==this.placeholder)){for(n=0;n<this.promptMask.length;n++)if(s.value[n]===this.promptChar){setTimeout(function(){(r||l)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:e,value:i.value,maskedValue:s.value,container:i.inputObj.container,selectionEnd:s.selectionEnd},y.call(i,o,s)});break}t.isNullOrUndefined(s.value.match(this.promptChar))&&(o={selectionStart:s.selectionStart,event:e,value:this.value,maskedValue:s.value,container:this.inputObj.container,selectionEnd:s.selectionEnd},y.call(this,o,s)),this.isClicked=!1}}function y(e,t){this.trigger("focus",e,function(e){t.selectionStart=e.selectionStart,t.selectionEnd=e.selectionEnd})}function b(e){if(this.blurEventArgs={event:e,value:this.value,maskedValue:this.element.value,container:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.mask&&(this.isFocus=!1,this.placeholder&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType)){I.call(this,"");var i=this.element.parentNode.querySelector(".e-float-text");"Auto"===this.floatLabelType&&!t.isNullOrUndefined(i)&&i.classList.contains(ne)&&t.removeClass([i],ne)}}function E(e){var t=this;if(this.mask&&!this.readonly){var i=this.element.selectionStart,s=this.element.selectionEnd,n=this.element.value;I.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var a=t.element.value.replace(/ /g,"");t.redoCollec.length>0&&t.redoCollec[0].value===t.element.value&&(a=p.call(t,t.element)),I.call(t,n),t.element.selectionStart=i,t.element.selectionEnd=s;var r=0;t.maskKeyPress=!0;do{w.call(t,a[r],!1,null),++r}while(r<a.length);if(t.maskKeyPress=!1,t._callPasteHandler=!1,t.element.value===n){var l=0;t.maskKeyPress=!0;do{w.call(t,a[l],!1,null),++l}while(l<a.length);t.maskKeyPress=!1}else B.call(t,e,n)},1)}}function C(e){var t=this;if(this.mask&&!this.readonly){var i=this.element.value,s=this.element.selectionStart,n=this.element.selectionEnd;this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd});var a=this.element.value.substring(0,s)+this.promptMask.substring(s,n)+this.element.value.substring(n);setTimeout(function(){I.call(t,a),t.element.selectionStart=t.element.selectionEnd=s,t.element.value!==i&&B.call(t,e,null)},0)}}function S(e){e.preventDefault()}function T(e){if(!0!==t.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType){var i={ctrlKey:!1,keyCode:229};if(t.extend(e,i),this.mask){if(""===this.element.value&&this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this._callPasteHandler||P.call(this,e),this.element.value.length>this.promptMask.length){var s=this.element.selectionStart,n=this.element.value.length-this.promptMask.length,a=this.element.value.substring(s-n,s);this.maskKeyPress=!1;var r=0;do{w.call(this,a[r],e.ctrlKey,e),++r}while(r<a.length);this.element.value!==this.preEleVal&&B.call(this,e,null)}var l=p.call(this,this.element);this.prevValue=l,this.value=l,""===l&&(I.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}}function k(e){if(this.mask&&!this.readonly){229!==e.keyCode&&(!e.ctrlKey||89!==e.keyCode&&90!==e.keyCode||e.preventDefault(),P.call(this,e));var t=this.element.value;if(e.ctrlKey&&(89===e.keyCode||90===e.keyCode)){var i=void 0;90===e.keyCode&&this.undoCollec.length>0&&t!==this.undoCollec[this.undoCollec.length-1].value?(i=this.undoCollec[this.undoCollec.length-1],this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),I.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===e.keyCode&&this.redoCollec.length>0&&t!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),I.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function x(){var e,t=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(e=this.redoCollec[0],I.call(this,e.value),e.startIndex-t==1?(this.element.selectionStart=e.startIndex,this.element.selectionEnd=e.endIndex):(this.element.selectionStart=t+1,this.element.selectionEnd=i+1)):(I.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=t)}function O(e,t,i){return"input"===i.type&&(e=!1,t=this.element.value,I.call(this,this.promptMask),D.call(this,t)),e}function P(e){var i,s=!1,n=!1;this.element.value.length<this.promptMask.length&&(s=!0,i=this.element.value,s=O.call(this,s,i,e),x.call(this)),this.element.value.length>=this.promptMask.length&&"input"===e.type&&(s=O.call(this,s,i,e));var a=this.element.selectionStart,r=this.element.selectionEnd,l=this.element.selectionStart,o=this.element.selectionEnd,h=this.hiddenMask.replace(/[>|\\<]/g,""),d=h[l-1],u=this.element.selectionEnd;if(s||8===e.keyCode||46===e.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:o});var c=!1,p=this.element.value;if(l>0||(8===e.keyCode||46===e.keyCode)&&l<this.element.value.length&&this.element.selectionEnd-l!==this.element.value.length){var m=l;l!==o?(l=o,46===e.keyCode&&(c=!0)):46===e.keyCode?++m:--m;for(var v=l;8===e.keyCode||s||c?v>m:v<m;8===e.keyCode||s||c?v--:v++)for(var f=l;8===e.keyCode||s||c?f>0:f<this.element.value.length;8===e.keyCode||s||c?f--:f++){var g=void 0;(8===e.keyCode||c)&&(a!==r&&a!==l||a===r)||s?(d=h[f-1],g=l-1):(d=h[f],g=l,++l);var y=this.element.value[g];if(t.isNullOrUndefined(this.regExpCollec[d])&&!t.isNullOrUndefined(this.customCharacters)&&t.isNullOrUndefined(this.customCharacters[d])&&this.hiddenMask[g]!==this.promptChar&&"["!==this.customRegExpCollec[g][0]&&"]"!==this.customRegExpCollec[g][this.customRegExpCollec[g].length-1]||this.promptMask[g]!==this.promptChar&&t.isNullOrUndefined(this.customCharacters))this.element.selectionStart=this.element.selectionEnd=g,e.preventDefault(),46!==e.keyCode||c||++this.element.selectionStart;else{var b=this.element.value,E=this.promptChar,C=b.substring(0,g)+E+b.substring(l,b.length);I.call(this,C),e.preventDefault(),46!==e.keyCode||c||g++,this.element.selectionStart=this.element.selectionEnd=g,n=!0}if(l=this.element.selectionStart,!n&&8===e.keyCode||c||!n&&46!==e.keyCode?g=l-1:(g=l,n=!1),y=this.element.value[g],a!==r&&this.element.selectionStart===a||this.promptMask[g]===this.promptChar||y!==this.promptMask[g]&&this.promptMask[g]!==this.promptChar&&!t.isNullOrUndefined(this.customCharacters))break}}46===e.keyCode&&c&&n&&(this.element.selectionStart=this.element.selectionEnd=u),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(I.call(this,this.promptMask),e.preventDefault(),this.element.selectionStart=this.element.selectionEnd=l),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==p&&B.call(this,e,i)}}function L(e){if(this.mask&&!this.readonly){var t=this.element.value;if(!e.ctrlKey||e.ctrlKey&&"KeyA"!==e.code&&"KeyY"!==e.code&&"KeyZ"!==e.code&&"KeyX"!==e.code&&"KeyC"!==e.code&&"KeyV"!==e.code){this.maskKeyPress=!0;var i=e.key;"Spacebar"===i&&(i=String.fromCharCode(e.keyCode)),i?i&&1===i.length&&(w.call(this,i,e.ctrlKey,e),e.preventDefault()):(this.isIosInvalid=!0,w.call(this,String.fromCharCode(e.keyCode),e.ctrlKey,e),e.preventDefault(),this.isIosInvalid=!1),32===e.keyCode&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length)}this.element.value!==t&&B.call(this,e,t)}}function B(e,i){var s=this.isProtectedOnChange;if(!t.isNullOrUndefined(this.changeEventArgs)&&!this.isInitial){var n={};this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!1,isInteracted:!1},this.mask&&(this.changeEventArgs.value=p.call(this,this.element)),t.isNullOrUndefined(e)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=e),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,t.merge(n,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n)}this.preEleVal=this.element.value,this.prevValue=p.call(this,this.element),t.attributes(this.element,{"aria-valuenow":this.element.value})}function A(e){if(this.mask&&!this.readonly){var i=void 0;if(this.maskKeyPress||229!==e.keyCode)V.call(this);else{var s=void 0;if(1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this.element.value.length>this.promptMask.length){var n=this.element.selectionStart,a=this.element.value.length-this.promptMask.length,r=this.element.value.substring(n-a,n);if(this.undoCollec.length>0){i=this.undoCollec[this.undoCollec.length-1];var l=this.element.selectionStart;s=i.value;var o=i.value.substring(l-a,l);i=this.redoCollec[0],r=r.trim();var h=t.Browser.isAndroid&&""===r;h||o===r||i.value.substring(l-a,l)===r?h&&R.call(this,e,l-1,this.element.selectionEnd-1,r,e.ctrlKey,!1):w.call(this,r,e.ctrlKey,e)}else s=this.promptMask,w.call(this,r,e.ctrlKey,e);this.maskKeyPress=!1,B.call(this,e,s)}}var d=p.call(this,this.element);(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==d||""===d&&this.value!==d)&&(this.prevValue=d,this.value=d)}else B.call(this,e);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var u=this.element;setTimeout(function(){u.setSelectionRange(0,0)},0)}}function H(e){if(e.length>1&&this.promptMask.length+e.length<this.element.value.length){var t=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+e+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length);I.call(this,t),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+e.length}this.element.selectionStart=this.element.selectionStart-e.length,this.element.selectionEnd=this.element.selectionEnd-e.length}function N(e){this.maskKeyPress||H.call(this,e)}function w(e,i,s){if(N.call(this,e),!t.isNullOrUndefined(this)&&!t.isNullOrUndefined(e))for(var n,a,r=this.element.selectionStart,l=r,o=!1,h=this.element.value,d=!1,u=!1,c=0;c<e.length;c++){var p=e[c];if(r=this.element.selectionStart,this.maskKeyPress||l!==r||(r+=c),!this.maskKeyPress||r<this.promptMask.length){for(v=r;v<this.promptMask.length;v++)n=this.escapeMaskValue[r],"\\"===this.hiddenMask[r]&&this.hiddenMask[r+1]===e&&(u=!0),(t.isNullOrUndefined(this.regExpCollec[n])&&(t.isNullOrUndefined(this.customCharacters)||!t.isNullOrUndefined(this.customCharacters)&&t.isNullOrUndefined(this.customCharacters[n]))&&this.hiddenMask[r]!==this.promptChar&&"["!==this.customRegExpCollec[r][0]&&"]"!==this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]||this.promptMask[r]!==this.promptChar&&t.isNullOrUndefined(this.customCharacters)||this.promptChar===n&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=r+1,r=this.element.selectionStart,n=this.hiddenMask[r]);if(t.isNullOrUndefined(this.customCharacters)||t.isNullOrUndefined(this.customCharacters[n]))!t.isNullOrUndefined(this.regExpCollec[n])&&p.match(new RegExp(this.regExpCollec[n]))&&this.promptMask[r]===this.promptChar?o=!0:this.promptMask[r]===this.promptChar&&"["===this.customRegExpCollec[r][0]&&"]"===this.customRegExpCollec[r][this.customRegExpCollec[r].length-1]&&p.match(new RegExp(this.customRegExpCollec[r]))&&(o=!0);else for(var m=this.customCharacters[n].split(","),v=0;v<m.length;v++)if(p.match(new RegExp("["+m[v]+"]"))){o=!0;break}if((!this.maskKeyPress||r<this.hiddenMask.length)&&o){if(0===c)if(this.maskKeyPress)this.undoCollec.push({value:h,startIndex:r,endIndex:r});else{var f=this.element.selectionStart,g=this.element.selectionEnd;this.redoCollec.length>0?(a=this.redoCollec[0].value,I.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:r,endIndex:r}),a=this.promptMask,I.call(this,a)),this.element.selectionStart=f,this.element.selectionEnd=g}r=this.element.selectionStart,U.call(this,s,r,p,a,u),d=!0,c===e.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=!1}else r=this.element.selectionStart,R.call(this,s,r,l,e,i,d);c!==e.length-1||o||(!t.Browser.isAndroid||t.Browser.isAndroid&&r<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==e.length||i||t.isNullOrUndefined(s)||F.call(this)}}function U(e,t,i,s,n){if(this.hiddenMask.length>this.promptMask.length&&(i=M.call(this,i,this.element.value)),!n){var a=this.element.value,r=a.substring(0,t)+i+a.substring(t+1,a.length);I.call(this,r),this.element.selectionStart=this.element.selectionEnd=t+1}}function R(e,i,s,n,a,r){if(!this.maskKeyPress){var l=this.element.value;i>=this.promptMask.length?I.call(this,l.substring(0,i)):(s===i?I.call(this,l.substring(0,i)+l.substring(i+1,l.length)):this.promptMask.length===this.element.value.length?I.call(this,l.substring(0,i)+l.substring(i,l.length)):I.call(this,l.substring(0,s)+l.substring(s+1,l.length)),this.element.selectionStart=this.element.selectionEnd=r||this.element.value[s]!==this.promptChar?i:s),F.call(this)}1!==n.length||a||t.isNullOrUndefined(e)||F.call(this)}function F(){var e=this,i=this.element.parentNode,s=200;i.classList.contains(te)||i.classList.contains(ie)?t.addClass([i],ee):t.addClass([this.element],ee),!0===this.isIosInvalid&&(s=400),t.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){e.maskKeyPress||V.call(e)},s)}function V(){var e=this.element.parentNode;t.isNullOrUndefined(e)||t.removeClass([e],ee),t.removeClass([this.element],ee),t.attributes(this.element,{"aria-invalid":"false"})}function M(e,t){var i,s,n=t,a=0;for(s=0;s<this.hiddenMask.length;s++)if("\\"===this.hiddenMask[s]&&(i=n.substring(0,s)+"\\"+n.substring(s,n.length)),">"!==this.hiddenMask[s]&&"<"!==this.hiddenMask[s]&&"|"!==this.hiddenMask[s]||(this.hiddenMask[s]!==n[s]&&(i=n.substring(0,s)+this.hiddenMask[s]+n.substring(s,n.length)),++a),i){if(i[s]===this.promptChar&&s>this.element.selectionStart||this.element.value.indexOf(this.promptChar)<0&&this.element.selectionStart+a===s){a=0;break}n=i}for(;s>=0&&i;){if(0===s||"\\"!==i[s-1]){if(">"===i[s]){e=e.toUpperCase();break}if("<"===i[s]){e=e.toLowerCase();break}if("|"===i[s])break}--s}return e}function D(e){if(this.mask&&void 0!==e&&(void 0===this.prevValue||this.prevValue!==e)){if(this.maskKeyPress=!0,I.call(this,this.promptMask),""===e||null===e&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==e)for(var i=0;i<e.length;i++)w.call(this,e[i],!1,null);var s=p.call(this,this.element);this.prevValue=s,this.value=s,B.call(this,null,null),this.maskKeyPress=!1;var n=this.element.parentNode.querySelector(".e-float-text");this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!t.isNullOrUndefined(n)&&n.classList.contains(ne)&&!this.isFocus&&(t.removeClass([n],ne),t.addClass([n],ae),I.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&I.call(this,this.value)}function I(i,s){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&t.isNullOrUndefined(this.value)&&(i="");var n=p.call(this,s||this.element,i);null===n||""===n?(e.Input.setValue(i,s||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):e.Input.setValue(i,s||this.element,this.floatLabelType,this.showClearButton)}function z(e){var t=q(e);a.call(t);var i=p.call(this,this.element);this.prevValue=i,this.value=i,e.mask&&(l.call(t),r.call(t))}function q(e){t.addClass([e.element],se);var i={element:e.element,mask:e.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:e.promptChar?e.promptChar.length>1?e.promptChar=e.promptChar[0]:e.promptChar:"_",value:e.value?e.value:null,regExpCollec:re,customRegExpCollec:[],customCharacters:e.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return n.call(i),i}function W(e){return p.call(_(e),e.element)}function j(e){return c.call(_(e),e.element)}function _(e){var i;return!t.isNullOrUndefined(e)&&e.element.classList.contains(se)&&(i=q(e)),i}var X={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",TEXTAREA:"e-multi-line-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"};!function(e){function i(e,i){var n=t.isNullOrUndefined(i)?t.createElement:i,a={container:null,buttons:[],clearButton:null};if(q=e.floatLabelType,W=e.bindClearAction,t.isNullOrUndefined(e.floatLabelType)||"Never"===e.floatLabelType?(a.container=y(e,X.INPUTGROUP,X.INPUTCUSTOMTAG,"span",n),e.element.parentNode.insertBefore(a.container,e.element),t.addClass([e.element],X.INPUT),a.container.appendChild(e.element)):h(e,a,n),s(e),t.isNullOrUndefined(e.properties)||t.isNullOrUndefined(e.properties.showClearButton)||!e.properties.showClearButton||"TEXTAREA"===e.element.tagName||(P(e.properties.showClearButton,e.element,a,!0,n),a.clearButton.setAttribute("role","button"),a.container.classList.contains(X.FLOATINPUT)&&t.addClass([a.container],X.INPUTGROUP)),!t.isNullOrUndefined(e.buttons)&&"TEXTAREA"!==e.element.tagName)for(var r=0;r<e.buttons.length;r++)a.buttons.push(I(e.buttons[r],a.container,n));return t.isNullOrUndefined(e.element)||"TEXTAREA"!==e.element.tagName||t.addClass([a.container],X.TEXTAREA),z(a.container,e.element),a=u(e,a)}function s(e){n(e.floatLabelType,e.element),e.element.addEventListener("focus",function(){var e=m(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus")}),e.element.addEventListener("blur",function(){var e=m(this);(e.classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus")}),e.element.addEventListener("input",function(){n(q,e.element)})}function n(e,i){var s=i.value;""!==s&&!t.isNullOrUndefined(s)&&i.parentElement?i.parentElement.classList.add("e-valid-input"):"Always"!==e&&i.parentElement&&i.parentElement.classList.remove("e-valid-input")}function a(){var e=m(this).getElementsByClassName("e-float-text")[0];t.isNullOrUndefined(e)||(t.addClass([e],X.LABELTOP),e.classList.contains(X.LABELBOTTOM)&&t.removeClass([e],X.LABELBOTTOM))}function r(){var e=m(this);if(e.getElementsByTagName("textarea")[0]?""===e.getElementsByTagName("textarea")[0].value:""===e.getElementsByTagName("input")[0].value){var i=e.getElementsByClassName("e-float-text")[0];t.isNullOrUndefined(i)||(i.classList.contains(X.LABELTOP)&&t.removeClass([i],X.LABELTOP),t.addClass([i],X.LABELBOTTOM))}}function l(e){e.addEventListener("focus",a),e.addEventListener("blur",r)}function o(e){e.removeEventListener("focus",a),e.removeEventListener("blur",r)}function h(e,i,s){var n=t.isNullOrUndefined(s)?t.createElement:s;"Auto"===e.floatLabelType&&l(e.element),t.isNullOrUndefined(i.container)?(i.container=y(e,X.FLOATINPUT,X.FLOATCUSTOMTAG,"div",n),e.element.parentNode.insertBefore(i.container,e.element)):(t.isNullOrUndefined(e.customTag)||i.container.classList.add(X.FLOATCUSTOMTAG),i.container.classList.add(X.FLOATINPUT));var a=n("span",{className:X.FLOATLINE}),r=n("label",{className:X.FLOATTEXT});if(t.isNullOrUndefined(e.element.id)||""===e.element.id||(r.id="label_"+e.element.id.replace(/ /g,"_"),t.attributes(e.element,{"aria-labelledby":r.id})),t.isNullOrUndefined(e.element.placeholder)||""===e.element.placeholder||(r.innerText=b(e.element.placeholder),e.element.removeAttribute("placeholder")),t.isNullOrUndefined(e.properties)||t.isNullOrUndefined(e.properties.placeholder)||""===e.properties.placeholder||(r.innerText=b(e.properties.placeholder)),r.innerText||i.container.classList.add(X.NOFLOATLABEL),i.container.classList.contains("e-float-icon-left")){var o=i.container.querySelector(".e-input-in-wrap");o.appendChild(e.element),o.appendChild(a),o.appendChild(r)}else i.container.appendChild(e.element),i.container.appendChild(a),i.container.appendChild(r);p(e.element.value,r),"Always"===e.floatLabelType&&(r.classList.contains(X.LABELBOTTOM)&&t.removeClass([r],X.LABELBOTTOM),t.addClass([r],X.LABELTOP)),"Auto"===e.floatLabelType&&(e.element.addEventListener("input",function(t){p(e.element.value,r)}),e.element.addEventListener("blur",function(t){p(e.element.value,r)})),t.isNullOrUndefined(e.element.getAttribute("id"))||r.setAttribute("for",e.element.getAttribute("id"))}function d(e,t){"Always"===e&&t.classList.contains("e-outline")&&t.classList.add("e-valid-input")}function u(e,i){if(!t.isNullOrUndefined(e.properties))for(var s=0,n=Object.keys(e.properties);s<n.length;s++)switch(n[s]){case"cssClass":C(e.properties.cssClass,[i.container]),d(e.floatLabelType,i.container);break;case"enabled":O(e.properties.enabled,e.element,e.floatLabelType,i.container);break;case"enableRtl":x(e.properties.enableRtl,[i.container]);break;case"placeholder":T(e.properties.placeholder,e.element);break;case"readonly":k(e.properties.readonly,e.element)}return i}function c(e,i){e?t.removeClass([i],X.CLEARICONHIDE):t.addClass([i],X.CLEARICONHIDE)}function p(e,i){e?(t.addClass([i],X.LABELTOP),i.classList.contains(X.LABELBOTTOM)&&t.removeClass([i],X.LABELBOTTOM)):(i.classList.contains(X.LABELTOP)&&t.removeClass([i],X.LABELTOP),t.addClass([i],X.LABELBOTTOM))}function m(e){var i=t.isNullOrUndefined(e.parentNode)?e:e.parentNode;return i&&i.classList.contains("e-input-in-wrap")&&(i=i.parentNode),i}function v(e,i,s,n){var a=(t.isNullOrUndefined(n)?t.createElement:n)("span",{className:X.CLEARICON}),r=i.container;return t.isNullOrUndefined(s)?(i.container.classList.contains(X.FLOATINPUT)?i.container.querySelector("."+X.FLOATTEXT):e).insertAdjacentElement("afterend",a):r.appendChild(a),!t.isNullOrUndefined(r)&&r.classList.contains(X.FLOATINPUT)&&t.addClass([r],X.INPUTGROUP),t.addClass([a],X.CLEARICONHIDE),f(e,a,r),a.setAttribute("aria-label","close"),a}function f(e,i,s){(void 0==W||W)&&i.addEventListener("click",function(s){e.classList.contains(X.DISABLE)||e.readOnly||(s.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",t.addClass([i],X.CLEARICONHIDE))}),e.addEventListener("input",function(t){c(e.value,i)}),e.addEventListener("focus",function(t){c(e.value,i)}),e.addEventListener("blur",function(e){setTimeout(function(){t.addClass([i],X.CLEARICONHIDE)},200)})}function g(e,t){if(m(e).classList.contains(X.FLOATINPUT)&&"Auto"===t){var i=m(e).getElementsByClassName("e-float-text")[0];p(e.value,i)}}function y(e,i,s,n,a){var r,l=t.isNullOrUndefined(a)?t.createElement:a;return t.isNullOrUndefined(e.customTag)?r=l(n,{className:i}):(r=l(e.customTag,{className:i})).classList.add(s),r.classList.add("e-control-wrapper"),r}function b(e){var i="";if(!t.isNullOrUndefined(e)&&""!==e){var s=document.createElement("span");s.innerHTML='<input placeholder="'+e+'"/>',i=s.children[0].placeholder}return i}function E(e,i,s,a){if(i.value=e,t.isNullOrUndefined(s)||"Auto"!==s||g(i,s),!t.isNullOrUndefined(a)&&a){var r=m(i);if(!t.isNullOrUndefined(r)){var l=r.getElementsByClassName(X.CLEARICON)[0];t.isNullOrUndefined(l)||(i.value&&r.classList.contains("e-input-focus")?t.removeClass([l],X.CLEARICONHIDE):t.addClass([l],X.CLEARICONHIDE))}}n(s,i)}function C(e,i,s){t.isNullOrUndefined(s)||""===s||t.removeClass(i,s.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(i,e.split(" "))}function S(e,i){"number"==typeof e?i.style.width=t.formatUnit(e):"string"==typeof e&&(i.style.width=e.match(/px|%|em/)?e:t.formatUnit(e))}function T(e,i){e=b(e);var s=m(i);s.classList.contains(X.FLOATINPUT)?t.isNullOrUndefined(e)||""===e?(s.classList.add(X.NOFLOATLABEL),s.getElementsByClassName(X.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName(X.FLOATTEXT)[0].textContent=e,s.classList.remove(X.NOFLOATLABEL),i.removeAttribute("placeholder")):t.isNullOrUndefined(e)||""===e?(i.removeAttribute("placeholder"),i.removeAttribute("aria-placeholder")):t.attributes(i,{placeholder:e,"aria-placeholder":e})}function k(e,i,s){e?t.attributes(i,{readonly:""}):i.removeAttribute("readonly"),t.isNullOrUndefined(s)||g(i,s)}function x(e,i){e?t.addClass(i,X.RTL):t.removeClass(i,X.RTL)}function O(e,i,s,n){var a={disabled:"disabled","aria-disabled":"true"},r=!t.isNullOrUndefined(n);e?(i.classList.remove(X.DISABLE),L(a,i),r&&t.removeClass([n],X.DISABLE)):(i.classList.add(X.DISABLE),B(a,i),r&&t.addClass([n],X.DISABLE)),t.isNullOrUndefined(s)||g(i,s)}function P(e,i,s,n,a){var r=t.isNullOrUndefined(a)?t.createElement:a;e?s.clearButton=v(i,s,n,r):(t.remove(s.clearButton),s.clearButton=null)}function L(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i],a=m(t);"disabled"===n&&t.classList.remove(X.DISABLE),"disabled"===n&&a.classList.contains(X.INPUTGROUP)&&a.classList.remove(X.DISABLE),"placeholder"===n&&a.classList.contains(X.FLOATINPUT)?a.getElementsByClassName(X.FLOATTEXT)[0].textContent="":t.removeAttribute(n)}}function B(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i],a=m(t);"disabled"===n&&t.classList.add(X.DISABLE),"disabled"===n&&a.classList.contains(X.INPUTGROUP)&&a.classList.add(X.DISABLE),"placeholder"===n&&a.classList.contains(X.FLOATINPUT)?a.getElementsByClassName(X.FLOATTEXT)[0].textContent=e[n]:t.setAttribute(n,e[n])}}function A(e){var i=e.container;if(!t.isNullOrUndefined(i)&&i.classList.contains(X.FLOATINPUT)){var s=i.querySelector("textarea")?i.querySelector("textarea"):i.querySelector("input"),n=i.querySelector("."+X.FLOATTEXT).textContent,a=null!==i.querySelector(".e-clear-icon");t.detach(i.querySelector("."+X.FLOATLINE)),t.detach(i.querySelector("."+X.FLOATTEXT)),t.classList(i,[X.INPUTGROUP],[X.FLOATINPUT]),o(s),t.attributes(s,{placeholder:n}),s.classList.add(X.INPUT),a||"INPUT"!==s.tagName||s.removeAttribute("required")}}function H(e,i,s,n){var a=t.isNullOrUndefined(n)?t.createElement:n,r=t.closest(e,"."+X.INPUTGROUP);if(q=i,"Never"!==i){var l=r.tagName,o={element:e,floatLabelType:i,customTag:l="DIV"!==l&&"SPAN"!==l?l:null,properties:{placeholder:s}},u=r.querySelector(".e-clear-icon"),c={container:r};e.classList.remove(X.INPUT),h(o,c,a);var p=r.classList.contains("e-float-icon-left");if(t.isNullOrUndefined(u)&&(u=p?r.querySelector(".e-input-in-wrap").querySelector(".e-input-group-icon"):r.querySelector(".e-input-group-icon")),t.isNullOrUndefined(u))p&&(u=r.querySelector(".e-input-group-icon")),t.isNullOrUndefined(u)&&r.classList.remove(X.INPUTGROUP);else{var m=r.querySelector("."+X.FLOATLINE),v=r.querySelector("."+X.FLOATTEXT),f=p?r.querySelector(".e-input-in-wrap"):r;f.insertBefore(e,u),f.insertBefore(m,u),f.insertBefore(v,u)}}d(i,e.parentElement)}function N(e,t){for(var i=0;i<t.length;i++)w(e,t[i].container)}function w(e,i,s){var n=[];n.push(s);var a=t.isNullOrUndefined(s)?i.querySelectorAll(".e-input-group-icon"):n;if(e&&a.length>0)for(r=0;r<a.length;r++)a[r].addEventListener("mousedown",R,!1),a[r].addEventListener("mouseup",F,!1);else if(a.length>0)for(var r=0;r<a.length;r++)a[r].removeEventListener("mousedown",R,this),a[r].removeEventListener("mouseup",F,this)}function U(e,t){e.classList.contains("e-disabled")||e.querySelector("input").readOnly||t.classList.add("e-input-btn-ripple")}function R(){for(var e=this,t=this.parentElement;!t.classList.contains("e-input-group");)t=t.parentElement;U(t,e)}function F(){var e=this;setTimeout(function(){e.classList.remove("e-input-btn-ripple")},500)}function V(e,t){var i=t("span",{className:e});return i.classList.add("e-input-group-icon"),i}function M(e,t,i,s,n){var a="string"==typeof t?t.split(","):t;if("append"===e.toLowerCase())for(var r=0,l=a;r<l.length;r++)I(d=l[r],i,n);else for(var o=0,h=a;o<h.length;o++){var d=h[o];D(d,i,s,n)}}function D(e,i,s,n){var a=t.isNullOrUndefined(n)?t.createElement:n,r=V(e,a);i.classList.add("e-float-icon-left");var l=i.querySelector(".e-input-in-wrap");if(t.isNullOrUndefined(l)){l=a("span",{className:"e-input-in-wrap"}),s.parentNode.insertBefore(l,s);var o=i.querySelectorAll(s.tagName+" ~ *");l.appendChild(s);for(var h=0;h<o.length;h++)l.appendChild(o[h])}return l.parentNode.insertBefore(r,l),i.classList.contains(X.INPUTGROUP)||i.classList.add(X.INPUTGROUP),w(!0,i,r),r}function I(e,i,s){var n=V(e,t.isNullOrUndefined(s)?t.createElement:s);return i.classList.contains(X.INPUTGROUP)||i.classList.add(X.INPUTGROUP),(i.classList.contains("e-float-icon-left")?i.querySelector(".e-input-in-wrap"):i).appendChild(n),w(!0,i,n),n}function z(e,t){"hidden"===t.type?e.classList.add("e-hidden"):e.classList.contains("e-hidden")&&e.classList.remove("e-hidden")}var q,W=!0;e.createInput=i,e.bindInitialEvent=s,e.wireFloatingEvents=l,e.wireClearBtnEvents=f,e.setValue=E,e.setCssClass=C,e.setWidth=S,e.setPlaceholder=T,e.setReadonly=k,e.setEnableRtl=x,e.setEnabled=O,e.setClearButton=P,e.removeAttributes=L,e.addAttributes=B,e.removeFloating=A,e.addFloating=H,e.setRipple=N,e.addIcon=M,e.prependSpan=D,e.appendSpan=I,e.validateInputType=z}(e.Input||(e.Input={}));var K=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Z=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},Y="e-input-group-icon",G="e-spin-up",$=new RegExp("^(-)?(\\d*)$"),J=["title","style","class"],Q=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.isVue=!1,s.preventChange=!1,s.isAngular=!1,s.isDynamicChange=!1,s.numericOptions=e,s}return K(s,i),s.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var e=t.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=t.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;var i=this.createElement("input"),s=0;for(s;s<this.element.attributes.length;s++)"id"!==this.element.attributes[s].nodeName&&(i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML);this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}if(!t.isBlazor()||!this.isServerRendered){t.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off","aria-live":"assertive"});var n={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new t.L10n("numerictextbox",n,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.prevValue=this.value,t.isBlazor()&&this.isServerRendered||(this.updateHTMLAttrToElement(),this.checkAttributes(!1),this.formEle&&(this.inputEleValue=this.value)),this.validateMinMax(),this.validateStep(),null!==this.placeholder||t.isBlazor()&&this.isServerRendered||this.updatePlaceholder()},s.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(t.isBlazor()&&this.isServerRendered?(this.container=this.element.parentElement,this.inputWrapper={container:this.container},this.hiddenInput=this.container.querySelector('input[type="hidden"]'),this.showClearButton&&(this.inputWrapper.clearButton=this.container.querySelector(".e-clear-icon"),e.Input.wireClearBtnEvents(this.element,this.inputWrapper.clearButton,this.inputWrapper.container)),this.showSpinButton&&(this.spinDown=this.container.querySelector(".e-spin-down"),this.spinUp=this.container.querySelector("."+G),this.wireSpinBtnEvents()),e.Input.bindInitialEvent({element:this.element,buttons:null,customTag:null,floatLabelType:this.floatLabelType,properties:this.properties})):(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),this.setElementWidth(this.width),this.container.classList.contains("e-input-group")||this.container.classList.add("e-input-group"),this.changeValue(null===this.value||isNaN(this.value)?null:this.strictMode?this.trimValue(this.value):this.value)),this.wireEvents(),t.isBlazor()&&this.isServerRendered||(null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0),(this.element.getAttribute("value")||this.value)&&(this.element.setAttribute("value",this.element.value),this.hiddenInput.setAttribute("value",this.hiddenInput.value))),this.elementPrevValue=this.element.value,this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete())},s.prototype.checkAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"readonly":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||e){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!e)}break;case"placeholder":(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"value":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||e){var l=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));this.setProperties(t.setValue(n,l,{}),!e)}break;case"min":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.min||e){var o=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===o||isNaN(o)||this.setProperties(t.setValue(n,o,{}),!e)}break;case"max":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.max||e){var h=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===h||isNaN(h)||this.setProperties(t.setValue(n,h,{}),!e)}break;case"step":if(t.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.step||e){var d=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===d||isNaN(d)||this.setProperties(t.setValue(n,d,{}),!e)}break;case"style":this.inputStyle=this.element.getAttribute(n);break;case"name":this.inputName=this.element.getAttribute(n);break;default:var u=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));(null!==u&&!isNaN(u)||"value"===n)&&this.setProperties(t.setValue(n,u,{}),!0)}}},s.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},s.prototype.initCultureFunc=function(){this.instance=new t.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==t.getValue("currency",this)&&(t.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},s.prototype.createWrapper=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getNumericValidClassList(this.cssClass));var s=e.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:i,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement);this.inputWrapper=s,this.container=s.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&t.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text",validateHidden:"true",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),t.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&t.attributes(this.container,{style:this.inputStyle})},s.prototype.updateDataAttribute=function(e){var t={};if(e)t=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)t[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,n=Object.keys(t);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,t[a])}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];J.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(i))},s.prototype.getNumericValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(J.indexOf(s)>-1)if("class"===s){var n=this.getNumericValidClassList(this.htmlAttributes[s]);""!==n&&t.addClass([this.container],n.split(" "))}else if("style"===s){var a=this.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.container.setAttribute(s,a)}else this.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.setElementWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.container.style.width=t.formatUnit(e):"string"==typeof e&&(this.container.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.spinBtnCreation=function(){this.spinDown=e.Input.appendSpan(Y+" e-spin-down",this.container,this.createElement),t.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),this.spinUp=e.Input.appendSpan(Y+" "+G,this.container,this.createElement),t.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},s.prototype.validateMinMax=function(){("number"!=typeof this.min||isNaN(this.min))&&this.setProperties({min:-Number.MAX_VALUE},!0),("number"!=typeof this.max||isNaN(this.max))&&this.setProperties({max:Number.MAX_VALUE},!0),null!==this.decimals&&(this.min!==-Number.MAX_VALUE&&this.setProperties({min:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.min))},!0),this.max!==Number.MAX_VALUE&&this.setProperties({max:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.max))},!0)),this.setProperties({min:this.min>this.max?this.max:this.min},!0),t.attributes(this.element,{"aria-valuemin":this.min.toString(),"aria-valuemax":this.max.toString()})},s.prototype.formattedValue=function(e,t){return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},s.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},s.prototype.action=function(e,t){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,e)),this.raiseChangeEvent(t)},s.prototype.checkErrorClass=function(){this.isValidState?t.removeClass([this.container],"e-error"):t.addClass([this.container],"e-error"),t.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},s.prototype.bindClearEvent=function(){this.showClearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},s.prototype.resetHandler=function(e){e.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")||this.clear(e),this.isInteract=!0,this.raiseChangeEvent(e)},s.prototype.clear=function(e){if(this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",t.closest(this.element,"form")){var i=this.element.nextElementSibling,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}},s.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},s.prototype.setSpinButton=function(){t.isNullOrUndefined(this.spinDown)||t.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),t.isNullOrUndefined(this.spinUp)||t.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"blur",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"input",this.inputHandler,this),t.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle&&t.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this))},s.prototype.wireSpinBtnEvents=function(){t.EventHandler.add(this.spinUp,t.Browser.touchStartEvent,this.mouseDownOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchStartEvent,this.mouseDownOnSpinner,this),t.EventHandler.add(this.spinUp,t.Browser.touchEndEvent,this.mouseUpOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchEndEvent,this.mouseUpOnSpinner,this),t.EventHandler.add(this.spinUp,t.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),t.EventHandler.add(this.spinDown,t.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},s.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"blur",this.focusOutHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"input",this.inputHandler),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.element,"keypress",this.keyPressHandler),t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&t.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},s.prototype.unwireSpinBtnEvents=function(){t.EventHandler.remove(this.spinUp,t.Browser.touchStartEvent,this.mouseDownOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchStartEvent,this.mouseDownOnSpinner),t.EventHandler.remove(this.spinUp,t.Browser.touchEndEvent,this.mouseUpOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchEndEvent,this.mouseUpOnSpinner),t.EventHandler.remove(this.spinUp,t.Browser.touchMoveEvent,this.touchMoveOnSpinner),t.EventHandler.remove(this.spinDown,t.Browser.touchMoveEvent,this.touchMoveOnSpinner)},s.prototype.changeHandler=function(e){e.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var t=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(t,e)},s.prototype.raiseChangeEvent=function(e){if(this.prevValue!==this.value){var i={};this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:e},e&&(this.changeEventArgs.event=e),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),t.merge(i,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",i)}},s.prototype.pasteHandler=function(){var e=this;if(this.enabled&&!this.readonly){var t=this.element.value;setTimeout(function(){e.numericRegex().test(e.element.value)||e.setElementValue(t)})}},s.prototype.preventHandler=function(){var e=this,i=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){if(e.element.selectionStart>0){var s=e.element.selectionStart,n=e.element.selectionStart-1,a=e.element.value.split(""),r=t.getNumericObject(e.locale),l=t.getValue("decimal",r).charCodeAt(0);" "===e.element.value[n]&&e.element.selectionStart>0&&!i?(t.isNullOrUndefined(e.prevVal)?e.element.value=e.element.value.trim():0!==n?e.element.value=e.prevVal:0===n&&(e.element.value=e.element.value.trim()),e.element.setSelectionRange(n,n)):isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&45!==e.element.value[e.element.selectionStart-1].charCodeAt(0)?(a.indexOf(e.element.value[e.element.selectionStart-1])!==a.lastIndexOf(e.element.value[e.element.selectionStart-1])&&e.element.value[e.element.selectionStart-1].charCodeAt(0)===l||e.element.value[e.element.selectionStart-1].charCodeAt(0)!==l)&&(e.element.value=e.element.value.substring(0,n)+e.element.value.substring(s,e.element.value.length),e.element.setSelectionRange(n,n),isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&e.element.selectionStart>0&&e.element.value.length&&e.preventHandler()):isNaN(parseFloat(e.element.value[e.element.selectionStart-2]))&&e.element.selectionStart>1&&45!==e.element.value[e.element.selectionStart-2].charCodeAt(0)&&(a.indexOf(e.element.value[e.element.selectionStart-2])!==a.lastIndexOf(e.element.value[e.element.selectionStart-2])&&e.element.value[e.element.selectionStart-2].charCodeAt(0)===l||e.element.value[e.element.selectionStart-2].charCodeAt(0)!==l)&&(e.element.setSelectionRange(n,n),e.nextEle=e.element.value[e.element.selectionStart],e.cursorPosChanged=!0,e.preventHandler()),!0===e.cursorPosChanged&&e.element.value[e.element.selectionStart]===e.nextEle&&isNaN(parseFloat(e.element.value[e.element.selectionStart-1]))&&(e.element.setSelectionRange(e.element.selectionStart+1,e.element.selectionStart+1),e.cursorPosChanged=!1,e.nextEle=null),""===e.element.value.trim()&&e.element.setSelectionRange(0,0),e.element.selectionStart>0&&45===e.element.value[e.element.selectionStart-1].charCodeAt(0)&&e.element.selectionStart>1&&(t.isNullOrUndefined(e.prevVal)?e.element.value=e.element.value:e.element.value=e.prevVal,e.element.setSelectionRange(e.element.selectionStart,e.element.selectionStart)),e.prevVal=e.element.value}})},s.prototype.keyUpHandler=function(){if(this.enabled&&!this.readonly){!(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))&&t.Browser.isDevice&&this.preventHandler();var e=this.instance.getNumberParser({format:"n"})(this.element.value);if(e=null===e||isNaN(e)?null:e,this.hiddenInput.value=e||0===e?e.toString():null,t.closest(this.element,"form")){var i=this.element.nextElementSibling,s=document.createEvent("KeyboardEvent");s.initEvent("keyup",!1,!0),i.dispatchEvent(s)}}},s.prototype.inputHandler=function(e){var i=this;if(this.enabled&&!this.readonly){var s=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);if((navigator.userAgent.toLowerCase().indexOf("firefox")>-1||s)&&t.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==t.getValue("decimal",t.getNumericObject(this.locale))&&this.element.value!==t.getValue("minusSign",t.getNumericObject(this.locale))){var n=this.instance.getNumberParser({format:"n"})(this.element.value);n=isNaN(n)?null:n,i.localChange({value:n}),this.preventChange=!0}if(this.isVue){var a=this.instance.getNumberParser({format:"n"})(this.element.value),r=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),l={event:e,value:null===a||isNaN(a)?null:a,previousValue:null===r||isNaN(r)?null:r};this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",l)}}},s.prototype.keyDownHandler=function(e){if(!this.readonly)switch(e.keyCode){case 38:e.preventDefault(),this.action("increment",e);break;case 40:e.preventDefault(),this.action("decrement",e)}},s.prototype.performAction=function(e,t,i){(null===e||isNaN(e))&&(e=0);var s="increment"===i?e+t:e-t;return s=this.correctRounding(e,t,s),this.strictMode?this.trimValue(s):s},s.prototype.correctRounding=function(e,t,i){var s=new RegExp("[,.](.*)"),n=s.test(e.toString()),a=s.test(t.toString());if(n||a){var r=n?s.exec(e.toString())[0].length:0,l=a?s.exec(t.toString())[0].length:0,o=Math.max(r,l);return e=this.roundValue(i,o)}return i},s.prototype.roundValue=function(e,t){t=t||0;var i=Math.pow(10,t);return e*=i,e=Math.round(e)/i},s.prototype.updateValue=function(e,t){t&&(this.isInteract=!0),null===e||isNaN(e)||this.decimals&&(e=this.roundNumber(e,this.decimals)),this.changeValue(null===e||isNaN(e)?null:this.strictMode?this.trimValue(e):e),this.isDynamicChange||this.raiseChangeEvent(t)},s.prototype.updateCurrency=function(e,i){t.setValue(e,i,this.cultureInfo),this.updateValue(this.value)},s.prototype.changeValue=function(e){if(e||0===e){var t=this.getNumberOfDecimals(e);this.setProperties({value:this.roundNumber(e,t)},!0)}else e=null,this.setProperties({value:e},!0);this.modifyText(),this.strictMode||this.validateState()},s.prototype.modifyText=function(){if(this.value||0===this.value){var e=this.formatNumber(),i=this.isFocused?e:this.instance.getNumberFormat(this.cultureInfo)(this.value);this.setElementValue(i),t.attributes(this.element,{"aria-valuenow":e}),this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator))}else this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null},s.prototype.setElementValue=function(t,i){e.Input.setValue(t,i||this.element,this.floatLabelType,this.showClearButton)},s.prototype.validateState=function(){this.isValidState=!0,(this.value||0===this.value)&&(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},s.prototype.getNumberOfDecimals=function(e){var i,s=new RegExp("[eE][-+]?([0-9]+)"),n=e.toString();if(s.test(n)){var a=s.exec(n);t.isNullOrUndefined(a)||(n=e.toFixed(Math.min(parseInt(a[1],10),20)))}var r=n.split(".")[1];return i=r&&r.length?r.length:0,null!==this.decimals&&(i=i<this.decimals?i:this.decimals),i},s.prototype.formatNumber=function(){var e=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(this.value)},s.prototype.trimValue=function(e){return e>this.max?this.max:e<this.min?this.min:e},s.prototype.roundNumber=function(e,t){var i=e,s=t||0,n=i.toString().split("e"),a=(i=Math.round(Number(n[0]+"e"+(n[1]?Number(n[1])+s:s)))).toString().split("e");return i=Number(a[0]+"e"+(a[1]?Number(a[1])-s:-s)),Number(i.toFixed(s))},s.prototype.cancelEvent=function(e){return e.preventDefault(),!1},s.prototype.keyPressHandler=function(e){if(!this.enabled||this.readonly)return!0;if(!t.Browser.isDevice&&"11.0"===t.Browser.info.version&&13===e.keyCode){var i=this.instance.getNumberParser({format:"n"})(this.element.value);return this.updateValue(i,e),!0}if(0===e.which||e.metaKey||e.ctrlKey||8===e.keyCode||13===e.keyCode)return!0;var s=String.fromCharCode(e.which),n=this.element.value;return n=n.substring(0,this.element.selectionStart)+s+n.substring(this.element.selectionEnd),!!this.numericRegex().test(n)||(e.preventDefault(),e.stopPropagation(),!1)},s.prototype.numericRegex=function(){var e=t.getNumericObject(this.locale),i=t.getValue("decimal",e),s="*";return"."===i&&(i="\\"+i),0===this.decimals&&this.validateDecimalOnType?$:(this.decimals&&this.validateDecimalOnType&&(s="{0,"+this.decimals+"}"),new RegExp("^(-)?(((\\d+("+i+"\\d"+s+")?)|("+i+"\\d"+s+")))?$"))},s.prototype.mouseWheel=function(e){e.preventDefault();var t,i=e;i.wheelDelta?t=i.wheelDelta/120:i.detail&&(t=-i.detail/3),t>0?this.action("increment",e):t<0&&this.action("decrement",e),this.cancelEvent(e)},s.prototype.focusHandler=function(e){var i=this;if(this.focusEventArgs={event:e,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),this.enabled&&!this.readonly){if(this.isFocused=!0,t.removeClass([this.container],"e-error"),this.prevValue=this.value,this.value||0===this.value){var s=this.formatNumber();if(this.setElementValue(s),!this.isPrevFocused)if(t.Browser.isDevice||"11.0"!==t.Browser.info.version){var n=t.Browser.isDevice&&t.Browser.isIos?600:0;setTimeout(function(){i.element.setSelectionRange(0,s.length)},n)}else this.element.setSelectionRange(0,s.length)}t.Browser.isDevice||t.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},s.prototype.focusOutHandler=function(e){var i=this;if(this.blurEventArgs={event:e,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly){if(this.isPrevFocused){if(e.preventDefault(),t.Browser.isDevice){var s=this.element.value;this.element.focus(),this.isPrevFocused=!1;var n=this.element;setTimeout(function(){i.setElementValue(s,n)},200)}}else{this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var a=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(a),t.Browser.isDevice||t.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}if(t.closest(this.element,"form")){var r=this.element.nextElementSibling,l=document.createEvent("FocusEvent");l.initEvent("focusout",!1,!0),r.dispatchEvent(l)}}},s.prototype.mouseDownOnSpinner=function(e){var i=this;if(this.isFocused&&(this.isPrevFocused=!0,e.preventDefault()),this.getElementData(e)){this.getElementData(e);var s=e.currentTarget,n=s.classList.contains(G)?"increment":"decrement";t.EventHandler.add(s,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){i.isCalled=!0,i.action(n,e)},150),t.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},s.prototype.touchMoveOnSpinner=function(e){var t;if("touchmove"===e.type){var i=e.touches;t=i.length&&document.elementFromPoint(i[0].pageX,i[0].pageY)}else t=document.elementFromPoint(e.clientX,e.clientY);t.classList.contains(Y)||clearInterval(this.timeOut)},s.prototype.mouseUpOnSpinner=function(e){if(this.isPrevFocused&&(this.element.focus(),t.Browser.isDevice||(this.isPrevFocused=!1)),t.Browser.isDevice||e.preventDefault(),this.getElementData(e)){var i=e.currentTarget,s=i.classList.contains(G)?"increment":"decrement";if(t.EventHandler.remove(i,"mouseleave",this.mouseUpClick),this.isCalled||this.action(s,e),this.isCalled=!1,t.EventHandler.remove(document,"mouseup",this.mouseUpClick),t.closest(this.element,"form")){var n=this.element.nextElementSibling,a=document.createEvent("KeyboardEvent");a.initEvent("keyup",!1,!0),n.dispatchEvent(a)}}},s.prototype.getElementData=function(e){return!(e.which&&3===e.which||e.button&&2===e.button||!this.enabled||this.readonly)&&(clearInterval(this.timeOut),!0)},s.prototype.floatLabelTypeUpdate=function(){e.Input.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),e.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(t,this.container.childNodes[1])},s.prototype.mouseUpClick=function(e){e.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,t.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),t.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},s.prototype.increment=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,"increment")),this.raiseChangeEvent()},s.prototype.decrement=function(e){void 0===e&&(e=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,e,"decrement")),this.raiseChangeEvent()},s.prototype.destroy=function(){if(this.unwireEvents(),!t.isBlazor()||!this.isServerRendered){t.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),t.detach(this.spinUp),t.detach(this.spinDown));for(var e=["aria-labelledby","role","autocomplete","aria-readonly","autocorrect","aria-disabled","aria-placeholder","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-live","aria-valuenow","aria-invalid"],s=0;s<e.length;s++)this.element.removeAttribute(e[s]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),t.detach(this.container),i.prototype.destroy.call(this)}},s.prototype.getText=function(){return this.element.value},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),t.addClass([this.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),t.removeClass([this.container],["e-input-focus"]))},s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n<a.length;n++){var r=a[n];switch(r){case"width":this.setElementWidth(i.width);break;case"cssClass":this.updateCssClass(i.cssClass,s.cssClass);break;case"enabled":e.Input.setEnabled(i.enabled,this.element);break;case"enableRtl":e.Input.setEnableRtl(i.enableRtl,[this.container]);break;case"readonly":e.Input.setReadonly(i.readonly,this.element),this.readonly?t.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.updateDataAttribute(!0),this.checkAttributes(!0),e.Input.validateInputType(this.container,this.element);break;case"placeholder":e.Input.setPlaceholder(i.placeholder,this.element);break;case"step":this.step=i.step,this.validateStep();break;case"showSpinButton":this.updateSpinButton(i);break;case"showClearButton":this.updateClearButton(i);break;case"floatLabelType":this.floatLabelType=i.floatLabelType,this.floatLabelTypeUpdate();break;case"value":this.isDynamicChange=(this.isAngular||this.isVue)&&this.preventChange,this.updateValue(i.value),this.isDynamicChange&&(this.preventChange=!1,this.isDynamicChange=!1);break;case"min":case"max":t.setValue(r,t.getValue(r,i),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=i.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.setSpinButton(),this.updatePlaceholder(),e.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":var l=t.getValue(r,i);this.setProperties({currencyCode:l},!0),this.updateCurrency(r,l);break;case"currencyCode":var o=t.getValue(r,i);this.setProperties({currency:o},!0),this.updateCurrency("currency",o);break;case"format":t.setValue(r,t.getValue(r,i),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=i.decimals,this.updateValue(this.value)}}},s.prototype.updateClearButton=function(i){t.isBlazor()?this.showClearButton&&(this.inputWrapper.clearButton=this.container.querySelector(".e-clear-icon"),e.Input.wireClearBtnEvents(this.element,this.inputWrapper.clearButton,this.inputWrapper.container)):(e.Input.setClearButton(i.showClearButton,this.element,this.inputWrapper,void 0,this.createElement),this.bindClearEvent())},s.prototype.updateSpinButton=function(e){t.isBlazor()?this.showSpinButton&&(this.spinDown=this.container.querySelector(".e-spin-down"),this.spinUp=this.container.querySelector("."+G),this.wireSpinBtnEvents()):e.showSpinButton?this.spinBtnCreation():(t.detach(this.spinUp),t.detach(this.spinDown))},s.prototype.getModuleName=function(){return"numerictextbox"},Z([t.Property("")],s.prototype,"cssClass",void 0),Z([t.Property(null)],s.prototype,"value",void 0),Z([t.Property(-Number.MAX_VALUE)],s.prototype,"min",void 0),Z([t.Property(Number.MAX_VALUE)],s.prototype,"max",void 0),Z([t.Property(1)],s.prototype,"step",void 0),Z([t.Property(null)],s.prototype,"width",void 0),Z([t.Property(null)],s.prototype,"placeholder",void 0),Z([t.Property({})],s.prototype,"htmlAttributes",void 0),Z([t.Property(!0)],s.prototype,"showSpinButton",void 0),Z([t.Property(!1)],s.prototype,"readonly",void 0),Z([t.Property(!0)],s.prototype,"enabled",void 0),Z([t.Property(!1)],s.prototype,"showClearButton",void 0),Z([t.Property(!1)],s.prototype,"enablePersistence",void 0),Z([t.Property("n2")],s.prototype,"format",void 0),Z([t.Property(null)],s.prototype,"decimals",void 0),Z([t.Property(null)],s.prototype,"currency",void 0),Z([t.Property(null)],s.prototype,"currencyCode",void 0),Z([t.Property(!0)],s.prototype,"strictMode",void 0),Z([t.Property(!1)],s.prototype,"validateDecimalOnType",void 0),Z([t.Property("Never")],s.prototype,"floatLabelType",void 0),Z([t.Event()],s.prototype,"created",void 0),Z([t.Event()],s.prototype,"destroyed",void 0),Z([t.Event()],s.prototype,"change",void 0),Z([t.Event()],s.prototype,"focus",void 0),Z([t.Event()],s.prototype,"blur",void 0),s=Z([t.NotifyPropertyChanges],s)}(t.Component),ee="e-error",te="e-input-group",ie="e-float-input",se="e-utility-mask",ne="e-label-top",ae="e-label-bottom",re={0:"[0-9]",9:"[0-9 ]","#":"[0-9 +-]",L:"[A-Za-z]","?":"[A-Za-z ]","&":"[^ ]+",C:"[^]+",A:"[A-Za-z0-9]",a:"[A-Za-z0-9 ]"},le=function(){function e(){}return e}(),oe=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),he=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},de=["title","style","class"],ue=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.initInputValue="",s.isAngular=!1,s.preventChange=!1,s.isClicked=!1,s.maskOptions=e,s}return oe(s,i),s.prototype.getModuleName=function(){return"maskedtextbox"},s.prototype.preRender=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.regExpCollec=re,this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.changeEventArgs={},this.focusEventArgs={},this.blurEventArgs={},this.maskKeyPress=!1,this.isFocus=!1,this.isInitial=!1,this.isIosInvalid=!1;var e=t.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],["e-control","e-maskedtextbox","e-lib"]),this.angularTagName=null,this.formElement=t.closest(this.element,"form"),"EJS-MASKEDTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;for(var i=this.createElement("input"),s=0;s<this.element.attributes.length;s++)i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML;this.element.hasAttribute("id")&&this.element.removeAttribute("id"),this.element.classList.remove("e-control","e-maskedtextbox"),this.element.classList.add("e-mask-container"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}this.updateHTMLAttrToElement(),this.checkHtmlAttributes(!1),this.formElement&&(this.initInputValue=this.value)},s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.render=function(){var e=this;if("input"===this.element.tagName.toLowerCase()){var i=t.isBlazor()&&this.isServerRendered;"Never"===this.floatLabelType&&t.addClass([this.element],"e-input"),this.createWrapper(),this.updateHTMLAttrToWrapper(),""===this.element.name&&this.element.setAttribute("name",this.element.id),this.isInitial=!0,i&&!0===t.Browser.isIE?setTimeout(function(){e.resetMaskedTextBox()}):this.resetMaskedTextBox(),this.isInitial=!1,this.setMaskPlaceholder(!0,!1),this.setWidth(this.width),this.preEleVal=this.element.value,t.Browser.isDevice||"11.0"!==t.Browser.info.version&&"edge"!==t.Browser.info.name||this.element.blur(),t.Browser.isDevice&&t.Browser.isIos&&this.element.blur(),(this.element.getAttribute("value")||this.value)&&this.element.setAttribute("value",this.element.value),this.renderComplete()}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];de.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getValidClassList(t),[this.inputObj.container],this.getValidClassList(i))},s.prototype.getValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(de.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==n&&t.addClass([this.inputObj.container],n.split(" "))}else if("style"===s){var a=this.inputObj.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.inputObj.container.setAttribute(s,a)}else this.inputObj.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.resetMaskedTextBox=function(){this.promptMask="",this.hiddenMask="",this.escapeMaskValue="",this.customRegExpCollec=[],this.undoCollec=[],this.redoCollec=[],this.promptChar.length>1&&(this.promptChar=this.promptChar[0]),n.call(this),a.call(this),(null===this.mask||""===this.mask&&void 0!==this.value)&&I.call(this,this.value);var e=p.call(this,this.element);this.prevValue=e,this.value=e,this.isInitial||l.call(this),r.call(this)},s.prototype.setMaskPlaceholder=function(t,i){(i||this.placeholder)&&(e.Input.setPlaceholder(this.placeholder,this.element),(this.element.value===this.promptMask&&t&&"Always"!==this.floatLabelType||this.element.value===this.promptMask&&"Never"===this.floatLabelType)&&I.call(this,""))},s.prototype.setWidth=function(e){if(!t.isNullOrUndefined(e))if("number"==typeof e)this.inputObj.container.style.width=t.formatUnit(e),this.element.style.width=t.formatUnit(e);else if("string"==typeof e){var i=e.match(/px|%|em/)?e:t.formatUnit(e);this.inputObj.container.style.width=i,this.element.style.width=i}},s.prototype.checkHtmlAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"placeholder":(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"disabled":if(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"value":(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.value||e)&&this.setProperties({value:this.element.value},!e);break;case"readonly":if(t.isNullOrUndefined(this.maskOptions)||void 0===this.maskOptions.readonly||e){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!e)}}}},s.prototype.createWrapper=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getValidClassList(this.cssClass)),this.inputObj=e.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{enableRtl:this.enableRtl,cssClass:i,enabled:this.enabled,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}},this.createElement),this.inputObj.container.setAttribute("class","e-control-wrapper e-mask "+this.inputObj.container.getAttribute("class"))},s.prototype.onPropertyChanged=function(t,i){for(var s=0,n=Object.keys(t);s<n.length;s++)switch(n[s]){case"value":D.call(this,this.value),this.placeholder&&this.setMaskPlaceholder(!1,!1);break;case"placeholder":this.setMaskPlaceholder(!0,!0);break;case"width":this.setWidth(t.width);break;case"cssClass":this.updateCssClass(t.cssClass,i.cssClass);break;case"enabled":e.Input.setEnabled(t.enabled,this.element,this.floatLabelType,this.inputObj.container);break;case"readonly":e.Input.setReadonly(t.readonly,this.element);break;case"enableRtl":e.Input.setEnableRtl(t.enableRtl,[this.inputObj.container]);break;case"customCharacters":this.customCharacters=t.customCharacters,this.resetMaskedTextBox();break;case"showClearButton":e.Input.setClearButton(t.showClearButton,this.element,this.inputObj,void 0,this.createElement),o.call(this);break;case"floatLabelType":this.floatLabelType=t.floatLabelType,e.Input.removeFloating(this.inputObj),e.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement);break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHtmlAttributes(!0);break;case"mask":var a=this.value;this.mask=t.mask,this.updateValue(a);break;case"promptChar":t.promptChar.length>1&&(t.promptChar=t.promptChar[0]),t.promptChar?this.promptChar=t.promptChar:this.promptChar="_";var r=this.element.value.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar);this.promptMask===this.element.value&&(r=this.promptMask.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar)),this.promptMask=this.promptMask.replace(new RegExp("["+i.promptChar+"]","g"),this.promptChar),this.undoCollec=this.redoCollec=[],I.call(this,r)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},s.prototype.updateValue=function(e){this.resetMaskedTextBox(),D.call(this,e)},s.prototype.getMaskedValue=function(){return c.call(this,this.element)},s.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),t.addClass([this.inputObj.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),t.removeClass([this.inputObj.container],["e-input-focus"]))},s.prototype.destroy=function(){l.call(this);for(var e=["aria-labelledby","role","autocomplete","aria-readonly","autocorrect","aria-disabled","aria-placeholder","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-valuenow","aria-invalid"],s=0;s<e.length;s++)this.element.removeAttribute(e[s]);this.element.classList.remove("e-input"),this.inputObj.container.insertAdjacentElement("afterend",this.element),t.detach(this.inputObj.container),i.prototype.destroy.call(this)},he([t.Property(null)],s.prototype,"cssClass",void 0),he([t.Property(null)],s.prototype,"width",void 0),he([t.Property(null)],s.prototype,"placeholder",void 0),he([t.Property("Never")],s.prototype,"floatLabelType",void 0),he([t.Property({})],s.prototype,"htmlAttributes",void 0),he([t.Property(!0)],s.prototype,"enabled",void 0),he([t.Property(!1)],s.prototype,"readonly",void 0),he([t.Property(!1)],s.prototype,"showClearButton",void 0),he([t.Property(!1)],s.prototype,"enablePersistence",void 0),he([t.Property(null)],s.prototype,"mask",void 0),he([t.Property("_")],s.prototype,"promptChar",void 0),he([t.Property(null)],s.prototype,"value",void 0),he([t.Property(null)],s.prototype,"customCharacters",void 0),he([t.Event()],s.prototype,"created",void 0),he([t.Event()],s.prototype,"destroyed",void 0),he([t.Event()],s.prototype,"change",void 0),he([t.Event()],s.prototype,"focus",void 0),he([t.Event()],s.prototype,"blur",void 0),s=he([t.NotifyPropertyChanges],s)}(t.Component),ce=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),pe=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("None")],i.prototype,"placement",void 0),pe([t.Property(10)],i.prototype,"largeStep",void 0),pe([t.Property(1)],i.prototype,"smallStep",void 0),pe([t.Property(!1)],i.prototype,"showSmallTicks",void 0),pe([t.Property(null)],i.prototype,"format",void 0),i}(t.ChildProperty),ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property(null)],i.prototype,"color",void 0),pe([t.Property(null)],i.prototype,"start",void 0),pe([t.Property(null)],i.prototype,"end",void 0),i}(t.ChildProperty),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property(!1)],i.prototype,"enabled",void 0),pe([t.Property(null)],i.prototype,"minStart",void 0),pe([t.Property(null)],i.prototype,"minEnd",void 0),pe([t.Property(null)],i.prototype,"maxStart",void 0),pe([t.Property(null)],i.prototype,"maxEnd",void 0),pe([t.Property(!1)],i.prototype,"startHandleFixed",void 0),pe([t.Property(!1)],i.prototype,"endHandleFixed",void 0),i}(t.ChildProperty),ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("")],i.prototype,"cssClass",void 0),pe([t.Property("Before")],i.prototype,"placement",void 0),pe([t.Property("Focus")],i.prototype,"showOn",void 0),pe([t.Property(!1)],i.prototype,"isVisible",void 0),pe([t.Property(null)],i.prototype,"format",void 0),i}(t.ChildProperty),ye={root:"e-slider",rtl:"e-rtl",sliderHiddenInput:"e-slider-input",controlWrapper:"e-control-wrapper",sliderHandle:"e-handle",rangeBar:"e-range",sliderButton:"e-slider-button",firstButton:"e-first-button",secondButton:"e-second-button",scale:"e-scale",tick:"e-tick",large:"e-large",tickValue:"e-tick-value",sliderTooltip:"e-slider-tooltip",sliderHover:"e-slider-hover",sliderFirstHandle:"e-handle-first",sliderSecondHandle:"e-handle-second",sliderDisabled:"e-disabled",sliderContainer:"e-slider-container",horizontalTooltipBefore:"e-slider-horizontal-before",horizontalTooltipAfter:"e-slider-horizontal-after",verticalTooltipBefore:"e-slider-vertical-before",verticalTooltipAfter:"e-slider-vertical-after",materialTooltip:"e-material-tooltip",materialTooltipOpen:"e-material-tooltip-open",materialTooltipActive:"e-tooltip-active",materialSlider:"e-material-slider",sliderTrack:"e-slider-track",sliderHorizantalColor:"e-slider-horizantal-color",sliderVerticalColor:"e-slider-vertical-color",sliderHandleFocused:"e-handle-focused",verticalSlider:"e-vertical",horizontalSlider:"e-horizontal",sliderHandleStart:"e-handle-start",sliderTooltipStart:"e-material-tooltip-start",sliderTabHandle:"e-tab-handle",sliderButtonIcon:"e-button-icon",sliderSmallSize:"e-small-size",sliderTickPosition:"e-tick-pos",sliderFirstTick:"e-first-tick",sliderLastTick:"e-last-tick",sliderButtonClass:"e-slider-btn",sliderTooltipWrapper:"e-tooltip-wrap",sliderTabTrack:"e-tab-track",sliderTabRange:"e-tab-range",sliderActiveHandle:"e-handle-active",sliderMaterialHandle:"e-material-handle",sliderMaterialRange:"e-material-range",sliderMaterialDefault:"e-material-default",materialTooltipShow:"e-material-tooltip-show",materialTooltipHide:"e-material-tooltip-hide",readonly:"e-read-only",limits:"e-limits",limitBarDefault:"e-limit-bar",limitBarFirst:"e-limit-first",limitBarSecond:"e-limit-second",dragHorizontal:"e-drag-horizontal",dragVertical:"e-drag-vertical"},be=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.horDir="left",s.verDir="bottom",s.transition={handle:"left .4s cubic-bezier(.25, .8, .25, 1), right .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1) , bottom .4s cubic-bezier(.25, .8, .25, 1)",rangeBar:"all .4s cubic-bezier(.25, .8, .25, 1)"},s.transitionOnMaterialTooltip={handle:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, top 1ms ease-out",rangeBar:"left 1ms ease-out, right 1ms ease-out, bottom 1ms ease-out, width 1ms ease-out, height 1ms ease-out"},s.scaleTransform="transform .4s cubic-bezier(.25, .8, .25, 1)",s.customAriaText=null,s.drag=!0,s.isDragComplete=!1,s.initialTooltip=!0,s}return ce(s,e),s.prototype.preRender=function(){var e={incrementTitle:"Increase",decrementTitle:"Decrease"};this.l10n=new t.L10n("slider",e,this.locale),this.isElementFocused=!1,this.tickElementCollection=[],this.tooltipFormatInfo={},this.ticksFormatInfo={},this.initCultureInfo(),this.initCultureFunc(),this.formChecker()},s.prototype.formChecker=function(){var e=t.closest(this.element,"form");e?(this.isForm=!0,t.isNullOrUndefined(this.formResetValue)||this.setProperties({value:this.formResetValue},!0),this.formResetValue=this.value,"Range"!==this.type||!t.isNullOrUndefined(this.formResetValue)&&"object"==typeof this.formResetValue?t.isNullOrUndefined(this.formResetValue)&&(this.formResetValue=parseFloat(t.formatUnit(this.min))):this.formResetValue=[parseFloat(t.formatUnit(this.min)),parseFloat(t.formatUnit(this.max))],this.formElement=e):this.isForm=!1},s.prototype.initCultureFunc=function(){this.internationalization=new t.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.tooltipFormatInfo.format=t.isNullOrUndefined(this.tooltip.format)?null:this.tooltip.format,this.ticksFormatInfo.format=t.isNullOrUndefined(this.ticks.format)?null:this.ticks.format},s.prototype.formatString=function(e,t){var i=null,s=null;if(e||0===e){i=this.formatNumber(e);var n=this.numberOfDecimals(e);s=this.internationalization.getNumberFormat(t)(this.makeRoundNumber(e,n))}return{elementVal:i,formatString:s}},s.prototype.formatNumber=function(e){var t=this.numberOfDecimals(e);return this.internationalization.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},s.prototype.numberOfDecimals=function(e){var t=e.toString().split(".")[1];return t&&t.length?t.length:0},s.prototype.makeRoundNumber=function(e,t){var i=t||0;return Number(e.toFixed(i))},s.prototype.fractionalToInteger=function(e){e=0===this.numberOfDecimals(e)?Number(e).toFixed(this.noOfDecimals):e;for(var t=1,i=0;i<this.noOfDecimals;i++)t*=10;return e=Number((e*t).toFixed(0))},s.prototype.render=function(){t.isBlazor()&&this.isServerRendered||this.initialize(),this.initRender(),this.wireEvents(),this.setZindex(),this.renderComplete()},s.prototype.initialize=function(){t.addClass([this.element],ye.root),this.setCSSClass()},s.prototype.setElementWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.sliderContainer.style.width=t.formatUnit(e):"string"==typeof e&&(this.sliderContainer.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.setCSSClass=function(e){e&&t.removeClass([this.element],e.split(" ")),this.cssClass&&t.addClass([this.element],this.cssClass.split(" "))},s.prototype.setEnabled=function(){this.enabled?(t.removeClass([this.sliderContainer],[ye.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.remove(ye.sliderDisabled),this.wireEvents()):(t.addClass([this.sliderContainer],[ye.sliderDisabled]),this.tooltip.isVisible&&this.tooltipElement&&"Always"===this.tooltip.showOn&&this.tooltipElement.classList.add(ye.sliderDisabled),this.unwireEvents())},s.prototype.getTheme=function(e){return window.getComputedStyle(e,":after").getPropertyValue("content").replace(/['"]+/g,"")},s.prototype.initRender=function(){t.isBlazor()&&this.isServerRendered?(this.sliderContainer=this.element.parentElement,this.sliderTrack=this.element.querySelector(".e-slider-track"),this.hiddenInput=this.element.parentElement.querySelector(".e-slider-input")):(this.sliderContainer=this.createElement("div",{className:ye.sliderContainer+" "+ye.controlWrapper}),this.element.parentNode.insertBefore(this.sliderContainer,this.element),this.sliderContainer.appendChild(this.element),this.sliderTrack=this.createElement("div",{className:ye.sliderTrack}),this.element.appendChild(this.sliderTrack)),this.setElementWidth(this.width),this.element.tabIndex=-1,this.getThemeInitialization(),this.setHandler(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),t.isBlazor()&&this.isServerRendered||(this.setOrientClass(),this.hiddenInput=this.createElement("input",{attrs:{type:"hidden",value:t.isNullOrUndefined(this.value)?this.min.toString():this.value.toString(),name:this.element.getAttribute("name")||this.element.getAttribute("id")||"_"+(1e3*Math.random()).toFixed(0)+"slider",class:ye.sliderHiddenInput}}),this.hiddenInput.tabIndex=-1,this.sliderContainer.appendChild(this.hiddenInput)),this.showButtons&&this.setButtons(),this.setEnableRTL(),"Range"===this.type?this.rangeValueUpdate():this.value=t.isNullOrUndefined(this.value)?parseFloat(t.formatUnit(this.min.toString())):this.value,this.previousVal="Range"!==this.type?this.checkHandleValue(parseFloat(t.formatUnit(this.value.toString()))):[this.checkHandleValue(parseFloat(t.formatUnit(this.value[0].toString()))),this.checkHandleValue(parseFloat(t.formatUnit(this.value[1].toString())))],this.previousChanged=this.previousVal,t.isNullOrUndefined(this.element.hasAttribute("name"))||this.element.removeAttribute("name"),this.setValue(),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.renderScale(),this.tooltip.isVisible&&this.renderTooltip(),t.isBlazor()&&this.isServerRendered||(this.enabled?t.removeClass([this.sliderContainer],[ye.sliderDisabled]):t.addClass([this.sliderContainer],[ye.sliderDisabled]),this.readonly?t.addClass([this.sliderContainer],[ye.readonly]):t.removeClass([this.sliderContainer],[ye.readonly]))},s.prototype.getThemeInitialization=function(){this.isMaterial="material"===this.getTheme(this.sliderContainer)||"material-dark"===this.getTheme(this.sliderContainer),this.isBootstrap="bootstrap"===this.getTheme(this.sliderContainer)||"bootstrap-dark"===this.getTheme(this.sliderContainer),this.isBootstrap4="bootstrap4"===this.getTheme(this.sliderContainer),this.isTailwind="tailwind"===this.getTheme(this.sliderContainer)||"tailwind-dark"===this.getTheme(this.sliderContainer),this.isMaterialTooltip=this.isMaterial&&"Range"!==this.type&&this.tooltip.isVisible},s.prototype.createRangeBar=function(){"Default"!==this.type&&(this.rangeBar=this.createElement("div",{attrs:{class:ye.rangeBar}}),this.element.appendChild(this.rangeBar),this.drag&&"Range"===this.type&&("Horizontal"===this.orientation?this.rangeBar.classList.add(ye.dragHorizontal):this.rangeBar.classList.add(ye.dragVertical)))},s.prototype.createLimitBar=function(){if(t.isBlazor()&&this.isServerRendered)this.limitBarFirst=this.element.querySelectorAll(".e-limits")[0],"Range"===this.type&&(this.limitBarSecond=this.element.querySelectorAll(".e-limit-second")[0]);else{var e="Range"!==this.type?ye.limitBarDefault:ye.limitBarFirst;e+=" "+ye.limits,this.limitBarFirst=this.createElement("div",{attrs:{class:e}}),this.element.appendChild(this.limitBarFirst),"Range"===this.type&&(this.limitBarSecond=this.createElement("div",{attrs:{class:ye.limitBarSecond+" "+ye.limits}}),this.element.appendChild(this.limitBarSecond))}},s.prototype.setOrientClass=function(){"Vertical"!==this.orientation?(this.sliderContainer.classList.remove(ye.verticalSlider),this.sliderContainer.classList.add(ye.horizontalSlider),this.firstHandle.setAttribute("aria-orientation","horizontal"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","horizontal")):(this.sliderContainer.classList.remove(ye.horizontalSlider),this.sliderContainer.classList.add(ye.verticalSlider),this.firstHandle.setAttribute("aria-orientation","vertical"),"Range"===this.type&&this.secondHandle.setAttribute("aria-orientation","vertical"))},s.prototype.setAriaAttributes=function(e){var i=this,s=this.min,n=this.max;!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(s=this.customValues[0],n=this.customValues[this.customValues.length-1]),"Range"!==this.type?t.attributes(e,{"aria-valuemin":s.toString(),"aria-valuemax":n.toString()}):(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?[[s.toString(),this.customValues[this.value[1]].toString()],[this.customValues[this.value[0]].toString(),n.toString()]]:[[s.toString(),this.value[1].toString()],[this.value[0].toString(),n.toString()]]).forEach(function(e,s){var n=0===s?i.firstHandle:i.secondHandle;n&&t.attributes(n,{"aria-valuemin":e[0],"aria-valuemax":e[1]})})},s.prototype.createSecondHandle=function(){t.isBlazor()&&this.isServerRendered?this.secondHandle=this.element.querySelector(".e-handle-second"):(this.secondHandle=this.createElement("div",{attrs:{class:ye.sliderHandle,role:"slider",tabIndex:"0"}}),this.secondHandle.classList.add(ye.sliderSecondHandle),this.element.appendChild(this.secondHandle))},s.prototype.createFirstHandle=function(){t.isBlazor()&&this.isServerRendered?this.firstHandle=this.element.querySelector(".e-handle-first"):(this.firstHandle=this.createElement("div",{attrs:{class:ye.sliderHandle,role:"slider",tabIndex:"0"}}),this.firstHandle.classList.add(ye.sliderFirstHandle),this.element.appendChild(this.firstHandle)),this.isMaterialTooltip&&(this.materialHandle=this.createElement("div",{attrs:{class:ye.sliderHandle+" "+ye.sliderMaterialHandle}}),this.element.appendChild(this.materialHandle))},s.prototype.wireFirstHandleEvt=function(e){e?(t.EventHandler.remove(this.firstHandle,"mousedown touchstart",this.handleFocus),t.EventHandler.remove(this.firstHandle,"transitionend",this.transitionEnd),t.EventHandler.remove(this.firstHandle,"mouseenter touchenter",this.handleOver),t.EventHandler.remove(this.firstHandle,"mouseleave touchend",this.handleLeave)):(t.EventHandler.add(this.firstHandle,"mousedown touchstart",this.handleFocus,this),t.EventHandler.add(this.firstHandle,"transitionend",this.transitionEnd,this),t.EventHandler.add(this.firstHandle,"mouseenter touchenter",this.handleOver,this),t.EventHandler.add(this.firstHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.wireSecondHandleEvt=function(e){e?(t.EventHandler.remove(this.secondHandle,"mousedown touchstart",this.handleFocus),t.EventHandler.remove(this.secondHandle,"transitionend",this.transitionEnd),t.EventHandler.remove(this.secondHandle,"mouseenter touchenter",this.handleOver),t.EventHandler.remove(this.secondHandle,"mouseleave touchend",this.handleLeave)):(t.EventHandler.add(this.secondHandle,"mousedown touchstart",this.handleFocus,this),t.EventHandler.add(this.secondHandle,"transitionend",this.transitionEnd,this),t.EventHandler.add(this.secondHandle,"mouseenter touchenter",this.handleOver,this),t.EventHandler.add(this.secondHandle,"mouseleave touchend",this.handleLeave,this))},s.prototype.handleStart=function(){"Range"!==this.type&&(this.firstHandle.classList[0===this.handlePos1?"add":"remove"](ye.sliderHandleStart),this.isMaterialTooltip&&(this.materialHandle.classList[0===this.handlePos1?"add":"remove"](ye.sliderHandleStart),this.tooltipElement&&this.tooltipElement.classList[0===this.handlePos1?"add":"remove"](ye.sliderTooltipStart)))},s.prototype.transitionEnd=function(e){"transform"!==e.propertyName&&(this.handleStart(),this.getHandle().style.transition="none","Default"!==this.type&&(this.rangeBar.style.transition="none"),this.isMaterial&&this.tooltip.isVisible&&"Default"===this.type&&(this.tooltipElement.style.transition=this.transition.handle),this.tooltipToggle(this.getHandle()),this.closeTooltip())},s.prototype.handleFocusOut=function(){this.firstHandle.classList.contains(ye.sliderHandleFocused)&&this.firstHandle.classList.remove(ye.sliderHandleFocused),"Range"===this.type&&this.secondHandle.classList.contains(ye.sliderHandleFocused)&&this.secondHandle.classList.remove(ye.sliderHandleFocused)},s.prototype.handleFocus=function(e){this.focusSliderElement(),this.sliderBarClick(e),e.currentTarget===this.firstHandle?this.firstHandle.classList.add(ye.sliderHandleFocused):this.secondHandle.classList.add(ye.sliderHandleFocused),t.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.handleOver=function(e){this.tooltip.isVisible&&"Hover"===this.tooltip.showOn&&this.tooltipToggle(e.currentTarget),"Default"===this.type&&this.tooltipToggle(this.getHandle())},s.prototype.handleLeave=function(e){!this.tooltip.isVisible||"Hover"!==this.tooltip.showOn||e.currentTarget.classList.contains(ye.sliderHandleFocused)||e.currentTarget.classList.contains(ye.sliderTabHandle)||this.closeTooltip()},s.prototype.setHandler=function(){this.min>this.max&&(this.min=this.max),this.createFirstHandle(),"Range"===this.type&&this.createSecondHandle()},s.prototype.setEnableRTL=function(){if(!t.isBlazor()||!this.isServerRendered){this.enableRtl&&"Vertical"!==this.orientation?t.addClass([this.sliderContainer],ye.rtl):t.removeClass([this.sliderContainer],ye.rtl);var e="Vertical"!==this.orientation?this.horDir:this.verDir;this.enableRtl?(this.horDir="right",this.verDir="bottom"):(this.horDir="left",this.verDir="bottom"),e!==("Vertical"!==this.orientation?this.horDir:this.verDir)&&"Horizontal"===this.orientation&&(t.setStyleAttribute(this.firstHandle,{right:"",left:"auto"}),"Range"===this.type&&t.setStyleAttribute(this.secondHandle,{top:"",left:"auto"}))}this.setBarColor()},s.prototype.tooltipValue=function(){var e,i=this,s={value:this.value,text:""};this.initialTooltip&&(this.initialTooltip=!1,t.isBlazor()&&this.isServerRendered?s.text=this.formatContent(this.tooltipFormatInfo,!1):(this.setTooltipContent(),s.text=e=this.tooltipObj.content),this.trigger("tooltipChange",s,function(t){i.addTooltipClass(t.text),e!==t.text&&(i.customAriaText=t.text,i.tooltipObj.content=t.text,i.setAriaAttrValue(i.firstHandle),"Range"===i.type&&i.setAriaAttrValue(i.secondHandle))}),this.isMaterialTooltip&&this.setPreviousVal("change",this.value))},s.prototype.setTooltipContent=function(){var e;e=this.formatContent(this.tooltipFormatInfo,!1),this.tooltipObj.content=e},s.prototype.formatContent=function(e,i){var s="",n=this.handleVal1,a=this.handleVal2;return!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(n=this.customValues[this.handleVal1],a=this.customValues[this.handleVal2]),i?("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?a.toString()+" - "+n.toString():this.formatString(a,e).elementVal+" - "+this.formatString(n,e).elementVal:t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?n.toString()+" - "+a.toString():this.formatString(n,e).elementVal+" - "+this.formatString(a,e).elementVal:t.isNullOrUndefined(n)||(s=t.isNullOrUndefined(this.tooltip)||t.isNullOrUndefined(this.tooltip.format)?n.toString():this.formatString(n,e).elementVal),s):("Range"===this.type?s=this.enableRtl&&"Vertical"!==this.orientation?t.isNullOrUndefined(e.format)?a.toString()+" - "+n.toString():this.formatString(a,e).formatString+" - "+this.formatString(n,e).formatString:t.isNullOrUndefined(e.format)?n.toString()+" - "+a.toString():this.formatString(n,e).formatString+" - "+this.formatString(a,e).formatString:t.isNullOrUndefined(n)||(s=t.isNullOrUndefined(e.format)?n.toString():this.formatString(n,e).formatString),s)},s.prototype.addTooltipClass=function(e){if(this.isMaterialTooltip){var t=e.toString().length;if(this.tooltipElement){i=t>4?{oldCss:ye.sliderMaterialDefault,newCss:ye.sliderMaterialRange}:{oldCss:ye.sliderMaterialRange,newCss:ye.sliderMaterialDefault};this.tooltipElement.classList.remove(i.oldCss),this.tooltipElement.classList.contains(i.newCss)||(this.tooltipElement.classList.add(i.newCss),this.tooltipElement.style.transform=t>4?"scale(1)":this.getTooltipTransformProperties(this.previousTooltipClass).rotate)}else{var i=t>4?ye.sliderMaterialRange:ye.sliderMaterialDefault;this.tooltipObj.cssClass=ye.sliderTooltip+" "+i}}},s.prototype.tooltipPlacement=function(){return"Horizontal"===this.orientation?"Before"===this.tooltip.placement?"TopCenter":"BottomCenter":"Before"===this.tooltip.placement?"LeftCenter":"RightCenter"},s.prototype.tooltipBeforeOpen=function(e){this.tooltipElement=e.element,this.tooltip.cssClass&&t.addClass([this.tooltipElement],this.tooltip.cssClass.split(" ").filter(function(e){return e})),e.target.removeAttribute("aria-describedby"),this.isMaterialTooltip&&(this.tooltipElement.firstElementChild.classList.add(ye.materialTooltipHide),this.handleStart(),this.setTooltipTransform())},s.prototype.tooltipCollision=function(e){if(this.isBootstrap||this.isBootstrap4||this.isMaterial&&!this.isMaterialTooltip){var t=this.isBootstrap4?3:6;switch(e){case"TopCenter":this.tooltipObj.setProperties({offsetY:-t},!1);break;case"BottomCenter":this.tooltipObj.setProperties({offsetY:t},!1);break;case"LeftCenter":this.tooltipObj.setProperties({offsetX:-t},!1);break;case"RightCenter":this.tooltipObj.setProperties({offsetX:t},!1)}}},s.prototype.materialTooltipEventCallBack=function(e){this.sliderBarClick(e),t.EventHandler.add(document,"mousemove touchmove",this.sliderBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.sliderBarUp,this)},s.prototype.wireMaterialTooltipEvent=function(e){this.isMaterialTooltip&&(e?t.EventHandler.remove(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack):t.EventHandler.add(this.tooltipElement,"mousedown touchstart",this.materialTooltipEventCallBack,this))},s.prototype.tooltipPositionCalculation=function(e){var t;switch(e){case"TopCenter":t=ye.horizontalTooltipBefore;break;case"BottomCenter":t=ye.horizontalTooltipAfter;break;case"LeftCenter":t=ye.verticalTooltipBefore;break;case"RightCenter":t=ye.verticalTooltipAfter}return t},s.prototype.getTooltipTransformProperties=function(e){var t;if(this.tooltipElement){var i="Horizontal"===this.orientation?this.tooltipElement.clientHeight+14-this.tooltipElement.clientHeight/2:this.tooltipElement.clientWidth+14-this.tooltipElement.clientWidth/2;t="Horizontal"===this.orientation?e===ye.horizontalTooltipBefore?{rotate:"rotate(45deg)",translate:"translateY("+i+"px)"}:{rotate:"rotate(225deg)",translate:"translateY("+-i+"px)"}:e===ye.verticalTooltipBefore?{rotate:"rotate(-45deg)",translate:"translateX("+i+"px)"}:{rotate:"rotate(-225deg)",translate:"translateX("+-i+"px)"}}return t},s.prototype.openMaterialTooltip=function(){var e=this;if(this.isMaterialTooltip){this.refreshTooltip(this.firstHandle);var t=this.tooltipElement.firstElementChild;t.classList.remove(ye.materialTooltipHide),t.classList.add(ye.materialTooltipShow),this.firstHandle.style.cursor="default",this.tooltipElement.style.transition=this.scaleTransform,this.tooltipElement.classList.add(ye.materialTooltipOpen),this.materialHandle.style.transform="scale(0)",t.innerText.length>4?this.tooltipElement.style.transform="scale(1)":this.tooltipElement.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate,"Default"===this.type?setTimeout(function(){e.tooltipElement.style.transition=e.transition.handle},2500):setTimeout(function(){e.tooltipElement.style.transition="none"},2500)}},s.prototype.closeMaterialTooltip=function(){var e=this;if(this.isMaterialTooltip){var t=this.tooltipElement.firstElementChild;this.tooltipElement.style.transition=this.scaleTransform,t.classList.remove(ye.materialTooltipShow),t.classList.add(ye.materialTooltipHide),this.firstHandle.style.cursor="-webkit-grab",this.firstHandle.style.cursor="grab",this.materialHandle&&(this.materialHandle.style.transform="scale(1)"),this.tooltipElement.classList.remove(ye.materialTooltipOpen),this.setTooltipTransform(),this.tooltipTarget=void 0,setTimeout(function(){e.tooltipElement.style.transition="none"},2500)}},s.prototype.checkTooltipPosition=function(e){var t=this.tooltipPositionCalculation(e.collidedPosition);void 0!==this.tooltipCollidedPosition&&this.tooltipCollidedPosition===e.collidedPosition&&e.element.classList.contains(t)||(this.isMaterialTooltip&&(void 0!==t&&(e.element.classList.remove(this.previousTooltipClass),e.element.classList.add(t),this.previousTooltipClass=t),e.element.style.transform&&e.element.classList.contains(ye.materialTooltipOpen)&&e.element.firstElementChild.innerText.length<=4&&(e.element.style.transform=this.getTooltipTransformProperties(this.previousTooltipClass).rotate)),this.tooltipCollidedPosition=e.collidedPosition),this.isMaterialTooltip&&this.tooltipElement&&-1!==this.tooltipElement.style.transform.indexOf("translate")&&this.setTooltipTransform()},s.prototype.setTooltipTransform=function(){var e=this.getTooltipTransformProperties(this.previousTooltipClass);this.tooltipElement.firstElementChild.innerText.length>4?this.tooltipElement.style.transform=e.translate+" scale(0.01)":this.tooltipElement.style.transform=e.translate+" "+e.rotate+" scale(0.01)"},s.prototype.renderTooltip=function(){this.tooltipObj=new i.Tooltip({showTipPointer:this.isBootstrap||this.isMaterial||this.isBootstrap4||this.isTailwind,cssClass:ye.sliderTooltip,height:this.isMaterial?30:"auto",animation:{open:{effect:"None"},close:{effect:"FadeOut",duration:500}},opensOn:"Custom",beforeOpen:this.tooltipBeforeOpen.bind(this),beforeCollision:this.checkTooltipPosition.bind(this),beforeClose:this.tooltipBeforeClose.bind(this),enableHtmlSanitizer:this.enableHtmlSanitizer}),this.tooltipObj.appendTo(this.firstHandle),this.initializeTooltipProps()},s.prototype.initializeTooltipProps=function(){var e=this.isMaterialTooltip?"Always":"Auto"===this.tooltip.showOn?"Hover":this.tooltip.showOn;this.setProperties({tooltip:{showOn:e}},!0),this.tooltipObj.position=this.tooltipPlacement(),this.tooltipCollision(this.tooltipObj.position),[this.firstHandle,this.rangeBar,this.secondHandle].forEach(function(e){t.isNullOrUndefined(e)||(e.style.transition="none")}),this.isMaterialTooltip&&(this.sliderContainer.classList.add(ye.materialSlider),t.isBlazor()||this.tooltipValue(),this.tooltipObj.animation.close.effect="None",this.tooltipObj.open(this.firstHandle))},s.prototype.tooltipBeforeClose=function(){this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0},s.prototype.setButtons=function(){t.isBlazor()&&this.isServerRendered?(this.firstBtn=this.element.parentElement.querySelector(".e-slider-button.e-first-button"),this.secondBtn=this.element.parentElement.querySelector(".e-slider-button.e-second-button")):(this.firstBtn=this.createElement("div",{className:ye.sliderButton+" "+ye.firstButton}),this.firstBtn.appendChild(this.createElement("span",{className:ye.sliderButtonIcon})),this.isTailwind&&this.firstBtn.querySelector("span").classList.add("e-icons"),this.firstBtn.tabIndex=-1,this.secondBtn=this.createElement("div",{className:ye.sliderButton+" "+ye.secondButton}),this.secondBtn.appendChild(this.createElement("span",{className:ye.sliderButtonIcon})),this.isTailwind&&this.secondBtn.querySelector("span").classList.add("e-icons"),this.secondBtn.tabIndex=-1,this.sliderContainer.classList.add(ye.sliderButtonClass),this.sliderContainer.appendChild(this.firstBtn),this.sliderContainer.appendChild(this.secondBtn),this.sliderContainer.appendChild(this.element),this.buttonTitle())},s.prototype.buttonTitle=function(){var e=this.enableRtl&&"Vertical"!==this.orientation;this.l10n.setLocale(this.locale);var i=this.l10n.getConstant("decrementTitle"),s=this.l10n.getConstant("incrementTitle");t.attributes(e?this.secondBtn:this.firstBtn,{"aria-label":i,title:i}),t.attributes(e?this.firstBtn:this.secondBtn,{"aria-label":s,title:s})},s.prototype.buttonFocusOut=function(){this.isMaterial&&this.getHandle().classList.remove("e-large-thumb-size")},s.prototype.repeatButton=function(e){var t,i=this.handleValueUpdate(),s=this.enableRtl&&"Vertical"!==this.orientation;e.target.parentElement.classList.contains(ye.firstButton)||e.target.classList.contains(ye.firstButton)?t=s?this.add(i,parseFloat(this.step.toString()),!0):this.add(i,parseFloat(this.step.toString()),!1):(e.target.parentElement.classList.contains(ye.secondButton)||e.target.classList.contains(ye.secondButton))&&(t=s?this.add(i,parseFloat(this.step.toString()),!1):this.add(i,parseFloat(this.step.toString()),!0)),this.limits.enabled&&(t=this.getLimitCorrectedValues(t)),t>=this.min&&t<=this.max&&(this.changeHandleValue(t),this.tooltipToggle(this.getHandle()))},s.prototype.repeatHandlerMouse=function(e){e.preventDefault(),"mousedown"!==e.type&&"touchstart"!==e.type||(this.buttonClick(e),this.repeatInterval=setInterval(this.repeatButton.bind(this),180,e))},s.prototype.materialChange=function(){this.getHandle().classList.contains("e-large-thumb-size")||this.getHandle().classList.add("e-large-thumb-size")},s.prototype.repeatHandlerUp=function(e){this.changeEvent("changed",e),this.closeTooltip(),clearInterval(this.repeatInterval),this.getHandle().focus()},s.prototype.customTickCounter=function(e){var i=4;return!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(e>4&&(i=3),e>7&&(i=2),e>14&&(i=1),e>28&&(i=0)),i},s.prototype.renderScale=function(){var e=0,i="Vertical"===this.orientation?"v":"h";this.noOfDecimals=this.numberOfDecimals(this.step),t.isBlazor()&&this.isServerRendered?this.ul=this.element.querySelector("ul"):this.ul=this.createElement("ul",{className:ye.scale+" e-"+i+"-scale "+ye.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),this.ul.style.zIndex="-1",t.Browser.isAndroid&&"h"===i&&this.ul.classList.add(ye.sliderTickPosition);var s=this.ticks.smallStep;this.ticks.showSmallTicks?s<=0&&(s=parseFloat(t.formatUnit(this.step))):s=this.ticks.largeStep>0?this.ticks.largeStep:parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min));var n=this.fractionalToInteger(this.min),a=this.fractionalToInteger(this.max),r=this.fractionalToInteger(s),l=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&this.customValues.length-1,o=this.customTickCounter(l),h=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?l*o+l:Math.abs((a-n)/r);t.isBlazor()&&this.isServerRendered||this.element.appendChild(this.ul);var d,u=parseFloat(this.min.toString());"v"===i&&(u=parseFloat(this.max.toString()));var c,p=0,m=100/h;m===1/0&&(m=5);for(var v=0,f=!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0?this.customValues.length-1:0,g=0;v<=h;v++){if(d=this.createElement("li",{attrs:{class:ye.tick,role:"presentation",tabIndex:"-1","aria-hidden":"true"}}),!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0)(c=v%(o+1)==0)&&("h"===i?(u=this.customValues[g],g++):(u=this.customValues[f],f--),d.setAttribute("title",u.toString()));else if(d.setAttribute("title",u.toString()),0===this.numberOfDecimals(this.max)&&0===this.numberOfDecimals(this.min)&&0===this.numberOfDecimals(this.step))c="h"===i?(u-parseFloat(this.min.toString()))%this.ticks.largeStep==0:Math.abs(u-parseFloat(this.max.toString()))%this.ticks.largeStep==0;else{var y=this.fractionalToInteger(this.ticks.largeStep),b=this.fractionalToInteger(u);c="h"===i?(b-n)%y==0:Math.abs(b-parseFloat(a.toString()))%y==0}c&&d.classList.add(ye.large),"h"===i?d.style.width=m+"%":d.style.height=m+"%";var E=c?"Both"===this.ticks.placement?2:1:0;if(c){for(var C=0;C<E;C++)this.createTick(d,u,m);t.isBlazor()&&this.isServerRendered&&t.isNullOrUndefined(this.customValues)&&(this.updateTicksValues(u,this.ul.children[e]),e++)}else t.isNullOrUndefined(this.customValues)&&(this.formatTicksValue(d,u),t.isBlazor()&&this.isServerRendered&&t.isNullOrUndefined(this.customValues)&&(this.updateTicksValues(u,this.ul.children[e]),e++));t.isBlazor()&&this.isServerRendered||this.ul.appendChild(d),this.tickElementCollection.push(d);var S=void 0;t.isNullOrUndefined(this.customValues)&&(S=this.numberOfDecimals(s)>this.numberOfDecimals(u)?this.numberOfDecimals(s):this.numberOfDecimals(u),u="h"===i?this.makeRoundNumber(u+s,S):this.makeRoundNumber(u-s,S),p=this.makeRoundNumber(p+s,S))}this.ticksAlignment(i,m)},s.prototype.updateTicksValues=function(e,t){if(t.childElementCount>0)for(var i=0;i<t.childElementCount;i++)this.blazortTicksValue(t,e,t.children[i]);else this.blazortTicksValue(t,e,null)},s.prototype.blazortTicksValue=function(e,i,s){var n=this,a=this.formatNumber(i),r={value:i,text:t.isNullOrUndefined(this.ticks)||t.isNullOrUndefined(this.ticks.format)?a:this.formatString(i,this.ticksFormatInfo).formatString,tickElement:e};this.trigger("renderingTicks",r,function(i){e.setAttribute("title",i.text.toString()),s&&(n.enableHtmlSanitizer?s.innerHTML=t.SanitizeHtmlHelper.sanitize(i.text.toString()):s.innerHTML=i.text.toString())})},s.prototype.ticksAlignment=function(e,t,i){void 0===i&&(i=!0),this.firstChild=this.ul.firstElementChild,this.lastChild=this.ul.lastElementChild,this.firstChild.classList.add(ye.sliderFirstTick),this.lastChild.classList.add(ye.sliderLastTick),this.sliderContainer.classList.add(ye.scale+"-"+this.ticks.placement.toLowerCase()),"h"===e?(this.firstChild.style.width=t/2+"%",this.lastChild.style.width=t/2+"%"):(this.firstChild.style.height=t/2+"%",this.lastChild.style.height=t/2+"%");var s={ticksWrapper:this.ul,tickElements:this.tickElementCollection};i&&this.trigger("renderedTicks",s),this.scaleAlignment()},s.prototype.createTick=function(e,i,s){var n=this.createElement("span",{className:ye.tickValue+" "+ye.tick+"-"+this.ticks.placement.toLowerCase(),attrs:{role:"presentation",tabIndex:"-1","aria-hidden":"true"}});e.appendChild(n),t.isNullOrUndefined(this.customValues)?this.formatTicksValue(e,i,n,s):this.enableHtmlSanitizer?n.innerHTML=t.SanitizeHtmlHelper.sanitize(i.toString()):n.innerHTML=i.toString()},s.prototype.formatTicksValue=function(e,i,s,n){var a=this,r=this.formatNumber(i),l={value:i,text:t.isNullOrUndefined(this.ticks)||t.isNullOrUndefined(this.ticks.format)?r:this.formatString(i,this.ticksFormatInfo).formatString,tickElement:e};this.trigger("renderingTicks",l,function(i){if(e.setAttribute("title",i.text.toString()),s&&(a.enableHtmlSanitizer?s.innerHTML=t.SanitizeHtmlHelper.sanitize(i.text.toString()):s.innerHTML=i.text.toString()),!t.isNullOrUndefined(a.renderingTicks)&&t.isBlazor()){var r="Horizontal"===a.orientation?"h":"v";a.ticksAlignment(r,n,!1)}})},s.prototype.scaleAlignment=function(){this.tickValuePosition();this.orientation;"Vertical"===this.orientation?this.element.getBoundingClientRect().width<=15?this.sliderContainer.classList.add(ye.sliderSmallSize):this.sliderContainer.classList.remove(ye.sliderSmallSize):this.element.getBoundingClientRect().height<=15?this.sliderContainer.classList.add(ye.sliderSmallSize):this.sliderContainer.classList.remove(ye.sliderSmallSize)},s.prototype.tickValuePosition=function(){this.firstChild=this.element.querySelector("ul").children[0];var e,i,s=this.firstChild.getBoundingClientRect(),n=this.ticks.smallStep,a=Math.abs(parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min)))/n;this.firstChild.children.length>0&&(e=this.firstChild.children[0].getBoundingClientRect());var r,l=[this.sliderContainer.querySelectorAll("."+ye.tick+"."+ye.large+" ."+ye.tickValue)];r="Both"===this.ticks.placement?[].slice.call(l[0],2):[].slice.call(l[0],1);for(var o="Vertical"===this.orientation?2*s.height:2*s.width,h=0;h<this.firstChild.children.length;h++)"Vertical"===this.orientation?t.isBlazor()&&this.isServerRendered||(this.firstChild.children[h].style.top=-e.height/2+"px"):this.enableRtl?this.firstChild.children[h].style.left=(o-this.firstChild.children[h].getBoundingClientRect().width)/2+"px":this.firstChild.children[h].style.left=-e.width/2+"px";for(h=0;h<r.length;h++)i=r[h].getBoundingClientRect(),"Vertical"===this.orientation?t.isBlazor()&&this.isServerRendered||t.setStyleAttribute(r[h],{top:(o-i.height)/2+"px"}):t.setStyleAttribute(r[h],{left:(o-i.width)/2+"px"});if(this.enableRtl&&this.lastChild.children.length&&0!==a&&(this.lastChild.children[0].style.left=-this.lastChild.getBoundingClientRect().width/2+"px","Both"===this.ticks.placement&&(t.isBlazor()||(this.lastChild.children[1].style.left=-this.lastChild.getBoundingClientRect().width/2+"px"))),0===a&&("Horizontal"===this.orientation&&(this.enableRtl?(this.firstChild.classList.remove(ye.sliderLastTick),this.firstChild.style.right=this.firstHandle.style.right,t.isBlazor()||(this.firstChild.children[0].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px","Both"===this.ticks.placement&&(this.firstChild.children[1].style.left=this.firstChild.getBoundingClientRect().width/2+2+"px"))):(this.firstChild.classList.remove(ye.sliderLastTick),t.isBlazor()||(this.firstChild.style.left=this.firstHandle.style.left))),t.isBlazor()&&this.isServerRendered||"Vertical"===this.orientation&&this.firstChild.classList.remove(ye.sliderLastTick)),t.isBlazor()&&this.isServerRendered){var d=void 0;null!=this.firstChild&&(d="Horizontal"===this.orientation?{firstTickPostion:this.firstChild.children[0].style.left}:{firstTickPostion:-e.height/2+"px"}),null!=r[0]&&(d="Horizontal"===this.orientation?{otherTicksPosition:r[0].style.left}:{otherTicksPosition:(o-i.height)/2+"px"}),null!=this.firstChild&&null!=r[0]&&(d="Horizontal"===this.orientation?{firstTickPostion:this.firstChild.children[0].style.left,otherTicksPosition:r[0].style.left}:{firstTickPostion:-e.height/2+"px",otherTicksPosition:(o-i.height)/2+"px"}),this.interopAdaptor.invokeMethodAsync("SliderTicksData",d)}},s.prototype.setAriaAttrValue=function(e){var i,s=!t.isNullOrUndefined(this.ticks)&&!t.isNullOrUndefined(this.ticks.format),n=s?this.formatContent(this.tooltipFormatInfo,!1):this.formatContent(this.ticksFormatInfo,!1),a=s?this.formatContent(this.ticksFormatInfo,!0):this.formatContent(this.tooltipFormatInfo,!0);i=2===(n=this.customAriaText?this.customAriaText:n).split(" - ").length?n.split(" - "):[n,n],this.setAriaAttributes(e),"Range"!==this.type?t.attributes(e,{"aria-valuenow":a,"aria-valuetext":n}):this.enableRtl?e===this.firstHandle?t.attributes(e,{"aria-valuenow":a.split(" - ")[1],"aria-valuetext":i[1]}):t.attributes(e,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):e===this.firstHandle?t.attributes(e,{"aria-valuenow":a.split(" - ")[0],"aria-valuetext":i[0]}):t.attributes(e,{"aria-valuenow":a.split(" - ")[1],"aria-valuetext":i[1]})},s.prototype.handleValueUpdate=function(){return"Range"===this.type?1===this.activeHandle?this.handleVal1:this.handleVal2:this.handleVal1},s.prototype.getLimitCorrectedValues=function(e){return e="MinRange"===this.type||"Default"===this.type?this.getLimitValueAndPosition(e,this.limits.minStart,this.limits.minEnd)[0]:1===this.activeHandle?this.getLimitValueAndPosition(e,this.limits.minStart,this.limits.minEnd)[0]:this.getLimitValueAndPosition(e,this.limits.maxStart,this.limits.maxEnd)[0]},s.prototype.focusSliderElement=function(){this.isElementFocused||(this.element.focus(),this.isElementFocused=!0)},s.prototype.buttonClick=function(e){this.focusSliderElement();var i,s=this.enableRtl&&"Vertical"!==this.orientation,n=this.handleValueUpdate();40===e.keyCode||37===e.keyCode||e.currentTarget.classList.contains(ye.firstButton)?i=s?this.add(n,parseFloat(this.step.toString()),!0):this.add(n,parseFloat(this.step.toString()),!1):38===e.keyCode||39===e.keyCode||e.currentTarget.classList.contains(ye.secondButton)?i=s?this.add(n,parseFloat(this.step.toString()),!1):this.add(n,parseFloat(this.step.toString()),!0):33===e.keyCode||e.currentTarget.classList.contains(ye.firstButton)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):34===e.keyCode||e.currentTarget.classList.contains(ye.secondButton)?i=s?this.add(n,parseFloat(this.ticks.largeStep.toString()),!0):this.add(n,parseFloat(this.ticks.largeStep.toString()),!1):36===e.keyCode?i=parseFloat(this.min.toString()):35===e.keyCode&&(i=parseFloat(this.max.toString())),this.limits.enabled&&(i=this.getLimitCorrectedValues(i)),this.changeHandleValue(i),!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(ye.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),this.getHandle().focus(),e.currentTarget.classList.contains(ye.firstButton)&&t.EventHandler.add(this.firstBtn,"mouseup touchend",this.buttonUp,this),e.currentTarget.classList.contains(ye.secondButton)&&t.EventHandler.add(this.secondBtn,"mouseup touchend",this.buttonUp,this)},s.prototype.tooltipToggle=function(e){this.isMaterialTooltip?this.tooltipElement.classList.contains(ye.materialTooltipOpen)?this.refreshTooltip(this.firstHandle):this.openMaterialTooltip():this.tooltipElement?this.refreshTooltip(e):this.openTooltip(e)},s.prototype.buttonUp=function(e){e.currentTarget.classList.contains(ye.firstButton)&&t.EventHandler.remove(this.firstBtn,"mouseup touchend",this.buttonUp),e.currentTarget.classList.contains(ye.secondButton)&&t.EventHandler.remove(this.secondBtn,"mouseup touchend",this.buttonUp)},s.prototype.setRangeBar=function(){"Horizontal"===this.orientation?"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",t.setStyleAttribute(this.rangeBar,{width:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"})):"MinRange"===this.type?(this.rangeBar.style.bottom="0px",t.setStyleAttribute(this.rangeBar,{height:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):(this.rangeBar.style.bottom=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{height:this.handlePos2-this.handlePos1+"px"}))},s.prototype.checkValidValueAndPos=function(e){return e=this.checkHandleValue(e),e=this.checkHandlePosition(e)},s.prototype.setLimitBarPositions=function(e,t,i,s){"Horizontal"===this.orientation?this.enableRtl?(this.limitBarFirst.style.right=e+"px",this.limitBarFirst.style.width=t-e+"px"):(this.limitBarFirst.style.left=e+"px",this.limitBarFirst.style.width=t-e+"px"):(this.limitBarFirst.style.bottom=e+"px",this.limitBarFirst.style.height=t-e+"px"),"Range"===this.type&&("Horizontal"===this.orientation?this.enableRtl?(this.limitBarSecond.style.right=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.left=i+"px",this.limitBarSecond.style.width=s-i+"px"):(this.limitBarSecond.style.bottom=i+"px",this.limitBarSecond.style.height=s-i+"px"))},s.prototype.setLimitBar=function(){if("Default"===this.type||"MinRange"===this.type){var e=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];e=this.checkValidValueAndPos(e);var t=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];t=this.checkValidValueAndPos(t),this.setLimitBarPositions(e,t)}else if("Range"===this.type){var i=this.getLimitValueAndPosition(this.limits.minStart,this.limits.minStart,this.limits.minEnd,!0)[0];i=this.checkValidValueAndPos(i);var s=this.getLimitValueAndPosition(this.limits.minEnd,this.limits.minStart,this.limits.minEnd,!0)[0];s=this.checkValidValueAndPos(s);var n=this.getLimitValueAndPosition(this.limits.maxStart,this.limits.maxStart,this.limits.maxEnd,!0)[0];n=this.checkValidValueAndPos(n);var a=this.getLimitValueAndPosition(this.limits.maxEnd,this.limits.maxStart,this.limits.maxEnd,!0)[0];a=this.checkValidValueAndPos(a),this.setLimitBarPositions(i,s,n,a)}},s.prototype.getLimitValueAndPosition=function(e,i,s,n){return t.isNullOrUndefined(i)&&(i=this.min,t.isNullOrUndefined(e)&&n&&(e=i)),t.isNullOrUndefined(s)&&(s=this.max,t.isNullOrUndefined(e)&&n&&(e=s)),e<i&&(e=i),e>s&&(e=s),[e,this.checkHandlePosition(e)]},s.prototype.setValue=function(){if(!t.isNullOrUndefined(this.customValues)&&this.customValues.length>0&&(this.min=0,this.max=this.customValues.length-1,this.setBarColor()),this.setAriaAttributes(this.firstHandle),this.handleVal1=t.isNullOrUndefined(this.value)?this.checkHandleValue(parseFloat(this.min.toString())):this.checkHandleValue(parseFloat(this.value.toString())),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.preHandlePos1=this.handlePos1,t.isNullOrUndefined(this.activeHandle)?"Range"===this.type?this.activeHandle=2:this.activeHandle=1:this.activeHandle=this.activeHandle,"Default"===this.type||"MinRange"===this.type){if(this.limits.enabled){var e=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=e[0],this.handlePos1=e[1],this.preHandlePos1=this.handlePos1}this.setHandlePosition(null),this.handleStart(),this.value=this.handleVal1,this.setAriaAttrValue(this.firstHandle),this.changeEvent("changed",null)}else this.validateRangeValue();"Default"!==this.type&&this.setRangeBar(),this.limits.enabled&&this.setLimitBar()},s.prototype.rangeValueUpdate=function(){null!==this.value&&"object"==typeof this.value||(this.value=[parseFloat(t.formatUnit(this.min)),parseFloat(t.formatUnit(this.max))])},s.prototype.validateRangeValue=function(){this.rangeValueUpdate(),this.setRangeValue()},s.prototype.modifyZindex=function(){"Range"===this.type?1===this.activeHandle?(this.firstHandle.style.zIndex=this.zIndex+4+"",this.secondHandle.style.zIndex=this.zIndex+3+""):(this.firstHandle.style.zIndex=this.zIndex+3+"",this.secondHandle.style.zIndex=this.zIndex+4+""):this.isMaterialTooltip&&this.tooltipElement&&(this.tooltipElement.style.zIndex=i.getZindexPartial(this.element)+"")},s.prototype.setHandlePosition=function(e){var i,s=this,n=1===this.activeHandle?this.handlePos1:this.handlePos2;i=this.isMaterialTooltip?[this.firstHandle,this.materialHandle]:[this.getHandle()],this.handleStart(),i.forEach(function(e){"Horizontal"===s.orientation?s.enableRtl?e.style.right=n+"px":e.style.left=n+"px":e.style.bottom=n+"px",t.isBlazor()&&s.isServerRendered&&e.style.removeProperty("visibility")}),this.changeEvent("change",e)},s.prototype.getHandle=function(){return 1===this.activeHandle?this.firstHandle:this.secondHandle},s.prototype.setRangeValue=function(){this.updateRangeValue(),this.activeHandle=1,this.setHandlePosition(null),this.activeHandle=2,this.setHandlePosition(null),this.activeHandle=1},s.prototype.changeEvent=function(e,t){var i="change"===e?this.previousVal:this.previousChanged;if("Range"!==this.type)this.setProperties({value:this.handleVal1},!0),i===this.value||this.isMaterialTooltip&&this.initialTooltip||(this.trigger(e,this.changeEventArgs(e,t)),this.initialTooltip=!0,this.setPreviousVal(e,this.value)),this.setAriaAttrValue(this.firstHandle);else{var s=this.value=[this.handleVal1,this.handleVal2];this.setProperties({value:s},!0),(i.length===this.value.length&&this.value[0]!==i[0]||this.value[1]!==i[1])&&(this.initialTooltip=!1,this.trigger(e,this.changeEventArgs(e,t)),this.initialTooltip=!0,this.setPreviousVal(e,this.value)),this.setAriaAttrValue(this.getHandle())}this.hiddenInput.value=this.value.toString()},s.prototype.changeEventArgs=function(e,i){var s;return this.tooltip.isVisible&&this.tooltipObj&&this.initialTooltip?(t.isBlazor()&&this.isServerRendered||this.tooltipValue(),s={value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:this.tooltipObj.content,isInteracted:!t.isNullOrUndefined(i)}):s={value:this.value,previousValue:"change"===e?this.previousVal:this.previousChanged,action:e,text:t.isNullOrUndefined(this.ticksFormatInfo.format)?this.value.toString():"Range"!==this.type?this.formatString(this.value,this.ticksFormatInfo).formatString:this.formatString(this.value[0],this.ticksFormatInfo).formatString+" - "+this.formatString(this.value[1],this.ticksFormatInfo).formatString,isInteracted:!t.isNullOrUndefined(i)},s},s.prototype.setPreviousVal=function(e,t){"change"===e?this.previousVal=t:this.previousChanged=t},s.prototype.updateRangeValue=function(){var e=this.value.toString().split(",").map(Number);if(this.enableRtl&&"Vertical"!==this.orientation||this.rtl?this.value=[e[1],e[0]]:this.value=[e[0],e[1]],this.enableRtl&&"Vertical"!==this.orientation?(this.handleVal1=this.checkHandleValue(this.value[1]),this.handleVal2=this.checkHandleValue(this.value[0])):(this.handleVal1=this.checkHandleValue(this.value[0]),this.handleVal2=this.checkHandleValue(this.value[1])),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2),this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.preHandlePos1=this.handlePos1,this.preHandlePos2=this.handlePos2,this.limits.enabled){this.activeHandle=1;var t=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=t[0],this.handlePos1=t[1],this.preHandlePos1=this.handlePos1,this.activeHandle=2,t=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=t[0],this.handlePos2=t[1],this.preHandlePos2=this.handlePos2}},s.prototype.checkHandlePosition=function(e){var i;return e=100*(e-parseFloat(t.formatUnit(this.min)))/(parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min))),i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(e/100):this.element.getBoundingClientRect().height*(e/100),parseFloat(t.formatUnit(this.max))===parseFloat(t.formatUnit(this.min))&&(i="Horizontal"===this.orientation?this.element.getBoundingClientRect().width:this.element.getBoundingClientRect().height),i},s.prototype.checkHandleValue=function(e){if(this.min>this.max&&(this.min=this.max),this.min===this.max)return parseFloat(t.formatUnit(this.max));var i=this.tempStartEnd();return e<i.start?e=i.start:e>i.end&&(e=i.end),e},s.prototype.reposition=function(){var e=this;this.firstHandle.style.transition="none","Default"!==this.type&&(this.rangeBar.style.transition="none"),"Range"===this.type&&(this.secondHandle.style.transition="none"),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handleVal2&&(this.handlePos2=this.checkHandlePosition(this.handleVal2)),"Horizontal"===this.orientation?(this.enableRtl?this.firstHandle.style.right=this.handlePos1+"px":this.firstHandle.style.left=this.handlePos1+"px",this.isMaterialTooltip&&(this.enableRtl?this.materialHandle.style.right=this.handlePos1+"px":this.materialHandle.style.left=this.handlePos1+"px"),"MinRange"===this.type?(this.enableRtl?this.rangeBar.style.right="0px":this.rangeBar.style.left="0px",t.setStyleAttribute(this.rangeBar,{width:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.enableRtl?this.secondHandle.style.right=this.handlePos2+"px":this.secondHandle.style.left=this.handlePos2+"px",this.enableRtl?this.rangeBar.style.right=this.handlePos1+"px":this.rangeBar.style.left=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{width:this.handlePos2-this.handlePos1+"px"}))):(this.firstHandle.style.bottom=this.handlePos1+"px",this.isMaterialTooltip&&(this.materialHandle.style.bottom=this.handlePos1+"px"),"MinRange"===this.type?(this.rangeBar.style.bottom="0px",t.setStyleAttribute(this.rangeBar,{height:t.isNullOrUndefined(this.handlePos1)?0:this.handlePos1+"px"})):"Range"===this.type&&(this.secondHandle.style.bottom=this.handlePos2+"px",this.rangeBar.style.bottom=this.handlePos1+"px",t.setStyleAttribute(this.rangeBar,{height:this.handlePos2-this.handlePos1+"px"}))),this.limits.enabled&&this.setLimitBar(),"None"!==this.ticks.placement&&this.ul&&(t.isBlazor()||(this.removeElement(this.ul),this.ul=void 0),this.renderScale(),t.isBlazor()&&this.tickValuePosition()),this.handleStart(),this.tooltip.isVisible||setTimeout(function(){e.firstHandle.style.transition=e.scaleTransform,"Range"===e.type&&(e.secondHandle.style.transition=e.scaleTransform)}),t.isBlazor()&&this.isServerRendered||this.refreshTooltip(this.tooltipTarget),this.setBarColor()},s.prototype.changeHandleValue=function(e){var t=null;1===this.activeHandle?(this.limits.enabled&&this.limits.startHandleFixed||(this.handleVal1=this.checkHandleValue(e),this.handlePos1=this.checkHandlePosition(this.handleVal1),"Range"===this.type&&this.handlePos1>this.handlePos2&&(this.handlePos1=this.handlePos2,this.handleVal1=this.handleVal2),this.handlePos1!==this.preHandlePos1&&(t=this.preHandlePos1=this.handlePos1)),this.modifyZindex()):(this.limits.enabled&&this.limits.endHandleFixed||(this.handleVal2=this.checkHandleValue(e),this.handlePos2=this.checkHandlePosition(this.handleVal2),"Range"===this.type&&this.handlePos2<this.handlePos1&&(this.handlePos2=this.handlePos1,this.handleVal2=this.handleVal1),this.handlePos2!==this.preHandlePos2&&(t=this.preHandlePos2=this.handlePos2)),this.modifyZindex()),null!==t&&("Default"!==this.type&&this.setRangeBar(),this.setHandlePosition(null))},s.prototype.tempStartEnd=function(){return this.min>this.max?{start:this.max,end:this.min}:{start:this.min,end:this.max}},s.prototype.xyToPosition=function(e){if(this.min===this.max)return 100;if("Horizontal"===this.orientation){var t=e.x-this.element.getBoundingClientRect().left,i=this.element.offsetWidth/100;this.val=t/i}else{var s=e.y-this.element.getBoundingClientRect().top,i=this.element.offsetHeight/100;this.val=100-s/i}var n=this.stepValueCalculation(this.val);return n<0?n=0:n>100&&(n=100),this.enableRtl&&"Vertical"!==this.orientation&&(n=100-n),"Horizontal"===this.orientation?this.element.getBoundingClientRect().width*(n/100):this.element.getBoundingClientRect().height*(n/100)},s.prototype.stepValueCalculation=function(e){0===this.step&&(this.step=1);var i=parseFloat(t.formatUnit(this.step))/((parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min)))/100),s=e%Math.abs(i);return 0!==s&&(i/2>s?e-=s:e+=Math.abs(i)-s),e},s.prototype.add=function(e,t,i){var s=Math.pow(10,3);return i?(Math.round(e*s)+Math.round(t*s))/s:(Math.round(e*s)-Math.round(t*s))/s},s.prototype.positionToValue=function(e){var i,s=parseFloat(t.formatUnit(this.max))-parseFloat(t.formatUnit(this.min));return i="Horizontal"===this.orientation?e/this.element.getBoundingClientRect().width*s:e/this.element.getBoundingClientRect().height*s,this.add(i,parseFloat(this.min.toString()),!0)},s.prototype.sliderBarClick=function(e){e.preventDefault();var t;"mousedown"===e.type||"mouseup"===e.type||"click"===e.type?t={x:e.clientX,y:e.clientY}:"touchend"!==e.type&&"touchstart"!==e.type||(t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY});var i=this.xyToPosition(t),s=this.positionToValue(i);if("Range"===this.type&&this.handlePos2-i<i-this.handlePos1)this.activeHandle=2,this.limits.enabled&&this.limits.endHandleFixed||(this.limits.enabled&&(s=(n=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd))[0],i=n[1]),this.secondHandle.classList.add(ye.sliderActiveHandle),this.handlePos2=this.preHandlePos2=i,this.handleVal2=s),this.modifyZindex(),this.secondHandle.focus();else{if(this.activeHandle=1,!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);s=n[0],i=n[1]}this.firstHandle.classList.add(ye.sliderActiveHandle),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s}this.modifyZindex(),this.firstHandle.focus()}this.isMaterialTooltip&&this.tooltipElement.classList.add(ye.materialTooltipActive);var a=this.element.querySelector("."+ye.sliderTabHandle);a&&this.getHandle()!==a&&a.classList.remove(ye.sliderTabHandle);var r=1===this.activeHandle?this.firstHandle:this.secondHandle;if(e.target===r)return!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(ye.sliderTabHandle)||this.materialChange(),this.sliderBarUp(e),void this.tooltipToggle(this.getHandle());if(this.checkRepeatedValue(s)){var l=this.isMaterial&&this.tooltip.isVisible?this.transitionOnMaterialTooltip:this.transition;this.getHandle().style.transition=l.handle,"Default"!==this.type&&(this.rangeBar.style.transition=l.rangeBar),this.setHandlePosition(e),this.isMaterialTooltip&&(this.initialTooltip=!1),this.changeEvent("changed",e),"Default"!==this.type&&this.setRangeBar()}},s.prototype.handleValueAdjust=function(e,t,i){1===i?(this.handleVal1=t,this.handleVal2=this.handleVal1+this.minDiff):2===i&&(this.handleVal2=t,this.handleVal1=this.handleVal2-this.minDiff),this.handlePos1=this.checkHandlePosition(this.handleVal1),this.handlePos2=this.checkHandlePosition(this.handleVal2)},s.prototype.dragRangeBarMove=function(e){var t,i;"touchmove"!==e.type&&e.preventDefault(),this.rangeBarDragged=!0;var s;this.rangeBar.style.transition="none",this.firstHandle.style.transition="none",this.secondHandle.style.transition="none";var n,a;if("mousemove"===e.type?(n=(t=[e.clientX,e.clientY])[0],a=t[1]):(n=(i=[e.changedTouches[0].clientX,e.changedTouches[0].clientY])[0],a=i[1]),!(this.limits.enabled&&this.limits.startHandleFixed||this.limits.enabled&&this.limits.endHandleFixed)){if(s=this.enableRtl?{x:n+this.secondPartRemain,y:a+this.secondPartRemain}:{x:n-this.firstPartRemain,y:a+this.secondPartRemain},this.handlePos1=this.xyToPosition(s),this.handleVal1=this.positionToValue(this.handlePos1),s=this.enableRtl?{x:n-this.firstPartRemain,y:a-this.firstPartRemain}:{x:n+this.secondPartRemain,y:a-this.firstPartRemain},this.handlePos2=this.xyToPosition(s),this.handleVal2=this.positionToValue(this.handlePos2),this.limits.enabled){var r=this.getLimitValueAndPosition(this.handleVal1,this.limits.minStart,this.limits.minEnd);this.handleVal1=r[0],this.handlePos1=r[1],this.handleVal1===this.limits.minEnd&&this.handleValueAdjust(this.handleVal1,this.limits.minEnd,1),this.handleVal1===this.limits.minStart&&this.handleValueAdjust(this.handleVal1,this.limits.minStart,1),r=this.getLimitValueAndPosition(this.handleVal2,this.limits.maxStart,this.limits.maxEnd),this.handleVal2=r[0],this.handlePos2=r[1],this.handleVal2===this.limits.maxStart&&this.handleValueAdjust(this.handleVal2,this.limits.maxStart,2),this.handleVal2===this.limits.maxEnd&&this.handleValueAdjust(this.handleVal2,this.limits.maxEnd,2)}this.handleVal2===this.max&&this.handleValueAdjust(this.handleVal2,this.max,2),this.handleVal1===this.min&&this.handleValueAdjust(this.handleVal1,this.min,1)}this.activeHandle=1,this.setHandlePosition(e),this.activeHandle=2,this.setHandlePosition(e),this.tooltipToggle(this.rangeBar),this.setRangeBar()},s.prototype.sliderBarUp=function(e){this.changeEvent("changed",e),this.handleFocusOut(),this.firstHandle.classList.remove(ye.sliderActiveHandle),"Range"===this.type&&(this.initialTooltip=!1,this.secondHandle.classList.remove(ye.sliderActiveHandle)),this.closeTooltip(),this.isMaterial&&(this.getHandle().classList.remove("e-large-thumb-size"),this.isMaterialTooltip&&this.tooltipElement.classList.remove(ye.materialTooltipActive)),t.EventHandler.remove(document,"mousemove touchmove",this.sliderBarMove),t.EventHandler.remove(document,"mouseup touchend",this.sliderBarUp)},s.prototype.sliderBarMove=function(e){"touchmove"!==e.type&&e.preventDefault();var t;t="mousemove"===e.type?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};var i=this.xyToPosition(t),s=this.positionToValue(i);if(i=Math.round(i),"Range"!==this.type&&1===this.activeHandle){if(!this.limits.enabled||!this.limits.startHandleFixed){if(this.limits.enabled){var n=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd);i=n[1],s=n[0]}this.handlePos1=i,this.handleVal1=s}this.firstHandle.classList.add(ye.sliderActiveHandle)}if("Range"===this.type)if(1===this.activeHandle)this.firstHandle.classList.add(ye.sliderActiveHandle),this.limits.enabled&&this.limits.startHandleFixed||(i>this.handlePos2&&(i=this.handlePos2,s=this.handleVal2),i!==this.preHandlePos1&&(this.limits.enabled&&(s=(a=this.getLimitValueAndPosition(s,this.limits.minStart,this.limits.minEnd))[0],i=a[1]),this.handlePos1=this.preHandlePos1=i,this.handleVal1=s,this.activeHandle=1));else if(2===this.activeHandle&&(this.secondHandle.classList.add(ye.sliderActiveHandle),!(this.limits.enabled&&this.limits.endHandleFixed||(i<this.handlePos1&&(i=this.handlePos1,s=this.handleVal1),i===this.preHandlePos2)))){if(this.limits.enabled){var a=this.getLimitValueAndPosition(s,this.limits.maxStart,this.limits.maxEnd);s=a[0],i=a[1]}this.handlePos2=this.preHandlePos2=i,this.handleVal2=s,this.activeHandle=2}this.checkRepeatedValue(s)&&(this.getHandle().style.transition=this.scaleTransform,"Default"!==this.type&&(this.rangeBar.style.transition="none"),this.setHandlePosition(e),!this.isMaterial||this.tooltip.isVisible||this.getHandle().classList.contains(ye.sliderTabHandle)||this.materialChange(),this.tooltipToggle(this.getHandle()),"Default"!==this.type&&this.setRangeBar())},s.prototype.dragRangeBarUp=function(e){this.rangeBarDragged?this.isDragComplete=!0:(this.focusSliderElement(),this.sliderBarClick(e)),this.changeEvent("changed",e),this.closeTooltip(),t.EventHandler.remove(document,"mousemove touchmove",this.dragRangeBarMove),t.EventHandler.remove(document,"mouseup touchend",this.dragRangeBarUp),this.rangeBarDragged=!1},s.prototype.checkRepeatedValue=function(e){if("Range"===this.type){if(e===(this.enableRtl&&"Vertical"!==this.orientation?1===this.activeHandle?this.previousVal[1]:this.previousVal[0]:1===this.activeHandle?this.previousVal[0]:this.previousVal[1]))return 0}else if(e===this.previousVal)return 0;return 1},s.prototype.refreshTooltip=function(e){this.tooltip.isVisible&&this.tooltipObj&&(this.tooltipValue(),e&&(this.tooltipObj.refresh(e),this.tooltipTarget=e))},s.prototype.openTooltip=function(e){this.tooltip.isVisible&&this.tooltipObj&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.open(e),this.tooltipTarget=e)},s.prototype.closeTooltip=function(){this.tooltip.isVisible&&this.tooltipObj&&"Always"!==this.tooltip.showOn&&!this.isMaterialTooltip&&(this.tooltipValue(),this.tooltipObj.close(),this.tooltipTarget=void 0)},s.prototype.keyDown=function(e){switch(e.keyCode){case 37:case 38:case 39:case 40:case 33:case 34:case 36:case 35:e.preventDefault(),this.buttonClick(e)}},s.prototype.wireButtonEvt=function(e){e?(t.EventHandler.remove(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut),t.EventHandler.remove(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut),t.EventHandler.remove(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse),t.EventHandler.remove(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),t.EventHandler.remove(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse),t.EventHandler.remove(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp),t.EventHandler.remove(this.firstBtn,"focusout",this.sliderFocusOut),t.EventHandler.remove(this.secondBtn,"focusout",this.sliderFocusOut)):(t.EventHandler.add(this.firstBtn,"mouseleave touchleave",this.buttonFocusOut,this),t.EventHandler.add(this.secondBtn,"mouseleave touchleave",this.buttonFocusOut,this),t.EventHandler.add(this.firstBtn,"mousedown touchstart",this.repeatHandlerMouse,this),t.EventHandler.add(this.firstBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),t.EventHandler.add(this.secondBtn,"mousedown touchstart",this.repeatHandlerMouse,this),t.EventHandler.add(this.secondBtn,"mouseup mouseleave touchup touchend",this.repeatHandlerUp,this),t.EventHandler.add(this.firstBtn,"focusout",this.sliderFocusOut,this),t.EventHandler.add(this.secondBtn,"focusout",this.sliderFocusOut,this))},s.prototype.rangeBarMousedown=function(e){var i,s;if(e.preventDefault(),this.focusSliderElement(),"Range"===this.type&&this.drag&&e.target===this.rangeBar){var n=void 0,a=void 0;"mousedown"===e.type?(n=(i=[e.clientX,e.clientY])[0],a=i[1]):"touchstart"===e.type&&(n=(s=[e.changedTouches[0].clientX,e.changedTouches[0].clientY])[0],a=s[1]),"Horizontal"===this.orientation?(this.firstPartRemain=n-this.rangeBar.getBoundingClientRect().left,this.secondPartRemain=this.rangeBar.getBoundingClientRect().right-n):(this.firstPartRemain=a-this.rangeBar.getBoundingClientRect().top,this.secondPartRemain=this.rangeBar.getBoundingClientRect().bottom-a),this.minDiff=this.handleVal2-this.handleVal1,this.tooltipToggle(this.rangeBar);var r=this.element.querySelector("."+ye.sliderTabHandle);r&&r.classList.remove(ye.sliderTabHandle),t.EventHandler.add(document,"mousemove touchmove",this.dragRangeBarMove,this),t.EventHandler.add(document,"mouseup touchend",this.dragRangeBarUp,this)}},s.prototype.elementClick=function(e){if(this.isDragComplete)return void(this.isDragComplete=!1);e.preventDefault(),this.focusSliderElement(),this.sliderBarClick(e)},s.prototype.wireEvents=function(){this.onresize=this.reposition.bind(this),window.addEventListener("resize",this.onresize),this.enabled&&!this.readonly&&(t.EventHandler.add(this.element,"click",this.elementClick,this),"Range"===this.type&&this.drag&&t.EventHandler.add(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown,this),t.EventHandler.add(this.sliderContainer,"keydown",this.keyDown,this),t.EventHandler.add(this.sliderContainer,"keyup",this.keyUp,this),t.EventHandler.add(this.element,"focusout",this.sliderFocusOut,this),t.EventHandler.add(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover,this),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.showButtons&&this.wireButtonEvt(!1),this.wireMaterialTooltipEvent(!1),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this))},s.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.elementClick),"Range"===this.type&&this.drag&&t.EventHandler.remove(this.rangeBar,"mousedown touchstart",this.rangeBarMousedown),t.EventHandler.remove(this.sliderContainer,"keydown",this.keyDown),t.EventHandler.remove(this.sliderContainer,"keyup",this.keyUp),t.EventHandler.remove(this.element,"focusout",this.sliderFocusOut),t.EventHandler.remove(this.sliderContainer,"mouseover mouseout touchstart touchend",this.hover),this.wireFirstHandleEvt(!0),"Range"===this.type&&this.wireSecondHandleEvt(!0),this.showButtons&&this.wireButtonEvt(!0),this.wireMaterialTooltipEvent(!0),t.EventHandler.remove(this.element,"reset",this.formResetHandler)},s.prototype.formResetHandler=function(){this.setProperties({value:this.formResetValue},!0),this.setValue()},s.prototype.keyUp=function(e){if(9===e.keyCode&&e.target.classList.contains(ye.sliderHandle)&&(this.focusSliderElement(),!e.target.classList.contains(ye.sliderTabHandle))){this.element.querySelector("."+ye.sliderTabHandle)&&this.element.querySelector("."+ye.sliderTabHandle).classList.remove(ye.sliderTabHandle),e.target.classList.add(ye.sliderTabHandle);var t=e.target.parentElement;t===this.element&&(t.querySelector("."+ye.sliderTrack).classList.add(ye.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||t.querySelector("."+ye.rangeBar).classList.add(ye.sliderTabRange)),"Range"===this.type&&(e.target.previousSibling.classList.contains(ye.sliderHandle)?this.activeHandle=2:this.activeHandle=1),this.getHandle().focus(),this.tooltipToggle(this.getHandle())}this.closeTooltip(),this.changeEvent("changed",e)},s.prototype.hover=function(e){t.isNullOrUndefined(e)||("mouseover"===e.type||"touchmove"===e.type||"mousemove"===e.type||"pointermove"===e.type||"touchstart"===e.type?this.sliderContainer.classList.add(ye.sliderHover):this.sliderContainer.classList.remove(ye.sliderHover))},s.prototype.sliderFocusOut=function(e){e.relatedTarget!==this.secondHandle&&e.relatedTarget!==this.firstHandle&&e.relatedTarget!==this.element&&e.relatedTarget!==this.firstBtn&&e.relatedTarget!==this.secondBtn&&(this.closeMaterialTooltip(),this.element.querySelector("."+ye.sliderTabHandle)&&this.element.querySelector("."+ye.sliderTabHandle).classList.remove(ye.sliderTabHandle),this.element.querySelector("."+ye.sliderTabTrack)&&(this.element.querySelector("."+ye.sliderTabTrack).classList.remove(ye.sliderTabTrack),"Range"!==this.type&&"MinRange"!==this.type||!this.element.querySelector("."+ye.sliderTabRange)||this.element.querySelector("."+ye.sliderTabRange).classList.remove(ye.sliderTabRange)),this.hiddenInput.focus(),this.hiddenInput.blur(),this.isElementFocused=!1)},s.prototype.removeElement=function(e){e.parentNode&&e.parentNode.removeChild(e)},s.prototype.changeSliderType=function(e,i){this.isMaterialTooltip&&this.materialHandle&&(this.sliderContainer.classList.remove(ye.materialSlider),this.removeElement(this.materialHandle),this.materialHandle=void 0),this.removeElement(this.firstHandle),this.firstHandle=void 0,"Default"!==e&&("Range"===e&&(this.removeElement(this.secondHandle),this.secondHandle=void 0),this.removeElement(this.rangeBar),this.rangeBar=void 0),this.tooltip.isVisible&&!t.isNullOrUndefined(this.tooltipObj)&&(this.tooltipObj.destroy(),this.tooltipElement=void 0,this.tooltipCollidedPosition=void 0),this.limits.enabled&&("MinRange"===e||"Default"===e?t.isNullOrUndefined(this.limitBarFirst)||(this.removeElement(this.limitBarFirst),this.limitBarFirst=void 0):t.isNullOrUndefined(this.limitBarSecond)||(this.removeElement(this.limitBarSecond),this.limitBarSecond=void 0)),this.activeHandle=1,this.getThemeInitialization(),"Range"===this.type&&this.rangeValueUpdate(),this.createRangeBar(),this.limits.enabled&&this.createLimitBar(),this.setHandler(),this.setOrientClass(),this.wireFirstHandleEvt(!1),"Range"===this.type&&this.wireSecondHandleEvt(!1),this.setValue(),this.tooltip.isVisible&&(this.renderTooltip(),this.wireMaterialTooltipEvent(!1)),this.setBarColor(),(t.isBlazor()||this.isServerRendered)&&"tooltip"===i||this.updateConfig()},s.prototype.changeRtl=function(){if(this.enableRtl||"Range"!==this.type||(this.value=[this.handleVal2,this.handleVal1]),this.updateConfig(),this.tooltip.isVisible&&this.tooltipObj.refresh(this.firstHandle),this.showButtons){var e=this.enableRtl&&"Vertical"!==this.orientation;t.attributes(e?this.secondBtn:this.firstBtn,{"aria-label":"Decrease",title:"Decrease"}),t.attributes(e?this.firstBtn:this.secondBtn,{"aria-label":"Increase",title:"Increase"})}},s.prototype.changeOrientation=function(){this.changeSliderType(this.type,"null")},s.prototype.updateConfig=function(){this.setEnableRTL(),this.setValue(),this.tooltip.isVisible&&(t.isBlazor()||this.refreshTooltip(this.tooltipTarget)),"None"!==this.ticks.placement&&this.ul&&(this.removeElement(this.ul),this.ul=void 0,this.renderScale()),this.limitsPropertyChange()},s.prototype.limitsPropertyChange=function(){this.limits.enabled?(t.isNullOrUndefined(this.limitBarFirst)&&"Range"!==this.type&&this.createLimitBar(),t.isNullOrUndefined(this.limitBarFirst)&&t.isNullOrUndefined(this.limitBarSecond)&&"Range"===this.type&&this.createLimitBar(),this.setLimitBar(),this.setValue()):(t.isNullOrUndefined(this.limitBarFirst)||t.detach(this.limitBarFirst),t.isNullOrUndefined(this.limitBarSecond)||t.detach(this.limitBarSecond))},s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.destroy=function(){e.prototype.destroy.call(this),this.unwireEvents(),window.removeEventListener("resize",this.onresize),t.removeClass([this.sliderContainer],[ye.sliderDisabled]),this.firstHandle.removeAttribute("aria-orientation"),"Range"===this.type&&this.secondHandle.removeAttribute("aria-orientation"),t.isBlazor()||this.isServerRendered||(this.sliderContainer.parentNode.insertBefore(this.element,this.sliderContainer),t.detach(this.sliderContainer)),this.tooltip.isVisible&&this.tooltipObj.destroy(),t.isBlazor()&&this.isMaterialTooltip&&!t.isNullOrUndefined(this.materialHandle)&&this.materialHandle.remove(),t.isBlazor()||this.isServerRendered||(this.element.innerHTML="")},s.prototype.onPropertyChanged=function(e,i){for(var s=this,n=0,a=Object.keys(e);n<a.length;n++){var r=a[n];switch(r){case"cssClass":this.setCSSClass(i.cssClass);break;case"value":if(e&&i){var l=t.isNullOrUndefined(e.value)?"Range"===this.type?[this.min,this.max]:this.min:e.value;this.setProperties({value:l},!0),t.isNullOrUndefined(i.value)||i.value.toString()===l.toString()||(this.setValue(),t.isBlazor()&&this.isServerRendered||this.refreshTooltip(this.tooltipTarget),"Range"===this.type&&(t.isNullOrUndefined(e.value)||i.value[1]===l[1]?this.activeHandle=1:this.activeHandle=2))}break;case"min":case"step":case"max":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),this.setMinMaxValue(),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"tooltip":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),t.isNullOrUndefined(e.tooltip)||t.isNullOrUndefined(i.tooltip)||this.setTooltip(r),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"type":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),t.isNullOrUndefined(i)||!Object.keys(i).length||t.isNullOrUndefined(i.type)||(this.changeSliderType(i.type,r),this.setZindex()),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"enableRtl":t.isBlazor()&&this.isServerRendered&&(this.isMaterialTooltip&&this.sliderContainer.classList.add(ye.materialSlider),this.isServerRendered=!1),i.enableRtl!==e.enableRtl&&"Vertical"!==this.orientation&&(this.rtl=i.enableRtl,this.changeRtl()),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"limits":this.limitsPropertyChange();break;case"orientation":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),this.changeOrientation(),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"ticks":t.isNullOrUndefined(this.sliderContainer.querySelector("."+ye.scale))||(t.isBlazor()&&this.isServerRendered||t.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(e){e.match(/e-scale-/)&&s.sliderContainer.classList.remove(e)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex());break;case"locale":this.showButtons&&this.buttonTitle();break;case"showButtons":e.showButtons?(this.setButtons(),this.reposition(),this.enabled&&!this.readonly&&this.wireButtonEvt(!1)):t.isBlazor()&&this.isServerRendered||this.firstBtn&&this.secondBtn&&(this.sliderContainer.removeChild(this.firstBtn),this.sliderContainer.removeChild(this.secondBtn),this.sliderContainer.classList.remove(ye.sliderButtonClass),this.firstBtn=void 0,this.secondBtn=void 0,this.reposition()),t.isBlazor()&&this.isServerRendered&&this.isMaterialTooltip&&this.sliderContainer.classList.add(ye.materialSlider);break;case"enabled":this.setEnabled(),t.isBlazor()&&this.isServerRendered&&this.isMaterialTooltip&&this.sliderContainer.classList.add(ye.materialSlider);break;case"readonly":this.setReadOnly(),t.isBlazor()&&this.isServerRendered&&this.isMaterialTooltip&&this.sliderContainer.classList.add(ye.materialSlider);break;case"customValues":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),this.setValue(),this.reposition(),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"colorRange":t.isBlazor()&&this.isServerRendered&&(this.isServerRendered=!1),this.reposition(),t.isBlazor()&&!this.isServerRendered&&(this.isServerRendered=!0);break;case"width":this.setElementWidth(e.width),this.setMinMaxValue(),this.limits&&this.limitsPropertyChange()}}},s.prototype.setReadOnly=function(){this.readonly?(this.unwireEvents(),this.sliderContainer.classList.add(ye.readonly)):(this.wireEvents(),this.sliderContainer.classList.remove(ye.readonly))},s.prototype.setMinMaxValue=function(){var e=this;this.setValue(),t.isBlazor()||this.refreshTooltip(this.tooltipTarget),t.isNullOrUndefined(this.sliderContainer.querySelector("."+ye.scale))||this.ul&&(t.detach(this.ul),Array.prototype.forEach.call(this.sliderContainer.classList,function(t){t.match(/e-scale-/)&&e.sliderContainer.classList.remove(t)})),"None"!==this.ticks.placement&&(this.renderScale(),this.setZindex())},s.prototype.setZindex=function(){this.zIndex=6,t.isNullOrUndefined(this.ticks)||"None"===this.ticks.placement||(this.ul.style.zIndex=this.zIndex+-7+"",this.element.style.zIndex=this.zIndex+2+""),this.isMaterial||t.isNullOrUndefined(this.ticks)||"Both"!==this.ticks.placement||(this.element.style.zIndex=this.zIndex+2+""),this.firstHandle.style.zIndex=this.zIndex+3+"","Range"===this.type&&(this.secondHandle.style.zIndex=this.zIndex+4+"")},s.prototype.setTooltip=function(e){this.changeSliderType(this.type,e)},s.prototype.setBarColor=function(){for(var e,i,s=this.sliderTrack.lastElementChild;s;)this.sliderTrack.removeChild(s),s=this.sliderTrack.lastElementChild;for(var n=0;n<this.colorRange.length;n++)if(!t.isNullOrUndefined(this.colorRange[n].start)&&!t.isNullOrUndefined(this.colorRange[n].end)&&this.colorRange[n].end>this.colorRange[n].start){this.colorRange[n].start<this.min&&(this.colorRange[n].start=this.min),this.colorRange[n].end>this.max&&(this.colorRange[n].end=this.max);var a=this.checkHandlePosition(this.colorRange[n].start),r=this.checkHandlePosition(this.colorRange[n].end),l=this.createElement("div");l.style.backgroundColor=this.colorRange[n].color,l.style.border="1px solid "+this.colorRange[n].color,"Horizontal"===this.orientation?(i=ye.sliderHorizantalColor,e=this.enableRtl?t.isNullOrUndefined(this.customValues)?this.checkHandlePosition(this.max)-this.checkHandlePosition(this.colorRange[n].end):this.checkHandlePosition(this.customValues.length-this.colorRange[n].end-1):this.checkHandlePosition(this.colorRange[n].start),l.style.width=r-a+"px",l.style.left=e+"px"):(i=ye.sliderVerticalColor,e=this.checkHandlePosition(this.colorRange[n].start),l.style.height=r-a+"px",l.style.bottom=e+"px"),l.classList.add(i),this.sliderTrack.appendChild(l)}},s.prototype.getModuleName=function(){return"slider"},pe([t.Property(null)],s.prototype,"value",void 0),pe([t.Property(null)],s.prototype,"customValues",void 0),pe([t.Property(1)],s.prototype,"step",void 0),pe([t.Property(null)],s.prototype,"width",void 0),pe([t.Property(0)],s.prototype,"min",void 0),pe([t.Property(100)],s.prototype,"max",void 0),pe([t.Property(!1)],s.prototype,"readonly",void 0),pe([t.Property("Default")],s.prototype,"type",void 0),pe([t.Collection([{}],ve)],s.prototype,"colorRange",void 0),pe([t.Complex({},me)],s.prototype,"ticks",void 0),pe([t.Complex({},fe)],s.prototype,"limits",void 0),pe([t.Property(!0)],s.prototype,"enabled",void 0),pe([t.Complex({},ge)],s.prototype,"tooltip",void 0),pe([t.Property(!1)],s.prototype,"showButtons",void 0),pe([t.Property(!0)],s.prototype,"enableAnimation",void 0),pe([t.Property("Horizontal")],s.prototype,"orientation",void 0),pe([t.Property("")],s.prototype,"cssClass",void 0),pe([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),pe([t.Event()],s.prototype,"created",void 0),pe([t.Event()],s.prototype,"change",void 0),pe([t.Event()],s.prototype,"changed",void 0),pe([t.Event()],s.prototype,"renderingTicks",void 0),pe([t.Event()],s.prototype,"renderedTicks",void 0),pe([t.Event()],s.prototype,"tooltipChange",void 0),s=pe([t.NotifyPropertyChanges],s)}(t.Component),Ee=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Ce=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},Se={EMAIL:new RegExp("^[A-Za-z0-9._%+-]{1,}@[A-Za-z0-9._%+-]{1,}([.]{1}[a-zA-Z0-9]{2,}|[.]{1}[a-zA-Z0-9]{2,4}[.]{1}[a-zA-Z0-9]{2,4})$"),URL:/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:\/?#[\]@!\$&'\(\)\*\+,;=.]+$/m,DATE_ISO:new RegExp("^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$"),DIGITS:new RegExp("^[0-9]*$"),PHONE:new RegExp("^[+]?[0-9]{9,13}$"),CREDITCARD:new RegExp("^\\d{13,16}$")};!function(e){e[e.Message=0]="Message",e[e.Label=1]="Label"}(e.ErrorOption||(e.ErrorOption={}));var Te=function(i){function s(e,s){var n=i.call(this,s,e)||this;if(n.validated=[],n.errorRules=[],n.allowSubmit=!1,n.required="required",n.infoElement=null,n.inputElement=null,n.selectQuery="input:not([type=reset]):not([type=button]), select, textarea",n.localyMessage={},n.defaultMessages={required:"This field is required.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateIso:"Please enter a valid date ( ISO ).",creditcard:"Please enter valid card number",number:"Please enter a valid number.",digits:"Please enter only digits.",maxLength:"Please enter no more than {0} characters.",minLength:"Please enter at least {0} characters.",rangeLength:"Please enter a value between {0} and {1} characters long.",range:"Please enter a value between {0} and {1}.",max:"Please enter a value less than or equal to {0}.",min:"Please enter a value greater than or equal to {0}.",regex:"Please enter a correct value.",tel:"Please enter a valid phone number.",pattern:"Please enter a correct pattern value.",equalTo:"Please enter the valid match text"},void 0===n.rules&&(n.rules={}),n.l10n=new t.L10n("formValidator",n.defaultMessages,n.locale),n.locale&&n.localeFunc(),t.onIntlChange.on("notifyExternalChange",n.afterLocalization,n),e="string"==typeof e?t.select(e,document):e,null!=n.element)return n.element.setAttribute("novalidate",""),n.inputElements=t.selectAll(n.selectQuery,n.element),n.createHTML5Rules(),n.wireEvents(),n}Ee(s,i),n=s,s.prototype.addRules=function(e,i){e&&(this.rules.hasOwnProperty(e)?t.extend(this.rules[e],i,{}):this.rules[e]=i)},s.prototype.removeRules=function(e,i){if(e||i)if(this.rules[e]&&!i)delete this.rules[e];else{if(t.isNullOrUndefined(this.rules[e]&&i))return;for(var s=0;s<i.length;s++)delete this.rules[e][i[s]]}else this.rules={}},s.prototype.validate=function(e){var t=Object.keys(this.rules);if(e&&t.length)return this.validateRules(e),-1!==t.indexOf(e)&&0===this.errorRules.filter(function(t){return t.name===e}).length;this.errorRules=[];for(var i=0,s=t;i<s.length;i++){var n=s[i];this.validateRules(n)}return 0===this.errorRules.length},s.prototype.reset=function(){this.element.reset(),this.clearForm()},s.prototype.getInputElement=function(e){return this.inputElement=t.select('[name="'+e+'"]',this.element),this.inputElement},s.prototype.destroy=function(){this.reset(),this.unwireEvents(),this.rules={};for(var e=0,s=t.selectAll("."+this.errorClass+", ."+this.validClass,this.element);e<s.length;e++){var n=s[e];t.detach(n)}i.prototype.destroy.call(this),t.onIntlChange.off("notifyExternalChange",this.afterLocalization)},s.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"locale":this.localeFunc()}},s.prototype.localeFunc=function(){for(var e=0,t=Object.keys(this.defaultMessages);e<t.length;e++){var i=t[e];this.l10n.setLocale(this.locale);var s=this.l10n.getConstant(i);this.localyMessage[i]=s}},s.prototype.getModuleName=function(){return"formValidator"},s.prototype.afterLocalization=function(e){this.locale=e.locale,this.localeFunc()},s.prototype.refresh=function(){this.unwireEvents(),this.inputElements=t.selectAll(this.selectQuery,this.element),this.wireEvents()},s.prototype.clearForm=function(){this.errorRules=[],this.validated=[];for(var e=0,i=t.selectAll(this.selectQuery,this.element);e<i.length;e++){var s=i[e];s.removeAttribute("aria-invalid"),s.classList.remove(this.errorClass),s.name.length>0&&(this.getInputElement(s.name),this.getErrorElement(s.name),this.hideMessage(s.name)),s.classList.remove(this.validClass)}},s.prototype.createHTML5Rules=function(){for(var e=["required","validateHidden","regex","rangeLength","maxLength","minLength","dateIso","digits","pattern","data-val-required","type","data-validation","min","max","range","equalTo","data-val-minlength-min","data-val-equalto-other","data-val-maxlength-max","data-val-range-min","data-val-regex-pattern","data-val-length-max","data-val-creditcard","data-val-phone"],t=["hidden","email","url","date","number","tel"],i=0,s=this.inputElements;i<s.length;i++){for(var n=s[i],a={},r=0,l=e;r<l.length;r++){var o=l[r];if(null!==n.getAttribute(o))switch(o){case"required":this.defRule(n,a,o,n.required);break;case"data-validation":o=n.getAttribute(o),this.defRule(n,a,o,!0);break;case"type":-1!==t.indexOf(n.type)&&this.defRule(n,a,n.type,!0);break;case"rangeLength":case"range":this.defRule(n,a,o,JSON.parse(n.getAttribute(o)));break;case"equalTo":var h=n.getAttribute(o);this.defRule(n,a,o,h);break;default:"true"===n.getAttribute("data-val")?this.annotationRule(n,a,o,n.getAttribute(o)):this.defRule(n,a,o,n.getAttribute(o))}}0!==Object.keys(a).length&&this.addRules(n.name,a)}},s.prototype.annotationRule=function(e,t,i,s){var n=i.split("-"),a=["required","creditcard","phone","maxlength","minlength","range","regex","equalto"],r=n[n.length-1],l=n[n.length-2];if(-1!==a.indexOf(r))switch(r){case"required":this.defRule(e,t,"required",s);break;case"creditcard":this.defRule(e,t,"creditcard",s);break;case"phone":this.defRule(e,t,"tel",s)}else if(-1!==a.indexOf(l))switch(l){case"maxlength":this.defRule(e,t,"maxLength",s);break;case"minlength":this.defRule(e,t,"minLength",s);break;case"range":var o=e.getAttribute("data-val-range-min"),h=e.getAttribute("data-val-range-max");this.defRule(e,t,"range",[o,h]);break;case"equalto":var d=e.getAttribute(i).split(".");this.defRule(e,t,"equalTo",d[d.length-1]);break;case"regex":this.defRule(e,t,"regex",s)}},s.prototype.defRule=function(e,t,i,s){var n,a=e.getAttribute("data-"+i+"-message"),r=e.getAttribute("data-val-"+i);this.rules[e.name]&&"validateHidden"!==i&&"hidden"!==i&&(this.getInputElement(e.name),n=this.getErrorMessage(this.rules[e.name][i],i)),a?s=[s,a]:r?s=[s,r]:n&&(s=[s,n]),t[i]=s},s.prototype.wireEvents=function(){for(var e=0,i=this.inputElements;e<i.length;e++){var s=i[e];n.isCheckable(s)?t.EventHandler.add(s,"click",this.clickHandler,this):"SELECT"===s.tagName?t.EventHandler.add(s,"change",this.changeHandler,this):(t.EventHandler.add(s,"focusout",this.focusOutHandler,this),t.EventHandler.add(s,"keyup",this.keyUpHandler,this))}t.EventHandler.add(this.element,"submit",this.submitHandler,this),t.EventHandler.add(this.element,"reset",this.resetHandler,this)},s.prototype.unwireEvents=function(){for(var e=0,i=this.inputElements;e<i.length;e++){var s=i[e];t.EventHandler.clearEvents(s)}t.EventHandler.remove(this.element,"submit",this.submitHandler),t.EventHandler.remove(this.element,"reset",this.resetHandler)},s.prototype.focusOutHandler=function(e){this.trigger("focusout",e);var t=e.target;this.rules[t.name]&&(this.rules[t.name][this.required]||t.value.length>0?this.validate(t.name):-1===this.validated.indexOf(t.name)&&this.validated.push(t.name))},s.prototype.keyUpHandler=function(e){this.trigger("keyup",e);var t=e.target,i=[16,17,18,20,35,36,37,38,39,40,45,144,225];(9!==e.which||this.rules[t.name]&&(!this.rules[t.name]||this.rules[t.name][this.required]))&&-1!==this.validated.indexOf(t.name)&&this.rules[t.name]&&-1===i.indexOf(e.which)&&this.validate(t.name)},s.prototype.clickHandler=function(e){this.trigger("click",e);var t=e.target;"submit"!==t.type?this.validate(t.name):null!==t.getAttribute("formnovalidate")&&(this.allowSubmit=!0)},s.prototype.changeHandler=function(e){this.trigger("change",e);var t=e.target;this.validate(t.name)},s.prototype.submitHandler=function(e){this.trigger("submit",e),this.allowSubmit||this.validate()?this.allowSubmit=!1:e.preventDefault()},s.prototype.resetHandler=function(){this.clearForm()},s.prototype.validateRules=function(e){if(this.rules[e]){var t=Object.keys(this.rules[e]),i=!1,s=!1,n=t.indexOf("validateHidden"),a=t.indexOf("hidden");if(this.getInputElement(e),-1!==a&&(i=!0),-1!==n&&(s=!0),!i||i&&s){-1!==n&&t.splice(n,1),-1!==a&&t.splice(a-1,1),this.getErrorElement(e);for(var r=0,l=t;r<l.length;r++){var o=l[r],h=this.getErrorMessage(this.rules[e][o],o),d={name:e,message:h},u={inputName:e,element:this.inputElement,message:h};if(!this.isValid(e,o)&&!this.inputElement.classList.contains(this.ignore)){this.removeErrorRules(e),this.errorRules.push(d),this.inputElement.setAttribute("aria-invalid","true"),this.inputElement.setAttribute("aria-describedby",this.inputElement.id+"-info"),this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.infoElement?this.showMessage(d):this.createErrorElement(e,d.message,this.inputElement),u.errorElement=this.infoElement,u.status="failure",this.inputElement.classList.add(this.errorClass),this.inputElement.classList.remove(this.validClass),this.optionalValidationStatus(e,u),this.trigger("validationComplete",u),"required"===o&&this.inputElement.setAttribute("aria-required","true");break}this.hideMessage(e),u.status="success",this.trigger("validationComplete",u)}}}},s.prototype.optionalValidationStatus=function(e,i){this.rules[e][this.required]||this.inputElement.value.length||t.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),i.status="",this.hideMessage(e))},s.prototype.isValid=function(e,i){var s=this.rules[e][i],a=s instanceof Array&&"string"==typeof s[1]?s[0]:s,r=this.rules[e][i],l={value:this.inputElement.value,param:a,element:this.inputElement,formElement:this.element};return this.trigger("validationBegin",l),!l.param&&"required"===i||(r&&"function"==typeof r[0]?r[0].call(this,{element:this.inputElement,value:this.inputElement.value}):n.isCheckable(this.inputElement)?"required"!==i||t.selectAll('input[name="'+e+'"]:checked',this.element).length>0:n.checkValidator[i](l))},s.prototype.getErrorMessage=function(e,i){var s=this.inputElement.getAttribute("data-"+i+"-message")?this.inputElement.getAttribute("data-"+i+"-message"):e instanceof Array&&"string"==typeof e[1]?e[1]:0!==Object.keys(this.localyMessage).length?this.localyMessage[i]:this.defaultMessages[i],n=s.match(/{(\d)}/g);if(!t.isNullOrUndefined(n))for(var a=0;a<n.length;a++){var r=e instanceof Array?e[a]:e;s=s.replace(n[a],r)}return s},s.prototype.createErrorElement=function(i,s,n){var a=t.createElement(this.errorElement,{className:this.errorClass,innerHTML:s,attrs:{for:i}});if(this.errorOption===e.ErrorOption.Message&&(a.classList.remove(this.errorClass),a.classList.add("e-message"),a=t.createElement(this.errorContainer,{className:this.errorClass,innerHTML:a.outerHTML})),a.id=this.inputElement.name+"-info",this.element.querySelector('[data-valmsg-for="'+n.id+'"]'))this.element.querySelector('[data-valmsg-for="'+n.id+'"]').appendChild(a);else if(!0===n.hasAttribute("data-msg-containerid")){var r=n.getAttribute("data-msg-containerid");t.select("#"+r,this.element).appendChild(a)}else null!=this.customPlacement?this.customPlacement.call(this,this.inputElement,a):this.inputElement.parentNode.insertBefore(a,this.inputElement.nextSibling);a.style.display="block",this.getErrorElement(i),this.validated.push(i),this.checkRequired(i)},s.prototype.getErrorElement=function(e){return this.infoElement=t.select(this.errorElement+"."+this.errorClass,this.inputElement.parentElement),this.infoElement||(this.infoElement=t.select(this.errorElement+"."+this.errorClass+'[for="'+e+'"]',this.element)),this.infoElement},s.prototype.removeErrorRules=function(e){for(var t=0;t<this.errorRules.length;t++)this.errorRules[t].name===e&&this.errorRules.splice(t,1)},s.prototype.showMessage=function(e){this.infoElement.style.display="block",this.infoElement.innerHTML=e.message,this.checkRequired(e.name)},s.prototype.hideMessage=function(e){this.infoElement&&(this.infoElement.style.display="none",this.removeErrorRules(e),this.inputElement.classList.add(this.validClass),this.inputElement.classList.remove(this.errorClass),this.inputElement.setAttribute("aria-invalid","false"))},s.prototype.checkRequired=function(e){this.rules[e][this.required]||this.inputElement.value.length||t.isNullOrUndefined(this.infoElement)||(this.infoElement.innerHTML=this.inputElement.value,this.infoElement.setAttribute("aria-invalid","false"),this.hideMessage(e))},s.isCheckable=function(e){var t=e.getAttribute("type");return t&&("checkbox"===t||"radio"===t||"submit"===t)};var n;return s.checkValidator={required:function(e){return isNaN(Date.parse(e.value))?e.value.toString().length>0:!isNaN(new Date(e.value).getTime())},email:function(e){return Se.EMAIL.test(e.value)},url:function(e){return Se.URL.test(e.value)},dateIso:function(e){return Se.DATE_ISO.test(e.value)},tel:function(e){return Se.PHONE.test(e.value)},creditcard:function(e){return Se.CREDITCARD.test(e.value)},number:function(e){return!isNaN(Number(e.value))&&-1===e.value.indexOf(" ")},digits:function(e){return Se.DIGITS.test(e.value)},maxLength:function(e){return e.value.length<=e.param},minLength:function(e){return e.value.length>=e.param},rangeLength:function(e){var t=e.param;return e.value.length>=t[0]&&e.value.length<=t[1]},range:function(e){var t=e.param;return!isNaN(Number(e.value))&&Number(e.value)>=t[0]&&Number(e.value)<=t[1]},date:function(e){return!isNaN(new Date(e.value).getTime())},max:function(e){return isNaN(Number(e.value))?new Date(e.value).getTime()<=new Date(JSON.parse(JSON.stringify(e.param))).getTime():+e.value<=e.param},min:function(e){if(isNaN(Number(e.value))){if(-1!==e.value.indexOf(",")){var t=e.value.replace(/,/g,"");return parseFloat(t)>=e.param}return new Date(e.value).getTime()>=new Date(JSON.parse(JSON.stringify(e.param))).getTime()}return+e.value>=e.param},regex:function(e){return new RegExp(e.param).test(e.value)},equalTo:function(e){var t=e.formElement.querySelector("#"+e.param);return e.param=t.value,e.param===e.value}},Ce([t.Property("")],s.prototype,"locale",void 0),Ce([t.Property("e-hidden")],s.prototype,"ignore",void 0),Ce([t.Property()],s.prototype,"rules",void 0),Ce([t.Property("e-error")],s.prototype,"errorClass",void 0),Ce([t.Property("e-valid")],s.prototype,"validClass",void 0),Ce([t.Property("label")],s.prototype,"errorElement",void 0),Ce([t.Property("div")],s.prototype,"errorContainer",void 0),Ce([t.Property(e.ErrorOption.Label)],s.prototype,"errorOption",void 0),Ce([t.Event()],s.prototype,"focusout",void 0),Ce([t.Event()],s.prototype,"keyup",void 0),Ce([t.Event()],s.prototype,"click",void 0),Ce([t.Event()],s.prototype,"change",void 0),Ce([t.Event()],s.prototype,"submit",void 0),Ce([t.Event()],s.prototype,"validationBegin",void 0),Ce([t.Event()],s.prototype,"validationComplete",void 0),Ce([t.Event()],s.prototype,"customPlacement",void 0),s=n=Ce([t.NotifyPropertyChanges],s)}(t.Base),ke=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),xe=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},Oe="e-upload-file-list",Pe="e-file-status",Le="e-file-remove-btn",Be="e-file-delete-btn",Ae="e-file-abort-btn",He="e-file-reload-btn",Ne="e-upload-progress-wrap",we="e-upload-progress-bar",Ue="e-upload-success",Re="e-upload-fails",Fe="e-file-pause-btn",Ve=["title","style","class"],Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ke(i,e),xe([t.Property("")],i.prototype,"name",void 0),xe([t.Property(null)],i.prototype,"size",void 0),xe([t.Property("")],i.prototype,"type",void 0),i}(t.ChildProperty),De=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ke(i,e),xe([t.Property("Browse...")],i.prototype,"browse",void 0),xe([t.Property("Upload")],i.prototype,"upload",void 0),xe([t.Property("Clear")],i.prototype,"clear",void 0),i}(t.ChildProperty),Ie=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ke(i,e),xe([t.Property("")],i.prototype,"saveUrl",void 0),xe([t.Property("")],i.prototype,"removeUrl",void 0),xe([t.Property(0)],i.prototype,"chunkSize",void 0),xe([t.Property(3)],i.prototype,"retryCount",void 0),xe([t.Property(500)],i.prototype,"retryAfterDelay",void 0),i}(t.ChildProperty),ze=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.initialAttr={accept:null,multiple:!1,disabled:!1},s.uploadedFilesData=[],s.base64String=[],s.isForm=!1,s.allTypes=!1,s.pausedData=[],s.uploadMetaData=[],s.tabIndex="0",s.btnTabIndex="0",s.disableKeyboardNavigation=!1,s.count=-1,s.actionCompleteCount=0,s.flag=!0,s.selectedFiles=[],s.uploaderName="UploadFiles",s.fileStreams=[],s.newFileRef=0,s.isFirstFileOnSelection=!1,s.dragCounter=0,s.fileList=[],s.filesData=[],s.uploaderOptions=t,s}return ke(s,e),s.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"allowedExtensions":this.setExtensions(this.allowedExtensions),this.clearAll();break;case"enabled":this.setControlStatus();break;case"multiple":this.setMultipleSelection();break;case"enableRtl":this.setRTL(),this.reRenderFileList();break;case"buttons":this.buttons.browse=t.isNullOrUndefined(this.buttons.browse)?"":this.buttons.browse,this.buttons.clear=t.isNullOrUndefined(this.buttons.clear)?"":this.buttons.clear,this.buttons.upload=t.isNullOrUndefined(this.buttons.upload)?"":this.buttons.upload,this.renderButtonTemplates();break;case"dropArea":this.unBindDropEvents(),this.updateDropArea();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkHTMLAttributes(!0);break;case"files":this.renderPreLoadFiles();break;case"directoryUpload":this.updateDirectoryAttributes();break;case"template":this.isServerBlazor||this.clearAll();break;case"minFileSize":case"maxFileSize":case"autoUpload":case"sequentialUpload":this.clearAll();break;case"locale":this.l10n.setLocale(this.locale),this.setLocalizedTexts(),this.preLocaleObj=t.getValue("currentLocale",this.l10n);break;case"cssClass":this.setCSSClass(i.cssClass)}},s.prototype.setLocalizedTexts=function(){t.isNullOrUndefined(this.template)&&("string"==typeof this.buttons.browse&&(this.browseButton.innerText="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText),this.uploadWrapper&&!t.isNullOrUndefined(this.uploadWrapper.querySelector(".e-file-drop"))&&(this.uploadWrapper.querySelector(".e-file-drop").innerHTML=this.localizedTexts("dropFilesHint"))),this.updateFileList())},s.prototype.getKeyValue=function(e){for(var t,i=0,s=Object.keys(this.preLocaleObj);i<s.length;i++){var n=s[i];this.preLocaleObj[n]===e&&(t=n)}return t},s.prototype.updateFileList=function(){if(this.fileList.length>0&&!t.isNullOrUndefined(this.uploadWrapper.querySelector(".e-upload-files")))for(var e=0;e<this.fileList.length;e++)this.fileList[e].querySelector(".e-file-status").innerHTML=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.filesData[e].status=this.localizedTexts(this.getKeyValue(this.filesData[e].status)),this.fileList[e].classList.contains(Ue)&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("delete")),this.fileList[e].querySelector(".e-file-play-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("resume")),this.fileList[e].querySelector(".e-file-remove-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("remove")),this.fileList[e].querySelector(".e-file-reload-btn")&&this.fileList[e].querySelector(".e-icons").setAttribute("title",this.localizedTexts("retry")),this.autoUpload||(this.uploadButton.innerText="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.localizedTexts("Upload")),this.clearButton.innerText="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.localizedTexts("Clear")))},s.prototype.reRenderFileList=function(){this.listParent&&(t.detach(this.listParent),this.listParent=null,this.fileList=[],this.createFileList(this.filesData),this.actionButtons&&(this.removeActionButtons(),this.renderActionButtons(),this.checkActionButtonStatus()))},s.prototype.preRender=function(){if(this.localeText={Browse:"Browse...",Clear:"Clear",Upload:"Upload",dropFilesHint:"Or drop files here",invalidMaxFileSize:"File size is too large",invalidMinFileSize:"File size is too small",invalidFileType:"File type is not allowed",uploadFailedMessage:"File failed to upload",uploadSuccessMessage:"File uploaded successfully",removedSuccessMessage:"File removed successfully",removedFailedMessage:"Unable to remove file",inProgress:"Uploading",readyToUploadMessage:"Ready to upload",abort:"Abort",remove:"Remove",cancel:"Cancel",delete:"Delete file",pauseUpload:"File upload paused",pause:"Pause",resume:"Resume",retry:"Retry",fileUploadCancel:"File upload canceled",invalidFileSelection:"Invalid files selected",totalFiles:"Total files",size:"Size"},this.l10n=new t.L10n("uploader",this.localeText,this.locale),this.preLocaleObj=t.getValue("currentLocale",this.l10n),this.isServerBlazor=!(!t.isBlazor()||!this.isServerRendered),this.isBlazorTemplate=!(!this.isServerBlazor||""===this.template||t.isNullOrUndefined(this.template)),this.isBlazorSaveUrl=!(!this.isServerRendered||""!==this.asyncSettings.saveUrl&&!t.isNullOrUndefined(this.asyncSettings.saveUrl)),this.isBlazorSaveUrl&&this.sequentialUpload&&(this.sequentialUpload=!1),this.isBlazorSaveUrl||this.formRendered(),!this.isServerBlazor){this.updateHTMLAttrToElement(),this.checkHTMLAttributes(!1);var e=t.getValue("ej2_instances",this.element);if("EJS-UPLOADER"===this.element.tagName){var i=this.createElement("input",{attrs:{type:"file"}}),s=0;for(s;s<this.element.attributes.length;s++)i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML;i.hasAttribute("name")||i.setAttribute("name","UploadFiles"),this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}e[0].isPureReactComponent&&(t.isNullOrUndefined(e[0].props.name)?!t.isNullOrUndefined(e[0].props.id)&&t.isNullOrUndefined(e[0].props.name)?this.element.setAttribute("name",e[0].props.id):this.element.setAttribute("name","UploadFiles"):this.element.setAttribute("name",e[0].props.name)),t.isNullOrUndefined(this.element.getAttribute("name"))&&this.element.setAttribute("name",this.element.getAttribute("id")),this.element.hasAttribute("type")||this.element.setAttribute("type","file"),this.updateDirectoryAttributes()}this.keyConfigs={enter:"enter"},this.element.hasAttribute("tabindex")&&(this.tabIndex=this.element.getAttribute("tabindex")),this.browserName=t.Browser.info.name,this.uploaderName=this.element.getAttribute("name")},s.prototype.formRendered=function(){var e=t.closest(this.element,"form");if(!t.isNullOrUndefined(e))for(;e&&e!==document.documentElement;e=e.parentElement)"FORM"===e.tagName&&(this.isForm=!0,this.formElement=e,e.setAttribute("enctype","multipart/form-data"),e.setAttribute("encoding","multipart/form-data"))},s.prototype.getPersistData=function(){return this.addOnPersist(["filesData"])},s.prototype.getModuleName=function(){return"uploader"},s.prototype.updateDirectoryAttributes=function(){this.directoryUpload?(this.element.setAttribute("directory","true"),this.element.setAttribute("webkitdirectory","true")):(this.element.removeAttribute("directory"),this.element.removeAttribute("webkitdirectory"))},s.prototype.render=function(){this.isServerBlazor?(this.dropAreaWrapper=t.closest(this.element,".e-file-select-wrap"),this.uploadWrapper=t.closest(this.element,".e-upload.e-control-wrapper"),this.browseButton=this.dropAreaWrapper.querySelector("button.e-upload-browse-btn"),this.setDropArea(),this.renderPreLoadFiles(),this.wireEvents()):(this.renderBrowseButton(),this.initializeUpload(),this.updateHTMLAttrToWrapper(),this.wireEvents(),this.setMultipleSelection(),this.setExtensions(this.allowedExtensions),this.setRTL(),this.renderPreLoadFiles(),this.setControlStatus(),this.setCSSClass()),this.isServerBlazor&&this.renderComplete()},s.prototype.renderBrowseButton=function(){this.browseButton=this.createElement("button",{className:"e-css e-btn",attrs:{type:"button"}}),this.browseButton.setAttribute("tabindex",this.tabIndex),"string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.innerText)):this.browseButton.appendChild(this.buttons.browse),this.element.setAttribute("aria-label","Uploader")},s.prototype.renderActionButtons=function(){this.element.setAttribute("tabindex","-1"),this.isBlazorSaveUrl||this.isBlazorTemplate||(this.actionButtons=this.createElement("div",{className:"e-upload-actions"}),this.uploadButton=this.createElement("button",{className:"e-file-upload-btn e-css e-btn e-flat e-primary",attrs:{type:"button",tabindex:this.btnTabIndex}}),this.clearButton=this.createElement("button",{className:"e-file-clear-btn e-css e-btn e-flat",attrs:{type:"button",tabindex:this.btnTabIndex}}),this.actionButtons.appendChild(this.clearButton),this.actionButtons.appendChild(this.uploadButton),this.renderButtonTemplates(),this.uploadWrapper.appendChild(this.actionButtons),this.browseButton.blur(),this.uploadButton.focus(),this.wireActionButtonEvents())},s.prototype.serverActionButtonsEventBind=function(e){e&&!this.isForm&&(this.browseButton.blur(),this.actionButtons=e,this.uploadButton=this.actionButtons.querySelector(".e-file-upload-btn"),this.clearButton=this.actionButtons.querySelector(".e-file-clear-btn"),this.uploadButton.focus(),this.unwireActionButtonEvents(),this.wireActionButtonEvents(),this.checkActionButtonStatus())},s.prototype.serverUlElement=function(e){e&&(this.isBlazorSaveUrl||this.isBlazorTemplate)&&(this.listParent=e,this.fileList=[].slice.call(this.listParent.querySelectorAll("li")),this.serverRemoveIconBindEvent(),this.isForm||this.checkAutoUpload(this.filesData))},s.prototype.wireActionButtonEvents=function(){t.EventHandler.add(this.uploadButton,"click",this.uploadButtonClick,this),t.EventHandler.add(this.clearButton,"click",this.clearButtonClick,this)},s.prototype.unwireActionButtonEvents=function(){t.EventHandler.remove(this.uploadButton,"click",this.uploadButtonClick),t.EventHandler.remove(this.clearButton,"click",this.clearButtonClick)},s.prototype.removeActionButtons=function(){this.actionButtons&&(this.unwireActionButtonEvents(),this.isBlazorSaveUrl||this.isBlazorTemplate||t.detach(this.actionButtons),this.actionButtons=null)},s.prototype.renderButtonTemplates=function(){if("string"==typeof this.buttons.browse?(this.browseButton.textContent="Browse..."===this.buttons.browse?this.localizedTexts("Browse"):this.buttons.browse,this.browseButton.setAttribute("title",this.browseButton.textContent)):(this.browseButton.innerHTML="",this.browseButton.appendChild(this.buttons.browse)),this.uploadButton){var e=t.isNullOrUndefined(this.buttons.upload)?"Upload":this.buttons.upload;this.buttons.upload=e,"string"==typeof this.buttons.upload?(this.uploadButton.textContent="Upload"===this.buttons.upload?this.localizedTexts("Upload"):this.buttons.upload,this.uploadButton.setAttribute("title",this.uploadButton.textContent)):(this.uploadButton.innerHTML="",this.uploadButton.appendChild(this.buttons.upload))}if(this.clearButton){var i=t.isNullOrUndefined(this.buttons.clear)?"Clear":this.buttons.clear;this.buttons.clear=i,"string"==typeof this.buttons.clear?(this.clearButton.textContent="Clear"===this.buttons.clear?this.localizedTexts("Clear"):this.buttons.clear,this.clearButton.setAttribute("title",this.clearButton.textContent)):(this.clearButton.innerHTML="",this.clearButton.appendChild(this.buttons.clear))}},s.prototype.initializeUpload=function(){this.element.setAttribute("tabindex","-1");var e=this.createElement("span",{className:"e-file-select"});this.element.parentElement.insertBefore(e,this.element),this.dropAreaWrapper=this.createElement("div",{className:"e-file-select-wrap"}),this.element.parentElement.insertBefore(this.dropAreaWrapper,this.element),e.appendChild(this.element),this.dropAreaWrapper.appendChild(this.browseButton),this.dropAreaWrapper.appendChild(e),this.uploadWrapper=this.createElement("div",{className:"e-upload e-control-wrapper"}),this.dropAreaWrapper.parentElement.insertBefore(this.uploadWrapper,this.dropAreaWrapper),this.uploadWrapper.appendChild(this.dropAreaWrapper),this.setDropArea()},s.prototype.renderPreLoadFiles=function(){if(this.files.length){if(this.enablePersistence&&this.filesData.length)return void this.createFileList(this.filesData);if(t.isNullOrUndefined(this.files[0].size))return;var e=[].slice.call(this.files),i=[];this.multiple||(this.clearData(),e=[e[0]]);for(var s=0,n=e;s<n.length;s++){var a=n[s],r={name:a.name+"."+a.type.split(".")[a.type.split(".").length-1],rawFile:"",size:a.size,status:this.localizedTexts("uploadSuccessMessage"),type:a.type,validationMessages:{minSize:"",maxSize:""},statusCode:"2"};i.push(r),this.filesData.push(r)}this.createFileList(i),this.autoUpload||!this.listParent||this.actionButtons||this.isForm&&!this.allowUpload()||!this.showFileList||this.renderActionButtons(),this.checkActionButtonStatus(),this.sequentialUpload&&(this.count=this.filesData.length-1)}},s.prototype.checkActionButtonStatus=function(){if(this.actionButtons){var e=this.uploadWrapper.querySelectorAll(".e-validation-fails").length+this.uploadWrapper.querySelectorAll(".e-upload-fails:not(.e-upload-progress)").length+this.uploadWrapper.querySelectorAll("span."+Ue).length+this.uploadWrapper.querySelectorAll("span.e-upload-progress").length;e>0&&e===this.uploadWrapper.querySelectorAll("li").length?this.uploadButton.setAttribute("disabled","disabled"):this.uploadButton.removeAttribute("disabled")}},s.prototype.setDropArea=function(){var e=this.dropAreaWrapper.querySelector(".e-file-drop");if(this.dropArea){this.dropZoneElement="string"!=typeof this.dropArea?this.dropArea:t.select(this.dropArea,document);for(var i=this.element,s=!1;i.parentNode;)(i=i.parentNode)===this.dropZoneElement&&(s=!0,e?this.isServerBlazor||(e.innerHTML=this.localizedTexts("dropFilesHint")):this.createDropTextHint());!s&&e&&t.remove(e)}else t.isNullOrUndefined(this.uploaderOptions)||void 0!==this.uploaderOptions.dropArea||(this.createDropTextHint(),this.dropZoneElement=this.uploadWrapper,this.setProperties({dropArea:this.uploadWrapper},!0));this.bindDropEvents()},s.prototype.updateDropArea=function(){if(this.dropArea)this.setDropArea();else{this.dropZoneElement=null;var e=this.dropAreaWrapper.querySelector(".e-file-drop");e&&t.remove(e)}},s.prototype.createDropTextHint=function(){if(!this.isServerBlazor){var e=this.createElement("span",{className:"e-file-drop"});e.innerHTML=this.localizedTexts("dropFilesHint"),this.dropAreaWrapper.appendChild(e)}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];Ve.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(Ve.indexOf(s)>-1)if("class"===s){var n=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==n&&t.addClass([this.uploadWrapper],n.split(" "))}else if("style"===s){var a=this.uploadWrapper.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.uploadWrapper.setAttribute(s,a)}else this.uploadWrapper.setAttribute(s,this.htmlAttributes[s])}},s.prototype.setMultipleSelection=function(){if(this.multiple&&!this.element.hasAttribute("multiple")){var e=document.createAttribute("multiple");e.value="multiple",this.element.setAttributeNode(e)}else this.multiple||this.element.removeAttribute("multiple")},s.prototype.checkAutoUpload=function(e){this.autoUpload?(this.sequentialUpload?this.sequenceUpload(e):this.upload(e),this.removeActionButtons()):this.actionButtons||this.renderActionButtons(),this.checkActionButtonStatus()},s.prototype.sequenceUpload=function(e){if(this.filesData.length-e.length==0||"1"!==this.filesData[this.filesData.length-e.length-1].statusCode){++this.count;var t=!this.showFileList;"object"==typeof this.filesData[this.count]?(this.isFirstFileOnSelection=!1,this.upload(this.filesData[this.count],t),"0"===this.filesData[this.count].statusCode&&this.sequenceUpload(e)):--this.count}},s.prototype.setCSSClass=function(e){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.cssClass.replace(/\s+/g," ").trim()),t.isNullOrUndefined(this.cssClass)||""===i||t.addClass([this.uploadWrapper],i.split(i.indexOf(",")>-1?",":" "));var s=e;t.isNullOrUndefined(e)||(s=e.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||""===s||t.removeClass([this.uploadWrapper],s.split(" "))},s.prototype.wireEvents=function(){t.EventHandler.add(this.browseButton,"click",this.browseButtonClick,this),t.EventHandler.add(this.element,"change",this.onSelectFiles,this),t.EventHandler.add(document,"click",this.removeFocus,this),this.keyboardModule=new t.KeyboardEvents(this.uploadWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.resetForm,this)},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.browseButton,"click",this.browseButtonClick),t.EventHandler.remove(this.element,"change",this.onSelectFiles),t.EventHandler.remove(document,"click",this.removeFocus),this.isForm&&t.EventHandler.remove(this.formElement,"reset",this.resetForm),this.keyboardModule&&this.keyboardModule.destroy()},s.prototype.resetForm=function(){this.clearAll()},s.prototype.keyActionHandler=function(e){var i=e.target;switch(e.action){case"enter":if(e.target===this.clearButton)this.clearButtonClick();else if(e.target===this.uploadButton)this.uploadButtonClick();else if(e.target===this.browseButton)this.browseButtonClick();else if(i.classList.contains(Fe))(s=this.getCurrentMetaData(null,e)).file.statusCode="4",s.file.status=this.localizedTexts("pauseUpload"),this.abortUpload(s,!1);else if(i.classList.contains("e-file-play-btn"))this.resumeUpload(this.getCurrentMetaData(null,e),e);else if(i.classList.contains(He)){var s=this.getCurrentMetaData(null,e);if(t.isNullOrUndefined(s)){var n=e.target.parentElement,a=this.filesData[this.fileList.indexOf(n)];this.retry(a)}else s.file.statusCode="1",s.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(s.file)}else this.removeFiles(e),i.classList.contains(Ae)||this.browseButton.focus();e.preventDefault(),e.stopPropagation()}},s.prototype.getCurrentMetaData=function(e,i){var s,n;if(t.isNullOrUndefined(e)){var a=i.target.parentElement;s=this.filesData[this.fileList.indexOf(a)]}else s=e;for(var r=0;r<this.uploadMetaData.length;r++)this.uploadMetaData[r].file.name===s.name&&(n=this.uploadMetaData[r]);return n},s.prototype.removeFocus=function(){this.uploadWrapper&&this.listParent&&this.listParent.querySelector(".e-clear-icon-focus")&&(document.activeElement.blur(),this.listParent.querySelector(".e-clear-icon-focus").classList.remove("e-clear-icon-focus"))},s.prototype.browseButtonClick=function(){this.element.click()},s.prototype.uploadButtonClick=function(){this.sequentialUpload?this.sequenceUpload(this.filesData):this.upload(this.filesData)},s.prototype.clearButtonClick=function(){this.clearAll(),this.sequentialUpload&&(this.count=-1),this.actionCompleteCount=0},s.prototype.bindDropEvents=function(){this.dropZoneElement&&(t.EventHandler.add(this.dropZoneElement,"drop",this.dropElement,this),t.EventHandler.add(this.dropZoneElement,"dragover",this.dragHover,this),t.EventHandler.add(this.dropZoneElement,"dragleave",this.onDragLeave,this),t.EventHandler.add(this.dropZoneElement,"paste",this.onPasteFile,this),t.EventHandler.add(this.dropZoneElement,"dragenter",this.onDragEnter,this))},s.prototype.unBindDropEvents=function(){this.dropZoneElement&&(t.EventHandler.remove(this.dropZoneElement,"drop",this.dropElement),t.EventHandler.remove(this.dropZoneElement,"dragover",this.dragHover),t.EventHandler.remove(this.dropZoneElement,"dragleave",this.onDragLeave),t.EventHandler.remove(this.dropZoneElement,"dragenter",this.onDragEnter))},s.prototype.onDragEnter=function(e){this.enabled&&(this.dropZoneElement.classList.add("e-upload-drag-hover"),this.dragCounter=this.dragCounter+1,e.preventDefault(),e.stopPropagation())},s.prototype.onDragLeave=function(){this.enabled&&(this.dragCounter=this.dragCounter-1,this.dragCounter||this.dropZoneElement.classList.remove("e-upload-drag-hover"))},s.prototype.dragHover=function(e){this.enabled&&("Default"!==this.dropEffect&&(e.dataTransfer.dropEffect=this.dropEffect.toLowerCase()),e.preventDefault(),e.stopPropagation())},s.prototype.dropElement=function(e){this.dragCounter=0,this.dropZoneElement.classList.remove("e-upload-drag-hover"),this.onSelectFiles(e),e.preventDefault(),e.stopPropagation()},s.prototype.onPasteFile=function(e){var t=e.clipboardData.items;if(1===t.length){var i=[].slice.call(t)[0];"file"===i.kind&&i.type.match("^image/")&&this.renderSelectedFiles(e,[i.getAsFile()],!1,!0)}},s.prototype.getSelectedFiles=function(e){for(var t=[],i=this.fileList[e],s=this.getFilesData(),n=+i.getAttribute("data-files-count"),a=0,r=0;r<e;r++)a+=+this.fileList[r].getAttribute("data-files-count");for(var l=a;l<a+n;l++)t.push(s[l]);return t},s.prototype.removeFiles=function(e){if(this.enabled){var s=e.target.parentElement;this.isBlazorSaveUrl&&(this.fileList=[].slice.call(this.uploadWrapper.querySelectorAll("li")));var n=this.fileList.indexOf(s),a=this.fileList[n],r=this.isFormUpload(),l=r?this.getSelectedFiles(n):this.getFilesInArray(this.filesData[n]);if(!t.isNullOrUndefined(l)){if(e.target.classList.contains(Ae)&&!r){if(l[0].statusCode="5",!t.isNullOrUndefined(a)){var o=a.querySelector("."+Ae);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}this.sequentialUpload&&this.uploadSequential(),a.classList.contains("e-restrict-retry")||this.checkActionComplete(!0)}else t.closest(e.target,".e-spinner-pane")||this.remove(l,!1,!1,!0,e);this.element.value="",this.checkActionButtonStatus()}}},s.prototype.removeFilesData=function(e,i){var s;if(i)return void(this.showFileList||(s=this.filesData.indexOf(e),this.filesData.splice(s,1)));var n=this.getLiElement(e);t.isNullOrUndefined(n)||(this.isBlazorSaveUrl||t.detach(n),s=this.fileList.indexOf(n),this.fileList.splice(s,1),this.filesData.splice(s,1),this.isBlazorSaveUrl?this.interopAdaptor.invokeMethodAsync("removeFileData",s):(0!==this.fileList.length||t.isNullOrUndefined(this.listParent)||(t.detach(this.listParent),this.listParent=null,this.removeActionButtons()),this.sequentialUpload&&s<=this.count&&--this.count))},s.prototype.removeUploadedFile=function(e,i,s,n){var a=this,r=e,l=new t.Ajax(this.asyncSettings.removeUrl,"POST",!0,null);l.emitError=!1;var o=new FormData;if(l.beforeSend=function(n){i.currentRequest=l.httpRequest,t.isBlazor()&&(a.currentRequestHeader&&a.updateCustomheader(l.httpRequest,a.currentRequestHeader),a.customFormDatas&&a.updateFormData(o,a.customFormDatas)),s?a.removingEventCallback(i,o,r,e):a.trigger("removing",i,function(t){t.cancel?n.cancel=!0:a.removingEventCallback(t,o,r,e)})},this.isServerBlazor){var h=this.element.getAttribute("name");t.isNullOrUndefined(r.rawFile)||""===r.rawFile?o.append(h,r.name):o.append(h,r.rawFile,r.name)}l.onLoad=function(e){return a.removeCompleted(e,r,n),{}},l.onError=function(e){return a.removeFailed(e,r,n),{}},l.send(o)},s.prototype.removingEventCallback=function(e,s,n,a){var r=this.element.getAttribute("name"),l=this.getLiElement(a);if(!(t.isNullOrUndefined(l)||t.isNullOrUndefined(l.querySelector("."+Be))&&t.isNullOrUndefined(l.querySelector("."+Le)))){var o=l.querySelector("."+Be)?l.querySelector("."+Be):l.querySelector("."+Le);i.createSpinner({target:o,width:"20px"}),i.showSpinner(o)}this.isServerBlazor||(e.postRawFile&&!t.isNullOrUndefined(n.rawFile)&&""!==n.rawFile?s.append(r,n.rawFile,n.name):s.append(r,n.name),this.updateFormData(s,e.customFormData))},s.prototype.updateFormData=function(e,t){if(t.length>0&&t[0])for(var i=0;i<t.length;i++)!function(i){var s=t[i],n=Object.keys(s).map(function(e){return s[e]});e.append(Object.keys(s)[0],n)}(i)},s.prototype.updateCustomheader=function(e,t){if(t.length>0&&t[0])for(var i=0;i<t.length;i++)!function(i){var s=t[i],n=Object.keys(s).map(function(e){return s[e]});e.setRequestHeader(Object.keys(s)[0],n)}(i)},s.prototype.removeCompleted=function(e,t,i){var s=e&&e.currentTarget?this.getResponse(e):null,n=e.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a={e:e,response:s,operation:"remove",file:this.updateStatus(t,this.localizedTexts("removedSuccessMessage"),"2")};this.trigger("success",a),this.removeFilesData(t,i);var r=this.uploadedFilesData.indexOf(t);this.uploadedFilesData.splice(r,1),this.trigger("change",{files:this.uploadedFilesData})}else this.removeFailed(e,t,i)},s.prototype.removeFailed=function(e,s,n){var a={e:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"remove",file:this.updateStatus(s,this.localizedTexts("removedFailedMessage"),"0")};if(!n){var r=this.filesData.indexOf(s),l=this.fileList[r];if(l){l.classList.remove(Ue),l.classList.add(Re);var o=l.querySelector("."+Pe);o&&(o.classList.remove(Ue),o.classList.add(Re))}this.checkActionButtonStatus()}this.trigger("failure",a);var h=this.getLiElement(s);if(!t.isNullOrUndefined(h)&&!t.isNullOrUndefined(h.querySelector("."+Be))){var d=h.querySelector("."+Be);i.hideSpinner(d),t.detach(h.querySelector(".e-spinner-pane"))}},s.prototype.getFilesFromFolder=function(e){this.filesEntries=[];var t=this.multiple?e.dataTransfer.items:[e.dataTransfer.items[0]];if(this.checkDirectoryUpload(t))for(var i=this,s=0;s<t.length;s++)!function(s){var n=t[s].webkitGetAsEntry();if(n.isFile){var a=[];n.file(function(e){var t=n.fullPath;a.push({path:t,file:e})}),i.renderSelectedFiles(e,a,!0)}else n.isDirectory&&i.traverseFileTree(n,e)}(s)},s.prototype.checkDirectoryUpload=function(e){for(var t=0;e&&t<e.length;t++)if(e[t].webkitGetAsEntry().isDirectory)return!0;return!1},s.prototype.traverseFileTree=function(e,t){if(e.isFile)this.filesEntries.push(e);else if(e.isDirectory){var i=e.createReader();this.readFileFromDirectory(i,t)}},s.prototype.readFileFromDirectory=function(e,t){var i=this;e.readEntries(function(s){for(var n=0;n<s.length;n++)i.traverseFileTree(s[n],t);i.pushFilesEntries(t),s.length&&i.readFileFromDirectory(e)})},s.prototype.pushFilesEntries=function(e){for(var t=this,i=[],s=this,n=0;n<this.filesEntries.length;n++)!function(n){s.filesEntries[n].file(function(s){if(t.filesEntries.length){var a=t.filesEntries[n].fullPath;i.push({path:a,file:s}),n===t.filesEntries.length-1&&(t.filesEntries=[],t.renderSelectedFiles(e,i,!0))}})}(n)},s.prototype.onSelectFiles=function(e){if(this.enabled){var t;if("drop"===e.type)if(this.directoryUpload)this.getFilesFromFolder(e);else{var i=this.sortFilesList=e.dataTransfer.files;"msie"!==this.browserName&&"edge"!==this.browserName&&"safari"!==this.browserName&&(this.element.files=i),i.length>0&&(t=this.multiple?this.sortFileList(i):[i[0]],this.renderSelectedFiles(e,t))}else t=[].slice.call(e.target.files),this.renderSelectedFiles(e,t)}},s.prototype.getBase64=function(e){return new Promise(function(t,i){var s=new FileReader;s.readAsDataURL(e),s.onload=function(){return t(s.result)},s.onerror=function(e){return i(e)}})},s.prototype.renderSelectedFiles=function(e,t,i,s){var n=this;this.base64String=[];var a={event:e,cancel:!1,filesData:[],isModified:!1,modifiedFilesData:[],progressInterval:"",isCanceled:!1,currentRequest:null,customFormData:null};if(t.length<1)return a.isCanceled=!0,void this.trigger("selected",a);this.flag=!0;var r=[];this.multiple||(this.clearData(!0),t=[t[0]]);for(var l=0;l<t.length;l++){var o=i?t[l].file:t[l];this.updateInitialFileDetails(e,t,o,l,r,i,s)}a.filesData=r,this.allowedExtensions.indexOf("*")>-1&&(this.allTypes=!0),this.allTypes||(r=this.checkExtension(r)),this.trigger("selected",a,function(e){n._internalRenderSelect(e,r)})},s.prototype.updateInitialFileDetails=function(e,i,s,n,a,r,l){var o={name:r?i[n].path.substring(1,i[n].path.length):l?t.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name):this.directoryUpload?i[n].webkitRelativePath:s.name,rawFile:s,size:s.size,status:this.localizedTexts("readyToUploadMessage"),type:this.getFileType(s.name),validationMessages:this.validatedFileSize(s.size),statusCode:"1",id:t.getUniqueID(s.name.substring(0,s.name.lastIndexOf(".")))+"."+this.getFileType(s.name)};l&&(o.fileSource="paste"),o.status=""!==o.validationMessages.minSize?this.localizedTexts("invalidMinFileSize"):""!==o.validationMessages.maxSize?this.localizedTexts("invalidMaxFileSize"):o.status,""===o.validationMessages.minSize&&""===o.validationMessages.maxSize||(o.statusCode="0"),a.push(o)},s.prototype._internalRenderSelect=function(e,i){if(!e.cancel){if(t.isBlazor()&&(this.currentRequestHeader=e.currentRequest,this.customFormDatas=e.customFormData),this.selectedFiles=this.selectedFiles.concat(i),this.btnTabIndex=this.disableKeyboardNavigation?"-1":"0",this.showFileList){if(e.isModified&&e.modifiedFilesData.length>0){for(var s=0;s<e.modifiedFilesData.length;s++)for(var n=0;n<i.length;n++)e.modifiedFilesData[s].id===i[n].id&&(e.modifiedFilesData[s].rawFile=i[n].rawFile);var a=this.allTypes?e.modifiedFilesData:this.checkExtension(e.modifiedFilesData);this.updateSortedFileList(a),this.filesData=a,this.isForm&&!this.allowUpload()||this.checkAutoUpload(a)}else this.createFileList(i,!0),this.isBlazorSaveUrl||this.isBlazorTemplate||(this.filesData=this.filesData.concat(i)),this.isForm&&!this.allowUpload()||this.isBlazorSaveUrl||this.isBlazorTemplate||this.checkAutoUpload(i);t.isNullOrUndefined(e.progressInterval)||""===e.progressInterval||(this.progressInterval=e.progressInterval)}else this.filesData=this.filesData.concat(i),this.isBlazorSaveUrl&&this.interopAdaptor.invokeMethodAsync("updateServerFileData",this.filesData,this.isForm),this.autoUpload&&this.upload(this.filesData,!0);this.raiseActionComplete(),this.isFirstFileOnSelection=!0}},s.prototype.allowUpload=function(){var e=!1;return this.isForm&&!t.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl&&(e=!0),e},s.prototype.isFormUpload=function(){var e=!1;return!this.isForm||!t.isNullOrUndefined(this.asyncSettings.saveUrl)&&""!==this.asyncSettings.saveUrl||!t.isNullOrUndefined(this.asyncSettings.removeUrl)&&""!==this.asyncSettings.removeUrl||(e=!0),e},s.prototype.clearData=function(e){t.isNullOrUndefined(this.listParent)||this.isBlazorSaveUrl||this.isBlazorTemplate||(t.detach(this.listParent),this.listParent=null),"msie"===this.browserName||e||(this.element.value=""),this.fileList=[],this.filesData=[],this.isBlazorSaveUrl||this.isBlazorTemplate?this.interopAdaptor.invokeMethodAsync("clearAll"):this.removeActionButtons()},s.prototype.updateSortedFileList=function(e){var i,s=this.createElement("div",{id:"clonewrapper"}),n=-1;if(this.listParent){for(var a=0;a<this.listParent.querySelectorAll("li").length;a++){var r=this.listParent.querySelectorAll("li")[a];s.appendChild(r.cloneNode(!0))}for(var l=0,o=i=this.listParent.querySelectorAll("li");l<o.length;l++){var h=o[l];t.detach(h)}this.removeActionButtons();var d=[].slice.call(s.childNodes);t.detach(this.listParent),this.listParent=null,this.fileList=[],this.createParentUL();for(var u=0;u<e.length;u++){for(var c=0;c<this.filesData.length;c++)this.filesData[c].name===e[u].name&&(this.listParent.appendChild(d[c]),t.EventHandler.add(d[c].querySelector(".e-icons"),"click",this.removeFiles,this),this.fileList.push(d[c]),n=u);n!==u&&this.createFileList([e[u]])}}else this.createFileList(e)},s.prototype.isBlank=function(e){return!e||/^\s*$/.test(e)},s.prototype.checkExtension=function(e){var t=e;if(!this.isBlank(this.allowedExtensions)){for(var i=[],s=0,n=this.allowedExtensions.split(",");s<n.length;s++){var a=n[s];i.push(a.trim().toLocaleLowerCase())}for(var r=0;r<e.length;r++)-1===i.indexOf(("."+e[r].type).toLocaleLowerCase())&&(e[r].status=this.localizedTexts("invalidFileType"),e[r].statusCode="0")}return t},s.prototype.validatedFileSize=function(e){var t="",i="";return e<this.minFileSize?t=this.localizedTexts("invalidMinFileSize"):e>this.maxFileSize?i=this.localizedTexts("invalidMaxFileSize"):(t="",i=""),{minSize:t,maxSize:i}},s.prototype.isPreLoadFile=function(e){for(var t=!1,i=0;i<this.files.length;i++)this.files[i].name===e.name.slice(0,e.name.lastIndexOf("."))&&this.files[i].type===e.type&&(t=!0);return t},s.prototype.createCustomfileList=function(e){this.createParentUL(),t.resetBlazorTemplate(this.element.id+"Template","Template");for(var i=0,s=e;i<s.length;i++){var n=s[i],a=this.createElement("li",{className:Oe,attrs:{"data-file-name":n.name}});this.uploadTemplateFn=this.templateComplier(this.template);var r=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,a);if(r){var l=[].slice.call(r);t.append(l,a)}var o=e.indexOf(n),h={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)},d={element:a,fileInfo:n,index:o,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",h),this.trigger("fileListRendering",d),this.listParent.appendChild(a),this.fileList.push(a)}this.renderReactTemplates(),t.updateBlazorTemplate(this.element.id+"Template","Template",this,!1)},s.prototype.createParentUL=function(){t.isNullOrUndefined(this.listParent)&&(this.listParent=this.createElement("ul",{className:"e-upload-files"}),this.uploadWrapper.appendChild(this.listParent))},s.prototype.formFileList=function(e,i){var s=this.createElement("li",{className:Oe});s.setAttribute("data-files-count",e.length+"");for(var n,a=this.createElement("span",{className:"e-file-container"}),r=0,l=e;r<l.length;r++){var o=l[r],h=this.createElement("span",{className:"e-file-name"});h.innerHTML=this.getFileNameOnly(o.name);var d=this.createElement("span",{className:"e-file-type"}),u=this.getFileType(o.name);if(d.innerHTML="."+u,u||d.classList.add("e-hidden"),this.enableRtl){var c=this.createElement("span",{className:"e-rtl-container"});c.appendChild(d),c.appendChild(h),a.appendChild(c)}else a.appendChild(h),a.appendChild(d);this.truncateName(h),n=this.formValidateFileInfo(o,s)}s.appendChild(a),this.setListToFileInfo(e,s);var p=this.listParent.querySelectorAll("li").length,m=this.createElement("span");if(s.classList.contains("e-file-invalid")?(m.classList.add(Pe),m.classList.add("e-file-invalid"),m.innerText=e.length>1?this.localizedTexts("invalidFileSelection"):n):(m.classList.add(e.length>1?"e-file-information":"e-file-size"),m.innerText=e.length>1?this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):this.bytesToSize(e[0].size),this.createFormInput(e)),a.appendChild(m),t.isNullOrUndefined(s.querySelector(".e-icons"))){var v=this.createElement("span",{className:"e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&v.classList.add("e-msie"),v.setAttribute("title",this.localizedTexts("remove")),s.appendChild(a),s.appendChild(v),t.EventHandler.add(v,"click",this.removeFiles,this),v.classList.add(Le)}var f={element:s,fileInfo:this.mergeFileInfo(e,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,s))},g={element:s,fileInfo:this.mergeFileInfo(e,s),index:p,isPreload:this.isPreLoadFile(this.mergeFileInfo(e,s))};this.trigger("rendering",f),this.trigger("fileListRendering",g),this.listParent.appendChild(s),this.fileList.push(s)},s.prototype.formValidateFileInfo=function(e,t){var i=e.status,s=this.validatedFileSize(e.size);""===s.minSize&&""===s.maxSize||(this.addInvalidClass(t),i=""!==s.minSize?this.localizedTexts("invalidMinFileSize"):""!==s.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var n=this.checkExtension(this.getFilesInArray(e))[0].status;return n===this.localizedTexts("invalidFileType")&&(this.addInvalidClass(t),i=n),i},s.prototype.addInvalidClass=function(e){e.classList.add("e-file-invalid")},s.prototype.createFormInput=function(e){var t=this.element.cloneNode(!0);t.classList.add("e-hidden-file-input");for(var i=0,s=e;i<s.length;i++)s[i].input=t;t.setAttribute("name",this.uploaderName),this.uploadWrapper.querySelector(".e-file-select").appendChild(t),"msie"!==this.browserName&&"edge"!==this.browserName&&(this.element.value="")},s.prototype.getFileSize=function(e){for(var t=0,i=0,s=e;i<s.length;i++)t+=s[i].size;return t},s.prototype.mergeFileInfo=function(e,t){for(var i={name:"",rawFile:"",size:0,status:"",type:"",validationMessages:{minSize:"",maxSize:""},statusCode:"1",list:t},s=[],n="",a=0,r=e;a<r.length;a++){var l=r[a];s.push(l.name),n=l.type}return i.name=s.join(", "),i.size=this.getFileSize(e),i.type=n,i.status=this.statusForFormUpload(e,t),i},s.prototype.statusForFormUpload=function(e,t){for(var i,s=!0,n=0,a=e;n<a.length;n++){var r=a[n];i=r.status;var l=this.validatedFileSize(r.size);""===l.minSize&&""===l.maxSize||(s=!1,i=""!==l.minSize?this.localizedTexts("invalidMinFileSize"):""!==l.maxSize?this.localizedTexts("invalidMaxFileSize"):i);var o=this.checkExtension(this.getFilesInArray(r))[0].status;o===this.localizedTexts("invalidFileType")&&(s=!1,i=o)}return s?i=this.localizedTexts("totalFiles")+": "+e.length+" , "+this.localizedTexts("size")+": "+this.bytesToSize(this.getFileSize(e)):(t.classList.add("e-file-invalid"),i=e.length>1?this.localizedTexts("invalidFileSelection"):i),i},s.prototype.formCustomFileList=function(e,i){this.createParentUL(),t.resetBlazorTemplate(this.element.id+"Template","Template");var s=this.createElement("li",{className:Oe});s.setAttribute("data-files-count",e.length+""),this.setListToFileInfo(e,s);var n=this.mergeFileInfo(e,s);s.setAttribute("data-file-name",n.name),this.uploadTemplateFn=this.templateComplier(this.template);var a=this.uploadTemplateFn(n,this,"template",this.element.id+"Template",this.isStringTemplate,null,s);if(a){var r=[].slice.call(a);t.append(r,s)}var l=this.listParent.querySelectorAll("li").length;s.classList.contains("e-file-invalid")||this.createFormInput(e);var o={element:s,fileInfo:n,index:l,isPreload:this.isPreLoadFile(n)},h={element:s,fileInfo:n,index:l,isPreload:this.isPreLoadFile(n)};this.trigger("rendering",o),this.trigger("fileListRendering",h),this.listParent.appendChild(s),this.fileList.push(s),this.renderReactTemplates(),t.updateBlazorTemplate(this.element.id+"Template","Template",this,!1)},s.prototype.createFileList=function(e,i){if(this.isBlazorSaveUrl||this.isBlazorTemplate){var s=i?this.filesData=this.filesData.concat(e):e;this.interopAdaptor.invokeMethodAsync("createFileList",s,this.isForm)}else if(this.createParentUL(),""===this.template||t.isNullOrUndefined(this.template))if(this.isFormUpload())this.uploadWrapper.classList.add("e-form-upload"),this.formFileList(e,this.element.files);else for(var n=0,a=e;n<a.length;n++){var r=a[n],l=this.createElement("li",{className:Oe,attrs:{"data-file-name":r.name,"data-files-count":"1"}}),o=this.createElement("span",{className:"e-file-container"}),h=this.createElement("span",{className:"e-file-name",attrs:{title:r.name}});h.innerHTML=this.getFileNameOnly(r.name);var d=this.createElement("span",{className:"e-file-type"}),u=this.getFileType(r.name);if(d.innerHTML="."+u,u||d.classList.add("e-hidden"),this.enableRtl){var c=this.createElement("span",{className:"e-rtl-container"});c.appendChild(d),c.appendChild(h),o.appendChild(c)}else o.appendChild(h),o.appendChild(d);var p=this.createElement("span",{className:"e-file-size"});p.innerHTML=this.bytesToSize(r.size),o.appendChild(p);var m=this.createElement("span",{className:Pe});o.appendChild(m),m.innerHTML=r.status,l.appendChild(o);var v=this.createElement("span",{className:" e-icons",attrs:{tabindex:this.btnTabIndex}});"msie"===this.browserName&&v.classList.add("e-msie"),v.setAttribute("title",this.localizedTexts("remove")),l.appendChild(v),t.EventHandler.add(v,"click",this.removeFiles,this),"2"===r.statusCode?(m.classList.add(Ue),v.classList.add(Be),v.setAttribute("title",this.localizedTexts("delete"))):"1"!==r.statusCode&&(m.classList.remove(Ue),m.classList.add("e-validation-fails")),this.autoUpload&&"1"===r.statusCode&&""!==this.asyncSettings.saveUrl&&(m.innerHTML=""),v.classList.contains(Be)||v.classList.add(Le);var f=e.indexOf(r),g={element:l,fileInfo:r,index:f,isPreload:this.isPreLoadFile(r)},y={element:l,fileInfo:r,index:f,isPreload:this.isPreLoadFile(r)};this.trigger("rendering",g),this.trigger("fileListRendering",y),this.listParent.appendChild(l),this.fileList.push(l),this.truncateName(h);var b=this.flag;this.isPreLoadFile(r)&&(this.flag=!1,this.checkActionComplete(!0),this.flag=b)}else this.isFormUpload()?(this.uploadWrapper.classList.add("e-form-upload"),this.formCustomFileList(e,this.element.files)):this.createCustomfileList(e)},s.prototype.getSlicedName=function(e){var t=e.textContent;e.dataset.tail=t.slice(t.length-10)},s.prototype.setListToFileInfo=function(e,t){for(var i=0,s=e;i<s.length;i++)s[i].list=t},s.prototype.truncateName=function(e){var t=e;"edge"!==this.browserName&&t.offsetWidth<t.scrollWidth?this.getSlicedName(t):t.offsetWidth+1<t.scrollWidth&&this.getSlicedName(t)},s.prototype.getFileType=function(e){var t,i=e.lastIndexOf(".");return i>=0&&(t=e.substring(i+1)),t||""},s.prototype.getFileNameOnly=function(e){var t=this.getFileType(e);return t=e.split("."+t)[0]},s.prototype.setInitialAttributes=function(){if(this.initialAttr.accept&&this.element.setAttribute("accept",this.initialAttr.accept),this.initialAttr.disabled&&this.element.setAttribute("disabled","disabled"),this.initialAttr.multiple){var e=document.createAttribute("multiple");this.element.setAttributeNode(e)}},s.prototype.filterfileList=function(e){for(var t=[],i=0;i<e.length;i++)this.getLiElement(e[i]).classList.contains(Ue)||t.push(e[i]);return t},s.prototype.updateStatus=function(e,i,s,n){if(void 0===n&&(n=!0),""!==i&&!t.isNullOrUndefined(i)&&""!==s&&!t.isNullOrUndefined(s))if(this.isBlazorSaveUrl)for(var a=0;a<this.filesData.length;a++)this.filesData[a].name===e.name&&(this.filesData[a].status=i,this.filesData[a].statusCode=s);else e.status=i,e.statusCode=s;if(n){var r=this.getLiElement(e);t.isNullOrUndefined(r)||t.isNullOrUndefined(r.querySelector("."+Pe))||""===i||t.isNullOrUndefined(i)||(r.querySelector("."+Pe).textContent=i)}return e},s.prototype.getLiElement=function(e){for(var i,s=0;s<this.filesData.length;s++)(t.isNullOrUndefined(this.filesData[s].id)||t.isNullOrUndefined(e.id)?this.filesData[s].name===e.name:this.filesData[s].name===e.name&&this.filesData[s].id===e.id)&&(i=s);return this.fileList[i]},s.prototype.createProgressBar=function(e){var t=this.createElement("span",{className:Ne}),i=this.createElement("progressbar",{className:we,attrs:{value:"0",max:"100"}}),s=this.createElement("span",{className:"e-progress-inner-wrap"});i.setAttribute("style","width: 0%");var n=this.createElement("span",{className:"e-progress-bar-text"});n.textContent="0%",s.appendChild(i),t.appendChild(s),t.appendChild(n),e.querySelector(".e-file-container").appendChild(t)},s.prototype.updateProgressbar=function(e,i){if(!isNaN(Math.round(e.loaded/e.total*100))&&!t.isNullOrUndefined(i.querySelector("."+we)))if(t.isNullOrUndefined(this.progressInterval)||""===this.progressInterval)this.changeProgressValue(i,Math.round(e.loaded/e.total*100).toString()+"%");else{var s=Math.round(e.loaded/e.total*100)%parseInt(this.progressInterval,10);0!==s&&100!==s||this.changeProgressValue(i,Math.round(e.loaded/e.total*100).toString()+"%")}},s.prototype.changeProgressValue=function(e,t){e.querySelector("."+we).setAttribute("style","width:"+t),e.querySelector(".e-progress-bar-text").textContent=t},s.prototype.uploadInProgress=function(e,i,s,n){var a=this.getLiElement(i);if(!t.isNullOrUndefined(a)||s){if(t.isNullOrUndefined(a))this.cancelUploadingFile(i,e,n);else{"5"===i.statusCode&&this.cancelUploadingFile(i,e,n,a),a.querySelectorAll("."+Ne).length>0||!a.querySelector("."+Pe)||(a.querySelector("."+Pe).classList.add("e-upload-progress"),this.createProgressBar(a),this.updateProgressBarClasses(a,"e-upload-progress"),a.querySelector("."+Pe).classList.remove(Re)),this.updateProgressbar(e,a);var r=a.querySelector("."+Le);t.isNullOrUndefined(r)||(r.classList.add(Ae,"e-upload-progress"),r.setAttribute("title",this.localizedTexts("abort")),r.classList.remove(Le))}var l={e:e,operation:"upload",file:this.updateStatus(i,this.localizedTexts("inProgress"),"3")};this.trigger("progress",l)}},s.prototype.cancelUploadingFile=function(e,s,n,a){var r=this;if("5"===e.statusCode){var l={event:s,fileData:e,cancel:!1,customFormData:[]};this.trigger("canceling",l,function(s){if(s.cancel){if(e.statusCode="3",!t.isNullOrUndefined(a)){var l=a.querySelector("."+Ae);t.isNullOrUndefined(l)||(i.hideSpinner(l),t.detach(a.querySelector(".e-spinner-pane")))}}else{n.emitError=!1,n.httpRequest.abort();var o=new FormData;if("5"===e.statusCode){var h=r.element.getAttribute("name");o.append(h,e.name),o.append("cancel-uploading",e.name),r.updateFormData(o,s.customFormData);var d=new t.Ajax(r.asyncSettings.removeUrl,"POST",!0,null);d.emitError=!1,d.onLoad=function(t){return r.removecanceledFile(t,e),{}},d.send(o)}}})}},s.prototype.removecanceledFile=function(e,s){var n=this.getLiElement(s);if(!n.querySelector("."+He)&&!t.isNullOrUndefined(n.querySelector("."+Ae))){this.updateStatus(s,this.localizedTexts("fileUploadCancel"),"5"),this.renderFailureState(e,s,n);var a=n.querySelector("."+Le);t.isNullOrUndefined(n)||(i.hideSpinner(a),t.isNullOrUndefined(n.querySelector(".e-spinner-pane"))||t.detach(n.querySelector(".e-spinner-pane")));var r={event:e,response:e&&e.currentTarget?this.getResponse(e):null,operation:"cancel",file:s};this.trigger("success",r)}},s.prototype.renderFailureState=function(e,i,s){var n=this;this.updateProgressBarClasses(s,Re),this.removeProgressbar(s,"failure"),t.isNullOrUndefined(s.querySelector(".e-file-status"))||s.querySelector(".e-file-status").classList.add(Re);var a=s.querySelector("."+Ae);t.isNullOrUndefined(a)||(a.classList.remove(Ae,"e-upload-progress"),a.classList.add(Le),a.setAttribute("title",this.localizedTexts("remove")),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}}),a.parentElement.insertBefore(this.pauseButton,a),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),s.querySelector("."+He).addEventListener("click",function(e){n.reloadcanceledFile(e,i,s,!1)},!1))},s.prototype.reloadcanceledFile=function(e,i,s,n){i.statusCode="1",i.status=this.localizedTexts("readyToUploadMessage"),n||(t.isNullOrUndefined(s.querySelector("."+Pe))||s.querySelector("."+Pe).classList.remove(Re),t.isNullOrUndefined(s.querySelector("."+He))||t.detach(s.querySelector("."+He)),this.pauseButton=null),s.classList.add("e-restrict-retry"),this.upload([i])},s.prototype.uploadComplete=function(e,i,s){var n=e.target;if(4===n.readyState&&n.status>=200&&n.status<=299){var a=this.getLiElement(i);if(t.isNullOrUndefined(a)&&(!s||t.isNullOrUndefined(s)))return;if(!t.isNullOrUndefined(a)){this.updateProgressBarClasses(a,Ue),this.removeProgressbar(a,"success");var r=a.querySelector("."+Ae);t.isNullOrUndefined(r)||(r.classList.add(Be),r.setAttribute("title",this.localizedTexts("delete")),r.classList.remove(Ae),r.classList.remove("e-upload-progress"))}this.raiseSuccessEvent(e,i)}else this.uploadFailed(e,i)},s.prototype.getResponse=function(e){var t=e.currentTarget;return{readyState:t.readyState,statusCode:t.status,statusText:t.statusText,headers:t.getAllResponseHeaders(),withCredentials:t.withCredentials}},s.prototype.serverRemoveIconBindEvent=function(){if(this.uploadWrapper&&this.isBlazorSaveUrl)for(var e=[].slice.call(this.uploadWrapper.querySelectorAll("ul li")),i=0;i<e.length;i++){var s=e[i]?e[i].querySelector(".e-icons"):null;s&&(t.EventHandler.remove(s,"click",this.removeFiles),t.EventHandler.add(s,"click",this.removeFiles,this))}},s.prototype.raiseSuccessEvent=function(e,s){var n=this,a=e&&e.currentTarget?this.getResponse(e):null,r=this.localizedTexts("uploadSuccessMessage"),l={e:e,response:a,operation:"upload",file:this.updateStatus(s,r,"2",!1),statusText:r};if(!this.isBlazorSaveUrl){var o=this.getLiElement(s);if(!t.isNullOrUndefined(o)){var h=o.querySelector(".e-spinner-pane");t.isNullOrUndefined(h)||(i.hideSpinner(o),t.detach(h))}}this.trigger("success",l,function(e){n.updateStatus(s,e.statusText,"2"),n.uploadedFilesData.push(s),n.isBlazorSaveUrl||n.trigger("change",{file:n.uploadedFilesData}),n.checkActionButtonStatus(),n.fileList.length>0&&(n.getLiElement(s).classList.contains("e-restrict-retry")?n.getLiElement(s).classList.remove("e-restrict-retry"):(n.uploadSequential(),n.checkActionComplete(!0)))})},s.prototype.uploadFailed=function(e,i){var s=this,n=this.getLiElement(i),a=e&&e.currentTarget?this.getResponse(e):null,r=this.localizedTexts("uploadFailedMessage"),l={e:e,response:a,operation:"upload",file:this.updateStatus(i,r,"0",!1),statusText:r};t.isNullOrUndefined(n)||this.renderFailureState(e,i,n),this.trigger("failure",l,function(e){s.updateStatus(i,e.statusText,"0"),s.checkActionButtonStatus(),s.uploadSequential(),s.checkActionComplete(!0)})},s.prototype.uploadSequential=function(){this.sequentialUpload&&(this.autoUpload?this.checkAutoUpload(this.filesData):this.uploadButtonClick())},s.prototype.checkActionComplete=function(e){e?++this.actionCompleteCount:--this.actionCompleteCount,this.raiseActionComplete()},s.prototype.raiseActionComplete=function(){if(this.filesData.length===this.actionCompleteCount&&this.flag){this.flag=!1;var e={fileData:[]};e.fileData=this.getSelectedFileStatus(this.selectedFiles),this.trigger("actionComplete",e)}},s.prototype.getSelectedFileStatus=function(e){for(var t=[],i=0,s=0;s<e.length;s++)for(var n=e[s],a=0;a<this.filesData.length;a++)this.filesData[a].name===n.name&&(t[i]=this.filesData[a],++i);return t},s.prototype.updateProgressBarClasses=function(e,i){var s=e.querySelector("."+we);t.isNullOrUndefined(s)||s.classList.add(i)},s.prototype.removeProgressbar=function(e,i){var s=this;t.isNullOrUndefined(e.querySelector("."+Ne))||(this.progressAnimation=new t.Animation({duration:1250}),this.progressAnimation.animate(e.querySelector("."+Ne),{name:"FadeOut"}),this.progressAnimation.animate(e.querySelector(".e-progress-bar-text"),{name:"FadeOut"}),setTimeout(function(){s.animateProgressBar(e,i)},750))},s.prototype.animateProgressBar=function(e,i){"success"===i?(e.classList.add(Ue),t.isNullOrUndefined(e.querySelector("."+Pe))||(e.querySelector("."+Pe).classList.remove("e-upload-progress"),this.progressAnimation.animate(e.querySelector("."+Pe),{name:"FadeIn"}),e.querySelector("."+Pe).classList.add(Ue))):t.isNullOrUndefined(e.querySelector("."+Pe))||(e.querySelector("."+Pe).classList.remove("e-upload-progress"),this.progressAnimation.animate(e.querySelector("."+Pe),{name:"FadeIn"}),e.querySelector("."+Pe).classList.add(Re)),e.querySelector("."+Ne)&&t.detach(e.querySelector("."+Ne))},s.prototype.setExtensions=function(e){""===e||t.isNullOrUndefined(e)?this.element.removeAttribute("accept"):this.element.setAttribute("accept",e)},s.prototype.templateComplier=function(e){if(e)try{if(t.selectAll(e,document).length)return t.compile(t.select(e,document).innerHTML.trim())}catch(i){return t.compile(e)}},s.prototype.setRTL=function(){this.enableRtl?t.addClass([this.uploadWrapper],"e-rtl"):t.removeClass([this.uploadWrapper],"e-rtl")},s.prototype.localizedTexts=function(e){return this.l10n.setLocale(this.locale),this.l10n.getConstant(e)},s.prototype.setControlStatus=function(){this.enabled?(this.uploadWrapper.classList.contains("e-disabled")&&this.uploadWrapper.classList.remove("e-disabled"),!t.isNullOrUndefined(this.browseButton)&&this.element.hasAttribute("disabled")&&(this.element.removeAttribute("disabled"),this.browseButton.removeAttribute("disabled")),!t.isNullOrUndefined(this.clearButton)&&this.clearButton.hasAttribute("disabled")&&this.clearButton.removeAttribute("disabled"),!t.isNullOrUndefined(this.uploadButton)&&this.uploadButton.hasAttribute("disabled")&&this.uploadButton.hasAttribute("disabled")):(this.uploadWrapper.classList.add("e-disabled"),this.element.setAttribute("disabled","disabled"),this.browseButton.setAttribute("disabled","disabled"),t.isNullOrUndefined(this.clearButton)||this.clearButton.setAttribute("disabled","disabled"),t.isNullOrUndefined(this.uploadButton)||this.uploadButton.setAttribute("disabled","disabled"))},s.prototype.checkHTMLAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["accept","multiple","disabled"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"accept":(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.allowedExtensions||e)&&(this.setProperties({allowedExtensions:this.element.getAttribute("accept")},!e),this.initialAttr.accept=this.allowedExtensions);break;case"multiple":if(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.multiple||e){var a="multiple"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({multiple:a},!e),this.initialAttr.multiple=!0}break;case"disabled":if(t.isNullOrUndefined(this.uploaderOptions)||void 0===this.uploaderOptions.enabled||e){var r="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:r},!e),this.initialAttr.disabled=!0}}}},s.prototype.chunkUpload=function(e,t,i){var s=Math.min(this.asyncSettings.chunkSize,e.size),n={chunkIndex:0,blob:e.rawFile.slice(0,s),file:e,start:0,end:s,retryCount:0,request:null};this.sendRequest(e,n,t,i)},s.prototype.sendRequest=function(e,i,s,n){var a=this,r=new FormData,l=e.rawFile.slice(i.start,i.end);r.append("chunkFile",l,e.name),r.append(this.uploaderName,l,e.name),r.append("chunk-index",i.chunkIndex.toString()),r.append("chunkIndex",i.chunkIndex.toString());var o=Math.max(Math.ceil(e.size/this.asyncSettings.chunkSize),1);r.append("total-chunk",o.toString()),r.append("totalChunk",o.toString());var h=new t.Ajax({url:this.asyncSettings.saveUrl,type:"POST",async:!0,contentType:null});h.emitError=!1,h.onLoad=function(e){return a.chunkUploadComplete(e,i,s),{}},h.onUploadProgress=function(e){return a.chunkUploadInProgress(e,i,s),{}};var d={fileData:e,customFormData:[],cancel:!1,chunkSize:0===this.asyncSettings.chunkSize?null:this.asyncSettings.chunkSize};h.beforeSend=function(s){d.currentRequest=h.httpRequest,d.currentChunkIndex=i.chunkIndex,t.isBlazor()&&(a.currentRequestHeader&&a.updateCustomheader(h.httpRequest,a.currentRequestHeader),a.customFormDatas&&a.updateFormData(r,a.customFormDatas)),0===d.currentChunkIndex?a.trigger("uploading",d,function(t){a.uploadingEventCallback(r,t,s,e)}):a.trigger("chunkUploading",d,function(t){a.uploadingEventCallback(r,t,s,e)})},h.onError=function(e){return a.chunkUploadFailed(e,i,s),{}},h.send(r),i.request=h},s.prototype.uploadingEventCallback=function(e,t,i,s){t.cancel?this.eventCancelByArgs(i,t,s):this.updateFormData(e,t.customFormData)},s.prototype.eventCancelByArgs=function(e,i,s){var n=this;if(e.cancel=!0,"5"!==i.fileData.statusCode){i.fileData.statusCode="5",i.fileData.status=this.localizedTexts("fileUploadCancel");var a=this.getLiElement(i.fileData);if(a){t.isNullOrUndefined(a.querySelector("."+Pe))||(a.querySelector("."+Pe).innerHTML=this.localizedTexts("fileUploadCancel"),a.querySelector("."+Pe).classList.add(Re)),this.pauseButton=this.createElement("span",{className:"e-icons e-file-reload-btn",attrs:{tabindex:this.btnTabIndex}});var r=a.querySelector("."+Le);r&&r.parentElement.insertBefore(this.pauseButton,r),this.pauseButton.setAttribute("title",this.localizedTexts("retry")),this.pauseButton.addEventListener("click",function(e){n.reloadcanceledFile(e,s,a)},!1),this.checkActionButtonStatus()}}},s.prototype.checkChunkUpload=function(){return!(this.asyncSettings.chunkSize<=0||t.isNullOrUndefined(this.asyncSettings.chunkSize))},s.prototype.chunkUploadComplete=function(e,s,n){var a,r=this,l=e.target;if(4===l.readyState&&l.status>=200&&l.status<300){var o=e&&e.currentTarget?this.getResponse(e):null,h=Math.max(Math.ceil(s.file.size/this.asyncSettings.chunkSize),1),d={event:e,file:s.file,chunkIndex:s.chunkIndex,totalChunk:h,chunkSize:this.asyncSettings.chunkSize,response:o};if(this.trigger("chunkSuccess",d),!t.isNullOrUndefined(n)&&n||(a=this.getLiElement(s.file)),this.updateMetaData(s),s.end===s.file.size&&(s.file.statusCode="3"),"5"===s.file.statusCode){var u={event:e,fileData:s.file,cancel:!1,customFormData:[]};this.trigger("canceling",u,function(e){if(e.cancel){s.file.statusCode="3";var o=a.querySelector("."+Ae);t.isNullOrUndefined(a)||t.isNullOrUndefined(o)||(i.hideSpinner(o),t.detach(a.querySelector(".e-spinner-pane"))),r.sendNextRequest(s)}else{s.request.emitError=!1,l.abort();var h=new FormData,d=r.element.getAttribute("name");h.append(d,s.file.name),h.append("cancel-uploading",s.file.name),h.append("cancelUploading",s.file.name),r.updateFormData(h,e.customFormData);var u=new t.Ajax(r.asyncSettings.removeUrl,"POST",!0,null);u.emitError=!1,u.onLoad=function(e){return r.removeChunkFile(e,s,n),{}},u.send(h)}})}else{if(h-1===s.chunkIndex&&h>s.chunkIndex){var c=this.pausedData.indexOf(s);return c>=0&&this.pausedData.splice(c,1),t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(n)||!n)&&a&&(a&&!t.isNullOrUndefined(a.querySelector("."+Fe))&&t.detach(a.querySelector("."+Fe)),this.removeChunkProgressBar(s)),void this.raiseSuccessEvent(e,s.file)}"4"!==s.file.statusCode&&this.sendNextRequest(s)}}else this.chunkUploadFailed(e,s)},s.prototype.sendNextRequest=function(e){e.start=e.end,e.end+=this.asyncSettings.chunkSize,e.end=Math.min(e.end,e.file.size),e.chunkIndex+=1,this.sendRequest(e.file,e)},s.prototype.removeChunkFile=function(e,s,n){if(t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(n)&&!n){var a=this.getLiElement(s.file),r=a.querySelector("."+Ae),l=r;this.updateStatus(s.file,this.localizedTexts("fileUploadCancel"),"5"),this.updateProgressBarClasses(a,Re),this.removeProgressbar(a,"failure"),r&&r.classList.remove(Ae),r&&r.classList.add(Le),r&&r.setAttribute("title",this.localizedTexts("remove"));var o=a.querySelector("."+Fe);o&&o.classList.add(He),o&&o.classList.remove(Fe),o&&o.setAttribute("title",this.localizedTexts("retry")),t.isNullOrUndefined(a)||t.isNullOrUndefined(r)||t.isNullOrUndefined(a.querySelector(".e-spinner-pane"))||(i.hideSpinner(l),t.detach(a.querySelector(".e-spinner-pane")))}},s.prototype.pauseUpload=function(e,t,i){e.file.statusCode="4",e.file.status=this.localizedTexts("pause"),this.updateMetaData(e);var s={event:t||null,file:e.file,chunkIndex:e.chunkIndex,chunkCount:Math.round(e.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.abortUpload(e,i,s)},s.prototype.abortUpload=function(e,i,s){"4"!==e.file.statusCode&&(e.request.emitError=!1,e.request.httpRequest.abort());var n=this.getLiElement(e.file);if(t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(i)||!i)){var a=n.querySelector("."+Fe);a.classList.remove(Fe),a.classList.add("e-file-play-btn"),a.setAttribute("title",this.localizedTexts("resume")),a.nextElementSibling.classList.add(Le),a.nextElementSibling.classList.remove(Ae),a.nextElementSibling.setAttribute("title",this.localizedTexts("remove"))}for(var r=0;r<this.pausedData.length;r++)this.pausedData[r].file.name===e.file.name&&this.pausedData.splice(r,1);this.pausedData.push(e),this.trigger("pausing",s)},s.prototype.resumeUpload=function(e,i,s){var n,a=this.getLiElement(e.file);t.isNullOrUndefined(a)||(n=a.querySelector(".e-file-play-btn")),t.isNullOrUndefined(n)||!t.isNullOrUndefined(s)&&s||(n.classList.remove("e-file-play-btn"),n.classList.add(Fe),n.setAttribute("title",this.localizedTexts("pause")),n.nextElementSibling.classList.remove(Le),n.nextElementSibling.classList.add(Ae),n.nextElementSibling.setAttribute("title",this.localizedTexts("abort"))),e.file.status=this.localizedTexts("inProgress"),e.file.statusCode="3",this.updateMetaData(e);var r={event:i||null,file:e.file,chunkIndex:e.chunkIndex,chunkCount:Math.round(e.file.size/this.asyncSettings.chunkSize),chunkSize:this.asyncSettings.chunkSize};this.trigger("resuming",r);for(var l=0;l<this.pausedData.length;l++)this.pausedData[l].end===this.pausedData[l].file.size?this.chunkUploadComplete(i,e,s):this.pausedData[l].file.name===e.file.name&&(this.pausedData[l].start=this.pausedData[l].end,this.pausedData[l].end=this.pausedData[l].end+this.asyncSettings.chunkSize,this.pausedData[l].end=Math.min(this.pausedData[l].end,this.pausedData[l].file.size),this.pausedData[l].chunkIndex=this.pausedData[l].chunkIndex+1,this.sendRequest(this.pausedData[l].file,this.pausedData[l],s))},s.prototype.updateMetaData=function(e){-1===this.uploadMetaData.indexOf(e)?this.uploadMetaData.push(e):(this.uploadMetaData.splice(this.uploadMetaData.indexOf(e),1),this.uploadMetaData.push(e))},s.prototype.removeChunkProgressBar=function(e){var i=this.getLiElement(e.file);if(!t.isNullOrUndefined(i)){this.updateProgressBarClasses(i,Ue),this.removeProgressbar(i,"success");var s=i.querySelector("."+Ae);t.isNullOrUndefined(s)||(s.classList.add(Be),s.setAttribute("title",this.localizedTexts("delete")),s.classList.remove(Ae,"e-upload-progress"))}},s.prototype.chunkUploadFailed=function(e,i,s){var n,a=this,r=Math.max(Math.ceil(i.file.size/this.asyncSettings.chunkSize),1);!t.isNullOrUndefined(this.template)||!t.isNullOrUndefined(s)&&s||(n=this.getLiElement(i.file));var l=e&&e.currentTarget?this.getResponse(e):null,o={event:e,file:i.file,chunkIndex:i.chunkIndex,totalChunk:r,chunkSize:this.asyncSettings.chunkSize,cancel:!1,response:l};this.trigger("chunkFailure",o,function(r){if(!r.cancel)if(i.retryCount<a.asyncSettings.retryCount)setTimeout(function(){a.retryRequest(n,i,s)},a.asyncSettings.retryAfterDelay);else{if(!t.isNullOrUndefined(n)){var o=n.querySelector("."+Fe)?n.querySelector("."+Fe):n.querySelector(".e-file-play-btn");t.isNullOrUndefined(o)||(o.classList.add(He),o.classList.remove(Fe,"e-file-play-btn")),a.updateProgressBarClasses(n,Re),a.removeProgressbar(n,"failure"),n.querySelector(".e-icons").classList.remove("e-upload-progress");var h=n.querySelector("."+Ae)?n.querySelector("."+Ae):n.querySelector("."+Le);h.classList.remove(Ae),t.isNullOrUndefined(n.querySelector("."+Fe))||t.detach(n.querySelector("."+Fe)),i.start>0?(h.classList.add(Be),h.setAttribute("title",a.localizedTexts("delete"))):(h.classList.add(Le),h.setAttribute("title",a.localizedTexts("remove")))}i.retryCount=0;var d=i.file,u=a.localizedTexts("uploadFailedMessage"),c={e:e,response:l,operation:"upload",file:a.updateStatus(d,u,"0",!1),statusText:u};a.trigger("failure",c,function(e){a.updateStatus(d,e.statusText,"0"),a.uploadSequential(),a.checkActionComplete(!0)})}})},s.prototype.retryRequest=function(e,i,s){t.isNullOrUndefined(this.template)&&(t.isNullOrUndefined(s)||!s)&&e&&this.updateProgressBarClasses(e,Re),i.retryCount+=1,this.sendRequest(i.file,i)},s.prototype.checkPausePlayAction=function(e){var t=e.target,i=e.target.parentElement,s=this.fileList.indexOf(i),n=this.filesData[s],a=this.getCurrentMetaData(n);t.classList.contains(Fe)?this.pauseUpload(a,e):t.classList.contains("e-file-play-btn")?this.resumeUpload(a,e):t.classList.contains(He)&&(a.file.status===this.localizedTexts("fileUploadCancel")?this.retryUpload(a,!1):this.retryUpload(a,!0))},s.prototype.retryUpload=function(e,t){t?(e.end=e.end+this.asyncSettings.chunkSize,e.start=e.start+this.asyncSettings.chunkSize,this.sendRequest(e.file,e)):(e.file.statusCode="1",e.file.status=this.localizedTexts("readyToUploadMessage"),this.chunkUpload(e.file)),this.getLiElement(e.file).classList.add("e-restrict-retry")},s.prototype.chunkUploadInProgress=function(e,i,s){var n=this;if("4"!==i.file.statusCode){"4"!==i.file.statusCode&&"5"!==i.file.statusCode&&(i.file.statusCode="3",i.file.status=this.localizedTexts("inProgress")),this.updateMetaData(i);var a=this.getLiElement(i.file);if(!t.isNullOrUndefined(a)){var r=a.querySelector("."+He);if(t.isNullOrUndefined(r)||(r.classList.add(Fe),r.setAttribute("title",this.localizedTexts("pause")),r.classList.remove(He)),!t.isNullOrUndefined(a)){if(!(a.querySelectorAll("."+Ne).length>0)){var l=a.querySelector("."+Pe);t.isNullOrUndefined(this.template)&&(l.classList.add("e-upload-progress"),l.classList.remove(Re),this.createProgressBar(a),this.updateProgressBarClasses(a,"e-upload-progress"));var o=a.querySelector("."+Le)?a.querySelector("."+Le):a.querySelector("."+Be);t.isNullOrUndefined(o)||(o.classList.add(Ae),o.setAttribute("title",this.localizedTexts("abort")),o.classList.remove(Le))}if(!isNaN(Math.round(e.loaded/e.total*100))&&t.isNullOrUndefined(this.template)&&"4"!==i.file.statusCode){var h=void 0,d=Math.ceil(i.file.size/this.asyncSettings.chunkSize)-1;this.asyncSettings.chunkSize&&d&&(h=Math.round(i.chunkIndex/d*100),this.changeProgressValue(a,h.toString()+"%"))}0===i.chunkIndex&&this.checkActionButtonStatus()}if(t.isNullOrUndefined(a.querySelector("."+Fe))&&t.isNullOrUndefined(this.template)&&t.isNullOrUndefined(a.querySelector("."+Be))){this.pauseButton=this.createElement("span",{className:"e-icons e-file-pause-btn",attrs:{tabindex:this.btnTabIndex}}),"msie"===this.browserName&&this.pauseButton.classList.add("e-msie");var u=a.querySelector("."+Ae);u.parentElement.insertBefore(this.pauseButton,u),this.pauseButton.setAttribute("title",this.localizedTexts("pause")),this.pauseButton.addEventListener("click",function(e){n.checkPausePlayAction(e)},!1)}}}},s.prototype.bytesToSize=function(e){var t=-1;if(!e)return"0.0 KB";do{e/=1024,t++}while(e>99);return t>=2&&(e*=1024,t=1),Math.max(e,0).toFixed(1)+" "+["KB","MB"][t]},s.prototype.sortFileList=function(e){for(var t=e=e||this.sortFilesList,i=[],s=0;s<t.length;s++)i.push(t[s].name);for(var n=[],a=0,r=i.sort();a<r.length;a++)for(var l=r[a],s=0;s<t.length;s++)l===t[s].name&&n.push(t[s]);return n},s.prototype.destroy=function(){this.element.value=null,this.clearTemplate(),this.isBlazorSaveUrl||this.isBlazorTemplate||this.clearAll(),this.unWireEvents(),this.unBindDropEvents(),this.multiple&&this.element.removeAttribute("multiple"),this.enabled||this.element.removeAttribute("disabled"),this.element.removeAttribute("accept"),this.setInitialAttributes();for(var i=0,s=["aria-label","directory","webkitdirectory","tabindex"];i<s.length;i++){var n=s[i];this.element.removeAttribute(n)}this.isServerBlazor?this.uploadWrapper=null:(t.isNullOrUndefined(this.uploadWrapper)||(this.uploadWrapper.parentElement.appendChild(this.element),t.detach(this.uploadWrapper)),this.uploadWrapper=null,e.prototype.destroy.call(this))},s.prototype.upload=function(e,i){var s=this;if(e=e||this.filesData,this.sequentialUpload&&(this.isFirstFileOnSelection||i))this.sequenceUpload(e);else{var n=this.getFilesInArray(e),a={customFormData:[],currentRequest:null,cancel:!1};this.trigger("beforeUpload",a,function(e){e.cancel||(t.isBlazor()&&(s.currentRequestHeader=e.currentRequest?e.currentRequest:s.currentRequestHeader,s.customFormDatas=e.customFormData&&e.customFormData.length>0?e.customFormData:s.customFormDatas),s.uploadFiles(n,i))})}},s.prototype.getFilesInArray=function(e){var t=[];return e instanceof Array?t=e:t.push(e),t},s.prototype.serverReadFileBase64=function(e,t,i){var s=this;return new Promise(function(n,a){var r=s.fileStreams[e].rawFile;try{var l=new FileReader;l.onload=function(e){return function(){try{var t=e.result,i=t?t.split(";base64,")[1]:null;n(i)}catch(e){a(e)}}}(l),l.readAsDataURL(r.slice(t,t+i))}catch(e){a(e)}})},s.prototype.uploadFileCount=function(e){var t=this.filesData;return t&&0!==t.length?t.length:-1},s.prototype.getFileRead=function(e,t){var i=this.filesData;if(!i||0===i.length)return-1;var s=i[e],n=this.newFileRef++;return this.fileStreams[n]=s,n},s.prototype.getFileInfo=function(e,t){var i=this.filesData;return i&&0!==i.length&&i[e]?this.filesData[e]:null},s.prototype.uploadFiles=function(e,i){var s=this,n=[];if(""===this.asyncSettings.saveUrl||t.isNullOrUndefined(this.asyncSettings.saveUrl))return void(this.isServerBlazor&&this.interopAdaptor.invokeMethodAsync("GetFileDetails",e));if(!i||t.isNullOrUndefined(i))if(this.multiple)n=this.filterfileList(e);else{var a=[];a.push(e[0]),n=this.filterfileList(a)}else n=e;for(var r=this,l=0;l<n.length;l++)!function(e){r.isServerBlazor&&!r.checkChunkUpload()?n[e]&&n[e].rawFile instanceof File&&r.getBase64(n[e].rawFile).then(function(t){s.base64String.push(t),s.uploadFilesRequest(n,e,i)}):r.uploadFilesRequest(n,e,i)}(l)},s.prototype.uploadFilesRequest=function(e,i,s){var n=this,a=[],r=this.checkChunkUpload(),l=new t.Ajax(this.asyncSettings.saveUrl,"POST",!0,null);l.emitError=!1;var o;this.isServerBlazor&&(o=e.slice(0),a.push(o[i].rawFile));var h={fileData:this.isServerBlazor?o[i]:e[i],customFormData:[],cancel:!1},d=new FormData;if(l.beforeSend=function(s){h.currentRequest=l.httpRequest,t.isBlazor()&&(h.fileData.rawFile=r?h.fileData.rawFile:n.base64String[i],n.currentRequestHeader&&n.updateCustomheader(l.httpRequest,n.currentRequestHeader),n.customFormDatas&&n.updateFormData(d,n.customFormDatas)),n.trigger("uploading",h,function(t){n.isServerBlazor&&!r&&(e[i].rawFile=t.fileData.rawFile=a[i]),t.cancel&&n.eventCancelByArgs(s,t,e[i]),n.updateFormData(d,t.customFormData)})},"1"===e[i].statusCode){var u=this.element.getAttribute("name");d.append(u,e[i].rawFile,e[i].name),r&&e[i].size>this.asyncSettings.chunkSize?this.chunkUpload(e[i],s,i):(l.onLoad=function(t){return h.cancel&&n.isServerBlazor?{}:(n.uploadComplete(t,e[i],s),{})},l.onUploadProgress=function(t){return h.cancel&&n.isServerBlazor?{}:(n.uploadInProgress(t,e[i],s,l),{})},l.onError=function(t){return n.uploadFailed(t,e[i]),{}},l.send(d))}},s.prototype.spliceFiles=function(e){for(var t=this.fileList[e],i=this.getFilesData(),s=+t.getAttribute("data-files-count"),n=0,a=0;a<e;a++)n+=+this.fileList[a].getAttribute("data-files-count");for(var r=n+s-1;r>=n;r--)i.splice(r,1)},s.prototype.remove=function(e,i,s,n,a){var r=this;t.isNullOrUndefined(n)&&(n=!0);var l={event:a,cancel:!1,filesData:[],customFormData:[],postRawFile:n,currentRequest:null},o={cancel:!1,customFormData:[],currentRequest:null};this.trigger("beforeRemove",o,function(n){if(!n.cancel)if(t.isBlazor()&&(r.currentRequestHeader=n.currentRequest,r.customFormDatas=n.customFormData),r.isFormUpload()&&!r.isBlazorSaveUrl)l.filesData=e,r.trigger("removing",l,function(i){if(!i.cancel)for(var s=!1,n=void 0,a=0,l=r.getFilesInArray(e);a<l.length;a++){var o=l[a];if(s||(n=r.fileList.indexOf(o.list)),n>-1){var h=t.isNullOrUndefined(o.input)?null:o.input;h&&t.detach(h),r.spliceFiles(n),t.detach(r.fileList[n]),r.fileList.splice(n,1),s=!0,n=-1}}});else if(!r.isForm||!t.isNullOrUndefined(r.asyncSettings.removeUrl)&&""!==r.asyncSettings.removeUrl||r.isBlazorSaveUrl){var o=[];(e=t.isNullOrUndefined(e)?r.filesData:e)instanceof Array?o=e:o.push(e),l.filesData=o;for(var h=r.asyncSettings.removeUrl,d=""!==h&&!t.isNullOrUndefined(h),u=0,c=o;u<c.length;u++)!function(e){var t=r.uploadedFilesData.indexOf(e);("2"===e.statusCode||"4"===e.statusCode||"0"===e.statusCode&&-1!==t)&&d?r.removeUploadedFile(e,l,s,i):s?r.removeFilesData(e,i):r.trigger("removing",l,function(t){t.cancel||r.removeFilesData(e,i)}),a&&!a.target.classList.contains(Le)&&r.checkActionComplete(!1)}(c[u])}else l.filesData=r.getFilesData(),r.trigger("removing",l,function(e){e.cancel||r.clearAll()})})},s.prototype.clearAll=function(){var e=this;if(t.isNullOrUndefined(this.listParent)&&!this.isBlazorSaveUrl&&!this.isBlazorTemplate)return"msie"!==this.browserName&&(this.element.value=""),void(this.filesData=[]);var i={cancel:!1,filesData:this.filesData};this.trigger("clearing",i,function(t){t.cancel||(e.clearData(),e.actionCompleteCount=0,e.count=-1)})},s.prototype.getFilesData=function(e){if(this.isServerBlazor){for(var i=0;i<this.filesData.length;i++)this.filesData[i].rawFile=this.base64String[i];return this.filesData}return t.isNullOrUndefined(e)?this.filesData:this.getSelectedFiles(e)},s.prototype.pause=function(e,t){e=e||this.filesData;var i=this.getFilesInArray(e);this.pauseUploading(i,t)},s.prototype.pauseUploading=function(e,t){for(var i=this.getFiles(e),s=0;s<i.length;s++)"3"===i[s].statusCode&&this.pauseUpload(this.getCurrentMetaData(i[s],null),null,t)},s.prototype.getFiles=function(e){var i=[];return t.isNullOrUndefined(e)||e instanceof Array?i=e:i.push(e),i},s.prototype.resume=function(e,t){e=e||this.filesData;var i=this.getFilesInArray(e);this.resumeFiles(i,t)},s.prototype.resumeFiles=function(e,t){for(var i=this.getFiles(e),s=0;s<i.length;s++)"4"===i[s].statusCode&&this.resumeUpload(this.getCurrentMetaData(i[s],null),null,t)},s.prototype.retry=function(e,t,i){e=e||this.filesData;var s=this.getFilesInArray(e);this.retryFailedFiles(s,t,i)},s.prototype.retryFailedFiles=function(e,t,i){for(var s=this.getFiles(e),n=0;n<s.length;n++)if("5"===s[n].statusCode||"0"===s[n].statusCode)if(this.asyncSettings.chunkSize>0)this.retryUpload(this.getCurrentMetaData(s[n],null),t);else{var a=void 0;i||(a=this.fileList[this.filesData.indexOf(s[n])]),this.reloadcanceledFile(null,s[n],a,i)}},s.prototype.cancel=function(e){e=e||this.filesData;var t=this.getFilesInArray(e);this.cancelUpload(t)},s.prototype.cancelUpload=function(e){var t=this.getFiles(e);if(this.asyncSettings.chunkSize>0){for(s=0;s<t.length;s++)if("3"===t[s].statusCode){var i=this.getCurrentMetaData(t[s],null);i.file.statusCode="5",i.file.status=this.localizedTexts("fileUploadCancel"),this.updateMetaData(i),this.showHideUploadSpinner(t[s])}}else for(var s=0;s<t.length;s++)"3"===t[s].statusCode&&(t[s].statusCode="5",t[s].status=this.localizedTexts("fileUploadCancel"),this.showHideUploadSpinner(t[s]))},s.prototype.showHideUploadSpinner=function(e){var s=this.getLiElement(e);if(!t.isNullOrUndefined(s)&&t.isNullOrUndefined(this.template)){var n=s.querySelector("."+Ae);i.createSpinner({target:n,width:"20px"}),i.showSpinner(n)}},xe([t.Complex({saveUrl:"",removeUrl:""},Ie)],s.prototype,"asyncSettings",void 0),xe([t.Property(!1)],s.prototype,"sequentialUpload",void 0),xe([t.Property({})],s.prototype,"htmlAttributes",void 0),xe([t.Property("")],s.prototype,"cssClass",void 0),xe([t.Property(!0)],s.prototype,"enabled",void 0),xe([t.Property(null)],s.prototype,"template",void 0),xe([t.Property(!0)],s.prototype,"multiple",void 0),xe([t.Property(!0)],s.prototype,"autoUpload",void 0),xe([t.Complex({},De)],s.prototype,"buttons",void 0),xe([t.Property("")],s.prototype,"allowedExtensions",void 0),xe([t.Property(0)],s.prototype,"minFileSize",void 0),xe([t.Property(3e7)],s.prototype,"maxFileSize",void 0),xe([t.Property(null)],s.prototype,"dropArea",void 0),xe([t.Collection([{}],Me)],s.prototype,"files",void 0),xe([t.Property(!0)],s.prototype,"showFileList",void 0),xe([t.Property(!1)],s.prototype,"directoryUpload",void 0),xe([t.Property("Default")],s.prototype,"dropEffect",void 0),xe([t.Event()],s.prototype,"created",void 0),xe([t.Event()],s.prototype,"actionComplete",void 0),xe([t.Event()],s.prototype,"rendering",void 0),xe([t.Event()],s.prototype,"beforeUpload",void 0),xe([t.Event()],s.prototype,"fileListRendering",void 0),xe([t.Event()],s.prototype,"selected",void 0),xe([t.Event()],s.prototype,"uploading",void 0),xe([t.Event()],s.prototype,"success",void 0),xe([t.Event()],s.prototype,"failure",void 0),xe([t.Event()],s.prototype,"removing",void 0),xe([t.Event()],s.prototype,"beforeRemove",void 0),xe([t.Event()],s.prototype,"clearing",void 0),xe([t.Event()],s.prototype,"progress",void 0),xe([t.Event()],s.prototype,"change",void 0),xe([t.Event()],s.prototype,"chunkSuccess",void 0),xe([t.Event()],s.prototype,"chunkFailure",void 0),xe([t.Event()],s.prototype,"chunkUploading",void 0),xe([t.Event()],s.prototype,"canceling",void 0),xe([t.Event()],s.prototype,"pausing",void 0),xe([t.Event()],s.prototype,"resuming",void 0),s=xe([t.NotifyPropertyChanges],s)}(t.Component),qe=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),We=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},je="e-switch-ctrl-btn",_e="e-hide-hex-value",Xe="e-hide-switchable-value",Ke="e-hide-value",Ze="e-hsv-color",Ye="e-selected-value",Ge="e-mode-switch-btn",$e="e-nocolor-item",Je="e-opacity-value",Qe="e-preview-container",et="e-show-value",tt="e-selected",it="e-tile",st={default:["#000000","#f44336","#e91e63","#9c27b0","#673ab7","#2196f3","#03a9f4","#00bcd4","#009688","#ffeb3b","#ffffff","#ffebee","#fce4ec","#f3e5f5","#ede7f6","#e3f2fd","#e1f5fe","#e0f7fa","#e0f2f1","#fffde7","#f2f2f2","#ffcdd2","#f8bbd0","#e1bee7","#d1c4e9","#bbdefb","#b3e5fc","#b2ebf2","#b2dfdb","#fff9c4","#e6e6e6","#ef9a9a","#f48fb1","#ce93d8","#b39ddb","#90caf9","#81d4fa","#80deea","#80cbc4","#fff59d","#cccccc","#e57373","#f06292","#ba68c8","#9575cd","#64b5f6","#4fc3f7","#4dd0e1","#4db6ac","#fff176","#b3b3b3","#ef5350","#ec407a","#ab47bc","#7e57c2","#42a5f5","#29b6f6","#26c6da","#26a69a","#ffee58","#999999","#e53935","#d81b60","#8e24aa","#5e35b1","#1e88e5","#039be5","#00acc1","#00897b","#fdd835","#808080","#d32f2f","#c2185b","#7b1fa2","#512da8","#1976d2","#0288d1","#0097a7","#00796b","#fbc02d","#666666","#c62828","#ad1457","#6a1b9a","#4527a0","#1565c0","#0277bd","#00838f","#00695c","#f9a825","#4d4d4d","#b71c1c","#880e4f","#4a148c","#311b92","#0d47a1","#01579b","#006064","#004d40","#f57f17"]},nt=function(n){function a(e,t){return n.call(this,e,t)||this}return qe(a,n),a.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this);var i={Apply:"Apply",Cancel:"Cancel",ModeSwitcher:"Switch Mode"};this.l10n=new t.L10n("colorpicker",i,this.locale),e.getAttribute("ejs-for")&&!e.getAttribute("name")&&e.setAttribute("name",e.id)},a.prototype.render=function(){this.initWrapper(),this.inline?this.createWidget():this.createSplitBtn(),this.enableOpacity||t.addClass([this.container.parentElement],"e-hide-opacity"),this.renderComplete()},a.prototype.initWrapper=function(){var e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"});this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element),t.attributes(this.element,{tabindex:"-1",spellcheck:"false"}),this.container=this.createElement("div",{className:"e-container"}),this.getWrapper().appendChild(this.container);var i=this.value?this.roundValue(this.value).toLowerCase():"#008000ff";this.noColor&&"Palette"===this.mode&&""===this.value&&(i="");var s=i.slice(0,7);t.isNullOrUndefined(this.initialInputValue)&&(this.initialInputValue=s),this.element.value=s,this.enableOpacity?this.setProperties({value:i},!0):this.setProperties({value:s},!0),this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.tileRipple=t.rippleEffect(this.container,{selector:"."+it}),this.ctrlBtnRipple=t.rippleEffect(this.container,{selector:".e-btn"})},a.prototype.getWrapper=function(){return this.element.parentElement},a.prototype.createWidget=function(){"Palette"===this.mode?(this.createPalette(),this.inline||this.firstPaletteFocus()):(this.createPicker(),this.inline||this.getDragHandler().focus()),this.isRgb=!0,this.createInput(),this.createCtrlBtn(),this.disabled||this.wireEvents(),this.inline&&this.disabled&&this.toggleDisabled(!0),t.Browser.isDevice&&this.refreshPopupPos()},a.prototype.createSplitBtn=function(){var e=this,n=this.createElement("button",{className:"e-split-colorpicker"});this.getWrapper().appendChild(n),this.splitBtn=new s.SplitButton({iconCss:"e-selected-color",target:this.container,disabled:this.disabled,enableRtl:this.enableRtl,open:this.onOpen.bind(this),click:function(){e.trigger("change",{currentValue:{hex:e.value.slice(0,7),rgba:e.convertToRgbString(e.hexToRgb(e.value))},previousValue:{hex:null,rgba:null},value:e.value})}}),this.splitBtn.createElement=this.createElement,this.splitBtn.appendTo(n);var a=this.createElement("span",{className:"e-split-preview"});t.select(".e-selected-color",n).appendChild(a),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value));var r=this.getPopupEle();if(t.addClass([r],"e-colorpicker-popup"),this.cssClass&&t.addClass([r],this.cssClass.split(" ")),t.Browser.isDevice){var l=this.getPopupInst();l.relateTo=document.body,l.position={X:"center",Y:"center"},l.targetType="container",l.collision={X:"fit",Y:"fit"},l.offsetY=4,r.style.zIndex=i.getZindexPartial(this.splitBtn.element).toString()}this.bindCallBackEvent()},a.prototype.onOpen=function(){this.trigger("open",{element:this.container})},a.prototype.getPopupInst=function(){return t.getInstance(this.getPopupEle(),i.Popup)},a.prototype.bindCallBackEvent=function(){var e=this;this.splitBtn.beforeOpen=function(i){var n=new s.Deferred;return e.trigger("beforeOpen",i,function(s){if(!s.cancel){var a=e.getPopupEle();a.style.top=t.formatUnit(0+pageYOffset),a.style.left=t.formatUnit(0+pageXOffset),a.style.display="block",e.createWidget(),a.style.display="",t.Browser.isDevice&&(e.modal=e.createElement("div"),e.modal.className="e-"+e.getModuleName()+" e-modal",e.modal.style.display="none",document.body.insertBefore(e.modal,a),document.body.className+=" e-colorpicker-overflow",e.modal.style.display="block",e.modal.style.zIndex=(Number(a.style.zIndex)-1).toString())}i.cancel=s.cancel,n.resolve(s)}),n},this.splitBtn.beforeClose=function(i){var n=new s.Deferred;if(t.isNullOrUndefined(i.event))n.resolve(i);else{var a={element:e.container,event:i.event,cancel:!1};e.trigger("beforeClose",a,function(s){t.Browser.isDevice&&i.event.target===e.modal&&(s.cancel=!0),s.cancel||e.onPopupClose(),i.cancel=s.cancel,n.resolve(s)})}return n}},a.prototype.onPopupClose=function(){this.unWireEvents(),this.destroyOtherComp(),this.container.style.width="",t.select(".e-split-preview",this.splitBtn.element).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value)),this.container.innerHTML="",t.removeClass([this.container],["e-color-picker","e-color-palette"]),t.Browser.isDevice&&this.modal&&(t.removeClass([document.body],"e-colorpicker-overflow"),this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},a.prototype.createPalette=function(){if(t.classList(this.container,["e-color-palette"],["e-color-picker"]),this.presetColors){var e=this.createElement("div",{className:"e-custom-palette"});this.appendElement(e);var i=Object.keys(this.presetColors);if(1===i.length)this.appendPalette(this.presetColors[i[0]],i[0],e);else for(var s=0,n=i.length;s<n;s++)this.appendPalette(this.presetColors[i[s]],i[s],e);t.selectAll(".e-row",e).length>10&&t.addClass([e],"e-palette-group")}else this.appendPalette(st.default,"default");"Palette"===this.mode&&!this.modeSwitcher&&this.noColor&&this.setNoColor();var a=parseInt(getComputedStyle(this.container).borderBottomWidth,10);this.container.style.width=t.formatUnit(this.container.children[0].offsetWidth+a+a),this.rgb=this.hexToRgb(this.roundValue(this.value)),this.hsv=this.rgbToHsv.apply(this,this.rgb)},a.prototype.firstPaletteFocus=function(){t.select("."+tt,this.container.children[0])||t.selectAll(".e-palette",this.container)[0].focus()},a.prototype.appendPalette=function(e,t,i){var s=this.createElement("div",{className:"e-palette",attrs:{tabindex:"0"}});i?i.appendChild(s):this.appendElement(s);for(var n,a,r,l=0,o=e.length;l<o;l++)0!==l&&l%this.columns!=0||(n=this.createElement("div",{className:"e-row",attrs:{role:"presentation"}}),s.appendChild(n)),r=this.roundValue(e[l]).toLowerCase(),a=this.createElement("span",{className:it,attrs:{role:"gridcell","aria-label":r,"aria-selected":"false"}}),this.trigger("beforeTileRender",{element:a,presetName:t,value:e[l]}),n.appendChild(a),this.value===r&&(this.addTileSelection(a),s.focus()),a.style.backgroundColor=this.convertToRgbString(this.hexToRgb(r))},a.prototype.setNoColor=function(){var e=this.container.querySelector(".e-row").children[0];e.classList.add($e),this.value||(e.classList.add(tt),t.closest(e,".e-palette").focus()),["aria-selected","aria-label"].forEach(function(t){e.removeAttribute(t)}),e.style.backgroundColor=""},a.prototype.appendElement=function(e,t){void 0===t&&(t=0);var i=this.container.children[t];i?this.container.insertBefore(e,i):this.container.appendChild(e)},a.prototype.addTileSelection=function(e){e.classList.add(tt),e.setAttribute("aria-selected","true")},a.prototype.createPicker=function(){t.classList(this.container,["e-color-picker"],["e-color-palette"]);var e=this.createElement("div",{className:"e-hsv-container"});this.appendElement(e),e.appendChild(this.createElement("div",{className:Ze}));var i=this.createElement("span",{className:"e-handler",attrs:{tabindex:"0"}});e.appendChild(i),this.rgb=this.hexToRgb(this.value),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHsvContainerBg(),this.setHandlerPosition(),this.createSlider(),this.createDragTooltip()},a.prototype.setHsvContainerBg=function(e){void 0===e&&(e=this.hsv[0]),this.getHsvContainer().style.backgroundColor=this.convertToRgbString(this.hsvToRgb(e,100,100,1))},a.prototype.getHsvContainer=function(){return t.select(".e-hsv-container",this.container)},a.prototype.setHandlerPosition=function(){var e=this.getDragHandler(),i=t.select("."+Ze,this.container);this.enableRtl?e.style.left=t.formatUnit(i.offsetWidth*Math.abs(100-this.hsv[1])/100):e.style.left=t.formatUnit(i.offsetWidth*this.hsv[1]/100),e.style.top=t.formatUnit(i.offsetHeight*(100-this.hsv[2])/100)},a.prototype.createSlider=function(){var e=this.createElement("div",{className:"e-slider-preview"});this.appendElement(e,1),this.createPreview(e);var t=this.createElement("div",{className:"e-colorpicker-slider"});e.insertBefore(t,e.children[0]);var i=this.createElement("div",{className:"e-hue-slider"});t.appendChild(i),this.hueSlider=new be({value:this.hsv[0],min:0,max:359,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.hueChange.bind(this)}),this.hueSlider.createElement=this.createElement,this.hueSlider.appendTo(i),this.enableOpacity&&(i=this.createElement("div",{className:"e-opacity-slider"}),t.appendChild(i),this.createOpacitySlider(i))},a.prototype.createOpacitySlider=function(e){this.opacitySlider=new be({value:100*this.rgb[3],min:0,max:100,enableRtl:this.enableRtl,enabled:!this.disabled,change:this.opacityChange.bind(this)}),this.opacitySlider.createElement=this.createElement,this.opacitySlider.appendTo(e);var t=this.createElement("div",{className:"e-opacity-empty-track"});e.appendChild(t),this.updateOpacitySliderBg()},a.prototype.updateOpacitySliderBg=function(){var e=this.enableRtl?"to left":"to right",i=t.select(".e-opacity-empty-track",this.opacitySlider.element);i&&(i.style.background="linear-gradient("+e+", rgba("+this.rgb.slice(0,3)+", 0) 0%, "+this.convertToRgbString(this.rgb.slice(0,3))+" 100%)")},a.prototype.hueChange=function(e){this.hsv[0]=e.value,this.setHsvContainerBg(),this.convertToOtherFormat()},a.prototype.opacityChange=function(e){var t=e.value,i=this.rgbToHex(this.rgb);this.hsv[3]=t/100,this.rgb[3]=t/100;var s=this.rgbToHex(this.rgb);this.updateOpacityInput(t);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,i,n)},a.prototype.updateOpacityInput=function(e){if(this.enableOpacity&&!this.getWrapper().classList.contains(Ke)){var i=t.getInstance(t.select("."+Je,this.container),Q);i.value=e,i.dataBind()}},a.prototype.createPreview=function(e){var t=this.createElement("div",{className:Qe});e.appendChild(t);var i=this.createElement("span",{className:"e-preview e-current"});t.appendChild(i);var s=this.convertToRgbString(this.rgb);i.style.backgroundColor=s,i=this.createElement("span",{className:"e-preview e-previous"}),t.appendChild(i),i.style.backgroundColor=s},a.prototype.isPicker=function(){return!this.container.classList.contains("e-color-palette")},a.prototype.getPopupEle=function(){return this.container.parentElement},a.prototype.createNumericInput=function(e,t,i,s){var n=this,a=new Q({value:t,placeholder:i,min:0,max:s,format:"###.##",showSpinButton:!1,floatLabelType:"Always",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker(),change:function(e){e.event&&n.inputHandler(e.event)}});a.createElement=this.createElement,a.appendTo(e)},a.prototype.createInput=function(){var t=this.isPicker(),i=this.getWrapper();if(t&&!i.classList.contains(Ke)||!t&&i.classList.contains(et)){var s=this.createElement("div",{className:Ye});t?this.appendElement(s,2):this.appendElement(s,1);var n=this.createElement("div",{className:"e-input-container"});if(s.appendChild(n),i.classList.contains("e-hide-valueswitcher")||this.appendValueSwitchBtn(s),!i.classList.contains(_e)){var a=this.createElement("input",{className:"e-hex",attrs:{maxlength:"7",spellcheck:"false"}});n.appendChild(a),e.Input.createInput({element:a,floatLabelType:"Always",properties:{placeholder:"HEX",enableRtl:this.enableRtl,enabled:!this.disabled,readonly:!this.isPicker()}},this.createElement),e.Input.setValue(this.value.slice(0,7),a),a.addEventListener("input",this.inputHandler.bind(this))}if(!i.classList.contains(Xe)){var r=void 0,l=void 0;this.isRgb?(r="RGB",l=this.rgb):(r="HSV",l=this.hsv);for(var o=["rh","gs","bv"],h=0;h<3;h++)this.createNumericInput(n.appendChild(this.createElement("input",{className:"e-"+o[h]+"-value"})),l[h],r[h],255);this.enableOpacity&&this.appendOpacityValue(n)}}},a.prototype.appendOpacityValue=function(e){this.createNumericInput(e.appendChild(this.createElement("input",{className:Je})),100*this.rgb[3],"A",100)},a.prototype.appendValueSwitchBtn=function(e){var t=this.createElement("button",{className:"e-icons e-css e-btn e-flat e-icon-btn e-value-switch-btn"});e.appendChild(t),this.isPicker()&&!this.getWrapper().classList.contains(Xe)&&t.addEventListener("click",this.formatSwitchHandler.bind(this))},a.prototype.createCtrlBtn=function(){if(this.modeSwitcher||this.showButtons){this.l10n.setLocale(this.locale);var e=this.createElement("div",{className:je});if(this.container.appendChild(e),this.showButtons){var t=this.createElement("div",{className:"e-ctrl-btn"});e.appendChild(t);var i=this.l10n.getConstant("Apply");t.appendChild(this.createElement("button",{innerHTML:i,className:"e-btn e-css e-flat e-primary e-small e-apply",attrs:{title:i}}));var s=this.l10n.getConstant("Cancel");t.appendChild(this.createElement("button",{innerHTML:s,className:"e-btn e-css e-flat e-small e-cancel",attrs:{title:s}}))}this.modeSwitcher&&this.appendModeSwitchBtn()}},a.prototype.appendModeSwitchBtn=function(){var e=this.createElement("button",{className:"e-icons e-btn e-flat e-icon-btn "+Ge,attrs:{title:this.l10n.getConstant("ModeSwitcher")}});t.select("."+je,this.container).insertBefore(e,t.select(".e-ctrl-btn",this.container))},a.prototype.createDragTooltip=function(){var e=this,s=new i.Tooltip({opensOn:"Custom",showTipPointer:!1,cssClass:"e-color-picker-tooltip",beforeOpen:function(t){e.tooltipEle=t.element},animation:{open:{effect:"None"},close:{effect:"None"}}});s.createElement=this.createElement,s.appendTo(this.container),s.open(this.container),this.tooltipEle.style.zIndex=i.getZindexPartial(this.tooltipEle).toString(),t.select(".e-tip-content",this.tooltipEle).appendChild(this.createElement("div",{className:"e-tip-transparent"}))},a.prototype.getTooltipInst=function(){return t.getInstance(this.container,i.Tooltip)},a.prototype.setTooltipOffset=function(e){this.getTooltipInst().offsetY=e},a.prototype.toggleDisabled=function(e){e?this.getWrapper().classList.add("e-disabled"):this.getWrapper().classList.remove("e-disabled"),this.showButtons&&[].slice.call(t.selectAll(".e-btn",this.container)).forEach(function(i){e?t.attributes(i,{disabled:""}):i.removeAttribute("disabled")})},a.prototype.convertToRgbString=function(e){return e.length?4===e.length?"rgba("+e.join()+")":"rgb("+e.join()+")":""},a.prototype.convertToHsvString=function(e){return 4===e.length?"hsva("+e.join()+")":"hsv("+e.join()+")"},a.prototype.updateHsv=function(){this.hsv[1]=this.hsv[1]>100?100:this.hsv[1],this.hsv[2]=this.hsv[2]>100?100:this.hsv[2],this.setHandlerPosition()},a.prototype.convertToOtherFormat=function(e){void 0===e&&(e=!1);var t=this.rgbToHex(this.rgb);this.rgb=this.hsvToRgb.apply(this,this.hsv);var i=this.rgbToHex(this.rgb),s=this.convertToRgbString(this.rgb);this.updatePreview(s),this.updateInput(i),this.triggerEvent(i,t,s,e)},a.prototype.updateInput=function(i){var s=this.getWrapper();s.classList.contains(Ke)||(s.classList.contains(_e)||e.Input.setValue(i.substr(0,7),t.select(".e-hex",this.container)),s.classList.contains(Xe)||(this.isRgb?this.updateValue(this.rgb,!1):this.updateValue(this.hsv,!1)))},a.prototype.updatePreview=function(e){this.enableOpacity&&this.updateOpacitySliderBg(),t.select(".e-tip-transparent",this.tooltipEle).style.backgroundColor=e,t.select("."+Qe+" .e-current",this.container).style.backgroundColor=e,t.select("."+Qe+" .e-previous",this.container).style.backgroundColor=this.convertToRgbString(this.hexToRgb(this.value))},a.prototype.getDragHandler=function(){return t.select(".e-handler",this.container)},a.prototype.removeTileSelection=function(){[].slice.call(t.selectAll("."+tt,this.container.children[0])).forEach(function(e){e.classList.remove(tt),e.setAttribute("aria-selected","false")})},a.prototype.convertRgbToNumberArray=function(e){return e.slice(e.indexOf("(")+1,e.indexOf(")")).split(",").map(function(e,t){return 3!==t?parseInt(e,10):parseFloat(e)})},a.prototype.getValue=function(e,t){if(e||(e=this.value),t=t?t.toLowerCase():"hex","r"===e[0]){i=this.convertRgbToNumberArray(e);if("hex"===t||"hexa"===t){s=this.rgbToHex(i);return"hex"===t?s.slice(0,7):s}return"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i.slice(0,3))):"hsva"===t?this.convertToHsvString(this.rgbToHsv.apply(this,i)):"null"}if("h"===e[0]){var i=this.hsvToRgb.apply(this,this.convertRgbToNumberArray(e));if("rgba"===t)return this.convertToRgbString(i);if("hex"===t||"hexa"===t){var s=this.rgbToHex(i);return"hex"===t?s.slice(0,7):s}return"rgb"===t?this.convertToRgbString(i.slice(0,3)):"null"}e=this.roundValue(e);var n=this.hexToRgb(e);return"rgb"!==t&&"hsv"!==t||(n=n.slice(0,3)),"rgba"===t||"rgb"===t?this.convertToRgbString(n):"hsva"===t||"hsv"===t?this.convertToHsvString(this.rgbToHsv.apply(this,n)):"hex"===t?e.slice(0,7):"a"===t?n[3].toString():"null"},a.prototype.toggle=function(){this.container.parentElement.classList.contains("e-popup-close")?this.splitBtn.toggle():this.closePopup(null)},a.prototype.getModuleName=function(){return"colorpicker"},a.prototype.getPersistData=function(){return this.addOnPersist(["value"])},a.prototype.wireEvents=function(){if(this.isPicker()){var e=this.getDragHandler();t.EventHandler.add(e,"keydown",this.pickerKeyDown,this),t.EventHandler.add(this.getHsvContainer(),"mousedown touchstart",this.handlerDown,this),(this.modeSwitcher||this.showButtons)&&this.addCtrlSwitchEvent(),t.EventHandler.add(t.select(".e-previous",this.container),"click",this.previewHandler,this)}else t.EventHandler.add(this.container,"click",this.paletteClickHandler,this),t.EventHandler.add(this.container,"keydown",this.paletteKeyDown,this)},a.prototype.formResetHandler=function(){this.value=this.initialInputValue,t.attributes(this.element,{value:this.initialInputValue})},a.prototype.addCtrlSwitchEvent=function(){var e=t.select("."+je,this.container);e&&t.EventHandler.add(e,"click",this.btnClickHandler,this)},a.prototype.pickerKeyDown=function(e){switch(e.keyCode){case 39:this.handlerDragPosition(1,this.enableRtl?-1:1,e);break;case 37:this.handlerDragPosition(1,this.enableRtl?1:-1,e);break;case 38:this.handlerDragPosition(2,1,e);break;case 40:this.handlerDragPosition(2,-1,e);break;case 13:e.preventDefault();var t=this.rgbToHex(this.rgb);this.enterKeyHandler(t,e)}},a.prototype.enterKeyHandler=function(e,t){this.triggerChangeEvent(e),this.inline||(this.closePopup(t),this.splitBtn.element.focus())},a.prototype.closePopup=function(e){var t=this,i={element:this.container,event:e,cancel:!1};this.trigger("beforeClose",i,function(e){e.cancel||(t.splitBtn.toggle(),t.onPopupClose())})},a.prototype.triggerChangeEvent=function(e){var t=e.slice(0,7);this.trigger("change",{currentValue:{hex:t,rgba:this.convertToRgbString(this.rgb)},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:this.enableOpacity?e:t}),this.enableOpacity?this.setProperties({value:e},!0):this.setProperties({value:t},!0),this.element.value=t||"#000000"},a.prototype.handlerDragPosition=function(e,t,i){i.preventDefault(),this.hsv[e]+=t*(i.ctrlKey?1:3),this.hsv[e]<0&&(this.hsv[e]=0),this.updateHsv(),this.convertToOtherFormat(!0)},a.prototype.handlerDown=function(e){e.preventDefault(),"mousedown"===e.type?(this.clientX=Math.abs(e.pageX-pageXOffset),this.clientY=Math.abs(e.pageY-pageYOffset),this.setTooltipOffset(8)):(this.clientX=Math.abs(e.changedTouches[0].pageX-pageXOffset),this.clientY=Math.abs(e.changedTouches[0].pageY-pageYOffset),this.setTooltipOffset(-8)),this.setHsv(this.clientX,this.clientY),this.getDragHandler().style.transition="left .4s cubic-bezier(.25, .8, .25, 1), top .4s cubic-bezier(.25, .8, .25, 1)",this.updateHsv(),this.convertToOtherFormat(),this.getDragHandler().focus(),t.EventHandler.add(document,"mousemove touchmove",this.handlerMove,this),t.EventHandler.add(document,"mouseup touchend",this.handlerEnd,this)},a.prototype.handlerMove=function(e){"touchmove"!==e.type&&e.preventDefault();var i,s;"mousemove"===e.type?(i=Math.abs(e.pageX-pageXOffset),s=Math.abs(e.pageY-pageYOffset)):(i=Math.abs(e.changedTouches[0].pageX-pageXOffset),s=Math.abs(e.changedTouches[0].pageY-pageYOffset)),this.setHsv(i,s);var n=this.getDragHandler();this.updateHsv(),this.convertToOtherFormat(),this.getTooltipInst().refresh(n),this.tooltipEle.style.transform||(Math.abs(this.clientX-i)>8||Math.abs(this.clientY-s)>8)&&(t.select("."+Ze,this.container).style.cursor="pointer",n.style.transition="none",this.inline||(this.tooltipEle.style.zIndex=(parseInt(this.getPopupEle().style.zIndex,10)+1).toString()),this.tooltipEle.style.transform="rotate(45deg)",n.classList.add("e-hide-handler"))},a.prototype.setHsv=function(e,i){var s=t.select("."+Ze,this.container),n=s.getBoundingClientRect();e=this.enableRtl?e>n.right?0:Math.abs(e-n.right):e>n.left?Math.abs(e-n.left):0,i=i>n.top?Math.abs(i-n.top):0,this.hsv[2]=Math.round(10*Number(100*(s.offsetHeight-Math.max(0,Math.min(s.offsetHeight,i-s.offsetTop)))/s.offsetHeight))/10,this.hsv[1]=Math.round(10*Number(100*Math.max(0,Math.min(s.offsetWidth,e-s.offsetLeft))/s.offsetWidth))/10},a.prototype.handlerEnd=function(e){"touchend"!==e.type&&e.preventDefault(),t.EventHandler.remove(document,"mousemove touchmove",this.handlerMove),t.EventHandler.remove(document,"mouseup touchend",this.handlerEnd);var i=this.getDragHandler();t.select("."+Ze,this.container).style.cursor="",this.tooltipEle.style.transform&&(this.tooltipEle.style.transform="",i.classList.remove("e-hide-handler")),this.inline||this.showButtons||this.closePopup(e)},a.prototype.btnClickHandler=function(e){var i=e.target;t.closest(i,"."+Ge)?(e.stopPropagation(),this.switchToPalette()):(i.classList.contains("e-apply")||i.classList.contains("e-cancel"))&&this.ctrlBtnClick(i,e)},a.prototype.switchToPalette=function(){this.trigger("beforeModeSwitch",{element:this.container,mode:"Palette"}),this.unWireEvents(),this.destroyOtherComp(),t.detach(t.select(".e-slider-preview",this.container)),this.getWrapper().classList.contains(Ke)||t.remove(t.select("."+Ye,this.container)),t.detach(this.getHsvContainer()),this.createPalette(),this.firstPaletteFocus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Palette"})},a.prototype.refreshPopupPos=function(){if(!this.inline){var e=this.getPopupEle();e.style.left=t.formatUnit(0+pageXOffset),e.style.top=t.formatUnit(0+pageYOffset),this.getPopupInst().refreshPosition(this.splitBtn.element.parentElement)}},a.prototype.formatSwitchHandler=function(){this.isRgb?(this.updateValue(this.hsv,!0,3,[360,100,100]),this.isRgb=!1):(this.updateValue(this.rgb,!0,2),this.isRgb=!0)},a.prototype.updateValue=function(e,i,s,n){for(var a,r=["e-rh-value","e-gs-value","e-bv-value"],l=0,o=r.length;l<o;l++)(a=t.getInstance(t.select("."+r[l],this.container),Q)).value=Math.round(e[l]),i&&(a.placeholder=r[l].substr(s,1).toUpperCase(),a.max=n?n[l]:255),a.dataBind()},a.prototype.previewHandler=function(e){var i=e.target,s=this.rgbToHex(this.rgb);this.rgb=this.convertRgbToNumberArray(i.style.backgroundColor),this.rgb[3]||(this.rgb[3]=1);var n=this.rgbToHex(this.rgb),a=this.rgbToHsv.apply(this,this.rgb);a[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:a[0]},!0),this.hueSlider.refresh()),this.setHsvContainerBg(a[0]),this.enableOpacity&&a[3]!==this.hsv[3]&&(this.opacitySlider.setProperties({value:100*a[3]},!0),this.opacitySlider.refresh(),this.updateOpacitySliderBg()),this.hsv=a,this.setHandlerPosition(),this.updateInput(n),t.select("."+Qe+" .e-current",this.container).style.backgroundColor=this.convertToRgbString(this.rgb),this.triggerEvent(n,s,this.convertToRgbString(this.rgb))},a.prototype.paletteClickHandler=function(e){e.preventDefault();var i=e.target;if(i.classList.contains(it)){if(this.removeTileSelection(),this.addTileSelection(i),i.classList.contains($e))this.noColorTile();else{var s=i.getAttribute("aria-label"),n=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(this.roundValue(s)),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(et)&&this.updateInput(s),this.triggerEvent(s,n,this.convertToRgbString(this.rgb))}this.inline||this.showButtons||this.closePopup(e)}else t.closest(i,"."+Ge)?this.switchToPicker():i.classList.contains("e-apply")||i.classList.contains("e-cancel")?this.ctrlBtnClick(i,e):this.getWrapper().classList.contains(et)&&t.closest(i,".e-value-switch-btn")&&this.formatSwitchHandler()},a.prototype.noColorTile=function(e){void 0===e&&(e=!1);var t=this.rgbToHex(this.rgb);this.rgb=[],this.hsv=[],this.triggerEvent("",t,"",e)},a.prototype.switchToPicker=function(){var e=this.getWrapper();this.trigger("beforeModeSwitch",{element:this.container,mode:"Picker"}),this.unWireEvents(),[].slice.call(t.selectAll(".e-palette",this.container)).forEach(function(e){t.detach(e)}),e.classList.contains(et)&&t.detach(t.select("."+Ye,this.container)),this.container.style.width="";var i=t.select(".e-custom-palette",this.container);this.presetColors&&t.remove(i),this.createPicker(),this.getDragHandler().focus(),this.createInput(),this.refreshPopupPos(),this.wireEvents(),this.trigger("onModeSwitch",{element:this.container,mode:"Picker"})},a.prototype.ctrlBtnClick=function(e,t){if(e.classList.contains("e-apply")){var i=this.rgbToHex(this.rgb);this.triggerChangeEvent(i)}this.inline||(this.closePopup(t),this.splitBtn.element.focus())},a.prototype.paletteKeyDown=function(e){var i=e.target;if(i.classList.contains("e-palette")){var s,n,a=[].slice.call(t.selectAll("."+it,i)),r=a.filter(function(e){return e.classList.contains("e-selected")}).pop();switch(!e.altKey&&e.keyCode){case 39:e.preventDefault(),s=r?a[this.tilePosition(a,r,this.enableRtl?-1:1)]:a[this.enableRtl?a.length-1:0],this.keySelectionChanges(s);break;case 37:e.preventDefault(),s=r?a[this.tilePosition(a,r,this.enableRtl?1:-1)]:a[this.enableRtl?0:a.length-1],this.keySelectionChanges(s);break;case 38:e.preventDefault(),s=a[n=r?this.tilePosition(a,r,-this.columns):0]?a[n]:a[n-this.columns],this.keySelectionChanges(s);break;case 40:e.preventDefault(),a[n=r?this.tilePosition(a,r,this.columns):a.length-1]?s=a[n]:(n%=a.length,s=a[n+=a[a.length-1].parentElement.childElementCount]),this.keySelectionChanges(s);break;case 13:if(e.preventDefault(),r){var l=r.getAttribute("aria-label");this.enterKeyHandler(l||"",e)}}}},a.prototype.keySelectionChanges=function(e){if(this.removeTileSelection(),this.addTileSelection(e),e.classList.contains($e))this.noColorTile(!0);else{var t=e.getAttribute("aria-label"),i=this.rgbToHex(this.rgb);this.rgb=this.hexToRgb(t),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.getWrapper().classList.contains(et)&&this.updateInput(t),this.triggerEvent(t,i,this.convertToRgbString(this.rgb),!0)}},a.prototype.tilePosition=function(e,t,i){var s=(e=Array.prototype.slice.call(e)).length,n=this.columns-e[s-1].parentElement.childElementCount,a=e.indexOf(t);return a+=i,a<0?a+=s+n:a%=s+n,a},a.prototype.inputHandler=function(e){var i=e.target;if(i.value.length){var s,n;switch(t.select(".e-float-text",i.parentElement).textContent){case"HEX":var a="";if(("#"===i.value[0]&&5!==i.value.length||"#"!==i.value[0]&&4!==i.value.length)&&(a=this.roundValue(i.value)),9!==a.length)return;n=this.rgbToHex(this.rgb),this.rgb=this.hexToRgb(a+a.substr(-2)),this.inputValueChange(this.rgbToHsv.apply(this,this.rgb),n,i.value);break;case"R":this.rgb[0]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[0]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"G":this.rgb[1]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[1]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"B":this.rgb[2]!==Number(i.value)&&(n=this.rgbToHex(this.rgb),this.rgb[2]=Number(i.value),s=this.rgbToHsv.apply(this,this.rgb),this.inputValueChange(s,n));break;case"H":this.hueSlider.value=Number(i.value);break;case"S":this.hsv[1]!==Number(i.value)&&(this.hsv[1]=Number(i.value),this.updateHsv(),this.convertToOtherFormat());break;case"V":this.hsv[2]!==Number(i.value)&&(this.hsv[2]=Number(i.value),this.updateHsv(),this.convertToOtherFormat());break;case"A":this.opacitySlider.value=Number(i.value)}}},a.prototype.inputValueChange=function(e,t,i){e[0]!==this.hsv[0]&&(this.hueSlider.setProperties({value:e[0]},!0),this.hueSlider.refresh(),this.setHsvContainerBg(e[0])),this.hsv=e;var s=this.rgbToHex(this.rgb);this.setHandlerPosition(),this.updateInput(i||s);var n=this.convertToRgbString(this.rgb);this.updatePreview(n),this.triggerEvent(s,t,n)},a.prototype.triggerEvent=function(e,t,i,s){void 0===s&&(s=!1);var n=e.slice(0,7);this.showButtons||s?this.trigger("select",{currentValue:{hex:n,rgba:i},previousValue:{hex:t.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(t))}}):(this.trigger("change",{currentValue:{hex:n,rgba:i},previousValue:{hex:this.value.slice(0,7),rgba:this.convertToRgbString(this.hexToRgb(this.value))},value:e}),this.setProperties({value:e},!0),this.element.value=n||"#000000")},a.prototype.destroy=function(){var e=this,i=this.getWrapper();n.prototype.destroy.call(this),["tabindex","spellcheck"].forEach(function(t){e.element.removeAttribute(t)}),this.inline?(this.unWireEvents(),this.destroyOtherComp()):(this.isPopupOpen()&&(this.unWireEvents(),this.destroyOtherComp()),this.splitBtn.destroy(),this.splitBtn=null),this.tileRipple(),this.tileRipple=null,this.ctrlBtnRipple(),this.ctrlBtnRipple=null,this.element.nextElementSibling&&t.detach(this.element.nextElementSibling),i&&(i.parentElement.insertBefore(this.element,i),t.detach(i)),this.container=null,this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},a.prototype.destroyOtherComp=function(){if(this.isPicker()){this.hueSlider.destroy(),this.enableOpacity&&(this.opacitySlider.destroy(),this.opacitySlider=null),this.hueSlider=null;var e=this.getTooltipInst();e.close(),e.destroy(),this.tooltipEle=null}},a.prototype.isPopupOpen=function(){return this.getPopupEle().classList.contains("e-popup-open")},a.prototype.unWireEvents=function(){if(this.isPicker()){var e=this.getDragHandler();t.EventHandler.remove(e,"keydown",this.pickerKeyDown),t.EventHandler.remove(this.getHsvContainer(),"mousedown touchstart",this.handlerDown),(this.modeSwitcher||this.showButtons)&&t.EventHandler.remove(t.select("."+je,this.container),"click",this.btnClickHandler),t.EventHandler.remove(t.select(".e-previous",this.container),"click",this.previewHandler)}else t.EventHandler.remove(this.container,"click",this.paletteClickHandler),t.EventHandler.remove(this.container,"keydown",this.paletteKeyDown)},a.prototype.roundValue=function(e){if(!e)return"";"#"!==e[0]&&(e="#"+e);var t=e.length;if(4===t&&(e+="f",t=5),5===t){for(var i="",s=1,n=e.length;s<n;s++)i+=e.charAt(s)+e.charAt(s);e="#"+i,t=9}return 7===t&&(e+="ff"),e},a.prototype.hexToRgb=function(e){if(!e)return[];9!==(e=e.trim()).length&&(e=this.roundValue(e));var t=Number((parseInt(e.slice(-2),16)/255).toFixed(2));e=e.slice(1,7);var i=parseInt(e,16),s=[];return s.push(i>>16&255),s.push(i>>8&255),s.push(255&i),s.push(t),s},a.prototype.rgbToHsv=function(e,i,s,n){if(this.rgb&&!this.rgb.length)return[];e/=255,i/=255,s/=255;var a,r=Math.max(e,i,s),l=Math.min(e,i,s),o=r,h=r-l,d=0===r?0:h/r;if(r===l)a=0;else{switch(r){case e:a=(i-s)/h+(i<s?6:0);break;case i:a=(s-e)/h+2;break;case s:a=(e-i)/h+4}a/=6}var u=[Math.round(360*a),Math.round(1e3*d)/10,Math.round(1e3*o)/10];return t.isNullOrUndefined(n)||u.push(n),u},a.prototype.hsvToRgb=function(e,i,s,n){var a,r,l;if(i/=100,s/=100,0===i)return a=r=l=s,[Math.round(255*a),Math.round(255*r),Math.round(255*l),n];e/=60;var o=Math.floor(e),h=e-o,d=s*(1-i),u=s*(1-i*h),c=s*(1-i*(1-h));switch(o){case 0:a=s,r=c,l=d;break;case 1:a=u,r=s,l=d;break;case 2:a=d,r=s,l=c;break;case 3:a=d,r=u,l=s;break;case 4:a=c,r=d,l=s;break;default:a=s,r=d,l=u}var p=[Math.round(255*a),Math.round(255*r),Math.round(255*l)];return t.isNullOrUndefined(n)||p.push(n),p},a.prototype.rgbToHex=function(e){return e.length?"#"+this.hex(e[0])+this.hex(e[1])+this.hex(e[2])+(t.isNullOrUndefined(e[3])?"":0!==e[3]?(Math.round(255*e[3])+65536).toString(16).substr(-2):"00"):""},a.prototype.hex=function(e){return("0"+e.toString(16)).slice(-2)},a.prototype.changeModeSwitcherProp=function(e){var i=t.select("."+je,this.container);e?i?this.appendModeSwitchBtn():(this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):i&&(this.showButtons?t.detach(t.select("."+Ge,i)):t.remove(i))},a.prototype.changeShowBtnProps=function(e){var i=t.select("."+je,this.container);e?(i&&t.remove(i),this.createCtrlBtn(),this.isPicker()&&!this.disabled&&this.addCtrlSwitchEvent()):this.modeSwitcher?t.detach(t.select(".e-ctrl-btn",i)):t.remove(i)},a.prototype.changeValueProp=function(e){if(this.isPicker())this.rgb=this.hexToRgb(e),this.hsv=this.rgbToHsv.apply(this,this.rgb),this.setHandlerPosition(),t.detach(t.closest(this.hueSlider.element,".e-slider-preview")),this.createSlider(),this.setHsvContainerBg(),this.updateInput(e),4===this.rgb.length&&this.updateOpacityInput(100*this.rgb[3]);else{this.removeTileSelection();var i=this.container.querySelector('span[aria-label="'+this.roundValue(e)+'"]');i&&this.addTileSelection(i)}},a.prototype.setInputEleProps=function(){t.remove(t.select("."+Ye,this.container)),this.createInput()},a.prototype.changeDisabledProp=function(e){this.isPicker()&&(this.hueSlider.enabled=!e,this.opacitySlider.enabled=!e,this.setInputEleProps()),e?(this.toggleDisabled(!0),this.unWireEvents()):(this.toggleDisabled(!1),this.wireEvents())},a.prototype.changeCssClassProps=function(e,i){var s=this.getWrapper(),n=this.getPopupEle();i&&t.removeClass([s,n],i.split(" ")),e&&t.addClass([s,n],e.split(" "))},a.prototype.changeRtlProps=function(e){e?t.addClass([this.getWrapper()],"e-rtl"):t.removeClass([this.getWrapper()],"e-rtl")},a.prototype.changePaletteProps=function(){t.detach(this.container.children[0]),this.container.style.width="",this.createPalette()},a.prototype.changeOpacityProps=function(e){var i=this.getWrapper();e?(t.removeClass([this.container.parentElement],"e-hide-opacity"),this.createOpacitySlider(t.select(".e-colorpicker-slider",this.container).appendChild(this.createElement("div",{className:"e-opacity-slider"}))),i.classList.contains(Ke)||i.classList.contains(Xe)||this.appendOpacityValue(t.select(".e-input-container",this.container))):(t.addClass([this.container.parentElement],"e-hide-opacity"),this.opacitySlider.destroy(),t.remove(this.opacitySlider.element),this.opacitySlider=null,i.classList.contains(Ke)||i.classList.contains(Xe)||t.remove(t.select("."+Je,this.container).parentElement))},a.prototype.onPropertyChanged=function(e,i){var n=this;if(!t.isNullOrUndefined(e.value)){var a=this.roundValue(e.value);if(9===a.length){this.element.value=this.roundValue(a).slice(0,7);var r=this.splitBtn&&t.select(".e-split-preview",this.splitBtn.element);r&&(r.style.backgroundColor=this.convertToRgbString(this.hexToRgb(e.value)))}else this.value=i.value}if(!this.inline&&t.isNullOrUndefined(e.inline)){var l=["disabled","enableRtl"];if(this.splitBtn.setProperties(s.getModel(e,l)),!this.isPopupOpen())return this.changeCssClassProps(e.cssClass,i.cssClass),void this.changeRtlProps(e.enableRtl)}for(var o=this,h=0,d=Object.keys(e);h<d.length;h++)!function(s){switch(s){case"inline":e.inline?(o.getWrapper().appendChild(o.container),o.splitBtn.destroy(),t.detach(o.element.nextElementSibling),o.container.children.length||o.createWidget()):(o.destroyOtherComp(),o.unWireEvents(),o.container.innerHTML="",o.createSplitBtn());break;case"cssClass":o.changeCssClassProps(e.cssClass,i.cssClass);var a=e.cssClass.split(" ").concat(i.cssClass.split(" ")),r=0;(a=a.reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[])).forEach(function(e){0!==r||e!==Ke&&"e-hide-valueswitcher"!==e&&e!==et&&e!==_e&&e!==Xe||(t.select("."+Ye,n.container)&&t.remove(t.select("."+Ye,n.container)),n.createInput(),r++)});break;case"enableRtl":o.isPicker()&&(o.hueSlider.enableRtl=e.enableRtl,o.enableOpacity&&(o.opacitySlider.enableRtl=e.enableRtl),o.setInputEleProps()),o.changeRtlProps(e.enableRtl);break;case"disabled":o.changeDisabledProp(e.disabled);break;case"value":o.value!==i.value&&o.changeValueProp(e.value);break;case"showButtons":o.changeShowBtnProps(e.showButtons);break;case"mode":"Picker"===e.mode?o.switchToPicker():o.switchToPalette();break;case"modeSwitcher":o.changeModeSwitcherProp(e.modeSwitcher);break;case"columns":case"presetColors":o.isPicker()||o.changePaletteProps();break;case"noColor":e.noColor?"Palette"!==o.mode||o.modeSwitcher||o.setNoColor():o.changePaletteProps();break;case"enableOpacity":o.changeOpacityProps(e.enableOpacity)}}(d[h])},a.prototype.focusIn=function(){this.element.parentElement.focus()},We([t.Property("#008000ff")],a.prototype,"value",void 0),We([t.Property("")],a.prototype,"cssClass",void 0),We([t.Property(!1)],a.prototype,"disabled",void 0),We([t.Property("Picker")],a.prototype,"mode",void 0),We([t.Property(!0)],a.prototype,"modeSwitcher",void 0),We([t.Property(null)],a.prototype,"presetColors",void 0),We([t.Property(!0)],a.prototype,"showButtons",void 0),We([t.Property(10)],a.prototype,"columns",void 0),We([t.Property(!1)],a.prototype,"inline",void 0),We([t.Property(!1)],a.prototype,"noColor",void 0),We([t.Property(!1)],a.prototype,"enablePersistence",void 0),We([t.Property(!0)],a.prototype,"enableOpacity",void 0),We([t.Event()],a.prototype,"select",void 0),We([t.Event()],a.prototype,"change",void 0),We([t.Event()],a.prototype,"beforeTileRender",void 0),We([t.Event()],a.prototype,"beforeOpen",void 0),We([t.Event()],a.prototype,"open",void 0),We([t.Event()],a.prototype,"beforeClose",void 0),We([t.Event()],a.prototype,"beforeModeSwitch",void 0),We([t.Event()],a.prototype,"onModeSwitch",void 0),We([t.Event()],a.prototype,"created",void 0),a=We([t.NotifyPropertyChanges],a)}(t.Component),at=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),rt=function(e,t,i,s){var n,a=arguments.length,r=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(r=(a<3?n(r):a>3?n(t,i,r):n(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},lt=["title","style","class"],ot=function(i){function s(e,t){var s=i.call(this,e,t)||this;return s.previousValue=null,s.isAngular=!1,s.isHiddenInput=!1,s.isForm=!1,s.inputPreviousValue=null,s.isVue=!1,s.textboxOptions=e,s}return at(s,i),s.prototype.onPropertyChanged=function(i,s){for(var n=0,a=Object.keys(i);n<a.length;n++)switch(a[n]){case"floatLabelType":e.Input.removeFloating(this.textboxWrapper),e.Input.addFloating(this.respectiveElement,this.floatLabelType,this.placeholder);break;case"enabled":e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container),this.bindClearEvent();break;case"width":e.Input.setWidth(i.width,this.textboxWrapper.container);break;case"value":var r=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.isBlank(this.value)||(this.value=this.value.toString()),this.isProtectedOnChange=r,e.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.inputPreviousValue=this.respectiveElement.value,(this.isAngular||this.isVue)&&!0===this.preventChange?(this.previousValue=this.isAngular?this.value:this.previousValue,this.preventChange=!1):(t.isNullOrUndefined(this.isAngular)||!this.isAngular||this.isAngular&&!this.preventChange||this.isAngular&&t.isNullOrUndefined(this.preventChange))&&this.raiseChangeEvent();break;case"htmlAttributes":this.updateHTMLAttrToElement(),this.updateHTMLAttrToWrapper(),this.checkAttributes(!0),e.Input.validateInputType(this.textboxWrapper.container,this.element);break;case"readonly":e.Input.setReadonly(this.readonly,this.respectiveElement);break;case"type":"TEXTAREA"!==this.respectiveElement.tagName&&(this.respectiveElement.setAttribute("type",this.type),e.Input.validateInputType(this.textboxWrapper.container,this.element),this.raiseChangeEvent());break;case"showClearButton":"TEXTAREA"!==this.respectiveElement.tagName&&(e.Input.setClearButton(this.showClearButton,this.respectiveElement,this.textboxWrapper),this.bindClearEvent());break;case"enableRtl":e.Input.setEnableRtl(this.enableRtl,[this.textboxWrapper.container]);break;case"placeholder":e.Input.setPlaceholder(this.placeholder,this.respectiveElement);break;case"autocomplete":"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:this.removeAttributes(["autocomplete"]);break;case"cssClass":this.updateCssClass(i.cssClass,s.cssClass);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)}},s.prototype.getModuleName=function(){return"textbox"},s.prototype.isBlank=function(e){return!e||/^\s*$/.test(e)},s.prototype.preRender=function(){if(!t.isBlazor()||!this.isServerRendered){if(this.cloneElement=this.element.cloneNode(!0),this.formElement=t.closest(this.element,"form"),t.isNullOrUndefined(this.formElement)||(this.isForm=!0),"EJS-TEXTBOX"===this.element.tagName){var e=t.getValue("ej2_instances",this.element),i=this.multiline?this.createElement("textarea"):this.createElement("input");for(a=0;a<this.element.attributes.length;a++)"id"!==(r=this.element.attributes[a].nodeName)&&(i.setAttribute(r,this.element.attributes[a].nodeValue),i.innerHTML=this.element.innerHTML,"name"===r&&this.element.removeAttribute("name"));this.element.appendChild(i),this.element=i,t.setValue("ej2_instances",e,this.element)}this.updateHTMLAttrToElement(),this.checkAttributes(!1),"TEXTAREA"!==this.element.tagName&&this.element.setAttribute("type",this.type),this.element.setAttribute("role","textbox"),this.globalize=new t.Internationalization(this.locale);var s={placeholder:this.placeholder};if(this.l10n=new t.L10n("textbox",s,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",t.getUniqueID("textbox")),this.element.hasAttribute("name")||this.element.setAttribute("name",this.element.getAttribute("id")),"INPUT"===this.element.tagName&&this.multiline){this.isHiddenInput=!0,this.textarea=this.createElement("textarea"),this.element.parentNode.insertBefore(this.textarea,this.element),this.element.setAttribute("type","hidden"),this.textarea.setAttribute("name",this.element.getAttribute("name")),this.element.removeAttribute("name"),this.textarea.setAttribute("role",this.element.getAttribute("role")),this.element.removeAttribute("role"),this.textarea.setAttribute("id",t.getUniqueID("textarea"));for(var n=["placeholder","disabled","value","readonly","type","autocomplete"],a=0;a<this.element.attributes.length;a++){var r=this.element.attributes[a].nodeName;this.element.hasAttribute(r)&<.indexOf(r)<0&&"id"!==r&&"type"!==r&&"e-mappinguid"!==r&&(this.textarea.setAttribute(r,this.element.attributes[a].nodeValue),n.indexOf(r)<0&&(this.element.removeAttribute(r),a--))}}}},s.prototype.checkAttributes=function(e){for(var i=0,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["placeholder","disabled","value","readonly","type","autocomplete"];i<s.length;i++){var n=s[i];if(!t.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.enabled||e){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!e)}break;case"readonly":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.readonly||e){var r="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:r},!e)}break;case"placeholder":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.placeholder||e)&&this.setProperties({placeholder:this.element.placeholder},!e);break;case"autocomplete":if(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||e){var l="off"===this.element.autocomplete?"off":"on";this.setProperties({autocomplete:l},!e)}break;case"value":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.value||e)&&this.setProperties({value:this.element.value},!e);break;case"type":(t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.type||e)&&this.setProperties({type:this.element.type},!e)}}},s.prototype.render=function(){var i=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getInputValidClassList(this.cssClass)),t.isBlazor()&&this.isServerRendered?(this.respectiveElement=this.element,this.textboxWrapper={container:this.element.parentElement},this.showClearButton&&!this.multiline&&(this.textboxWrapper.clearButton=this.textboxWrapper.container.querySelector(".e-clear-icon"),e.Input.wireClearBtnEvents(this.respectiveElement,this.textboxWrapper.clearButton,this.textboxWrapper.container)),"Auto"===this.floatLabelType&&e.Input.wireFloatingEvents(this.respectiveElement),e.Input.bindInitialEvent({element:this.respectiveElement,buttons:null,customTag:null,floatLabelType:this.floatLabelType,properties:this.properties})):(this.respectiveElement=this.isHiddenInput?this.textarea:this.element,this.textboxWrapper=e.Input.createInput({element:this.respectiveElement,floatLabelType:this.floatLabelType,properties:{enabled:this.enabled,enableRtl:this.enableRtl,cssClass:i,readonly:this.readonly,placeholder:this.placeholder,showClearButton:this.showClearButton}}),this.updateHTMLAttrToWrapper(),this.isHiddenInput&&this.respectiveElement.parentNode.insertBefore(this.element,this.respectiveElement)),this.wireEvents(),t.isNullOrUndefined(this.value)||(e.Input.setValue(this.value,this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value)),t.isNullOrUndefined(this.value)||(this.initialValue=this.value,this.setInitialValue()),"on"!==this.autocomplete&&""!==this.autocomplete?this.respectiveElement.autocomplete=this.autocomplete:t.isNullOrUndefined(this.textboxOptions)||void 0===this.textboxOptions.autocomplete||this.removeAttributes(["autocomplete"]),this.previousValue=this.value,this.inputPreviousValue=this.value,this.respectiveElement.defaultValue=this.respectiveElement.value,e.Input.setWidth(this.width,this.textboxWrapper.container),this.renderComplete()},s.prototype.updateHTMLAttrToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(lt.indexOf(s)>-1)if("class"===s){var n=this.getInputValidClassList(this.htmlAttributes[s]);""!==n&&t.addClass([this.textboxWrapper.container],n.split(" "))}else if("style"===s){var a=this.textboxWrapper.container.getAttribute(s);a=t.isNullOrUndefined(a)?this.htmlAttributes[s]:a+this.htmlAttributes[s],this.textboxWrapper.container.setAttribute(s,a)}else this.textboxWrapper.container.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateHTMLAttrToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];lt.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[s])}},s.prototype.updateCssClass=function(t,i){e.Input.setCssClass(this.getInputValidClassList(t),[this.textboxWrapper.container],this.getInputValidClassList(i))},s.prototype.getInputValidClassList=function(e){var i=e;return t.isNullOrUndefined(e)||""===e||(i=e.replace(/\s+/g," ").trim()),i},s.prototype.setInitialValue=function(){this.isAngular||this.respectiveElement.setAttribute("value",this.initialValue)},s.prototype.wireEvents=function(){t.EventHandler.add(this.respectiveElement,"focus",this.focusHandler,this),t.EventHandler.add(this.respectiveElement,"blur",this.focusOutHandler,this),t.EventHandler.add(this.respectiveElement,"input",this.inputHandler,this),t.EventHandler.add(this.respectiveElement,"change",this.changeHandler,this),this.isForm&&t.EventHandler.add(this.formElement,"reset",this.resetForm,this),this.bindClearEvent(),!t.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-autofill")&&this.textboxWrapper.container.classList.contains("e-outline")&&t.EventHandler.add(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler,this)},s.prototype.animationHandler=function(){this.textboxWrapper.container.classList.add("e-valid-input");var e=this.textboxWrapper.container.querySelector(".e-float-text");t.isNullOrUndefined(e)||(e.classList.add("e-label-top"),e.classList.contains("e-label-bottom")&&e.classList.remove("e-label-bottom"))},s.prototype.resetValue=function(e){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=e,this.isProtectedOnChange=t},s.prototype.resetForm=function(){if(this.isAngular?this.resetValue(""):this.resetValue(this.initialValue),!t.isNullOrUndefined(this.textboxWrapper)){var e=this.textboxWrapper.container.querySelector(".e-float-text");t.isNullOrUndefined(e)||(t.isNullOrUndefined(this.initialValue)||""===this.initialValue?(e.classList.add("e-label-bottom"),e.classList.remove("e-label-top")):""!==this.initialValue&&(e.classList.add("e-label-top"),e.classList.remove("e-label-bottom")))}},s.prototype.focusHandler=function(e){var t={container:this.textboxWrapper.container,event:e,value:this.value};this.trigger("focus",t)},s.prototype.focusOutHandler=function(e){null===this.previousValue&&null===this.value&&""===this.respectiveElement.value||this.previousValue===this.respectiveElement.value||this.raiseChangeEvent(e,!0);var t={container:this.textboxWrapper.container,event:e,value:this.value};this.trigger("blur",t)},s.prototype.inputHandler=function(e){var t=this,i={event:e,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.inputPreviousValue=this.respectiveElement.value,this.isAngular&&(t.localChange({value:this.respectiveElement.value}),this.preventChange=!0),this.isVue&&(this.preventChange=!0),this.trigger("input",i),e.stopPropagation()},s.prototype.changeHandler=function(e){this.setProperties({value:this.respectiveElement.value},!0),this.raiseChangeEvent(e,!0),e.stopPropagation()},s.prototype.raiseChangeEvent=function(e,t){var i={event:e,value:this.value,previousValue:this.previousValue,container:this.textboxWrapper.container,isInteraction:t||!1,isInteracted:t||!1};this.preventChange=!1,this.trigger("change",i),this.previousValue=this.value},s.prototype.bindClearEvent=function(){this.showClearButton&&"TEXTAREA"!==this.respectiveElement.tagName&&(this.enabled?t.EventHandler.add(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler,this):t.EventHandler.remove(this.textboxWrapper.clearButton,"mousedown touchstart",this.resetInputHandler))},s.prototype.resetInputHandler=function(t){if(t.preventDefault(),!this.textboxWrapper.clearButton.classList.contains("e-clear-icon-hide")){e.Input.setValue("",this.respectiveElement,this.floatLabelType,this.showClearButton),this.isHiddenInput&&(this.element.value=this.respectiveElement.value),this.setProperties({value:this.respectiveElement.value},!0);var i={event:t,value:this.respectiveElement.value,previousValue:this.inputPreviousValue,container:this.textboxWrapper.container};this.trigger("input",i),this.inputPreviousValue=this.respectiveElement.value,this.raiseChangeEvent(t,!0)}},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.respectiveElement,"focus",this.focusHandler),t.EventHandler.remove(this.respectiveElement,"blur",this.focusOutHandler),t.EventHandler.remove(this.respectiveElement,"input",this.inputHandler),t.EventHandler.remove(this.respectiveElement,"change",this.changeHandler),this.isForm&&t.EventHandler.remove(this.formElement,"reset",this.resetForm),!t.isNullOrUndefined(this.textboxWrapper.container.querySelector(".e-float-text"))&&"Auto"===this.floatLabelType&&this.textboxWrapper.container.classList.contains("e-outline")&&this.textboxWrapper.container.classList.contains("e-autofill")&&t.EventHandler.remove(this.textboxWrapper.container.querySelector(".e-float-text"),"animationstart",this.animationHandler)},s.prototype.destroy=function(){this.unWireEvents(),t.isBlazor()&&this.isServerRendered?this.textboxWrapper=null:("INPUT"===this.element.tagName&&this.multiline&&(t.detach(this.textboxWrapper.container.getElementsByTagName("textarea")[0]),this.respectiveElement=this.element,this.element.removeAttribute("type")),this.respectiveElement.value=this.respectiveElement.defaultValue,this.respectiveElement.classList.remove("e-input"),this.removeAttributes(["aria-placeholder","aria-disabled","aria-readonly","aria-labelledby"]),t.isNullOrUndefined(this.textboxWrapper)||(this.textboxWrapper.container.insertAdjacentElement("afterend",this.respectiveElement),t.detach(this.textboxWrapper.container)),this.textboxWrapper=null,i.prototype.destroy.call(this))},s.prototype.addIcon=function(t,i){e.Input.addIcon(t,i,this.textboxWrapper.container,this.respectiveElement,this.createElement)},s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.addAttributes=function(t){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!1},!0),e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!0},!0),e.Input.setReadonly(this.readonly,this.respectiveElement)):"class"===n?this.respectiveElement.classList.add(t[n]):"placeholder"===n?(this.setProperties({placeholder:t[n]},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)):("rows"===n&&this.respectiveElement.tagName,this.respectiveElement.setAttribute(n,t[n]))}},s.prototype.removeAttributes=function(t){for(var i=0,s=t;i<s.length;i++){var n=s[i];"disabled"===n?(this.setProperties({enabled:!0},!0),e.Input.setEnabled(this.enabled,this.respectiveElement,this.floatLabelType,this.textboxWrapper.container)):"readonly"===n?(this.setProperties({readonly:!1},!0),e.Input.setReadonly(this.readonly,this.respectiveElement)):"placeholder"===n?(this.setProperties({placeholder:null},!0),e.Input.setPlaceholder(this.placeholder,this.respectiveElement)):this.respectiveElement.removeAttribute(n)}},s.prototype.focusIn=function(){document.activeElement!==this.respectiveElement&&this.enabled&&(this.respectiveElement.focus(),(this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&t.addClass([this.textboxWrapper.container],["e-input-focus"]))},s.prototype.focusOut=function(){document.activeElement===this.respectiveElement&&this.enabled&&(this.respectiveElement.blur(),(this.textboxWrapper.container.classList.contains("e-input-group")||this.textboxWrapper.container.classList.contains("e-outline")||this.textboxWrapper.container.classList.contains("e-filled"))&&t.removeClass([this.textboxWrapper.container],["e-input-focus"]))},rt([t.Property("text")],s.prototype,"type",void 0),rt([t.Property(!1)],s.prototype,"readonly",void 0),rt([t.Property(null)],s.prototype,"value",void 0),rt([t.Property("Never")],s.prototype,"floatLabelType",void 0),rt([t.Property("")],s.prototype,"cssClass",void 0),rt([t.Property(null)],s.prototype,"placeholder",void 0),rt([t.Property("on")],s.prototype,"autocomplete",void 0),rt([t.Property({})],s.prototype,"htmlAttributes",void 0),rt([t.Property(!1)],s.prototype,"multiline",void 0),rt([t.Property(!0)],s.prototype,"enabled",void 0),rt([t.Property(!1)],s.prototype,"showClearButton",void 0),rt([t.Property(!1)],s.prototype,"enablePersistence",void 0),rt([t.Property(null)],s.prototype,"width",void 0),rt([t.Event()],s.prototype,"created",void 0),rt([t.Event()],s.prototype,"destroyed",void 0),rt([t.Event()],s.prototype,"change",void 0),rt([t.Event()],s.prototype,"blur",void 0),rt([t.Event()],s.prototype,"focus",void 0),rt([t.Event()],s.prototype,"input",void 0),s=rt([t.NotifyPropertyChanges],s)}(t.Component);return e.NumericTextBox=Q,e.regularExpressions=re,e.createMask=n,e.applyMask=a,e.wireEvents=r,e.unwireEvents=l,e.bindClearEvent=o,e.unstrippedValue=c,e.strippedValue=p,e.maskInputMouseDownHandler=v,e.maskInputMouseUpHandler=f,e.maskInputFocusHandler=g,e.triggerFocus=y,e.maskInputBlurHandler=b,e.maskInputDropHandler=S,e.mobileRemoveFunction=x,e.setMaskValue=D,e.setElementValue=I,e.maskInput=z,e.getVal=W,e.getMaskedVal=j,e.MaskUndo=le,e.MaskedTextBox=ue,e.TicksData=me,e.ColorRangeData=ve,e.LimitData=fe,e.TooltipData=ge,e.Slider=be,e.regex=Se,e.FormValidator=Te,e.FilesProp=Me,e.ButtonsProps=De,e.AsyncSettings=Ie,e.Uploader=ze,e.ColorPicker=nt,e.TextBox=ot,e}({},ej.base,ej.popups,ej.splitbuttons),this.ejs=ej;
- /*!
- * filename: ej2-lists.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.lists=function(e,t,i,s){"use strict";function n(e,i){var s={};if(t.isNullOrUndefined(e)||"string"==typeof e||"number"==typeof e||!t.isNullOrUndefined(e.isHeader))return e;for(var n=0,l=Object.keys(i);n<l.length;n++){var r=i[l[n]],a=t.isNullOrUndefined(r)||"string"!=typeof r?void 0:t.getValue(r,e);t.isNullOrUndefined(a)||(s[r]=a)}return s}function l(e,i,s,n){var l=[];if(i||(i=e),s&&s.length?s.forEach(function(t){l.push(e.children[t])}):l=[].slice.call(e.children),t.isNullOrUndefined(n))l.forEach(function(e){i.appendChild(e)});else{var r=i.children[n];l.forEach(function(e){i.insertBefore(e,r)})}}e.cssClass={li:"e-list-item",ul:"e-list-parent e-ul",group:"e-list-group-item",icon:"e-list-icon",text:"e-list-text",check:"e-list-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-list-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-list-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"},function(s){function l(e,i,s,n,l){var a=t.extend({},D,s),o=t.extend({},k,a.ariaAttributes),h=v(i).typeof;return"string"===h||"number"===h?r(e,i,n,s,l):c(e,i,s,o.level,n,l)}function r(e,t,i,s,n){return E(e,a(e,t,i,s,n),null,s)}function a(i,s,n,l,r){var a=[],o=t.extend({},D,l);e.cssClass=L(o.moduleName);for(var c=w(),h=0;h<s.length;h++)if(!t.isNullOrUndefined(s[h])){var d=void 0;if(o.itemCreating&&"function"==typeof o.itemCreating){u={dataSource:s,curData:s[h],text:s[h],options:o};o.itemCreating(u)}if(d=n?x(i,s[h],void 0,null,null,[],null,c,h,l):V(i,s[h],void 0,null,null,l,r),o.itemCreated&&"function"==typeof o.itemCreated){var u={dataSource:s,curData:s[h],text:s[h],item:d,options:o};o.itemCreated(u)}a.push(d)}return a}function o(i,l,r,a,o,c){var h=t.extend({},D,r);e.cssClass=L(h.moduleName);var d,u=t.extend({},s.defaultMappedFields,h.fields),p=t.extend({},k,h.ariaAttributes),m=[];a&&(p.level=a);var f,g,y=[];l&&l.length&&!t.isNullOrUndefined(v(l).item)&&!v(l).item.hasOwnProperty(u.id)&&(d=w());for(var b=0;b<l.length;b++){var C=n(l[b],u);if(!t.isNullOrUndefined(l[b])){if(h.itemCreating&&"function"==typeof h.itemCreating){A={dataSource:l,curData:l[b],text:C[u.text],options:h,fields:u};h.itemCreating(A)}var E=l[b];h.itemCreating&&"function"==typeof h.itemCreating&&(C=n(l[b],u)),C.hasOwnProperty(u.id)&&!t.isNullOrUndefined(C[u.id])&&(d=C[u.id]);var O=[];if(h.showCheckBox&&(h.itemNavigable&&(C[u.url]||C[u.urlAttributes])?m.push(i("input",{className:e.cssClass.check,attrs:{type:"checkbox"}})):O.push(i("input",{className:e.cssClass.check,attrs:{type:"checkbox"}}))),!0===o)h.showIcon&&C.hasOwnProperty(u.iconCss)&&!t.isNullOrUndefined(C[u.iconCss])&&O.push(i("span",{className:e.cssClass.icon+" "+C[u.iconCss]})),g=(f=x(i,E,C,u,h.itemClass,O,!(!E.hasOwnProperty("isHeader")||!E.isHeader),d,b,r)).querySelector("."+e.cssClass.anchorWrap),h.itemNavigable&&m.length&&t.prepend(m,f.firstElementChild);else{if((f=V(i,E,C,u,h.itemClass,r,c)).classList.add(e.cssClass.level+"-"+p.level),f.setAttribute("aria-level",p.level.toString()),g=f.querySelector("."+e.cssClass.anchorWrap),C.hasOwnProperty(u.tooltip)&&f.setAttribute("title",C[u.tooltip]),C.hasOwnProperty(u.htmlAttributes)&&C[u.htmlAttributes]&&I(f,C[u.htmlAttributes]),C.hasOwnProperty(u.enabled)&&!1===C[u.enabled]&&f.classList.add(e.cssClass.disabled),C.hasOwnProperty(u.isVisible)&&!1===C[u.isVisible]&&(f.style.display="none"),C.hasOwnProperty(u.imageUrl)&&!t.isNullOrUndefined(C[u.imageUrl])&&!h.template){var B={src:C[u.imageUrl]};t.merge(B,C[u.imageAttributes]);var T=i("img",{className:e.cssClass.image,attrs:B});g?g.insertAdjacentElement("afterbegin",T):t.prepend([T],f.firstElementChild)}if(h.showIcon&&C.hasOwnProperty(u.iconCss)&&!t.isNullOrUndefined(C[u.iconCss])&&!h.template){var H=i("div",{className:e.cssClass.icon+" "+C[u.iconCss]});g?g.insertAdjacentElement("afterbegin",H):t.prepend([H],f.firstElementChild)}O.length&&t.prepend(O,f.firstElementChild),h.itemNavigable&&m.length&&t.prepend(m,f.firstElementChild),S(i,C,u,l,h,f,p.level)}if(g&&t.addClass([f],[e.cssClass.navigable]),h.itemCreated&&"function"==typeof h.itemCreated){var A={dataSource:l,curData:l[b],text:C[u.text],item:f,options:h,fields:u};h.itemCreated(A)}m=[],y.push(f)}}return y}function c(e,i,s,n,l,r){var a=t.extend({},D,s);return E(e,o(e,i,s,n,l,r),a.listClass,s)}function h(i,s,n){if(e.cssClass=L(D.moduleName),i&&i.length){var l,r,a=Array.prototype.slice.call(i);for(l=a[(r=s?d(s,a):!0===n?a.length:-1)+(!0===n?-1:1)];l&&(!t.isVisible(l)||l.classList.contains(e.cssClass.disabled));)l=a[r+=!0===n?-1:1];return l}}function d(e,t){if(t&&e){return Array.prototype.slice.call(t).indexOf(e)}}function u(e,n,l){void 0===l&&(l="None");var r=t.extend({},s.defaultMappedFields,n),a=(new i.Query).group(r.groupBy),o=m(e,a=p(l,"key",a));e=[];for(var c=0;c<o.length;c++){var h=o[c].items,d={};d[r.text]=o[c].key,d.isHeader=!0;var u=r.text;"id"===u&&(d[u="text"]=o[c].key),d._id="group-list-item-"+(o[c].key?o[c].key.toString().trim():"undefined"),d.items=h,e.push(d);for(var f=0;f<h.length;f++)e.push(h[f])}return e}function p(e,t,s){if(void 0===s&&(s=new i.Query),"Ascending"===e)s.sortBy(t,"ascending",!0);else if("Descending"===e)s.sortBy(t,"descending",!0);else for(var n=0;n<s.queries.length;n++)"onSortBy"===s.queries[n].fn&&s.queries.splice(n,1);return s}function m(e,t){return new i.DataManager(e).executeLocal(t)}function f(e,i){var n=t.extend({},D,i),l=t.extend({},s.defaultMappedFields,n.fields),r=e.cloneNode(!0),a=[];r.classList.add("json-parent");var o=r.querySelectorAll(".json-parent>li");r.classList.remove("json-parent");for(var c=0;c<o.length;c++){for(var h=o[c],d=h.querySelector("a"),u=h.querySelector("ul"),p={},m=d?d.childNodes:h.childNodes,v=Object.keys(m),I=0;I<m.length;I++)m[Number(v[I])].hasChildNodes()||(p[l.text]=m[Number(v[I])].textContent);var y=g(h);y.id?(p[l.id]=y.id,delete y.id):p[l.id]=w(),Object.keys(y).length&&(p[l.htmlAttributes]=y),d&&(y=g(d),Object.keys(y).length&&(p[l.urlAttributes]=y)),u&&(p[l.child]=f(u,i)),a.push(p)}return a}function v(e){for(var i={typeof:null,item:null},s=0;s<e.length;s++)if(!t.isNullOrUndefined(e[s]))return i={typeof:typeof e[s],item:e[s]};return i}function I(e,i){var s={};t.merge(s,i),s.class&&(t.addClass([e],s.class.split(" ")),delete s.class),t.attributes(e,s)}function g(e){for(var t={},i=e.attributes,s=0;s<i.length;s++)t[i[s].nodeName]=i[s].nodeValue;return t}function y(i,l,r,a,o,c){e.cssClass=L(D.moduleName);for(var h,d=i("ul",{className:e.cssClass.ul,attrs:{role:"presentation"}}),u=t.extend({},D,o),p=t.extend({},s.defaultMappedFields,a),m=t.compile(l),f=[],v=w(),I=0;I<r.length;I++){var g=n(r[I],p),y=r[I],b=y.isHeader;if(h="string"==typeof r[I]||"number"==typeof r[I]?y:g[p.value],u.itemCreating&&"function"==typeof u.itemCreating){C={dataSource:r,curData:y,text:h,options:u,fields:p};u.itemCreating(C)}u.itemCreating&&"function"==typeof u.itemCreating&&(g=n(r[I],p),h="string"==typeof r[I]||"number"==typeof r[I]?y:g[p.value]);var S=i("li",{id:v+"-"+I,className:b?e.cssClass.group:e.cssClass.li,attrs:{role:"presentation"}});if(b)"string"==typeof r[I]||"number"==typeof r[I]?S.innerText=y:S.innerText=g[p.text];else{var x=b?u.groupTemplateID:u.templateID;b?t.append(m(y,c,"headerTemplate",x,!!u.isStringTemplate),S):t.append(m(y,c,"template",x,!!u.isStringTemplate),S),S.setAttribute("data-value",t.isNullOrUndefined(h)?"null":h),S.setAttribute("role","option")}if(u.itemCreated&&"function"==typeof u.itemCreated){var C={dataSource:r,curData:y,text:h,item:S,options:u,fields:p};u.itemCreated(C)}f.push(S)}return t.append(f,d),d}function b(e,i,n,l,r,a){for(var o=t.compile(e),c=t.extend({},s.defaultMappedFields,n),h=t.extend({},D,r),d=c.groupBy,u=0,p=l;u<p.length;u++){var m=p[u],f={};f[d]=m.textContent,m.innerHTML="",t.append(o(f,a,"groupTemplate",h.groupTemplateID,!!h.isStringTemplate),m)}return l}function w(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function S(i,s,n,l,r,a,o){var h=s[n.child]||[],d=s[n.hasChildren];if(h.length&&(d=!0,a.classList.add(e.cssClass.hasChild),r.processSubChild)){var u=c(i,h,r,++o);a.appendChild(u)}r.expandCollapse&&d&&!r.template&&(a.firstElementChild.classList.add(e.cssClass.iconWrapper),("Left"===r.expandIconPosition?t.prepend:t.append)([i("div",{className:"e-icons "+r.expandIconClass})],a.querySelector("."+e.cssClass.textContent)))}function x(i,s,n,l,r,a,o,c,h,d){var u,p=t.extend({},D,d),m=t.extend({},k,p.ariaAttributes),f=s,v=s;"string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s&&(u=s,f="boolean"==typeof n[l.text]||"number"==typeof n[l.text]?n[l.text]:n[l.text]||"",v=n[l.value]);var g;g=t.isNullOrUndefined(u)||t.isNullOrUndefined(n[l.id])||""===n[l.id]?c+"-"+h:c;var y=i("li",{className:(!0===o?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(r)?"":r),id:g,attrs:""!==m.groupItemRole&&""!==m.itemRole?{role:!0===o?m.groupItemRole:m.itemRole}:{}});return u&&n.hasOwnProperty(l.enabled)&&"false"===n[l.enabled].toString()&&y.classList.add(e.cssClass.disabled),o?y.innerText=f:(y.setAttribute("data-value",t.isNullOrUndefined(v)?"null":v),y.setAttribute("role","option"),u&&n.hasOwnProperty(l.htmlAttributes)&&n[l.htmlAttributes]&&I(y,n[l.htmlAttributes]),a.length&&!p.itemNavigable&&t.append(a,y),u&&(n[l.url]||n[l.urlAttributes]&&n[l.urlAttributes].href)?y.appendChild(C(i,u,l,f,a,p.itemNavigable)):(a.length&&p.itemNavigable&&t.append(a,y),y.appendChild(document.createTextNode(f)))),y}function L(e){return{li:"e-"+e+"-item",ul:"e-"+e+"-parent e-ul",group:"e-"+e+"-group-item",icon:"e-"+e+"-icon",text:"e-"+e+"-text",check:"e-"+e+"-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-"+e+"-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-"+e+"-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"}}function C(i,s,l,r,a,o){var c=n(s,l),h={href:c[l.url]};c.hasOwnProperty(l.urlAttributes)&&c[l.urlAttributes]&&(t.merge(h,c[l.urlAttributes]),h.href=c[l.url]?c[l.url]:c[l.urlAttributes].href);var d;if(o){d=i("a",{className:e.cssClass.text+" "+e.cssClass.url});var u=i("div",{className:e.cssClass.anchorWrap});a&&a.length&&t.append(a,u),u.appendChild(document.createTextNode(r)),t.append([u],d)}else d=i("a",{className:e.cssClass.text+" "+e.cssClass.url,innerHTML:r});return I(d,h),d}function V(i,s,n,l,r,a,o){var c,h,d,u=t.extend({},D,a),p=t.extend({},k,u.ariaAttributes),m=s;"string"!=typeof s&&"number"!=typeof s&&(d=s,m=n[l.text]||"",c=t.isNullOrUndefined(n._id)?n[l.id]:n._id,h=!(!s.hasOwnProperty("isHeader")||!s.isHeader)),a&&a.enableHtmlSanitizer&&(m=m);var f=i("li",{className:(!0===h?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(r)?"":r),attrs:""!==p.groupItemRole&&""!==p.itemRole?{role:!0===h?p.groupItemRole:p.itemRole}:{}});!0==!t.isNullOrUndefined(c)?f.setAttribute("data-uid",c):f.setAttribute("data-uid",w());if(a&&a.removeBlazorID&&"object"==typeof s&&s.hasOwnProperty("BlazId")&&delete s.BlazId,h&&a&&a.groupTemplate){v=t.compile(a.groupTemplate);t.append(v(s,o,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate),f)}else if(!h&&a&&a.template){var v=t.compile(a.template);t.append(v(s,o,"template",u.templateID,!!u.isStringTemplate),f)}else{var I=i("div",{className:e.cssClass.textContent,attrs:""!==p.wrapperRole?{role:p.wrapperRole}:{}});if(d&&(n[l.url]||n[l.urlAttributes]&&n[l.urlAttributes].href))I.appendChild(C(i,d,l,m,null,u.itemNavigable));else{var g=i("span",{className:e.cssClass.text,attrs:""!==p.itemText?{role:p.itemText}:{}});a&&a.enableHtmlSanitizer?g.innerText=m:g.innerHTML=m,I.appendChild(g)}f.appendChild(I)}return f}function E(i,s,n,l){var r=t.extend({},D,l),a=t.extend({},k,r.ariaAttributes);e.cssClass=L(r.moduleName);var o=i("ul",{className:e.cssClass.ul+" "+(t.isNullOrUndefined(n)?"":n),attrs:""!==a.listRole?{role:a.listRole}:{}});return t.append(s,o),o}function O(i,s,n,l){var r=t.extend({},D,l);return e.cssClass=L(r.moduleName),("Left"===r.expandIconPosition?t.prepend:t.append)([i("div",{className:"e-icons "+r.expandIconClass+" "+(t.isNullOrUndefined(n)?"":n)})],s.querySelector("."+e.cssClass.textContent)),s}s.defaultMappedFields={id:"id",text:"text",url:"url",value:"value",isChecked:"isChecked",enabled:"enabled",expanded:"expanded",selected:"selected",iconCss:"iconCss",child:"child",isVisible:"isVisible",hasChildren:"hasChildren",tooltip:"tooltip",htmlAttributes:"htmlAttributes",urlAttributes:"urlAttributes",imageAttributes:"imageAttributes",imageUrl:"imageUrl",groupBy:null};var k={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"},D={showCheckBox:!1,showIcon:!1,enableHtmlSanitizer:!1,expandCollapse:!1,fields:s.defaultMappedFields,ariaAttributes:k,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,headerTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"Right",itemNavigable:!1};s.createList=l,s.createListFromArray=r,s.createListItemFromArray=a,s.createListItemFromJson=o,s.createListFromJson=c,s.getSiblingLI=h,s.indexOf=d,s.groupDataSource=u,s.addSorting=p,s.getDataSource=m,s.createJsonFromElement=f,s.renderContentTemplate=y,s.renderGroupTemplate=b,s.generateId=w,s.generateUL=E,s.generateIcon=O}(e.ListBase||(e.ListBase={}));var r=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),a=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},o={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},c={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},h={root:"e-listview",hover:"e-hover",selected:"e-active",focused:"e-focused",parentItem:"e-list-parent",listItem:"e-list-item",listIcon:"e-list-icon",textContent:"e-text-content",listItemText:"e-list-text",groupListItem:"e-list-group-item",hasChild:"e-has-child",view:"e-view",header:"e-list-header",headerText:"e-headertext",headerTemplateText:"e-headertemplate-text",text:"e-text",disable:"e-disabled",content:"e-content",icon:"e-icons",backIcon:"e-icon-back",checkboxWrapper:"e-checkbox-wrapper",checkbox:"e-checkbox",checked:"e-check",checklist:"e-checklist",checkboxIcon:"e-frame",checkboxRight:"e-checkbox-right",checkboxLeft:"e-checkbox-left",listviewCheckbox:"e-listview-checkbox",itemCheckList:"e-checklist",virtualElementContainer:"e-list-virtualcontainer"},d=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return r(i,e),a([t.Property("id")],i.prototype,"id",void 0),a([t.Property("text")],i.prototype,"text",void 0),a([t.Property("isChecked")],i.prototype,"isChecked",void 0),a([t.Property("isVisible")],i.prototype,"isVisible",void 0),a([t.Property("enabled")],i.prototype,"enabled",void 0),a([t.Property("iconCss")],i.prototype,"iconCss",void 0),a([t.Property("child")],i.prototype,"child",void 0),a([t.Property("tooltip")],i.prototype,"tooltip",void 0),a([t.Property("groupBy")],i.prototype,"groupBy",void 0),a([t.Property("text")],i.prototype,"sortBy",void 0),a([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),a([t.Property("tableName")],i.prototype,"tableName",void 0),i}(t.ChildProperty),u=function(l){function u(e,t){var i=l.call(this,e,t)||this;return i.itemReRender=!1,i.previousSelectedItems=[],i.hiddenItems=[],i.enabledItems=[],i.disabledItems=[],i}return r(u,l),u.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"htmlAttributes":this.setHTMLAttribute();break;case"cssClass":this.setCSSClass(i.cssClass);break;case"enable":this.setEnable();break;case"width":case"height":this.setSize();break;case"enableRtl":this.setEnableRTL();break;case"fields":this.listBaseOption.fields=this.fields.properties,this.enableVirtualization?this.isServerRendered&&t.isBlazor()||this.virtualizationModule.reRenderUiVirtualization():(t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization&&(this.itemReRender=!0),this.reRender());break;case"headerTitle":this.curDSLevel.length||this.header(this.headerTitle,!1,"header");break;case"query":this.enableVirtualization?t.isBlazor()&&this.isServerRendered||this.virtualizationModule.reRenderUiVirtualization():(t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization&&(this.itemReRender=!0),this.reRender());break;case"showHeader":this.header(this.headerTitle,!1,"header");break;case"enableVirtualization":t.isNullOrUndefined(this.contentContainer)||t.detach(this.contentContainer),this.refresh();break;case"showCheckBox":case"checkBoxPosition":t.isBlazor()&&this.isServerRendered||(this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.setCheckbox());break;case"dataSource":this.enableVirtualization?this.isServerRendered&&t.isBlazor()||this.virtualizationModule.reRenderUiVirtualization():(t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization&&(this.itemReRender=!0),this.reRender());break;case"sortOrder":case"template":this.enableVirtualization||this.isServerRendered&&t.isBlazor()||this.refresh();break;case"showIcon":t.isBlazor()&&this.isServerRendered?this.interopAdaptor.invokeMethodAsync("ItemSorting"):this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():(this.listBaseOption.showIcon=this.showIcon,this.curViewDS=this.getSubDS(),this.resetCurrentList())}},u.prototype.setHTMLAttribute=function(){Object.keys(this.htmlAttributes).length&&t.attributes(this.element,this.htmlAttributes)},u.prototype.setCSSClass=function(e){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ").filter(function(e){return e})),e&&t.removeClass([this.element],e.split(" ").filter(function(e){return e}))},u.prototype.setSize=function(){this.element.style.height=t.formatUnit(this.height),this.element.style.width=t.formatUnit(this.width),this.isWindow=!this.element.clientHeight},u.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},u.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},u.prototype.enableElement=function(e,t){t?e.classList.remove(h.disable):e.classList.add(h.disable)},u.prototype.header=function(e,i,s){if(t.isBlazor()&&this.isServerRendered){var n={HeaderText:e,BackButton:i};this.interopAdaptor.invokeMethodAsync("HeaderTitle",n)}else if(void 0===this.headerEle&&this.showHeader){this.enableHtmlSanitizer&&this.setProperties({headerTitle:t.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),this.headerEle=this.createElement("div",{className:h.header});var l=this.createElement("span",{className:h.headerText,innerHTML:this.headerTitle}),r=this.createElement("div",{className:h.text,innerHTML:l.outerHTML}),a=this.createElement("div",{className:h.icon+" "+h.backIcon+" e-but-back",attrs:{style:"display:none;"}});if(this.headerEle.appendChild(a),this.headerEle.appendChild(r),this.headerTemplate){var o=t.compile(this.headerTemplate),c=this.createElement("div",{className:h.headerTemplateText}),d=o({},this,s,this.LISTVIEW_HEADERTEMPLATE_ID,null,null,this.headerEle);d&&t.append(d,c),t.append([c],this.headerEle),this.updateBlazorTemplates(!1,!0,!0),this.isReact&&this.renderReactTemplates()}this.headerTemplate&&this.headerTitle&&r.classList.add("header"),this.element.classList.add("e-has-header"),t.prepend([this.headerEle],this.element)}else if(this.headerEle)if(this.showHeader){this.headerEle.style.display="";var r=this.headerEle.querySelector("."+h.headerText),a=this.headerEle.querySelector("."+h.backIcon);this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(e)),r.innerHTML=e,this.headerTemplate&&i&&(r.parentElement.classList.remove("header"),this.headerEle.querySelector("."+h.headerTemplateText).classList.add("nested-header")),this.headerTemplate&&!i&&(r.parentElement.classList.add("header"),this.headerEle.querySelector("."+h.headerTemplateText).classList.remove("nested-header"),this.headerEle.querySelector("."+h.headerTemplateText).classList.add("header")),a.style.display=!0===i?"":"none"}else this.headerEle.style.display="none"},u.prototype.switchView=function(e,t,i){var s=this;if(e&&t){var n=e.style.position,l="hidden"!==this.element.style.overflow?this.element.style.overflow:"";e.style.position="absolute",e.classList.add("e-view");var r=void 0,a=this.animation.duration;if(this.animation.effect)r=this.enableRtl?c[this.animation.effect]:o[this.animation.effect];else{r=o.SlideLeft,i=this.enableRtl,a=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===i?r[0]:r[1],duration:a,timingFunction:this.animation.easing,end:function(t){e.style.display="none",s.element.style.overflow=l,e.style.position=n,e.classList.remove("e-view")}}),t.style.display="",this.aniObj.animate(t,{name:!0===i?r[2]:r[3],duration:a,timingFunction:this.animation.easing,end:function(){s.trigger("actionComplete")}}),this.curUL=t}},u.prototype.preRender=function(){if(this.template)try{document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim())}catch(e){t.compile(this.template),this.isReact&&this.renderReactTemplates()}this.listBaseOption={template:this.template,headerTemplate:this.headerTemplate,groupTemplate:this.groupTemplate,expandCollapse:!0,listClass:"",ariaAttributes:{itemRole:"option",listRole:"presentation",itemText:"",groupItemRole:"group",wrapperRole:"presentation"},fields:this.fields.properties,sortOrder:this.sortOrder,showIcon:this.showIcon,itemCreated:this.renderCheckbox.bind(this),templateID:this.element.id+"Template",groupTemplateID:this.element.id+"GroupTemplate",enableHtmlSanitizer:this.enableHtmlSanitizer,removeBlazorID:!0},this.initialization()},u.prototype.updateLiElementHeight=function(){var e=this.element.querySelector("."+h.virtualElementContainer);e.children[0]&&(this.liElementHeight=e.children[0].getBoundingClientRect().height,this.interopAdaptor.invokeMethodAsync("LiElementHeight",this.liElementHeight))},u.prototype.initialization=function(){if(t.isBlazor()&&this.isServerRendered&&this.enableVirtualization){var e=this.element.querySelector("."+h.virtualElementContainer);null!==e&&(""===this.height&&(this.interopAdaptor.invokeMethodAsync("SetComponentHeight",window.innerHeight),this.isWindow=!0,e.scrollIntoView()),-1!==this.height.toString().indexOf("%")&&this.interopAdaptor.invokeMethodAsync("SetContainerHeight",this.element.getBoundingClientRect().height.toString()),e.children[0]&&(this.liElementHeight=e.children[0].getBoundingClientRect().height,this.interopAdaptor.invokeMethodAsync("LiElementHeight",this.liElementHeight)))}this.curDSLevel=[],this.animateOptions={},this.curViewDS=[],this.currentLiElements=[],this.isNestedList=!1,this.selectedData=[],this.selectedId=[],this.LISTVIEW_TEMPLATE_ID=this.element.id+"Template",this.LISTVIEW_GROUPTEMPLATE_ID=this.element.id+"GroupTemplate",this.LISTVIEW_HEADERTEMPLATE_ID=this.element.id+"HeaderTemplate",this.aniObj=new t.Animation(this.animateOptions),this.removeElement(this.curUL),this.removeElement(this.ulElement),this.removeElement(this.headerEle),this.removeElement(this.contentContainer),this.isReact&&this.clearTemplate(),this.curUL=this.ulElement=this.liCollection=this.headerEle=this.contentContainer=void 0},u.prototype.renderCheckbox=function(e){if(e.item.classList.contains(h.hasChild)&&(this.isNestedList=!0),this.showCheckBox&&this.isValidLI(e.item)){var t=void 0;(t=s.createCheckBox(this.createElement,!1,{checked:!1,enableRtl:this.enableRtl,cssClass:h.listviewCheckbox})).setAttribute("role","checkbox");var i=t.querySelector("."+h.checkboxIcon);e.item.classList.add(h.itemCheckList),e.item.firstElementChild.classList.add(h.checkbox),"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]?n(e.curData,this.listBaseOption.fields)[this.listBaseOption.fields.isChecked]&&this.checkInternally(e,t):"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]||-1===this.selectedData.indexOf(e.text)||this.checkInternally(e,t),t.setAttribute("aria-checked",i.classList.contains(h.checked)?"true":"false"),"Left"===this.checkBoxPosition?(t.classList.add(h.checkboxLeft),e.item.firstElementChild.classList.add(h.checkboxLeft),e.item.firstElementChild.insertBefore(t,e.item.firstElementChild.childNodes[0])):(t.classList.add(h.checkboxRight),e.item.firstElementChild.classList.add(h.checkboxRight),e.item.firstElementChild.appendChild(t)),this.currentLiElements.push(e.item),"Left"===this.checkBoxPosition?this.virtualCheckBox=e.item.firstElementChild.children[0]:this.virtualCheckBox=e.item.firstElementChild.lastElementChild}},u.prototype.checkInternally=function(e,t){e.item.classList.add(h.selected),e.item.setAttribute("aria-selected","true"),t.querySelector("."+h.checkboxIcon).classList.add(h.checked),t.setAttribute("aria-checked","true")},u.prototype.checkItem=function(e){this.toggleCheckBase(e,!0)},u.prototype.toggleCheckBase=function(e,i){if(this.showCheckBox){var s=e;if(e instanceof Object&&e.constructor!==HTMLLIElement&&(s=this.getLiFromObjOrElement(e)),!t.isNullOrUndefined(s)){var n=s.querySelector("."+h.checkboxIcon);!0===i?s.classList.add(h.selected):s.classList.remove(h.selected),s.setAttribute("aria-selected",i?"true":"false"),!0===i?n.classList.add(h.checked):n.classList.remove(h.checked),n.parentElement.setAttribute("aria-checked",i?"true":"false")}this.setSelectedItemData(s)}},u.prototype.uncheckItem=function(e){this.toggleCheckBase(e,!1)},u.prototype.checkAllItems=function(){this.toggleAllCheckBase(!0)},u.prototype.uncheckAllItems=function(){this.toggleAllCheckBase(!1)},u.prototype.toggleAllCheckBase=function(e){if(this.showCheckBox){for(var t=0;t<this.liCollection.length;t++){var i=this.liCollection[t].querySelector("."+h.checkboxIcon);i&&(e?i.classList.contains(h.checked)||this.checkItem(this.liCollection[t]):i.classList.contains(h.checked)&&this.uncheckItem(this.liCollection[t]))}this.enableVirtualization&&this.virtualizationModule.checkedItem(e)}},u.prototype.setCheckbox=function(){if(this.showCheckBox)for(var e=Array.prototype.slice.call(this.element.querySelectorAll("."+h.listItem)),t={item:void 0,curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:""},i=0;i<e.length;i++){var s=e[i];t.item=s,t.curData=this.getItemData(s),s.querySelector("."+h.checkboxWrapper)&&this.removeElement(s.querySelector("."+h.checkboxWrapper)),this.renderCheckbox(t),t.item.classList.contains(h.selected)&&this.checkInternally(t,t.item.querySelector("."+h.checkboxWrapper))}else{for(var e=Array.prototype.slice.call(this.element.querySelectorAll("."+h.itemCheckList)),i=0;i<e.length;i++)(s=e[i]).classList.remove(h.selected),s.firstElementChild.classList.remove(h.checkbox),this.removeElement(s.querySelector("."+h.checkboxWrapper));this.selectedItems&&this.selectedItems.item.classList.add(h.selected)}},u.prototype.refreshItemHeight=function(){this.virtualizationModule&&this.virtualizationModule.refreshItemHeight()},u.prototype.clickHandler=function(e){var i,s=e.target,n=s.classList;if(n.contains(h.backIcon)||n.contains(h.headerText))this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back();else{var l=t.closest(s.parentNode,"."+h.listItem);if(null===l&&(l=s),this.removeFocus(),this.enable&&this.showCheckBox&&this.isValidLI(l))if(e.target.classList.contains(h.checkboxIcon)){if(l.classList.add(h.focused),t.isNullOrUndefined(l.querySelector("."+h.checked))){var r={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:l};this.checkInternally(r,r.item.querySelector("."+h.checkboxWrapper))}else this.uncheckItem(l),l.classList.add(h.focused);if(this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(l,e),e){var a=this.selectEventData(l,e),o=l.querySelector("."+h.checkboxIcon);t.merge(a,{isChecked:o.classList.contains(h.checked)}),this.trigger("select",a)}}else l.classList.contains(h.hasChild)?(this.removeHover(),this.removeSelect(),this.removeSelect(l),this.setSelectLI(l,e),l.classList.remove(h.selected)):this.setCheckboxLI(l,e);else this.setSelectLI(l,e);i=t.closest(e.target,"li"),t.isNullOrUndefined(i)||i.classList.contains("e-has-child")&&!e.target.parentElement.classList.contains("e-listview-checkbox")&&i.classList.add(h.disable)}if(t.isBlazor()&&this.isServerRendered&&this.enableVirtualization){var c=this.element.querySelector("."+h.virtualElementContainer);if(c.querySelector(".e-active")){var d=c.querySelectorAll(".e-active");if(this.showCheckBox)for(var u=0;u<d.length;u++)this.previousSelectedItems.includes(d[u].getAttribute("data-uid"))||this.previousSelectedItems.push(d[u].getAttribute("data-uid"));else this.previousSelectedItems[0]=c.querySelector(".e-active").getAttribute("data-uid")}if(c.querySelector(".e-focused")){var p=c.querySelector(".e-focused");if(!p.classList.contains("e-active")){var m=p.getAttribute("data-uid");if(this.previousSelectedItems.includes(m)){var f=this.previousSelectedItems.slice(0,this.previousSelectedItems.indexOf(m)),v=this.previousSelectedItems.slice(this.previousSelectedItems.indexOf(m)+1,this.previousSelectedItems.length);this.previousSelectedItems=f.concat(v)}}}}},u.prototype.removeElement=function(e){return e&&e.parentNode&&e.parentNode.removeChild(e)},u.prototype.hoverHandler=function(e){var i=t.closest(e.target.parentNode,"."+h.listItem);this.setHoverLI(i)},u.prototype.leaveHandler=function(e){this.removeHover()},u.prototype.homeKeyHandler=function(e,t){if(Object.keys(this.dataSource).length&&this.curUL){this.selectedItems&&this.selectedItems.item.setAttribute("aria-selected","false");var i=this.curUL.querySelectorAll("."+h.listItem),s=this.curUL.querySelector("."+h.focused)||this.curUL.querySelector("."+h.selected);s&&(s.classList.remove(h.focused),this.showCheckBox||s.classList.remove(h.selected));var n=t?i.length-1:0;i[n].classList.contains(h.hasChild)||this.showCheckBox?i[n].classList.add(h.focused):this.setSelectLI(i[n],e),i[n]?this.element.setAttribute("aria-activedescendant",i[n].id.toString()):this.element.removeAttribute("aria-activedescendant")}},u.prototype.onArrowKeyDown=function(i,s){var n,l;return!t.isNullOrUndefined(this.curUL.querySelector("."+h.hasChild))||this.showCheckBox?(l=this.curUL.querySelector("."+h.focused)||this.curUL.querySelector("."+h.selected),n=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+h.listItem),l,s),t.isNullOrUndefined(n)||(l&&(l.classList.remove(h.focused),this.showCheckBox||l.classList.remove(h.selected)),n.classList.contains(h.hasChild)||this.showCheckBox?n.classList.add(h.focused):this.setSelectLI(n,i))):(l=this.curUL.querySelector("."+h.selected),n=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+h.listItem),l,s),this.setSelectLI(n,i)),n?this.element.setAttribute("aria-activedescendant",n.id.toString()):this.element.removeAttribute("aria-activedescendant"),n},u.prototype.arrowKeyHandler=function(e,t){var i=this;if(e.preventDefault(),Object.keys(this.dataSource).length&&this.curUL){var s=this.onArrowKeyDown(e,t),n=this.element.getBoundingClientRect().top,l=this.element.getBoundingClientRect().height,r=this.curUL.querySelector("."+h.listItem).getBoundingClientRect(),a=void 0,o=void 0;if(this.fields.groupBy&&(o=this.curUL.querySelector("."+h.groupListItem).getBoundingClientRect()),s){var c=s.getBoundingClientRect().top,d=s.getBoundingClientRect().height;if(t)(a=this.isWindow?c:c-n)<0&&(!0===this.isWindow?window.scroll(0,pageYOffset+a):this.element.scrollTop=this.element.scrollTop+a);else{var u=this.isWindow?window.innerHeight:l;(a=this.isWindow?c+d:c-n+d)>u&&(!0===this.isWindow?window.scroll(0,pageYOffset+(a-u)):this.element.scrollTop=this.element.scrollTop+(a-u))}}else if(this.enableVirtualization&&t&&this.virtualizationModule.uiFirstIndex)this.onUIScrolled=function(){i.onArrowKeyDown(e,t),i.onUIScrolled=void 0},a=this.virtualizationModule.listItemHeight,!0===this.isWindow?window.scroll(0,pageYOffset-a):this.element.scrollTop=this.element.scrollTop-a;else if(t)if(this.showHeader&&this.headerEle){var p=o?o.top:r.top,m=this.headerEle.getBoundingClientRect();a=m.top<0?m.height-p:0,!0===this.isWindow?window.scroll(0,pageYOffset-a):this.element.scrollTop=0}else this.fields.groupBy&&(a=this.isWindow?o.top<0?o.top:0:n-r.top+o.height,!0===this.isWindow?window.scroll(0,pageYOffset+a):this.element.scrollTop=this.element.scrollTop-a)}},u.prototype.enterKeyHandler=function(e){if(Object.keys(this.dataSource).length&&this.curUL){var i=!t.isNullOrUndefined(this.curUL.querySelector("."+h.hasChild)),s=this.curUL.querySelector("."+h.focused);i&&s&&(s.classList.remove(h.focused),this.showCheckBox&&(this.removeSelect(),this.removeSelect(s),this.removeHover()),this.setSelectLI(s,e))}},u.prototype.spaceKeyHandler=function(){if(this.enable&&this.showCheckBox&&Object.keys(this.dataSource).length&&this.curUL){var e=this.curUL.querySelector("."+h.focused);if(!t.isNullOrUndefined(e)&&t.isNullOrUndefined(e.querySelector("."+h.checked))){var i={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:e};this.checkInternally(i,i.item.querySelector("."+h.checkboxWrapper))}else this.uncheckItem(e)}},u.prototype.keyActionHandler=function(e){switch(e.keyCode){case 36:this.homeKeyHandler(e);break;case 35:this.homeKeyHandler(e,!0);break;case 40:this.arrowKeyHandler(e);break;case 38:this.arrowKeyHandler(e,!0);break;case 13:this.enterKeyHandler(e);break;case 8:this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back();break;case 32:this.spaceKeyHandler()}},u.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&e.velocity>.5&&"touchend"===e.originalEvent.type&&(this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back())},u.prototype.focusout=function(){if(Object.keys(this.dataSource).length&&this.curUL){var e=this.curUL.querySelector("."+h.focused),t=this.curUL.querySelector("[aria-selected = true]");e&&(e.classList.remove(h.focused),t&&!this.showCheckBox&&t.classList.add(h.selected))}},u.prototype.wireEvents=function(){t.EventHandler.add(this.element,"keydown",this.keyActionHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.element,"mouseout",this.leaveHandler,this),t.EventHandler.add(this.element,"focusout",this.focusout,this),this.touchModule=new t.Touch(this.element,{swipe:this.swipeActionHandler.bind(this)})},u.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),this.touchModule.destroy()},u.prototype.removeFocus=function(){for(var e=0,t=this.element.querySelectorAll("."+h.focused);e<t.length;e++)t[e].classList.remove(h.focused)},u.prototype.removeHover=function(){var e=this.element.querySelector("."+h.hover);e&&e.classList.remove(h.hover)},u.prototype.removeSelect=function(e){if(t.isNullOrUndefined(e))for(var i=0,s=this.element.querySelectorAll("."+h.selected);i<s.length;i++){var n=s[i];this.showCheckBox&&n.querySelector("."+h.checked)||(n.setAttribute("aria-selected","false"),n.classList.remove(h.selected))}else e.classList.remove(h.selected),e.setAttribute("aria-selected","false")},u.prototype.isValidLI=function(e){return e&&e.classList.contains(h.listItem)&&!e.classList.contains(h.groupListItem)&&!e.classList.contains(h.disable)},u.prototype.setCheckboxLI=function(e,i){if(this.isValidLI(e)&&this.enable&&this.showCheckBox){this.curUL.querySelector("."+h.focused)&&this.curUL.querySelector("."+h.focused).classList.remove(h.focused),e.classList.add(h.focused);var s=e.querySelector("."+h.checkboxWrapper),n=s.querySelector("."+h.checkboxIcon+"."+h.icon);this.removeHover(),n.classList.contains(h.checked)?(n.classList.remove(h.checked),e.classList.remove(h.selected),e.setAttribute("aria-selected","false")):(n.classList.add(h.checked),e.classList.add(h.selected),e.setAttribute("aria-selected","true")),s.setAttribute("aria-checked",n.classList.contains(h.checked)?"true":"false");var l=this.selectEventData(e,i);t.merge(l,{isChecked:n.classList.contains(h.checked)}),this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(e,i),this.trigger("select",l),this.setSelectedItemData(e),this.renderSubList(e)}},u.prototype.selectEventData=function(e,i){var s,l=this.getItemData(e),r=n(l,this.listBaseOption.fields);s=!t.isNullOrUndefined(l)&&"string"==typeof this.dataSource[0]||"number"==typeof this.dataSource[0]?{item:e,text:e&&e.innerText.trim(),data:this.dataSource}:{item:e,text:r&&r[this.listBaseOption.fields.text],data:l};var a={};return t.merge(a,s),i&&t.merge(a,{isInteracted:!0,event:i,index:this.curUL&&Array.prototype.indexOf.call(this.curUL.children,e)}),a},u.prototype.setSelectedItemData=function(e){var i=this.getItemData(e),s=n(i,this.listBaseOption.fields);t.isNullOrUndefined(i)||"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]?this.selectedItems={item:e,text:s&&s[this.listBaseOption.fields.text],data:i}:this.selectedItems={item:e,text:e&&e.innerText.trim(),data:this.dataSource}},u.prototype.setSelectLI=function(e,t){if(this.isValidLI(e)&&!e.classList.contains(h.selected)&&this.enable){this.showCheckBox||this.removeSelect(),e.classList.add(h.selected),e.setAttribute("aria-selected","true"),this.removeHover(),this.setSelectedItemData(e),this.enableVirtualization&&this.virtualizationModule.setSelectLI(e,t);var i=this.selectEventData(e,t);this.trigger("select",i),this.selectedLI=e,this.renderSubList(e)}},u.prototype.setHoverLI=function(e){if(this.isValidLI(e)&&!e.classList.contains(h.hover)&&this.enable){var i=this.element.querySelectorAll("."+h.hover);i&&i.length&&t.removeClass(i,h.hover),e.classList.contains(h.selected)&&!this.showCheckBox||e.classList.add(h.hover)}},u.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,s=e;i<s.length;i++){var l=s[i],r={};r[this.fields.id]=l,this.curDSJSON=this.findItemFromDS(t,r);var a=n(this.curDSJSON,this.listBaseOption.fields);t=this.curDSJSON?a[this.fields.child]:t}return t}return this.localData},u.prototype.getItemData=function(e){var s,n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource,l=this.getElementUID(e);return s=t.isNullOrUndefined(this.element.querySelector("."+h.hasChild))&&this.fields.groupBy?this.curViewDS:n,this.findItemFromDS(s,l)},u.prototype.findItemFromDS=function(e,i,s){var l,r=this;return e&&e.length&&i?e.some(function(a){var o=n(a,r.listBaseOption.fields);if(!i[r.fields.id]&&!i[r.fields.text]||i[r.fields.id]&&(!t.isNullOrUndefined(o[r.fields.id])&&o[r.fields.id].toString())!==i[r.fields.id].toString()||i[r.fields.text]&&o[r.fields.text]!==i[r.fields.text])if("object"!=typeof a&&-1!==e.indexOf(a))l=s?e:a;else if(!t.isNullOrUndefined(i[r.fields.id])&&t.isNullOrUndefined(o[r.fields.id])){var c=r.element.querySelector('[data-uid="'+i[r.fields.id]+'"]');c&&c.innerText.trim()===o[r.fields.text]&&(l=a)}else o.hasOwnProperty(r.fields.child)&&o[r.fields.child].length&&(l=r.findItemFromDS(o[r.fields.child],i,s));else l=s?e:a;return!!l}):l=e,l},u.prototype.getQuery=function(){var t=[],s=this.query?this.query:new i.Query;if(!this.query){for(var n=0,l=Object.keys(this.fields.properties);n<l.length;n++){var r=l[n];"tableName"!==r&&this.fields[r]&&this.fields[r]!==e.ListBase.defaultMappedFields[r]&&-1===t.indexOf(this.fields[r])&&t.push(this.fields[r])}s.select(t),this.fields.properties.hasOwnProperty("tableName")&&s.from(this.fields.tableName)}return s},u.prototype.setViewDataSource=function(t){void 0===t&&(t=this.localData),t&&this.fields.groupBy?"None"!==this.sortOrder?this.curViewDS=e.ListBase.groupDataSource(e.ListBase.getDataSource(t,e.ListBase.addSorting(this.sortOrder,this.fields.sortBy)),this.listBaseOption.fields,this.sortOrder):this.curViewDS=e.ListBase.groupDataSource(t,this.listBaseOption.fields,this.sortOrder):t&&"None"!==this.sortOrder?this.curViewDS=e.ListBase.getDataSource(t,e.ListBase.addSorting(this.sortOrder,this.fields.sortBy)):this.curViewDS=t},u.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},u.prototype.setLocalData=function(){var s=this;this.trigger("actionBegin");var n=this;if(this.dataSource instanceof i.DataManager)this.dataSource.executeQuery(this.getQuery()).then(function(e){s.isDestroyed||(s.localData=e.result,s.isServerRendered&&t.isBlazor()||(n.removeElement(n.contentContainer),s.isReact&&s.clearTemplate()),s.renderList(),s.trigger("actionComplete",e))}).catch(function(e){s.isDestroyed||s.trigger("actionFailure",e)});else if(this.dataSource&&this.dataSource.length)this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData});else{var l=this.element.querySelector("ul");l&&(t.remove(l),this.setProperties({dataSource:e.ListBase.createJsonFromElement(l)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))}},u.prototype.reRender=function(){t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization||(this.resetBlazorTemplates(),this.removeElement(this.headerEle),this.removeElement(this.ulElement),this.removeElement(this.contentContainer),this.isReact&&this.clearTemplate(),-1===Object.keys(window).indexOf("ejsInterop")&&(this.element.innerHTML=""),this.headerEle=this.ulElement=this.liCollection=void 0,this.header()),this.setLocalData()},u.prototype.resetCurrentList=function(){this.resetBlazorTemplates(),this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},u.prototype.setAttributes=function(e){for(var t=0;t<e.length;t++){var i=e[t];i.classList.contains("e-list-item")&&(i.setAttribute("id",this.element.id+"_"+i.getAttribute("data-uid")),i.setAttribute("aria-selected","false"),i.setAttribute("tabindex","-1"))}},u.prototype.createList=function(){this.currentLiElements=[],this.isNestedList=!1,this.ulElement=this.curUL=e.ListBase.createList(this.createElement,this.curViewDS,this.listBaseOption,null,this),this.liCollection=this.curUL.querySelectorAll("."+h.listItem),this.setAttributes(this.liCollection),this.updateBlazorTemplates(!0)},u.prototype.resetBlazorTemplates=function(){var e=t.blazorTemplates;this.template&&(e[this.LISTVIEW_TEMPLATE_ID]=[],t.resetBlazorTemplate(this.LISTVIEW_TEMPLATE_ID,"Template")),this.groupTemplate&&(e[this.LISTVIEW_GROUPTEMPLATE_ID]=[],t.resetBlazorTemplate(this.LISTVIEW_GROUPTEMPLATE_ID,"GroupTemplate")),this.headerTemplate&&t.resetBlazorTemplate(this.LISTVIEW_HEADERTEMPLATE_ID,"HeaderTemplate")},u.prototype.updateBlazorTemplates=function(e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=!1),this.template&&e&&!this.enableVirtualization&&t.updateBlazorTemplate(this.LISTVIEW_TEMPLATE_ID,"Template",this,s),this.groupTemplate&&e&&!this.enableVirtualization&&t.updateBlazorTemplate(this.LISTVIEW_GROUPTEMPLATE_ID,"GroupTemplate",this,s),this.headerTemplate&&i&&t.updateBlazorTemplate(this.LISTVIEW_HEADERTEMPLATE_ID,"HeaderTemplate",this,s)},u.prototype.exceptionEvent=function(e){this.trigger("actionFailure",e)},u.prototype.UpdateCurrentUL=function(){this.ulElement=this.curUL=this.element.querySelector("."+h.parentItem),this.curUL&&(this.liCollection=this.curUL.querySelectorAll("."+h.listItem))},u.prototype.removeActiveClass=function(){var e=this;setTimeout(function(){for(var t=e.element.querySelector("."+h.virtualElementContainer),i=0;i<t.childElementCount;i++){var s=t.children[i],n=void 0,l=void 0;if(e.showCheckBox)if(e.previousSelectedItems.length>0)for(var r=0;r<e.previousSelectedItems.length;r++)s.getAttribute("data-uid")===e.previousSelectedItems[r]?(s.classList.add("e-active"),s.setAttribute("aria-selected","true"),s.querySelector(".e-frame.e-icons")&&s.querySelector(".e-frame.e-icons").classList.add("e-check"),n=i):n!==i&&(s.classList.remove("e-active"),s.removeAttribute("aria-selected"),s.querySelector(".e-check")&&s.querySelector(".e-check").classList.remove("e-check"));else s.classList.remove("e-active"),s.removeAttribute("aria-selected"),s.querySelector(".e-check")&&s.querySelector(".e-check").classList.remove("e-check");else s.getAttribute("data-uid")===e.previousSelectedItems[0]?(s.classList.add("e-active"),s.setAttribute("aria-selected","true")):(s.classList.remove("e-active"),s.removeAttribute("aria-selected"));if(e.hiddenItems.length>0)for(var a=0;a<e.hiddenItems.length;a++)s.getAttribute("data-uid")===e.previousSelectedItems[a]?(s.style.display="none",l=i):l!==i&&(s.style.display=null);if(e.enabledItems.length>0)for(var o=0;o<e.enabledItems.length;o++)s.getAttribute("data-uid")===e.enabledItems[o]&&s.classList.contains("e-disabled")&&s.classList.remove("e-disabled");if(e.disabledItems.length>0)for(var c=0;c<e.disabledItems.length;c++)s.getAttribute("data-uid")===e.disabledItems[c]&&(s.classList.contains("e-disabled")||s.classList.add("e-disabled"))}},200)},u.prototype.renderingNestedList=function(){var e=t.closest(this.liElement.parentNode,"."+h.parentItem),i=this.element.id,s=document.getElementById(i),n=s.getElementsByTagName("UL")[s.getElementsByTagName("UL").length-1];this.switchView(e,n),this.liElement=null},u.prototype.renderSubList=function(i){this.liElement=i;var s=i.getAttribute("data-uid");if(i.classList.contains(h.hasChild)&&s){var l=t.closest(i.parentNode,"."+h.parentItem),r=this.element.querySelector("[pid='"+s+"']");if(this.curDSLevel.push(s),this.setViewDataSource(this.getSubDS()),!r){var a=this.curViewDS;if(t.isBlazor()&&this.isServerRendered)this.interopAdaptor.invokeMethodAsync("ListChildDataSource",a);else{r=e.ListBase.createListFromJson(this.createElement,a,this.listBaseOption,this.curDSLevel.length,null,this),this.isReact&&this.renderReactTemplates();var o=r.querySelectorAll("."+h.listItem);this.setAttributes(o),r.setAttribute("pID",s),r.style.display="none",this.renderIntoDom(r),this.updateBlazorTemplates(!0)}}if(t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization||this.switchView(l,r),this.liCollection=this.curUL.querySelectorAll("."+h.listItem),this.selectedItems){var c=n(this.selectedItems.data,this.listBaseOption.fields);this.header(c[this.listBaseOption.fields.text],!0,"header")}this.selectedLI=void 0}},u.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},u.prototype.renderList=function(e){this.setViewDataSource(e),t.isBlazor()&&this.isServerRendered&&!this.enableVirtualization||(this.enableVirtualization?(Object.keys(this.dataSource).length&&(t.isBlazor()&&this.isServerRendered||!this.template&&!this.groupTemplate||this.virtualizationModule.isNgTemplate()||(this.listBaseOption.template=null,this.listBaseOption.groupTemplate=null,this.listBaseOption.itemCreated=this.virtualizationModule.createUIItem.bind(this.virtualizationModule))),this.virtualizationModule.uiVirtualization()):(this.createList(),this.contentContainer=this.createElement("div",{className:h.content}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement),this.isReact&&this.renderReactTemplates()))},u.prototype.getElementUID=function(e){var t={};return e instanceof Element?t[this.fields.id]=e.getAttribute("data-uid"):t=e,t},u.prototype.render=function(){t.isBlazor()&&this.isServerRendered?this.initBlazor(!0):(this.element.classList.add(h.root),t.attributes(this.element,{role:"list",tabindex:"0"}),this.setCSSClass(),this.setEnableRTL(),this.setEnable(),this.setSize(),this.wireEvents(),this.header(),this.setLocalData(),this.setHTMLAttribute(),this.isReact&&this.renderReactTemplates()),this.rippleFn=t.rippleEffect(this.element,{selector:"."+h.listItem}),this.renderComplete()},u.prototype.initBlazor=function(e){null===e&&(e=!1),this.setLocalData(),this.setViewDataSource(this.localData),this.contentContainer=this.element.querySelector("."+h.content),e&&this.wireEvents()},u.prototype.destroy=function(){this.resetBlazorTemplates(),this.isReact&&this.clearTemplate(),this.unWireEvents();var e=[h.root,h.disable,"e-rtl","e-has-header","e-lib"].concat(this.cssClass.split(" ").filter(function(e){return e}));t.removeClass([this.element],e),this.element.removeAttribute("role"),this.element.removeAttribute("tabindex"),this.curUL=this.ulElement=this.liCollection=this.headerEle=void 0,t.isBlazor()&&this.isServerRendered?this.element.style.display="none":(this.element.innerHTML="",l.prototype.destroy.call(this))},u.prototype.back=function(){var e=this.curDSLevel[this.curDSLevel.length-1];if(void 0!==e&&!this.isInAnimation()){this.curDSLevel.pop(),this.setViewDataSource(this.getSubDS());var i=this.element.querySelector("[data-uid='"+e+"']"),s=this.curUL;i?i=t.isBlazor()&&this.isServerRendered&&this.enableVirtualization?i.parentElement.parentElement.parentElement:i.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),i=this.curUL);var l=n(this.curDSJSON,this.listBaseOption.fields)[this.fields.text];this.switchView(s,i,!0),this.removeFocus();var r=this.element.querySelector("[data-uid='"+e+"']");r.classList.remove(h.disable),r.classList.add(h.focused),this.showCheckBox&&r.querySelector("."+h.checkboxIcon).classList.contains(h.checked)?r.setAttribute("aria-selected","true"):(r.classList.remove(h.selected),r.setAttribute("aria-selected","false")),this.liCollection=this.curUL.querySelectorAll("."+h.listItem),this.enableHtmlSanitizer&&this.setProperties({headerTitle:t.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),this.header(this.curDSLevel.length?l:this.headerTitle,!!this.curDSLevel.length,"header")}},u.prototype.selectItem=function(e){this.enableVirtualization?this.virtualizationModule.selectItem(e):this.showCheckBox?this.setCheckboxLI(this.getLiFromObjOrElement(e)):!0===t.isNullOrUndefined(e)?this.removeSelect():this.setSelectLI(this.getLiFromObjOrElement(e))},u.prototype.getLiFromObjOrElement=function(e){var s,l=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;if(!t.isNullOrUndefined(e))if("string"==typeof l[0]||"number"==typeof l[0])if(e instanceof Element){for(var r=e.getAttribute("data-uid").toString(),a=0;a<this.liCollection.length;a++)if(this.liCollection[a].getAttribute("data-uid").toString()===r){s=this.liCollection[a];break}}else Array.prototype.some.call(this.curUL.querySelectorAll("."+h.listItem),function(t){return t.innerText.trim()===e.toString()&&(s=t,!0)});else{var o=this.getItemData(e),c=n(o,this.listBaseOption.fields);if(o&&(s=this.element.querySelector('[data-uid="'+c[this.fields.id]+'"]'),!this.enableVirtualization&&t.isNullOrUndefined(s)))for(var d=this.element.querySelectorAll("."+h.listItem),a=0;a<d.length;a++)d[a].innerText.trim()===c[this.fields.text]&&(s=d[a])}return s},u.prototype.selectMultipleItems=function(e){if(!t.isNullOrUndefined(e))for(var i=0;i<e.length;i++)t.isNullOrUndefined(e[i])||this.selectItem(e[i])},u.prototype.getParentId=function(){var e=[];if(this.isNestedList)for(var t=this.curDSLevel.length-1;t>=0;t--)e.push(this.curDSLevel[t]);return e},u.prototype.getSelectedItems=function(){var e,s=!1;this.selectedId=[];var l=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;if(this.enableVirtualization&&!s)e=this.virtualizationModule.getSelectedItems(),s=!0;else if(this.showCheckBox&&!s){var r=this.curUL.getElementsByClassName(h.selected),a=[],o=[];this.selectedId=[];for(var c=[],d=0;d<r.length;d++)if("string"==typeof l[0]||"number"==typeof l[0])a.push(r[d].innerText.trim());else{var u=this.getItemData(r[d]),p=n(u,this.listBaseOption.fields);this.isNestedList?c.push({data:u,parentId:this.getParentId()}):o.push(u),p?(a.push(p[this.listBaseOption.fields.text]),this.selectedId.push(p[this.listBaseOption.fields.id])):(a.push(void 0),this.selectedId.push(void 0))}"string"!=typeof l[0]&&"number"!=typeof l[0]||s||(e={item:r,data:l,text:a},s=!0),this.isNestedList&&!s?(e={item:r,data:c,text:a},s=!0):s||(e={item:r,data:o,text:a},s=!0)}else if(!s){var m=this.element.getElementsByClassName(h.selected)[0],p=n(this.getItemData(m),this.listBaseOption.fields);"string"!=typeof l[0]&&"number"!=typeof l[0]||s?s||(t.isNullOrUndefined(p)||t.isNullOrUndefined(m)?(e=void 0,s=!0):(this.selectedId.push(p[this.listBaseOption.fields.id]),e={text:p[this.listBaseOption.fields.text],item:m,data:this.getItemData(m)},s=!0)):(e=t.isNullOrUndefined(m)?void 0:{item:m,data:l,text:m.innerText.trim()},s=!0)}return t.isBlazor()?this.blazorGetSelectedItems(e):e},u.prototype.blazorGetSelectedItems=function(e){var i={data:[],index:[],parentId:[],text:[]};if(!t.isNullOrUndefined(e)){if(!t.isNullOrUndefined(e.data))if(this.showCheckBox&&this.isNestedList){for(var s=0;s<e.data.length;s++)i.data.push(e.data[s].data);t.isNullOrUndefined(e.data[0])||t.isNullOrUndefined(e.data[0].parentId)||(i.parentId=e.data[0].parentId)}else i.data=this.convertItemsToArray(e.data);t.isNullOrUndefined(e.text)||(i.text=this.convertItemsToArray(e.text)),t.isNullOrUndefined(e.index)||(i.index=this.convertItemsToArray(e.index))}return i},u.prototype.convertItemsToArray=function(e){return Array.isArray(e)?e.slice():[e]},u.prototype.findItem=function(e){return this.getItemData(e)},u.prototype.enableItem=function(e){this.setItemState(e,!0),this.enableVirtualization&&this.virtualizationModule.enableItem(e)},u.prototype.disableItem=function(e){this.setItemState(e,!1),this.enableVirtualization&&this.virtualizationModule.disableItem(e)},u.prototype.setItemState=function(e,t){var i=this.getItemData(e),s=n(i,this.listBaseOption.fields);if(i){var l=this.element.querySelector('[data-uid="'+s[this.fields.id]+'"]');t?(l&&l.classList.remove(h.disable),delete i[this.fields.enabled]):t||(l&&l.classList.add(h.disable),i[this.fields.enabled]=!1)}},u.prototype.showItem=function(e){this.showHideItem(e,!1,""),this.enableVirtualization&&this.virtualizationModule.showItem(e)},u.prototype.hideItem=function(e){this.showHideItem(e,!0,"none"),this.enableVirtualization&&this.virtualizationModule.hideItem(e)},u.prototype.showHideItem=function(e,t,i){var s=this.getItemData(e),l=n(s,this.listBaseOption.fields);if(s){var r=this.element.querySelector('[data-uid="'+l[this.fields.id]+'"]');r&&(r.style.display=i),t?s[this.fields.isVisible]=!1:delete s[this.fields.isVisible]}},u.prototype.addItem=function(e,t){void 0===t&&(t=void 0);var s=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;this.addItemInternally(e,t,s)},u.prototype.addItemInternally=function(e,t,i){if(e instanceof Array)if(this.enableVirtualization)this.virtualizationModule.addItem(e,t,i);else{var s=this.findItemFromDS(i,t),l=void 0;if(s&&((l=n(s,this.listBaseOption.fields)[this.fields.child])||(l=[]),l=l.concat(e)),s instanceof Array){for(var r=0;r<e.length;r++){i.push(e[r]),this.setViewDataSource(i);var a=this.contentContainer?this.contentContainer.children[0]:null;this.contentContainer&&a?this.addItemIntoDom(e[r],a,this.curViewDS):this.reRender()}this.curUL&&this.updateBlazorTemplates(!0),this.liCollection=this.curUL.querySelectorAll("."+h.listItem)}else s&&(s[this.fields.child]=l,this.addItemInNestedList(s,e))}},u.prototype.addItemInNestedList=function(i,s){var n=i[this.fields.id],l=i[this.fields.child],r=this.element.querySelector("[pid='"+n+"']"),a=this.element.querySelector("[data-uid='"+n+"']"),o=r||(a?t.closest(a,"ul"):null),c=r?l:[i],d=!1;if(!!a&&!a.classList.contains(h.hasChild)){var u=e.ListBase.createListItemFromJson(this.createElement,c,this.listBaseOption,null,null,this);this.setAttributes(u),o.insertBefore(u[0],a),t.detach(a),d=!0}if(r&&s){for(var p=0;p<s.length;p++)c.push(s[p]),this.addItemIntoDom(s[p],o,c);d=!0}d&&this.updateBlazorTemplates(!0)},u.prototype.addItemIntoDom=function(e,t,i){var s=i.indexOf(e);this.addListItem(e,s,t,i);var n=i[s-1];n&&n.isHeader&&1===n.items.length&&this.addListItem(n,s-1,t,i)},u.prototype.addListItem=function(t,i,s,n){var l=this.getLiFromObjOrElement(n[i+1])||this.getLiFromObjOrElement(n[i+2])||null,r=e.ListBase.createListItemFromJson(this.createElement,[t],this.listBaseOption,null,null,this);this.setAttributes(r),this.template&&this.isReact&&this.renderReactTemplates(),s.insertBefore(r[0],l)},u.prototype.removeItem=function(e){var t=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;this.enableVirtualization?this.virtualizationModule.removeItem(e):(this.removeItemFromList(e,t),this.updateBlazorTemplates(!0))},u.prototype.removeItemFromList=function(i,s){var n,l=this,r=this.curViewDS,a=i instanceof Element?this.getElementUID(i):i;if(n=this.findItemFromDS(s,a,!0)){var o;o=this.findItemFromDS(n,a);var c=r.indexOf(o),d=this.getLiFromObjOrElement(i),u=void 0;this.validateNestedView(d),this.fields.groupBy&&this.curViewDS[c-1]&&r[c-1].isHeader&&1===r[c-1].items.length&&d&&d.previousElementSibling.classList.contains(h.groupListItem)&&(t.isNullOrUndefined(d.nextElementSibling)||d.nextElementSibling&&d.nextElementSibling.classList.contains(h.groupListItem))&&(u=d.previousElementSibling),d&&t.detach(d),u&&t.detach(u);var p=n.length-1<=0?this.findParent(this.localData,this.fields.id,function(e){return e===o[l.fields.id]},null):null,m=n.indexOf(o);if(n.splice(m,1),this.setViewDataSource(s),p&&p.parent&&Array.isArray(p.parent[this.fields.child])&&p.parent[this.fields.child].length<=0){var f=this.getLiFromObjOrElement(p.parent);if(f){var v=e.ListBase.createListItemFromJson(this.createElement,[p.parent],this.listBaseOption,null,null,this);this.setAttributes(v),f.parentElement.insertBefore(v[0],f),f.parentElement.removeChild(f)}}n.length<=0&&this.back(),this.liCollection=Array.prototype.slice.call(this.element.querySelectorAll("."+h.listItem))}},u.prototype.validateNestedView=function(e){var t=e?e.getAttribute("data-uid").toString().toLowerCase():null;if(t&&this.curDSLevel&&this.curDSLevel.length>0)for(;this.curDSLevel.some(function(e){return e.toString().toLowerCase()===t});)this.back()},u.prototype.removeMultipleItems=function(e){if(e.length){for(var t=0;t<e.length;t++)this.removeItem(e[t]);this.updateBlazorTemplates(!0)}},u.prototype.findParent=function(e,i,s,n){if(e.hasOwnProperty(i)&&!0===s(e[i]))return t.extend({},e);for(var l=0;l<Object.keys(e).length;l++)if(e[Object.keys(e)[l]]&&"object"==typeof e[Object.keys(e)[l]]){var r=this.findParent(e[Object.keys(e)[l]],i,s,e);if(null!=r)return r.parent||(r.parent=n),r}return null},u.prototype.getModuleName=function(){return"listview"},u.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"virtualization"}),e},u.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width","showCheckBox","checkBoxPosition"])},a([t.Property("")],u.prototype,"cssClass",void 0),a([t.Property(!1)],u.prototype,"enableVirtualization",void 0),a([t.Property({})],u.prototype,"htmlAttributes",void 0),a([t.Property(!0)],u.prototype,"enable",void 0),a([t.Property([])],u.prototype,"dataSource",void 0),a([t.Property()],u.prototype,"query",void 0),a([t.Complex(e.ListBase.defaultMappedFields,d)],u.prototype,"fields",void 0),a([t.Property({effect:"SlideLeft",duration:400,easing:"ease"})],u.prototype,"animation",void 0),a([t.Property("None")],u.prototype,"sortOrder",void 0),a([t.Property(!1)],u.prototype,"showIcon",void 0),a([t.Property(!1)],u.prototype,"showCheckBox",void 0),a([t.Property("Left")],u.prototype,"checkBoxPosition",void 0),a([t.Property("")],u.prototype,"headerTitle",void 0),a([t.Property(!1)],u.prototype,"showHeader",void 0),a([t.Property(!1)],u.prototype,"enableHtmlSanitizer",void 0),a([t.Property("")],u.prototype,"height",void 0),a([t.Property("")],u.prototype,"width",void 0),a([t.Property(null)],u.prototype,"template",void 0),a([t.Property(null)],u.prototype,"headerTemplate",void 0),a([t.Property(null)],u.prototype,"groupTemplate",void 0),a([t.Event()],u.prototype,"select",void 0),a([t.Event()],u.prototype,"actionBegin",void 0),a([t.Event()],u.prototype,"actionComplete",void 0),a([t.Event()],u.prototype,"actionFailure",void 0),u=a([t.NotifyPropertyChanges],u)}(t.Component),p=function(){function s(e){this.elementDifference=0,this.listViewInstance=e}return s.prototype.isNgTemplate=function(){return!t.isNullOrUndefined(this.listViewInstance.templateRef)&&"string"!=typeof this.listViewInstance.templateRef},s.prototype.uiVirtualization=function(){this.wireScrollEvent(!1);var i=this.listViewInstance.curViewDS,s=i.slice(0,1);t.isBlazor()||this.listViewInstance.isServerRendered||(this.listViewInstance.ulElement=this.listViewInstance.curUL=e.ListBase.createList(this.listViewInstance.createElement,s,this.listViewInstance.listBaseOption,null,this),this.listViewInstance.contentContainer=this.listViewInstance.createElement("div",{className:h.content}),this.listViewInstance.element.appendChild(this.listViewInstance.contentContainer),this.listViewInstance.contentContainer.appendChild(this.listViewInstance.ulElement)),this.listItemHeight=this.listViewInstance.ulElement.firstElementChild.getBoundingClientRect().height,this.expectedDomItemCount=this.ValidateItemCount(1e4),this.domItemCount=this.ValidateItemCount(Object.keys(this.listViewInstance.curViewDS).length),this.uiFirstIndex=0,this.uiLastIndex=this.domItemCount-1;var n=i.slice(1,this.domItemCount);if(t.isBlazor()||this.listViewInstance.isServerRendered)this.listViewInstance.contentContainer=this.listViewInstance.element.querySelector(".e-content"),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li");else{var l=e.ListBase.createListItemFromJson(this.listViewInstance.createElement,n,this.listViewInstance.listBaseOption,null,null,this);t.append(l,this.listViewInstance.ulElement),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li"),this.topElement=this.listViewInstance.createElement("div"),this.listViewInstance.ulElement.insertBefore(this.topElement,this.listViewInstance.ulElement.firstElementChild),this.bottomElement=this.listViewInstance.createElement("div"),this.listViewInstance.ulElement.insertBefore(this.bottomElement,null),this.totalHeight=Object.keys(i).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.topElement.style.height="0px",this.bottomElement.style.height=this.totalHeight+"px",this.topElementHeight=0,this.bottomElementHeight=this.totalHeight}this.listDiff=0,this.uiIndicesInitialization()},s.prototype.wireScrollEvent=function(e){e?!0===this.listViewInstance.isWindow?(window.removeEventListener("scroll",this.onVirtualScroll),window.removeEventListener("scroll",this.updateUl)):(t.EventHandler.remove(this.listViewInstance.element,"scroll",this.onVirtualUiScroll),t.EventHandler.remove(this.listViewInstance.element,"scroll",this.updateUlContainer)):t.isBlazor()&&this.listViewInstance.isServerRendered?this.listViewInstance.isWindow?(this.onVirtualScroll=t.debounce(this.onVirtualUiScroll.bind(this),350),this.updateUl=this.updateUlContainer.bind(this),window.addEventListener("scroll",this.onVirtualScroll),window.addEventListener("scroll",this.updateUl)):(t.EventHandler.add(this.listViewInstance.element,"scroll",t.debounce(this.onVirtualUiScroll,350),this),t.EventHandler.add(this.listViewInstance.element,"scroll",this.updateUlContainer,this)):this.listViewInstance.isWindow?(this.onVirtualScroll=this.onVirtualUiScroll.bind(this),window.addEventListener("scroll",this.onVirtualScroll)):t.EventHandler.add(this.listViewInstance.element,"scroll",this.onVirtualUiScroll,this)},s.prototype.updateUlContainer=function(e){var i,s=this.listViewInstance.ulElement.querySelector("."+h.virtualElementContainer);t.isNullOrUndefined(this.listViewInstance.liElementHeight)&&this.listViewInstance.updateLiElementHeight(),((i=this.listViewInstance.isWindow?Math.round(e.target.documentElement.scrollTop/this.listViewInstance.liElementHeight)-2:Math.round(e.target.scrollTop/this.listViewInstance.liElementHeight)-2)-1)*this.listViewInstance.liElementHeight<0?s.style.top="0px":s.style.top=i*this.listViewInstance.liElementHeight+"px"},s.prototype.ValidateItemCount=function(e){var i,s=parseFloat(t.formatUnit(this.listViewInstance.height));return(i=this.listViewInstance.isWindow?Math.round(window.innerHeight/this.listItemHeight*3):"string"==typeof this.listViewInstance.height&&-1!==this.listViewInstance.height.indexOf("%")?Math.round(this.listViewInstance.element.getBoundingClientRect().height/this.listItemHeight*1.5):Math.round(s/this.listItemHeight*1.5))>e&&(i=e),i},s.prototype.uiIndicesInitialization=function(){this.uiIndices={activeIndices:[],disabledItemIndices:[],hiddenItemIndices:[]};for(var e=this.listViewInstance.curViewDS,i=0;i<e.length;i++)this.listViewInstance.showCheckBox&&e[i][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(i),t.isNullOrUndefined(e[i][this.listViewInstance.fields.enabled])||e[i][this.listViewInstance.fields.enabled]||this.uiIndices.disabledItemIndices.push(i);if(this.isNgTemplate())for(var s=this.listViewInstance.element.querySelectorAll("."+h.listItem),n=0;n<s.length;n++)s[n].context=this.listViewInstance.viewContainerRef.get(n).context},s.prototype.refreshItemHeight=function(){if(this.listViewInstance.curViewDS.length){var e=this.listViewInstance.curViewDS;t.isBlazor()&&this.listViewInstance.isServerRendered?this.listViewInstance.ulElement.children[0].style.height=this.listViewInstance.liElementHeight*Object.keys(e).length+"px":(this.listItemHeight=this.topElement.nextSibling.getBoundingClientRect().height,this.totalHeight=Object.keys(e).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.bottomElementHeight=this.totalHeight,this.bottomElement.style.height=this.totalHeight+"px")}},s.prototype.getscrollerHeight=function(e){return this.listViewInstance.isWindow?pageYOffset-e<=0?0:pageYOffset-e:this.listViewInstance.element.scrollTop-e<=0?0:this.listViewInstance.element.scrollTop-e},s.prototype.onVirtualUiScroll=function(e){var i,s;s=this.listViewInstance.isWindow?this.listViewInstance.ulElement.getBoundingClientRect().top-document.documentElement.getBoundingClientRect().top:this.listViewInstance.headerEle?this.listViewInstance.headerEle.getBoundingClientRect().height:0,this.scrollPosition=t.isNullOrUndefined(this.scrollPosition)?0:this.scrollPosition;var n=this.getscrollerHeight(s);if(this.topElementHeight=this.listItemHeight*Math.floor(n/this.listItemHeight),this.bottomElementHeight=this.totalHeight-this.topElementHeight,i=n<=this.totalHeight?[this.topElementHeight,this.bottomElementHeight]:[this.totalHeight,0],this.topElementHeight=i[0],this.bottomElementHeight=i[1],t.isBlazor()&&this.listViewInstance.isServerRendered){var l=void 0;if(t.isNullOrUndefined(this.listViewInstance.liElementHeight)&&this.listViewInstance.updateLiElementHeight(),(l=this.listViewInstance.isWindow?Math.round(document.documentElement.scrollTop/this.listViewInstance.liElementHeight):Math.round(e.target.scrollTop/this.listViewInstance.liElementHeight))-2-this.elementDifference>=3||l-2-this.elementDifference<=-1){var r={listDiff:l-2,selectedItems:this.listViewInstance.previousSelectedItems};this.listViewInstance.interopAdaptor.invokeMethodAsync("VirtalScrolling",r),this.listViewInstance.ulElement.querySelector(".e-focused")&&this.listViewInstance.ulElement.querySelector(".e-focused").classList.remove("e-focused"),this.elementDifference=l-2}}else this.topElementHeight!==parseFloat(this.topElement.style.height)&&(this.topElement.style.height=this.topElementHeight+"px",this.bottomElement.style.height=this.bottomElementHeight+"px",n>this.scrollPosition?(l=Math.round(this.topElementHeight/this.listItemHeight-this.listDiff))>this.expectedDomItemCount+5?this.onLongScroll(l,!0):this.onNormalScroll(l,!0):(l=Math.round(this.listDiff-this.topElementHeight/this.listItemHeight))>this.expectedDomItemCount+5?this.onLongScroll(l,!1):this.onNormalScroll(l,!1)),this.listDiff=Math.round(this.topElementHeight/this.listItemHeight),"function"==typeof this.listViewInstance.onUIScrolled&&this.listViewInstance.onUIScrolled();this.scrollPosition=n},s.prototype.onLongScroll=function(e,t){for(var i=t?this.uiFirstIndex+e:this.uiFirstIndex-e,s=this.listViewInstance.ulElement.querySelectorAll("li"),n=0;n<s.length;n++)this.updateUI(s[n],i),i++;this.uiLastIndex=t?this.uiLastIndex+e:this.uiLastIndex-e,this.uiFirstIndex=t?this.uiFirstIndex+e:this.uiFirstIndex-e},s.prototype.onNormalScroll=function(e,t){if(t)for(i=0;i<e;i++){s=++this.uiLastIndex;this.updateUI(this.topElement.nextElementSibling,s,this.bottomElement),this.uiFirstIndex++}else for(var i=0;i<e;i++){var s=--this.uiFirstIndex,n=this.topElement.nextSibling;this.updateUI(this.bottomElement.previousElementSibling,s,n),this.uiLastIndex--}},s.prototype.updateUiContent=function(i,s){var n=this.listViewInstance.curViewDS;if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]?(i.dataset.uid=e.ListBase.generateId(),i.getElementsByClassName(h.listItemText)[0].innerHTML=this.listViewInstance.curViewDS[s].toString()):(i.dataset.uid=n[s][this.listViewInstance.fields.id]?n[s][this.listViewInstance.fields.id]:e.ListBase.generateId(),i.getElementsByClassName(h.listItemText)[0].innerHTML=n[s][this.listViewInstance.fields.text]),this.listViewInstance.showIcon&&(i.querySelector("."+h.listIcon)&&t.detach(i.querySelector("."+h.listIcon)),this.listViewInstance.curViewDS[s][this.listViewInstance.fields.iconCss])){var l=i.querySelector("."+h.textContent),r=this.listViewInstance.createElement("div",{className:h.listIcon+" "+this.listViewInstance.curViewDS[s][this.listViewInstance.fields.iconCss]});l.insertBefore(r,i.querySelector("."+h.listItemText))}if(this.listViewInstance.showCheckBox&&this.listViewInstance.fields.groupBy){this.checkListWrapper||(this.checkListWrapper=this.listViewInstance.curUL.querySelector("."+h.checkboxWrapper).cloneNode(!0));l=i.querySelector("."+h.textContent);this.listViewInstance.curViewDS[s].isHeader?i.querySelector("."+h.checkboxWrapper)&&(i.classList.remove(h.checklist),l.classList.remove(h.checkbox),t.detach(i.querySelector("."+h.checkboxWrapper))):i.querySelector("."+h.checkboxWrapper)||(i.classList.add(h.checklist),l.classList.add(h.checkbox),l.insertBefore(this.checkListWrapper.cloneNode(!0),i.querySelector("."+h.listItemText)))}},s.prototype.changeElementAttributes=function(e,i){if(e.classList.remove(h.disable),this.uiIndices.disabledItemIndices.length&&-1!==this.uiIndices.disabledItemIndices.indexOf(i)&&e.classList.add(h.disable),e.style.display="",this.uiIndices.hiddenItemIndices.length&&-1!==this.uiIndices.hiddenItemIndices.indexOf(i)&&(e.style.display="none"),this.listViewInstance.showCheckBox){var s=e.querySelector("."+h.checkboxWrapper);e.classList.remove(h.selected),e.classList.remove(h.focused),s&&(s.removeAttribute("aria-checked"),s.firstElementChild.classList.remove(h.checked)),this.uiIndices.activeIndices.length&&-1!==this.uiIndices.activeIndices.indexOf(i)&&!this.listViewInstance.curUL.querySelector(h.selected)&&(e.classList.add(h.selected),s.firstElementChild.classList.add(h.checked),s.setAttribute("aria-checked","true"),this.activeIndex===i&&e.classList.add(h.focused))}else e.classList.remove(h.selected),e.removeAttribute("aria-selected"),t.isNullOrUndefined(this.activeIndex)||this.activeIndex!==i||this.listViewInstance.curUL.querySelector(h.selected)||(e.classList.add(h.selected),e.setAttribute("aria-selected","true"));this.listViewInstance.fields.groupBy&&(this.listViewInstance.curViewDS[i].isHeader?e.classList.contains(h.listItem)&&(e.classList.remove(h.listItem),e.setAttribute("role","group"),e.classList.add(h.groupListItem)):e.classList.contains(h.groupListItem)&&(e.classList.remove(h.groupListItem),e.setAttribute("role","listitem"),e.classList.add(h.listItem)))},s.prototype.findDSAndIndexFromId=function(e,i){var s=this,n={};return i=this.listViewInstance.getElementUID(i),t.isNullOrUndefined(i)||e.some(function(e,t){return!!(i[s.listViewInstance.fields.id]&&i[s.listViewInstance.fields.id]===(e[s.listViewInstance.fields.id]&&e[s.listViewInstance.fields.id])||i===e)&&(n.index=t,n.data=e,!0)}),n},s.prototype.getSelectedItems=function(){var e=this;if(!t.isNullOrUndefined(this.activeIndex)||this.listViewInstance.showCheckBox&&this.uiIndices.activeIndices.length){var s=[],n=[];if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]){var l=this.listViewInstance.curViewDS;if(this.listViewInstance.showCheckBox){for(var r=this.uiIndices.activeIndices,a=0;a<r.length;a++)s.push(l[r[a]]);return{text:s,data:s,index:this.uiIndices.activeIndices.map(function(t){return e.listViewInstance.dataSource.indexOf(l[t])})}}return{text:l[this.activeIndex],data:l[this.activeIndex],index:this.listViewInstance.dataSource.indexOf(l[this.activeIndex])}}if(t.isBlazor()&&this.listViewInstance.isServerRendered){var o=Math.round(this.listViewInstance.element.scrollTop/this.listViewInstance.liElementHeight)-2;o<0&&(o=0),this.activeIndex+=o}var c=this.listViewInstance.curViewDS,h=this.listViewInstance.fields.text;if(this.listViewInstance.showCheckBox){for(var d=this.uiIndices.activeIndices,a=0;a<d.length;a++)n.push(c[d[a]][h]),s.push(c[d[a]]);var u=this.listViewInstance.dataSource instanceof i.DataManager?c:this.listViewInstance.dataSource;return{text:n,data:s,index:this.uiIndices.activeIndices.map(function(e){return u.indexOf(c[e])})}}var p=this.listViewInstance.dataSource instanceof i.DataManager?c:this.listViewInstance.dataSource;return{text:c[this.activeIndex][this.listViewInstance.fields.text],data:c[this.activeIndex],index:p.indexOf(c[this.activeIndex])}}},s.prototype.selectItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(Object.keys(i).length){var s=this.activeIndex===i.index,n=void 0;if(this.activeIndex=i.index,this.listViewInstance.showCheckBox&&(-1===this.uiIndices.activeIndices.indexOf(i.index)?(n=!0,this.uiIndices.activeIndices.push(i.index)):(n=!1,this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(i.index),1)),this.listViewInstance.curUL.querySelector("."+h.focused)&&this.listViewInstance.curUL.querySelector("."+h.focused).classList.remove(h.focused)),this.listViewInstance.getLiFromObjOrElement(e))this.listViewInstance.showCheckBox?this.listViewInstance.setCheckboxLI(this.listViewInstance.getLiFromObjOrElement(e)):this.listViewInstance.setSelectLI(this.listViewInstance.getLiFromObjOrElement(e));else{var l=void 0;if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0])l={text:this.listViewInstance.curViewDS[this.activeIndex],data:this.listViewInstance.curViewDS[this.activeIndex],index:this.activeIndex};else{var r=this.listViewInstance.curViewDS;l={text:r[this.activeIndex][this.listViewInstance.fields.text],data:r[this.activeIndex],index:this.activeIndex}}this.listViewInstance.showCheckBox?(l.isChecked=n,this.listViewInstance.trigger("select",l)):s||(this.listViewInstance.removeSelect(),this.listViewInstance.trigger("select",l))}}else t.isNullOrUndefined(e)&&!this.listViewInstance.showCheckBox&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0);if(t.isBlazor()&&this.listViewInstance.isServerRendered){var a=i.data[this.listViewInstance.fields.id];if(this.listViewInstance.showCheckBox)if(this.listViewInstance.previousSelectedItems.includes(a)){var o=this.listViewInstance.previousSelectedItems.indexOf(a);o>-1&&this.listViewInstance.previousSelectedItems.splice(o,1)}else this.listViewInstance.previousSelectedItems.push(a);else this.listViewInstance.previousSelectedItems[0]=a;this.listViewInstance.removeActiveClass()}},s.prototype.enableItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(t.isBlazor()&&this.listViewInstance.isServerRendered){var s=i.data[this.listViewInstance.fields.id];if(this.listViewInstance.enabledItems.includes(s)||(this.listViewInstance.enabledItems.push(s),this.listViewInstance.removeActiveClass()),this.listViewInstance.disabledItems.includes(s)){var n=this.listViewInstance.disabledItems.indexOf(s);n>-1&&this.listViewInstance.disabledItems.splice(n,1)}}else Object.keys(i).length&&this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(i.index),1)},s.prototype.disableItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(t.isBlazor()&&this.listViewInstance.isServerRendered){var s=i.data[this.listViewInstance.fields.id];if(this.listViewInstance.disabledItems.includes(s)||(this.listViewInstance.disabledItems.push(s),this.listViewInstance.removeActiveClass()),this.listViewInstance.enabledItems.includes(s)){var n=this.listViewInstance.enabledItems.indexOf(s);n>-1&&this.listViewInstance.enabledItems.splice(n,1)}}else Object.keys(i).length&&-1===this.uiIndices.disabledItemIndices.indexOf(i.index)&&this.uiIndices.disabledItemIndices.push(i.index)},s.prototype.showItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(t.isBlazor()&&this.listViewInstance.isServerRendered){var s=i.data[this.listViewInstance.fields.id];if(this.listViewInstance.hiddenItems.includes(s)){var n=this.listViewInstance.hiddenItems.indexOf(s);n>-1&&(this.listViewInstance.previousSelectedItems.splice(n,1),this.listViewInstance.removeActiveClass())}}else Object.keys(i).length&&this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(i.index),1)},s.prototype.hideItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(t.isBlazor()&&this.listViewInstance.isServerRendered){var s=i.data[this.listViewInstance.fields.id];this.listViewInstance.hiddenItems.includes(s)||(this.listViewInstance.hiddenItems.push(s),this.listViewInstance.removeActiveClass())}else Object.keys(i).length&&-1===this.uiIndices.hiddenItemIndices.indexOf(i.index)&&this.uiIndices.hiddenItemIndices.push(i.index)},s.prototype.removeItem=function(e){var s,n=this.listViewInstance.curViewDS,l=this.findDSAndIndexFromId(n,e);t.isBlazor()&&this.listViewInstance.isServerRendered&&void 0!==l.index&&this.listViewInstance.interopAdaptor.invokeMethodAsync("RemoveItemPosition",l.index),Object.keys(l).length&&(s=l.data,n[l.index-1]&&n[l.index-1].isHeader&&1===n[l.index-1].items.length?(this.removeUiItem(l.index-1),this.removeUiItem(l.index-1)):t.isBlazor()&&this.listViewInstance.isServerRendered||this.removeUiItem(l.index));var r=this.listViewInstance.dataSource instanceof i.DataManager?this.listViewInstance.localData:this.listViewInstance.dataSource,a=r.indexOf(s);-1!==a&&(r.splice(a,1),this.listViewInstance.setViewDataSource(r)),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")},s.prototype.setCheckboxLI=function(e,i){t.isBlazor()&&this.listViewInstance.isServerRendered&&(this.uiFirstIndex=Math.round(this.listViewInstance.element.scrollTop/36)-4,this.uiFirstIndex<0&&(this.uiFirstIndex=0));var s=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex;this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex,e.classList.contains(h.selected)?-1===this.uiIndices.activeIndices.indexOf(s)&&this.uiIndices.activeIndices.push(s):this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(s),1)},s.prototype.setSelectLI=function(e,t){this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex},s.prototype.checkedItem=function(e){if(e){this.uiIndices.activeIndices=[],this.activeIndex=void 0;for(var t=this.listViewInstance.curViewDS,i=0;i<t.length;i++)t[i].isHeader||this.uiIndices.activeIndices.push(i)}else this.activeIndex=void 0,this.uiIndices.activeIndices=[]},s.prototype.addUiItem=function(e){var t=this.listViewInstance.curViewDS;if(this.changeUiIndices(e,!0),this.activeIndex&&this.activeIndex>=e&&this.activeIndex++,this.listViewInstance.showCheckBox&&t[e][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(e),parseFloat(this.bottomElement.style.height)||parseFloat(this.topElement.style.height)||(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px"),parseFloat(this.bottomElement.style.height)){i=this.listViewInstance.curUL.lastElementChild.previousSibling;(s=this.listViewInstance.getLiFromObjOrElement(t[e+1])||this.listViewInstance.getLiFromObjOrElement(t[e+2]))&&(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px",this.updateUI(i,e,s))}else{var i=this.listViewInstance.curUL.firstElementChild.nextSibling,s=void 0;s=Object.keys(this.listViewInstance.curViewDS).length-1===e?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(t[e+1])||this.listViewInstance.getLiFromObjOrElement(t[e+2]),this.topElement.style.height=parseFloat(this.topElement.style.height)+this.listItemHeight+"px",this.uiFirstIndex++,this.uiLastIndex++,s&&(this.updateUI(i,e,s),!0===this.listViewInstance.isWindow?window.scrollTo(0,pageYOffset+this.listItemHeight):this.listViewInstance.element.scrollTop+=this.listItemHeight)}this.totalHeight+=this.listItemHeight,this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},s.prototype.removeUiItem=function(e){this.totalHeight-=this.listItemHeight;var i=this.listViewInstance.curViewDS[e],s=this.listViewInstance.getLiFromObjOrElement(i);if(this.listViewInstance.curViewDS.splice(e,1),this.activeIndex&&this.activeIndex>=e&&this.activeIndex--,s)if(this.domItemCount>Object.keys(this.listViewInstance.curViewDS).length)t.detach(s),this.domItemCount--,this.uiLastIndex--,this.totalHeight=0;else{if(s.classList.contains(h.disable)&&(s.classList.remove(h.disable),this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(e),1)),"none"===s.style.display&&(s.style.display="",this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(e),1)),this.listViewInstance.showCheckBox&&s.classList.contains(h.selected)){this.listViewInstance.removeSelect(),this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(e),1);var n=s.querySelector("."+h.checkboxWrapper);n.removeAttribute("aria-checked"),n.firstElementChild.classList.remove(h.checked),s.classList.contains(h.focused)&&(s.classList.remove(h.focused),this.activeIndex=void 0)}else s.classList.contains(h.selected)&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0);parseFloat(this.bottomElement.style.height)||parseFloat(this.topElement.style.height)?parseFloat(this.bottomElement.style.height)?(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)-this.listItemHeight+"px",this.updateUI(s,this.uiLastIndex,this.bottomElement)):(this.topElement.style.height=parseFloat(this.topElement.style.height)-this.listItemHeight+"px",this.updateUI(s,this.uiFirstIndex-1,this.topElement.nextSibling),this.uiLastIndex--,this.uiFirstIndex--):this.updateUI(s,this.uiLastIndex,this.bottomElement)}this.changeUiIndices(e,!1),this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},s.prototype.changeUiIndices=function(e,t){for(var i=Object.keys(this.uiIndices),s=0;s<i.length;s++)this.uiIndices[i[s]]=this.uiIndices[i[s]].map(function(i){return i>=e?t?++i:--i:i})},s.prototype.addItem=function(e,t,i){for(var s=0;s<e.length;s++){var n=e[s];if(i.push(n),this.listViewInstance.setViewDataSource(i),this.domItemCount)if(this.domItemCount<this.expectedDomItemCount){if(this.listViewInstance.findItemFromDS(i,t)instanceof Array){if(this.listViewInstance.ulElement){l=this.listViewInstance.curViewDS.indexOf(n);this.createAndInjectNewItem(n,l),(r=this.listViewInstance.curViewDS[l-1])&&r.isHeader&&1===r.items.length&&(--l,this.createAndInjectNewItem(r,l))}this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")}}else{var l=this.listViewInstance.curViewDS.indexOf(n);this.addUiItem(l);var r=this.listViewInstance.curViewDS[l-1];r&&r.isHeader&&1===r.items.length&&this.addUiItem(l-1)}else!this.listViewInstance.template&&!this.listViewInstance.groupTemplate||this.isNgTemplate()||(this.listViewInstance.listBaseOption.template=null,this.listViewInstance.listBaseOption.groupTemplate=null,this.listViewInstance.listBaseOption.itemCreated=this.createUIItem.bind(this)),this.uiVirtualization()}},s.prototype.createAndInjectNewItem=function(t,i){var s,n=e.ListBase.createListItemFromJson(this.listViewInstance.createElement,[t],this.listViewInstance.listBaseOption,null,null,this);s=Object.keys(this.listViewInstance.curViewDS).length-1===i?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i+1])||this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i+2]),this.listViewInstance.ulElement.insertBefore(n[0],s),this.domItemCount++,this.bottomElementHeight<=0&&this.uiLastIndex++,this.refreshItemHeight()},s.prototype.createUIItem=function(e){var i=this.listViewInstance.template,s=this.listViewInstance.createElement("div"),n='<div class="e-text-content" role="presentation"> <span class="e-list-text"> ${'+this.listViewInstance.fields.text+"} </span></div>";if(this.listViewInstance.showCheckBox){if(this.listViewInstance.renderCheckbox(e),!t.isNullOrUndefined(this.listViewInstance.virtualCheckBox)&&!t.isNullOrUndefined(this.listViewInstance.virtualCheckBox.outerHTML)){var l=document.createElement("div");l.innerHTML=this.listViewInstance.template||n,l.children[0].classList.add("e-checkbox"),"Left"===this.listViewInstance.checkBoxPosition?l.children[0].classList.add("e-checkbox-left"):l.children[0].classList.add("e-checkbox-right"),"Left"===this.listViewInstance.checkBoxPosition?l.children[0].insertBefore(this.listViewInstance.virtualCheckBox,l.childNodes[0].children[0]):l.children[0].appendChild(this.listViewInstance.virtualCheckBox),this.listViewInstance.template=l.innerHTML}s.innerHTML=this.listViewInstance.template,this.listViewInstance.template=i}else s.innerHTML=this.listViewInstance.template||n;var r=s.getElementsByTagName("*"),a=this.listViewInstance.createElement("div");this.listViewInstance.fields.groupBy&&(a.innerHTML=this.listViewInstance.groupTemplate||n);var o=a.getElementsByTagName("*");e.curData.isHeader&&(this.headerData=e.curData),this.templateData=e.curData.isHeader?e.curData.items[0]:e.curData,e.item.innerHTML="",e.item.context={data:e.curData,nodes:{flatTemplateNodes:[],groupTemplateNodes:[]}};for(c=0;c<r.length;c++)this.compileTemplate(r[c],e.item,!1);for(var c=0;c<o.length;c++)this.compileTemplate(o[c],e.item,!0);e.item.context.template=e.curData.isHeader?s.firstElementChild:a.firstElementChild,e.item.context.type=e.curData.isHeader?"flatList":"groupList";var h=e.curData.isHeader?a:s;e.item.insertBefore(h.firstElementChild,null)},s.prototype.compileTemplate=function(e,t,i){this.textProperty(e,t,i),this.classProperty(e,t,i),this.attributeProperty(e,t,i)},s.prototype.onChange=function(e,i){i.context.data=e;var s=i.context.nodes.groupTemplateNodes,n=i.context.nodes.flatTemplateNodes;if(!t.isNullOrUndefined(e.isHeader)&&e.isHeader&&"groupList"===i.context.type){l=i.firstElementChild;t.detach(i.firstElementChild),i.insertBefore(i.context.template,null),i.context.template=l,i.context.type="flatList";for(r=0;r<s.length;r++)s[r].onChange(e)}else if(e.isHeader||"flatList"!==i.context.type)if(e.isHeader)for(r=0;r<s.length;r++)s[r].onChange(e);else for(r=0;r<n.length;r++)n[r].onChange(e);else{var l=i.firstElementChild;t.detach(i.firstElementChild),i.insertBefore(i.context.template,null),i.context.template=l,i.context.type="groupList";for(var r=0;r<n.length;r++)n[r].onChange(e)}},s.prototype.updateContextData=function(e,t,i){i?e.context.nodes.groupTemplateNodes.push(t):e.context.nodes.flatTemplateNodes.push(t)},s.prototype.classProperty=function(e,i,s){for(var n,l=new RegExp("\\${([^}]*)}","g"),r=[];null!==n;){var a=l.exec(e.className);r.push(a),null===(n=a)&&r.pop()}if(r&&r.length)for(var o=this,c=0;c<r.length;c++)!function(n){var l,a=r[n];l=-1!==a[1].indexOf("?")&&-1!==a[1].indexOf(":")?new Function("data","return "+a[1].replace(/\$/g,"data.")):new Function("data","return data."+a[1]);var c={};c.bindedvalue=l(s?o.headerData:o.templateData),c.onChange=function(i){c.bindedvalue&&t.removeClass([e],c.bindedvalue.split(" ").filter(function(e){return e}));var s=l(i);s&&t.addClass([e],s.split(" ").filter(function(e){return e})),c.bindedvalue=s};for(var h=a[0].split(" "),d=0;d<h.length;d++)e.classList.remove(h[d]);c.bindedvalue&&t.addClass([e],c.bindedvalue.split(" ").filter(function(e){return e})),o.updateContextData(i,c,s)}(c)},s.prototype.attributeProperty=function(e,t,i){for(var s=[],n=0;n<e.attributes.length;n++)s.push(e.attributes[n].nodeName);-1!==s.indexOf("class")&&s.splice(s.indexOf("class"),1);for(var l=this,n=0;n<s.length;n++)!function(n){var r,a,o=s[n],c=new RegExp("\\${([^}]*)}","g").exec(o)||[],h=new RegExp("\\${([^}]*)}","g").exec(e.getAttribute(o))||[];if(c.length||h.length){c[1]&&(r=new Function("data","return data."+c[1])),h[1]&&(a=-1!==h[1].indexOf("?")&&-1!==h[1].indexOf(":")?new Function("data","return "+h[1].replace(/\$/g,"data.")):new Function("data","return data."+h[1]));var d={};d.bindedvalue=i?[void 0===c[1]?void 0:r(l.headerData),void 0===h[1]?void 0:a(l.headerData)]:[void 0===c[1]?void 0:r(l.templateData),void 0===h[1]?void 0:a(l.templateData)],d.attrName=void 0===d.bindedvalue[0]?o:d.bindedvalue[0],d.onChange=function(t){var i=void 0===d.bindedvalue[1]?e.getAttribute(d.attrName):a(t);e.removeAttribute(d.attrName),d.attrName=void 0===d.bindedvalue[0]?d.attrName:r(t),e.setAttribute(d.attrName,i),d.bindedvalue=[void 0===d.bindedvalue[0]?void 0:r(t),void 0===d.bindedvalue[1]?void 0:a(t)]};var u=void 0===d.bindedvalue[1]?e.getAttribute(o):d.bindedvalue[1];e.removeAttribute(o),e.setAttribute(d.attrName,u),l.updateContextData(t,d,i)}}(n)},s.prototype.textProperty=function(e,t,i){for(var s,n=new RegExp("\\${([^}]*)}","g"),l=[];null!==s;){var r=n.exec(e.innerText);l.push(r),null===(s=r)&&l.pop()}var a=Array.prototype.some.call(e.children,function(e){return!!new RegExp("\\${([^}]*)}","g").exec(e.innerText)});if(l&&l.length&&!a)for(var o=this,c=0;c<l.length;c++)!function(s){var n,r=l[s],a={};n=-1!==r[1].indexOf("?")&&-1!==r[1].indexOf(":")?new Function("data","return "+r[1].replace(/\$/g,"data.")):new Function("data","return data."+r[1]),a.bindedvalue=n(i?o.headerData:o.templateData),a.onChange=function(t){e.innerText=e.innerText.replace(a.bindedvalue,n(t)),a.bindedvalue=n(t)},e.innerText=e.innerText.replace(r[0],a.bindedvalue),o.updateContextData(t,a,i)}(c)},s.prototype.reRenderUiVirtualization=function(){this.wireScrollEvent(!0),this.listViewInstance.contentContainer&&t.detach(this.listViewInstance.contentContainer),this.listViewInstance.preRender(),this.domItemCount=0,this.listViewInstance.header(),this.listViewInstance.setLocalData()},s.prototype.updateUI=function(t,i,s){var n=this.isNgTemplate()?this.onNgChange:this.onChange;if(this.listViewInstance.template||this.listViewInstance.groupTemplate){var l=this.listViewInstance.curViewDS[i];t.dataset.uid=l[this.listViewInstance.fields.id]?l[this.listViewInstance.fields.id]:e.ListBase.generateId(),n(l,t,this)}else this.updateUiContent(t,i);this.changeElementAttributes(t,i),s&&this.listViewInstance.ulElement.insertBefore(t,s)},s.prototype.onNgChange=function(e,i,s){for(var n=t.compile(s.listViewInstance.template)(e);i.lastChild;)i.removeChild(i.lastChild);i.appendChild(n[0])},s.prototype.getModuleName=function(){return"virtualization"},s.prototype.destroy=function(){this.wireScrollEvent(!0)},s}(),m=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),f=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},v=function(e){function i(i,s){var n=e.call(this,s,i)||this;return n.getHelper=function(e){var i=n.getSortableElement(e.sender.target);if(!n.isValidTarget(i,n))return!1;var s;return n.helper?s=n.helper({sender:i,element:e.element}):((s=i.cloneNode(!0)).style.width=i.offsetWidth+"px",s.style.height=i.offsetHeight+"px"),t.addClass([s],["e-sortableclone"]),t.removeClass([s],["e-listboxtool-container"]),document.body.appendChild(s),s},n.onDrag=function(e){n.trigger("drag",{event:e.event,element:n.element,target:e.target});var i=n.getSortableInstance(e.target),s=n.getSortableElement(e.target,i);if((n.isValidTarget(s,i)||e.target.className.indexOf("e-list-group-item")>-1)&&(n.curTarget!==s||!t.isNullOrUndefined(i.placeHolder))&&(!i.placeHolderElement||i.placeHolderElement!==e.target)){if(e.target.className.indexOf("e-list-group-item")>-1&&(s=e.target),n.curTarget=s,n.target===s)return;var l=n.getIndex(i.placeHolderElement,i),r=n.getPlaceHolder(s,i),a=void 0;if(r){l=t.isNullOrUndefined(l)?n.getIndex(n.target):l,a=n.getIndex(s,i,e.event);var o=n.isPlaceHolderPresent(i);if(o&&l===a)return;o&&t.remove(i.placeHolderElement),i.placeHolderElement=r,e.target.className.indexOf("e-list-group-item")>-1?i.element.insertBefore(i.placeHolderElement,i.element.children[a]):i.element!==n.element&&a===i.element.childElementCount?i.element.appendChild(i.placeHolderElement):i.element.insertBefore(i.placeHolderElement,i.element.children[a]),n.refreshDisabled(l,a,i)}else{l=t.isNullOrUndefined(l)?n.getIndex(n.target):n.getIndex(s,i)<l||!l?l:l-1,a=n.getIndex(s,i);var c=i.element!==n.element?a:l<a?a+1:a;n.updateItemClass(i),i.element.insertBefore(n.target,i.element.children[c]),n.refreshDisabled(l,a,i),n.curTarget=n.target,n.trigger("drop",{droppedElement:n.target,element:i.element,previousIndex:l,currentIndex:a,target:e.target,helper:document.getElementsByClassName("e-sortableclone")[0],event:e.event,scope:n.scope})}}if(i=n.getSortableInstance(n.curTarget),t.isNullOrUndefined(s)&&e.target!==i.placeHolderElement)n.isPlaceHolderPresent(i)&&n.removePlaceHolder(i);else{var h;[].slice.call(document.getElementsByClassName("e-sortable-placeholder")).forEach(function(e){(h=n.getSortableInstance(e)).element&&h!==i&&n.removePlaceHolder(h)})}},n.onDragStart=function(e){n.target=n.getSortableElement(e.target);var i=!1;n.target.classList.add("e-grabbed"),n.curTarget=n.target,e.helper=document.getElementsByClassName("e-sortableclone")[0];var s={cancel:!1,element:n.element,target:n.target};n.trigger("beforeDragStart",s,function(t){t.cancel&&(i=t.cancel,n.onDragStop(e))}),i||(t.isBlazor?n.trigger("dragStart",{event:e.event,element:n.element,target:n.target,bindEvents:e.bindEvents,dragElement:e.dragElement}):n.trigger("dragStart",{event:e.event,element:n.element,target:n.target}))},n.onDragStop=function(e){var i,s,l,r=n.getSortableInstance(n.curTarget);i=n.getIndex(n.target);var a=n.isPlaceHolderPresent(r);if(a){var o=n.getIndex(r.placeHolderElement,r),c=n===r&&i-o>0?i-1:i,h={previousIndex:c,currentIndex:n.curTarget===n.target?c:o,target:e.target,droppedElement:n.target,helper:e.helper,cancel:!1,handled:!1};n.trigger("beforeDrop",h,function(s){if(!s.cancel){if(l=s.handled,n.updateItemClass(r),s.handled){var a=n.target.cloneNode(!0);n.target.classList.remove("e-grabbed"),n.target=a}r.element.insertBefore(n.target,r.placeHolderElement);var o=n.getIndex(n.target,r);i=n===r&&i-o>1?i-1:i,n.trigger("drop",{event:e.event,element:r.element,previousIndex:i,currentIndex:o,target:e.target,helper:e.helper,droppedElement:n.target,scopeName:n.scope,handled:l})}t.remove(r.placeHolderElement)})}if(r=n.getSortableInstance(e.target),s=r.element.childElementCount,i=n.getIndex(n.target),r.element===e.target||!a&&n.curTarget===n.target){var d={previousIndex:i,currentIndex:n.curTarget===n.target?i:s,target:e.target,droppedElement:n.target,helper:e.helper,cancel:!1};n.trigger("beforeDrop",d,function(t){r.element!==e.target||t.cancel||(n.updateItemClass(r),r.element.appendChild(n.target),n.trigger("drop",{event:e.event,element:r.element,previousIndex:i,currentIndex:s,target:e.target,helper:e.helper,droppedElement:n.target,scopeName:n.scope}))})}n.target.classList.remove("e-grabbed"),n.target=null,n.curTarget=null,t.remove(e.helper),t.getComponent(n.element,t.Draggable).intDestroy(e.event)},n.bind(),n}m(i,e),s=i,i.prototype.bind=function(){this.element.id||(this.element.id=t.getUniqueID("sortable")),this.itemClass||(this.itemClass="e-sort-item",this.dataBind()),this.initializeDraggable()},i.prototype.initializeDraggable=function(){new t.Draggable(this.element,{helper:this.getHelper,dragStart:this.onDragStart,drag:this.onDrag,dragStop:this.onDragStop,dragTarget:"."+this.itemClass,enableTapHold:!0,tapHoldThreshold:200,queryPositionInfo:this.queryPositionInfo,distance:5})},i.prototype.getPlaceHolder=function(e,t){if(t.placeHolder){var i=t.placeHolder({element:t.element,grabbedElement:this.target,target:e});return i.classList.add("e-sortable-placeholder"),i}return null},i.prototype.isValidTarget=function(e,i){return e&&t.compareElementParent(e,i.element)&&e.classList.contains(i.itemClass)&&!e.classList.contains("e-disabled")},i.prototype.removePlaceHolder=function(e){t.remove(e.placeHolderElement),e.placeHolderElement=null},i.prototype.updateItemClass=function(e){this!==e&&(this.target.classList.remove(this.itemClass),this.target.classList.add(e.itemClass))},i.prototype.getSortableInstance=function(e){if(e=t.closest(e,".e-"+this.getModuleName())){var i=t.getComponent(e,s);return i.scope&&this.scope&&i.scope===this.scope?i:this}return this},i.prototype.refreshDisabled=function(e,t,i){if(i===this)for(var s=void 0,n=e<t,l=void 0,r=n?e:t,a=n?t:e;r<=a;)(s=this.element.children[r]).classList.contains("e-disabled")?(l=this.getIndex(s),this.element.insertBefore(s,this.element.children[n?l+2:l-1]),r=n?l+2:l+1):r++},i.prototype.getIndex=function(e,i,s){void 0===i&&(i=this);var n,l;return[].slice.call(i.element.children).forEach(function(i,r){if(i.classList.contains("e-sortable-placeholder")&&(l=!0),i!==e);else if(n=r,!t.isNullOrUndefined(s)){l&&(n-=1);var a=e.getBoundingClientRect(),o=a.bottom-(a.bottom-a.top)/2;n=s.clientY<=o?n:n+1}}),n},i.prototype.getSortableElement=function(e,i){return void 0===i&&(i=this),t.closest(e,"."+i.itemClass)},i.prototype.queryPositionInfo=function(e){return e.left=pageXOffset?parseFloat(e.left)-pageXOffset+"px":e.left,e.top=pageYOffset?parseFloat(e.top)-pageYOffset+"px":e.top,e},i.prototype.isPlaceHolderPresent=function(e){return e.placeHolderElement&&!!t.closest(e.placeHolderElement,"#"+e.element.id)},i.prototype.moveTo=function(e,t,i){l(this.element,e,t,i)},i.prototype.destroy=function(){"e-sort-item"===this.itemClass&&(this.itemClass=null,this.dataBind()),t.getComponent(this.element,t.Draggable).destroy(),e.prototype.destroy.call(this)},i.prototype.getModuleName=function(){return"sortable"},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"itemClass":[].slice.call(this.element.children).forEach(function(i){i.classList.contains(t.itemClass)&&i.classList.remove(t.itemClass),e.itemClass&&i.classList.add(e.itemClass)})}};var s;return f([t.Property(!1)],i.prototype,"enableAnimation",void 0),f([t.Property(null)],i.prototype,"itemClass",void 0),f([t.Property(null)],i.prototype,"scope",void 0),f([t.Property()],i.prototype,"helper",void 0),f([t.Property()],i.prototype,"placeHolder",void 0),f([t.Event()],i.prototype,"drag",void 0),f([t.Event()],i.prototype,"beforeDragStart",void 0),f([t.Event()],i.prototype,"dragStart",void 0),f([t.Event()],i.prototype,"beforeDrop",void 0),f([t.Event()],i.prototype,"drop",void 0),i=s=f([t.NotifyPropertyChanges],i)}(t.Base);return u.Inject(p),e.classNames=h,e.FieldSettings=d,e.ListView=u,e.Virtualization=p,e.getFieldValues=n,e.Sortable=v,e.moveTo=l,e}({},ej.base,ej.data,ej.buttons),this.ejs=ej;
- /*!
- * filename: ej2-dropdowns.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.dropdowns=function(e,t,i,s,l,o,r,n){"use strict";function a(e,t,i,s,l,o){C+=String.fromCharCode(e),setTimeout(function(){C=""},1e3);var r;if(C=s?C.toLowerCase():C,x===l&&b===C){for(p=0;p<S.length;p++)if(S[p].classList.contains(E)){r=p;break}return r+=1,S[r]}var n=t,a=C.length,h=void 0,p=i=i?i+1:0;S=[];do{p===n.length&&(p=-1),h=n[r=-1===p?0:p],(o?s?h.textContent.trim().toLowerCase():h.textContent.trim():s?h.innerText.toLowerCase():h.innerText).substr(0,a)===C&&S.push(n[r]),p++}while(p!==i);return b=C,x=l,S[0]}function h(e,t,i,s){var l=t;s=void 0===s||null===s||s;var o={item:null,index:null};if(e&&e.length){for(var r=e.length,n=s?e.toLocaleLowerCase():e,a=0,h=l;a<h.length;a++){var p=h[a],u=(s?p.textContent.toLocaleLowerCase():p.textContent).replace(/^\s+|\s+$/g,"");if("Equal"===i&&u===n||"StartsWith"===i&&u.substr(0,r)===n)return o.item=p,o.index=a,{item:p,index:a}}return o}return o}function p(e,t,i,s,l){if(""!==t){var o=i?"gim":"gm";t=/^[a-zA-Z0-9- ]*$/.test(t)?t:t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var r="StartsWith"===s?"^("+t+")":"EndsWith"===s?"("+t+")$":"("+t+")";u(e,new RegExp(r,o),l)}}function u(e,t,i){for(var s=0;e.childNodes&&s<e.childNodes.length;s++){if(3===e.childNodes[s].nodeType&&""!==e.childNodes[s].textContent.trim()){if(e=i&&e.classList.contains("e-highlight")?e.parentElement:e,i&&e.getAttribute("data-value"))e.innerHTML=e.getAttribute("data-value").replace(t,'<span class="e-highlight">$1</span>');else{var l=e.childNodes[s].nodeValue.trim().replace(t,'<span class="e-highlight">$1</span>');e.childNodes[s].nodeValue="",e.innerHTML=e.innerHTML.trim()+l}break}u(e.childNodes[s],t,i)}}function c(e){for(var t=e.querySelectorAll(".e-highlight"),i=t.length-1;i>=0;i--){var s=t[i].parentNode,l=document.createTextNode(t[i].textContent);s.replaceChild(l,t[i])}}function d(e,i,s,l,o,r,n){var a=t.createElement("span",{className:ee}),h=t.createElement("label",{className:te});t.isNullOrUndefined(s.id)||""===s.id||(h.id="label_"+s.id.replace(/ /g,"_"),t.attributes(s,{"aria-labelledby":h.id})),t.isNullOrUndefined(l.placeholder)||""===l.placeholder||(h.innerText=t.SanitizeHtmlHelper.sanitize(l.placeholder),l.removeAttribute("placeholder")),h.innerText=t.SanitizeHtmlHelper.sanitize(n),i.appendChild(a),i.appendChild(h),e.classList.add("e-float-input"),m(o,h),"Always"===r&&(h.classList.contains(se)&&t.removeClass([h],se),t.addClass([h],ie))}function m(e,i){e&&e.length>0?(t.addClass([i],ie),t.removeClass([i],se)):(t.removeClass([i],ie),t.addClass([i],se))}function f(e,i,s,l,o,r,n){var a,h=i.querySelector("."+te),p=i.querySelector("."+ee);t.isNullOrUndefined(h)?v(o,l,a=null!==n?n:""):(a=h.innerText,t.detach(s.querySelector("."+te)),v(o,l,a),t.isNullOrUndefined(p)||t.detach(s.querySelector("."+ee))),e.classList.remove("e-float-input")}function v(e,t,i){e&&e.length?t.placeholder="":t.placeholder=i}function y(e,i){e.classList.add("e-input-focus");var s=i.querySelector("."+te);t.isNullOrUndefined(s)||(t.addClass([s],ie),s.classList.contains(se)&&t.removeClass([s],se))}function g(e,i,s,l,o){e.classList.remove("e-input-focus");var r=i.querySelector("."+te);s&&s.length<=0&&"Auto"===l&&!t.isNullOrUndefined(r)&&(r.classList.contains(ie)&&t.removeClass([r],ie),t.addClass([r],se))}var C="",b="",S=[],E="e-active",x="",w=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),O=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},A=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return w(i,e),O([t.Property()],i.prototype,"text",void 0),O([t.Property()],i.prototype,"value",void 0),O([t.Property()],i.prototype,"iconCss",void 0),O([t.Property()],i.prototype,"groupBy",void 0),O([t.Property()],i.prototype,"htmlAttributes",void 0),i}(t.ChildProperty),k={root:"e-dropdownbase",rtl:"e-rtl",content:"e-content",selected:"e-active",hover:"e-hover",noData:"e-nodata",fixedHead:"e-fixed-head",focus:"e-item-focus",li:"e-list-item",group:"e-list-group-item",disabled:"e-disabled",grouping:"e-dd-group"},B=function(e){function l(t,i){var s=e.call(this,t,i)||this;return s.preventChange=!1,s.isAngular=!1,s.isPreventChange=!1,s}return w(l,e),l.prototype.getPropObject=function(e,t,i){var s=new Object,l=new Object,o=function(e){return e};s[o(e)]=t[o(e)],l[o(e)]=i[o(e)];var r=new Object;return r.newProperty=s,r.oldProperty=l,r},l.prototype.getValueByText=function(e,i,s){var l=null;return t.isNullOrUndefined(this.listData)||(l=i?this.checkValueCase(e,!0,s):this.checkValueCase(e,!1,s)),l},l.prototype.checkValueCase=function(e,i,s,l){var o=this,r=null;l&&(r=e);var n=this.listData,a=this.fields,h=this.typeOfData(n).typeof;if("string"===h||"number"===h||"boolean"===h)for(var p=0,u=n;p<u.length;p++){var c=u[p];t.isNullOrUndefined(c)||(s?r=this.checkingAccent(String(c),e,i):i?this.checkIgnoreCase(String(c),e)&&(r=this.getItemValue(String(c),e,i)):this.checkNonIgnoreCase(String(c),e)&&(r=this.getItemValue(String(c),e,i,l)))}else i?n.filter(function(i){var s=t.getValue(a.value,i);!t.isNullOrUndefined(s)&&o.checkIgnoreCase(t.getValue(a.text,i).toString(),e)&&(r=t.getValue(a.value,i))}):l?n.filter(function(e){var i=t.getValue(a.value,e);t.isNullOrUndefined(i)||t.isNullOrUndefined(r)||i.toString()!==r.toString()||(r=t.getValue(a.text,e))}):n.filter(function(i){o.checkNonIgnoreCase(t.getValue(a.text,i),e)&&(r=t.getValue(a.value,i))});return r},l.prototype.checkingAccent=function(e,t,s){var l=i.DataUtil.ignoreDiacritics(String(e)),o=i.DataUtil.ignoreDiacritics(t.toString()),r=null;return s?this.checkIgnoreCase(l,o)&&(r=this.getItemValue(String(e),t,s)):this.checkNonIgnoreCase(String(e),t)&&(r=this.getItemValue(String(e),t,s)),r},l.prototype.checkIgnoreCase=function(e,t){return String(e).toLowerCase()===t.toString().toLowerCase()},l.prototype.checkNonIgnoreCase=function(e,t){return String(e)===t.toString()},l.prototype.getItemValue=function(e,t,i,s){var l=this.listData,o=this.typeOfData(l).typeof;return s?e.toString():i?"string"===o?String(e):this.getFormattedValue(String(e)):"string"===o?t:this.getFormattedValue(t)},l.prototype.templateCompiler=function(e){var i=!1;if(e)try{i=!!t.selectAll(e,document).length}catch(e){i=!1}return i},l.prototype.l10nUpdate=function(e){var i="listbox"===this.getModuleName()?this.ulElement:this.list;if("No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){this.DropDownBaseresetBlazorTemplates(!1,!1,!0,!0);var s=e?this.actionFailureTemplate:this.noRecordsTemplate,l=void 0,o=e?this.actionFailureTemplateId:this.noRecordsTemplateId;i.innerHTML="";var r=(l=this.templateCompiler(s)?t.compile(t.select(s,document).innerHTML.trim()):t.compile(s))({},this,e?"actionFailureTemplate":"noRecordsTemplate",o,this.isStringTemplate,null,i);if(r&&r.length>0)for(var n=0;n<r.length;n++)i.appendChild(r[n]);this.renderReactTemplates(),this.DropDownBaseupdateBlazorTemplates(!1,!1,!e,e,!1,!1,!1,!1)}else{var a={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},h=new t.L10n(this.getLocaleName(),{},this.locale);""!==h.getConstant("actionFailureTemplate")?this.l10n=h:this.l10n=new t.L10n("listbox"===this.getModuleName()?"listbox":"dropdowns",a,this.locale);var p=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate");if("listbox"===this.getModuleName()){var u=this.createElement("li");u.textContent=p,i.appendChild(u),u.classList.add("e-list-nrt")}else i.innerHTML=p}},l.prototype.getLocaleName=function(){return"drop-down-base"},l.prototype.getTextByValue=function(e){return this.checkValueCase(e,!1,!1,!0)},l.prototype.getFormattedValue=function(e){if(this.listData&&this.listData.length){var i=this.typeOfData(this.listData);if(t.isBlazor()&&t.isNullOrUndefined(e)||"null"===e)return null;if("number"==typeof t.getValue(this.fields.value?this.fields.value:"value",i.item)||"number"===i.typeof)return parseFloat(e);if("boolean"==typeof t.getValue(this.fields.value?this.fields.value:"value",i.item)||"boolean"===i.typeof)return"true"===e||""+e=="true"}return e},l.prototype.setEnableRtl=function(){this.list&&this.enableRtlElements.push(this.list),this.enableRtl?t.addClass(this.enableRtlElements,k.rtl):t.removeClass(this.enableRtlElements,k.rtl)},l.prototype.initialize=function(){if(this.bindEvent=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName){var e=s.ListBase.createJsonFromElement(this.element);this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(e,this.fields)}else"SELECT"===this.element.tagName?(this.dataSource instanceof Array?this.dataSource.length>0:!t.isNullOrUndefined(this.dataSource))||this.renderItemsBySelect():this.setListData(this.dataSource,this.fields,this.query)},l.prototype.DropDownBaseupdateBlazorTemplates=function(e,i,s,l,o,r,n,a){this.isStringTemplate||(this.itemTemplate&&e&&t.updateBlazorTemplate(this.itemTemplateId,"ItemTemplate",this,a),this.groupTemplate&&i&&t.updateBlazorTemplate(this.groupTemplateId,"GroupTemplate",this,a),this.noRecordsTemplate&&s&&t.updateBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate",this,a),this.actionFailureTemplate&&l&&t.updateBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate",this,a),o&&t.updateBlazorTemplate(this.valueTemplateId,"ValueTemplate",this,a),r&&t.updateBlazorTemplate(this.headerTemplateId,"HeaderTemplate",this),n&&t.updateBlazorTemplate(this.footerTemplateId,"FooterTemplate",this))},l.prototype.DropDownBaseresetBlazorTemplates=function(e,i,s,l,o,r,n){this.isStringTemplate||(this.itemTemplate&&e&&t.resetBlazorTemplate(this.itemTemplateId,"ItemTemplate"),this.groupTemplate&&i&&t.resetBlazorTemplate(this.groupTemplateId,"GroupTemplate"),this.noRecordsTemplate&&s&&t.resetBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate"),this.actionFailureTemplate&&l&&t.resetBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate"),o&&t.resetBlazorTemplate(this.valueTemplateId,"ValueTemplate"),r&&t.resetBlazorTemplate(this.headerTemplateId,"HeaderTemplate"),n&&t.resetBlazorTemplate(this.footerTemplateId,"FooterTemplate"))},l.prototype.getPersistData=function(){return this.addOnPersist([])},l.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},l.prototype.updateDataAttribute=function(e){for(var i=["class","style","id","type"],s={},l=0;l<this.element.attributes.length;l++)-1!==i.indexOf(this.element.attributes[l].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[l].name||(s[this.element.attributes[l].name]=this.element.getAttribute(this.element.attributes[l].name));t.extend(s,e,s),this.setProperties({htmlAttributes:s},!0)},l.prototype.renderItemsBySelect=function(){var e=this.element,t={value:"value",text:"text"},i=[],s=e.querySelectorAll("select>optgroup"),l=e.querySelectorAll("select>option");if(this.getJSONfromOption(i,l,t),s.length){for(var o=0;o<s.length;o++){var r=s[o],n={};n[t.text]=r.label,n.isHeader=!0;var a=r.querySelectorAll("option");i.push(n),this.getJSONfromOption(i,a,t)}e.querySelectorAll("select>option")}this.updateFields(t.text,t.value,this.fields.groupBy,this.fields.htmlAttributes,this.fields.iconCss),this.resetList(i,t)},l.prototype.updateFields=function(e,i,s,l,o){var r={fields:{text:e,value:i,groupBy:t.isNullOrUndefined(s)?this.fields&&this.fields.groupBy:s,htmlAttributes:t.isNullOrUndefined(l)?this.fields&&this.fields.htmlAttributes:l,iconCss:t.isNullOrUndefined(o)?this.fields&&this.fields.iconCss:o}};this.setProperties(r,!0)},l.prototype.getJSONfromOption=function(e,i,s){for(var l=0,o=i;l<o.length;l++){var r=o[l],n={};n[s.text]=r.innerText,n[s.value]=t.isNullOrUndefined(r.getAttribute(s.value))?r.innerText:r.getAttribute(s.value),e.push(n)}},l.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",this.valueTemplateId=this.element.id+"ValueTemplate",this.groupTemplateId=this.element.id+"GroupTemplate",this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate"},l.prototype.setListData=function(e,t,s){var l=this;t=t||this.fields;var o;this.isActive=!0;var r={cancel:!1,data:e,query:s};this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.trigger("actionBegin",r,function(s){if(!s.cancel)if(l.showSpinner(),e instanceof i.DataManager){if(l.isRequested=!0,l.isDataFetched)return void l.emptyDataRequest(t);s.data.executeQuery(l.getQuery(s.query)).then(function(e){l.isPreventChange=!(!l.isAngular||!l.preventChange)||l.isPreventChange,l.trigger("actionComplete",e,function(e){if(!e.cancel){var i=e.result;0===i.length&&(l.isDataFetched=!0),o=l.renderItems(i,t),l.onActionComplete(o,i,e),l.groupTemplate&&l.renderGroupTemplate(o),l.isRequested=!1,l.bindChildItems(i,o,t,e)}})}).catch(function(e){l.isRequested=!1,l.onActionFailure(e),l.hideSpinner()})}else{var r=new i.DataManager(s.data),n={cancel:!1,result:l.getQuery(s.query).executeLocal(r)};l.isPreventChange=!(!l.isAngular||!l.preventChange)||l.isPreventChange,l.trigger("actionComplete",n,function(e){e.cancel||(o=l.renderItems(e.result,t),l.onActionComplete(o,e.result),l.groupTemplate&&l.renderGroupTemplate(o),l.bindChildItems(e.result,o,t))})}})},l.prototype.bindChildItems=function(e,i,s,l){var o=this;e.length>=100&&"autocomplete"===this.getModuleName()?setTimeout(function(){var r=o.remainingItems(o.sortedData,s);t.append(r,i),o.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1),o.liCollections=o.list.querySelectorAll("."+k.li),o.updateListValues(),o.raiseDataBound(e,l)},0):this.raiseDataBound(e,l)},l.prototype.updateListValues=function(){},l.prototype.findListElement=function(e,t,i,s){var l=null;if(e)for(var o=[].slice.call(e.querySelectorAll(t)),r=0;r<o.length;r++)if(o[r].getAttribute(i)===s+""){l=o[r];break}return l},l.prototype.raiseDataBound=function(e,t){this.hideSpinner();var i={items:e,e:t};this.trigger("dataBound",i)},l.prototype.remainingItems=function(e,t){var l=new i.DataManager(e).executeLocal((new i.Query).skip(100));if(this.itemTemplate){var o=this.templateListItem(l,t);return[].slice.call(o.childNodes)}var r=this.typeOfData(l).typeof;return"string"===r||"number"===r||"boolean"===r?s.ListBase.createListItemFromArray(this.createElement,l,!0,this.listOption(l,t),this):s.ListBase.createListItemFromJson(this.createElement,l,this.listOption(l,t),1,!0,this)},l.prototype.emptyDataRequest=function(e){var t=[];this.onActionComplete(this.renderItems(t,e),t),this.isRequested=!1,this.hideSpinner()},l.prototype.showSpinner=function(){},l.prototype.hideSpinner=function(){},l.prototype.onActionFailure=function(e){this.liCollections=[],this.trigger("actionFailure",e),this.l10nUpdate(!0),t.addClass([this.list],k.noData)},l.prototype.onActionComplete=function(e,i,s){this.listData=i,t.isBlazor()&&this.isServerRendered&&"listbox"===this.getModuleName()?(t.remove(this.list.querySelector(".e-list-parent")),t.remove(this.list.querySelector(".e-hidden-select"))):(this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.list.innerHTML=""),this.fixedHeaderElement=t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement:null,this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+k.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,i,this.bindEvent)},l.prototype.postRender=function(e,i,s){var l=e.querySelector("."+k.li),o=e.querySelector("."+k.selected);l&&!o&&l.classList.add(k.focus),i.length<=0?(this.l10nUpdate(),t.addClass([e],k.noData)):e.classList.remove(k.noData)},l.prototype.getQuery=function(e){return e||(this.query?this.query:new i.Query)},l.prototype.renderGroupTemplate=function(e){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+k.group)){var i=this.dataSource,l={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},o=e.querySelectorAll("."+k.group);if(this.templateCompiler(this.groupTemplate)){var r=t.select(this.groupTemplate,document).innerHTML.trim();s.ListBase.renderGroupTemplate(r,i,this.fields.properties,o,l,this)}else s.ListBase.renderGroupTemplate(this.groupTemplate,i,this.fields.properties,o,l,this);this.DropDownBaseupdateBlazorTemplates(!1,!0,!1,!1,!1,!1,!1,!1)}},l.prototype.createListItems=function(e,l){e&&l.groupBy||this.element.querySelector("optgroup")?(l.groupBy&&("None"!==this.sortOrder&&(e=this.getSortedDataSource(e)),e=s.ListBase.groupDataSource(e,l.properties,this.sortOrder)),t.addClass([this.list],k.grouping)):e=this.getSortedDataSource(e);var o=this.listOption(e,l),r=e.length>100?new i.DataManager(e).executeLocal((new i.Query).take(100)):e;return this.sortedData=e,s.ListBase.createList(this.createElement,"autocomplete"===this.getModuleName()?r:e,o,!0,this)},l.prototype.listOption=function(e,i){var s=!t.isNullOrUndefined(i.iconCss),l=t.isNullOrUndefined(i.properties)?i:i.properties,o=null!==i.text||null!==i.value?{fields:l,showIcon:s,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}};return t.extend({},o,i,!0)},l.prototype.setFloatingHeader=function(e){t.isNullOrUndefined(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:k.fixedHead}),this.list.querySelector("li").classList.contains(k.group)||(this.fixedHeaderElement.style.display="none"),t.prepend([this.fixedHeaderElement],this.list),this.setFixedHeader()),t.isNullOrUndefined(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(e)},l.prototype.scrollStop=function(e){for(var i=t.isNullOrUndefined(e)?this.list:e.target,s=parseInt(getComputedStyle(this.getValidLi(),null).getPropertyValue("height"),10),l=Math.round(i.scrollTop/s),o=this.list.querySelectorAll("li:not(.e-hide-listitem)"),r=l;r>-1;r--){if(!t.isNullOrUndefined(o[r])&&o[r].classList.contains(k.group)){var n=o[r];this.fixedHeaderElement.innerHTML=n.innerHTML,this.fixedHeaderElement.style.top=i.scrollTop+"px",this.fixedHeaderElement.style.display="block";break}this.fixedHeaderElement.style.display="none",this.fixedHeaderElement.style.top="none"}},l.prototype.getValidLi=function(){return this.liCollections[0]},l.prototype.renderItems=function(e,t){var l;if(this.itemTemplate&&e){var o=e;o&&t.groupBy?("None"!==this.sortOrder&&(o=this.getSortedDataSource(o)),o=s.ListBase.groupDataSource(o,t.properties,this.sortOrder)):o=this.getSortedDataSource(o),this.sortedData=o;var r=o.length>100?new i.DataManager(o).executeLocal((new i.Query).take(100)):o;l=this.templateListItem("autocomplete"===this.getModuleName()?r:o,t);var n="listbox"===this.getModuleName();this.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1,!1,!1,!1,n)}else l=this.createListItems(e,t);return l},l.prototype.templateListItem=function(e,i){this.DropDownBaseresetBlazorTemplates(!0,!1,!1,!1);var l=this.listOption(e,i);if(l.templateID=this.itemTemplateId,l.isStringTemplate=this.isStringTemplate,this.templateCompiler(this.itemTemplate)){var o=t.select(this.itemTemplate,document).innerHTML.trim();return s.ListBase.renderContentTemplate(this.createElement,o,e,i.properties,l,this)}return s.ListBase.renderContentTemplate(this.createElement,this.itemTemplate,e,i.properties,l,this)},l.prototype.typeOfData=function(e){for(var i={typeof:null,item:null},s=0;!t.isNullOrUndefined(e)&&s<e.length;s++)if(!t.isNullOrUndefined(e[s])&&!("string"==typeof e[s]||"number"==typeof e[s]||"boolean"==typeof e[s]?t.isNullOrUndefined(e[s]):t.isNullOrUndefined(t.getValue(this.fields.value?this.fields.value:"value",e[s]))))return i={typeof:typeof e[s],item:e[s]};return i},l.prototype.setFixedHeader=function(){this.list.parentElement.style.display="block";var e=0;this.list&&this.list.parentElement&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-width"),10),isNaN(e)&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-top-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-bottom-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-left-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-right-width"),10)));var i=this.getValidLi().offsetWidth-e;this.fixedHeaderElement.style.width=i.toString()+"px",t.setStyleAttribute(this.fixedHeaderElement,{zIndex:10});var s=this.ulElement.querySelector("."+k.group+":not(.e-hide-listitem)");this.fixedHeaderElement.innerHTML=s.innerHTML},l.prototype.getSortedDataSource=function(e){if(e&&"None"!==this.sortOrder){var t=this.fields.text?this.fields.text:"text";"string"!==this.typeOfData(e).typeof&&"number"!==this.typeOfData(e).typeof&&"boolean"!==this.typeOfData(e).typeof||(t=""),e=s.ListBase.getDataSource(e,s.ListBase.addSorting(this.sortOrder,t))}return e},l.prototype.getIndexByValue=function(e){for(var i,s=this.getItems(),l=0;l<s.length;l++)if(!t.isNullOrUndefined(e)&&s[l].getAttribute("data-value")===e.toString()){i=l;break}return i},l.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i)},l.prototype.setFields=function(){this.fields.value&&!this.fields.text?this.updateFields(this.fields.value,this.fields.value):!this.fields.value&&this.fields.text?this.updateFields(this.fields.text,this.fields.text):this.fields.value||this.fields.text||this.updateFields("text","text")},l.prototype.resetList=function(e,i,s){this.list&&(("SELECT"===this.element.tagName&&this.element.options.length>0||"UL"===this.element.tagName&&this.element.childNodes.length>0)&&!(e instanceof Array?e.length>0:!t.isNullOrUndefined(e))&&this.selectData&&this.selectData.length>0&&(e=this.selectData),this.setListData(e,i,s))},l.prototype.updateSelectElementData=function(e){e&&t.isNullOrUndefined(this.selectData)&&this.listData&&this.listData.length>0&&(this.selectData=this.listData)},l.prototype.updateSelection=function(){},l.prototype.renderList=function(){this.render()},l.prototype.updateDataSource=function(e){this.resetList(this.dataSource)},l.prototype.setUpdateInitial=function(e,t){this.isDataFetched=!1;for(var i={},s=0;e.length>s;s++)t[e[s]]&&"fields"===e[s]?(this.setFields(),i[e[s]]=t[e[s]]):t[e[s]]&&(i[e[s]]=t[e[s]]);Object.keys(i).length>0&&(-1===Object.keys(i).indexOf("dataSource")&&(i.dataSource=this.dataSource),this.updateDataSource(i))},l.prototype.onPropertyChanged=function(e,i){"dropdownbase"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e),this.setUpdateInitial(["sortOrder","itemTemplate"],e);for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"query":case"sortOrder":case"dataSource":case"itemTemplate":break;case"enableRtl":this.setEnableRtl();break;case"enabled":this.setEnabled();break;case"groupTemplate":if(this.renderGroupTemplate(this.list),this.ulElement&&this.fixedHeaderElement){var o=this.ulElement.querySelector("."+k.group);this.fixedHeaderElement.innerHTML=o.innerHTML}break;case"locale":this.list&&!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length&&this.l10nUpdate();break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex()}},l.prototype.render=function(e){this.list=this.createElement("div",{className:k.content,attrs:{tabindex:"0"}}),this.list.classList.add(k.root),this.setFields();var i={duration:300,selector:"."+k.li};this.rippleFun=t.rippleEffect(this.list,i);var s=this.element.querySelector("select>optgroup");if(!this.fields.groupBy&&t.isNullOrUndefined(s)||this.isGroupChecking||t.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this),"dropdownbase"===this.getModuleName()){this.element.getAttribute("tabindex")&&this.list.setAttribute("tabindex",this.element.getAttribute("tabindex")),t.removeClass([this.element],k.root),this.element.style.display="none";var l=this.createElement("div");this.element.parentElement.insertBefore(l,this.element),l.appendChild(this.element),l.appendChild(this.list)}this.setEnableRtl(),this.setEnabled(),e||this.initialize()},l.prototype.getModuleName=function(){return"dropdownbase"},l.prototype.getItems=function(){return this.ulElement.querySelectorAll("."+k.li)},l.prototype.addItem=function(e,i){if((!this.list||this.list.textContent===this.noRecordsTemplate&&"listbox"!==this.getModuleName())&&this.renderList(),"None"!==this.sortOrder&&t.isNullOrUndefined(i)){var l=[].slice.call(this.listData);l.push(e),l=this.getSortedDataSource(l),i=this.fields.groupBy?(l=s.ListBase.groupDataSource(l,this.fields.properties,this.sortOrder)).indexOf(e):l.indexOf(e)}this.DropDownBaseresetBlazorTemplates(!0,!1,!1,!1);var o=this.getItems().length,r=this.list.querySelector("."+k.selected);e=e instanceof Array?e:[e];var n;n=t.isNullOrUndefined(i)||i<0||i>o-1?o:i;var a=this.fields;e&&a.groupBy&&(e=s.ListBase.groupDataSource(e,a.properties));for(var h=[],p=0;p<e.length;p++){var u=e[p],c=u.isHeader,d=this.createElement("li",{className:c?k.group:k.li,id:"option-add-"+p}),m=u instanceof Object?t.getValue(a.text,u):u;if(c&&(d.innerText=m),this.itemTemplate&&!c){var f=t.compile(this.itemTemplate)(u,this,"itemTemplate",this.itemTemplateId,this.isStringTemplate,null,d);f&&t.append(f,d),this.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1)}else c||d.appendChild(document.createTextNode(m));d.setAttribute("data-value",u instanceof Object?t.getValue(a.value,u):u),d.setAttribute("role","option"),this.notify("addItem",{module:"CheckBoxSelection",item:d}),h.push(d),this.listData.push(u),"None"===this.sortOrder&&t.isNullOrUndefined(i)&&0===n&&(n=null),this.updateActionCompleteData(d,u,n),this.trigger("beforeItemRender",{element:d,item:u})}if(0===o&&t.isNullOrUndefined(this.list.querySelector("ul")))this.list.innerHTML="",this.list.classList.remove(k.noData),this.list.appendChild(this.ulElement),this.liCollections=h,t.append(h,this.ulElement),this.updateAddItemList(this.list,o);else{"listbox"===this.getModuleName()&&0===o&&(this.ulElement.innerHTML="");for(var v=[],p=0;p<e.length;p++){for(var y=this.ulElement.querySelectorAll(".e-list-group-item"),g=0;g<y.length;g++)v[g]=y[g].innerText;if(v.indexOf(h[p].innerText)>-1&&a.groupBy){for(g=0;g<y.length;g++)if(v[g]===h[p].innerText){"None"===this.sortOrder?this.ulElement.insertBefore(h[p+1],y[g+1]):this.ulElement.insertBefore(h[p+1],this.ulElement.childNodes[i]),p+=1;break}}else this.liCollections[n]?this.liCollections[n].parentNode.insertBefore(h[p],this.liCollections[n]):this.ulElement.appendChild(h[p]);var C=[].slice.call(this.liCollections);C.splice(n,0,h[p]),this.liCollections=C,n+=1,"multiselect"===this.getModuleName()&&this.updateDataList()}}(r||0===i)&&this.updateSelection()},l.prototype.validationAttribute=function(e,t){var i=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");t.setAttribute("name",i),e.removeAttribute("name");for(var s=["required","aria-required","form"],l=0;l<s.length;l++)if(e.getAttribute(s[l])){var o=e.getAttribute(s[l]);t.setAttribute(s[l],o),e.removeAttribute(s[l])}},l.prototype.setZIndex=function(){},l.prototype.updateActionCompleteData=function(e,t,i){},l.prototype.updateAddItemList=function(e,t){},l.prototype.updateDataList=function(){},l.prototype.getDataByValue=function(e){if(!t.isNullOrUndefined(this.listData)){var i=this.typeOfData(this.listData).typeof;if("string"===i||"number"===i||"boolean"===i)for(var s=0,l=this.listData;s<l.length;s++){n=l[s];if(!t.isNullOrUndefined(n)&&n===e)return n}else for(var o=0,r=this.listData;o<r.length;o++){var n=r[o];if(!t.isNullOrUndefined(n)&&t.getValue(this.fields.value?this.fields.value:"value",n)===e)return n}}return null},l.prototype.destroy=function(){document.body.contains(this.list)&&(t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t.isNullOrUndefined(this.rippleFun)||this.rippleFun(),t.detach(this.list)),e.prototype.destroy.call(this)},O([t.Complex({text:null,value:null,iconCss:null,groupBy:null},A)],l.prototype,"fields",void 0),O([t.Property(!1)],l.prototype,"enablePersistence",void 0),O([t.Property(null)],l.prototype,"itemTemplate",void 0),O([t.Property(null)],l.prototype,"groupTemplate",void 0),O([t.Property("No records found")],l.prototype,"noRecordsTemplate",void 0),O([t.Property("Request failed")],l.prototype,"actionFailureTemplate",void 0),O([t.Property("None")],l.prototype,"sortOrder",void 0),O([t.Property(!0)],l.prototype,"enabled",void 0),O([t.Property([])],l.prototype,"dataSource",void 0),O([t.Property(null)],l.prototype,"query",void 0),O([t.Property("StartsWith")],l.prototype,"filterType",void 0),O([t.Property(!0)],l.prototype,"ignoreCase",void 0),O([t.Property(1e3)],l.prototype,"zIndex",void 0),O([t.Property(!1)],l.prototype,"ignoreAccent",void 0),O([t.Property()],l.prototype,"locale",void 0),O([t.Event()],l.prototype,"actionBegin",void 0),O([t.Event()],l.prototype,"actionComplete",void 0),O([t.Event()],l.prototype,"actionFailure",void 0),O([t.Event()],l.prototype,"select",void 0),O([t.Event()],l.prototype,"dataBound",void 0),O([t.Event()],l.prototype,"created",void 0),O([t.Event()],l.prototype,"destroyed",void 0),l=O([t.NotifyPropertyChanges],l)}(t.Component),D=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),T=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},I={root:"e-dropdownlist",hover:k.hover,selected:k.selected,rtl:k.rtl,li:k.li,disable:k.disabled,base:k.root,focus:k.focus,input:"e-input-group",inputFocus:"e-input-focus",icon:"e-input-group-icon e-ddl-icon",iconAnimation:"e-icon-anim",value:"e-input-value",device:"e-ddl-device",backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",filterParent:"e-filter-parent",mobileFilter:"e-ddl-device-filter",footer:"e-ddl-footer",header:"e-ddl-header",clearIcon:"e-clear-icon",clearIconHide:"e-clear-icon-hide",popupFullScreen:"e-popup-full-page",disableIcon:"e-ddl-disable-icon",hiddenElement:"e-ddl-hidden"},L={container:null,buttons:[]},N=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isListSearched=!1,s.preventChange=!1,s.isAngular=!1,s}return D(s,e),s.prototype.preRender=function(){var i=t.isBlazor()&&this.isServerRendered;this.isServerBlazor=!!i,this.valueTempElement=null,this.isServerBlazor?this.initializeData():(this.element.style.opacity="0",this.initializeData(),e.prototype.preRender.call(this)),this.activeIndex=this.index,this.queryString=""},s.prototype.initializeData=function(){this.isPopupOpen=!1,this.isDocumentClick=!1,this.isInteracted=!1,this.isFilterFocus=!1,this.beforePopupOpen=!1,this.initial=!0,this.initRemoteRender=!1,this.isNotSearchList=!1,this.isTyped=!1,this.isSelected=!1,this.preventFocus=!1,this.preventAutoFill=!1,this.isValidKey=!1,this.typedString="",this.isEscapeKey=!1,this.isPreventBlur=!1,this.isTabKey=!1,this.actionCompleteData={isUpdated:!1},this.actionData={isUpdated:!1},this.prevSelectPoints={},this.isSelectCustom=!1,this.isDropDownClick=!1,this.preventAltUp=!1,this.isCustomFilter=!1,this.isSecondClick=!1,this.previousValue=null,this.keyConfigure={tab:"tab",enter:"13",escape:"27",end:"35",home:"36",down:"40",up:"38",pageUp:"33",pageDown:"34",open:"alt+40",close:"shift+tab",hide:"alt+38",space:"32"}},s.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},s.prototype.renderList=function(t){this.isServerBlazor?this.interopAdaptor.invokeMethodAsync("OnServerRenderList",this.beforePopupOpen,!1):(e.prototype.render.call(this,t),this.unWireListEvents(),this.wireListEvents())},s.prototype.floatLabelChange=function(){if("dropdownlist"===this.getModuleName()&&"Auto"===this.floatLabelType){var e=this.inputWrapper.container.querySelector(".e-float-text");""!==this.inputElement.value||this.isInteracted?t.classList(e,["e-label-top"],["e-label-bottom"]):t.classList(e,["e-label-bottom"],["e-label-top"])}},s.prototype.resetHandler=function(e){e.preventDefault(),this.clearAll(e)},s.prototype.resetFocusElement=function(){if(this.removeHover(),this.removeSelection(),this.removeFocus(),this.list.scrollTop=0,"autocomplete"!==this.getModuleName()&&!t.isNullOrUndefined(this.ulElement)){var e=this.ulElement.querySelector("."+I.li);e&&e.classList.add(I.focus)}},s.prototype.clearAll=function(e,s){!t.isNullOrUndefined(s)&&(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s.dataSource)&&(s.dataSource instanceof i.DataManager||0!==s.dataSource.length))||(this.isActive=!0,this.resetSelection(s));var l=this.getItemData();this.previousValue!==l.value&&this.onChangeEvent(e)},s.prototype.resetSelection=function(e){this.list&&(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length)?(!this.allowFiltering||"autocomplete"===this.getModuleName()||t.isNullOrUndefined(this.actionCompleteData.ulElement)||t.isNullOrUndefined(this.actionCompleteData.list)||this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(!0),this.actionCompleteData.list),this.resetFocusElement()):(this.selectedLI=null,this.actionCompleteData.isUpdated=!1,this.actionCompleteData.ulElement=null,this.actionCompleteData.list=null,this.resetList(e.dataSource))),this.isServerBlazor||(this.hiddenElement.innerHTML=""),this.inputElement.value="",this.value=null,this.itemData=null,this.text=null,this.index=null,this.activeIndex=null,this.item=null,this.queryString="",this.valueTempElement&&(t.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.setSelection(null,null),this.isSelectCustom=!1,this.updateIconState(),this.cloneElements()},s.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if("class"===s){var l=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==l&&t.addClass([this.inputWrapper.container],l.split(" "))}else if("disabled"===s&&"disabled"===this.htmlAttributes[s])this.enabled=!1,this.setEnable();else if("readonly"!==s||t.isNullOrUndefined(this.htmlAttributes[s]))if("style"===s)this.inputWrapper.container.setAttribute("style",this.htmlAttributes[s]);else{var r=["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],n=["name","required"];"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||r.push("tabindex"),n.indexOf(s)>-1||0===s.indexOf("data")?this.hiddenElement.setAttribute(s,this.htmlAttributes[s]):r.indexOf(s)>-1?"placeholder"===s?o.Input.setPlaceholder(this.htmlAttributes[s],this.inputElement):this.inputElement.setAttribute(s,this.htmlAttributes[s]):this.inputWrapper.container.setAttribute(s,this.htmlAttributes[s])}else this.readonly=!0,this.dataBind()}"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.inputWrapper.container.removeAttribute("tabindex")},s.prototype.getAriaAttributes=function(){return{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-haspopup":"true","aria-expanded":"false","aria-activedescendant":"null","aria-live":"polite","aria-labelledby":this.hiddenElement.id}},s.prototype.setEnableRtl=function(){o.Input.setEnableRtl(this.enableRtl,[this.inputElement.parentElement]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},s.prototype.setEnable=function(){o.Input.setEnabled(this.enabled,this.inputElement),this.enabled?(t.removeClass([this.inputWrapper.container],I.disable),this.inputElement.setAttribute("aria-disabled","false"),this.targetElement().setAttribute("tabindex",this.tabIndex)):(this.hidePopup(),t.addClass([this.inputWrapper.container],I.disable),this.inputElement.setAttribute("aria-disabled","true"),this.targetElement().tabIndex=-1)},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.getLocaleName=function(){return"drop-down-list"},s.prototype.preventTabIndex=function(e){"dropdownlist"===this.getModuleName()&&(e.tabIndex=-1)},s.prototype.targetElement=function(){return this.inputWrapper.container},s.prototype.getNgDirective=function(){return"EJS-DROPDOWNLIST"},s.prototype.getElementByText=function(e){return this.getElementByValue(this.getValueByText(e))},s.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},s.prototype.initValue=function(){this.renderList(),this.dataSource instanceof i.DataManager?this.initRemoteRender=!0:this.updateValues()},s.prototype.updateValues=function(){if(t.isNullOrUndefined(this.value))if(this.text&&t.isNullOrUndefined(this.value)){var e=this.getElementByText(this.text);if(t.isNullOrUndefined(e))return void this.setProperties({text:null});this.setSelection(e,null)}else this.setSelection(this.liCollections[this.activeIndex],null);else this.setSelection(this.getElementByValue(this.value),null);this.setHiddenValue(),o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.onBlur=function(e){if(this.enabled){var i=e.relatedTarget,s=e.target,l=this.isPreventBlur;if(this.isPreventBlur=!1,l&&!this.isDocumentClick&&this.isPopupOpen&&(!t.isNullOrUndefined(s)||!this.isFilterLayout()&&t.isNullOrUndefined(i)))return void("dropdownlist"===this.getModuleName()&&this.allowFiltering&&this.isPopupOpen?this.filterInput.focus():this.targetElement().focus());if(this.isDocumentClick||!t.isNullOrUndefined(this.popupObj)&&document.body.contains(this.popupObj.element)&&this.popupObj.element.classList.contains(I.mobileFilter))return void(this.beforePopupOpen||(this.isDocumentClick=!1));("dropdownlist"===this.getModuleName()&&!this.isFilterFocus&&i!==this.inputElement&&(document.activeElement!==i||document.activeElement===i&&s.classList.contains(I.inputFocus))||t.isNullOrUndefined(i)&&"dropdownlist"===this.getModuleName()&&this.allowFiltering&&s!==this.inputWrapper.container||"dropdownlist"!==this.getModuleName()&&!this.inputWrapper.container.contains(i)||this.isTabKey)&&(this.isDocumentClick=!!this.isPopupOpen,this.focusOutAction(e),this.isTabKey=!1),!this.isRequested||this.isPopupOpen||this.isPreventBlur||(this.isActive=!1,this.beforePopupOpen=!1)}},s.prototype.focusOutAction=function(e){this.isInteracted=!1,this.focusOut(e),this.onFocusOut()},s.prototype.onFocusOut=function(){this.enabled&&(this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(null)),this.floatLabelChange(),this.dispatchEvent(this.hiddenElement,"change"),"dropdownlist"===this.getModuleName()&&"INPUT"!==this.element.tagName&&this.dispatchEvent(this.inputElement,"blur"),this.inputWrapper.clearButton&&t.addClass([this.inputWrapper.clearButton],I.clearIconHide),this.trigger("blur"))},s.prototype.onFocus=function(e){if(!this.isInteracted){this.isInteracted=!0;var t={isInteracted:!!e,event:e};this.trigger("focus",t)}this.updateIconState()},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputElement,"form");if(i&&e.target===i){var s=this.element.tagName===this.getNgDirective()?null:this.inputElement.getAttribute("value");this.text=s}},s.prototype.wireEvent=function(){t.EventHandler.add(this.inputWrapper.container,"mousedown",this.dropDownClick,this),t.EventHandler.add(this.inputWrapper.container,"focus",this.focusIn,this),t.EventHandler.add(this.inputWrapper.container,"keypress",this.onSearch,this),this.bindCommonEvent()},s.prototype.bindCommonEvent=function(){t.EventHandler.add(this.targetElement(),"blur",this.onBlur,this);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),t.Browser.isDevice?this.keyboardModule=new t.KeyboardEvents(this.targetElement(),{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.keyboardModule=new t.KeyboardEvents(this.targetElement(),{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.bindClearEvent()},s.prototype.bindClearEvent=function(){this.showClearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},s.prototype.unBindCommonEvent=function(){this.targetElement()&&t.EventHandler.remove(this.targetElement(),"blur",this.onBlur);var e=this.inputElement&&t.closest(this.inputElement,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),t.Browser.isDevice||this.keyboardModule.destroy(),this.showClearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown",this.resetHandler)},s.prototype.updateIconState=function(){this.showClearButton&&(""===this.inputElement.value||this.readonly?t.addClass([this.inputWrapper.clearButton],I.clearIconHide):t.removeClass([this.inputWrapper.clearButton],I.clearIconHide))},s.prototype.wireListEvents=function(){t.EventHandler.add(this.list,"click",this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},s.prototype.onSearch=function(e){32!==e.charCode&&13!==e.charCode&&(void 0===this.list&&(this.isServerBlazor?(this.isServerIncrementalSearch=!0,this.interopAdaptor.invokeMethodAsync("OnServerRenderList",!0,!1)):this.renderList()),this.searchKeyEvent=e,this.onServerIncrementalSearch(e))},s.prototype.onServerIncrementalSearch=function(e){this.isRequested||t.isNullOrUndefined(this.list)||t.isNullOrUndefined(this.list.querySelector("li"))||!this.enabled||this.readonly||this.incrementalSearch(e)},s.prototype.onMouseClick=function(e){var i=e.target,s=t.closest(i,"."+k.li);if(this.isValidLI(s))if(this.setSelection(s,e),t.Browser.isDevice&&this.isFilterLayout())history.back();else{this.closePopup(100)}},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+k.li);this.setHover(i)},s.prototype.setHover=function(e){this.enabled&&this.isValidLI(e)&&!e.classList.contains(k.hover)&&(this.removeHover(),t.addClass([e],k.hover))},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.removeHover=function(){if(this.list){var e=this.isServerBlazor&&this.popupObj&&this.popupObj.element?this.popupObj.element.querySelectorAll("."+k.hover):this.list.querySelectorAll("."+k.hover);e&&e.length&&t.removeClass(e,k.hover)}},s.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},s.prototype.incrementalSearch=function(e){if(this.liCollections.length>0){var i=a(e.charCode,this.liCollections,this.activeIndex,!0,this.element.id,this.isServerBlazor);t.isNullOrUndefined(i)||(this.setSelection(i,e),this.setScrollPosition())}},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(l.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],I.disableIcon),this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=t.Browser.isDevice&&!t.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[1]||!t.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[0]||this.inputWrapper.buttons[0],t.addClass([this.spinnerElement],I.disableIcon),l.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),l.showSpinner(this.spinnerElement))},s.prototype.keyActionHandler=function(e){if(this.enabled){var i="pageUp"===e.action||"pageDown"===e.action,s="dropdownlist"!==this.getModuleName()&&("home"===e.action||"end"===e.action);this.isEscapeKey="escape"===e.action,this.isTabKey=!this.isPopupOpen&&"tab"===e.action;var l="down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action,o="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action;if((!(this.isEditTextBox()||i||s)||this.isPopupOpen)&&!this.readonly){var r="tab"===e.action||"close"===e.action;if(void 0!==this.list||this.isRequested||r||"escape"===e.action||(this.searchKeyEvent=e,this.renderList()),((!this.isServerBlazor||"open"!==e.action&&"space"!==e.action)&&t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&o&&0===this.liCollections.length||this.isRequested)&&(!this.isServerBlazor||!l))return;switch((r&&"autocomplete"!==this.getModuleName()&&this.isPopupOpen||"escape"===e.action)&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,this.isTyped=!o&&"escape"!==e.action&&this.isTyped,e.action){case"down":case"up":this.updateUpDownAction(e);break;case"pageUp":this.pageUpSelection(this.activeIndex-this.getPageCount(),e),e.preventDefault();break;case"pageDown":this.pageDownSelection(this.activeIndex+this.getPageCount(),e),e.preventDefault();break;case"home":case"end":this.updateHomeEndAction(e);break;case"space":"dropdownlist"===this.getModuleName()&&(this.beforePopupOpen||this.showPopup());break;case"open":this.showPopup();break;case"hide":this.preventAltUp=this.isPopupOpen,this.hidePopup(e),this.focusDropDown(e);break;case"enter":this.selectCurrentItem(e);break;case"tab":this.selectCurrentValueOnTab(e);break;case"escape":case"close":this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))}}}},s.prototype.updateUpDownAction=function(e){if(this.isServerBlazor&&t.isNullOrUndefined(this.list))this.isServerNavigation=!0,this.interopAdaptor.invokeMethodAsync("OnServerRenderList",!0,!1);else{this.isServerNavigation=!1;var i=this.list.querySelector("."+I.focus);if(this.isSelectFocusItem(i))this.setSelection(i,e);else{var s="down"===e.action?this.activeIndex+1:this.activeIndex-1,l=0;"autocomplete"===this.getModuleName()&&(l="down"===e.action&&t.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,s=s<0?this.liCollections.length-1:s===this.liCollections.length?0:s);var o=t.isNullOrUndefined(this.activeIndex)?this.liCollections[l]:this.liCollections[s];t.isNullOrUndefined(o)||this.setSelection(o,e)}e.preventDefault()}},s.prototype.updateHomeEndAction=function(e){if("dropdownlist"===this.getModuleName())if(this.isServerBlazor&&t.isNullOrUndefined(this.list))this.isServerNavigation=!0,this.interopAdaptor.invokeMethodAsync("OnServerRenderList",!0,!1);else{this.isServerNavigation=!1;var i=0;if(i="home"===e.action?0:this.getItems().length-1,e.preventDefault(),this.activeIndex===i)return;this.setSelection(this.liCollections[i],e)}},s.prototype.selectCurrentValueOnTab=function(e){"autocomplete"===this.getModuleName()?this.selectCurrentItem(e):this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))},s.prototype.mobileKeyActionHandler=function(e){if(this.enabled&&(!this.isEditTextBox()||this.isPopupOpen)&&!this.readonly){if(void 0!==this.list||this.isRequested||(this.searchKeyEvent=e,this.renderList()),t.isNullOrUndefined(this.list)||!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length||this.isRequested)return;"enter"===e.action&&this.selectCurrentItem(e)}},s.prototype.selectCurrentItem=function(e){if(this.isPopupOpen){var t=this.list.querySelector("."+I.focus);t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.hidePopup(),this.focusDropDown(e)}else this.showPopup()},s.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},s.prototype.getPageCount=function(){var e=this.list.classList.contains(k.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height");return Math.round(this.list.getBoundingClientRect().height/parseInt(e,10))},s.prototype.pageUpSelection=function(e,t){var i=e>=0?this.liCollections[e+1]:this.liCollections[0];this.setSelection(i,t)},s.prototype.pageDownSelection=function(e,t){var i=this.getItems(),s=e<=i.length?this.liCollections[e-1]:this.liCollections[i.length-1];this.setSelection(s,t)},s.prototype.unWireEvent=function(){t.EventHandler.remove(this.inputWrapper.container,"mousedown",this.dropDownClick),t.EventHandler.remove(this.inputWrapper.container,"keypress",this.onSearch),t.EventHandler.remove(this.inputWrapper.container,"focus",this.focusIn),this.unBindCommonEvent()},s.prototype.unWireListEvents=function(){t.EventHandler.remove(this.list,"click",this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave)},s.prototype.checkSelector=function(e){return'[id="'+e.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g,"\\$1")+'"]'},s.prototype.onDocumentClick=function(e){var i=e.target;if(!t.isNullOrUndefined(this.popupObj)&&t.closest(i,this.checkSelector(this.popupObj.element.id))||this.inputWrapper.container.contains(e.target))i===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()&&!this.allowFiltering&&t.Browser.isDevice&&i===this.inputWrapper.buttons[0]||(this.isPreventBlur=(t.Browser.isIE||"edge"===t.Browser.info.name)&&(document.activeElement===this.targetElement()||document.activeElement===this.filterInput),e.preventDefault());else if(this.inputWrapper.container.classList.contains(I.inputFocus)||this.isPopupOpen){this.isDocumentClick=!0;var s=this.isRequested;this.isInteracted=!1,this.hidePopup(e),s||(this.onFocusOut(),this.inputWrapper.container.classList.remove(I.inputFocus))}},s.prototype.activeStateChange=function(){this.isDocumentClick&&(this.hidePopup(),this.onFocusOut(),this.inputWrapper.container.classList.remove(I.inputFocus))},s.prototype.focusDropDown=function(e){!this.initial&&this.isFilterLayout()&&this.focusIn(e)},s.prototype.dropDownClick=function(e){if(3!==e.which&&2!==e.button&&!this.targetElement().classList.contains(I.disable)&&this.inputWrapper.clearButton!==e.target){var i=e.target;if(i===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()||e.preventDefault(),this.readonly)this.focusIn(e);else{this.isPopupOpen?(this.hidePopup(),this.isFilterLayout()&&this.focusDropDown(e)):(this.focusIn(e),this.floatLabelChange(),this.queryString=""===this.inputElement.value.trim()?null:this.inputElement.value,this.isDropDownClick=!0,this.showPopup());var s=this,l=t.isBlazor()?1e3:this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isSecondClick||setTimeout(function(){s.cloneElements(),s.isSecondClick=!0},l)}}},s.prototype.cloneElements=function(){if(this.list){var e=this.list.querySelector("ul");e&&(e=e.cloneNode?e.cloneNode(!0):e,this.actionCompleteData.ulElement=e)}},s.prototype.updateSelectedItem=function(e,i,s,l){var o=this;this.removeSelection(),e.classList.add(k.selected),this.removeHover();var r=this.getFormattedValue(e.getAttribute("data-value")),n=this.getDataByValue(r);if(this.initial||s||t.isNullOrUndefined(i))this.selectEventCallback(e,i,s,n,r),this.isServerBlazor&&this.interopAdaptor.invokeMethodAsync("OnServerItemData",this.itemData),l&&this.setSelectOptions(e,i);else{var a=this.detachChanges(n);this.isSelected=!0;var h={e:i,item:e,itemData:a,isInteracted:!!i,cancel:!1};this.trigger("select",h,function(t){t.cancel?e.classList.remove(k.selected):(o.selectEventCallback(e,i,s,n,r),o.isServerBlazor&&o.interopAdaptor.invokeMethodAsync("OnServerItemData",o.itemData),l&&o.setSelectOptions(e,i))})}},s.prototype.selectEventCallback=function(e,i,s,l,o){this.previousItemData=t.isNullOrUndefined(this.itemData)?null:this.itemData,this.item=e,this.itemData=l;var r=this.list.querySelector("."+k.focus);r&&t.removeClass([r],k.focus),e.setAttribute("aria-selected","true"),this.activeIndex=this.getIndexByValue(o)},s.prototype.activeItem=function(e){this.isValidLI(e)&&!e.classList.contains(k.selected)&&(this.removeSelection(),e.classList.add(k.selected),this.removeHover(),e.setAttribute("aria-selected","true"))},s.prototype.setValue=function(e){var i=this.getItemData();null===i.value?t.isBlazor()&&null!==i.text||""!==i.text?o.Input.setValue(i.text,this.inputElement,this.floatLabelType,this.showClearButton):o.Input.setValue(null,this.inputElement,this.floatLabelType,this.showClearButton):o.Input.setValue(i.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isServerBlazor&&this.interopAdaptor.invokeMethodAsync("OnServerValueTemplate",i),this.valueTemplate&&null!==this.itemData&&!this.isServerBlazor?(this.DropDownBaseresetBlazorTemplates(!1,!1,!1,!1,!0),this.setValueTemplate()):this.inputElement.previousSibling===this.valueTempElement&&(t.detach(this.valueTempElement),this.inputElement.style.display="block");var s=I.clearIcon,l=this.isFiltering()&&this.filterInput&&"combobox"===this.getModuleName()&&this.filterInput.parentElement.querySelector("."+s);return this.isFiltering()&&l&&l.style.removeProperty("visibility"),this.previousValue===i.value?(this.isSelected=!1,!0):(this.isSelected=!this.initial,this.isSelectCustom=!1,"dropdownlist"===this.getModuleName()&&this.updateIconState(),!1)},s.prototype.setSelection=function(e,t){this.isValidLI(e)&&(!e.classList.contains(k.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(k.selected))?this.updateSelectedItem(e,t,!1,!0):this.setSelectOptions(e,t)},s.prototype.setSelectOptions=function(e,i){this.list&&this.removeHover(),this.previousSelectedLI=t.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.setValue(i)||(this.isPopupOpen&&(t.attributes(this.targetElement(),{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null}),this.isFilterLayout()&&this.filterInput&&t.attributes(this.filterInput,{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null})),(!this.isPopupOpen&&!t.isNullOrUndefined(e)||this.isPopupOpen&&!t.isNullOrUndefined(i)&&("keydown"!==i.type||"keydown"===i.type&&"enter"===i.action))&&(this.isSelectCustom=!1,this.onChangeEvent(i)),!this.isPopupOpen||t.isNullOrUndefined(this.selectedLI)||null===this.itemData||i&&"click"===i.type||this.setScrollPosition(i),"mozilla"!==t.Browser.info.name&&(t.attributes(this.inputElement,{"aria-label":this.inputElement.value}),t.attributes(this.targetElement(),{"aria-describedby":this.inputElement.id}),this.targetElement().removeAttribute("aria-live")))},s.prototype.dropdownCompiler=function(e){var t=!1;if(e)try{t=!!document.querySelectorAll(e).length}catch(e){t=!1}return t},s.prototype.setValueTemplate=function(){var e;this.isReact&&this.clearTemplate(["valueTemplate"]),this.valueTempElement||(this.valueTempElement=this.createElement("span",{className:I.value}),this.inputElement.parentElement.insertBefore(this.valueTempElement,this.inputElement),this.inputElement.style.display="none"),this.valueTempElement.innerHTML="";var i=t.isBlazor()?JSON.parse(JSON.stringify(this.itemData)):this.itemData,s=(e=this.dropdownCompiler(this.valueTemplate)?t.compile(document.querySelector(this.valueTemplate).innerHTML.trim()):t.compile(this.valueTemplate))(i,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,this.valueTempElement);if(s&&s.length>0)for(var l=0;l<s.length;l++)this.valueTempElement.appendChild(s[l]);this.renderReactTemplates(),this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!0,!0,!0)},s.prototype.removeSelection=function(){if(this.list){var e=this.list.querySelectorAll("."+k.selected);e.length&&(t.removeClass(e,k.selected),e[0].removeAttribute("aria-selected"))}},s.prototype.getItemData=function(){var e=this.fields,i=null;i=this.itemData;var s,l;return t.isNullOrUndefined(i)||(s=t.getValue(e.value,i),l=t.getValue(e.text,i)),{value:t.isNullOrUndefined(i)||t.isUndefined(s)?i:s,text:t.isNullOrUndefined(i)||t.isUndefined(s)?i:l}},s.prototype.onChangeEvent=function(e){var t=this.getItemData(),i=this.isSelectCustom?null:this.activeIndex;this.setProperties({index:i,text:t.text,value:t.value},!0),this.detachChangeEvent(e)},s.prototype.detachChanges=function(e){return"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e},s.prototype.detachChangeEvent=function(e){if(this.isSelected=!1,this.previousValue=this.value,this.activeIndex=this.index,this.typedString=t.isNullOrUndefined(this.text)?"":this.text,!this.initial){var i=this.detachChanges(this.itemData),s=void 0;s="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData,this.setHiddenValue();var l={e:e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:s,isInteracted:!!e,value:this.value,element:this.element};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",l),this.isServerBlazor&&this.enablePersistence&&this.interopAdaptor.invokeMethodAsync("ServerChange")}!t.isNullOrUndefined(this.value)&&""!==this.value||"Always"===this.floatLabelType||t.removeClass([this.inputWrapper.container],"e-valid-input")},s.prototype.setHiddenValue=function(){if(t.isNullOrUndefined(this.value))this.isServerBlazor||(this.hiddenElement.innerHTML="");else if(this.isServerBlazor&&this.hiddenElement.querySelector("option"))(e=this.hiddenElement.querySelector("option")).textContent=this.text,e.setAttribute("value",this.value.toString());else if(!this.isServerBlazor){this.hiddenElement.innerHTML="<option selected>"+this.text+"</option>";var e=this.hiddenElement.querySelector("option");e.setAttribute("value",this.value.toString())}},s.prototype.onFilterUp=function(e){if(e.ctrlKey&&86===e.keyCode||!this.isValidKey&&40!==e.keyCode&&38!==e.keyCode)this.isValidKey=!1;else switch(this.isValidKey=!1,e.keyCode){case 38:case 40:"autocomplete"!==this.getModuleName()||this.isPopupOpen||this.preventAltUp||this.isRequested?this.preventAutoFill=!1:(this.preventAutoFill=!0,this.searchLists(e)),this.preventAltUp=!1,e.preventDefault();break;case 46:case 8:this.typedString=this.filterInput.value,!this.isPopupOpen&&""!==this.typedString||this.isPopupOpen&&this.queryString.length>0?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&""===this.queryString&&"autocomplete"!==this.getModuleName()?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&(this.list&&this.resetFocusElement(),this.activeIndex=null,"dropdownlist"!==this.getModuleName()&&(this.preventAutoFill=!0,this.searchLists(e),"autocomplete"===this.getModuleName()&&this.hidePopup())),e.preventDefault();break;default:this.typedString=this.filterInput.value,this.preventAutoFill=!1,this.searchLists(e)}},s.prototype.onFilterDown=function(e){switch(e.keyCode){case 13:break;case 40:case 38:this.queryString=this.filterInput.value,e.preventDefault();break;case 9:this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&e.preventDefault();break;default:this.prevSelectPoints=this.getSelectionPoints(),this.queryString=this.filterInput.value}},s.prototype.removeFillSelection=function(){if(this.isInteracted){var e=this.getSelectionPoints();this.inputElement.setSelectionRange(e.end,e.end)}},s.prototype.getQuery=function(e){var t;if(!this.isCustomFilter&&this.allowFiltering&&this.filterInput){t=e?e.clone():this.query?this.query.clone():new i.Query;var s=""===this.typedString?"contains":this.filterType,l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var o=this.fields.text?this.fields.text:"";t.where(o,s,this.typedString,this.ignoreCase,this.ignoreAccent)}else t.where("",s,this.typedString,this.ignoreCase,this.ignoreAccent)}else t=e?e.clone():this.query?this.query.clone():new i.Query;return t},s.prototype.getSelectionPoints=function(){var e=this.inputElement;return{start:Math.abs(e.selectionStart),end:Math.abs(e.selectionEnd)}},s.prototype.searchLists=function(e){var t=this;if(this.isTyped=!0,this.activeIndex=null,this.isListSearched=!0,this.filterInput.parentElement.querySelector("."+I.clearIcon)&&(this.filterInput.parentElement.querySelector("."+I.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible"),this.isDataFetched=!1,this.isFiltering())if(this.isServerBlazor)this.beforePopupOpen="combobox"===this.getModuleName()&&this.isFiltering()&&!this.beforePopupOpen?!this.beforePopupOpen:this.beforePopupOpen,""===this.filterInput.value&&"dropdownlist"!==this.getModuleName()?this.interopAdaptor.invokeMethodAsync("OnServerRenderList",this.beforePopupOpen,!1):this.interopAdaptor.invokeMethodAsync("OnServerFilter",this.filterInput.value);else{var i={preventDefaultAction:!1,text:this.filterInput.value,updateData:function(e,s,l){i.cancel||(t.isCustomFilter=!0,t.filteringAction(e,s,l))},baseEventArgs:e,cancel:!1};this.trigger("filtering",i,function(e){e.cancel||t.isCustomFilter||e.preventDefaultAction||t.filteringAction(t.dataSource,null,t.fields)})}},s.prototype.filter=function(e,t,i){this.isCustomFilter=!0,this.filteringAction(e,t,i)},s.prototype.filteringAction=function(e,i,s){t.isNullOrUndefined(this.filterInput)||(this.beforePopupOpen=!(!this.isPopupOpen&&"combobox"===this.getModuleName()&&""===this.filterInput.value),""!==this.filterInput.value.trim()||this.itemTemplate?(this.isNotSearchList=!1,i=""===this.filterInput.value.trim()?null:i,this.resetList(e,s,i)):(this.actionCompleteData.isUpdated=!1,this.isTyped=!1,t.isNullOrUndefined(this.actionCompleteData.ulElement)||t.isNullOrUndefined(this.actionCompleteData.list)||this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list),this.isTyped=!0,t.isNullOrUndefined(this.itemData)||"dropdownlist"!==this.getModuleName()||(this.focusIndexItem(),this.setScrollPosition()),this.isNotSearchList=!0),this.renderReactTemplates())},s.prototype.setSearchBox=function(e){if(this.isFiltering()){var i=e.querySelector("."+I.filterParent)?e.querySelector("."+I.filterParent):this.createElement("span",{className:I.filterParent});this.isServerBlazor&&(i.innerHTML=""),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:I.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element);var s=!1;return t.Browser.isDevice&&(s=!0),this.filterInputObj=o.Input.createInput({element:this.filterInput,buttons:s?[I.backIcon,I.filterBarClearIcon]:[I.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),t.isNullOrUndefined(this.cssClass)||(-1!==this.cssClass.split(" ").indexOf("e-outline")?t.addClass([this.filterInputObj.container],"e-outline"):-1!==this.cssClass.split(" ").indexOf("e-filled")&&t.addClass([this.filterInputObj.container],"e-filled")),t.append([this.filterInputObj.container],i),t.prepend([i],e),t.attributes(this.filterInput,{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-activedescendant":this.selectedLI?this.selectedLI.id:null,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+I.clearIcon),!t.Browser.isDevice&&this.clearIconElement&&(t.EventHandler.add(this.clearIconElement,"click",this.clearText,this),this.clearIconElement.style.visibility="hidden"),t.Browser.isDevice?this.searchKeyModule=new t.KeyboardEvents(this.filterInput,{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.searchKeyModule=new t.KeyboardEvents(this.filterInput,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),t.EventHandler.add(this.filterInput,"input",this.onInput,this),t.EventHandler.add(this.filterInput,"keyup",this.onFilterUp,this),t.EventHandler.add(this.filterInput,"keydown",this.onFilterDown,this),t.EventHandler.add(this.filterInput,"blur",this.onBlur,this),t.EventHandler.add(this.filterInput,"paste",this.pasteHandler,this),this.filterInputObj}return L},s.prototype.onInput=function(e){this.isValidKey=!0,t.Browser.isDevice&&"mozilla"===t.Browser.info.name&&(this.typedString=this.filterInput.value,this.preventAutoFill=!0,this.searchLists(e))},s.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.typedString=t.filterInput.value,t.searchLists(e)})},s.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.beforePopupOpen&&this.renderPopup()},s.prototype.onActionComplete=function(s,l,o,r){var n=this;if(this.isNotSearchList)return void(this.isNotSearchList=!1);if(this.isActive){var a=this.selectedLI?this.selectedLI.cloneNode(!0):null;if(e.prototype.onActionComplete.call(this,s,l,o),this.updateSelectElementData(this.allowFiltering),this.isRequested&&!t.isNullOrUndefined(this.searchKeyEvent)&&"keydown"===this.searchKeyEvent.type&&(this.isRequested=!1,this.keyActionHandler(this.searchKeyEvent),this.searchKeyEvent=null),this.isRequested&&!t.isNullOrUndefined(this.searchKeyEvent)&&(this.incrementalSearch(this.searchKeyEvent),this.searchKeyEvent=null),this.list.scrollTop=0,t.isNullOrUndefined(s)||t.attributes(s,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false"}),this.initRemoteRender&&(this.initial=!0,this.activeIndex=this.index,this.updateValues(),this.initRemoteRender=!1,this.initial=!1,this.value&&this.dataSource instanceof i.DataManager)){var h=t.isNullOrUndefined(this.fields.value)?this.fields.text:this.fields.value;l.some(function(e){return e[h]===n.value})||this.dataSource.executeQuery(this.getQuery(this.query).where(new i.Predicate(h,"equal",this.value))).then(function(e){e.result.length>0&&(n.addItem(e.result,l.length),n.updateValues())})}"autocomplete"!==this.getModuleName()&&this.isFiltering()&&!this.isTyped&&((!this.actionCompleteData.isUpdated||!this.isCustomFilter&&!this.isFilterFocus||t.isNullOrUndefined(this.itemData)&&this.allowFiltering&&(this.dataSource instanceof i.DataManager||!t.isNullOrUndefined(this.dataSource)&&!t.isNullOrUndefined(this.dataSource.length)&&0!==this.dataSource.length))&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){n.updateActionCompleteDataValues(s,l)},0):this.updateActionCompleteDataValues(s,l)),this.addNewItem(l,a),t.isNullOrUndefined(this.itemData)||this.focusIndexItem()),this.beforePopupOpen&&this.renderPopup()}},s.prototype.updateActionCompleteDataValues=function(e,i){this.actionCompleteData={ulElement:e.cloneNode(!0),list:i,isUpdated:!0},t.isNullOrUndefined(this.actionData.ulElement)&&t.isNullOrUndefined(this.actionData.list)&&(this.actionData=this.actionCompleteData)},s.prototype.addNewItem=function(e,i){var s=this;if(!t.isNullOrUndefined(this.itemData)&&!t.isNullOrUndefined(i)){var l=this.getItemData().value;e.some(function(e){return("string"==typeof e||"number"==typeof e)&&e===l||t.getValue(s.fields.value,e)===l})||this.addItem(this.itemData)}},s.prototype.updateActionCompleteData=function(e,t,i){var s=this;"autocomplete"!==this.getModuleName()&&this.actionCompleteData.ulElement&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){s.actionCompleteDataUpdate(e,t,i)},0):this.actionCompleteDataUpdate(e,t,i))},s.prototype.actionCompleteDataUpdate=function(e,t,i){null!=i?this.actionCompleteData.ulElement.insertBefore(e.cloneNode(!0),this.actionCompleteData.ulElement.childNodes[i]):this.actionCompleteData.ulElement.appendChild(e.cloneNode(!0)),this.isFiltering()&&this.actionCompleteData.list.indexOf(t)<0&&this.actionCompleteData.list.push(t)},s.prototype.focusIndexItem=function(){var e=this.getItemData().value;this.activeIndex=this.getIndexByValue(e);var t=this.findListElement(this.list,"li","data-value",e);this.selectedLI=t,this.activeItem(t),this.removeFocus()},s.prototype.updateSelection=function(){var e=this.list.querySelector("."+k.selected);e?(this.setProperties({index:this.getIndexByValue(e.getAttribute("data-value"))}),this.activeIndex=this.index):(this.removeFocus(),this.list.querySelector("."+k.li).classList.add(I.focus))},s.prototype.removeFocus=function(){var e=this.list.querySelectorAll("."+I.focus);e&&e.length&&t.removeClass(e,I.focus)},s.prototype.renderPopup=function(){var e=this;if(this.popupObj&&document.body.contains(this.popupObj.element))return void this.refreshPopup();var i={cancel:!1};this.trigger("beforeOpen",i,function(i){if(i.cancel)e.beforePopupOpen=!1;else{var s=e.serverPopupEle?e.serverPopupEle:e.createElement("div",{id:e.element.id+"_popup",className:"e-ddl e-popup "+(null!=e.cssClass?e.cssClass:"")}),l=e.setSearchBox(s);if(e.listHeight=t.formatUnit(e.popupHeight),e.headerTemplate&&!e.isServerBlazor&&e.setHeaderTemplate(s),t.append([e.list],s),e.footerTemplate&&!e.isServerBlazor&&e.setFooterTemplate(s),e.isServerRendered&&s&&s.querySelector(".e-ddl-footer")&&s.appendChild(s.querySelector(".e-ddl-footer")),document.body.appendChild(s),e.updateServerPopup(s),s.style.visibility="hidden","auto"!==e.popupHeight){if(e.searchBoxHeight=0,t.isNullOrUndefined(l.container)||(e.searchBoxHeight=l.container.parentElement.getBoundingClientRect().height,e.listHeight=(parseInt(e.listHeight,10)-e.searchBoxHeight).toString()+"px"),e.headerTemplate||e.isServerRendered&&s&&s.querySelector(".e-ddl-header")){e.header=e.header?e.header:s.querySelector(".e-ddl-header");o=Math.round(e.header.getBoundingClientRect().height);e.listHeight=(parseInt(e.listHeight,10)-(o+e.searchBoxHeight)).toString()+"px"}if(e.footerTemplate||e.isServerRendered&&s&&s.querySelector(".e-ddl-footer")){e.footer=e.footer?e.footer:s.querySelector(".e-ddl-footer");var o=Math.round(e.footer.getBoundingClientRect().height);e.listHeight=(parseInt(e.listHeight,10)-(o+e.searchBoxHeight)).toString()+"px"}e.list.style.maxHeight=(parseInt(e.listHeight,10)-2).toString()+"px",s.style.maxHeight=t.formatUnit(e.popupHeight)}else s.style.height="auto";var r=0,n=void 0;if(!t.isNullOrUndefined(e.selectedLI)&&!t.isNullOrUndefined(e.activeIndex)&&e.activeIndex>=0?e.setScrollPosition():e.list.scrollTop=0,t.Browser.isDevice&&!e.allowFiltering&&("dropdownlist"===e.getModuleName()||e.isDropDownClick&&"combobox"===e.getModuleName())){r=e.getOffsetValue(s);var a=e.isEmptyList()?e.list:e.liCollections[0];n=-(parseInt(getComputedStyle(a).textIndent,10)-parseInt(getComputedStyle(e.inputElement).paddingLeft,10)+parseInt(getComputedStyle(e.inputElement.parentElement).borderLeftWidth,10))}e.getFocusElement(),e.createPopup(s,r,n),e.checkCollision(s),t.Browser.isDevice&&(e.popupObj.element.classList.add(I.device),("dropdownlist"===e.getModuleName()||"combobox"===e.getModuleName()&&!e.allowFiltering&&e.isDropDownClick)&&(e.popupObj.collision={X:"fit",Y:"fit"}),e.isFilterLayout()&&(e.popupObj.element.classList.add(I.mobileFilter),e.popupObj.position={X:0,Y:0},e.popupObj.dataBind(),t.attributes(e.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),t.addClass([document.body,e.popupObj.element],I.popupFullScreen),e.setSearchBoxPosition(),e.backIconElement=l.container.querySelector(".e-back-icon"),e.clearIconElement=l.container.querySelector("."+I.clearIcon),t.EventHandler.add(e.backIconElement,"click",e.clickOnBackIcon,e),t.EventHandler.add(e.clearIconElement,"click",e.clearText,e))),s.style.visibility="visible",t.addClass([s],"e-popup-close");for(var h=0,p=e.popupObj.getScrollableParent(e.inputWrapper.container);h<p.length;h++){var u=p[h];t.EventHandler.add(u,"scroll",e.scrollHandler,e)}t.Browser.isDevice&&e.isFilterLayout()&&t.EventHandler.add(e.list,"scroll",e.listScroll,e),t.isNullOrUndefined(e.list)||(e.unWireListEvents(),e.wireListEvents()),t.attributes(e.targetElement(),{"aria-expanded":"true"});var c=e.isFiltering()?e.filterInput.parentElement:e.inputWrapper.container;t.addClass([c],[I.inputFocus]);var d={name:"FadeIn",duration:100};e.beforePopupOpen=!0;var m={popup:t.isBlazor()&&e.isServerRendered?null:e.popupObj,cancel:!1,animation:d};e.trigger("open",m,function(i){i.cancel?(e.beforePopupOpen=!1,e.destroyPopup()):(e.serverBlazorUpdateSelection(),e.bindServerScrollEvent(),t.addClass([e.inputWrapper.container],[I.iconAnimation]),e.renderReactTemplates(),e.popupObj.show(new t.Animation(i.animation),1e3===e.zIndex?e.element:null))})}})},s.prototype.checkCollision=function(e){(!t.Browser.isDevice||t.Browser.isDevice&&"dropdownlist"!==this.getModuleName()&&!this.isDropDownClick)&&(l.isCollide(e).length>0&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},s.prototype.serverBlazorUpdateSelection=function(){(this.isServerBlazor&&(null!==this.value||null!==this.index||null!==this.text)||"dropdownlist"!==this.getModuleName()&&!this.isTyped)&&("dropdownlist"===this.getModuleName()&&(this.removeSelection(),this.removeFocus(),this.removeHover(),this.updateValues()),"combobox"===this.getModuleName()&&this.ulElement&&this.findListElement(this.ulElement,"li","data-value",this.value)&&!this.isTyped&&this.updateValues(),this.isServerBlazor&&"dropdownlist"!==this.getModuleName()&&(""===this.text||null===this.text)&&this.ulElement&&(this.ulElement.querySelector("li").classList.contains(k.hover)||t.addClass([this.ulElement.querySelector("li")],k.hover)))},s.prototype.bindServerScrollEvent=function(){this.isServerBlazor&&this.list&&this.fields.groupBy&&!this.isGroupChecking&&(t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this))},s.prototype.updateServerPopup=function(e){this.isServerBlazor&&(e&&e.querySelector("li")&&t.removeClass([e.querySelector(".e-content")],["e-nodata"]),this.initial=!1,e.removeAttribute("style"))},s.prototype.getOffsetValue=function(e){var t=getComputedStyle(e),i=parseInt(t.borderTopWidth,10),s=parseInt(t.borderBottomWidth,10);return this.setPopupPosition(i+s)},s.prototype.createPopup=function(e,i,s){var o=this;this.popupObj=new l.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputWrapper.container,collision:{X:"flip",Y:"flip"},offsetY:i,enableRtl:this.enableRtl,offsetX:s,position:{X:"left",Y:"bottom"},zIndex:this.zIndex,close:function(){o.isDocumentClick||o.focusDropDown(),o.isReact&&o.clearTemplate(["headerTemplate","footerTemplate"]);var e="autocomplete"===o.getModuleName();o.DropDownBaseresetBlazorTemplates(e,e,!0,!0,!1,!0,!0),o.isNotSearchList=!1,o.isDocumentClick=!1,o.destroyPopup(),o.isFiltering()&&o.actionCompleteData.list&&o.actionCompleteData.list[0]&&(o.isActive=!0,o.onActionComplete(o.actionCompleteData.ulElement,o.actionCompleteData.list,null,!0))},open:function(){t.EventHandler.add(document,"mousedown",o.onDocumentClick,o),o.isPopupOpen=!0;var e=o.actionCompleteData&&o.actionCompleteData.ulElement&&o.actionCompleteData.ulElement.querySelector("li"),i=o.list.querySelector("ul li");o.isFiltering()&&o.itemTemplate&&o.element.tagName===o.getNgDirective()&&e&&i&&e.textContent!==i.textContent&&"EJS-COMBOBOX"!==o.element.tagName&&o.cloneElements(),o.isFilterLayout()&&(t.removeClass([o.inputWrapper.container],[I.inputFocus]),o.isFilterFocus=!0,o.filterInput.focus(),o.inputWrapper.clearButton&&t.addClass([o.inputWrapper.clearButton],I.clearIconHide)),o.activeStateChange()},targetExitViewport:function(){t.Browser.isDevice||o.hidePopup()}})},s.prototype.isEmptyList=function(){return!t.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length},s.prototype.getFocusElement=function(){},s.prototype.isFilterLayout=function(){return"dropdownlist"===this.getModuleName()&&this.allowFiltering},s.prototype.scrollHandler=function(){t.Browser.isDevice&&("dropdownlist"===this.getModuleName()&&!this.isFilterLayout()||"combobox"===this.getModuleName()&&!this.allowFiltering&&this.isDropDownClick)&&this.hidePopup()},s.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height;this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%",this.list.style.maxHeight=window.innerHeight-e+"px",this.list.style.height=window.innerHeight-e+"px";var i=this.filterInput.parentElement.querySelector("."+I.clearIcon);t.detach(this.filterInput),i.parentElement.insertBefore(this.filterInput,i)},s.prototype.setPopupPosition=function(e){var i,s=e,l=this.list.querySelector("."+I.focus)||this.selectedLI,o=this.isEmptyList()?this.list:this.liCollections[0],r=this.isEmptyList()?this.list:this.liCollections[this.getItems().length-1],n=o.getBoundingClientRect().height,a=this.list.offsetHeight/2,h=t.isNullOrUndefined(l)?o.offsetTop:l.offsetTop;if(r.offsetTop-a<h&&!t.isNullOrUndefined(this.liCollections)&&this.liCollections.length>0&&!t.isNullOrUndefined(l)){var p=this.list.offsetHeight/n,u=parseInt(getComputedStyle(this.list).paddingBottom,10);i=(p-(this.liCollections.length-this.activeIndex))*n-s+u,this.list.scrollTop=l.offsetTop}else h>a?(i=a-n/2,this.list.scrollTop=h-a+n/2):i=h;return-(i=i+n+s-(n-this.inputWrapper.container.offsetHeight)/2)},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);if(e.indexOf("%")>-1&&(e=(this.inputWrapper.container.offsetWidth*parseFloat(e)/100).toString()+"px"),t.Browser.isDevice&&!this.allowFiltering&&("dropdownlist"===this.getModuleName()||this.isDropDownClick&&"combobox"===this.getModuleName())){var i=this.isEmptyList()?this.list:this.liCollections[0];e=parseInt(e,10)+2*(parseInt(getComputedStyle(i).textIndent,10)-parseInt(getComputedStyle(this.inputElement).paddingLeft,10)+parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth,10))+"px"}return e},s.prototype.scrollBottom=function(e){if(!t.isNullOrUndefined(this.selectedLI)){var i=this.list.offsetHeight,s=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,l=this.list.scrollTop+s-i;l=e?l+2*parseInt(getComputedStyle(this.list).paddingTop,10):l;var o=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;o=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?o-this.fixedHeaderElement.offsetHeight:o,0===this.activeIndex?this.list.scrollTop=0:(s>i||!(o>0&&this.list.offsetHeight>o))&&(this.list.scrollTop=l)}},s.prototype.scrollTop=function(){if(!t.isNullOrUndefined(this.selectedLI)){var e=this.selectedLI.offsetTop-this.list.scrollTop;e=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?e-this.fixedHeaderElement.offsetHeight:e;var i=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop;0===this.activeIndex?this.list.scrollTop=0:e<0?this.list.scrollTop=this.list.scrollTop+e:i>0&&this.list.offsetHeight>i||(this.list.scrollTop=this.selectedLI.offsetTop-(this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0))}},s.prototype.isEditTextBox=function(){return!1},s.prototype.isFiltering=function(){return this.allowFiltering},s.prototype.isPopupButton=function(){return!0},s.prototype.setScrollPosition=function(e){if(t.isNullOrUndefined(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.scrollBottom();break;default:this.scrollTop()}},s.prototype.clearText=function(){this.filterInput.value=this.typedString="",this.searchLists(null)},s.prototype.listScroll=function(){this.filterInput.blur()},s.prototype.setEleWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.inputWrapper.container.style.width=t.formatUnit(e):"string"==typeof e&&(this.inputWrapper.container.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.closePopup=function(e){var i=this;if(this.isTyped=!1,this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.isActive=!1,this.filterInputObj=null,this.isDropDownClick=!1,this.preventAutoFill=!1;for(var s=0,l=this.popupObj.getScrollableParent(this.inputWrapper.container);s<l.length;s++){var o=l[s];t.EventHandler.remove(o,"scroll",this.scrollHandler)}t.Browser.isDevice&&this.isFilterLayout()&&(t.removeClass([document.body,this.popupObj.element],I.popupFullScreen),t.EventHandler.remove(this.list,"scroll",this.listScroll)),this.isFilterLayout()&&(t.Browser.isDevice||(this.searchKeyModule.destroy(),this.clearIconElement&&t.EventHandler.remove(this.clearIconElement,"click",this.clearText)),this.backIconElement&&(t.EventHandler.remove(this.backIconElement,"click",this.clickOnBackIcon),t.EventHandler.remove(this.clearIconElement,"click",this.clearText)),t.EventHandler.remove(this.filterInput,"input",this.onInput),t.EventHandler.remove(this.filterInput,"keyup",this.onFilterUp),t.EventHandler.remove(this.filterInput,"keydown",this.onFilterDown),t.EventHandler.remove(this.filterInput,"blur",this.onBlur),t.EventHandler.remove(this.filterInput,"paste",this.pasteHandler),this.filterInput=null),t.attributes(this.targetElement(),{"aria-expanded":"false","aria-activedescendant":null}),this.inputWrapper.container.classList.remove(I.iconAnimation),this.isFiltering()&&(this.actionCompleteData.isUpdated=!1),this.beforePopupOpen=!1;var r={name:"FadeOut",duration:100,delay:e||0},n={popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj,cancel:!1,animation:r};this.trigger("close",n,function(e){if(!t.isNullOrUndefined(i.popupObj)&&!t.isNullOrUndefined(i.popupObj.element.querySelector(".e-fixed-head"))){var s=i.popupObj.element.querySelector(".e-fixed-head");s.parentNode.removeChild(s),i.fixedHeaderElement=null}e.cancel||("autocomplete"!==i.getModuleName()||i.isServerBlazor||i.rippleFun(),i.isPopupOpen?i.popupObj.hide(new t.Animation(e.animation)):i.destroyPopup())})}},s.prototype.destroyPopup=function(){var e=t.select("#"+this.element.id+"_popup_holder",document);this.isServerBlazor&&this.serverPopupEle&&e&&(e.appendChild(this.serverPopupEle),this.interopAdaptor.invokeMethodAsync("OnServerClosePopup")),this.isPopupOpen=!1,this.isFilterFocus=!1,this.popupObj.destroy(),t.detach(this.popupObj.element)},s.prototype.clickOnBackIcon=function(){this.hidePopup(),this.focusIn()},s.prototype.render=function(){if(this.isServerBlazor)this.inputElement=this.element,this.inputWrapper={container:this.element.parentElement},this.hiddenElement=this.inputWrapper.container.querySelector("select"),this.inputWrapper.buttons=[this.inputWrapper.container.querySelector(".e-input-group-icon.e-ddl-icon")],this.showClearButton&&(this.inputWrapper.clearButton=this.inputWrapper.container.querySelector(".e-clear-icon"),o.Input.wireClearBtnEvents(this.element,this.inputWrapper.clearButton,this.inputWrapper.container)),"Auto"===this.floatLabelType&&o.Input.wireFloatingEvents(this.element),o.Input.bindInitialEvent({element:this.element,buttons:null,customTag:null,floatLabelType:this.floatLabelType,properties:this.properties}),this.setFields(),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.enabled||(this.targetElement().tabIndex=-1),this.element.hasAttribute("autofocus")&&this.focusIn(),this.initial=!1;else{"INPUT"===this.element.tagName?(this.inputElement=this.element,t.isNullOrUndefined(this.inputElement.getAttribute("role"))&&this.inputElement.setAttribute("role","textbox"),t.isNullOrUndefined(this.inputElement.getAttribute("type"))&&this.inputElement.setAttribute("type","text")):(this.inputElement=this.createElement("input",{attrs:{role:"textbox",type:"text"}}),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.parentElement.insertBefore(this.inputElement,this.element),this.preventTabIndex(this.inputElement));var e=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=o.Input.createInput({element:this.inputElement,buttons:this.isPopupButton()?[I.icon]:null,floatLabelType:this.floatLabelType,properties:{readonly:"dropdownlist"===this.getModuleName()||this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton}},this.createElement),this.element.tagName===this.getNgDirective()?this.element.appendChild(this.inputWrapper.container):this.inputElement.parentElement.insertBefore(this.element,this.inputElement),this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:I.hiddenElement}}),t.prepend([this.hiddenElement],this.inputWrapper.container),this.validationAttribute(this.element,this.hiddenElement),this.setFields(),this.inputWrapper.container.style.width=t.formatUnit(this.width),this.inputWrapper.container.classList.add("e-ddl"),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex");var i=this.element.getAttribute("id")?this.element.getAttribute("id"):t.getUniqueID("ej2_dropdownlist");if(this.element.id=i,this.hiddenElement.id=i+"_hidden",this.targetElement().setAttribute("tabindex",this.tabIndex),t.attributes(this.targetElement(),this.getAriaAttributes()),this.updateDataAttribute(this.htmlAttributes),this.setHTMLAttributes(),null!==this.value||null!==this.activeIndex||null!==this.text)this.initValue();else if("SELECT"===this.element.tagName&&this.element.options[0]){var s=this.element;this.value=s.options[s.selectedIndex].value,this.text=t.isNullOrUndefined(this.value)?null:s.options[s.selectedIndex].textContent,this.initValue()}this.preventTabIndex(this.element),this.enabled||(this.targetElement().tabIndex=-1),this.initial=!1,this.element.style.opacity="",this.inputElement.onselect=function(e){e.stopImmediatePropagation()},this.inputElement.onchange=function(e){e.stopImmediatePropagation()},this.element.hasAttribute("autofocus")&&this.focusIn(),t.isNullOrUndefined(this.text)||this.inputElement.setAttribute("value",this.text)}this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete()},s.prototype.setFooterTemplate=function(e){var i;this.footer?this.footer.innerHTML="":(this.footer=this.createElement("div"),t.addClass([this.footer],I.footer));var s=(i=this.dropdownCompiler(this.footerTemplate)?t.compile(t.select(this.footerTemplate,document).innerHTML.trim()):t.compile(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);if(s&&s.length>0)for(var l=0;l<s.length;l++)this.footer.appendChild(s[l]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!1,!0),t.append([this.footer],e)},s.prototype.setHeaderTemplate=function(e){var i;this.header?this.header.innerHTML="":(this.header=this.createElement("div"),t.addClass([this.header],I.header));var s=(i=this.dropdownCompiler(this.headerTemplate)?t.compile(t.select(this.headerTemplate,document).innerHTML.trim()):t.compile(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);if(s&&s.length)for(var l=0;l<s.length;l++)this.header.appendChild(s[l]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!0,!1);var o=e.querySelector("div.e-content");e.insertBefore(this.header,o)},s.prototype.setOldText=function(e){this.text=e},s.prototype.setOldValue=function(e){this.value=e},s.prototype.refreshPopup=function(){t.isNullOrUndefined(this.popupObj)||!document.body.contains(this.popupObj.element)||(!this.allowFiltering||t.Browser.isDevice&&this.isFilterLayout())&&"autocomplete"!==this.getModuleName()||(t.removeClass([this.popupObj.element],"e-popup-close"),this.popupObj.refreshPosition(this.inputWrapper.container),this.popupObj.resolveCollision())},s.prototype.checkData=function(e){!e.dataSource||t.isNullOrUndefined(Object.keys(e.dataSource))||!this.itemTemplate||!this.allowFiltering||this.isListSearched&&e.dataSource instanceof i.DataManager||(this.list=null,this.actionCompleteData={ulElement:null,list:null,isUpdated:!1}),this.isListSearched=!1;var s=-1!==Object.keys(e).indexOf("value")&&t.isNullOrUndefined(e.value),l=-1!==Object.keys(e).indexOf("text")&&t.isNullOrUndefined(e.text);"autocomplete"!==this.getModuleName()&&this.allowFiltering&&(s||l)&&(this.itemData=null),this.allowFiltering&&e.dataSource&&!t.isNullOrUndefined(Object.keys(e.dataSource))?(this.actionCompleteData={ulElement:null,list:null,isUpdated:!1},this.actionData=this.actionCompleteData):this.allowFiltering&&e.query&&!t.isNullOrUndefined(Object.keys(e.query))&&(this.actionData=this.actionCompleteData)},s.prototype.updateDataSource=function(e){""===this.inputElement.value&&(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length))||this.clearAll(null,e),(t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof i.DataManager||0!==e.dataSource.length)||e.dataSource!==[])&&(this.typedString="",this.resetList(this.dataSource)),this.isCustomFilter||this.isFilterFocus||document.activeElement===this.filterInput||this.checkCustomValue()},s.prototype.checkCustomValue=function(){this.itemData=this.getDataByValue(this.value);var e=this.getItemData();this.setProperties({value:e.value,text:e.text})},s.prototype.updateInputFields=function(){"dropdownlist"===this.getModuleName()&&o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},s.prototype.onPropertyChanged=function(s,l){"dropdownlist"===this.getModuleName()&&(this.isServerBlazor||(this.checkData(s),this.setUpdateInitial(["fields","query","dataSource"],s)));for(var r=0,n=Object.keys(s);r<n.length;r++){var a=n[r];switch(a){case"query":case"dataSource":break;case"htmlAttributes":this.setHTMLAttributes();break;case"width":this.setEleWidth(s.width);break;case"placeholder":o.Input.setPlaceholder(s.placeholder,this.inputElement);break;case"filterBarPlaceholder":this.filterInput&&o.Input.setPlaceholder(s.filterBarPlaceholder,this.filterInput);break;case"readonly":"dropdownlist"!==this.getModuleName()&&o.Input.setReadonly(s.readonly,this.inputElement);break;case"cssClass":this.setCssClass(s.cssClass,l.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"enabled":this.setEnable();break;case"text":if(null===s.text){this.clearAll();break}if(this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),!this.initRemoteRender){var h=this.getElementByText(s.text);this.checkValidLi(h)||(this.liCollections&&100===this.liCollections.length&&"autocomplete"===this.getModuleName()&&this.listData.length>100?this.setSelectionData(s.text,l.text,"text"):this.isServerBlazor||this.setOldText(l.text)),this.updateInputFields()}break;case"value":if(null===s.value){this.clearAll();break}if(this.notify("beforeValueChange",{newProp:s}),this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),!this.initRemoteRender){var p=this.getElementByValue(s.value);this.checkValidLi(p)||(this.liCollections&&100===this.liCollections.length&&"autocomplete"===this.getModuleName()&&this.listData.length>100?this.setSelectionData(s.value,l.value,"value"):this.isServerBlazor||this.setOldValue(l.value)),this.updateInputFields(),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange}break;case"index":if(null===s.index){this.clearAll();break}if(this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),!this.initRemoteRender&&this.liCollections){var u=this.liCollections[s.index];this.checkValidLi(u)||(this.liCollections&&100===this.liCollections.length&&"autocomplete"===this.getModuleName()&&this.listData.length>100?this.setSelectionData(s.index,l.index,"index"):this.isServerBlazor||(this.index=l.index)),this.updateInputFields()}break;case"footerTemplate":this.popupObj&&this.setFooterTemplate(this.popupObj.element);break;case"headerTemplate":this.popupObj&&this.setHeaderTemplate(this.popupObj.element);break;case"valueTemplate":t.isNullOrUndefined(this.itemData)||null==this.valueTemplate||this.setValueTemplate();break;case"allowFiltering":this.allowFiltering&&(this.actionCompleteData={ulElement:this.ulElement,list:this.listData,isUpdated:!0},this.actionData=this.actionCompleteData,this.updateSelectElementData(this.allowFiltering));break;case"floatLabelType":o.Input.removeFloating(this.inputWrapper),o.Input.addFloating(this.inputElement,s.floatLabelType,this.placeholder,this.createElement);break;case"showClearButton":o.Input.setClearButton(s.showClearButton,this.inputElement,this.inputWrapper,null,this.createElement),this.bindClearEvent();break;default:var c=this.getPropObject(a,s,l);e.prototype.onPropertyChanged.call(this,c.newProperty,c.oldProperty)}}},s.prototype.checkValidLi=function(e){return!!this.isValidLI(e)&&(this.setSelection(e,null),!0)},s.prototype.setSelectionData=function(e,t,i){var s,l=this;this.updateListValues=function(){"text"===i?(s=l.getElementByText(e),l.checkValidLi(s)||l.setOldText(t)):"value"===i?(s=l.getElementByValue(e),l.checkValidLi(s)||l.setOldValue(t)):"index"===i&&(s=l.liCollections[e],l.checkValidLi(s)||(l.index=t))}},s.prototype.setCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),o.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupObj&&o.Input.setCssClass(e,[this.popupObj.element],i)},s.prototype.getModuleName=function(){return"dropdownlist"},s.prototype.showPopup=function(){if(this.enabled){if(t.isBlazor()&&this.itemTemplate&&this.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1),this.isFiltering()&&this.dataSource instanceof i.DataManager&&this.actionData.list!=this.actionCompleteData.list&&this.actionData.list&&this.actionData.ulElement&&(this.actionCompleteData=this.actionData,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)),this.beforePopupOpen)return void this.refreshPopup();this.beforePopupOpen=!0,this.isFiltering()&&!this.isActive&&this.actionCompleteData.list&&this.actionCompleteData.list[0]?(this.isActive=!0,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)):t.isNullOrUndefined(this.list)||!t.isUndefined(this.list)&&(this.list.classList.contains(k.noData)||this.list.querySelectorAll("."+k.li).length<=0)?this.renderList():this.isFiltering()&&this.isServerBlazor&&this.renderList(),this.isServerBlazor||this.invokeRenderPopup();var e=!this.isFiltering()||t.select("#"+this.element.id+"_popup_holder",document),s="dropdownlist"===this.getModuleName()||!this.isFiltering();this.isServerBlazor&&e&&!t.isNullOrUndefined(this.list)&&s&&this.invokeRenderPopup()}},s.prototype.invokeRenderPopup=function(){if(t.Browser.isDevice&&this.isFilterLayout()){var e=this;window.onpopstate=function(){e.hidePopup()},history.pushState({},"")}t.isNullOrUndefined(this.list.children[0])&&!this.list.classList.contains(k.noData)||this.renderPopup(),t.attributes(this.targetElement(),{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null})},s.prototype.clientRenderPopup=function(e,i){i?(this.serverPopupEle=i,this.list=i.querySelector(".e-dropdownbase.e-content")?i.querySelector(".e-dropdownbase.e-content"):this.list,this.ulElement=this.list.querySelector("ul"),t.isNullOrUndefined(this.ulElement)&&!this.list.classList.contains(k.noData)&&t.addClass([this.list],[k.noData]),this.liCollections=this.ulElement?this.ulElement.querySelectorAll("."+k.li):[],this.listData=e,"autocomplete"===this.getModuleName()&&this.liCollections.length>0&&this.renderHightSearch(),this.initRemoteRender=!1,this.isPopupOpen||this.serverBlazorUpdateSelection(),this.unWireListEvents(),this.wireListEvents(),this.isServerIncrementalSearch&&this.searchKeyEvent&&(this.isServerIncrementalSearch=!1,this.initial=!1,this.onServerIncrementalSearch(this.searchKeyEvent)),this.isServerNavigation&&this.searchKeyEvent&&("down"===this.searchKeyEvent.action||"up"===this.searchKeyEvent.action?(this.isServerNavigation=!1,this.updateUpDownAction(this.searchKeyEvent)):"home"!==this.searchKeyEvent.action&&"end"!==this.searchKeyEvent.action||(this.isServerNavigation=!1,this.updateHomeEndAction(this.searchKeyEvent))),this.beforePopupOpen&&this.invokeRenderPopup(),"dropdownlist"!==this.getModuleName()&&this.onActionComplete(this.ulElement,this.listData)):null!=e&&this.listData!==e&&(this.listData=e,this.initRemoteRender=!1)},s.prototype.renderHightSearch=function(){},s.prototype.updateclientItemData=function(e){this.listData=e},s.prototype.initValueItemData=function(e){this.itemData=e,this.previousValue=this.value,this.initial=!1},s.prototype.serverUpdateListElement=function(e,t){this.listData=e,this.ulElement&&(this.liCollections=this.ulElement.querySelectorAll("."+k.li))},s.prototype.hidePopup=function(e){var i=!!this.headerTemplate,s=!!this.headerTemplate;if(this.DropDownBaseresetBlazorTemplates(!1,!1,!1,!1,!1,i,s),this.isEscapeKey&&"dropdownlist"===this.getModuleName())if(o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1,t.isNullOrUndefined(this.index))this.resetSelection();else{var l=this.findListElement(this.ulElement,"li","data-value",this.value);this.selectedLI=this.liCollections[this.index]||l,this.selectedLI&&(this.updateSelectedItem(this.selectedLI,null,!0),this.valueTemplate&&null!==this.itemData&&this.setValueTemplate())}this.closePopup();var r=this.getItemData(),n=this.isServerBlazor?!t.isNullOrUndefined(this.value):!t.isNullOrUndefined(this.selectedLI);this.inputElement&&""===this.inputElement.value.trim()&&!this.isInteracted&&(this.isSelectCustom||n&&this.inputElement.value!==r.text)&&(this.isSelectCustom=!1,this.clearAll(e))},s.prototype.focusIn=function(e){if(this.enabled&&!this.targetElement().classList.contains(I.disable)){var i=!1;this.preventFocus&&t.Browser.isDevice&&(this.inputWrapper.container.tabIndex=1,this.inputWrapper.container.focus(),this.preventFocus=!1,i=!0),i||this.targetElement().focus(),t.addClass([this.inputWrapper.container],[I.inputFocus]),this.onFocus(e)}},s.prototype.focusOut=function(e){this.enabled&&(this.isTyped=!0,this.hidePopup(e),this.targetElement()&&this.targetElement().blur(),t.removeClass([this.inputWrapper.container],[I.inputFocus]))},s.prototype.destroy=function(){if(this.isActive=!1,this.isReact&&this.clearTemplate(),(!this.isServerBlazor||this.popupObj&&document.body.contains(this.popupObj.element))&&this.hidePopup(),this.unWireEvent(),this.list&&(this.unWireListEvents(),this.isServerBlazor&&this.fields.groupBy&&!this.isGroupChecking&&t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader)),!this.isServerBlazor){if(this.element&&!this.element.classList.contains("e-"+this.getModuleName()))return;if(this.inputElement){for(var i=["readonly","aria-disabled","aria-placeholder","placeholder","aria-owns","aria-labelledby","aria-haspopup","aria-expanded","aria-activedescendant","autocomplete","aria-readonly","autocorrect","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-describedby","aria-label"],s=0;s<i.length;s++)this.inputElement.removeAttribute(i[s]);this.inputElement.setAttribute("tabindex",this.tabIndex),this.inputElement.classList.remove("e-input"),o.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton)}this.element.style.display="block",this.inputWrapper.container.parentElement.tagName===this.getNgDirective()?t.detach(this.inputWrapper.container):(this.inputWrapper.container.parentElement.insertBefore(this.element,this.inputWrapper.container),t.detach(this.inputWrapper.container)),e.prototype.destroy.call(this)}},s.prototype.getItems=function(){return this.list||(this.dataSource instanceof i.DataManager&&(this.initRemoteRender=!0),this.renderList()),this.ulElement?e.prototype.getItems.call(this):[]},s.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},s.prototype.clear=function(){this.value=null},T([t.Property(null)],s.prototype,"cssClass",void 0),T([t.Property("100%")],s.prototype,"width",void 0),T([t.Property("300px")],s.prototype,"popupHeight",void 0),T([t.Property("100%")],s.prototype,"popupWidth",void 0),T([t.Property(null)],s.prototype,"placeholder",void 0),T([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),T([t.Property({})],s.prototype,"htmlAttributes",void 0),T([t.Property(null)],s.prototype,"query",void 0),T([t.Property(null)],s.prototype,"valueTemplate",void 0),T([t.Property(null)],s.prototype,"headerTemplate",void 0),T([t.Property(null)],s.prototype,"footerTemplate",void 0),T([t.Property(!1)],s.prototype,"allowFiltering",void 0),T([t.Property(!1)],s.prototype,"readonly",void 0),T([t.Property(null)],s.prototype,"text",void 0),T([t.Property(null)],s.prototype,"value",void 0),T([t.Property(null)],s.prototype,"index",void 0),T([t.Property("Never")],s.prototype,"floatLabelType",void 0),T([t.Property(!1)],s.prototype,"showClearButton",void 0),T([t.Event()],s.prototype,"filtering",void 0),T([t.Event()],s.prototype,"change",void 0),T([t.Event()],s.prototype,"beforeOpen",void 0),T([t.Event()],s.prototype,"open",void 0),T([t.Event()],s.prototype,"close",void 0),T([t.Event()],s.prototype,"blur",void 0),T([t.Event()],s.prototype,"focus",void 0),s=T([t.NotifyPropertyChanges],s)}(B),P=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),F=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},W="e-input-group-icon e-ddt-icon e-icons",H="e-show-chip",V="e-show-clear",U="e-chip-input",M="e-input-focus",j="e-icon-hide",R="e-check",q="e-no-data",z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return P(i,e),F([t.Property("child")],i.prototype,"child",void 0),F([t.Property([])],i.prototype,"dataSource",void 0),F([t.Property("expanded")],i.prototype,"expanded",void 0),F([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),F([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),F([t.Property("iconCss")],i.prototype,"iconCss",void 0),F([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),F([t.Property("parentValue")],i.prototype,"parentValue",void 0),F([t.Property(null)],i.prototype,"query",void 0),F([t.Property("selected")],i.prototype,"selected",void 0),F([t.Property(null)],i.prototype,"tableName",void 0),F([t.Property("text")],i.prototype,"text",void 0),F([t.Property("tooltip")],i.prototype,"tooltip",void 0),F([t.Property("value")],i.prototype,"value",void 0),i}(t.ChildProperty),K=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return P(i,e),F([t.Property(!1)],i.prototype,"autoCheck",void 0),F([t.Property("Auto")],i.prototype,"expandOn",void 0),F([t.Property(!1)],i.prototype,"loadOnDemand",void 0),i}(t.ChildProperty),_=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.filterTimer=null,s.isFilteredData=!1,s.isFilterRestore=!1,s.selectedData=[],s.filterDelayTime=300,s}return P(s,e),s.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},s.prototype.getLocaleName=function(){return"drop-down-tree"},s.prototype.preRender=function(){this.inputFocus=!1,this.isPopupOpen=!1,this.isFirstRender=!0,this.isInitialized=!1,this.currentText=null,this.currentValue=null,this.oldValue=null,this.removeValue=!1,this.selectedText=[],this.treeItems=[],this.dataValue=null,this.isNodeSelected=!1,this.isDynamicChange=!1,this.clearIconWidth=0,this.isBlazorPlatForm=t.isBlazor(),this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate",this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space",ctrlA:"ctrl+A"}},s.prototype.render=function(){this.ensureAutoCheck(),"INPUT"===this.element.tagName?(this.inputEle=this.element,t.isNullOrUndefined(this.inputEle.getAttribute("role"))&&this.inputEle.setAttribute("role","textbox"),t.isNullOrUndefined(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text")):(this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=o.Input.createInput({element:this.inputEle,floatLabelType:this.floatLabelType,buttons:this.showDropDownIcon?[W]:null,properties:{readonly:!0,placeholder:this.placeholder,enabled:this.enabled,cssClass:this.cssClass,enableRtl:this.enableRtl}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.contains("e-input-group")||this.inputWrapper.classList.add("e-input-group"),this.showDropDownIcon&&this.inputWrapper.classList.add("e-show-dd-icon"),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.createHiddenElement(),this.createClearIcon(),this.inputWrapper.classList.add("e-ddt"),this.setElementWidth(this.width),this.setAttributes(),this.updateDataAttribute(),this.setHTMLAttributes(),this.popupDiv=this.createElement("div",{className:"e-popup-content",attrs:{tabindex:"0"}}),this.popupDiv.classList.add("e-dropdown"),this.tree=this.createElement("div",{id:this.element.id+"_tree"}),this.popupDiv.appendChild(this.tree),document.body.appendChild(this.popupDiv),this.wireTreeEvents(),this.popupDiv.style.display="none",this.renderTree(),this.isRemoteData=this.fields.dataSource instanceof i.DataManager,(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.createChip(),this.wrapText||(this.overFlowWrapper=this.createElement("span",{className:"e-overflow "+j}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement),"Box"!==this.mode&&t.addClass([this.overFlowWrapper],"e-show-text"))),this.isRemoteData||(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView()),this.wireEvents();var e=t.select(".e-list-parent",this.treeObj.element);e&&e.getAttribute("aria-multiselectable")&&e.removeAttribute("aria-multiselectable"),this.oldValue=this.value,this.isInitialized=!0,this.hasTemplate=this.itemTemplate||this.headerTemplate||this.footerTemplate||this.actionFailureTemplate||this.noRecordsTemplate,this.renderComplete()},s.prototype.ensureAutoCheck=function(){this.allowFiltering&&this.treeSettings.autoCheck&&this.setProperties({treeSettings:{autoCheck:!1}},!0)},s.prototype.hideCheckAll=function(e){var i=t.isNullOrUndefined(this.popupEle)?null:this.popupEle.querySelector(".e-selectall-parent");t.isNullOrUndefined(i)||(e&&!i.classList.contains("e-hide-selectall")?t.addClass([i],"e-hide-selectall"):!e&&i.classList.contains("e-hide-selectall")&&t.removeClass([i],"e-hide-selectall"))},s.prototype.renderFilter=function(){this.filterContainer=this.createElement("div",{id:this.element.id+"_filter_wrap",className:"e-filter-wrap"});var e=this.createElement("input",{id:this.element.id+"_filter",attrs:{autocomplete:"off","aria-label":this.filterBarPlaceholder}});this.filterContainer.appendChild(e),t.prepend([this.filterContainer],this.popupEle),this.filterObj=new o.TextBox({value:"",showClearButton:!0,placeholder:this.filterBarPlaceholder,input:this.filterChangeHandler.bind(this)}),this.filterObj.appendTo("#"+this.element.id+"_filter")},s.prototype.filterChangeHandler=function(e){var i=this;t.isNullOrUndefined(e.value)||(window.clearTimeout(this.filterTimer),this.filterTimer=window.setTimeout(function(){i.filterHandler(e.value,e.event)},this.filterDelayTime))},s.prototype.filterHandler=function(e,t){var s=this;this.isFilteredData||(this.treeData=this.treeObj.getTreeData());var l=this.cloneFields(this.fields),o={cancel:!1,preventDefaultAction:!1,event:t,text:e,fields:l};this.trigger("filtering",o,function(t){if(!t.cancel){var l=!1,o=void 0;if(s.isFilteredData=!0,""===e?(s.isFilteredData=!1,s.isFilterRestore=!0,o=s.cloneFields(s.fields)):t.preventDefaultAction?o=t.fields:1===s.treeDataType?o=s.selfReferencefilter(e,t.fields):s.fields.dataSource instanceof i.DataManager?l=!0:o=s.nestedFilter(e,t.fields),s.hideCheckAll(s.isFilteredData),l)return;s.treeObj.fields=s.getTreeFields(o),s.treeObj.dataBind()}})},s.prototype.nestedFilter=function(e,i){for(var s=[],l=0;l<this.treeData.length;l++){var o=this.nestedChildFilter(e,this.treeData[l]);t.isNullOrUndefined(o)||s.push(o)}return i.dataSource=s,i},s.prototype.nestedChildFilter=function(e,i){var s=i[this.fields.child];if(t.isNullOrUndefined(s))return this.isMatchedNode(e,i)?i:null;for(var l=[],o=0;o<s.length;o++){var r=this.nestedChildFilter(e,s[o]);t.isNullOrUndefined(r)||l.push(r)}return 0!==l.length?(i[this.fields.child]=l,i):(i[this.fields.child]=null,this.isMatchedNode(e,i)?i:null)},s.prototype.selfReferencefilter=function(e,i){for(var s=[],l=[],o=0;o<this.treeData.length;o++)this.isMatchedNode(e,this.treeData[o])&&s.push(this.treeData[o]);for(o=0;o<s.length;o++)if(-1===l.indexOf(s[o])){l.push(s[o]);for(var r=s[o][this.fields.parentValue];!t.isNullOrUndefined(r);){for(var n=null,a=0;a<this.treeData.length;a++){var h=this.treeData[a][this.fields.value];if(!t.isNullOrUndefined(h)&&h===r){n=this.treeData[a];break}}if(t.isNullOrUndefined(n)||-1!==l.indexOf(n))break;l.push(n),r=n[this.fields.parentValue]}}return i.dataSource=l,i},s.prototype.isMatchedNode=function(e,t){var s=t[this.fields.text];return this.ignoreCase&&(s=s.toLowerCase(),e=e.toLowerCase()),this.ignoreAccent&&(s=i.DataUtil.ignoreDiacritics(s),e=i.DataUtil.ignoreDiacritics(e)),"StartsWith"===this.filterType?s.slice(0,e.length)===e:"EndsWith"===this.filterType?s.slice(-e.length)===e:-1!==s.indexOf(e)},s.prototype.wireEvents=function(){t.EventHandler.add(this.inputWrapper,"mouseup",this.dropDownClick,this),t.EventHandler.add(this.inputWrapper,"focus",this.focusIn,this),t.EventHandler.add(this.inputWrapper,"blur",this.focusOut,this),t.EventHandler.add(this.inputWrapper,"mousemove",this.mouseIn,this),t.EventHandler.add(this.inputWrapper,"mouseout",this.onMouseLeave,this),t.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),t.EventHandler.add(window,"resize",this.windowResize,this);var e=t.closest(this.inputWrapper,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),this.keyboardModule=new t.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.wireTreeEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.tree,{keyAction:this.treeAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.wireCheckAllWrapperEvents=function(){this.keyboardModule=new t.KeyboardEvents(this.checkAllParent,{keyAction:this.checkAllAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.inputWrapper,"mouseup",this.dropDownClick),t.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),t.EventHandler.remove(this.inputWrapper,"blur",this.focusOut),t.EventHandler.remove(this.inputWrapper,"mousemove",this.mouseIn),t.EventHandler.remove(this.inputWrapper,"mouseout",this.onMouseLeave),t.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),t.EventHandler.remove(window,"resize",this.windowResize);var e=t.closest(this.inputWrapper,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler)},s.prototype.dropDownClick=function(e){if(this.enabled&&!this.readonly){if(this.isClearButtonClick)return void(this.isClearButtonClick=!1);!this.wrapText&&e.target.classList.contains("e-chips-close")&&this.removeChip(e),this.isPopupOpen?this.hidePopup():(this.focusIn(e),this.renderPopup()),this.showOverAllClear()}},s.prototype.mouseIn=function(){!this.enabled&&this.readonly||this.showOverAllClear()},s.prototype.onMouseLeave=function(){this.inputFocus||(t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V))},s.prototype.getDirective=function(){return"EJS-DROPDOWNTREE"},s.prototype.focusOut=function(e){if(this.enabled&&!this.readonly&&this.inputFocus&&(!t.Browser.isIE&&"edge"!==t.Browser.info.name||e.target!==this.inputWrapper)){var i=e.relatedTarget;i===this.inputEle||!t.isNullOrUndefined(i)||e.target===this.inputWrapper&&this.isPopupOpen||this.onFocusOut(e)}},s.prototype.onFocusOut=function(e){if(this.inputFocus=!1,this.isPopupOpen&&this.hidePopup(),this.isClearButtonClick&&(this.isClearButtonClick=!1),this.showClearButton&&(this.clearIconWidth=t.select(".e-clear-icon",this.inputWrapper).offsetWidth,t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V)),t.removeClass([this.inputWrapper],[M]),this.allowMultiSelection||this.showCheckBox){var i=!!this.value&&!!this.value.length;"Delimiter"!==this.mode&&this.chipWrapper&&"Default"===this.mode&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H),t.removeClass([this.inputEle],U)),!this.wrapText&&i&&this.updateView()}this.changeOnBlur&&this.triggerChangeEvent(e),this.removeValue=!1,this.oldValue=this.value,this.trigger("blur")},s.prototype.updateView=function(){(this.showCheckBox||this.allowMultiSelection)&&("Box"!==this.mode?t.addClass([this.inputWrapper,this.overFlowWrapper],"e-show-text"):t.addClass([this.inputWrapper],H),this.value&&0!==this.value.length&&(this.inputWrapper.contains(this.chipWrapper)&&t.addClass([this.chipWrapper],j),t.addClass([this.inputEle],U),this.updateOverFlowView(),this.ensurePlaceHolder()))},s.prototype.triggerChangeEvent=function(e){if((!this.ddtCompareValues(this.oldValue,this.value)||this.isChipDelete)&&!this.removeValue){var t={e:e,oldValue:this.oldValue,value:this.value,isInteracted:!!e,element:this.element};this.trigger("change",t),this.oldValue=this.value}},s.prototype.ddtCompareValues=function(e,t){if(null===e||null===t)return null===e?t===e:0===e.length&&t===e;if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},s.prototype.focusIn=function(e){if(this.enabled&&!this.readonly&&!this.inputFocus){this.showOverAllClear(),this.inputFocus=!0,t.addClass([this.inputWrapper],[M]),(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.inputFocus&&(this.chipWrapper&&this.value&&0!==this.value.length&&(t.removeClass([this.chipWrapper],j),t.addClass([this.inputEle],U)),t.addClass([this.inputWrapper],H),this.popupObj&&this.popupObj.refreshPosition()),this.wrapText||(this.inputWrapper.contains(this.overFlowWrapper)&&t.addClass([this.overFlowWrapper],j),"Delimiter"===this.mode?(t.removeClass([this.inputWrapper],H),t.removeClass([this.inputEle],U)):t.addClass([this.inputWrapper],H),t.removeClass([this.inputWrapper],"e-show-text"),this.ensurePlaceHolder()));var i={isInteracted:!!e,event:e};this.trigger("focus",i)}},s.prototype.treeAction=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(i.cancel)e.stopImmediatePropagation();else switch(e.action){case"escape":case"altUp":t.inputWrapper.focus(),e.preventDefault(),t.isPopupOpen&&t.hidePopup();break;case"tab":case"shiftTab":t.isPopupOpen&&t.hidePopup();break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":t.showCheckBox||(t.isValueChange=!0,t.keyEventArgs=e);break;case"space":t.isValueChange=!0,t.keyEventArgs=e;break;case"ctrlA":t.allowMultiSelection&&t.selectAll(!0)}})},s.prototype.keyActionHandler=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(!i.cancel)switch(e.action){case"escape":case"altUp":case"shiftTab":case"tab":t.isPopupOpen&&t.hidePopup();break;case"altDown":t.isPopupOpen||(t.showPopup(),e.preventDefault());break;case"moveDown":t.showSelectAll&&t.showCheckBox&&t.checkAllParent.focus()}})},s.prototype.checkAllAction=function(e){var t=this,i={cancel:!1,event:e};this.trigger("keyPress",i,function(i){if(!i.cancel)switch(e.action){case"space":t.clickHandler(e);break;case"moveDown":t.treeObj.element.focus()}})},s.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.setWidth()}),this.popupObj.refreshPosition())},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputWrapper,"form");i&&e.target===i&&(this.isDynamicChange=!0,this.setProperties({value:null},!0),this.resetValue(!0),this.isDynamicChange=!1)},s.prototype.getAriaAttributes=function(){return{"aria-disabled":this.enabled?"false":"true","aria-owns":this.element.id+"_options",role:"listbox","aria-haspopup":"true","aria-expanded":"false","aria-activedescendant":"null","aria-labelledby":this.hiddenElement.id}},s.prototype.updateOverFlowView=function(){if(this.overFlowWrapper.classList.remove("e-total-count"),t.removeClass([this.overFlowWrapper],j),this.value&&this.value.length){var e="",i=void 0,s=void 0,l=void 0,o=1,r=void 0,n=void 0,a=0;this.overFlowWrapper.innerHTML="";var h={overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"};this.l10n=new t.L10n(this.getLocaleName(),h,this.locale);var p=this.l10n.getConstant("overflowCountTemplate"),u=this.createElement("span",{className:"e-remain"}),c=t.compile(p),d=t.compile(this.l10n.getConstant("totalCountTemplate"));u.appendChild(c({count:this.value.length},this,"overflowCountTemplate",null,!this.isStringTemplate)[0]),this.overFlowWrapper.appendChild(u);var m=u.offsetWidth;if(t.remove(u),this.showDropDownIcon&&(a=t.select(".e-ddt-icon",this.inputWrapper).offsetWidth),!t.isNullOrUndefined(this.value))if("Box"!==this.mode)for(var f=0;!t.isNullOrUndefined(this.value[f]);f++){if(e+=0===f?"":this.delimiterChar+" ",s=this.getOverflowVal(f),e+=s,s=this.overFlowWrapper.innerHTML,this.overFlowWrapper.innerHTML=e,r=this.overFlowWrapper.offsetWidth,i=this.inputWrapper.offsetWidth,r+a+this.clearIconWidth>i){for(void 0!==l&&""!==l&&(s=l,f=o+1),this.overFlowWrapper.innerHTML=s,n=this.value.length-f,r=this.overFlowWrapper.offsetWidth;r+m+a+this.clearIconWidth>=i&&0!==r&&""!==this.overFlowWrapper.innerHTML;){var v=this.overFlowWrapper.innerHTML.split(this.delimiterChar);v.pop(),this.overFlowWrapper.innerHTML=v.join(this.delimiterChar),n++,r=this.overFlowWrapper.offsetWidth}break}r+m+a+this.clearIconWidth<=i?(l=e,o=f):0===f&&(l="",o=-1)}else{t.addClass([this.chipWrapper],j);for(var y=this.chipWrapper.cloneNode(!0),g=t.selectAll(".e-chips",y),C=0;C<g.length;C++){if(s=this.overFlowWrapper.innerHTML,this.overFlowWrapper.appendChild(g[C]),e=this.overFlowWrapper.innerHTML,r=this.overFlowWrapper.offsetWidth,i=this.inputWrapper.offsetWidth,r+a+this.clearIconWidth>i){for(void 0!==l&&""!==l&&(s=l,C=o+1),this.overFlowWrapper.innerHTML=s,n=this.value.length-C,r=this.overFlowWrapper.offsetWidth;r+m+a+this.clearIconWidth>=i&&0!==r&&""!==this.overFlowWrapper.innerHTML;)this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild),n++,r=this.overFlowWrapper.offsetWidth;break}r+m+a+this.clearIconWidth<=i?(l=e,o=C):0===C&&(l="",o=-1)}}n>0&&this.overFlowWrapper.appendChild(this.updateRemainTemplate(u,n,c,d)),"Box"!==this.mode||this.overFlowWrapper.classList.contains("e-total-count")||t.addClass([u],"e-wrap-count")}else this.overFlowWrapper.innerHTML="",t.addClass([this.overFlowWrapper],j);this.updateDelimMode()},s.prototype.updateRemainTemplate=function(e,i,s,l){return this.overFlowWrapper.firstChild&&3===this.overFlowWrapper.firstChild.nodeType&&""===this.overFlowWrapper.firstChild.nodeValue&&this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild),e.innerHTML="",e.appendChild(!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?l({count:i},this,"totalCountTemplate",null,!this.isStringTemplate)[0]:s({count:i},this,"overflowCountTemplate",null,!this.isStringTemplate)[0]),!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?(t.addClass([this.overFlowWrapper],"e-total-count"),t.removeClass([this.overFlowWrapper],"e-wrap-count")):t.removeClass([this.overFlowWrapper],"e-total-count"),e},s.prototype.getOverflowVal=function(e){var i=this.getSelectedData(this.value[e]);return t.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",i)},s.prototype.updateDelimMode=function(){"Box"!==this.mode?t.select(".e-remain",this.overFlowWrapper)&&!this.overFlowWrapper.classList.contains("e-total-count")?(t.addClass([this.overFlowWrapper],"e-wrap-count"),t.addClass([this.overFlowWrapper],"e-show-text")):(this.overFlowWrapper.classList.remove("e-wrap-count"),t.removeClass([this.overFlowWrapper],"e-wrap-count")):t.select(".e-remain",this.overFlowWrapper)&&this.overFlowWrapper.classList.remove("e-wrap-count")},s.prototype.createHiddenElement=function(){this.allowMultiSelection||this.showCheckBox?this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-ddt-hidden",tabindex:"-1",multiple:""}}):this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:"e-ddt-hidden"}}),t.prepend([this.hiddenElement],this.inputWrapper),this.validationAttribute()},s.prototype.createClearIcon=function(){this.overAllClear=this.createElement("span",{className:"e-clear-icon e-icons"}),t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V),this.showClearButton&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},s.prototype.validationAttribute=function(){var e=this.inputEle.getAttribute("name")?this.inputEle.getAttribute("name"):this.inputEle.getAttribute("id");this.hiddenElement.setAttribute("name",e),this.inputEle.removeAttribute("name");for(var t=["required","aria-required","form"],i=0;i<t.length;i++){var s=this.inputEle.getAttribute(t[i]);s&&(this.hiddenElement.setAttribute(t[i],s),this.inputEle.removeAttribute(t[i]))}},s.prototype.createChip=function(){this.inputWrapper.contains(this.chipWrapper)||(this.chipWrapper=this.createElement("span",{className:"e-chips-wrapper"}),this.chipCollection=this.createElement("span",{className:"e-chips-collection"}),this.chipWrapper.appendChild(this.chipCollection),this.inputWrapper.insertBefore(this.chipWrapper,this.hiddenElement),t.addClass([this.inputWrapper],H),this.getValidMode()&&null!==this.value?t.addClass([this.inputEle],U):null===this.value&&t.addClass([this.chipWrapper],j))},s.prototype.getValidMode=function(){return!(!this.allowMultiSelection&&!this.showCheckBox)&&("Box"===this.mode||!("Default"!==this.mode||!this.inputFocus))},s.prototype.createSelectAllWrapper=function(){this.checkAllParent=this.createElement("div",{className:"e-selectall-parent",attrs:{tabindex:"0"}}),this.selectAllSpan=this.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="";var e=t.closest(this.element,".e-bigger"),i=t.isNullOrUndefined(e)?"":"e-small";this.checkBoxElement=r.createCheckBox(this.createElement,!0,{cssClass:i}),this.checkBoxElement.setAttribute("role","checkbox"),this.checkAllParent.appendChild(this.checkBoxElement),this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),t.EventHandler.add(this.checkAllParent,"mouseup",this.clickHandler,this),this.wireCheckAllWrapperEvents()},s.prototype.clickHandler=function(e){var i;if(i=e.currentTarget&&e.currentTarget.classList.contains("e-selectall-parent")?e.currentTarget.firstElementChild.lastElementChild:e.target,this.checkWrapper=t.closest(i,".e-checkbox-wrapper"),!t.isNullOrUndefined(this.checkWrapper)){var s=t.select(".e-frame",this.checkWrapper);this.changeState(this.checkWrapper,s.classList.contains(R)?"uncheck":"check",e)}e.preventDefault()},s.prototype.changeState=function(e,i,s){var l,o=e.getElementsByClassName("e-frame")[0];"check"!==i||o.classList.contains(R)?"uncheck"===i&&o.classList.contains(R)&&(o.classList.remove(R),l="false",this.isReverseUpdate||(this.treeObj.uncheckAll(),this.changeOnBlur||this.triggerChangeEvent(s)),this.setLocale(!1)):(o.classList.add(R),l="true",this.isReverseUpdate||(this.treeObj.checkAll(),this.changeOnBlur||this.triggerChangeEvent(s)),this.setLocale(!0)),this.setMultiSelect(),this.ensurePlaceHolder(),l="check"===i?"true":"false",t.isNullOrUndefined(l)||e.setAttribute("aria-checked",l)},s.prototype.setLocale=function(e){if(this.selectAllSpan)if("Select All"!==this.selectAllText||"Unselect All"!==this.unSelectAllText){var i=e?this.unSelectAllText:this.selectAllText;this.selectAllSpan.textContent="";for(var s=0,l=t.compile(i)({},this,e?"unSelectAllText":"selectAllText",null,!this.isStringTemplate);s<l.length;s++){var o=l[s];this.selectAllSpan.textContent=o.textContent}}else this.selectAllSpan.textContent=e?this.unSelectAllText:this.selectAllText},s.prototype.setAttributes=function(){this.element.removeAttribute("tabindex");var e=this.element.getAttribute("id");this.hiddenElement.id=e+"_hidden",this.inputWrapper.setAttribute("tabindex","0"),t.attributes(this.inputWrapper,this.getAriaAttributes())},s.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if("class"===s)this.inputWrapper.classList.add(this.htmlAttributes[s]);else if("disabled"===s&&"disabled"===this.htmlAttributes[s])this.setProperties({enabled:!1},!0),this.setEnable();else if("readonly"!==s||t.isNullOrUndefined(this.htmlAttributes[s]))if("style"===s)this.inputWrapper.setAttribute("style",this.htmlAttributes[s]);else{var l=["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],r=["name","required"];0===s.indexOf("data")||r.indexOf(s)>-1?this.hiddenElement.setAttribute(s,this.htmlAttributes[s]):l.indexOf(s)>-1?"placeholder"===s?o.Input.setPlaceholder(this.htmlAttributes[s],this.inputEle):this.inputEle.setAttribute(s,this.htmlAttributes[s]):this.inputWrapper.setAttribute(s,this.htmlAttributes[s])}else this.setProperties({readonly:!0},!0),this.dataBind()}},s.prototype.updateDataAttribute=function(){for(var e=this.htmlAttributes,i=["class","style","id","type"],s={},l=0;l<this.element.attributes.length;l++)-1===i.indexOf(this.element.attributes[l].name)&&"readonly"!==this.element.attributes[l].name&&(s[this.element.attributes[l].name]=this.element.getAttribute(this.element.attributes[l].name));t.extend(s,e,s),this.setProperties({htmlAttributes:s},!0)},s.prototype.showOverAllClear=function(){this.enabled&&!this.readonly&&this.overAllClear&&(!!this.value&&!!this.value.length&&this.showClearButton?(t.removeClass([this.overAllClear],j),t.addClass([this.inputWrapper],V)):(t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V)))},s.prototype.setTreeValue=function(){if(null!==this.value&&0!==this.value.length){var e=void 0;if(this.showCheckBox||this.allowMultiSelection){for(var i=0;i<this.value.length;i++)e=this.treeObj.getTreeData(this.value[i])[0],t.isNullOrUndefined(e)&&this.value.splice(this.value.indexOf(this.value[i]),1);0!==this.value.length&&this.setValidValue()}else e=this.treeObj.getTreeData(this.value[0])[0],t.isNullOrUndefined(e)?this.setProperties({value:this.currentValue},!0):(this.setProperties({text:e[this.fields.text]},!0),this.setValidValue())}},s.prototype.setTreeText=function(){if((null===this.value||this.isInitialized)&&null!==this.text){var e=void 0,i=[];if(this.showCheckBox||this.allowMultiSelection){for(var s=this.text.split(this.delimiterChar),l=0;l<s.length;l++)e=this.getItems(s[l]),t.isNullOrUndefined(e)||i.push(e[this.fields.value].toString());0!==i.length?(this.oldValue=this.value,this.setProperties({value:i},!0),this.setValidValue()):this.setProperties({text:this.currentText},!0)}else e=this.getItems(this.text),t.isNullOrUndefined(e)?this.setProperties({text:this.currentText},!0):(this.oldValue=this.value,this.setProperties({value:[e[this.fields.value].toString()]},!0),this.setValidValue())}},s.prototype.setSelectedValue=function(){null==this.value&&(this.isInitialized||(this.oldValue=this.value,this.treeObj.selectedNodes.length>0&&!this.showCheckBox?(this.setProperties({value:this.treeObj.selectedNodes},!0),this.allowMultiSelection&&this.updateMode()):this.showCheckBox&&this.treeObj.checkedNodes&&this.treeObj.checkedNodes.length>0&&(this.setProperties({value:this.treeObj.checkedNodes},!0),t.setValue("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.updateMode()),this.updateSelectedValues(),this.currentText=this.text,this.currentValue=this.value))},s.prototype.setValidValue=function(){if(this.showCheckBox||this.allowMultiSelection)this.showCheckBox?(this.treeObj.checkedNodes=this.value.slice(),t.setValue("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.setMultiSelect()):(this.treeObj.selectedNodes=this.value.slice(),this.selectedText=[],this.updateSelectedValues()),this.treeObj.dataBind();else{o.Input.setValue(this.text,this.inputEle,this.floatLabelType);var e=this.value[0].toString();this.treeObj.selectedNodes[0]!==e&&t.setValue("selectedNodes",[e],this.treeObj)}this.currentText=this.text,this.currentValue=this.value,this.isInitialized&&this.triggerChangeEvent()},s.prototype.getItems=function(e){var i;if(1===this.treeDataType)for(var s=0;s<this.treeItems.length;s++){var l=t.getValue(this.fields.text,this.treeItems[s]);if(!t.isNullOrUndefined(this.treeItems[s])&&!t.isNullOrUndefined(l)&&l===e){i=this.treeItems[s];break}}else i=this.getNestedItems(this.treeItems,this.fields,e);return i},s.prototype.getNestedItems=function(e,s,l){for(var o,r=0,n=e.length;r<n;r++){var a=t.getValue(this.fields.text,e[r]);if(e[r]&&a&&a.toString()===l)return e[r];if("string"!=typeof s.child||t.isNullOrUndefined(t.getValue(s.child,e[r]))){if(this.fields.dataSource instanceof i.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[r]))){if(void 0!==(o=this.getNestedItems(t.getValue("child",e[r]),this.getChildType(s),l)))break}}else{var h=t.getValue(s.child,e[r]);if(void 0!==(o=this.getNestedItems(h,this.getChildType(s),l)))break}}return o},s.prototype.getChildType=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},s.prototype.renderTree=function(){this.treeObj=new n.TreeView({fields:this.getTreeFields(this.fields),enableRtl:this.enableRtl,nodeSelected:this.onNodeSelected.bind(this),nodeChecked:this.onNodeChecked.bind(this),nodeChecking:this.beforeCheck.bind(this),actionFailure:this.onActionFailure.bind(this),nodeClicked:this.onNodeClicked.bind(this),dataBound:this.OnDataBound.bind(this),allowMultiSelection:this.allowMultiSelection,showCheckBox:this.showCheckBox,autoCheck:this.treeSettings.autoCheck,sortOrder:this.sortOrder,expandOn:this.treeSettings.expandOn,loadOnDemand:this.treeSettings.loadOnDemand,nodeSelecting:this.onBeforeSelect.bind(this),nodeTemplate:this.itemTemplate}),this.treeObj.appendTo("#"+this.tree.id)},s.prototype.renderPopup=function(){var e=this;this.isFilteredData&&(this.filterObj.value="",this.treeObj.fields=this.getTreeFields(this.fields),this.isFilterRestore=!0,this.isFilteredData=!1,this.hideCheckAll(!1));var i=!1,s={cancel:!1};this.trigger("beforeOpen",s,function(s){if(s.cancel?i=!0:(t.addClass([e.inputWrapper],["e-icon-anim"]),e.isFirstRender?(e.popupEle=e.createElement("div",{id:e.element.id+"_popup",className:"e-ddt e-popup "+(null!=e.cssClass?e.cssClass:"")}),document.body.appendChild(e.popupEle),e.createPopup(e.popupEle)):e.popupEle=e.popupObj.element),e.isFirstRender&&!i&&(t.prepend([e.popupDiv],e.popupEle),e.popupDiv.style.display="block",e.allowFiltering&&e.renderFilter(),e.showCheckBox&&e.showSelectAll&&!e.popupDiv.classList.contains(q)&&(e.createSelectAllWrapper(),e.popupEle.insertBefore(e.checkAllParent,e.popupDiv)),e.headerTemplate&&e.setHeaderTemplate(),e.footerTemplate&&e.setFooterTemplate(),e.isFirstRender=!1,e.hasTemplate&&e.portals&&(e.portals=e.portals.concat(e.treeObj.portals),e.renderReactTemplates())),!i){if(t.attributes(e.inputWrapper,{"aria-expanded":"true"}),e.popupObj.show(null,1e3===e.zIndex?e.inputEle:null),e.popupEle.style.display="block",e.updatePopupHeight(),e.popupObj.refreshPosition(),e.showCheckBox&&e.showSelectAll||e.popupDiv.classList.contains(q)||!(e.treeItems.length>0)||e.treeObj.element.focus(),e.checkSelectAll&&e.checkBoxElement){var l=t.closest(e.checkBoxElement,".e-checkbox-wrapper");e.changeState(l,"check"),e.checkSelectAll=!1}e.allowFiltering&&(t.removeClass([e.inputWrapper],[M]),e.filterObj.element.focus());var o={popup:e.popupObj};e.trigger("open",o)}})},s.prototype.updatePopupHeight=function(){if(!this.isFirstRender){var e=this.getHeight();if(this.popupEle.style.maxHeight=e,this.allowFiltering){i=Math.round(this.filterContainer.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.headerTemplate){i=Math.round(this.header.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.showCheckBox&&this.showSelectAll){i=Math.round(this.checkAllParent.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}if(this.footerTemplate){var i=Math.round(this.footer.getBoundingClientRect().height);e=t.formatUnit(parseInt(e,10)-i+"px")}var s=parseInt(window.getComputedStyle(this.popupEle).borderTopWidth,10);s+=parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth,10),e=t.formatUnit(parseInt(e,10)-s+"px"),this.popupDiv.style.maxHeight=e}},s.prototype.createPopup=function(e){var i=this;this.isFirstRender&&(this.popupObj=new l.Popup(e,{width:this.setWidth(),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,zIndex:this.zIndex,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},close:function(){i.isPopupOpen=!1},open:function(){t.EventHandler.add(document,"mousedown",i.onDocumentClick,i),i.isPopupOpen=!0},targetExitViewport:function(){t.Browser.isDevice||i.hidePopup()}}))},s.prototype.setElementWidth=function(e){var i=this.inputWrapper;t.isNullOrUndefined(e)||("number"==typeof e?i.style.width=t.formatUnit(e):"string"==typeof e&&(i.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.setWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1?e=(this.inputWrapper.offsetWidth*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupWidth&&(e=this.popupWidth.match(/px|em/)?this.popupWidth:e),e},s.prototype.getHeight=function(){var e=t.formatUnit(this.popupHeight);return e.indexOf("%")>-1?e=(document.documentElement.clientHeight*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupHeight&&(e=this.popupHeight.match(/px|em/)?this.popupHeight:e),e},s.prototype.onDocumentClick=function(e){var i=e.target,s=t.closest(i,".e-list-parent"),l=t.closest(i,".e-filter-wrap"),o=!!i.classList.contains("e-dropdown")||(t.matches(i,".e-ddt .e-popup")||t.matches(i,".e-ddt .e-treeview"));this.isPopupOpen&&(this.inputWrapper.contains(i)||s||l||o)||(this.allowMultiSelection||this.showCheckBox)&&(this.isPopupOpen&&i.classList.contains("e-chips-close")||this.isPopupOpen&&(i.classList.contains("e-selectall-parent")||i.classList.contains("e-all-text")||i.classList.contains("e-frame")))?(this.isDocumentClick=!1,e.preventDefault()):!this.inputWrapper.contains(i)&&this.inputFocus&&this.focusOut(e)},s.prototype.onActionFailure=function(e){this.trigger("actionFailure",e),this.l10nUpdate(!0),t.addClass([this.popupDiv],q)},s.prototype.OnDataBound=function(e){this.treeItems=e.data,this.treeItems.length<=0?(this.l10nUpdate(),t.addClass([this.popupDiv],q),this.hideCheckAll(!0)):this.popupDiv.classList.contains(q)&&this.treeItems.length>=1&&(t.removeClass([this.popupDiv],q),this.hideCheckAll(!1)),this.treeDataType=this.getTreeDataType(this.treeItems,this.fields),this.isFirstRender&&this.isRemoteData&&(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView(),this.treeObj.element.focus());var i={data:e.data};this.trigger("dataBound",i),this.isFilteredData&&this.treeObj.expandAll(),this.isFilterRestore&&(this.restoreFilterSelection(),this.isFilterRestore=!1)},s.prototype.restoreFilterSelection=function(){this.showCheckBox?this.treeObj.checkedNodes=this.value?this.value:[]:this.treeObj.selectedNodes=this.value?this.value:[]},s.prototype.setCssClass=function(e,i){var s=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];t.isNullOrUndefined(i)||""===i||t.removeClass(s,i.split(" ")),t.isNullOrUndefined(e)||""===e||t.addClass(s,e.split(" "))},s.prototype.setEnableRTL=function(e){e?this.inputWrapper.classList.add("e-rtl"):this.inputWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind()),this.treeObj&&(this.treeObj.enableRtl=e,this.treeObj.dataBind())},s.prototype.setEnable=function(){o.Input.setEnabled(this.enabled,this.inputEle),this.enabled?(t.removeClass([this.inputWrapper],"e-disabled"),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false")):(this.isPopupOpen&&this.hidePopup(),t.addClass([this.inputWrapper],"e-disabled"),this.inputWrapper&&this.inputWrapper.classList.contains(M)&&t.removeClass([this.inputWrapper],[M]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true"))},s.prototype.cloneFields=function(e){return{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:this.cloneChildField(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.cloneChildField=function(e){return"string"==typeof e?e:{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:e.child?this.cloneChildField(e.child):null,hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.getTreeFields=function(e){return{dataSource:e.dataSource,id:e.value,text:e.text,parentID:e.parentValue,child:this.getTreeChildren(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,isChecked:e.selected,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},s.prototype.getTreeChildren=function(e){if("string"==typeof e)return e;if(!t.isNullOrUndefined(e)){var i=e=this.getActualProperties(e);return e.value&&(i.id=e.value),e.parentValue&&(i.parentID=e.parentValue),e.child&&(i.child=this.getTreeChildren(e.child)),e.selected&&this.showCheckBox&&(i.isChecked=e.selected),i}return null},s.prototype.getTreeDataType=function(e,s){if(this.fields.dataSource instanceof i.DataManager){for(l=0;l<e.length;l++)if("string"==typeof s.child&&t.isNullOrUndefined(t.getValue(s.child,e[l])))return 1;return 2}for(var l=0,o=e.length;l<o;l++){if("string"==typeof s.child&&!t.isNullOrUndefined(t.getValue(s.child,e[l])))return 2;if(!t.isNullOrUndefined(t.getValue(s.parentValue,e[l]))||!t.isNullOrUndefined(t.getValue(s.hasChildren,e[l])))return 1}return 1},s.prototype.setFields=function(){this.resetValue(),this.hasTemplate&&this.updateTemplate(),this.treeObj.fields=this.getTreeFields(this.fields),this.treeObj.dataBind()},s.prototype.getEventArgs=function(e){var t,i=e.data,s=e.nodeData;return this.showCheckBox&&("check"===e.action?t="select":"uncheck"===e.action&&(t="un-select")),{action:this.showCheckBox?t:e.action,isInteracted:e.isInteracted,item:e.node,itemData:this.showCheckBox?i[0]:s}},s.prototype.onBeforeSelect=function(e){e.isInteracted&&(this.oldValue=this.value?this.value.slice():this.value,null===this.value&&this.setProperties({value:[]},!0))},s.prototype.updateHiddenValue=function(){this.allowMultiSelection||this.showCheckBox||(this.value&&this.value.length?this.hiddenElement.innerHTML='<option selected value ="'+this.value[0]+'">'+this.text+"</option>":this.hiddenElement.innerHTML="")},s.prototype.onNodeSelected=function(e){if(!this.showCheckBox){var i;if(e.isInteracted){var s=t.getValue("id",e.nodeData).toString();this.allowMultiSelection?this.allowMultiSelection&&this.setMultiSelect():(this.hiddenElement.innerHTML="",this.setProperties({value:[s]},!0),i=this.itemTemplate?t.getValue("text",this.treeObj.getNode(s)):t.getValue("text",e.nodeData).toString(),o.Input.setValue(i,this.inputEle,this.floatLabelType),this.setProperties({text:i},!0),this.currentText=this.text,this.currentValue=this.value,t.attributes(this.inputWrapper,{"aria-describedby":this.element.id}),t.attributes(this.inputWrapper,{"aria-activedescendant":s.toString()}),this.updateHiddenValue(),this.showOverAllClear(),this.hidePopup(),this.isNodeSelected=!0)}var l=this.getEventArgs(e);this.trigger("select",l),this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)}},s.prototype.onNodeClicked=function(e){!this.changeOnBlur&&this.isNodeSelected&&(this.triggerChangeEvent(e.event),this.isNodeSelected=!1);var t=e.event.target;(t.classList.contains("e-fullrow")||t.classList.contains("e-list-text"))&&this.showCheckBox&&("true"===this.treeObj.getNode(e.node).isChecked?this.treeObj.uncheckAll([e.node]):this.treeObj.checkAll([e.node]),this.setMultiSelect(),this.ensurePlaceHolder()),this.changeOnBlur||!this.allowMultiSelection&&!this.showCheckBox||this.triggerChangeEvent(e.event)},s.prototype.onNodeChecked=function(e){var i=this.getEventArgs(e);if(this.trigger("select",i),this.isFilteredData&&"uncheck"===e.action){var s=t.getValue("id",e.data[0]).toString();this.removeSelectedData(s,!0)}if(!this.isChipDelete&&e.isInteracted&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.showSelectAll&&this.checkBoxElement){var l=this.treeObj.element.querySelectorAll("li"),o=this.treeObj.element.querySelectorAll("li .e-checkbox-wrapper[aria-checked=true]"),r=t.closest(this.checkBoxElement,".e-checkbox-wrapper");r&&"uncheck"===e.action?(this.isReverseUpdate=!0,this.changeState(r,"uncheck"),this.isReverseUpdate=!1):r&&"check"===e.action&&o.length===l.length&&(this.isReverseUpdate=!0,this.changeState(r,"check"),this.isReverseUpdate=!1)}},s.prototype.beforeCheck=function(e){e.isInteracted&&(this.oldValue=this.value?this.value.slice():this.value)},s.prototype.updateClearButton=function(e){if(e?this.inputWrapper.contains(this.overAllClear)?(t.removeClass([this.overAllClear],j),t.addClass([this.inputWrapper],V)):this.inputEle.parentElement.insertBefore(this.overAllClear,this.inputEle.nextSibling):(t.addClass([this.overAllClear],j),t.removeClass([this.inputWrapper],V)),(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper)for(var i=t.selectAll(".e-chips-close",this.chipWrapper),s=0;s<i.length;s++)e?t.removeClass([i[s]],j):t.addClass([i[s]],j)},s.prototype.updateDropDownIconState=function(e){var i=t.select(".e-ddt-icon",this.inputWrapper);e?(i?t.removeClass([i],j):o.Input.appendSpan(W,this.inputWrapper,this.createElement),t.addClass([this.inputWrapper],"e-show-dd-icon")):(t.addClass([i],j),t.removeClass([this.inputWrapper],"e-show-dd-icon"))},s.prototype.updateMode=function(){if("Delimiter"!==this.mode){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var e=this.getValidMode();this.chipWrapper.classList.contains(j)&&e?(t.removeClass([this.chipWrapper],j),t.addClass([this.inputWrapper],H)):e||(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H));var i=null!==this.value&&0!==this.value.length;e&&i?t.addClass([this.inputEle],U):t.removeClass([this.inputEle],U)}else this.inputEle.classList.contains(U)&&(t.removeClass([this.inputEle],U),this.chipWrapper&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H)))},s.prototype.ensurePlaceHolder=function(){this.value&&0===this.value.length&&(t.removeClass([this.inputEle],U),this.chipWrapper&&t.addClass([this.chipWrapper],j))},s.prototype.ensureClearIconPosition=function(e){"Never"!==e&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},s.prototype.setMultiSelectValue=function(e){if(this.isFilteredData){for(var i=t.isNullOrUndefined(this.value)?[]:this.value,s=0;s<e.length;s++)(t.isNullOrUndefined(this.value)||-1===this.value.indexOf(e[s]))&&i.push(e[s]);this.setProperties({value:i},!0)}else this.setProperties({value:e},!0),e&&0!==e.length&&!this.showCheckBox&&(this.treeObj.selectedNodes=this.value.slice(),this.treeObj.dataBind())},s.prototype.setMultiSelect=function(){if(this.showCheckBox&&!this.isDynamicChange)this.setMultiSelectValue(this.treeObj.checkedNodes.slice());else{var e=this.allowMultiSelection?this.showCheckBox?this.treeObj.checkedNodes:this.treeObj.selectedNodes:this.value?this.showCheckBox?this.value:[this.value[0]]:null;this.setMultiSelectValue(e),this.showCheckBox&&null!==this.value&&(this.treeObj.checkedNodes=this.value,this.treeObj.dataBind())}this.selectedText=[];var i=!!this.allowMultiSelection||!!this.showCheckBox;this.inputWrapper.contains(this.chipWrapper)&&!i&&(t.removeClass([this.inputEle],U),t.detach(this.chipWrapper)),this.getValidMode()&&null!==this.value&&(t.addClass([this.inputEle],U),this.chipWrapper&&t.removeClass([this.chipWrapper],j));var s=!!this.value&&!!this.value.length;this.chipWrapper&&"Box"===this.mode&&!s&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputEle],U)),this.updateSelectedValues()},s.prototype.getSelectedData=function(e){var i=null;if(this.isFilteredData)for(var s=0;s<this.selectedData.length;s++)if(t.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[s]).toString()===e){i=this.selectedData[s];break}return t.isNullOrUndefined(i)&&(i=this.treeSettings.loadOnDemand?this.treeObj.getTreeData(e)[0]:this.treeObj.getNode(e),t.isNullOrUndefined(i)||this.selectedData.push(i)),i},s.prototype.removeSelectedData=function(e,i){var s=t.isNullOrUndefined(this.value)?[]:this.value.slice();s.splice(s.indexOf(e),1),this.setProperties({value:s},i);for(var l=0;l<this.selectedData.length;l++)if(t.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[l]).toString()===e){this.selectedData.splice(l,1);break}},s.prototype.updateSelectedValues=function(){this.dataValue="";var e,i,s,l="";if(this.hiddenElement.innerHTML="",this.isChipDelete&&!this.treeSettings.autoCheck||!this.inputWrapper.contains(this.chipWrapper)||(this.chipCollection.innerHTML=""),this.isFilteredData||(this.selectedData=[]),!t.isNullOrUndefined(this.value))for(var r=0,n=this.value.length;r<n;r++)s=this.getSelectedData(this.value[r]),i=t.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",s),this.selectedText.push(i),e=this.selectedText[this.selectedText.length-1],this.selectedText.length>1?(this.dataValue+=this.delimiterChar+" "+e,l+=","+e,this.setProperties({text:l},!0)):(this.dataValue+=e,l+=e),"Delimiter"===this.mode||this.isChipDelete&&!this.treeSettings.autoCheck||!this.allowMultiSelection&&!this.showCheckBox||this.setChipValues(e,this.value[r]),this.hiddenElement.innerHTML+='<option selected value ="'+this.value[r]+'">'+this.selectedText[this.selectedText.length-1]+"</option>";var a=this.getValidMode();"Box"===this.mode||!this.allowMultiSelection&&!this.showCheckBox||a||this.chipWrapper&&(t.addClass([this.chipWrapper],j),t.removeClass([this.inputWrapper],H)),o.Input.setValue(this.dataValue,this.inputEle,this.floatLabelType),""===l?this.setProperties({text:null},!0):this.setProperties({text:l},!0),this.showClearButton&&this.inputFocus&&this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&this.popupObj&&this.popupObj.refreshPosition(),this.currentText=this.text,this.currentValue=this.value},s.prototype.setChipValues=function(e,i){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var s=this.createElement("span",{className:"e-chips",attrs:{"data-value":i}}),l=this.createElement("span",{className:"e-chipcontent"}),o=this.createElement("span",{className:"e-chips-close e-icons"});l.innerHTML=e,s.appendChild(l),this.chipCollection.appendChild(s),this.showClearButton&&(s.appendChild(o),t.EventHandler.add(o,"mousedown",this.removeChip,this))},s.prototype.setSelectAllWrapper=function(e){this.isFirstRender||(e&&!this.popupEle.contains(this.checkAllParent)&&this.showCheckBox?(this.createSelectAllWrapper(),this.popupEle.insertBefore(this.checkAllParent,this.popupDiv)):this.popupEle.contains(this.checkAllParent)&&(t.detach(this.checkAllParent),this.checkAllParent=null))},s.prototype.setHeaderTemplate=function(){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),t.addClass([this.header],"e-ddt-header"));var e=this.templateComplier(this.headerTemplate)({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,void 0,this.header);e&&(e=Array.prototype.slice.call(e),t.append(e,this.header)),this.ddtupdateBlazorTemplates(!1,!1,!0,!1),this.popupEle.insertBefore(this.header,this.checkAllParent?this.checkAllParent:this.popupDiv)},s.prototype.templateComplier=function(e){if(e)try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(i){return t.compile(e)}return t.compile(e)},s.prototype.setFooterTemplate=function(){this.footer?this.footer.innerHTML="":(this.footer=this.createElement("div"),t.addClass([this.footer],"e-ddt-footer"));var e=this.templateComplier(this.footerTemplate)({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,void 0,this.footer);e&&(e=Array.prototype.slice.call(e),t.append(e,this.footer)),this.ddtupdateBlazorTemplates(!1,!1,!1,!0),t.append([this.footer],this.popupEle)},s.prototype.clearAll=function(e){this.enabled&&!this.readonly&&(this.resetValue(),this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&(this.popupObj&&this.popupObj.refreshPosition(),this.wrapText||this.updateOverflowWrapper(!0)),e&&(this.isClearButtonClick=!0),this.changeOnBlur||this.triggerChangeEvent(e))},s.prototype.removeChip=function(e){if(this.enabled&&!this.readonly){var i=e.target.parentElement,s=i.getAttribute("data-value");this.chipCollection&&i&&t.remove(i),this.isChipDelete=!0,this.isClearButtonClick=!0,this.removeSelectedData(s,!0),this.selectedText=[],this.allowMultiSelection&&(this.treeObj.selectedNodes=this.value.slice(),this.updateSelectedValues()),this.showCheckBox&&(this.treeObj.uncheckAll([s]),this.clearCheckAll(),this.setMultiSelect()),this.triggerChangeEvent(e),this.isChipDelete=!1,this.ensurePlaceHolder()}},s.prototype.resetValue=function(e){o.Input.setValue(null,this.inputEle,this.floatLabelType),e||(this.oldValue=this.value,this.setProperties({value:[]},!0)),this.dataValue=null,this.setProperties({text:null},!0),this.selectedData=[],t.setValue("selectedNodes",[],this.treeObj),this.hiddenElement.innerHTML="",this.showCheckBox&&(this.treeObj.uncheckAll(),this.setMultiSelect(),this.clearCheckAll()),null!==this.oldValue||e?e&&this.triggerChangeEvent():this.removeValue=!0,(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper&&(this.chipCollection.innerHTML="",this.wrapText||this.updateOverflowWrapper(!0),this.ensurePlaceHolder())},s.prototype.clearCheckAll=function(){this.showSelectAll&&this.value&&0===this.value.length&&this.setLocale(!1)},s.prototype.selectAllItems=function(e){if(this.showCheckBox)e?this.treeObj.checkAll():this.treeObj.uncheckAll(),this.checkSelectAll=!0;else if(this.allowMultiSelection)if(e){for(var i=t.selectAll("li",this.treeObj.element),s=void 0,l=[],o=0;o<i.length;o++)s=i[o].getAttribute("data-uid").toString(),l.push(s);this.treeObj.selectedNodes=l}else this.treeObj.selectedNodes=[];this.updateMode(),this.setMultiSelect(),this.wrapText||(e?this.updateView():this.updateOverflowWrapper(!0))},s.prototype.updateTreeSettings=function(e){var t=Object.keys(e.treeSettings)[0];if("autoCheck"===t)this.ensureAutoCheck(),this.treeObj.autoCheck=this.treeSettings.autoCheck;else if("loadOnDemand"===t)this.treeObj.loadOnDemand=this.treeSettings.loadOnDemand;else if("expandOn"===t)return this.treeObj.expandOn=this.treeSettings.expandOn,void this.treeObj.dataBind();this.treeObj.dataBind(),this.setMultiSelect(),this.updateValue(this.value)},s.prototype.updateCheckBoxState=function(e){this.hasTemplate&&this.updateTemplate(),this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.showCheckBox=e,this.treeObj.dataBind(),this.isDynamicChange=!0,this.setSelectAllWrapper(this.showSelectAll),this.showSelectAll&&this.setLocale(),this.showCheckBox&&this.updateMode(),this.setMultiSelect(),this.isDynamicChange=!1},s.prototype.updateTemplate=function(){this.popupObj&&(this.clearTemplate(),this.portals=[],this.popupObj.destroy(),this.isPopupOpen?(this.hidePopup(),this.isFirstRender=!0,this.renderPopup()):this.isFirstRender=!0)},s.prototype.l10nUpdate=function(e){if(this.noRecord?this.noRecord.innerHTML="":(this.noRecord=this.createElement("div"),t.addClass([this.noRecord],"e-ddt-nodata"),t.prepend([this.noRecord],this.popupDiv)),"No Records Found"!==this.noRecordsTemplate||"The Request Failed"!==this.actionFailureTemplate){var i=e?this.actionFailureTemplate:this.noRecordsTemplate,s=e?this.actionFailureTemplateId:this.noRecordsTemplateId,l=e?"actionFailureTemplate":"noRecordsTemplate",o=this.templateComplier(i)({},this,l,s,this.isStringTemplate,void 0,this.noRecord);o&&(o=Array.prototype.slice.call(o),t.append(o,this.noRecord)),this.ddtupdateBlazorTemplates(!e,e)}else{var r={noRecordsTemplate:"No Records Found",actionFailureTemplate:"The Request Failed"};this.l10n=new t.L10n(this.getLocaleName(),r,this.locale),this.noRecord.innerHTML=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")}},s.prototype.ddtupdateBlazorTemplates=function(e,i,s,l,o){this.isStringTemplate||(this.noRecordsTemplate&&e&&t.updateBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate",this,o),this.actionFailureTemplate&&i&&t.updateBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate",this,o),s&&t.updateBlazorTemplate(this.headerTemplateId,"HeaderTemplate",this),l&&t.updateBlazorTemplate(this.footerTemplateId,"FooterTemplate",this))},s.prototype.ddtresetBlazorTemplates=function(e,i,s,l){this.isStringTemplate||(this.noRecordsTemplate&&e&&t.resetBlazorTemplate(this.noRecordsTemplateId,"NoRecordsTemplate"),this.actionFailureTemplate&&i&&t.resetBlazorTemplate(this.actionFailureTemplateId,"ActionFailureTemplate"),s&&t.resetBlazorTemplate(this.headerTemplateId,"HeaderTemplate"),l&&t.resetBlazorTemplate(this.footerTemplateId,"FooterTemplate"))},s.prototype.updateRecordTemplate=function(e){this.treeItems&&this.treeItems.length<=0&&(this.l10nUpdate(e),this.hasTemplate&&this.updateTemplate())},s.prototype.updateOverflowWrapper=function(e){e?this.inputWrapper.contains(this.overFlowWrapper)&&e&&(this.overFlowWrapper.innerHTML=""):this.inputWrapper.contains(this.overFlowWrapper)||(this.overFlowWrapper=this.createElement("span",{className:"e-overflow "+j}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement))},s.prototype.updateMultiSelection=function(e){this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.allowMultiSelection=e,this.treeObj.dataBind(),this.updateOption(),this.allowMultiSelection&&this.updateMode(),this.setMultiSelect()},s.prototype.updateAllowFiltering=function(e){this.isFirstRender||(e?this.renderFilter():this.destroyFilter()),this.ensureAutoCheck()},s.prototype.updateFilterPlaceHolder=function(){this.filterObj&&(this.filterObj.placeholder=this.filterBarPlaceholder,this.filterObj.element.setAttribute("aria-label",this.filterBarPlaceholder))},s.prototype.updateValue=function(e){this.isDynamicChange=!0,t.isNullOrUndefined(e)||0===e.length?this.resetValue(!0):(this.setTreeValue(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue(),this.isDynamicChange=!1},s.prototype.updateText=function(e){t.isNullOrUndefined(e)?this.resetValue():(this.setTreeText(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue()},s.prototype.updateModelMode=function(){if(!!this.allowMultiSelection||!!this.showCheckBox){if(!this.wrapText){var e=t.select(".e-overflow",this.inputWrapper);e&&(e.innerHTML="")}this.updateMode(),this.setMultiSelect(),!this.wrapText&&this.value&&0!==this.value.length&&(this.updateOverFlowView(),t.addClass([this.inputEle],U),"Box"===this.mode?t.removeClass([this.overFlowWrapper,this.inputWrapper],"e-show-text"):t.addClass([this.overFlowWrapper,this.inputWrapper],"e-show-text"))}},s.prototype.updateOption=function(){this.hiddenElement.hasAttribute("multiple")||!this.allowMultiSelection&&!this.showCheckBox?!this.hiddenElement.hasAttribute("multiple")||this.allowMultiSelection||this.showCheckBox||this.hiddenElement.removeAttribute("multiple"):this.hiddenElement.setAttribute("multiple","")},s.prototype.onPropertyChanged=function(e,i){for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"width":this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"placeholder":o.Input.setPlaceholder(e.placeholder,this.inputEle);break;case"cssClass":this.setCssClass(e.cssClass,i.cssClass);break;case"enableRtl":this.setEnableRTL(this.enableRtl);break;case"fields":this.setFields();break;case"readonly":o.Input.setReadonly(e.readonly,this.inputEle);break;case"enabled":this.setEnable();break;case"floatLabelType":o.Input.removeFloating(this.inputObj),o.Input.addFloating(this.inputEle,e.floatLabelType,this.placeholder,this.createElement),this.ensureClearIconPosition(e.floatLabelType);break;case"showClearButton":this.updateClearButton(e.showClearButton);break;case"allowFiltering":this.updateAllowFiltering(e.allowFiltering);break;case"filterBarPlaceholder":this.updateFilterPlaceHolder();break;case"value":this.oldValue=i.value,this.updateValue(e.value);break;case"text":this.updateText(e.text);break;case"allowMultiSelection":this.updateMultiSelection(e.allowMultiSelection);break;case"mode":this.updateModelMode();break;case"delimiterChar":if("Box"===this.mode)return;(this.showCheckBox||this.allowMultiSelection)&&this.setMultiSelect();break;case"selectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale();break;case"unSelectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale(!1);break;case"showSelectAll":this.showCheckBox&&(this.setSelectAllWrapper(e.showSelectAll),this.updatePopupHeight());break;case"showCheckBox":this.updateCheckBoxState(e.showCheckBox),this.wrapText||this.updateOverflowWrapper(!0),this.updatePopupHeight(),this.updateOption();break;case"treeSettings":this.updateTreeSettings(e);break;case"sortOrder":this.hasTemplate&&this.updateTemplate(),this.treeObj.sortOrder=e.sortOrder,this.updateValue(this.value),this.treeObj.dataBind();break;case"showDropDownIcon":this.updateDropDownIconState(e.showDropDownIcon);break;case"popupWidth":this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"popupHeight":this.popupObj&&this.updatePopupHeight();break;case"zIndex":this.popupObj&&(this.popupObj.zIndex=e.zIndex,this.popupObj.dataBind());break;case"headerTemplate":case"footerTemplate":this.updateTemplate();break;case"itemTemplate":this.updateTemplate(),this.treeObj.nodeTemplate=e.itemTemplate,this.treeObj.dataBind();break;case"noRecordsTemplate":this.updateRecordTemplate();break;case"actionFailureTemplate":this.updateRecordTemplate(!0);break;case"htmlAttributes":this.setHTMLAttributes();break;case"wrapText":this.updateOverflowWrapper(this.wrapText),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText?(t.addClass([this.overFlowWrapper],j),this.chipWrapper&&"Box"===this.mode?t.removeClass([this.chipWrapper],j):(t.removeClass([this.inputWrapper],H),t.removeClass([this.inputEle],U)),this.ensurePlaceHolder()):this.updateView()}},s.prototype.clear=function(){this.clearAll(),this.inputFocus?this.onFocusOut():(this.changeOnBlur&&this.triggerChangeEvent(),this.removeValue=!1)},s.prototype.destroy=function(){this.ddtresetBlazorTemplates(!0,!0,!0,!0),this.clearTemplate(),this.unWireEvents(),this.setCssClass(null,this.cssClass),this.resetValue(),this.treeObj.destroy(),this.destroyFilter(),this.popupObj&&(this.popupObj.destroy(),t.detach(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),t.detach(this.inputWrapper),t.detach(this.popupDiv),this.element.classList.remove("e-input"),e.prototype.destroy.call(this)},s.prototype.destroyFilter=function(){this.filterObj&&(this.filterObj.destroy(),t.detach(this.filterObj.element),t.detach(this.filterContainer),this.filterObj=null)},s.prototype.ensureVisible=function(e){this.treeObj.ensureVisible(e)},s.prototype.getData=function(e){return this.treeObj.getTreeData(e)},s.prototype.hidePopup=function(){var e={popup:this.popupObj};this.inputWrapper.classList.remove("e-icon-anim"),this.popupEle&&(this.popupEle.style.display="none"),t.attributes(this.inputWrapper,{"aria-expanded":"false"}),this.popupObj&&this.isPopupOpen&&(this.popupObj.hide(),this.inputFocus&&(this.inputWrapper.focus(),this.allowFiltering&&t.addClass([this.inputWrapper],[M])),this.trigger("close",e))},s.prototype.selectAll=function(e){this.selectAllItems(e)},s.prototype.showPopup=function(){!this.enabled||this.readonly||this.isPopupOpen||(this.renderPopup(),this.focusIn())},s.prototype.getModuleName=function(){return"dropdowntree"},F([t.Property("The Request Failed")],s.prototype,"actionFailureTemplate",void 0),F([t.Property(!1)],s.prototype,"allowFiltering",void 0),F([t.Property(!1)],s.prototype,"allowMultiSelection",void 0),F([t.Property(!0)],s.prototype,"changeOnBlur",void 0),F([t.Property("")],s.prototype,"cssClass",void 0),F([t.Property(",")],s.prototype,"delimiterChar",void 0),F([t.Property(!0)],s.prototype,"enabled",void 0),F([t.Complex({},z)],s.prototype,"fields",void 0),F([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),F([t.Property("StartsWith")],s.prototype,"filterType",void 0),F([t.Property("Never")],s.prototype,"floatLabelType",void 0),F([t.Property(null)],s.prototype,"footerTemplate",void 0),F([t.Property(!1)],s.prototype,"ignoreAccent",void 0),F([t.Property(!0)],s.prototype,"ignoreCase",void 0),F([t.Property(null)],s.prototype,"headerTemplate",void 0),F([t.Property({})],s.prototype,"htmlAttributes",void 0),F([t.Property(null)],s.prototype,"itemTemplate",void 0),F([t.Property("Default")],s.prototype,"mode",void 0),F([t.Property("No Records Found")],s.prototype,"noRecordsTemplate",void 0),F([t.Property(null)],s.prototype,"placeholder",void 0),F([t.Property("300px")],s.prototype,"popupHeight",void 0),F([t.Property("100%")],s.prototype,"popupWidth",void 0),F([t.Property(!1)],s.prototype,"readonly",void 0),F([t.Property(!1)],s.prototype,"showSelectAll",void 0),F([t.Property("Select All")],s.prototype,"selectAllText",void 0),F([t.Property(!1)],s.prototype,"showCheckBox",void 0),F([t.Property(!0)],s.prototype,"showClearButton",void 0),F([t.Property(!0)],s.prototype,"showDropDownIcon",void 0),F([t.Property("None")],s.prototype,"sortOrder",void 0),F([t.Property(null)],s.prototype,"text",void 0),F([t.Complex({},K)],s.prototype,"treeSettings",void 0),F([t.Property("Unselect All")],s.prototype,"unSelectAllText",void 0),F([t.Property(null)],s.prototype,"value",void 0),F([t.Property("100%")],s.prototype,"width",void 0),F([t.Property(1e3)],s.prototype,"zIndex",void 0),F([t.Property(!1)],s.prototype,"wrapText",void 0),F([t.Event()],s.prototype,"actionFailure",void 0),F([t.Event()],s.prototype,"beforeOpen",void 0),F([t.Event()],s.prototype,"change",void 0),F([t.Event()],s.prototype,"close",void 0),F([t.Event()],s.prototype,"blur",void 0),F([t.Event()],s.prototype,"created",void 0),F([t.Event()],s.prototype,"dataBound",void 0),F([t.Event()],s.prototype,"destroyed",void 0),F([t.Event()],s.prototype,"filtering",void 0),F([t.Event()],s.prototype,"focus",void 0),F([t.Event()],s.prototype,"keyPress",void 0),F([t.Event()],s.prototype,"open",void 0),F([t.Event()],s.prototype,"select",void 0),s=F([t.NotifyPropertyChanges],s)}(t.Component),G=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Q=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};I.root="e-combobox";var J={container:null,buttons:[]},X=function(e){function i(t,i){return e.call(this,t,i)||this}return G(i,e),i.prototype.preRender=function(){e.prototype.preRender.call(this)},i.prototype.getLocaleName=function(){return"combo-box"},i.prototype.wireEvent=function(){"combobox"===this.getModuleName()&&(t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.preventBlur,this),t.EventHandler.add(this.inputWrapper.container,"blur",this.onBlur,this)),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick,this),t.EventHandler.add(this.inputElement,"focus",this.targetFocus,this),this.readonly||(t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),t.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this),t.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)),this.bindCommonEvent()},i.prototype.preventBlur=function(e){(this.allowFiltering||document.activeElement===this.inputElement||document.activeElement.classList.contains(I.input)||!t.Browser.isDevice)&&t.Browser.isDevice||e.preventDefault()},i.prototype.onBlur=function(i){var s=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;t.isNullOrUndefined(this.listData)||t.isNullOrUndefined(s)||s===this.text||this.customValue(i),e.prototype.onBlur.call(this,i)},i.prototype.targetElement=function(){return this.inputElement},i.prototype.setOldText=function(e){o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue(),this.removeSelection()},i.prototype.setOldValue=function(e){this.allowCustom?this.valueMuteChange(this.value):this.valueMuteChange(null),this.removeSelection(),this.setHiddenValue()},i.prototype.valueMuteChange=function(e){var i=t.isNullOrUndefined(e)?null:e.toString();o.Input.setValue(i,this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:e,text:e,index:null},!0),this.activeIndex=this.index;var s=this.fields,l={};l[s.text]=t.isNullOrUndefined(e)?null:e.toString(),l[s.value]=t.isNullOrUndefined(e)?null:e.toString(),this.itemData=l,this.item=null,this.previousValue!==this.value&&this.detachChangeEvent(null)},i.prototype.updateValues=function(){if(t.isNullOrUndefined(this.value))if(this.text&&t.isNullOrUndefined(this.value)){var e=this.getElementByText(this.text);e?this.setSelection(e,null):(o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue())}else this.setSelection(this.liCollections[this.activeIndex],null);else(e=this.getElementByValue(this.value))?this.setSelection(e,null):this.allowCustom?this.valueMuteChange(this.value):this.valueMuteChange(null);this.setHiddenValue(),o.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},i.prototype.updateIconState=function(){this.showClearButton&&(this.inputElement&&""!==this.inputElement.value&&!this.readonly?t.removeClass([this.inputWrapper.clearButton],I.clearIconHide):t.addClass([this.inputWrapper.clearButton],I.clearIconHide))},i.prototype.getAriaAttributes=function(){return{"aria-owns":this.element.id+"_options",role:"combobox","aria-autocomplete":"both","aria-labelledby":this.hiddenElement.id,"aria-hasPopup":"true","aria-expanded":"false","aria-readonly":this.readonly.toString(),autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}},i.prototype.searchLists=function(t){this.isTyped=!0,this.isFiltering()?(e.prototype.searchLists.call(this,t),this.ulElement&&""===this.filterInput.value.trim()&&this.setHoverList(this.ulElement.querySelector("."+I.li))):(this.ulElement&&""===this.inputElement.value&&this.preventAutoFill&&this.setHoverList(this.ulElement.querySelector("."+I.li)),this.incrementalSearch(t))},i.prototype.getNgDirective=function(){return"EJS-COMBOBOX"},i.prototype.setSearchBox=function(){return this.filterInput=this.inputElement,this.isFiltering()?this.inputWrapper:J},i.prototype.onActionComplete=function(t,i,s,l){this.isServerBlazor||e.prototype.onActionComplete.call(this,t,i,s),this.isSelectCustom&&this.removeSelection(),!this.preventAutoFill&&"combobox"===this.getModuleName()&&this.isTyped&&this.inlineSearch()},i.prototype.getFocusElement=function(){var e=this.isSelectCustom?{text:""}:this.getItemData(),i=this.list.querySelector("."+I.selected);if(e.text===this.inputElement.value&&!t.isNullOrUndefined(i))return i;if((t.Browser.isDevice&&!this.isDropDownClick||!t.Browser.isDevice)&&!t.isNullOrUndefined(this.liCollections)&&this.liCollections.length>0){var s=h(this.inputElement.value,this.liCollections,"StartsWith",!0).item;if(t.isNullOrUndefined(s))this.isSelectCustom&&""!==this.inputElement.value.trim()&&(this.removeFocus(),this.list.scrollTop=0);else{var l=this.getIndexByValue(s.getAttribute("data-value"))-1,o=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10);if(!isNaN(o)&&"autocomplete"!==this.getModuleName()){this.removeFocus();var r=this.fields.groupBy?this.liCollections[0].offsetHeight:0;this.list.scrollTop=l*o+r,t.addClass([s],I.focus)}}return s}return null},i.prototype.setValue=function(t){return t&&"keydown"===t.type&&"enter"===t.action&&this.removeFillSelection(),this.autofill&&"combobox"===this.getModuleName()&&t&&"keydown"===t.type&&"enter"!==t.action?(this.preventAutoFill=!1,this.inlineSearch(t),!1):e.prototype.setValue.call(this,t)},i.prototype.checkCustomValue=function(){this.itemData=this.getDataByValue(this.value);var e=this.getItemData();this.allowCustom&&t.isNullOrUndefined(e.value)&&t.isNullOrUndefined(e.text)||this.setProperties({value:e.value,text:e.text},!this.allowCustom)},i.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement="autocomplete"===this.getModuleName()?this.inputWrapper.buttons[0]||this.inputWrapper.clearButton||o.Input.appendSpan("e-input-group-icon e-atc-spinner-icon",this.inputWrapper.container,this.createElement):this.inputWrapper.buttons[0]||this.inputWrapper.clearButton,t.addClass([this.spinnerElement],I.disableIcon),l.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),l.showSpinner(this.spinnerElement))},i.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(l.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],I.disableIcon),this.spinnerElement.classList.contains("e-atc-spinner-icon")?t.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},i.prototype.setAutoFill=function(e,t){if(t||this.setHoverList(e),this.autofill&&!this.preventAutoFill){var i=this.getTextByValue(e.getAttribute("data-value")).toString(),s=this.getFormattedValue(e.getAttribute("data-value"));"combobox"===this.getModuleName()&&(this.isSelected||this.previousValue===s?this.updateSelectedItem(e,null,!0):(this.updateSelectedItem(e,null),this.isSelected=!0,this.previousValue=this.getFormattedValue(e.getAttribute("data-value")))),this.isAndroidAutoFill(i)||this.setAutoFillSelection(i)}},i.prototype.isAndroidAutoFill=function(e){if(t.Browser.isAndroid){var i=this.getSelectionPoints(),s=this.prevSelectPoints.end,l=i.end,o=this.prevSelectPoints.start,r=i.start;return 0!==s&&(s===e.length&&o===e.length||o>r&&s>l||s===l&&o===r)}return!1},i.prototype.clearAll=function(i,s){(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s.dataSource))&&(e.prototype.clearAll.call(this,i),this.isServerBlazor&&this.isFiltering()&&this.isPopupOpen&&i&&this.interopAdaptor.invokeMethodAsync("OnServerRenderList",this.beforePopupOpen,!0)),this.isFiltering()&&!t.isNullOrUndefined(i)&&i.target===this.inputWrapper.clearButton&&this.searchLists(i)},i.prototype.isSelectFocusItem=function(e){return!t.isNullOrUndefined(e)},i.prototype.inlineSearch=function(e){var i=e&&("down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action||"pageUp"===e.action||"pageDown"===e.action),s=i?this.liCollections[this.activeIndex]:this.getFocusElement();if(t.isNullOrUndefined(s))if(""===this.inputElement.value){this.activeIndex=null,this.list.scrollTop=0;var l=this.list.querySelector("."+I.li);this.setHoverList(l)}else this.activeIndex=null,this.removeSelection(),this.liCollections&&this.liCollections.length<0&&this.removeFocus();else{if(!i){var o=this.getFormattedValue(s.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(o),this.activeIndex=t.isNullOrUndefined(this.activeIndex)?null:this.activeIndex}this.preventAutoFill=""!==this.inputElement.value&&this.preventAutoFill,this.setAutoFill(s,i)}},i.prototype.incrementalSearch=function(e){this.showPopup(),t.isNullOrUndefined(this.listData)||(this.inlineSearch(e),e.preventDefault())},i.prototype.setAutoFillSelection=function(e){var t=this.getSelectionPoints(),i=this.inputElement.value.substr(0,t.start);if(i&&i.toLowerCase()===e.substr(0,t.start).toLowerCase()){var s=i+e.substr(i.length,e.length);o.Input.setValue(s,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(t.start,this.inputElement.value.length)}else o.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(0,this.inputElement.value.length)},i.prototype.getValueByText=function(t){return e.prototype.getValueByText.call(this,t,!0,this.ignoreAccent)},i.prototype.unWireEvent=function(){"combobox"===this.getModuleName()&&(t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.preventBlur),t.EventHandler.remove(this.inputWrapper.container,"blur",this.onBlur)),t.isNullOrUndefined(this.inputWrapper.buttons[0])||t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick),this.inputElement&&(t.EventHandler.remove(this.inputElement,"focus",this.targetFocus),this.readonly||(t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),t.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown),t.EventHandler.remove(this.inputElement,"paste",this.pasteHandler))),this.unBindCommonEvent()},i.prototype.setSelection=function(i,s){e.prototype.setSelection.call(this,i,s),t.isNullOrUndefined(i)||this.autofill||this.isDropDownClick||this.removeFocus()},i.prototype.selectCurrentItem=function(e){var i;this.isPopupOpen&&((i=this.isSelected?this.list.querySelector("."+I.selected):this.list.querySelector("."+I.focus))&&(this.setSelection(i,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e))),"enter"===e.action&&""===this.inputElement.value.trim()?this.clearAll(e):this.isTyped&&!this.isSelected&&t.isNullOrUndefined(i)&&this.customValue(e),this.hidePopup()},i.prototype.setHoverList=function(e){this.removeSelection(),this.isValidLI(e)&&!e.classList.contains(I.selected)&&(this.removeFocus(),e.classList.add(I.focus))},i.prototype.targetFocus=function(e){t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!1),this.onFocus(e)},i.prototype.dropDownClick=function(i){i.preventDefault(),t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!0),e.prototype.dropDownClick.call(this,i)},i.prototype.customValue=function(e){var i=this,s=this.getValueByText(this.inputElement.value);if(this.allowCustom||""===this.inputElement.value)if(""!==this.inputElement.value.trim()){var l=this.value;if(t.isNullOrUndefined(s)){var r=""===this.inputElement.value?null:this.inputElement.value,n={text:r,item:{}};this.initial?this.updateCustomValueCallback(r,n,l):this.trigger("customValueSpecifier",n,function(t){i.updateCustomValueCallback(r,t,l,e)})}else this.isSelectCustom=!1,this.setProperties({value:s}),l!==this.value&&this.onChangeEvent(e)}else this.allowCustom&&(this.isSelectCustom=!0);else{var a=this.previousValue,h=this.value;this.setProperties({value:s}),t.isNullOrUndefined(this.value)&&o.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.autofill&&a===this.value&&h!==this.value&&this.onChangeEvent(null)}},i.prototype.updateCustomValueCallback=function(e,i,s,l){var o=this.fields,r=i.item,n={};r&&t.getValue(o.text,r)&&t.getValue(o.value,r)?n=r:(t.setValue(o.text,e,n),t.setValue(o.value,e,n)),this.itemData=n;var a={text:t.getValue(o.text,this.itemData),value:t.getValue(o.value,this.itemData),index:null};this.setProperties(a,!0),this.setSelection(null,null),this.isSelectCustom=!0,s!==this.value&&this.onChangeEvent(l)},i.prototype.onPropertyChanged=function(i,s){"combobox"===this.getModuleName()&&(this.checkData(i),this.setUpdateInitial(["fields","query","dataSource"],i));for(var l=0,r=Object.keys(i);l<r.length;l++){var n=r[l];switch(n){case"readonly":o.Input.setReadonly(this.readonly,this.inputElement),this.readonly?(t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),t.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown)):(t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),t.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this));break;case"allowFiltering":this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this);break;case"allowCustom":break;default:var a=this.getPropObject(n,i,s);e.prototype.onPropertyChanged.call(this,a.newProperty,a.oldProperty),this.isFiltering()&&"dataSource"===n&&t.isNullOrUndefined(this.list)&&this.itemTemplate&&"combobox"===this.getModuleName()&&e.prototype.renderList.call(this)}}},i.prototype.render=function(){e.prototype.render.call(this),this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this),this.renderComplete()},i.prototype.getModuleName=function(){return"combobox"},i.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},i.prototype.filter=function(t,i,s){e.prototype.filter.call(this,t,i,s)},i.prototype.showPopup=function(){e.prototype.showPopup.call(this)},i.prototype.hidePopup=function(i){var s=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;if(!t.isNullOrUndefined(this.listData)){var l=this.isEscapeKey;this.isEscapeKey&&(o.Input.setValue(this.typedString,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1),this.autofill&&this.removeFillSelection();var r=this.isSelectCustom?{text:""}:this.getItemData(),n=this.list.querySelector("."+I.selected);if(this.inputElement&&r.text===this.inputElement.value&&!t.isNullOrUndefined(n))return this.isSelected&&(this.onChangeEvent(i),this.isSelectCustom=!1),void e.prototype.hidePopup.call(this,i);if("combobox"===this.getModuleName()&&""!==this.inputElement.value.trim()){var a=h(this.inputElement.value,this.liCollections,"Equal",!0);this.selectedLI=a.item,t.isNullOrUndefined(a.index)&&(a.index=h(this.inputElement.value,this.liCollections,"StartsWith",!0).index),this.activeIndex=a.index,t.isNullOrUndefined(this.selectedLI)?l&&(this.isSelectCustom=!0,this.removeSelection()):this.updateSelectedItem(this.selectedLI,null,!0)}this.isEscapeKey||!this.isTyped||this.isInteracted||this.customValue(i)}t.isNullOrUndefined(this.listData)&&this.allowCustom&&!t.isNullOrUndefined(s)&&s!==this.value&&this.customValue(),e.prototype.hidePopup.call(this,i)},i.prototype.focusIn=function(){this.enabled&&(t.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!0),e.prototype.focusIn.call(this))},i.prototype.clear=function(){this.value=null},i.prototype.focusOut=function(t){e.prototype.focusOut.call(this,t)},i.prototype.getItems=function(){return e.prototype.getItems.call(this)},i.prototype.getDataByValue=function(t){return e.prototype.getDataByValue.call(this,t)},i.prototype.renderHightSearch=function(){},Q([t.Property(!1)],i.prototype,"autofill",void 0),Q([t.Property(!0)],i.prototype,"allowCustom",void 0),Q([t.Property({})],i.prototype,"htmlAttributes",void 0),Q([t.Property(!1)],i.prototype,"allowFiltering",void 0),Q([t.Property(null)],i.prototype,"query",void 0),Q([t.Property(null)],i.prototype,"index",void 0),Q([t.Property(!0)],i.prototype,"showClearButton",void 0),Q([t.Property(!1)],i.prototype,"enableRtl",void 0),Q([t.Event()],i.prototype,"customValueSpecifier",void 0),Q([t.Event()],i.prototype,"filtering",void 0),Q([t.Property(null)],i.prototype,"valueTemplate",void 0),Q([t.Property("Never")],i.prototype,"floatLabelType",void 0),Q([t.Property(null)],i.prototype,"filterBarPlaceholder",void 0),Q([t.Property(null)],i.prototype,"cssClass",void 0),Q([t.Property(null)],i.prototype,"headerTemplate",void 0),Q([t.Property(null)],i.prototype,"footerTemplate",void 0),Q([t.Property(null)],i.prototype,"placeholder",void 0),Q([t.Property("100%")],i.prototype,"width",void 0),Q([t.Property("300px")],i.prototype,"popupHeight",void 0),Q([t.Property("100%")],i.prototype,"popupWidth",void 0),Q([t.Property(!1)],i.prototype,"readonly",void 0),Q([t.Property(null)],i.prototype,"text",void 0),Q([t.Property(null)],i.prototype,"value",void 0),i=Q([t.NotifyPropertyChanges],i)}(N),$=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Y=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};I.root="e-autocomplete",I.icon="e-input-group-icon e-ddl-icon e-search-icon";var Z=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.isFiltered=!1,s.searchList=!1,s}return $(s,e),s.prototype.preRender=function(){e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"auto-complete"},s.prototype.getNgDirective=function(){return"EJS-AUTOCOMPLETE"},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query,l=""!==this.queryString||t.isNullOrUndefined(this.value)?this.filterType:"equal",o=""!==this.queryString||t.isNullOrUndefined(this.value)?this.queryString:this.value;if(this.isFiltered)return s;if(null!==this.queryString&&""!==this.queryString){var r=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==r)&&"number"!==r){var n=t.isNullOrUndefined(this.fields.value)?"":this.fields.value;s.where(n,l,o,this.ignoreCase,this.ignoreAccent)}else s.where("",l,o,this.ignoreCase,this.ignoreAccent)}if(!t.isNullOrUndefined(this.suggestionCount)){if(20!==this.suggestionCount)for(var a=0;a<s.queries.length;a++)"onTake"===s.queries[a].fn&&s.queries.splice(a,1);s.take(this.suggestionCount)}return s},s.prototype.searchLists=function(i){var s=this;if(this.isTyped=!0,this.isDataFetched=this.isSelectCustom=!1,this.isServerBlazor)this.beforePopupOpen=this.isFiltering()&&!this.beforePopupOpen?!this.beforePopupOpen:this.beforePopupOpen,this.queryString=this.filterInput.value,""!==this.queryString&&this.queryString.length>=this.minLength?this.interopAdaptor.invokeMethodAsync("OnServerFilter",this.filterInput.value):this.hidePopup();else{if(t.isNullOrUndefined(this.list)&&e.prototype.renderList.call(this,!0),this.queryString=this.filterInput.value,"mousedown"!==i.type&&(40===i.keyCode||38===i.keyCode))return this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,void this.resetList(this.dataSource,this.fields);this.isSelected=!1,this.activeIndex=null;var l={preventDefaultAction:!1,text:this.filterInput.value,updateData:function(e,t,i){l.cancel||(s.isFiltered=!0,s.filterAction(e,t,i))},cancel:!1};this.trigger("filtering",l,function(e){e.cancel||s.isFiltered||e.preventDefaultAction||(s.searchList=!0,s.filterAction(s.dataSource,null,s.fields))})}},s.prototype.filter=function(e,t,i){this.isFiltered=!0,this.filterAction(e,t,i)},s.prototype.filterAction=function(e,t,i){this.beforePopupOpen=!0,""!==this.queryString&&this.queryString.length>=this.minLength?this.resetList(e,i,t):(this.hidePopup(),this.beforePopupOpen=!1),this.renderReactTemplates()},s.prototype.clearAll=function(i,s){(t.isNullOrUndefined(s)||!t.isNullOrUndefined(s)&&t.isNullOrUndefined(s.dataSource))&&e.prototype.clearAll.call(this,i),this.beforePopupOpen&&this.hidePopup()},s.prototype.onActionComplete=function(i,s,l,o){this.fixedHeaderElement=null,e.prototype.onActionComplete.call(this,i,s,l);var r=this.list.querySelector("."+I.li);t.isNullOrUndefined(r)||t.removeClass([r],I.focus),this.postBackAction()},s.prototype.postBackAction=function(){if(this.autofill&&!t.isNullOrUndefined(this.liCollections[0])&&this.searchList){var i=[this.liCollections[0]],s=h(this.inputElement.value,i,"StartsWith",this.ignoreCase);this.searchList=!1,t.isNullOrUndefined(s.item)||e.prototype.setAutoFill.call(this,this.liCollections[0],!0)}},s.prototype.setSelection=function(i,s){if(this.isValidLI(i))if(!t.isNullOrUndefined(s)&&"keydown"===s.type&&"enter"!==s.action&&"tab"!==s.action&&this.isValidLI(i)){var l=this.getFormattedValue(i.getAttribute("data-value"));this.activeIndex=this.getIndexByValue(l),this.isServerBlazor&&this.removeHover(),this.setHoverList(i),this.selectedLI=i,this.setScrollPosition(s),this.autofill&&this.isPopupOpen&&(this.preventAutoFill=!1,e.prototype.setAutoFill.call(this,i)),t.attributes(this.inputElement,{"aria-activedescendant":this.selectedLI?this.selectedLI.id:null})}else e.prototype.setSelection.call(this,i,s)},s.prototype.listOption=function(i,s){var l=this,o=e.prototype.listOption.call(this,i,s);if(t.isNullOrUndefined(o.itemCreated))o.itemCreated=function(e){l.highlight&&(l.element.tagName===l.getNgDirective()&&l.itemTemplate?setTimeout(function(){p(e.item,l.queryString,l.ignoreCase,l.filterType)},0):p(e.item,l.queryString,l.ignoreCase,l.filterType))};else{var r=o.itemCreated;o.itemCreated=function(e){l.highlight&&p(e.item,l.queryString,l.ignoreCase,l.filterType),r.apply(l,[e])}}return o},s.prototype.isFiltering=function(){return!0},s.prototype.renderPopup=function(){this.list.scrollTop=0,e.prototype.renderPopup.call(this)},s.prototype.isEditTextBox=function(){return""!==this.inputElement.value.trim()},s.prototype.isPopupButton=function(){return this.showPopupButton},s.prototype.isSelectFocusItem=function(e){return!1},s.prototype.showPopup=function(){if(this.enabled){if(this.beforePopupOpen&&!this.isServerBlazor)return void this.refreshPopup();this.beforePopupOpen=!0,this.preventAutoFill=!0,t.isNullOrUndefined(this.list)||this.isServerBlazor?this.renderList():this.resetList(this.dataSource,this.fields)}},s.prototype.hidePopup=function(){this.DropDownBaseresetBlazorTemplates(!0,!1,!1,!1),e.prototype.hidePopup.call(this),this.activeIndex=-1},s.prototype.onPropertyChanged=function(i,s){"autocomplete"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],i);for(var l=0,r=Object.keys(i);l<r.length;l++){var n=r[l];switch(n){case"showPopupButton":if(this.showPopupButton){if(this.isServerBlazor){if(this.inputWrapper&&this.inputWrapper.container){a=this.inputWrapper.container.querySelector(".e-input-group-icon.e-ddl-icon");this.inputWrapper.buttons[0]=a}}else{var a=o.Input.appendSpan(I.icon,this.inputWrapper.container,this.createElement);this.inputWrapper.buttons[0]=a}this.inputWrapper&&this.inputWrapper.buttons&&this.inputWrapper.buttons[0]&&t.EventHandler.add(this.inputWrapper.buttons[0],"click",this.dropDownClick,this)}else this.isServerBlazor||(t.detach(this.inputWrapper.buttons[0]),this.inputWrapper.buttons[0]=null);break;default:var h=this.getPropObject(n,i,s);e.prototype.onPropertyChanged.call(this,h.newProperty,h.oldProperty)}}},s.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++)this.ulElement.querySelector(".e-active")||(c(this.liCollections[e]),p(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType,this.isServerBlazor))},s.prototype.getModuleName=function(){return"autocomplete"},s.prototype.render=function(){e.prototype.render.call(this)},Y([t.Complex({value:null,iconCss:null,groupBy:null},A)],s.prototype,"fields",void 0),Y([t.Property(!0)],s.prototype,"ignoreCase",void 0),Y([t.Property(!1)],s.prototype,"showPopupButton",void 0),Y([t.Property(!1)],s.prototype,"highlight",void 0),Y([t.Property(20)],s.prototype,"suggestionCount",void 0),Y([t.Property({})],s.prototype,"htmlAttributes",void 0),Y([t.Property(null)],s.prototype,"query",void 0),Y([t.Property(1)],s.prototype,"minLength",void 0),Y([t.Property("Contains")],s.prototype,"filterType",void 0),Y([t.Event()],s.prototype,"filtering",void 0),Y([t.Property(null)],s.prototype,"index",void 0),Y([t.Property("Never")],s.prototype,"floatLabelType",void 0),Y([t.Property(null)],s.prototype,"valueTemplate",void 0),Y([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),Y([t.Property(!1)],s.prototype,"allowFiltering",void 0),Y([t.Property(null)],s.prototype,"text",void 0),s=Y([t.NotifyPropertyChanges],s)}(X),ee="e-float-line",te="e-float-text",ie="e-label-top",se="e-label-bottom",le=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),oe=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},re="e-input-focus",ne="e-hide-listitem",ae="e-chips",he=function(e){function s(t,i){var s=e.call(this,t,i)||this;return s.clearIconWidth=0,s.isValidKey=!1,s.selectAllEventData=[],s.selectAllEventEle=[],s.isDynamicDataChange=!1,s.scrollFocusStatus=!1,s.keyDownStatus=!1,s}return le(s,e),s.prototype.enableRTL=function(e){e?this.overAllWrapper.classList.add("e-rtl"):this.overAllWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind())},s.prototype.requiredModules=function(){var e=[];if("CheckBox"===this.mode){if(this.isGroupChecking=this.enableGroupCheckBox,this.enableGroupCheckBox){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.enableSelectionOrder=!1,this.isProtectedOnChange=t}this.allowCustomValue=!1,this.hideSelectedItem=!1,this.closePopupOnSelect=!1,e.push({member:"CheckBoxSelection",args:[this]})}return e},s.prototype.updateHTMLAttribute=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];switch(s){case"class":var l=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==l&&(t.addClass([this.overAllWrapper],l.split(" ")),t.addClass([this.popupWrapper],l.split(" ")));break;case"disabled":this.enable(!1);break;case"placeholder":this.placeholder||(this.inputElement.setAttribute(s,this.htmlAttributes[s]),this.setProperties({placeholder:this.inputElement.placeholder},!0),this.refreshPlaceHolder());break;default:var o=["name","required","aria-required","form"],r=["title","role","style","class"];["id"].indexOf(s)>-1?this.element.setAttribute(s,this.htmlAttributes[s]):0===s.indexOf("data")||o.indexOf(s)>-1?this.hiddenElement.setAttribute(s,this.htmlAttributes[s]):r.indexOf(s)>-1?this.overAllWrapper.setAttribute(s,this.htmlAttributes[s]):this.inputElement.setAttribute(s,this.htmlAttributes[s])}}},s.prototype.updateReadonly=function(e){e||"CheckBox"===this.mode?this.inputElement.setAttribute("readonly","true"):this.inputElement.removeAttribute("readonly")},s.prototype.updateClearButton=function(e){e?(this.overAllClear.parentNode?this.overAllClear.style.display="":this.componentWrapper.appendChild(this.overAllClear),this.componentWrapper.classList.remove("e-close-icon-hide")):(this.overAllClear.style.display="none",this.componentWrapper.classList.add("e-close-icon-hide"))},s.prototype.updateCssClass=function(){if(!t.isNullOrUndefined(this.cssClass)&&""!==this.cssClass){var e=this.cssClass;""!==(e=this.cssClass.replace(/\s+/g," ").trim())&&(t.addClass([this.overAllWrapper],e.split(" ")),t.addClass([this.popupWrapper],e.split(" ")))}},s.prototype.updateOldPropCssClass=function(e){t.isNullOrUndefined(e)||""===e||""!==(e=e.replace(/\s+/g," ").trim())&&(t.removeClass([this.overAllWrapper],e.split(" ")),t.removeClass([this.popupWrapper],e.split(" ")))},s.prototype.onPopupShown=function(){var e=this;if(t.Browser.isDevice&&"CheckBox"===this.mode&&this.allowFiltering){var i=this;window.onpopstate=function(){i.hidePopup(),i.inputElement.focus()},history.pushState({},"")}var s={name:"FadeIn",duration:100},l={popup:this.popupObj,cancel:!1,animation:s};this.trigger("open",l,function(i){i.cancel||(e.focusAtFirstListItem(),document.body.appendChild(e.popupObj.element),"CheckBox"===e.mode&&e.enableGroupCheckBox&&!t.isNullOrUndefined(e.fields.groupBy)&&e.updateListItems(e.list.querySelectorAll("li.e-list-item"),e.mainList.querySelectorAll("li.e-list-item")),("CheckBox"===e.mode||e.showDropDownIcon)&&t.addClass([e.overAllWrapper],["e-icon-anim"]),e.refreshPopup(),e.renderReactTemplates(),e.popupObj.show(i.animation,1e3===e.zIndex?e.element:null),t.attributes(e.inputElement,{"aria-expanded":"true"}),e.isFirstClick&&e.loadTemplate())})},s.prototype.updateListItems=function(e,t){for(var i=0;i<e.length;i++)this.findGroupStart(e[i]),this.findGroupStart(t[i]);this.deselectHeader()},s.prototype.loadTemplate=function(){var e=this;"CheckBox"===this.mode&&this.itemTemplate&&t.isBlazor()&&this.isServerRendered&&this.mainData&&this.mainData.length>0?setTimeout(function(){e.refreshListItems(null),"CheckBox"===e.mode&&e.removeFocus(),e.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===e.mode,e:e})},this.mainData.length<100?100:this.mainData.length):(this.refreshListItems(null),"CheckBox"===this.mode&&this.removeFocus(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}))},s.prototype.setScrollPosition=function(){if((!this.hideSelectedItem&&"CheckBox"!==this.mode||"CheckBox"===this.mode&&!this.enableSelectionOrder)&&!t.isNullOrUndefined(this.value)&&this.value.length>0){var e=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",this.value[this.value.length-1]);t.isNullOrUndefined(e)||this.scrollBottom(e)}},s.prototype.focusAtFirstListItem=function(){if(this.ulElement&&this.ulElement.querySelector("li."+k.li)){var e=void 0;if("CheckBox"===this.mode)return void this.removeFocus();null!==(e=this.ulElement.querySelector("li."+k.li+":not(."+ne+")"))&&(this.removeFocus(),this.addListFocus(e))}},s.prototype.focusAtLastListItem=function(e){var t;e?t=h(e,this.liCollections,"StartsWith",this.ignoreCase):this.value&&this.value.length?h(this.value[this.value.length-1],this.liCollections,"StartsWith",this.ignoreCase):t=null,t&&null!==t.item&&(this.addListFocus(t.item),this.scrollBottom(t.item,t.index))},s.prototype.getAriaAttributes=function(){return{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-multiselectable":"true","aria-activedescendant":"null","aria-haspopup":"true","aria-expanded":"false"}},s.prototype.updateListARIA=function(){t.attributes(this.ulElement,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false"});var e=!!this.inputElement.disabled;t.attributes(this.inputElement,this.getAriaAttributes()),e&&t.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled(e?"true":"false")},s.prototype.ensureAriaDisabled=function(e){if(this.htmlAttributes&&this.htmlAttributes["aria-disabled"]){var i=this.htmlAttributes;t.extend(i,{"aria-disabled":e},i),this.setProperties({htmlAttributes:i},!0)}},s.prototype.removelastSelection=function(e){var i=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),s=i[i.length-1].getAttribute("data-value");t.isNullOrUndefined(this.value)||(this.tempValues=this.value.slice());var l=this.getFormattedValue(s);this.allowCustomValue&&("false"!==s&&!1===l||!t.isNullOrUndefined(l)&&"NaN"===l.toString())&&(l=s),this.removeValue(l,e),this.removeChipSelection(),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),this.mainList&&this.listData&&this.refreshSelection(),this.checkPlaceholderSize()},s.prototype.onActionFailure=function(t){e.prototype.onActionFailure.call(this,t),this.renderPopup(),this.onPopupShown()},s.prototype.targetElement=function(){return this.targetInputElement=this.inputElement,"CheckBox"===this.mode&&this.allowFiltering&&this.notify("targetElement",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.targetInputElement.value},s.prototype.getForQuery=function(e){for(var s,l=t.isNullOrUndefined(this.fields.value)?this.fields.text:this.fields.value,o=0;o<e.length;o++)s=0===o?new i.Predicate(l,"equal",e[o]):s.or(l,"equal",e[o]);return this.getQuery(this.query).where(s)},s.prototype.onActionComplete=function(s,l,o,r){e.prototype.onActionComplete.call(this,s,l,o),this.updateSelectElementData(this.allowFiltering);var n=this;if(t.isBlazor()&&this.isServerRendered&&this.isDynamicDataChange&&null!==this.value&&this.value.length>0){for(var a=[],h=0;h<this.value.length;h++){var p=this.getDataByValue(this.value[h]);p&&a.push(p[this.fields.value])}0===a.length&&this.setProperties({value:null})}if(!t.isNullOrUndefined(this.value)&&!this.allowCustomValue)for(var u=0;u<this.value.length;u++)this.findListElement(this.allowFiltering&&!t.isNullOrUndefined(this.mainList)?this.mainList:s,"li","data-value",n.value[u])||(this.value.splice(u,1),u-=1);this.updateActionList(s,l,o),t.isBlazor()&&this.isServerRendered&&this.allowFiltering&&"CheckBox"===this.mode&&this.removeFocus(),t.isBlazor()&&this.isServerRendered&&this.isDynamicDataChange&&this.value&&this.value.length>0&&(this.updateVal(this.value,null,"value"),this.addValidInputClass(),this.isDynamicDataChange=!1),!(this.dataSource instanceof i.DataManager&&"CheckBox"===this.mode&&this.allowFiltering)||t.isBlazor()&&this.isServerRendered||this.removeFocus()},s.prototype.updateActionList=function(e,s,l,o){if("CheckBox"===this.mode&&this.showSelectAll&&this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.mainList||this.mainData?t.isNullOrUndefined(this.mainData)||0!==this.mainData.length||(this.mainData=s):(this.mainList=e.cloneNode?e.cloneNode(!0):e,this.mainData=s,this.mainListCollection=this.liCollections),(this.remoteCustomValue||s.length<=0)&&this.allowCustomValue&&this.inputFocus&&this.allowFiltering&&this.inputElement.value&&""!==this.inputElement.value)return void this.checkForCustomValue(this.tempQuery,this.fields);this.value&&this.value.length&&("CheckBox"!==this.mode&&""!==this.inputElement.value.trim()||"CheckBox"===this.mode||(8===this.keyCode||46===this.keyCode)&&this.allowFiltering&&this.allowCustomValue&&this.dataSource instanceof i.DataManager&&""===this.inputElement.value)&&this.refreshSelection(),this.updateListARIA(),this.unwireListEvents(),this.wireListEvents(),t.isNullOrUndefined(this.setInitialValue)||this.setInitialValue(),t.isNullOrUndefined(this.selectAllAction)||this.selectAllAction(),this.setDynValue&&(t.isNullOrUndefined(this.text)||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.initialValueUpdate(),this.initialUpdate(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,this.value,null)),this.renderPopup(),this.beforePopupOpen&&(this.beforePopupOpen=!1,this.onPopupShown())},s.prototype.refreshSelection=function(){var e,i,s=this.hideSelectedItem?ne:k.selected;if(!t.isNullOrUndefined(this.value))for(var l=0;!t.isNullOrUndefined(this.value[l]);l++)if(e=this.value[l],i=this.findListElement(this.list,"li","data-value",e)){if(t.addClass([i],s),this.hideSelectedItem&&i.previousSibling&&i.previousElementSibling.classList.contains(k.group)&&(!i.nextElementSibling||i.nextElementSibling.classList.contains(k.group))&&t.addClass([i.previousElementSibling],s),this.hideSelectedItem&&this.fields.groupBy&&!i.previousElementSibling.classList.contains(ne)&&this.hideGroupItem(e),this.hideSelectedItem&&i.classList.contains(k.focus)){t.removeClass([i],k.focus);var o=i.parentElement.querySelectorAll("."+k.li+":not(."+ne+")");o.length>0?t.addClass([o[0]],k.focus):(this.ulElement=this.ulElement.cloneNode?this.ulElement.cloneNode(!0):this.ulElement,this.l10nUpdate(),t.addClass([this.list],k.noData))}if(i.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&i.classList.contains("e-active")){var r=i.firstElementChild.getAttribute("aria-checked");if(t.isNullOrUndefined(r)||"false"===r){var n={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:i,e:null};this.notify("updatelist",n)}}}this.checkSelectAll(),this.checkMaxSelection()},s.prototype.hideGroupItem=function(e){var i,s,l=this.hideSelectedItem?ne:k.selected;s=i=this.findListElement(this.ulElement,"li","data-value",e);var o=0,r=0,n=!0,a=!0;do{i&&i.previousElementSibling&&!i.previousElementSibling.classList.contains(ne)&&i.previousElementSibling.classList.contains(k.li)&&(n=!1),!n||!i||i.previousElementSibling&&i.previousElementSibling.classList.contains(k.group)?o=10:i=i.previousElementSibling,s&&s.nextElementSibling&&!s.nextElementSibling.classList.contains(ne)&&s.nextElementSibling.classList.contains(k.li)&&(a=!1),!a||!s||s.nextElementSibling&&s.nextElementSibling.classList.contains(k.group)?r=10:s=s.nextElementSibling}while(o<10||r<10);n&&a&&!i.previousElementSibling.classList.contains(ne)?t.addClass([i.previousElementSibling],l):n&&a&&i.previousElementSibling.classList.contains(ne)&&t.removeClass([i.previousElementSibling],l)},s.prototype.getValidLi=function(){var e=this.ulElement.querySelector("li."+k.li+":not(."+ne+")");return t.isNullOrUndefined(e)?this.liCollections[0]:e},s.prototype.checkSelectAll=function(){var e=this.list.querySelectorAll("li.e-list-group-item.e-active").length,i=this.list.querySelectorAll("li.e-list-item"),s=this.list.querySelectorAll("li."+k.li).length,l=this.list.querySelectorAll("li."+k.selected).length;if(this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(l-=e),s!==l&&l!==this.maximumSelectionLength||"CheckBox"!==this.mode||!this.showSelectAll?s!==l&&"CheckBox"===this.mode&&this.showSelectAll&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}):this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check"}),this.enableGroupCheckBox&&this.fields.groupBy&&!this.enableSelectionOrder){for(var o=0;o<i.length;o++)this.findGroupStart(i[o]);this.deselectHeader()}},s.prototype.openClick=function(e){this.openOnClick||"CheckBox"===this.mode?this.openOnClick||"CheckBox"!==this.mode||this.isPopupOpen()||this.showPopup():""!==this.targetElement()?this.showPopup():this.hidePopup()},s.prototype.keyUp=function(e){if("CheckBox"===this.mode&&!this.openOnClick){var i=String.fromCharCode(e.keyCode).match(/\w/);t.isNullOrUndefined(i)||(this.isValidKey=!0)}this.isValidKey=this.isPopupOpen()&&8===e.keyCode||this.isValidKey,this.isValidKey=(!e.ctrlKey||86!==e.keyCode)&&this.isValidKey,this.isValidKey&&(this.isValidKey=!1,this.expandTextbox(),this.showOverAllClear(),e.keyCode,this.search(e))},s.prototype.filter=function(e,t,i){this.isFiltered=!0,this.remoteFilterAction=!0,this.dataUpdater(e,t,i)},s.prototype.getQuery=function(e){var s=e?e.clone():this.query?this.query.clone():new i.Query;if(this.filterAction){if(null!==this.targetElement()){var l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var o=this.fields;s.where(t.isNullOrUndefined(o.text)?"":o.text,this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}else s.where("",this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)}return s}return e||(this.query?this.query:new i.Query)},s.prototype.dataUpdater=function(e,t,s){if(this.isDataFetched=!1,""===this.targetElement().trim()){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.backCommand&&(this.remoteCustomValue=!1,this.onActionComplete(l,this.mainData),this.value&&this.value.length&&this.refreshSelection(),8!==this.keyCode&&this.focusAtFirstListItem(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}))}else this.resetList(e,s,t),this.allowCustomValue&&(e instanceof i.DataManager?(this.remoteCustomValue=!0,this.tempQuery=t):this.checkForCustomValue(t,s));this.refreshPopup(),"CheckBox"===this.mode&&this.removeFocus()},s.prototype.checkForCustomValue=function(e,i){var s=!this.getValueByText(this.inputElement.value,this.ignoreCase);if(this.allowCustomValue&&s){var l=this.inputElement.value,o=i||this.fields,r=!t.isNullOrUndefined(this.mainData)&&this.mainData.length>0?this.mainData[0]:this.mainData;if("string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r){var n={};t.setValue(o.text,l,n),"number"==typeof t.getValue(this.fields.value?this.fields.value:"value",r)?t.setValue(o.value,Math.random(),n):t.setValue(o.value,l,n),(a=JSON.parse(JSON.stringify(this.listData))).splice(0,0,n),this.resetList(a,o,e)}else{var a=[this.inputElement.value];a[0]="number"!=typeof r||isNaN(parseFloat(a[0]))?a[0]:parseFloat(a[0]),a[0]="boolean"==typeof r?"true"===a[0]||"false"!==a[0]&&a[0]:a[0],this.resetList(a,o)}}this.value&&this.value.length&&this.refreshSelection()},s.prototype.getNgDirective=function(){return"EJS-MULTISELECT"},s.prototype.wrapperClick=function(e){if(this.setDynValue=!1,this.enabled){if(e.target===this.overAllClear)return void e.preventDefault();if(this.inputFocus||this.inputElement.focus(),!this.readonly){if(e.target&&-1!==e.target.classList.toString().indexOf("e-chips-close"))return void(this.isPopupOpen()&&this.refreshPopup());!this.isPopupOpen()&&(this.openOnClick||this.showDropDownIcon&&e.target&&"e-input-group-icon e-ddl-icon"===e.target.className)?this.showPopup():(this.hidePopup(),"CheckBox"===this.mode&&(this.showOverAllClear(),this.inputFocus=!0,this.overAllWrapper.classList.contains(re)||this.overAllWrapper.classList.add(re)))}this.targetElement()&&""!==this.targetElement()||e.preventDefault()}},s.prototype.enable=function(e){e?(this.overAllWrapper.classList.remove("e-disabled"),this.inputElement.removeAttribute("disabled"),t.attributes(this.inputElement,{"aria-disabled":"false"}),this.ensureAriaDisabled("false")):(this.overAllWrapper.classList.add("e-disabled"),this.inputElement.setAttribute("disabled","true"),t.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled("true")),this.enabled!==e&&(this.enabled=e),this.hidePopup()},s.prototype.onBlur=function(e,i){var s;return t.isNullOrUndefined(e)||(s=e.relatedTarget),this.popupObj&&document.body.contains(this.popupObj.element)&&this.popupObj.element.contains(s)?void("CheckBox"!==this.mode?this.inputElement.focus():"Auto"===this.floatLabelType&&(this.overAllWrapper.classList.contains("e-outline")||this.overAllWrapper.classList.contains("e-filled"))&&t.addClass([this.overAllWrapper],"e-valid-input")):("Auto"===this.floatLabelType&&this.overAllWrapper.classList.contains("e-outline")&&"CheckBox"===this.mode&&(t.isNullOrUndefined(this.value)||0===this.value.length)&&t.removeClass([this.overAllWrapper],"e-valid-input"),"CheckBox"!==this.mode||!t.Browser.isIE||t.isNullOrUndefined(e)||i?this.scrollFocusStatus?(t.isNullOrUndefined(e)||e.preventDefault(),this.inputElement.focus(),void(this.scrollFocusStatus=!1)):(this.inputFocus=!1,this.overAllWrapper.classList.remove(re),this.refreshListItems(null),"Box"!==this.mode&&"CheckBox"!==this.mode&&this.updateDelimView(),this.changeOnBlur&&(this.updateValueState(e,this.value,this.tempValues),this.dispatchEvent(this.hiddenElement,"change")),this.overAllClear.style.display="none",this.isPopupOpen()&&(this.DropDownBaseresetBlazorTemplates(!1,!1,!0,!0,!1,!0,!0),this.hidePopup()),this.makeTextBoxEmpty(),this.trigger("blur"),this.focused=!0,t.Browser.isDevice&&"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.removeChipFocus(),this.removeChipSelection(),this.refreshInputHight(),g(this.overAllWrapper,this.componentWrapper,this.value,this.floatLabelType,this.placeholder),this.refreshPlaceHolder(),(this.allowFiltering||!0===this.enableSelectionOrder&&"CheckBox"===this.mode)&&!t.isNullOrUndefined(this.mainList)&&(this.ulElement=this.mainList),void this.checkPlaceholderSize()):(this.inputFocus=!1,void this.overAllWrapper.classList.remove(re)))},s.prototype.checkPlaceholderSize=function(){if(this.showDropDownIcon){var e=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10);this.setPlaceholderSize(e)}else t.isNullOrUndefined(this.dropIcon)||this.setPlaceholderSize(this.showDropDownIcon?this.dropIcon.offsetWidth:0)},s.prototype.setPlaceholderSize=function(e){t.isNullOrUndefined(this.value)||0===this.value.length?0!==this.dropIcon.offsetWidth?this.searchWrapper.style.width="calc(100% - "+(e+10)+"px":t.addClass([this.searchWrapper],"e-search-custom-width"):t.isNullOrUndefined(this.value)||(this.searchWrapper.removeAttribute("style"),t.removeClass([this.searchWrapper],"e-search-custom-width"))},s.prototype.refreshInputHight=function(){this.value&&this.value.length||!t.isNullOrUndefined(this.text)&&""!==this.text?this.searchWrapper.classList.add("e-zero-size"):this.searchWrapper.classList.remove("e-zero-size")},s.prototype.validateValues=function(e,t){return JSON.stringify(e.slice().sort())!==JSON.stringify(t.slice().sort())},s.prototype.updateValueState=function(e,t,i){var s=t||[],l=i||[];if(this.initStatus&&this.validateValues(s,l)){var o={e:e,oldValue:i,value:t,isInteracted:!!e,element:this.element};this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",o),this.updateTempValue(),this.changeOnBlur||this.dispatchEvent(this.hiddenElement,"change")}},s.prototype.updateTempValue=function(){this.value?this.tempValues=this.value.slice():this.tempValues=this.value},s.prototype.getPagingCount=function(){var e=this.list.classList.contains(k.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height");return Math.round(this.list.offsetHeight/parseInt(e,10))},s.prototype.pageUpSelection=function(e){var t=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)"),i=e>=0?t[e+1]:t[0];this.addListFocus(i),this.scrollBottom(i,this.getIndexByValue(i.getAttribute("data-value")))},s.prototype.pageDownSelection=function(e){this.getItems();var t=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)"),i=e<=t.length?t[e-1]:t[t.length-1];this.addListFocus(i),this.scrollBottom(i,this.getIndexByValue(i.getAttribute("data-value")))},s.prototype.getItems=function(){return this.list||e.prototype.render.call(this),this.ulElement&&this.ulElement.querySelectorAll("."+k.li).length>0?this.ulElement.querySelectorAll("."+k.li+":not(."+ne+")"):[]},s.prototype.focusInHandler=function(e){if(this.enabled){if(this.showOverAllClear(),this.inputFocus=!0,this.value&&this.value.length&&("Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),"CheckBox"!==this.mode&&(this.viewWrapper.style.display="none")),"CheckBox"!==this.mode&&this.searchWrapper.classList.remove("e-zero-size"),this.checkPlaceholderSize(),this.focused){var t={isInteracted:!!e,event:e};this.trigger("focus",t),this.focused=!1}return this.overAllWrapper.classList.contains(re)||this.overAllWrapper.classList.add(re),y(this.overAllWrapper,this.componentWrapper),this.isPopupOpen()&&this.refreshPopup(),!0}return!1},s.prototype.showDelimWrapper=function(){"CheckBox"===this.mode?this.viewWrapper.style.display="":this.delimiterWrapper.style.display="",this.componentWrapper.classList.add("e-delimiter")},s.prototype.hideDelimWrapper=function(){this.delimiterWrapper.style.display="none",this.componentWrapper.classList.remove("e-delimiter")},s.prototype.expandTextbox=function(){var e=5;this.placeholder&&(e=e>this.inputElement.placeholder.length?e:this.inputElement.placeholder.length),this.inputElement.value.length>e?this.inputElement.size=this.inputElement.value.length:this.inputElement.size=e},s.prototype.isPopupOpen=function(){return null!==this.popupWrapper&&null!==this.popupWrapper.parentElement},s.prototype.refreshPopup=function(){this.popupObj&&this.mobFilter&&(this.popupObj.setProperties({width:this.calcPopupWidth()}),this.popupObj.refreshPosition(this.overAllWrapper),this.popupObj.resolveCollision())},s.prototype.checkTextLength=function(){return this.targetElement().length<1},s.prototype.popupKeyActions=function(e){switch(e.keyCode){case 38:this.hidePopup(),"CheckBox"===this.mode&&this.inputElement.focus(),e.preventDefault();break;case 40:this.isPopupOpen()||(this.showPopup(),e.preventDefault())}},s.prototype.updateAriaAttribute=function(){var e=this.list.querySelector("."+k.focus);t.isNullOrUndefined(e)||this.inputElement.setAttribute("aria-activedescendant",e.id)},s.prototype.homeNavigation=function(e){this.removeFocus();var t=this.ulElement.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)");if(t.length>0){var i=t[e?0:t.length-1];i.classList.add(k.focus),this.scrollBottom(i)}},s.prototype.onKeyDown=function(e){if(!this.readonly&&(this.enabled||"CheckBox"===this.mode)&&(this.keyCode=e.keyCode,this.keyDownStatus=!0,!(e.keyCode>111&&e.keyCode<124))){if(e.altKey)return void this.popupKeyActions(e);if(this.isPopupOpen()){var t=this.list.querySelector("."+k.focus);switch(e.keyCode){case 36:case 35:this.homeNavigation(36===e.keyCode);break;case 33:return e.preventDefault(),void(t&&(this.getIndexByValue(t.getAttribute("data-value")),this.pageUpSelection(void 0-this.getPagingCount()),this.updateAriaAttribute()));case 34:return e.preventDefault(),void(t&&(this.getIndexByValue(t.getAttribute("data-value")),this.pageDownSelection(void 0+this.getPagingCount()),this.updateAriaAttribute()));case 38:this.arrowUp(e);break;case 40:this.arrowDown(e);break;case 27:return e.preventDefault(),this.hidePopup(),void("CheckBox"===this.mode&&this.inputElement.focus());case 13:return e.preventDefault(),"CheckBox"!==this.mode&&this.selectByKey(e),void this.checkPlaceholderSize();case 32:return void this.spaceKeySelection(e);case 9:e.preventDefault(),this.hidePopup(),this.inputElement.focus(),this.overAllWrapper.classList.add(re)}}else switch(e.keyCode){case 13:case 9:case 16:case 17:case 20:return;case 40:this.openOnClick&&this.showPopup();break;case 27:return e.preventDefault(),void this.escapeAction()}this.checkTextLength()&&this.keyNavigation(e),"CheckBox"===this.mode&&this.enableSelectionOrder&&this.checkBackCommand(e),this.expandTextbox(),this.refreshPopup()}},s.prototype.arrowDown=function(e){e.preventDefault(),this.moveByList(1),this.keyAction=!0,(document.activeElement.classList.contains("e-input-filter")||"CheckBox"===this.mode&&!this.allowFiltering&&document.activeElement!==this.list)&&(this.list.focus(),t.EventHandler.add(this.list,"keydown",this.onKeyDown,this)),this.updateAriaAttribute()},s.prototype.arrowUp=function(e){e.preventDefault(),this.keyAction=!0;var i=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)");this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+k.li+",li."+k.group+":not(."+ne+"):not(.e-reorder-hide)"));var s=this.list.querySelector("li."+k.focus);Array.prototype.slice.call(i).indexOf(s)<=0&&"CheckBox"===this.mode&&this.allowFiltering&&(this.keyAction=!1,this.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"focus"})),this.moveByList(-1),this.updateAriaAttribute()},s.prototype.spaceKeySelection=function(e){"CheckBox"===this.mode&&(document.activeElement.classList.contains("e-input-filter")||(e.preventDefault(),this.keyAction=!0,this.list.focus()),this.selectByKey(e)),this.checkPlaceholderSize()},s.prototype.checkBackCommand=function(e){8===e.keyCode&&""===this.targetElement()?this.backCommand=!1:this.backCommand=!0},s.prototype.keyNavigation=function(e){if("Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.value&&this.value.length)switch(e.keyCode){case 37:e.preventDefault(),this.moveBy(-1,e);break;case 39:e.preventDefault(),this.moveBy(1,e);break;case 8:this.removelastSelection(e);break;case 46:this.removeSelectedChip(e)}else if(8===e.keyCode&&"Delimiter"===this.mode&&this.value&&this.value.length){e.preventDefault();var t=this.value[this.value.length-1];this.removeValue(t,e),this.updateDelimeter(this.delimiterChar,e),this.focusAtLastListItem(t)}},s.prototype.selectByKey=function(e){this.removeChipSelection(),this.selectListByKey(e),this.hideSelectedItem&&this.focusAtFirstListItem()},s.prototype.escapeAction=function(){var e=this.tempValues?this.tempValues.slice():[];this.value&&this.validateValues(this.value,e)&&("CheckBox"!==this.mode&&(this.value=e,this.initialValueUpdate()),"Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),this.refreshPlaceHolder(),this.value.length?this.showOverAllClear():this.hideOverAllClear()),this.makeTextBoxEmpty()},s.prototype.scrollBottom=function(e,i){var s=this.list.offsetHeight,l=e.offsetTop+e.offsetHeight-this.list.scrollTop,o=this.list.scrollTop+l-s,r=e.offsetTop+e.offsetHeight-this.list.scrollTop;r=this.fields.groupBy&&!t.isNullOrUndefined(this.fixedHeaderElement)?r-this.fixedHeaderElement.offsetHeight:r,0===i?this.list.scrollTop=0:l>s?this.list.scrollTop=o:r>0&&this.list.offsetHeight>r||(this.list.scrollTop=o)},s.prototype.scrollTop=function(e,i){var s=e.offsetTop-this.list.scrollTop;s=this.fields.groupBy&&!t.isUndefined(this.fixedHeaderElement)?s-this.fixedHeaderElement.offsetHeight:s;var l=e.offsetTop+e.offsetHeight-this.list.scrollTop;0===i?this.list.scrollTop=0:s<0?this.list.scrollTop=this.list.scrollTop+s:l>0&&this.list.offsetHeight>l||(this.list.scrollTop=e.offsetTop-(this.fields.groupBy&&!t.isUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0))},s.prototype.selectListByKey=function(e){var i,s=this.list.querySelector("li."+k.focus),l=this.value&&this.value.length?this.value.length:0;null!==s&&(s.classList.contains("e-active")&&(l-=1),this.isValidLI(s)&&l<this.maximumSelectionLength?(this.updateListSelection(s,e),this.addListFocus(s),"CheckBox"===this.mode?(this.updateDelimView(),this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight(),this.checkPlaceholderSize(),this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=s.firstElementChild.lastElementChild,this.findGroupStart(i),this.deselectHeader())):this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),"CheckBox"!==this.mode&&this.refreshListItems(s.textContent),this.changeOnBlur||this.updateValueState(e,this.value,this.tempValues),this.refreshPopup()):!this.isValidLI(s)&&l<this.maximumSelectionLength&&((i=s.firstElementChild.lastElementChild).classList.contains("e-check")?this.selectAllItem(!1,e,s):this.selectAllItem(!0,e,s)),this.refreshSelection(),this.closePopupOnSelect&&this.hidePopup()),this.refreshPlaceHolder()},s.prototype.refreshListItems=function(e){if((this.allowFiltering||"CheckBox"===this.mode&&!0===this.enableSelectionOrder||this.allowCustomValue)&&this.mainList&&this.listData){var t=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(t,this.mainData),this.focusAtLastListItem(e),this.value&&this.value.length&&this.refreshSelection()}},s.prototype.removeSelectedChip=function(e){var i,s=this.chipCollectionWrapper.querySelector("span.e-chip-selected");null!==s&&(t.isNullOrUndefined(this.value)||(this.tempValues=this.value.slice()),null!==(i=s.nextElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,e)),this.removeValue(s.getAttribute("data-value"),e),this.makeTextBoxEmpty()),this.closePopupOnSelect&&this.hidePopup(),this.checkPlaceholderSize()},s.prototype.moveByTop=function(e){var t,i=this.list.querySelectorAll("li."+k.li);i.length>1&&(this.removeFocus(),t=e?0:i.length-1,this.addListFocus(i[t]),this.scrollBottom(i[t],t)),this.updateAriaAttribute()},s.prototype.moveByList=function(e){if(this.list){var i=this.list.querySelectorAll("li."+k.li+":not(."+ne+"):not(.e-reorder-hide)");"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+k.li+",li."+k.group+":not(."+ne+"):not(.e-reorder-hide)"));var s=this.list.querySelector("li."+k.focus),l=-1;if(i.length){for(var o=0;o<i.length;o++)if(i[o]===s){l=o;break}e>0?l<i.length-1&&(this.removeFocus(),this.addListFocus(i[++l]),this.updateCheck(i[l]),this.scrollBottom(i[l],l)):l>0&&(this.removeFocus(),this.addListFocus(i[--l]),this.updateCheck(i[l]),this.scrollTop(i[l],l))}}},s.prototype.updateCheck=function(e){"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&(e.firstElementChild.lastElementChild.classList.contains("e-check")?e.classList.add("e-active"):e.classList.remove("e-active"))},s.prototype.moveBy=function(e,t){var i,s=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),l=this.chipCollectionWrapper.querySelector("span.e-chip-selected");null===l?e<0&&this.addChipSelection(s[s.length-1],t):e<0?null!==(i=l.previousElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,t)):(i=l.nextElementSibling,this.removeChipSelection(),null!==i&&this.addChipSelection(i,t))},s.prototype.chipClick=function(e){if(this.enabled){var i=t.closest(e.target,".e-chips");this.removeChipSelection(),this.addChipSelection(i,e)}},s.prototype.removeChipSelection=function(){this.chipCollectionWrapper&&this.removeChipFocus()},s.prototype.addChipSelection=function(e,i){t.addClass([e],"e-chip-selected"),this.trigger("chipSelection",i)},s.prototype.onChipRemove=function(e){if(3!==e.which&&2!==e.button&&this.enabled&&!this.readonly){var i=e.target.parentElement.getAttribute("data-value"),s=this.getFormattedValue(i);if(this.allowCustomValue&&("false"!==i&&!1===s||!t.isNullOrUndefined(s)&&"NaN"===s.toString())&&(s=i),this.isPopupOpen()&&"CheckBox"!==this.mode&&this.hidePopup(),this.inputFocus||this.inputElement.focus(),this.removeValue(s,e),t.isNullOrUndefined(this.findListElement(this.list,"li","data-value",s))&&this.mainList&&this.listData){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.updateDelimeter(this.delimiterChar,e),this.placeholder&&"Never"===this.floatLabelType?(this.makeTextBoxEmpty(),this.checkPlaceholderSize()):this.inputElement.value="",e.preventDefault()}},s.prototype.makeTextBoxEmpty=function(){this.inputElement.value="",this.refreshPlaceHolder()},s.prototype.refreshPlaceHolder=function(){this.placeholder&&"Never"===this.floatLabelType?this.value&&this.value.length||!t.isNullOrUndefined(this.text)&&""!==this.text?this.inputElement.placeholder="":this.inputElement.placeholder=this.placeholder:this.setFloatLabelType(),this.expandTextbox()},s.prototype.removeValue=function(i,s,l,o){var r=this,n=this.value.indexOf(this.getFormattedValue(i));-1===n&&this.allowCustomValue&&!t.isNullOrUndefined(i)&&(n=this.value.indexOf(i.toString()));var a=s&&s.target;o=!!(o||a&&a.classList.contains("e-close-hooker"))||null;var h=this.hideSelectedItem?ne:k.selected;if(-1!==n){var p=this.findListElement(this.list,"li","data-value",i),u=this.getDataByValue(i),c={e:s,item:p,itemData:u,isInteracted:!!s,cancel:!1};this.trigger("removing",c,function(a){if(a.cancel)r.removeIndex++;else{var c=r.value.slice(0);if(c.splice(n,1),t.isBlazor()&&r.isServerRendered){var d=[].concat([],c);r.setProperties({value:0===d.length?null:d},!0)}else r.setProperties({value:[].concat([],c)},!0);if(null!==p){var m=r.findListElement(r.mainList,"li","data-value",i);p.setAttribute("aria-selected","false"),t.removeClass([p],h),m&&(m.setAttribute("aria-selected","false"),t.removeClass([p,m],h)),r.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===r.mode,li:p,e:r,index:n}),r.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===r.mode,li:p,e:s}),t.attributes(r.inputElement,{"aria-activedescendant":p.id}),r.value&&r.value.length!==r.mainData.length&&"CheckBox"===r.mode&&r.showSelectAll&&!r.isSelectAll&&!o&&r.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===r.mode,value:"uncheck"})}if(r.hideSelectedItem&&r.fields.groupBy&&r.hideGroupItem(i),r.hideSelectedItem&&r.fixedHeaderElement&&r.fields.groupBy&&"CheckBox"!==r.mode&&r.isPopupOpen()&&e.prototype.scrollStop.call(r),r.updateMainList(!0,i),r.removeChip(i),r.updateChipStatus(),(r.value&&r.value.length?r.value.length:0)<r.maximumSelectionLength){var f=r.list.querySelectorAll("li."+k.li+":not(.e-active)");t.removeClass(f,"e-disable")}r.trigger("removed",a);var v=s&&s.currentTarget,y=!(!v||!v.classList.contains("e-selectall-parent"))||null;if(r.changeOnBlur||o||!s||!l||y||r.updateValueState(s,r.value,r.tempValues),l&&(r.selectAllEventData.push(u),r.selectAllEventEle.push(p)),1===l){r.changeOnBlur||r.updateValueState(s,r.value,r.tempValues);var g={event:s,items:r.selectAllEventEle,itemData:r.selectAllEventData,isInteracted:!!s,isChecked:!1};r.trigger("selectedAll",g),r.selectAllEventData=[],r.selectAllEventEle=[]}!o||1!==l&&null!==l||r.clearAllCallback(s,o),t.isBlazor()&&r.isServerRendered&&(t.isNullOrUndefined(r.value)||0===r.value.length)&&r.updatedataValueItems(s)}})}},s.prototype.updateMainList=function(e,i){if(this.allowFiltering||"CheckBox"===this.mode){var s=this.findListElement(this.mainList,"li","data-value",i);s&&(e?(s.setAttribute("aria-selected","false"),t.removeClass([s],this.hideSelectedItem?ne:k.selected),"CheckBox"===this.mode&&(s.firstElementChild.setAttribute("aria-checked","false"),t.removeClass([s.firstElementChild.lastElementChild],"e-check"))):(s.setAttribute("aria-selected","true"),t.addClass([s],this.hideSelectedItem?ne:k.selected),"CheckBox"===this.mode&&(s.firstElementChild.setAttribute("aria-checked","true"),t.addClass([s.firstElementChild.lastElementChild],"e-check"))))}},s.prototype.removeChip=function(e){if(this.chipCollectionWrapper){var i=this.findListElement(this.chipCollectionWrapper,"span","data-value",e);i&&t.remove(i)}},s.prototype.setWidth=function(e){t.isNullOrUndefined(e)||("number"==typeof e?this.overAllWrapper.style.width=t.formatUnit(e):"string"==typeof e&&(this.overAllWrapper.style.width=e.match(/px|%|em/)?e:t.formatUnit(e)))},s.prototype.updateChipStatus=function(){this.value&&this.value.length?(t.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display=""),"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper(),this.showOverAllClear()):(t.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display="none"),t.isNullOrUndefined(this.delimiterWrapper)||(this.delimiterWrapper.style.display="none"),this.hideOverAllClear())},s.prototype.addValue=function(e,t,i){this.value||(this.value=[]),this.value.indexOf(e)<0&&this.setProperties({value:[].concat([],this.value,[e])},!0);var s=this.findListElement(this.list,"li","data-value",e);this.removeFocus(),s&&(this.addListFocus(s),this.addListSelection(s)),"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.addChip(t,e,i),this.hideSelectedItem&&this.fields.groupBy&&this.hideGroupItem(e),this.updateChipStatus(),this.checkMaxSelection()},s.prototype.checkMaxSelection=function(){if((this.value&&this.value.length?this.value.length:0)===this.maximumSelectionLength){var e=this.list.querySelectorAll("li."+k.li+":not(.e-active)");t.addClass(e,"e-disable")}},s.prototype.dispatchSelect=function(t,i,s,l,o){var r=this,n=this.listData;if(this.initStatus&&!l){var a=this.getDataByValue(t),h={e:i,item:s,itemData:a,isInteracted:!!i,cancel:!1};this.trigger("select",h,function(l){if(!l.cancel){if(o&&(r.selectAllEventData.push(a),r.selectAllEventEle.push(s)),1===o){var h={event:i,items:r.selectAllEventEle,itemData:r.selectAllEventData,isInteracted:!!i,isChecked:!0};r.trigger("selectedAll",h),r.selectAllEventData=[]}r.allowCustomValue&&r.isServerRendered&&r.listData!==n&&(r.listData=n),r.updateListSelectEventCallback(t,s,i),r.hideSelectedItem&&r.fixedHeaderElement&&r.fields.groupBy&&"CheckBox"!==r.mode&&e.prototype.scrollStop.call(r)}})}},s.prototype.addChip=function(e,t,i){this.chipCollectionWrapper&&this.getChip(e,t,i)},s.prototype.removeChipFocus=function(){var e=this.chipCollectionWrapper.querySelectorAll("span.e-chips"),i=this.chipCollectionWrapper.querySelectorAll("span."+"e-chips-close".split(" ")[0]);if(t.removeClass(e,"e-chip-selected"),t.Browser.isDevice)for(var s=0;s<i.length;s++)i[s].style.display="none"},s.prototype.onMobileChipInteraction=function(e){var i=t.closest(e.target,".e-chips"),s=i.querySelector("span."+"e-chips-close".split(" ")[0]);this.enabled&&!this.readonly&&(i.classList.contains("e-chip-selected")||(this.removeChipFocus(),s.style.display="",i.classList.add("e-chip-selected")),this.refreshPopup(),e.preventDefault())},s.prototype.multiCompiler=function(e){var i=!1;if(e)try{i=!!t.selectAll(e,document).length}catch(e){i=!1}return i},s.prototype.getChip=function(e,i,s){var l,o=this,r={text:i,value:i},n=this.createElement("span",{className:ae,attrs:{"data-value":i,title:e}}),a=this.createElement("span",{className:"e-chipcontent"}),h=this.createElement("span",{className:"e-chips-close"});if(this.mainData&&(r=t.isBlazor()&&this.isServerRendered?JSON.parse(JSON.stringify(this.getDataByValue(i))):this.getDataByValue(i)),this.valueTemplate&&!t.isNullOrUndefined(r)){var p=(l=this.multiCompiler(this.valueTemplate)?t.compile(t.select(this.valueTemplate,document).innerHTML.trim()):t.compile(this.valueTemplate))(r,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,a);if(p&&p.length>0)for(var u=0;u<p.length;u++)a.appendChild(p[u]);this.renderReactTemplates(),this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!0,!1,!1,!1)}else this.enableHtmlSanitizer?a.innerText=e:a.innerHTML=e;n.appendChild(a);var c={isInteracted:!!s,itemData:r,e:s,setClass:function(e){t.addClass([n],e)},cancel:!1};this.isPreventChange=this.isAngular&&this.preventChange,this.trigger("tagging",c,function(e){e.cancel||(e.setClass&&"string"==typeof e.setClass&&t.isBlazor()&&o.isServerRendered&&t.addClass([n],e.setClass),t.Browser.isDevice?(n.classList.add("e-mob-chip"),t.append([h],n),h.style.display="none",t.EventHandler.add(n,"click",o.onMobileChipInteraction,o)):(t.EventHandler.add(n,"mousedown",o.chipClick,o),o.showClearButton&&n.appendChild(h)),t.EventHandler.add(h,"mousedown",o.onChipRemove,o),o.chipCollectionWrapper.appendChild(n),!o.changeOnBlur&&s&&o.updateValueState(s,o.value,o.tempValues))})},s.prototype.calcPopupWidth=function(){var e=t.formatUnit(this.popupWidth);return e.indexOf("%")>-1&&(e=(this.componentWrapper.offsetWidth*parseFloat(e)/100).toString()+"px"),e},s.prototype.mouseIn=function(){this.enabled&&!this.readonly&&this.showOverAllClear()},s.prototype.mouseOut=function(){this.inputFocus||(this.overAllClear.style.display="none")},s.prototype.listOption=function(e,i){var s=!t.isNullOrUndefined(i.iconCss),l=t.isNullOrUndefined(i.properties)?i:i.properties;return this.listCurrentOptions=null!==i.text||null!==i.value?{fields:l,showIcon:s,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},t.extend(this.listCurrentOptions,this.listCurrentOptions,i,!0),"CheckBox"===this.mode&&this.notify("listoption",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,dataSource:e,fieldProperty:l}),this.listCurrentOptions},s.prototype.renderPopup=function(){var i=this;if(this.list||e.prototype.render.call(this),!this.popupObj){document.body.appendChild(this.popupWrapper);var s=this.popupWrapper.querySelector(".e-filter-parent");"CheckBox"===this.mode&&!this.allowFiltering&&s&&this.filterParent&&(s.remove(),this.filterParent=null);var o=parseInt(this.popupHeight,10);if(this.popupWrapper.style.visibility="hidden",this.headerTemplate&&(this.setHeaderTemplate(),o-=this.header.offsetHeight),t.append([this.list],this.popupWrapper),this.footerTemplate&&(this.setFooterTemplate(),o-=this.footer.offsetHeight),"CheckBox"===this.mode&&this.showSelectAll?(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),o-=this.selectAllHeight):"CheckBox"!==this.mode||this.showSelectAll||this.headerTemplate||this.footerTemplate?"CheckBox"!==this.mode||this.showSelectAll||(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),o=parseInt(this.popupHeight,10),this.headerTemplate&&this.header&&(o-=this.header.offsetHeight),this.footerTemplate&&this.footer&&(o-=this.footer.offsetHeight)):(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),o=parseInt(this.popupHeight,10)),"CheckBox"===this.mode){var r={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,popupElement:this.popupWrapper};this.allowFiltering&&(this.notify("searchBox",r),o-=this.searchBoxHeight),t.addClass([this.popupWrapper],"e-checkbox")}"auto"!==this.popupHeight?(this.list.style.maxHeight=t.formatUnit(o),this.popupWrapper.style.maxHeight=t.formatUnit(this.popupHeight)):this.list.style.maxHeight=t.formatUnit(this.popupHeight),this.popupObj=new l.Popup(this.popupWrapper,{width:this.calcPopupWidth(),targetType:"relative",position:{X:"left",Y:"bottom"},relateTo:this.overAllWrapper,collision:{X:"flip",Y:"flip"},offsetY:1,enableRtl:this.enableRtl,zIndex:this.zIndex,close:function(){i.popupObj.element.parentElement&&(i.popupObj.unwireScrollEvents(),t.detach(i.popupObj.element))},open:function(){if(i.popupObj.resolveCollision(),!i.isFirstClick){var e=i.list.querySelector("ul");e&&(i.itemTemplate&&t.isBlazor()&&i.isServerRendered?setTimeout(function(){i.mainList=i.ulElement},0):"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&""!==i.targetElement().trim()||(i.mainList=e.cloneNode?e.cloneNode(!0):e)),i.isFirstClick=!0}i.popupObj.wireScrollEvents(),"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&""!==i.targetElement().trim()||i.loadTemplate(),i.setScrollPosition(),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"focus"})},targetExitViewport:function(){t.Browser.isDevice||i.hidePopup()}}),"CheckBox"===this.mode&&t.Browser.isDevice&&this.allowFiltering&&this.notify("deviceSearchBox",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.popupObj.close(),this.popupWrapper.style.visibility=""}},s.prototype.setHeaderTemplate=function(){var e;this.header&&this.header.remove(),this.header=this.createElement("div"),t.addClass([this.header],"e-ddl-header");var i=(e=this.multiCompiler(this.headerTemplate)?t.compile(t.select(this.headerTemplate,document).innerHTML.trim()):t.compile(this.headerTemplate))({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);if(i&&i.length>0)for(var s=0;s<i.length;s++)this.header.appendChild(i[s]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!0,!1),"CheckBox"===this.mode&&this.showSelectAll?t.prepend([this.header],this.popupWrapper):t.append([this.header],this.popupWrapper),t.EventHandler.add(this.header,"mousedown",this.onListMouseDown,this)},s.prototype.setFooterTemplate=function(){var e;this.footer&&this.footer.remove(),this.footer=this.createElement("div"),t.addClass([this.footer],"e-ddl-footer");var i=(e=this.multiCompiler(this.footerTemplate)?t.compile(t.select(this.footerTemplate,document).innerHTML.trim()):t.compile(this.footerTemplate))({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);if(i&&i.length>0)for(var s=0;s<i.length;s++)this.footer.appendChild(i[s]);this.DropDownBaseupdateBlazorTemplates(!1,!1,!1,!1,!1,!1,!0),t.append([this.footer],this.popupWrapper),t.EventHandler.add(this.footer,"mousedown",this.onListMouseDown,this)},s.prototype.clearAll=function(e){if(this.enabled&&!this.readonly){var i=void 0;if(this.value&&this.value.length>0){var s=this.list&&this.list.querySelectorAll("li.e-list-item");if(s&&s.length>0)this.selectAllItems(!1,e);else for(this.removeIndex=0,i=this.value[this.removeIndex];this.removeIndex<this.value.length&&(this.removeValue(i,e,null,!0),null!==this.value||!t.isBlazor()||!this.isServerRendered);i=this.value[this.removeIndex]);}else this.clearAllCallback(e)}},s.prototype.clearAllCallback=function(e,i){var s=this.value?this.value.slice():[];if(this.mainList&&this.listData&&(this.allowFiltering&&"CheckBox"!==this.mode||this.allowCustomValue)){var l=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.onActionComplete(l,this.mainData)}this.focusAtFirstListItem(),this.updateDelimeter(this.delimiterChar,e),"Box"===this.mode||this.inputFocus&&"CheckBox"!==this.mode||this.updateDelimView(),""!==this.inputElement.value&&(this.makeTextBoxEmpty(),this.search(null)),this.checkPlaceholderSize(),this.isPopupOpen()&&this.refreshPopup(),this.inputFocus||(this.changeOnBlur&&this.updateValueState(e,this.value,s),"CheckBox"!==this.mode&&this.inputElement.focus()),"CheckBox"===this.mode&&(this.refreshPlaceHolder(),this.refreshInputHight(),this.changeOnBlur&&i&&(t.isNullOrUndefined(this.value)||0===this.value.length)&&this.updateValueState(e,this.value,this.tempValues)),this.changeOnBlur||!i||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.updateValueState(e,this.value,this.tempValues),"CheckBox"===this.mode&&this.enableGroupCheckBox&&!t.isNullOrUndefined(this.fields.groupBy)&&this.updateListItems(this.list.querySelectorAll("li.e-list-item"),this.mainList.querySelectorAll("li.e-list-item")),e.preventDefault()},s.prototype.windowResize=function(){this.refreshPopup(),this.inputFocus&&"CheckBox"!==this.mode||!this.viewWrapper||!this.viewWrapper.parentElement||this.updateDelimView()},s.prototype.resetValueHandler=function(e){var i=t.closest(this.inputElement,"form");if(i&&e.target===i){var s=this.element.tagName===this.getNgDirective()?null:this.element.getAttribute("data-initial-value");this.text=s}},s.prototype.wireEvent=function(){t.EventHandler.add(this.componentWrapper,"mousedown",this.wrapperClick,this),t.EventHandler.add(window,"resize",this.windowResize,this),t.EventHandler.add(this.inputElement,"focus",this.focusInHandler,this),t.EventHandler.add(this.inputElement,"keydown",this.onKeyDown,this),t.EventHandler.add(this.inputElement,"keyup",this.keyUp,this),"CheckBox"!==this.mode&&t.EventHandler.add(this.inputElement,"input",this.onInput,this),t.EventHandler.add(this.inputElement,"blur",this.onBlur,this),t.EventHandler.add(this.componentWrapper,"mousemove",this.mouseIn,this);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.add(e,"reset",this.resetValueHandler,this),t.EventHandler.add(this.componentWrapper,"mouseout",this.mouseOut,this),t.EventHandler.add(this.overAllClear,"mouseup",this.clearAll,this),t.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)},s.prototype.onInput=function(e){this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,t.Browser.isDevice&&"mozilla"===t.Browser.info.name&&this.search(e)},s.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.expandTextbox(),t.search(e)})},s.prototype.search=function(e){var s=this;if(t.isNullOrUndefined(e)||(this.keyCode=e.keyCode),!this.isPopupOpen()&&this.openOnClick&&this.showPopup(),this.openClick(e),!this.checkTextLength()||this.allowFiltering||t.isNullOrUndefined(e)||8===e.keyCode){var l=this.targetElement();if(this.allowFiltering){var o={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,t,i){o.cancel||(s.isFiltered=!0,s.remoteFilterAction=!0,s.dataUpdater(e,t,i))},event:e,cancel:!1};this.trigger("filtering",o,function(e){e.cancel||s.isFiltered||e.preventDefaultAction||(s.filterAction=!0,s.dataUpdater(s.dataSource,null,s.fields))})}else if(this.allowCustomValue){var r=new i.Query;r=""!==l?r.where(this.fields.text,"startswith",l,this.ignoreCase,this.ignoreAccent):r,this.dataUpdater(this.mainData,r,this.fields)}else{var n=this.list.querySelectorAll("li."+k.li+":not(.e-hide-listitem)"),a=h(this.targetElement(),n,"StartsWith",this.ignoreCase);a&&null!==a.item?(this.addListFocus(a.item),this.list.scrollTop=a.item.offsetHeight*a.index):""!==this.targetElement()?this.removeFocus():this.focusAtFirstListItem()}}else this.focusAtFirstListItem()},s.prototype.preRender=function(){null===this.allowFiltering&&(this.allowFiltering="CheckBox"===this.mode),this.initializeData(),this.updateDataAttribute(this.htmlAttributes),e.prototype.preRender.call(this)},s.prototype.getLocaleName=function(){return"multi-select"},s.prototype.initializeData=function(){this.mainListCollection=[],this.beforePopupOpen=!1,this.filterAction=!1,this.remoteFilterAction=!1,this.isFirstClick=!1,this.mobFilter=!0,this.isFiltered=!1,this.focused=!0,this.initial=!0,this.backCommand=!0},s.prototype.updateData=function(e,i){var s,l="",o="Delimiter"===this.mode||"CheckBox"===this.mode,r=[],n=this.listData;if(this.listData=this.mainData,this.hiddenElement.innerHTML="",!t.isNullOrUndefined(this.value))for(var a=0;!t.isNullOrUndefined(this.value[a]);a++){var h=this.findListElement(t.isNullOrUndefined(this.mainList)?this.ulElement:this.mainList,"li","data-value",this.value[a]);t.isBlazor()&&this.isServerRendered||!t.isNullOrUndefined(h)||this.allowCustomValue?(l+=(s=this.listData?this.getTextByValue(this.value[a]):this.value[a])+e+" ",r.push(s)):(this.value.splice(a,1),a-=1),this.hiddenElement.innerHTML+='<option selected value ="'+this.value[a]+'">'+a+"</option>"}this.setProperties({text:r.toString()},!0),o&&(this.updateWrapperText(this.delimiterWrapper,l),this.delimiterWrapper.setAttribute("id",t.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.inputElement.setAttribute("aria-labelledby",this.delimiterWrapper.id));var p=i&&i.target,u=!(!p||!p.classList.contains("e-close-hooker"))||null;(!this.changeOnBlur&&i&&!u||this.isSelectAll)&&(this.isSelectAll=!1,this.updateValueState(i,this.value,this.tempValues)),this.listData=n,this.addValidInputClass()},s.prototype.initialTextUpdate=function(){if(t.isNullOrUndefined(this.text))this.setProperties({value:null},!0);else{for(var e=this.text.split(this.delimiterChar),i=[],s=0;e.length>s;s++){var l=this.getValueByText(e[s]);t.isNullOrUndefined(l)?this.allowCustomValue&&i.push(e[s]):i.push(l)}i&&i.length&&this.setProperties({value:i},!0)}},s.prototype.renderList=function(t){!t&&this.allowCustomValue&&this.list&&(this.list.textContent===this.noRecordsTemplate||this.list.querySelector(".e-ul")&&0===this.list.querySelector(".e-ul").childElementCount)&&(t=!0),e.prototype.render.call(this,t),this.unwireListEvents(),this.wireListEvents()},s.prototype.initialValueUpdate=function(){if(this.list){var e=void 0,i=void 0,s=void 0;if(this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.removeListSelection(),!t.isNullOrUndefined(this.value))for(var l=0;!t.isNullOrUndefined(this.value[l]);l++)if(s=this.value[l],i=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",s),e=this.getTextByValue(s),i&&"true"!==i.getAttribute("aria-selected")||i&&"true"===i.getAttribute("aria-selected")&&this.hideSelectedItem&&("Box"===this.mode||"Default"===this.mode))this.addChip(e,s),this.addListSelection(i);else if(s&&this.allowCustomValue){var o=this.listData.length,r={};t.setValue(this.fields.text,s,r),t.setValue(this.fields.value,s,r);var n=this.popupWrapper.querySelector("."+k.noData);this.addItem(r,o),this.popupWrapper.contains(n)&&(this.list.setAttribute("style",n.getAttribute("style")),this.popupWrapper.replaceChild(this.list,n),this.wireListEvents()),this.addChip(e,s),this.addListSelection(i)}"CheckBox"===this.mode?(this.updateDelimView(),this.changeOnBlur&&this.updateValueState(null,this.value,this.tempValues),this.updateDelimeter(this.delimiterChar),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar),"CheckBox"!==this.mode||!this.showSelectAll||!t.isNullOrUndefined(this.value)&&this.value.length||this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),"Box"===this.mode||"Default"===this.mode&&this.inputFocus?this.chipCollectionWrapper.style.display="":"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper()}},s.prototype.updateActionCompleteData=function(e,i){this.value&&this.value.indexOf(e.getAttribute("data-value"))>-1&&(this.mainList=this.ulElement,t.addClass([e],ne))},s.prototype.updateAddItemList=function(e,i){this.popupObj&&this.popupObj.element&&this.popupObj.element.querySelector("."+k.noData)&&e&&(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"),t.remove(this.popupWrapper.querySelector(".e-content")),this.popupObj=null,this.renderPopup())},s.prototype.updateDataList=function(){this.mainList&&this.ulElement&&this.mainList.childElementCount<this.ulElement.childElementCount&&(this.mainList=this.ulElement.cloneNode?this.ulElement.cloneNode(!0):this.ulElement)},s.prototype.isValidLI=function(e){return e&&!e.classList.contains(k.disabled)&&!e.classList.contains(k.group)&&e.classList.contains(k.li)},s.prototype.updateListSelection=function(e,i,s){var l=e.getAttribute("data-value"),o=this.getFormattedValue(l);this.allowCustomValue&&("false"!==l&&!1===o||!t.isNullOrUndefined(o)&&"NaN"===o.toString())&&(o=l),this.removeHover(),this.value&&-1!==this.value.indexOf(o)?this.removeValue(o,i,s):this.dispatchSelect(o,i,e,"true"===e.getAttribute("aria-selected"),s)},s.prototype.updateListSelectEventCallback=function(e,i,s){var l=this,o=this.getTextByValue(e);if(!this.allowCustomValue&&!this.allowFiltering||this.findListElement(this.mainList,"li","data-value",e))this.remoteCustomValue=!1,this.addValue(e,o,s);else{var r=i.cloneNode(!0),n=this.fields.value?this.fields.value:"value";this.allowCustomValue&&this.mainData.length&&"number"==typeof t.getValue(n,this.mainData[0])&&(e=isNaN(parseFloat(e.toString()))?e:parseFloat(e.toString()));var a=this.getDataByValue(e),h={newData:a,cancel:!1};this.trigger("customValueSelection",h,function(i){i.cancel||(t.append([r],l.mainList),l.mainData.push(a),l.remoteCustomValue=!1,l.addValue(e,o,s),t.isBlazor()&&l.isServerRendered&&(l.checkPlaceholderSize(),l.makeTextBoxEmpty()))})}t.isBlazor()&&this.isServerRendered&&this.value&&this.list&&(this.value.length===this.list.querySelectorAll("li.e-list-item").length||this.value.length===this.maximumSelectionLength)&&(this.updatedataValueItems(s),this.checkPlaceholderSize()),t.isBlazor()&&this.isServerRendered&&(this.checkPlaceholderSize(),this.makeTextBoxEmpty())},s.prototype.removeListSelection=function(){var e=this.hideSelectedItem?ne:k.selected,i=this.list.querySelectorAll("."+e),s=i.length;if(i&&i.length)for(t.removeClass(i,e);s>0;)i[s-1].setAttribute("aria-selected","false"),s--;if(!t.isNullOrUndefined(this.mainList)){var l=this.mainList.querySelectorAll("."+e),o=l.length;if(l&&l.length)for(t.removeClass(l,e);o>0;)l[o-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&(i&&i.length>o-1&&(i[o-1].firstElementChild.setAttribute("aria-checked","false"),t.removeClass([i[o-1].firstElementChild.lastElementChild],"e-check")),l[o-1].firstElementChild.setAttribute("aria-checked","false"),t.removeClass([l[o-1].firstElementChild.lastElementChild],"e-check")),o--}},s.prototype.removeHover=function(){var e=this.list.querySelectorAll("."+k.hover);e&&e.length&&t.removeClass(e,k.hover)},s.prototype.removeFocus=function(){if(this.list&&this.mainList){var e=this.list.querySelectorAll("."+k.focus),i=this.mainList.querySelectorAll("."+k.focus);e&&e.length&&(t.removeClass(e,k.focus),t.removeClass(i,k.focus))}},s.prototype.addListHover=function(e){this.enabled&&this.isValidLI(e)?(this.removeHover(),t.addClass([e],k.hover)):null!==e&&e.classList.contains("e-list-group-item")&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&(this.removeHover(),t.addClass([e],k.hover))},s.prototype.addListFocus=function(e){this.enabled&&this.isValidLI(e)?(this.removeFocus(),t.addClass([e],k.focus)):this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&t.addClass([e],k.focus)},s.prototype.addListSelection=function(e){var i=this.hideSelectedItem?ne:k.selected;if(this.isValidLI(e)&&!e.classList.contains(k.hover)){if(t.addClass([e],i),this.updateMainList(!1,e.getAttribute("data-value")),e.setAttribute("aria-selected","true"),"CheckBox"===this.mode){var s=e.firstElementChild.getAttribute("aria-checked");("false"===s||t.isNullOrUndefined(s))&&this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this})}this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this}),this.chipCollectionWrapper&&this.removeChipSelection(),t.attributes(this.inputElement,{"aria-activedescendant":e.id})}},s.prototype.updateDelimeter=function(e,t){this.updateData(e,t)},s.prototype.onMouseClick=function(e){var i=this;this.keyCode=null,this.scrollFocusStatus=!1;var s=e.target,l=t.closest(s,"."+k.li);if(t.closest(s,"."+k.group)&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&this.fields.groupBy)(s=s.classList.contains("e-list-group-item")?s.firstElementChild.lastElementChild:e.target).classList.contains("e-check")?(this.selectAllItem(!1,e),s.classList.remove("e-check"),s.classList.remove("e-stop"),t.closest(s,".e-list-group-item").classList.remove("e-active"),s.setAttribute("aria-selected","false")):(this.selectAllItem(!0,e),s.classList.remove("e-stop"),s.classList.add("e-check"),t.closest(s,".e-list-group-item").classList.add("e-active"),s.setAttribute("aria-selected","true")),this.refreshSelection(),this.checkSelectAll();else{if(this.isValidLI(l)){var o=this.value&&this.value.length?this.value.length:0;l.classList.contains("e-active")&&(o-=1),o<this.maximumSelectionLength&&(this.updateListSelection(l,e),this.checkPlaceholderSize(),this.addListFocus(l),(this.allowCustomValue||this.allowFiltering)&&this.mainList&&this.listData?"CheckBox"!==this.mode&&(this.focusAtLastListItem(l.getAttribute("data-value")),this.refreshSelection()):this.makeTextBoxEmpty()),"CheckBox"===this.mode?(this.updateDelimView(),this.value&&this.value.length>50?setTimeout(function(){i.updateDelimeter(i.delimiterChar,e)},0):this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.checkSelectAll(),this.refreshPopup(),this.hideSelectedItem&&this.focusAtFirstListItem(),this.closePopupOnSelect?this.hidePopup():e.preventDefault(),this.makeTextBoxEmpty(),this.findGroupStart(s)}else e.preventDefault();"CheckBox"!==this.mode&&this.refreshListItems(t.isNullOrUndefined(l)?null:l.textContent),this.refreshPlaceHolder(),this.deselectHeader()}},s.prototype.findGroupStart=function(e){if(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)){var i=void 0;if(this.itemTemplate&&!e.getElementsByClassName("e-frame").length)for(;!e.getElementsByClassName("e-frame").length;)e=e.parentElement;for(e.classList.contains("e-frame")&&(e=e.parentElement.parentElement),i=this.findGroupAttrtibutes(e,0,0,0,0),i=this.findGroupAttrtibutes(e,i[0],i[1],i[2],1);!e.classList.contains("e-list-group-item")&&(e.classList.contains("e-list-icon")&&(e=e.parentElement),null!=(e=e.previousElementSibling)););this.updateCheckBox(e,i[0],i[1],i[2])}},s.prototype.findGroupAttrtibutes=function(e,t,i,s,l){for(;!e.classList.contains("e-list-group-item")&&(e.classList.contains("e-list-icon")&&(e=e.parentElement),e.getElementsByClassName("e-frame")[0].classList.contains("e-check")&&e.classList.contains("e-list-item")?t++:e.classList.contains("e-list-item")&&i++,s++,null!=(e=l?e.nextElementSibling:e.previousElementSibling)););return[t,i,s]},s.prototype.updateCheckBox=function(e,i,s,l){if(null!==e){var o=e.getElementsByClassName("e-frame")[0];l===i?(o.classList.remove("e-stop"),o.classList.add("e-check"),t.closest(o,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","true")):l===s?(o.classList.remove("e-check"),o.classList.remove("e-stop"),t.closest(o,".e-list-group-item").classList.remove("e-active"),e.setAttribute("aria-selected","false")):this.maximumSelectionLength===i-1?(o.classList.remove("e-stop"),e.setAttribute("aria-selected","true"),t.closest(o,".e-list-group-item").classList.add("e-active"),o.classList.add("e-check")):(o.classList.remove("e-check"),o.classList.add("e-stop"),t.closest(o,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","false"))}},s.prototype.deselectHeader=function(){var e=this.value&&this.value.length?this.value.length:0,i=this.list.querySelectorAll("li.e-list-group-item:not(.e-active)");e<this.maximumSelectionLength&&t.removeClass(i,"e-disable"),e===this.maximumSelectionLength&&t.addClass(i,"e-disable")},s.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+k.li);null===i&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)&&this.enableGroupCheckBox&&(i=t.closest(e.target,"."+k.group)),this.addListHover(i)},s.prototype.onMouseLeave=function(){this.removeHover()},s.prototype.onListMouseDown=function(e){e.preventDefault(),this.scrollFocusStatus=!0},s.prototype.onDocumentClick=function(e){if("CheckBox"!==this.mode){var i=e.target;!t.isNullOrUndefined(this.popupObj)&&t.closest(i,'[id="'+this.popupObj.element.id+'"]')||this.overAllWrapper.contains(e.target)?this.scrollFocusStatus=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.inputElement:this.scrollFocusStatus=!1}},s.prototype.wireListEvents=function(){t.EventHandler.add(document,"mousedown",this.onDocumentClick,this),t.EventHandler.add(this.list,"mousedown",this.onListMouseDown,this),t.EventHandler.add(this.list,"mouseup",this.onMouseClick,this),t.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},s.prototype.unwireListEvents=function(){t.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.list&&(t.EventHandler.remove(this.list,"mousedown",this.onListMouseDown),t.EventHandler.remove(this.list,"mouseup",this.onMouseClick),t.EventHandler.remove(this.list,"mouseover",this.onMouseOver),t.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},s.prototype.hideOverAllClear=function(){this.value&&this.value.length&&""!==this.inputElement.value||(this.overAllClear.style.display="none")},s.prototype.showOverAllClear=function(){(this.value&&this.value.length||""!==this.inputElement.value)&&this.showClearButton&&!0!==this.readonly?this.overAllClear.style.display="":this.overAllClear.style.display="none"},s.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},s.prototype.focusOut=function(){document.activeElement===this.inputElement&&this.enabled&&this.inputElement.blur()},s.prototype.showSpinner=function(){t.isNullOrUndefined(this.spinnerElement)&&("none"!==this.overAllClear.style.display?this.spinnerElement=this.overAllClear:(this.spinnerElement=this.createElement("span",{className:"e-chips-close e-close-hooker e-ms-spinner-icon"}),this.componentWrapper.appendChild(this.spinnerElement)),l.createSpinner({target:this.spinnerElement,width:t.Browser.isDevice?"16px":"14px"},this.createElement),t.addClass([this.spinnerElement],"e-ddl-disable-icon"),l.showSpinner(this.spinnerElement))},s.prototype.hideSpinner=function(){t.isNullOrUndefined(this.spinnerElement)||(l.hideSpinner(this.spinnerElement),t.removeClass([this.spinnerElement],"e-ddl-disable-icon"),this.spinnerElement.classList.contains("e-ms-spinner-icon")?t.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},s.prototype.updateWrapperText=function(e,i){this.valueTemplate||!this.enableHtmlSanitizer?e.innerHTML=i:e.innerText=t.SanitizeHtmlHelper.sanitize(i)},s.prototype.updateDelimView=function(){if(this.delimiterWrapper&&this.hideDelimWrapper(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.style.display="none"),this.viewWrapper.style.display="",this.viewWrapper.style.width="",this.viewWrapper.classList.remove("e-delim-total"),this.value&&this.value.length){var e="",i=void 0,s=void 0,l=1,o=void 0,r=void 0,n=0,a=void 0;this.updateWrapperText(this.viewWrapper,e);var h={noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed",overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},p=new t.L10n(this.getLocaleName(),h,this.locale);""===p.getConstant("actionFailureTemplate")&&(p=new t.L10n("dropdowns",h,this.locale)),""===p.getConstant("noRecordsTemplate")&&(p=new t.L10n("dropdowns",h,this.locale));var u=p.getConstant("overflowCountTemplate"),c=this.createElement("span",{className:"e-remain"}),d=t.compile(u),m=t.compile(p.getConstant("totalCountTemplate")),f=d({count:this.value.length},this,"overflowCountTemplate",null,!this.isStringTemplate,null,c);f&&f.length>0&&c.appendChild(f[0]),this.viewWrapper.appendChild(c),this.renderReactTemplates();var v=c.offsetWidth;if(t.remove(c),this.showDropDownIcon&&(n=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10)),this.checkClearIconWidth(),!t.isNullOrUndefined(this.value))for(var y=0;!t.isNullOrUndefined(this.value[y]);y++){if(e+=0===y?"":this.delimiterChar+" ",i=this.getOverflowVal(y),e+=i,i=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e),o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10),a=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),o+n+this.clearIconWidth>a){for(void 0!==s&&""!==s&&(i=s,y=l+1),this.updateWrapperText(this.viewWrapper,i),r=this.value.length-y,o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);o+v+n+this.clearIconWidth>a&&0!==o&&""!==this.viewWrapper.innerHTML;){var g=this.viewWrapper.innerHTML.split(this.delimiterChar);g.pop(),this.viewWrapper.innerHTML=g.join(this.delimiterChar),r++,o=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10)}break}o+v+n+this.clearIconWidth<=a?(s=e,l=y):0===y&&(s="",l=-1)}if(r>0){var C=a-n-this.clearIconWidth;this.viewWrapper.appendChild(this.updateRemainTemplate(c,this.viewWrapper,r,d,m,C)),this.updateRemainWidth(this.viewWrapper,C),this.updateRemainingText(c,n,r,d,m)}}else this.viewWrapper.innerHTML="",this.viewWrapper.style.display="none"},s.prototype.checkClearIconWidth=function(){this.showClearButton&&(this.clearIconWidth=this.overAllClear.offsetWidth)},s.prototype.updateRemainWidth=function(e,t){e.classList.contains("e-delim-total")&&t<e.offsetWidth+parseInt(window.getComputedStyle(e).paddingLeft,10)+parseInt(window.getComputedStyle(e).paddingLeft,10)&&(e.style.width=t+"px")},s.prototype.updateRemainTemplate=function(e,t,i,s,l,o){t.firstChild&&3===t.firstChild.nodeType&&""===t.firstChild.nodeValue&&t.removeChild(t.firstChild),e.innerHTML="";var r=s({count:i},this,"overflowCountTemplate",null,!this.isStringTemplate,null,e),n=l({count:i},this,"totalCountTemplate",null,!this.isStringTemplate,null,e);return e.appendChild(t.firstChild&&3===t.firstChild.nodeType?r&&r[0]:n&&n[0]),t.firstChild&&3===t.firstChild.nodeType?t.classList.remove("e-delim-total"):(t.classList.add("e-delim-total"),this.updateRemainWidth(t,o)),e},s.prototype.updateRemainingText=function(e,t,i,s,l){var o=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),r=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);if(r+t>=o&&0!==r&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType){for(;r+t>o&&0!==r&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType;){var n=this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);n.pop(),this.viewWrapper.firstChild.nodeValue=n.join(this.delimiterChar),""===this.viewWrapper.firstChild.nodeValue&&this.viewWrapper.removeChild(this.viewWrapper.firstChild),i++,r=this.viewWrapper.offsetWidth}var a=o-t;this.updateRemainTemplate(e,this.viewWrapper,i,s,l,a)}},s.prototype.getOverflowVal=function(e){var t;if(this.mainData&&this.mainData.length)if("CheckBox"===this.mode){var i=this.listData;this.listData=this.mainData,t=this.getTextByValue(this.value[e]),this.listData=i}else t=this.getTextByValue(this.value[e]);else t=this.value[e];return t},s.prototype.unWireEvent=function(){t.EventHandler.remove(this.componentWrapper,"mousedown",this.wrapperClick),t.EventHandler.remove(window,"resize",this.windowResize),t.EventHandler.remove(this.inputElement,"focus",this.focusInHandler),t.EventHandler.remove(this.inputElement,"keydown",this.onKeyDown),"CheckBox"!==this.mode&&t.EventHandler.remove(this.inputElement,"input",this.onInput),t.EventHandler.remove(this.inputElement,"keyup",this.keyUp);var e=t.closest(this.inputElement,"form");e&&t.EventHandler.remove(e,"reset",this.resetValueHandler),t.EventHandler.remove(this.inputElement,"blur",this.onBlur),t.EventHandler.remove(this.componentWrapper,"mousemove",this.mouseIn),t.EventHandler.remove(this.componentWrapper,"mouseout",this.mouseOut),t.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),t.EventHandler.remove(this.inputElement,"paste",this.pasteHandler)},s.prototype.selectAllItem=function(e,i,s){var l;if(l=this.list.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)'),this.value&&this.value.length&&i&&i.target&&t.closest(i.target,".e-close-hooker")&&this.allowFiltering&&(l=this.mainList.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')),this.enableGroupCheckBox&&"CheckBox"===this.mode&&!t.isNullOrUndefined(this.fields.groupBy)){var o=i?i.target:null;if(o=i&&32===i.keyCode?s:o,(o=o&&o.classList.contains("e-frame")?o.parentElement.parentElement:o)&&o.classList.contains("e-list-group-item")){var r=o.nextElementSibling;if(t.isNullOrUndefined(r))return;for(;r.classList.contains("e-list-item");){if(e){if(!r.firstElementChild.lastElementChild.classList.contains("e-check")){var n=this.value&&this.value.length?this.value.length:0;r.classList.contains("e-active")&&(n-=1),n<this.maximumSelectionLength&&this.updateListSelection(r,i)}}else r.firstElementChild.lastElementChild.classList.contains("e-check")&&this.updateListSelection(r,i);if(null==(r=r.nextElementSibling))break}if(o.classList.contains("e-list-group-item")){var a=this.list.getElementsByClassName("e-item-focus")[0];a&&a.classList.remove("e-item-focus"),e?o.classList.add("e-active"):o.classList.remove("e-active"),o.classList.add("e-item-focus")}this.textboxValueUpdate(),this.checkPlaceholderSize(),!this.changeOnBlur&&i&&this.updateValueState(i,this.value,this.tempValues)}else this.updateValue(i,l,e)}else this.updateValue(i,l,e)},s.prototype.updateValue=function(e,i,s){var l=this,o=i.length;if(i&&i.length){var r=0,n=0;for(n=this.enableGroupCheckBox?s?this.maximumSelectionLength-(this.value?this.value.length:0):i.length:s?this.maximumSelectionLength-(this.value?this.value.length:0):this.maximumSelectionLength;r<o&&r<=50&&r<n;)this.updateListSelection(i[r],e,o-r),this.enableGroupCheckBox&&this.findGroupStart(i[r]),r++;o>50&&setTimeout(function(){for(;r<o&&r<n;)l.updateListSelection(i[r],e,o-r),l.enableGroupCheckBox&&l.findGroupStart(i[r]),r++;t.isBlazor()&&l.isServerRendered||(l.updatedataValueItems(e),l.changeOnBlur||(l.updateValueState(e,l.value,l.tempValues),l.isSelectAll=l.isSelectAll?!l.isSelectAll:l.isSelectAll),l.updateHiddenElement())},0)}t.isBlazor()&&this.isServerRendered||(this.updatedataValueItems(e),this.checkPlaceholderSize(),o<=50&&(this.changeOnBlur||(this.updateValueState(e,this.value,this.tempValues),this.isSelectAll=this.isSelectAll?!this.isSelectAll:this.isSelectAll),this.updateHiddenElement()))},s.prototype.updateHiddenElement=function(){var e=this,i="",s="",l="",o=[];"CheckBox"===this.mode&&(this.value.map(function(t,r){i+='<option selected value ="'+t+'">'+r+"</option>",l=e.listData?e.getTextByValue(t):t,s+=l+e.delimiterChar+" ",o.push(l)}),this.hiddenElement.innerHTML=i,this.updateWrapperText(this.delimiterWrapper,s),this.delimiterWrapper.setAttribute("id",t.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.inputElement.setAttribute("aria-labelledby",this.delimiterWrapper.id),this.setProperties({text:o.toString()},!0),this.refreshInputHight(),this.refreshPlaceHolder())},s.prototype.updatedataValueItems=function(e){this.deselectHeader(),this.textboxValueUpdate(e)},s.prototype.textboxValueUpdate=function(e){var i=e&&e.target&&(t.closest(e.target,".e-selectall-parent")||t.closest(e.target,".e-close-hooker"));"Box"===this.mode||this.isPopupOpen()||"CheckBox"===this.mode&&(this.isSelectAll||i)?this.searchWrapper.classList.remove("e-zero-size"):this.updateDelimView(),"CheckBox"===this.mode?(this.updateDelimView(),i||this.isSelectAll||this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.refreshPlaceHolder()},s.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},s.prototype.updateDataSource=function(e){t.isNullOrUndefined(this.list)?this.renderPopup():this.resetList(this.dataSource),!this.value||!this.value.length||t.isBlazor()&&this.isServerRendered||(this.setProperties({value:this.value}),this.refreshSelection())},s.prototype.onLoadSelect=function(){this.setDynValue=!0,this.renderPopup()},s.prototype.selectAllItems=function(i,s){var l=this;if(t.isNullOrUndefined(this.list))this.selectAllAction=function(){if("CheckBox"===l.mode&&l.showSelectAll){var e={module:"CheckBoxSelection",enable:"CheckBox"===l.mode,value:i?"check":"uncheck"};l.notify("checkSelectAll",e)}l.selectAllItem(i,s),l.selectAllAction=null},e.prototype.render.call(this);else{if(this.selectAllAction=null,"CheckBox"===this.mode&&this.showSelectAll){var o={value:i?"check":"uncheck",enable:"CheckBox"===this.mode,module:"CheckBoxSelection"};this.notify("checkSelectAll",o)}this.selectAllItem(i,s)}},s.prototype.getPersistData=function(){return this.addOnPersist(["value"])},s.prototype.onPropertyChanged=function(i,s){(i.dataSource&&!t.isNullOrUndefined(Object.keys(i.dataSource))||i.query&&!t.isNullOrUndefined(Object.keys(i.query)))&&(this.mainList=null,this.mainData=null,this.isFirstClick=!1,this.isDynamicDataChange=!0),"multiselect"===this.getModuleName()&&(this.filterAction=!1,this.setUpdateInitial(["fields","query","dataSource"],i));for(var l=0,o=Object.keys(i);l<o.length;l++){var r=o[l];switch(r){case"query":case"dataSource":"CheckBox"===this.mode&&this.showSelectAll&&(t.isNullOrUndefined(this.popupObj)||(this.popupObj.destroy(),this.popupObj=null),this.renderPopup());break;case"htmlAttributes":this.updateHTMLAttribute();break;case"showClearButton":this.updateClearButton(i.showClearButton);break;case"text":this.updateVal(this.value,this.value,"text");break;case"value":this.updateVal(this.value,s.value,"value"),this.addValidInputClass(),!this.closePopupOnSelect&&this.isPopupOpen()&&this.refreshPopup(),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"width":this.setWidth(i.width),this.popupObj.setProperties({width:this.calcPopupWidth()});break;case"placeholder":this.refreshPlaceHolder();break;case"filterBarPlaceholder":this.allowFiltering&&this.notify("filterBarPlaceholder",{filterBarPlaceholder:i.filterBarPlaceholder});break;case"delimiterChar":"Box"!==this.mode&&this.updateDelimView(),this.updateData(i.delimiterChar);break;case"cssClass":this.updateOldPropCssClass(s.cssClass),this.updateCssClass();break;case"enableRtl":this.enableRTL(i.enableRtl),e.prototype.onPropertyChanged.call(this,i,s);break;case"readonly":this.updateReadonly(i.readonly),this.hidePopup();break;case"enabled":this.hidePopup(),this.enable(i.enabled);break;case"showSelectAll":this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup();break;case"showDropDownIcon":this.dropDownIcon();break;case"floatLabelType":this.setFloatLabelType(),this.addValidInputClass();break;case"enableSelectionOrder":break;case"selectAllText":this.notify("selectAllText",!1);break;case"popupHeight":case"headerTemplate":case"footerTemplate":this.reInitializePoup();break;case"allowFiltering":"CheckBox"===this.mode&&this.popupObj&&this.reInitializePoup(),this.updateSelectElementData(this.allowFiltering);break;default:var n=this.getPropObject(r,i,s);e.prototype.onPropertyChanged.call(this,n.newProperty,n.oldProperty)}}},s.prototype.reInitializePoup=function(){this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup()},s.prototype.updateVal=function(e,s,l){this.list&&(!(this.dataSource instanceof i.DataManager)||this.listData&&this.mainList&&this.mainData)?("text"===l&&(this.initialTextUpdate(),e=this.value),(t.isNullOrUndefined(this.value)||0===this.value.length)&&(this.tempValues=s),this.initialValueUpdate(),"Box"===this.mode||this.inputFocus||this.updateDelimView(),this.inputFocus||this.refreshInputHight(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,e,s),this.checkPlaceholderSize()):this.onLoadSelect(),this.changeOnBlur||this.updateValueState(null,e,s)},s.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},s.prototype.hidePopup=function(){var e=this;if(this.isPopupOpen()){var i={name:"FadeOut",duration:100,delay:100},s={popup:this.popupObj,cancel:!1,animation:i};this.trigger("close",s,function(i){i.cancel||(e.fields.groupBy&&"CheckBox"!==e.mode&&e.fixedHeaderElement&&(t.remove(e.fixedHeaderElement),e.fixedHeaderElement=null),e.beforePopupOpen=!1,e.overAllWrapper.classList.remove("e-icon-anim"),e.popupObj.hide(new t.Animation(i.animation)),t.attributes(e.inputElement,{"aria-expanded":"false"}),e.allowFiltering&&e.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===e.mode,value:"clear"}),e.popupObj.hide(),t.removeClass([document.body,e.popupObj.element],"e-popup-full-page"),t.EventHandler.remove(e.list,"keydown",e.onKeyDown))})}},s.prototype.showPopup=function(){var i=this;if(this.enabled){var s={cancel:!1};this.trigger("beforeOpen",s,function(s){if(!s.cancel){if(t.isBlazor()&&i.isServerRendered&&i.itemTemplate&&(i.DropDownBaseupdateBlazorTemplates(!0,!1,!1,!1,!1,!1,!1,!1),"CheckBox"!==i.mode&&i.list&&i.refreshSelection()),!i.ulElement)return i.beforePopupOpen=!0,e.prototype.render.call(i),void("CheckBox"===i.mode&&t.Browser.isDevice&&i.allowFiltering&&i.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode}));"CheckBox"===i.mode&&t.Browser.isDevice&&i.allowFiltering&&i.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode});var l=i.ulElement.querySelectorAll("li.e-list-item").length,o=i.ulElement.querySelectorAll("li."+k.li+"."+ne).length;if(l>0&&l===o&&o===i.mainData.length)return void(i.beforePopupOpen=!1);i.onPopupShown()}})}},s.prototype.selectAll=function(e){this.isSelectAll=!0,this.selectAllItems(e)},s.prototype.getModuleName=function(){return"multiselect"},s.prototype.clear=function(){var e=this;this.selectAll(!1),this.value&&this.value.length?setTimeout(function(){e.setProperties({value:null},!0)},0):this.setProperties({value:null},!0)},s.prototype.render=function(){this.setDynValue=this.initStatus=!1,this.isSelectAll=!1,this.searchWrapper=this.createElement("span",{className:"e-searcher "+("Box"===this.mode?"e-multiselect-box":"")}),this.viewWrapper=this.createElement("span",{className:"e-delim-view e-delim-values",styles:"display:none;"}),this.overAllClear=this.createElement("span",{className:"e-chips-close e-close-hooker",styles:"display:none;"}),this.componentWrapper=this.createElement("div",{className:"e-multi-select-wrapper"}),this.overAllWrapper=this.createElement("div",{className:"e-multiselect e-input-group e-control-wrapper"}),"CheckBox"===this.mode&&t.addClass([this.overAllWrapper],"e-checkbox"),t.Browser.isDevice&&this.componentWrapper.classList.add("e-mob-wrapper"),this.setWidth(this.width),this.overAllWrapper.appendChild(this.componentWrapper),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:"e-ddl e-popup e-multi-select-list-wrapper"}),"Delimiter"===this.mode||"CheckBox"===this.mode?(this.delimiterWrapper=this.createElement("span",{className:"e-delim-values",styles:"display:none"}),this.componentWrapper.appendChild(this.delimiterWrapper)):(this.chipCollectionWrapper=this.createElement("span",{className:"e-chips-collection",styles:"display:none"}),"Default"===this.mode?this.chipCollectionWrapper.setAttribute("id",t.getUniqueID("chip_default")):"Box"===this.mode&&this.chipCollectionWrapper.setAttribute("id",t.getUniqueID("chip_box")),this.componentWrapper.appendChild(this.chipCollectionWrapper)),"Box"!==this.mode&&this.componentWrapper.appendChild(this.viewWrapper),this.componentWrapper.appendChild(this.searchWrapper),this.showClearButton&&!t.Browser.isDevice?this.componentWrapper.appendChild(this.overAllClear):this.componentWrapper.classList.add("e-close-icon-hide"),this.dropDownIcon(),this.inputElement=this.createElement("input",{className:"e-dropdownbase",attrs:{spellcheck:"false",type:"text",autocomplete:"off",tabindex:"0"}}),"Default"!==this.mode&&"Box"!==this.mode||(this.inputElement.setAttribute("aria-describedby",this.chipCollectionWrapper.id),this.inputElement.setAttribute("aria-labelledby",this.chipCollectionWrapper.id)),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.tagName===this.getNgDirective()?(this.element.appendChild(this.overAllWrapper),this.searchWrapper.appendChild(this.inputElement)):(this.element.parentElement.insertBefore(this.overAllWrapper,this.element),this.searchWrapper.appendChild(this.inputElement),this.searchWrapper.appendChild(this.element),this.element.removeAttribute("tabindex")),"Never"!==this.floatLabelType?d(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder):"Never"===this.floatLabelType&&this.refreshPlaceHolder(),this.addValidInputClass(),this.element.style.opacity="";var e=this.element.getAttribute("id")?this.element.getAttribute("id"):t.getUniqueID("ej2_dropdownlist");this.element.id=e,this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-multi-hidden",tabindex:"-1",multiple:""}}),this.componentWrapper.appendChild(this.hiddenElement),this.validationAttribute(this.element,this.hiddenElement),"CheckBox"!==this.mode&&this.hideOverAllClear(),this.wireEvent(),this.enable(this.enabled),this.enableRTL(this.enableRtl),this.checkInitialValue(),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete()},s.prototype.checkInitialValue=function(){var e=this,s=this.dataSource instanceof Array?this.dataSource.length>0:!t.isNullOrUndefined(this.dataSource);if((!this.value||!this.value.length)&&t.isNullOrUndefined(this.text)&&!s&&"SELECT"===this.element.tagName&&this.element.options.length>0){for(var l=this.element.options,o=[],r="",n=0,a=l.length;n<a;n++){var h=l[n];t.isNullOrUndefined(h.getAttribute("selected"))||(h.getAttribute("value")?o.push(h.getAttribute("value")):r+=h.text+this.delimiterChar)}o.length>0?this.setProperties({value:o},!0):""!==r&&this.setProperties({text:r},!0),(o.length>0||""!==r)&&(this.refreshInputHight(),this.refreshPlaceHolder())}(this.value&&this.value.length||!t.isNullOrUndefined(this.text))&&this.renderPopup(),t.isNullOrUndefined(this.text)||!t.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.value&&this.value.length?(this.dataSource instanceof i.DataManager?this.setInitialValue=function(){e.initStatus=!1,e.initialValueUpdate(),e.initialUpdate(),e.setInitialValue=null,e.initStatus=!0}:(this.initialValueUpdate(),this.initialUpdate()),this.updateTempValue()):this.initialUpdate(),this.initStatus=!0,this.checkAutoFocus(),t.isNullOrUndefined(this.text)||this.element.setAttribute("data-initial-value",this.text)},s.prototype.checkAutoFocus=function(){this.element.hasAttribute("autofocus")&&this.inputElement.focus()},s.prototype.setFloatLabelType=function(){f(this.overAllWrapper,this.componentWrapper,this.searchWrapper,this.inputElement,this.value,this.floatLabelType,this.placeholder),"Never"!==this.floatLabelType&&d(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder)},s.prototype.addValidInputClass=function(){!t.isNullOrUndefined(this.value)&&this.value.length||"Always"===this.floatLabelType?t.addClass([this.overAllWrapper],"e-valid-input"):t.removeClass([this.overAllWrapper],"e-valid-input")},s.prototype.dropDownIcon=function(){this.showDropDownIcon?(this.dropIcon=this.createElement("span",{className:"e-input-group-icon e-ddl-icon"}),this.componentWrapper.appendChild(this.dropIcon),t.addClass([this.componentWrapper],["e-down-icon"])):t.isNullOrUndefined(this.dropIcon)||(this.dropIcon.parentElement.removeChild(this.dropIcon),t.removeClass([this.componentWrapper],["e-down-icon"]))},s.prototype.initialUpdate=function(){"Box"===this.mode||this.setDynValue&&"Default"===this.mode&&this.inputFocus||this.updateDelimView(),this.updateCssClass(),this.updateHTMLAttribute(),this.updateReadonly(this.readonly),this.refreshInputHight(),this.checkPlaceholderSize()},s.prototype.destroy=function(){this.isReact&&this.clearTemplate(),this.popupObj&&this.popupObj.hide(),this.notify("destroy",{}),this.unwireListEvents(),this.unWireEvent(),this.list=null,this.popupObj=null,this.mainList=null,this.mainData=null,this.filterParent=null,this.ulElement=null,e.prototype.destroy.call(this);for(var i=["readonly","aria-disabled","aria-placeholder","placeholder"],s=i.length;s>0;)this.inputElement.removeAttribute(i[s-1]),s--;this.element.removeAttribute("data-initial-value"),this.element.style.display="block",this.overAllWrapper.parentElement&&(this.overAllWrapper.parentElement.tagName===this.getNgDirective()?t.remove(this.overAllWrapper):(this.overAllWrapper.parentElement.insertBefore(this.element,this.overAllWrapper),t.remove(this.overAllWrapper)))},oe([t.Complex({text:null,value:null,iconCss:null,groupBy:null},A)],s.prototype,"fields",void 0),oe([t.Property(!1)],s.prototype,"enablePersistence",void 0),oe([t.Property(null)],s.prototype,"groupTemplate",void 0),oe([t.Property("No records found")],s.prototype,"noRecordsTemplate",void 0),oe([t.Property("Request failed")],s.prototype,"actionFailureTemplate",void 0),oe([t.Property("None")],s.prototype,"sortOrder",void 0),oe([t.Property(!0)],s.prototype,"enabled",void 0),oe([t.Property(!1)],s.prototype,"enableHtmlSanitizer",void 0),oe([t.Property([])],s.prototype,"dataSource",void 0),oe([t.Property(null)],s.prototype,"query",void 0),oe([t.Property("StartsWith")],s.prototype,"filterType",void 0),oe([t.Property(1e3)],s.prototype,"zIndex",void 0),oe([t.Property(!1)],s.prototype,"ignoreAccent",void 0),oe([t.Property()],s.prototype,"locale",void 0),oe([t.Property(!1)],s.prototype,"enableGroupCheckBox",void 0),oe([t.Property(null)],s.prototype,"cssClass",void 0),oe([t.Property("100%")],s.prototype,"width",void 0),oe([t.Property("300px")],s.prototype,"popupHeight",void 0),oe([t.Property("100%")],s.prototype,"popupWidth",void 0),oe([t.Property(null)],s.prototype,"placeholder",void 0),oe([t.Property(null)],s.prototype,"filterBarPlaceholder",void 0),oe([t.Property({})],s.prototype,"htmlAttributes",void 0),oe([t.Property(null)],s.prototype,"valueTemplate",void 0),oe([t.Property(null)],s.prototype,"headerTemplate",void 0),oe([t.Property(null)],s.prototype,"footerTemplate",void 0),oe([t.Property(null)],s.prototype,"itemTemplate",void 0),oe([t.Property(null)],s.prototype,"allowFiltering",void 0),oe([t.Property(!0)],s.prototype,"changeOnBlur",void 0),oe([t.Property(!1)],s.prototype,"allowCustomValue",void 0),oe([t.Property(!0)],s.prototype,"showClearButton",void 0),oe([t.Property(1e3)],s.prototype,"maximumSelectionLength",void 0),oe([t.Property(!1)],s.prototype,"readonly",void 0),oe([t.Property(null)],s.prototype,"text",void 0),oe([t.Property(null)],s.prototype,"value",void 0),oe([t.Property(!0)],s.prototype,"hideSelectedItem",void 0),oe([t.Property(!0)],s.prototype,"closePopupOnSelect",void 0),oe([t.Property("Default")],s.prototype,"mode",void 0),oe([t.Property(",")],s.prototype,"delimiterChar",void 0),oe([t.Property(!0)],s.prototype,"ignoreCase",void 0),oe([t.Property(!1)],s.prototype,"showDropDownIcon",void 0),oe([t.Property("Never")],s.prototype,"floatLabelType",void 0),oe([t.Property(!1)],s.prototype,"showSelectAll",void 0),oe([t.Property("Select All")],s.prototype,"selectAllText",void 0),oe([t.Property("Unselect All")],s.prototype,"unSelectAllText",void 0),oe([t.Property(!0)],s.prototype,"enableSelectionOrder",void 0),oe([t.Property(!0)],s.prototype,"openOnClick",void 0),oe([t.Event()],s.prototype,"change",void 0),oe([t.Event()],s.prototype,"removing",void 0),oe([t.Event()],s.prototype,"removed",void 0),oe([t.Event()],s.prototype,"selectedAll",void 0),oe([t.Event()],s.prototype,"beforeOpen",void 0),oe([t.Event()],s.prototype,"open",void 0),oe([t.Event()],s.prototype,"close",void 0),oe([t.Event()],s.prototype,"blur",void 0),oe([t.Event()],s.prototype,"focus",void 0),oe([t.Event()],s.prototype,"chipSelection",void 0),oe([t.Event()],s.prototype,"filtering",void 0),oe([t.Event()],s.prototype,"tagging",void 0),oe([t.Event()],s.prototype,"customValueSelection",void 0),s=oe([t.NotifyPropertyChanges],s)}(B),pe=function(){function e(e){this.activeLi=[],this.activeEle=[],this.parent=e,this.removeEventListener(),this.addEventListener()}return e.prototype.getModuleName=function(){return"CheckBoxSelection"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("updatelist",this.listSelection,this),this.parent.on("listoption",this.listOption,this),this.parent.on("selectAll",this.setSelectAll,this),this.parent.on("checkSelectAll",this.checkSelectAll,this),this.parent.on("searchBox",this.setSearchBox,this),this.parent.on("blur",this.onBlur,this),this.parent.on("targetElement",this.targetElement,this),this.parent.on("deviceSearchBox",this.setDeviceSearchBox,this),this.parent.on("inputFocus",this.getFocus,this),this.parent.on("reOrder",this.setReorder,this),this.parent.on("activeList",this.getActiveList,this),this.parent.on("selectAllText",this.setLocale,this),this.parent.on("filterBarPlaceholder",this.setPlaceholder,this),t.EventHandler.add(document,"mousedown",this.onDocumentClick,this),this.parent.on("addItem",this.checboxCreate,this),this.parent.on("popupFullScreen",this.setPopupFullScreen,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updatelist",this.listSelection),this.parent.off("listoption",this.listOption),this.parent.off("selectAll",this.setSelectAll),this.parent.off("checkSelectAll",this.checkSelectAll),this.parent.off("searchBox",this.setSearchBox),this.parent.off("blur",this.onBlur),this.parent.off("targetElement",this.targetElement),this.parent.off("deviceSearchBox",this.setDeviceSearchBox),this.parent.off("inputFocus",this.getFocus),this.parent.off("reOrder",this.setReorder),this.parent.off("activeList",this.getActiveList),this.parent.off("selectAllText",this.setLocale),this.parent.off("filterBarPlaceholder",this.setPlaceholder),this.parent.off("addItem",this.checboxCreate),this.parent.off("popupFullScreen",this.setPopupFullScreen))},e.prototype.listOption=function(e){var i=this;if(t.isNullOrUndefined(this.parent.listCurrentOptions.itemCreated))this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e)};else{var s=this.parent.listCurrentOptions.itemCreated;this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e),s.apply(i,[e])}}},e.prototype.setPlaceholder=function(e){o.Input.setPlaceholder(e.filterBarPlaceholder,this.filterInput)},e.prototype.checboxCreate=function(e){var i;if(i=t.isNullOrUndefined(e.item)?e:e.item,this.parent.enableGroupCheckBox||"e-list-group-item "!==i.className&&"e-list-group-item"!==i.className){var s=r.createCheckBox(this.parent.createElement,!0),l=t.select("div.e-icons",i);return i.insertBefore(s,i.childNodes[t.isNullOrUndefined(l)?0:1]),t.select(".e-frame",s),this.parent.enableGroupCheckBox&&this.parent.popupWrapper.classList.add("e-multiselect-group"),i}return i},e.prototype.setSelectAll=function(){this.parent.showSelectAll?(t.isNullOrUndefined(this.checkAllParent)&&(this.checkAllParent=this.parent.createElement("div",{className:"e-selectall-parent"}),this.selectAllSpan=this.parent.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="",this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),this.checboxCreate(this.checkAllParent),this.parent.headerTemplate&&(t.isNullOrUndefined(this.parent.filterParent)?t.append([this.checkAllParent],this.parent.popupWrapper):t.append([this.checkAllParent],this.parent.filterParent)),this.parent.headerTemplate||(t.isNullOrUndefined(this.parent.filterParent)?t.prepend([this.checkAllParent],this.parent.popupWrapper):this.parent.filterParent.parentNode.insertBefore(this.checkAllParent,this.parent.filterParent.nextSibling)),t.EventHandler.add(this.checkAllParent,"mousedown",this.clickHandler,this)),this.parent.list.classList.contains("e-nodata")||this.parent.listData&&this.parent.listData.length<=1&&(!this.parent.isDynamicDataChange||!t.isBlazor())||this.parent.isDynamicDataChange&&!t.isNullOrUndefined(this.parent.value)&&this.parent.value.length<=1&&t.isBlazor()?this.checkAllParent.style.display="none":this.checkAllParent.style.display="block",this.parent.selectAllHeight=this.checkAllParent.getBoundingClientRect().height):t.isNullOrUndefined(this.checkAllParent)||(this.checkAllParent.parentElement.removeChild(this.checkAllParent),this.checkAllParent=null)},e.prototype.destroy=function(){this.removeEventListener(),t.EventHandler.remove(document,"mousedown",this.onDocumentClick)},e.prototype.listSelection=function(e){var i,s=t.isBlazor()&&e.module&&"listbox"===e.module;if(t.isNullOrUndefined(e.e)){var l=e.li.querySelector(".e-checkbox-wrapper");i=l?s?l.querySelector(".e-frame"):l.childNodes[1]:e.li.lastElementChild.childNodes[1]}else{var o=e.li.querySelector(".e-checkbox-wrapper .e-frame");i=t.isNullOrUndefined(e.e.target)?s?o:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]:e.e.target.classList.contains("e-frame")&&(!this.parent.showSelectAll||this.checkAllParent&&!this.checkAllParent.contains(e.e.target))?e.e.target:s?o:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]}if((this.parent.itemTemplate||this.parent.enableGroupCheckBox)&&(i=e.li.firstElementChild.childNodes[1]),t.isNullOrUndefined(i)||(this.checkWrapper=t.closest(i,".e-checkbox-wrapper")),!t.isNullOrUndefined(this.checkWrapper)){var r=t.select(".e-frame",this.checkWrapper);this.validateCheckNode(this.checkWrapper,r.classList.contains("e-check"),e.li,e.e,!1)}},e.prototype.validateCheckNode=function(e,t,i,s,l){this.changeState(e,t?"uncheck":"check",s,!0,l)},e.prototype.clickHandler=function(e){var i;i=e.currentTarget.classList.contains(this.checkAllParent.className)?e.currentTarget.firstElementChild.lastElementChild:e.currentTarget,this.checkWrapper=t.closest(i,".e-checkbox-wrapper");if(!t.isNullOrUndefined(this.checkWrapper)){var s=t.select(".e-frame",this.checkWrapper);this.validateCheckNode(this.checkWrapper,s.classList.contains("e-check"),null,e,!0)}e.preventDefault()},e.prototype.changeState=function(e,i,s,l,o){var r,n=e.getElementsByClassName("e-frame")[0];"check"!==i||n.classList.contains("e-check")?"uncheck"===i&&(n.classList.contains("e-check")||n.classList.contains("e-stop"))?(t.removeClass([n],["e-check","e-stop"]),r="false",o&&(this.parent.selectAllItems(!1,s),this.setLocale())):"indeterminate"!==i||n.classList.contains("e-stop")||(t.removeClass([n],["e-check"]),n.classList.add("e-stop"),r="false",o&&(this.parent.selectAllItems(!1,s),this.setLocale())):(n.classList.remove("e-stop"),n.classList.add("e-check"),r="true",o&&(this.parent.selectAllItems(!0,s),this.setLocale(!0))),r="check"===i?"true":"uncheck"===i?"false":r,t.isNullOrUndefined(r)||e.setAttribute("aria-checked",r)},e.prototype.setSearchBox=function(e){if(t.isNullOrUndefined(this.parent.filterParent)){this.parent.filterParent=this.parent.createElement("span",{className:"e-filter-parent"}),this.filterInput=this.parent.createElement("input",{attrs:{type:"text"},className:"e-input-filter"}),this.parent.element.parentNode.insertBefore(this.filterInput,this.parent.element);var i=!1;return t.Browser.isDevice&&(i=!0,this.parent.mobFilter=!1),this.filterInputObj=o.Input.createInput({element:this.filterInput,buttons:i?["e-input-group-icon e-back-icon e-icons","e-input-group-icon e-clear-icon e-icons"]:["e-input-group-icon e-clear-icon e-icons"],properties:{placeholder:this.parent.filterBarPlaceholder}},this.parent.createElement),t.isNullOrUndefined(this.parent.cssClass)||(-1!==this.parent.cssClass.split(" ").indexOf("e-outline")?t.addClass([this.filterInputObj.container],"e-outline"):-1!==this.parent.cssClass.split(" ").indexOf("e-filled")&&t.addClass([this.filterInputObj.container],"e-filled")),t.append([this.filterInputObj.container],this.parent.filterParent),t.prepend([this.parent.filterParent],e.popupElement),t.attributes(this.filterInput,{"aria-disabled":"false","aria-owns":this.parent.element.id+"_options",role:"listbox","aria-activedescendant":null,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector(".e-clear-icon"),!t.Browser.isDevice&&this.clearIconElement&&(t.EventHandler.add(this.clearIconElement,"mousedown",this.clearText,this),this.clearIconElement.style.visibility="hidden"),t.EventHandler.add(this.filterInput,"input",this.parent.onInput,this.parent),t.EventHandler.add(this.filterInput,"keyup",this.parent.keyUp,this.parent),t.EventHandler.add(this.filterInput,"keydown",this.parent.onKeyDown,this.parent),t.EventHandler.add(this.filterInput,"blur",this.onBlur,this),t.EventHandler.add(this.filterInput,"paste",this.parent.pasteHandler,this.parent),this.parent.searchBoxHeight=this.filterInputObj.container.parentElement.getBoundingClientRect().height,this.filterInputObj}},e.prototype.clickOnBackIcon=function(e){this.parent.hidePopup(),t.removeClass([document.body,this.parent.popupObj.element],"e-popup-full-page"),this.parent.inputElement.focus()},e.prototype.clearText=function(e){this.parent.targetInputElement.value="",this.parent.allowFiltering&&""===this.parent.targetInputElement.value&&this.parent.search(null),this.parent.refreshPopup(),this.parent.refreshListItems(null),this.clearIconElement.style.visibility="hidden",this.filterInput.focus(),this.setReorder(e),e.preventDefault()},e.prototype.setDeviceSearchBox=function(){this.parent.popupObj.element.classList.add("e-ddl-device"),this.parent.popupObj.element.classList.add("e-ddl-device-filter"),this.parent.popupObj.position={X:0,Y:0},this.parent.popupObj.dataBind(),this.setSearchBoxPosition(),this.backIconElement=this.filterInputObj.container.querySelector(".e-back-icon"),this.clearIconElement=this.filterInputObj.container.querySelector(".e-clear-icon"),this.clearIconElement.style.visibility="hidden",t.EventHandler.add(this.backIconElement,"click",this.clickOnBackIcon,this),t.EventHandler.add(this.clearIconElement,"click",this.clearText,this)},e.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,i=0;this.checkAllParent&&(i=this.checkAllParent.getBoundingClientRect().height),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%",this.parent.list.style.maxHeight=window.innerHeight-e-i+"px",this.parent.list.style.height=window.innerHeight-e-i+"px";var s=this.filterInput.parentElement.querySelector(".e-clear-icon");t.detach(this.filterInput),s.parentElement.insertBefore(this.filterInput,s)},e.prototype.setPopupFullScreen=function(){t.attributes(this.parent.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),t.addClass([document.body,this.parent.popupObj.element],"e-popup-full-page"),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%"},e.prototype.targetElement=function(){return t.isNullOrUndefined(this.clearIconElement)||(this.parent.targetInputElement=this.filterInput,this.clearIconElement.style.visibility=""===this.parent.targetInputElement.value?"hidden":"visible"),this.parent.targetInputElement.value},e.prototype.onBlur=function(e){if(!this.parent.element.classList.contains("e-listbox")){var i=void 0;if(this.parent.keyAction)return;if(t.Browser.isIE&&(i=!t.isNullOrUndefined(e)&&e.target),t.Browser.isIE||(i=!t.isNullOrUndefined(e)&&e.relatedTarget),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&this.parent.popupObj.element.contains(i)&&!t.Browser.isIE&&this.filterInput)return void this.filterInput.focus();if(this.parent.scrollFocusStatus&&this.filterInput)return e.preventDefault(),this.filterInput.focus(),void(this.parent.scrollFocusStatus=!1);this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.updateValueState(e,this.parent.value,this.parent.tempValues),this.parent.dispatchEvent(this.parent.hiddenElement,"change")),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.overAllWrapper.classList.remove("e-input-focus"),this.parent.trigger("blur"),this.parent.focused=!0),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&!t.Browser.isDevice&&this.parent.hidePopup()}},e.prototype.onDocumentClick=function(e){if("listbox"!==this.parent.getLocaleName()){var i=e.target;!t.isNullOrUndefined(this.parent.popupObj)&&t.closest(i,'[id="'+this.parent.popupObj.element.id+'"]')&&(this.filterInput&&""!==this.filterInput.value||e.preventDefault()),!t.isNullOrUndefined(this.parent.popupObj)&&t.closest(i,'[id="'+this.parent.popupObj.element.id+'"]')||this.parent.overAllWrapper.contains(e.target)?this.parent.scrollFocusStatus=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.filterInput:(this.parent.overAllWrapper.classList.contains(k.focus)||this.parent.isPopupOpen())&&(this.parent.inputFocus=!1,this.parent.scrollFocusStatus=!1,this.parent.hidePopup(),this.parent.onBlur(e,!0),this.parent.focused=!0),this.parent.overAllWrapper.contains(e.target)||!this.parent.overAllWrapper.classList.contains("e-input-focus")||this.parent.isPopupOpen()||(t.Browser.isIE?this.parent.onBlur():this.parent.onBlur(e)),this.filterInput===i&&this.filterInput.focus()}},e.prototype.getFocus=function(e){if(this.parent.overAllWrapper.classList.remove("e-input-focus"),this.parent.keyAction&&"clear"!==e.value&&"focus"!==e.value)return void(this.parent.keyAction=!1);"focus"===e.value&&(this.filterInput.focus(),this.parent.removeFocus(),t.EventHandler.remove(this.parent.list,"keydown",this.parent.onKeyDown)),"clear"===e.value&&(this.filterInput.value="",this.clearIconElement.style.visibility="hidden")},e.prototype.checkSelectAll=function(e){"check"===e.value&&"true"!==this.checkAllParent.getAttribute("aria-checked")&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale(!0)),"uncheck"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale()),"indeterminate"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale())},e.prototype.setLocale=function(e){if("Select All"!==this.parent.selectAllText||"Unselect All"!==this.parent.unSelectAllText){var i=e?this.parent.unSelectAllText:this.parent.selectAllText;this.selectAllSpan.textContent="";for(var s=t.compile(i),l=e?"unSelectAllText":"selectAllText",o=0,r=s({},this.parent,l,null,!this.parent.isStringTemplate);o<r.length;o++){var n=r[o];this.selectAllSpan.textContent=n.textContent}}else{var a={selectAllText:"Select All",unSelectAllText:"Unselect All"},h=new t.L10n(this.parent.getLocaleName(),{},this.parent.locale);""===h.getConstant("selectAllText")&&(h=new t.L10n("dropdowns",a,this.parent.locale)),this.selectAllSpan.textContent=e?h.getConstant("unSelectAllText"):h.getConstant("selectAllText")}},e.prototype.getActiveList=function(e){e.li.classList.contains("e-active")?this.activeLi.push(e.li.cloneNode(!0)):this.activeLi.splice(e.index,1)},e.prototype.setReorder=function(e){if(this.parent.enableSelectionOrder&&!t.isNullOrUndefined(this.parent.value)){var i=this.parent.ulElement.querySelectorAll("li.e-active").length,s=void 0,l=this.parent.createElement("ul",{className:"e-list-parent e-ul e-reorder"});i>0&&(t.append(this.parent.ulElement.querySelectorAll("li.e-active"),l),s=this.parent.ulElement.querySelectorAll("li.e-active"),t.addClass(s,"e-reorder-hide"),t.prepend([l],this.parent.list)),this.parent.focusAtFirstListItem()}},e}(),ue=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ce=function(e,t,i,s){var l,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(r=(o<3?l(r):o>3?l(t,i,r):l(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ue(i,e),ce([t.Property("Multiple")],i.prototype,"mode",void 0),ce([t.Property(!1)],i.prototype,"showCheckbox",void 0),ce([t.Property(!1)],i.prototype,"showSelectAll",void 0),ce([t.Property("Left")],i.prototype,"checkboxPosition",void 0),i}(t.ChildProperty),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ue(i,e),ce([t.Property([])],i.prototype,"items",void 0),ce([t.Property("Right")],i.prototype,"position",void 0),i}(t.ChildProperty),fe=function(e){function n(t,i){var s=e.call(this,t,i)||this;return s.isValidKey=!1,s.isDataSourceUpdate=!1,s.keyDownStatus=!1,s}ue(n,e),a=n,n.prototype.addItem=function(t,i){e.prototype.addItem.call(this,t,i)},n.prototype.render=function(){this.inputString="",this.initLoad=!0,this.isCustomFiltering=!1,this.initialSelectedOptions=this.value,t.isBlazor()&&this.isServerRendered?(this.list=this.element.parentElement,this.liCollections=this.list.querySelectorAll("."+s.cssClass.li),this.mainList=this.ulElement=this.list.querySelector("ul"),this.setSelection(this.value),this.allowFiltering&&this.setFiltering(),this.initToolbarAndStyles(),this.updateSelectionSettings(),this.wireEvents(),this.initDraggable(),this.initLoad=!1):e.prototype.render.call(this),this.renderComplete()},n.prototype.updateBlazorListData=function(e,i,l){i&&(this.liCollections=this.list.querySelectorAll("."+s.cssClass.li),this.mainList=this.ulElement=this.list.querySelector("ul"),this.allowDragAndDrop&&!this.ulElement.classList.contains("e-sortable")&&this.initDraggable(),l&&this.selectItems(this.listData,!1)),t.isNullOrUndefined(e)||(this.sortedData=this.jsonData=this.listData=e)},n.prototype.initWrapper=function(){var e=this.createElement("select",{className:"e-hidden-select",attrs:{multiple:""}});this.list.classList.add("e-listbox-wrapper"),this.itemTemplate&&this.list.classList.add("e-list-template"),this.list.classList.add("e-wrapper"),this.list.classList.add("e-lib"),"EJS-LISTBOX"===this.element.tagName?(this.element.setAttribute("tabindex","0"),this.initLoad&&this.element.appendChild(this.list)):(this.initLoad&&this.element.parentElement.insertBefore(this.list,this.element),this.list.insertBefore(this.element,this.list.firstChild),this.element.style.display="none"),this.list.insertBefore(e,this.list.firstChild),this.list.getElementsByClassName("e-list-item")[0]&&this.list.getElementsByClassName("e-list-item")[0].classList.remove(k.focus),this.itemTemplate&&this.renderReactTemplates(),t.removeClass([this.list],[k.content,k.root]),this.validationAttribute(this.element,e),this.list.setAttribute("role","listbox"),t.attributes(this.list,{role:"listbox","aria-multiselectable":"Multiple"===this.selectionSettings.mode?"true":"false"}),this.updateSelectionSettings()},n.prototype.updateSelectionSettings=function(){if(this.selectionSettings.showCheckbox&&this.selectionSettings.showSelectAll&&this.liCollections.length){var e=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=e.getConstant("selectAllText"),this.unSelectAllText=e.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{})}},n.prototype.initDraggable=function(){var e=this;this.ulElement&&(this.ulElement.id=this.element.id+"_parent"),this.allowDragAndDrop&&new s.Sortable(this.ulElement,{scope:this.scope,itemClass:"e-list-item",dragStart:this.triggerDragStart.bind(this),drag:this.triggerDrag.bind(this),beforeDrop:this.beforeDragEnd.bind(this),drop:this.dragEnd.bind(this),placeHolder:function(){return e.createElement("span",{className:"e-placeholder"})},helper:function(t){var i=e.list.cloneNode(),s=t.sender.cloneNode(!0);i.appendChild(s);var o=e.getItems()[0];return i.style.width=o.offsetWidth+"px",i.style.height=o.offsetHeight+"px",(e.value&&e.value.length)>1&&e.isSelected(s)&&s.appendChild(e.createElement("span",{className:"e-list-badge",innerHTML:e.value.length+""})),i.style.zIndex=l.getZindexPartial(e.element)+"",i}})},n.prototype.updateActionCompleteData=function(e,t){this.jsonData.push(t)},n.prototype.initToolbar=function(){var e=this.toolbarSettings.position,i=this.element.getAttribute("data-value");if(this.toolbarSettings.items.length){var s=this.createElement("div",{className:"e-listbox-tool",attrs:{role:"toolbar"}}),l=this.createElement("div",{className:"e-listboxtool-wrapper e-lib e-"+e.toLowerCase()});this.list.parentElement.insertBefore(l,this.list),l.appendChild("Right"===e?this.list:s),l.appendChild("Right"===e?s:this.list),this.createButtons(s),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.scope?document.querySelector(this.scope).setAttribute("data-value",this.element.id):this.updateToolBarState()}var o=this.element.getAttribute("data-value");i&&o&&i!==o?(this.tBListBox=t.getComponent(document.getElementById(i),this.getModuleName()),this.tBListBox.updateToolBarState()):o&&(this.tBListBox=t.getComponent(document.getElementById(o),this.getModuleName()),this.tBListBox.updateToolBarState())},n.prototype.createButtons=function(e){var i,s,l,o=this,n=new t.L10n(this.getModuleName(),{moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",moveFrom:"Move From",moveAllTo:"Move All To",moveAllFrom:"Move All From"},this.locale);this.toolbarSettings.items.forEach(function(t){l=n.getConstant(t),s=o.createElement("button",{attrs:{type:"button","data-value":t,title:l,"aria-label":l}}),e.appendChild(s),(i=new r.Button({iconCss:"e-icons e-"+t.toLowerCase()},s)).createElement=o.createElement})},n.prototype.validationAttribute=function(t,i){e.prototype.validationAttribute.call(this,t,i),i.required=t.required,t.required=!1},n.prototype.setHeight=function(){(this.toolbarSettings.items.length?this.list.parentElement:this.list).style.height=t.formatUnit(this.height),this.allowFiltering&&this.height.toString().indexOf("%")<0?t.addClass([this.list],"e-filter-list"):t.removeClass([this.list],"e-filter-list")},n.prototype.setCssClass=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.enableRtl&&t.addClass([e],"e-rtl")},n.prototype.setEnable=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.enabled?t.removeClass([e],s.cssClass.disabled):(t.addClass([e],s.cssClass.disabled),t.isBlazor()&&this.isServerRendered&&this.toolbarSettings.items.length&&t.removeClass([this.list],s.cssClass.disabled))},n.prototype.showSpinner=function(){this.spinner||(this.spinner=this.createElement("div",{className:"e-listbox-wrapper"})),this.spinner.style.height=t.formatUnit(this.height),this.element.parentElement.insertBefore(this.spinner,this.element.nextSibling),l.createSpinner({target:this.spinner},this.createElement),l.showSpinner(this.spinner)},n.prototype.hideSpinner=function(){this.spinner.querySelector(".e-spinner-pane")&&l.hideSpinner(this.spinner),this.spinner.parentElement&&t.detach(this.spinner)},n.prototype.onInput=function(){this.isDataSourceUpdate=!1,this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,this.refreshClearIcon()},n.prototype.clearText=function(){this.filterInput.value="",this.refreshClearIcon();var e=document.createEvent("KeyboardEvent");this.isValidKey=!0,this.KeyUp(e)},n.prototype.refreshClearIcon=function(){this.filterInput.parentElement.querySelector("."+ve.clearIcon)&&(this.filterInput.parentElement.querySelector("."+ve.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible")},n.prototype.onActionComplete=function(i,s,l){var o;if(this.allowFiltering&&this.list.getElementsByClassName("e-filter-parent")[0]&&(o=t.isBlazor()&&this.isServerRendered?this.list.getElementsByClassName("e-filter-parent")[0]:this.list.getElementsByClassName("e-filter-parent")[0].cloneNode(!0)),0===s.length){var r=i.getElementsByClassName("e-list-nrt")[0];r&&i.removeChild(r)}if(e.prototype.onActionComplete.call(this,i,s,l),this.allowFiltering&&!t.isNullOrUndefined(o)&&(this.list.insertBefore(o,this.list.firstElementChild),t.isBlazor()||this.isServerRendered||(this.filterParent=this.list.getElementsByClassName("e-filter-parent")[0],this.filterWireEvents(o))),this.initWrapper(),this.setSelection(),this.initDraggable(),this.mainList=this.ulElement,this.initLoad)this.jsonData=[],t.extend(this.jsonData,s,[]),this.initToolbarAndStyles(),this.wireEvents(),this.showCheckbox&&this.setCheckboxPosition(),this.allowFiltering&&this.setFiltering();else if(this.isDataSourceUpdate&&(this.jsonData=[],t.extend(this.jsonData,s,[]),this.isDataSourceUpdate=!1),this.allowFiltering){var n=this.list.getElementsByClassName("e-input-filter")[0],a=this.filterInput.value.length;n.selectionStart=a,n.selectionEnd=a,n.focus()}if(this.toolbarSettings.items.length&&this.scope&&this.scope.indexOf("#")>-1&&!t.isNullOrUndefined(l)){var h=this.scope.replace("#","");t.getComponent(document.getElementById(h),this.getModuleName()).initToolbar()}this.initLoad=!1},n.prototype.initToolbarAndStyles=function(){this.initToolbar(),this.setCssClass(),this.setEnable(),this.setHeight()},n.prototype.triggerDragStart=function(e){var i,s=this;e=t.extend(this.getDragArgs(e),{dragSelected:!0}),t.Browser.isIos&&(this.list.style.overflow="hidden"),this.trigger("dragStart",e,function(l){s.allowDragAll=l.dragSelected,s.allowDragAll||(i=s.ulElement.getElementsByClassName("e-list-badge")[0])&&t.detach(i),t.isBlazor()&&e.bindEvents(e.dragElement)})},n.prototype.triggerDrag=function(e){this.trigger("drag",this.getDragArgs(e));var t=this.getComponent(e.target);if(t&&0===t.listData.length){var i=t.ulElement.getElementsByClassName("e-list-nrt")[0];i&&t.ulElement.removeChild(i)}},n.prototype.beforeDragEnd=function(e){var t=this.getFormattedValue(e.droppedElement.getAttribute("data-value"));this.value.indexOf(t)>-1?e.items=this.getDataByValues(this.value):e.items=this.getDataByValues([t]),this.trigger("beforeDrop",e)},n.prototype.dragEnd=function(e){var i,l,o,r,n,a,h=this,p=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),u=this.getComponent(e.droppedElement),c=this.getDragArgs({target:e.droppedElement},!0),d={previousData:this.dataSource},m={previousData:u.dataSource},f=t.extend({},c,{target:e.target,source:{previousData:this.dataSource},previousIndex:e.previousIndex,currentIndex:e.currentIndex});if(u!==this){T=t.extend(d,{currentData:this.listData});f=t.extend(f,{source:T,destination:m})}if(t.Browser.isIos&&(this.list.style.overflow=""),u===this){var v=this.ulElement;i=[].slice.call(this.listData),l=[].slice.call(this.liCollections),o=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData);var y=e.currentIndex,g=e.currentIndex=this.getCurIdx(this,e.currentIndex),C=i.indexOf(this.getDataByValue(p)),b=o.indexOf(this.getDataByValue(p)),S=a.indexOf(this.getDataByValue(p));if(i.splice(g,0,i.splice(C,1)[0]),a.splice(y,0,a.splice(S,1)[0]),o.splice(g,0,o.splice(b,1)[0]),t.isBlazor()||l.splice(g,0,l.splice(C,1)[0]),this.allowDragAll&&(n=this.value&&Array.prototype.indexOf.call(this.value,p)>-1?this.value:[p]).forEach(function(r){if(r!==p){var n=i.indexOf(h.getDataByValue(r)),u=o.indexOf(h.getDataByValue(r)),c=a.indexOf(h.getDataByValue(r));n>g&&g++,o.splice(g,0,o.splice(u,1)[0]),i.splice(g,0,i.splice(n,1)[0]),a.splice(y,0,a.splice(c,1)[0]),t.isBlazor()||(l.splice(g,0,l.splice(n,1)[0]),v.insertBefore(h.getItems()[h.getIndexByValue(r)],v.getElementsByClassName("e-placeholder")[0]))}else if(t.isBlazor()){var d=[].slice.call(h.ulElement.getElementsByClassName(s.cssClass.li)),m=h.ulElement.removeChild(d[e.currentIndex]);d.splice(e.currentIndex,1),h.ulElement.insertBefore(m,d[e.previousIndex])}}),this.listData=i,this.jsonData=o,this.sortedData=a,this.liCollections=l,t.isBlazor()){var E=this.value;this.interopAdaptor.invokeMethodAsync("UpdateListData",this.listData).then(function(){h.updateBlazorListData(null,!0),h.selectItems(h.listData,!1),h.selectItems(E)})}}else{var x,w=[].slice.call(this.liCollections),O=e.currentIndex=this.getCurIdx(u,e.currentIndex),A=u.ulElement;i=[].slice.call(u.listData),l=[].slice.call(u.liCollections),o=[].slice.call(u.jsonData),a=[].slice.call(u.sortedData),n=this.value&&Array.prototype.indexOf.call(this.value,p)>-1&&this.allowDragAll?this.value:[p];var k=[].slice.call(this.listData),B=[].slice.call(this.sortedData);if(n.forEach(function(n,u){r=h.getDataByValue(n);var c=h.listData.indexOf(r),d=h.jsonData.indexOf(r),m=h.sortedData.indexOf(r);k.splice(c,1),h.jsonData.splice(d,1),B.splice(m,1),h.listData=k,h.sortedData=B;var f=n===p?e.currentIndex:O;if(i.splice(f,0,r),o.splice(f,0,r),a.splice(f,0,r),t.isBlazor()||l.splice(f,0,w.splice(c,1)[0]),n)x=h.getItems()[h.getIndexByValue(n)];else for(var v=h.getItems(),y=0;y<v.length;y++)if(null===v[y].getAttribute("data-value")&&v[y].classList.contains("e-list-item")){x=v[y];break}x||(x=e.helper),h.removeSelected(h,n===p?[e.droppedElement]:[x]),t.isBlazor()?0===u&&h.ulElement.insertBefore(A.getElementsByClassName(s.cssClass.li)[e.currentIndex],h.ulElement.getElementsByClassName(s.cssClass.li)[e.previousIndex]):A.insertBefore(x,A.getElementsByClassName("e-placeholder")[0]),O++}),t.isBlazor())this.interopAdaptor.invokeMethodAsync("UpdateListData",this.listData).then(function(){h.updateSelectedOptions(),h.fields.groupBy&&h.setSelection(),h.updateBlazorListData(null,!0,null==h.value||!h.value.length)}),u.interopAdaptor.invokeMethodAsync("UpdateListData",i).then(function(){("None"!==u.sortOrder||h.selectionSettings.showCheckbox!==u.selectionSettings.showCheckbox||u.fields.groupBy)&&u.setSelection(),u.updateBlazorListData(null,!0,null==u.value||!u.value.length)});else{if(this.fields.groupBy&&(this.ulElement.innerHTML=this.renderItems(this.listData,this.fields).innerHTML,this.setSelection()),"None"!==u.sortOrder||this.selectionSettings.showCheckbox!==u.selectionSettings.showCheckbox||u.fields.groupBy||u.itemTemplate||this.itemTemplate){var D=t.getComponent(A,"sortable");A.innerHTML=u.renderItems(i,u.fields).innerHTML,D.placeHolderElement&&A.appendChild(D.placeHolderElement),A.appendChild(e.helper),u.setSelection()}this.liCollections=w,u.liCollections=l}u.jsonData=t.extend([],[],o,!1),u.listData=t.extend([],[],i,!1),u.sortedData=t.extend([],[],a,!1),0===this.listData.length&&this.l10nUpdate()}if(this===u){var T=t.extend(d,{currentData:i});f=t.extend(f,{source:T})}else{var I=t.extend(m,{currentData:i});f=t.extend(f,{destination:I})}this.trigger("drop",f)},n.prototype.removeSelected=function(e,i){e.selectionSettings.showCheckbox?i.forEach(function(e){e.getElementsByClassName("e-frame")[0].classList.remove("e-check")}):t.removeClass(i,s.cssClass.selected)},n.prototype.getCurIdx=function(e,t){return e.fields.groupBy&&(t-=[].slice.call(e.ulElement.children).slice(0,t).filter(function(e){return e.classList.contains(s.cssClass.group)}).length),t},n.prototype.getComponent=function(e){var i,s="EJS-LISTBOX"===this.element.tagName?t.closest(e,".e-listbox"):t.closest(e,".e-listbox-wrapper")&&t.closest(e,".e-listbox-wrapper").querySelector(".e-listbox");return s&&(i=t.getComponent(s,this.getModuleName())),i},n.prototype.listOption=function(i,s){return this.listCurrentOptions=e.prototype.listOption.call(this,i,s),this.listCurrentOptions=t.extend({},this.listCurrentOptions,{itemCreated:this.triggerBeforeItemRender.bind(this)},!0),this.notify("listoption",{module:"CheckBoxSelection"}),this.listCurrentOptions},n.prototype.triggerBeforeItemRender=function(e){e.item.setAttribute("tabindex","-1"),this.trigger("beforeItemRender",{element:e.item,item:e.curData})},n.prototype.requiredModules=function(){var e=[];return this.selectionSettings.showCheckbox&&e.push({member:"CheckBoxSelection",args:[this]}),e},n.prototype.enableItems=function(e,i,l){var o=this;void 0===i&&(i=!0);var r;e.forEach(function(e){var n;if(t.isBlazor()&&"object"==typeof e){if(n=t.getValue(l?o.fields.value:o.fields.text,e),t.isNullOrUndefined(n))return}else n=e;(r=o.findListElement(o.list,"li","data-value",l?n:o.getValueByText(n)))&&(i?(t.removeClass([r],s.cssClass.disabled),r.removeAttribute("aria-disabled")):(t.addClass([r],s.cssClass.disabled),r.setAttribute("aria-disabled","true")))})},n.prototype.selectItems=function(e,t,i){void 0===t&&(t=!0),this.setSelection(e,t,!i),this.updateSelectedOptions()},n.prototype.selectAll=function(e){void 0===e&&(e=!0),this.selectAllItems(e)},n.prototype.addItems=function(t,i){e.prototype.addItem.call(this,t,i)},n.prototype.removeItems=function(e,t){this.removeItem(e,t)},n.prototype.removeItem=function(e,i){var s=[],l=this.list.querySelectorAll("."+k.li);if(e){e=e instanceof Array?e:[e];var o=this.fields,r=void 0,n=[],a=void 0;t.extend(n,[],this.listData);for(var h=[],p=[],u=0;u<e.length;u++){r=e[u]instanceof Object?t.getValue(o.value,e[u]):e[u].toString();for(var c=0,d=n.length;c<d;c++)(n[c]instanceof Object?t.getValue(o.value,n[c]):n[c].toString())===r&&(a=this.getIndexByValue(r),s.push(l[a]),h.push(c),p.push(a))}for(m=h.length-1;m>=0;m--)this.listData.splice(h[m],1);for(var m=p.length-1;m>=0;m--)this.updateLiCollection(p[m])}else i=i||0,s.push(l[i]),this.listData.splice(i,1),this.updateLiCollection(i);for(c=0;c<s.length;c++)this.ulElement.removeChild(s[c]);0===this.listData.length&&this.l10nUpdate()},n.prototype.getDataByValues=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getDataByValue(e[i]));return t},n.prototype.moveUp=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,t)},n.prototype.moveDown=function(e){var t=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!1,!1,t)},n.prototype.moveTo=function(e,i,s){var l=e?this.getElemByValue(e):this.getSelectedItems(),o=s?t.getComponent(s,a):this.getScopedListBox();this.moveData(this,o,!1,l,i)},n.prototype.moveAllTo=function(e,i){if(this.listData.length>0){var s=e?t.getComponent(e,a):this.getScopedListBox();this.moveAllData(this,s,!1,i)}},n.prototype.getDataList=function(){return this.jsonData},n.prototype.getSortedList=function(){var e,t;if(e=t=this.sortedData,this.fields.groupBy){e=[];for(var i=0;i<t.length;i++)t[i].isHeader||e.push(t[i])}return e},n.prototype.getElemByValue=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.ulElement.querySelector('[data-value ="'+e[i]+'"]'));return t},n.prototype.updateLiCollection=function(e){var t=[].slice.call(this.liCollections);t.splice(e,1),this.liCollections=t},n.prototype.selectAllItems=function(e,t){var i=this;if([].slice.call(this.getItems()).forEach(function(t){if(!t.classList.contains(s.cssClass.disabled))if(i.selectionSettings.showCheckbox){var l=t.getElementsByClassName("e-check")[0];(!l&&e||l&&!e)&&(i.notify("updatelist",{li:t,module:"listbox"}),i.maximumSelectionLength>=i.list.querySelectorAll(".e-list-item span.e-check").length&&i.checkMaxSelection())}else e?t.classList.add(s.cssClass.selected):t.classList.remove(s.cssClass.selected)}),this.updateSelectedOptions(),this.allowFiltering&&this.selectionSettings.showCheckbox){var l=this.list.getElementsByTagName("li"),o=0;if(e){var r=this;for(o=0;o<l.length;o++)!function(){var e=r.getFormattedValue(l[o].getAttribute("data-value"));r.value.some(function(t){return t===e})||r.value.push(r.getFormattedValue(l[o].getAttribute("data-value")))}()}else{var n=this;for(o=0;o<l.length;o++)!function(){var e=n.getFormattedValue(l[o].getAttribute("data-value"));n.value=n.value.filter(function(t){return t!==e})}()}document.querySelectorAll("ul").length<2&&this.updateMainList()}this.triggerChange(this.getSelectedItems(),t)},n.prototype.updateMainList=function(){var e=this.mainList.querySelectorAll(".e-list-item"),t=this.ulElement.querySelectorAll(".e-list-item"),i=e.length,s=t.length;if(this.selectionSettings.showCheckbox||document.querySelectorAll("ul").length>1||i!==s){var l=0,o=0,r=0;for(l;l<i;){if(this.value)for(o;o<this.value.length;o++)e[l].getAttribute("data-value")===this.value[o]&&r++;!r&&this.selectionSettings.showCheckbox&&e[l].getElementsByClassName("e-frame")[0].classList.remove("e-check"),document.querySelectorAll("ul").length>1&&r&&i!==s?(this.mainList.removeChild(this.mainList.getElementsByTagName("li")[l]),l=0):l++,r=0,o=0}}},n.prototype.wireEvents=function(){var e=t.closest(this.element,"form"),i="EJS-LISTBOX"===this.element.tagName?this.element:this.list;t.EventHandler.add(this.list,"click",this.clickHandler,this),t.EventHandler.add(i,"keydown",this.keyDownHandler,this),t.EventHandler.add(i,"focusout",this.focusOutHandler,this),this.wireToolbarEvent(),this.selectionSettings.showCheckbox&&t.EventHandler.remove(document,"mousedown",this.checkBoxSelectionModule.onDocumentClick),(this.fields.groupBy||this.element.querySelector("select>optgroup"))&&t.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),e&&t.EventHandler.add(e,"reset",this.formResetHandler,this)},n.prototype.wireToolbarEvent=function(){this.toolbarSettings.items.length&&t.EventHandler.add(this.getToolElem(),"click",this.toolbarClickHandler,this)},n.prototype.unwireEvents=function(){var e=t.closest(this.element,"form"),i="EJS-LISTBOX"===this.element.tagName?this.element:this.list;t.EventHandler.remove(this.list,"click",this.clickHandler),t.EventHandler.remove(i,"keydown",this.keyDownHandler),t.EventHandler.remove(i,"focusout",this.focusOutHandler),this.allowFiltering&&this.clearFilterIconElem&&t.EventHandler.remove(this.clearFilterIconElem,"click",this.clearText),this.toolbarSettings.items.length&&t.EventHandler.remove(this.getToolElem(),"click",this.toolbarClickHandler),e&&t.EventHandler.remove(e,"reset",this.formResetHandler)},n.prototype.clickHandler=function(e){this.selectHandler(e)},n.prototype.checkSelectAll=function(){for(var e=0,t=this.list.querySelectorAll("li."+k.li),i=0;i<t.length;i++)t[i].classList.contains("e-disabled")||e++;var s=this.getSelectedItems().length;this.showSelectAll&&e&&this.notify("checkSelectAll",{module:"CheckBoxSelection",value:e===s?"check":0===s?"uncheck":"indeterminate"})},n.prototype.getQuery=function(e){var t=e?e.clone():this.query?this.query.clone():new i.Query;if(this.allowFiltering){var s=""===this.inputString?"contains":this.filterType,l=this.typeOfData(this.dataSource).typeof;if((this.dataSource instanceof i.DataManager||"string"!==l)&&"number"!==l){var o=this.fields.text?this.fields.text:"";t.where(o,s,this.inputString,this.ignoreCase,this.ignoreAccent)}else t.where("",s,this.inputString,this.ignoreCase,this.ignoreAccent)}else t=e||(this.query?this.query:new i.Query);return t},n.prototype.setFiltering=function(){var e;if(this.initLoad||t.isNullOrUndefined(this.filterParent))return t.isBlazor()&&this.isServerRendered?(this.filterParent=this.list.querySelector(".e-filter-parent"),this.filterInput=this.list.querySelector(".e-input-filter")):(this.filterParent=this.createElement("span",{className:ve.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:ve.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),e=o.Input.createInput({element:this.filterInput,buttons:[ve.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),t.append([e.container],this.filterParent),t.prepend([this.filterParent],this.list),t.attributes(this.filterInput,{"aria-disabled":"false","aria-owns":this.element.id+"_options",role:"listbox","aria-activedescendant":null,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"})),this.height.toString().indexOf("%")<0&&t.addClass([this.list],"e-filter-list"),this.inputString=this.filterInput.value,this.filterWireEvents(),e},n.prototype.filterWireEvents=function(e){e&&(this.filterInput=e.querySelector(".e-input-filter")),this.clearFilterIconElem=this.filterInput.parentElement.querySelector("."+ve.clearIcon),this.clearFilterIconElem&&(t.EventHandler.add(this.clearFilterIconElem,"click",this.clearText,this),e||(this.clearFilterIconElem.style.visibility="hidden")),t.EventHandler.add(this.filterInput,"input",this.onInput,this),t.EventHandler.add(this.filterInput,"keyup",this.KeyUp,this),t.EventHandler.add(this.filterInput,"keydown",this.onKeyDown,this)},n.prototype.selectHandler=function(e,i){var l,o=!0,r=t.closest(e.target,".e-list-item"),n=[r];if(r&&r.parentElement){if(l=[].slice.call(r.parentElement.children).indexOf(r),this.selectionSettings.showCheckbox?o=!r.getElementsByClassName("e-frame")[0].classList.contains("e-check"):(e.ctrlKey||t.Browser.isDevice)&&this.isSelected(r)?(r.classList.remove(s.cssClass.selected),r.removeAttribute("aria-selected"),o=!1):"Multiple"===this.selectionSettings.mode&&(e.ctrlKey||t.Browser.isDevice)||(this.getSelectedItems().forEach(function(e){e.removeAttribute("aria-selected")}),t.removeClass(this.getSelectedItems(),s.cssClass.selected)),e.shiftKey&&!this.selectionSettings.showCheckbox&&"Single"!==this.selectionSettings.mode?n=[].slice.call(r.parentElement.children).slice(Math.min(l,this.prevSelIdx),Math.max(l,this.prevSelIdx)+1).filter(function(e){return e.classList.contains("e-list-item")}):this.prevSelIdx=[].slice.call(r.parentElement.children).indexOf(r),o&&(this.selectionSettings.showCheckbox||t.addClass(n,s.cssClass.selected),n.forEach(function(e){e.setAttribute("aria-selected","true")}),this.list.setAttribute("aria-activedescendant",r.id)),i||!(this.maximumSelectionLength>(this.value&&this.value.length))&&o||!(this.maximumSelectionLength>=(this.value&&this.value.length))&&o||this.maximumSelectionLength<(this.value&&this.value.length)||this.notify("updatelist",{li:r,e:e,module:"listbox"}),this.allowFiltering&&!i){var a=this.getFormattedValue(r.getAttribute("data-value"));if(o){var h=[];t.extend(h,this.value),h.push(a),this.value=h}else this.value=this.value.filter(function(e){return e!==a});document.querySelectorAll("ul").length<2&&this.updateMainList()}this.updateSelectedOptions(),this.triggerChange(this.getSelectedItems(),e),this.checkMaxSelection()}},n.prototype.triggerChange=function(e,t){this.trigger("change",{elements:e,items:this.getDataByElements(e),value:this.value,event:t})},n.prototype.getDataByElems=function(e){for(var t=[],i=0,s=e.length;i<s;i++)t.push(this.getDataByValue(this.getFormattedValue(e[i].getAttribute("data-value"))));return t},n.prototype.getDataByElements=function(e){var i,s=[],l=0;if(!t.isNullOrUndefined(this.listData)){var o=this.typeOfData(this.listData).typeof;if("string"===o||"number"===o||"boolean"===o)for(var r=0,n=this.listData;r<n.length;r++){for(var a=n[r],h=l,p=e.length;h<p;h++)if(i=this.getFormattedValue(e[h].getAttribute("data-value")),!t.isNullOrUndefined(a)&&a===i){l=h,s.push(a);break}if(e.length===s.length)break}else for(var u=0,c=this.listData;u<c.length;u++){for(var a=c[u],h=l,p=e.length;h<p;h++)if(i=this.getFormattedValue(e[h].getAttribute("data-value")),!t.isNullOrUndefined(a)&&t.getValue(this.fields.value?this.fields.value:"value",a)===i){l=h,s.push(a);break}if(e.length===s.length)break}return s}return null},n.prototype.checkMaxSelection=function(){var e=this.list.querySelectorAll(".e-list-item span.e-check").length;if(this.selectionSettings.showCheckbox){var t=0,i=this.list.getElementsByClassName("e-list-item");for(t;t<i.length;t++)i[t].querySelector(".e-frame.e-check")||(e===this.maximumSelectionLength?i[t].classList.add("e-disable"):i[t].classList.contains("e-disable")&&i[t].classList.remove("e-disable"))}},n.prototype.toolbarClickHandler=function(e){var i=t.closest(e.target,"button");if(i){if(this.toolbarAction=i.getAttribute("data-value"),i.disabled)return;switch(this.toolbarAction){case"moveUp":this.moveUpDown(!0);break;case"moveDown":this.moveUpDown();break;case"moveTo":this.moveItemTo();break;case"moveFrom":this.moveItemFrom();break;case"moveAllTo":this.moveAllItemTo();break;case"moveAllFrom":this.moveAllItemFrom();break;default:this.trigger("actionBegin",{cancel:!1,items:this.getDataByElems(this.getSelectedItems()),eventName:this.toolbarAction})}}},n.prototype.moveUpDown=function(e,t,i){var l=this,o=this.getSelectedItems();if(i&&(o=i),!(e&&this.isSelected(this.ulElement.firstElementChild)||!e&&this.isSelected(this.ulElement.lastElementChild))||i){var r=this.getDataByElems(o),n={cancel:!1,items:r,eventName:this.toolbarAction};this.trigger("actionBegin",n),n.cancel||((e?o:o.reverse()).forEach(function(t){var i=Array.prototype.indexOf.call(l.ulElement.querySelectorAll(".e-list-item"),t),o=Array.prototype.indexOf.call(l.ulElement.children,t);s.moveTo(l.ulElement,l.ulElement,[o],e?o-1:o+2),l.changeData(o,e?o-1:o+1,e?i-1:i+1,t)}),this.trigger("actionComplete",{items:r,eventName:this.toolbarAction}),o[0].focus(),!t&&this.toolbarSettings.items.length&&this.getToolElem().querySelector("[data-value="+(e?"moveUp":"moveDown")+"]").focus(),this.updateToolBarState())}},n.prototype.moveItemTo=function(){this.moveData(this,this.getScopedListBox())},n.prototype.moveItemFrom=function(){this.moveData(this.getScopedListBox(),this)},n.prototype.moveData=function(e,i,l,o,r){var n=this,a=[],h=[],p=[],u=[],c=[].slice.call(e.listData),d=[].slice.call(i.listData),m=[].slice.call(e.sortedData),f=[].slice.call(i.sortedData),v=[].slice.call(e.liCollections),y=[],g=[].slice.call(i.liCollections),C=[],b=[],S=e.getSelectedItems();o&&(S=o);var E="None"!==i.sortOrder||i.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||i.fields.groupBy||i.itemTemplate||e.itemTemplate;if(e.value=[],S.length){this.removeSelected(e,S),S.forEach(function(t){a.push(Array.prototype.indexOf.call(e.ulElement.children,t)),y.push(Array.prototype.indexOf.call(e.ulElement.querySelectorAll(".e-list-item"),t)),h.push(Array.prototype.indexOf.call(e.listData,e.getDataByElems([t])[0])),u.push(Array.prototype.indexOf.call(e.sortedData,e.getDataByElems([t])[0])),p.push(Array.prototype.indexOf.call(e.jsonData,e.getDataByElems([t])[0]))}),"None"!==this.sortOrder?u.forEach(function(t){C.push(e.sortedData[t])}):p.forEach(function(t){C.push(e.jsonData[t])});var x={cancel:!1,items:C,eventName:this.toolbarAction};if(e.trigger("actionBegin",x),x.cancel)return;if(!t.isBlazor()){var w=[];if(y.sort(function(e,t){return e-t}).reverse().forEach(function(e){w.push(v.splice(e,1)[0])}),e.liCollections=v,r){var O=g.splice(0,r);i.liCollections=O.concat(w.reverse()).concat(g)}else i.liCollections=g.concat(w.reverse());if(0===i.listData.length){var A=i.ulElement.getElementsByClassName("e-list-nrt")[0];A&&i.ulElement.removeChild(A)}}h.sort(function(e,t){return t-e}).forEach(function(e){c.splice(e,1)[0]}),u.sort(function(e,t){return t-e}).forEach(function(e){m.splice(e,1)[0]}),p.slice().reverse().forEach(function(t){b.push(e.jsonData.splice(t,1)[0])}),t.isBlazor()||(E?e.fields.groupBy?e.ulElement.innerHTML=e.renderItems(c,e.fields).innerHTML:S.forEach(function(e){t.detach(e)}):(s.moveTo(e.ulElement,i.ulElement,a,r),e.trigger("actionComplete",{items:C,eventName:this.toolbarAction})),i.mainList.childElementCount!==i.jsonData.length&&(i.mainList=i.ulElement),e.updateMainList());var k=[].slice.call(i.jsonData);f=[].slice.call(i.sortedData),t.isBlazor()||this.selectNextList(S,y,h,e),l&&this.list.focus(),e.listData=c,e.sortedData=m,r=r||d.length;for(var B=C.length-1;B>=0;B--)d.splice(r,0,C[B]),k.splice(r,0,C[B]),f.splice(r,0,C[B]);i.listData=d,i.jsonData=k,i.sortedData=f,t.isBlazor()?(e.interopAdaptor.invokeMethodAsync("UpdateListData",e.listData).then(function(){e.updateBlazorListData(null,!0),n.selectNextList(S,y,h,e),e.updateSelectedOptions()}),i.interopAdaptor.invokeMethodAsync("UpdateListData",i.listData).then(function(){E&&i.setSelection(),i.updateBlazorListData(null,!0),e.trigger("actionComplete",{items:C,eventName:n.toolbarAction})})):(E&&(i.ulElement.innerHTML=i.renderItems(d,i.fields).innerHTML,i.setSelection(),e.trigger("actionComplete",{items:C,eventName:this.toolbarAction})),e.updateSelectedOptions()),0===e.listData.length&&e.l10nUpdate()}1===e.value.length&&e.getSelectedItems().length&&(e.value[0]=e.getFormattedValue(e.getSelectedItems()[0].getAttribute("data-value")))},n.prototype.selectNextList=function(e,t,i,l){var o,r,n=l.ulElement.querySelectorAll(".e-list-item").length,a=-1;1===e.length&&n&&!l.selectionSettings.showCheckbox&&(r=n<=t[0]?n-1:t[0],o=l.ulElement.querySelectorAll(".e-list-item")[r],(a=l.getValidIndex(o,r,n===i[0]?38:40))>-1&&l.ulElement.querySelectorAll(".e-list-item")[a].classList.add(s.cssClass.selected))},n.prototype.moveAllItemTo=function(){this.moveAllData(this,this.getScopedListBox())},n.prototype.moveAllItemFrom=function(){this.moveAllData(this.getScopedListBox(),this)},n.prototype.moveAllData=function(e,i,l,o){var r=this,n=[].slice.call(i.listData),a=[].slice.call(i.jsonData),h="None"!==i.sortOrder||i.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||i.fields.groupBy||i.itemTemplate||e.itemTemplate;this.removeSelected(e,e.getSelectedItems());var p=[].slice.call(e.jsonData),u={cancel:!1,items:p,eventName:this.toolbarAction};if(e.trigger("actionBegin",u),!u.cancel){if(!t.isBlazor()){if(0===i.listData.length&&(c=i.ulElement.getElementsByClassName("e-list-nrt")[0])&&i.ulElement.removeChild(c),h){var c=e.ulElement.getElementsByClassName("e-list-nrt")[0];c&&e.ulElement.removeChild(c)}s.moveTo(e.ulElement,i.ulElement,Array.apply(null,{length:e.ulElement.childElementCount}).map(Number.call,Number),o),this.trigger("actionComplete",{items:p,eventName:this.toolbarAction})}l&&this.list.focus(),o=o||n.length;for(d=0;d<e.listData.length;d++)n.splice(o+d,0,e.listData[d]);for(var d=0;d<e.jsonData.length;d++)a.splice(o+d,0,e.jsonData[d]);if(!t.isBlazor()){var m=[].slice.call(e.liCollections),f=[].slice.call(i.liCollections);if(e.liCollections=[],o){var v=f.splice(0,o);i.liCollections=v.concat(m).concat(f)}else i.liCollections=f.concat(m)}e.value=[],n=n.filter(function(e){return!0!==e.isHeader}),i.listData=n,i.jsonData=a,e.listData=e.sortedData=e.jsonData=[],t.isBlazor()?(h||(i.sortedData=n),e.interopAdaptor.invokeMethodAsync("UpdateListData",e.listData).then(function(){e.updateBlazorListData(null,!0),e.updateSelectedOptions()}),i.interopAdaptor.invokeMethodAsync("UpdateListData",i.listData).then(function(){i.updateBlazorListData(null,!0),e.updateSelectedOptions(),e.trigger("actionComplete",{items:p,eventName:r.toolbarAction})})):(h?(i.ulElement.innerHTML=i.renderItems(n,i.fields).innerHTML,this.trigger("actionComplete",{items:p,eventName:this.toolbarAction})):i.sortedData=n,e.updateSelectedOptions()),0===e.listData.length&&e.l10nUpdate()}},n.prototype.changeData=function(e,t,i,s){var l=[].slice.call(this.listData),o=[].slice.call(this.jsonData),r=[].slice.call(this.sortedData),n=Array.prototype.indexOf.call(this.jsonData,this.getDataByElems([s])[0]),a=Array.prototype.indexOf.call(this.sortedData,this.getDataByElems([s])[0]),h=[].slice.call(this.liCollections);l.splice(t,0,l.splice(e,1)[0]),o.splice(i,0,o.splice(n,1)[0]),r.splice(t,0,r.splice(a,1)[0]),h.splice(t,0,h.splice(e,1)[0]),this.listData=l,this.jsonData=o,this.liCollections=h,this.sortedData=r},n.prototype.getSelectedItems=function(){var e=[];return this.selectionSettings.showCheckbox?[].slice.call(this.ulElement.getElementsByClassName("e-check")).forEach(function(i){e.push(t.closest(i,".e-list-item"))}):e=[].slice.call(this.ulElement.getElementsByClassName(s.cssClass.selected)),e},n.prototype.getScopedListBox=function(){var e,i=this;return this.scope&&[].slice.call(document.querySelectorAll(this.scope)).forEach(function(s){t.getComponent(s,i.getModuleName())&&(e=t.getComponent(s,i.getModuleName()))}),e},n.prototype.getGrabbedItems=function(){return Array.prototype.slice.call(this.element.querySelectorAll(".e-grabbed"))},n.prototype.getDragArgs=function(e,i){var s=this.getGrabbedItems();return s.length?i&&s.push(e.target):s=[e.target],t.isBlazor()?{elements:s,items:this.getDataByElems(s),bindEvents:e.bindEvents,dragElement:e.dragElement}:{elements:s,items:this.getDataByElems(s)}},n.prototype.onKeyDown=function(e){this.keyDownHandler(e),e.stopPropagation()},n.prototype.keyDownHandler=function(e){if([32,35,36,37,38,39,40,65].indexOf(e.keyCode)>-1&&!this.allowFiltering){if(e.target&&e.target.className.indexOf("e-edit-template")>-1)return;if(e.preventDefault(),32===e.keyCode&&this.ulElement.children.length)this.selectHandler({target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey});else if(65===e.keyCode&&e.ctrlKey)this.selectAll();else if((38===e.keyCode||40===e.keyCode)&&e.ctrlKey&&e.shiftKey)this.moveUpDown(38===e.keyCode,!0);else if(!this.toolbarSettings.items.length&&!this.tBListBox||39!==e.keyCode&&37!==e.keyCode||!e.ctrlKey)37!==e.keyCode&&39!==e.keyCode&&this.upDownKeyHandler(e);else{var t=this.tBListBox||this.getScopedListBox();39===e.keyCode?e.shiftKey?this.moveAllData(this,t,!0):this.moveData(this,t,!0):e.shiftKey?this.moveAllData(t,this,!0):this.moveData(t,this,!0)}}else this.allowFiltering&&(40!==e.keyCode&&38!==e.keyCode||this.upDownKeyHandler(e))},n.prototype.upDownKeyHandler=function(e){var i=this.ulElement,l=40===e.keyCode||36===e.keyCode?0:i.childElementCount-1,o=i.getElementsByClassName("e-focused")[0]||i.getElementsByClassName(s.cssClass.selected)[0];if(o){if(35!==e.keyCode&&36!==e.keyCode&&(l=Array.prototype.indexOf.call(i.children,o),40===e.keyCode?l++:l--,l<0||l>i.childElementCount-1))return;t.removeClass([o],"e-focused")}var r=i.children[l];if(r){if(-1===(l=this.getValidIndex(r,l,e.keyCode)))return void t.addClass([o],"e-focused");i.children[l].focus(),i.children[l].classList.add("e-focused"),e.ctrlKey||this.selectHandler({target:i.children[l],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},!0)}},n.prototype.KeyUp=function(e){var s=this,l=String.fromCharCode(e.keyCode).match(/\w/);if(t.isNullOrUndefined(l)||(this.isValidKey=!0),this.isValidKey=8===e.keyCode||46===e.keyCode||this.isValidKey,this.isValidKey&&(this.isValidKey=!1,e.keyCode,this.allowFiltering)){var o={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,t,i){o.cancel||(s.isFiltered=!0,s.remoteFilterAction=!0,s.dataUpdater(e,t,i))},event:e,cancel:!1};this.trigger("filtering",o,function(e){s.isDataFetched=!1,e.cancel||""!==s.filterInput.value&&s.isFiltered||(e.cancel||s.isCustomFiltering||e.preventDefaultAction||(s.inputString=s.filterInput.value,s.filteringAction(s.jsonData,new i.Query,s.fields)),s.isFiltered||s.isCustomFiltering||e.preventDefaultAction||s.dataUpdater(s.jsonData,new i.Query,s.fields))})}},n.prototype.filter=function(e,t,i){this.isCustomFiltering=!0,this.filteringAction(e,t,i)},n.prototype.filteringAction=function(e,t,i){this.resetList(e,i,t)},n.prototype.targetElement=function(){return this.targetInputElement=this.list.getElementsByClassName("e-input-filter")[0],this.targetInputElement.value},n.prototype.dataUpdater=function(e,t,i){this.isDataFetched=!1;if(""===this.targetElement().trim()){var s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList;this.remoteCustomValue=!1,this.onActionComplete(s,this.jsonData),this.notify("reOrder",{module:"CheckBoxSelection",enable:this.selectionSettings.showCheckbox,e:this})}else this.resetList(e,i,t)},n.prototype.focusOutHandler=function(){var e=this.list.getElementsByClassName("e-focused")[0];e&&e.classList.remove("e-focused"),this.allowFiltering&&this.refreshClearIcon()},n.prototype.getValidIndex=function(e,t,i){var l=this.ulElement;return(e.classList.contains("e-disabled")||e.classList.contains(s.cssClass.group))&&(40===i||36===i?t++:t--),t<0||t===l.childElementCount?-1:(((e=l.querySelectorAll(".e-list-item")[t]).classList.contains("e-disabled")||e.classList.contains(s.cssClass.group))&&(t=this.getValidIndex(e,t,i)),t)},n.prototype.updateSelectedOptions=function(){var e=this,i=[],s=[];if(t.extend(s,this.value),this.getSelectedItems().forEach(function(t){t.classList.contains("e-grabbed")||i.push(e.getFormattedValue(t.getAttribute("data-value")))}),this.mainList.childElementCount===this.ulElement.childElementCount)if(this.allowFiltering&&this.selectionSettings.showCheckbox){for(var l=0;l<i.length;l++)s.indexOf(i[l])>-1||s.push(i[l]);this.setProperties({value:s},!0)}else this.setProperties({value:i},!0);this.updateSelectTag(),this.updateToolBarState(),this.tBListBox&&this.tBListBox.updateToolBarState()},n.prototype.clearSelection=function(e){var t=this;if(void 0===e&&(e=this.value),this.selectionSettings.showCheckbox){var i;this.getSelectedItems().forEach(function(s){i=t.getFormattedValue(s.getAttribute("data-value")),e.indexOf(i)<0&&(s.getElementsByClassName("e-check")[0].classList.remove("e-check"),s.getElementsByClassName("e-checkbox-wrapper")[0].removeAttribute("aria-checked"),s.removeAttribute("aria-selected"))})}},n.prototype.setSelection=function(e,i,l){var o=this;void 0===e&&(e=this.value),void 0===i&&(i=!0),void 0===l&&(l=!1);var r,n;e&&e.forEach(function(e){var a;if(l)if(t.isBlazor()&&"object"==typeof e){if(a=e[o.fields.text||"text"],t.isNullOrUndefined(a))return;a=o.getValueByText(a)}else a=o.getValueByText(e);else a=e;(r=o.list.querySelector('[data-value="'+a+'"]'))&&(n=o.selectionSettings.showCheckbox?r.getElementsByClassName("e-frame")[0].classList.contains("e-check"):r.classList.contains("e-selected"),(!i&&n||i&&!n&&r)&&(o.selectionSettings.showCheckbox?o.notify("updatelist",{li:r,module:"listbox"}):i?(r.classList.add(s.cssClass.selected),r.setAttribute("aria-selected","true")):(r.classList.remove(s.cssClass.selected),r.removeAttribute("aria-selected"))))}),this.updateSelectTag()},n.prototype.updateSelectTag=function(){var e=this.getSelectTag(),t="";if(e.innerHTML="",this.value){for(var i=0,s=this.value.length;i<s;i++)t+='<option selected value="'+this.value[i]+'"></option>';e.innerHTML+=t}this.checkSelectAll()},n.prototype.checkDisabledState=function(e){return 0===e.ulElement.querySelectorAll("."+s.cssClass.li).length},n.prototype.updateToolBarState=function(){var e=this;if(this.toolbarSettings.items.length){var t=this.getScopedListBox(),i=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0];this.toolbarSettings.items.forEach(function(s){var l=i.querySelector('[data-value="'+s+'"]');switch(s){case"moveAllTo":l.disabled=e.checkDisabledState(e);break;case"moveAllFrom":l.disabled=e.checkDisabledState(t);break;case"moveFrom":l.disabled=!t.value||!t.value.length;break;case"moveUp":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[0]));break;case"moveDown":l.disabled=!(e.value&&e.value.length&&!e.isSelected(e.ulElement.children[e.ulElement.childElementCount-1]));break;default:l.disabled=!e.value||!e.value.length}})}},n.prototype.setCheckboxPosition=function(){var e=this.list;this.initLoad||"Left"!==this.selectionSettings.checkboxPosition||e.classList.remove("e-right"),"Right"===this.selectionSettings.checkboxPosition&&e.classList.add("e-right")},n.prototype.showCheckbox=function(e){var i=0,s=this.list.lastElementChild.querySelectorAll("li"),l=this.list.lastElementChild.getElementsByClassName("e-list-item").length;if(e){if(t.isBlazor()||(this.ulElement=this.renderItems(this.listData,this.fields),this.mainList=this.ulElement,this.list.removeChild(this.list.getElementsByTagName("ul")[0]),this.list.appendChild(this.ulElement)),this.selectionSettings.showSelectAll&&!this.list.getElementsByClassName("e-selectall-parent")[0]){var o=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.showSelectAll=!0,this.selectAllText=o.getConstant("selectAllText"),this.unSelectAllText=o.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}),this.checkSelectAll()}}else if(this.list.getElementsByClassName("e-selectall-parent")[0]&&this.list.removeChild(this.list.getElementsByClassName("e-selectall-parent")[0]),!t.isBlazor()){for(i;i<l;i++)s[i].classList.contains("e-list-item")&&s[i].removeChild(s[i].getElementsByClassName("e-checkbox-wrapper")[0]),s[i].hasAttribute("aria-selected")&&s[i].removeAttribute("aria-selected");this.mainList=this.ulElement}this.value=[]},n.prototype.isSelected=function(e){return!t.isNullOrUndefined(e)&&(e.classList.contains(s.cssClass.selected)||null!==e.querySelector(".e-check"))},n.prototype.getSelectTag=function(){return this.list.getElementsByClassName("e-hidden-select")[0]},n.prototype.getToolElem=function(){return this.list.parentElement.getElementsByClassName("e-listbox-tool")[0]},n.prototype.formResetHandler=function(){this.value=this.initialSelectedOptions},n.prototype.getModuleName=function(){return"listbox"},n.prototype.getPersistData=function(){return this.addOnPersist(["value"])},n.prototype.getLocaleName=function(){return"listbox"},n.prototype.destroy=function(){this.itemTemplate&&t.resetBlazorTemplate(this.element.id+"ItemTemplate","ItemTemplate"),this.unwireEvents(),"EJS-LISTBOX"===this.element.tagName?this.element.innerHTML="":(!t.isBlazor()||t.isBlazor()&&!this.isServerRendered)&&(this.element.style.display="inline-block",this.toolbarSettings.items.length&&(this.list.parentElement.parentElement.insertBefore(this.list,this.list.parentElement),t.detach(this.list.nextElementSibling)),this.list.parentElement.insertBefore(this.element,this.list)),(!t.isBlazor()||t.isBlazor()&&!this.isServerRendered)&&e.prototype.destroy.call(this),this.itemTemplate&&this.clearTemplate()},n.prototype.onPropertyChanged=function(i,l){var r=this.toolbarSettings.items.length?this.list.parentElement:this.list;e.prototype.onPropertyChanged.call(this,i,l),this.setUpdateInitial(["fields","query","dataSource"],i);for(var n=0,a=Object.keys(i);n<a.length;n++)switch(a[n]){case"cssClass":l.cssClass&&t.removeClass([r],l.cssClass.split(" ")),i.cssClass&&t.addClass([r],i.cssClass.split(" "));break;case"enableRtl":i.enableRtl?r.classList.add("e-rtl"):r.classList.remove("e-rtl");break;case"value":t.removeClass(this.list.querySelectorAll("."+s.cssClass.selected),s.cssClass.selected),this.clearSelection(this.value),this.setSelection();break;case"height":this.setHeight();break;case"enabled":this.setEnable();break;case"allowDragAndDrop":i.allowDragAndDrop?this.initDraggable():t.getComponent(this.ulElement,"sortable").destroy();break;case"allowFiltering":this.allowFiltering?this.setFiltering():(this.list.removeChild(this.list.getElementsByClassName("e-filter-parent")[0]),this.filterParent=null,t.removeClass([this.list],"e-filter-list"));break;case"filterBarPlaceholder":this.allowFiltering&&this.filterInput&&o.Input.setPlaceholder(i.filterBarPlaceholder,this.filterInput);break;case"scope":this.allowDragAndDrop&&(t.getComponent(this.ulElement,"sortable").scope=i.scope),this.toolbarSettings.items.length&&(l.scope&&(t.getComponent(document.querySelector(l.scope),this.getModuleName()).tBListBox=null),i.scope&&(t.getComponent(document.querySelector(i.scope),this.getModuleName()).tBListBox=this));break;case"toolbarSettings":var h=void 0,p=i.toolbarSettings.position,u=this.getToolElem();p&&(t.removeClass([r],["e-right","e-left"]),r.classList.add("e-"+p.toLowerCase()),"Left"===p?r.insertBefore(u,this.list):r.appendChild(u)),i.toolbarSettings.items&&(l.toolbarSettings.items.length&&((h=this.list.parentElement).parentElement.insertBefore(this.list,h),t.detach(h)),this.initToolbarAndStyles(),this.wireToolbarEvent());break;case"selectionSettings":var c=i.selectionSettings.showSelectAll,d=i.selectionSettings.showCheckbox;if(!t.isNullOrUndefined(c)){if(this.showSelectAll=c,this.showSelectAll){var m=new t.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale);this.checkBoxSelectionModule.checkAllParent=null,this.showSelectAll=!0,this.selectAllText=m.getConstant("selectAllText"),this.unSelectAllText=m.getConstant("selectAllText"),this.popupWrapper=this.list}this.notify("selectAll",{}),this.checkSelectAll()}t.isNullOrUndefined(d)||this.showCheckbox(d),this.selectionSettings.showCheckbox&&this.setCheckboxPosition();break;case"dataSource":this.isDataSourceUpdate=!0,this.jsonData=[].slice.call(this.dataSource)}};var a;return ce([t.Property("")],n.prototype,"cssClass",void 0),ce([t.Property([])],n.prototype,"value",void 0),ce([t.Property("")],n.prototype,"height",void 0),ce([t.Property(!1)],n.prototype,"allowDragAndDrop",void 0),ce([t.Property(1e3)],n.prototype,"maximumSelectionLength",void 0),ce([t.Property(!1)],n.prototype,"allowFiltering",void 0),ce([t.Property("")],n.prototype,"scope",void 0),ce([t.Property(!0)],n.prototype,"ignoreCase",void 0),ce([t.Property(null)],n.prototype,"filterBarPlaceholder",void 0),ce([t.Event()],n.prototype,"beforeItemRender",void 0),ce([t.Event()],n.prototype,"filtering",void 0),ce([t.Event()],n.prototype,"select",void 0),ce([t.Event()],n.prototype,"change",void 0),ce([t.Event()],n.prototype,"beforeDrop",void 0),ce([t.Event()],n.prototype,"dragStart",void 0),ce([t.Event()],n.prototype,"drag",void 0),ce([t.Event()],n.prototype,"drop",void 0),ce([t.Event()],n.prototype,"dataBound",void 0),ce([t.Property(null)],n.prototype,"groupTemplate",void 0),ce([t.Property("No records found")],n.prototype,"noRecordsTemplate",void 0),ce([t.Property("Request failed")],n.prototype,"actionFailureTemplate",void 0),ce([t.Property(1e3)],n.prototype,"zIndex",void 0),ce([t.Property(!1)],n.prototype,"ignoreAccent",void 0),ce([t.Complex({},me)],n.prototype,"toolbarSettings",void 0),ce([t.Complex({},de)],n.prototype,"selectionSettings",void 0),n=a=ce([t.NotifyPropertyChanges],n)}(B),ve={backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",filterParent:"e-filter-parent",clearIcon:"e-clear-icon"};return he.Inject(pe),fe.Inject(pe),e.incrementalSearch=a,e.Search=h,e.highlightSearch=p,e.revertHighlightSearch=c,e.FieldSettings=A,e.dropDownBaseClasses=k,e.DropDownBase=B,e.dropDownListClasses=I,e.DropDownList=N,e.Fields=z,e.TreeSettings=K,e.DropDownTree=_,e.ComboBox=X,e.AutoComplete=Z,e.MultiSelect=he,e.CheckBoxSelection=pe,e.createFloatLabel=d,e.updateFloatLabelState=m,e.removeFloating=f,e.setPlaceHolder=v,e.floatLabelFocus=y,e.floatLabelBlur=g,e.SelectionSettings=de,e.ToolbarSettings=me,e.ListBox=fe,e}({},ej.base,ej.data,ej.lists,ej.popups,ej.inputs,ej.buttons,ej.navigations),this.ejs=ej;
- /*!
- * filename: ej2-navigations.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.navigations=function(e,t,i,s,n,r,l){"use strict";function o(e,t,i,s,n,r){var l,o,d=t.parentElement;if("vscroll"===s?(l=r||t.getBoundingClientRect().height,o=i.getBoundingClientRect().height):(l=t.getBoundingClientRect().width,o=i.getBoundingClientRect().width),l<o)return a(e,t,i,s,n,r);if(d){var h=d.getBoundingClientRect().width;return h<l&&"hscroll"===s?(o=h,t.style.maxWidth=h+"px",a(e,t,i,s,n,r)):i}return i}function a(e,i,s,n,r,l){var o=e("div",{className:"e-menu-"+n});i.appendChild(o),o.appendChild(s),l?(o.style.overflow="hidden",o.style.height=l+"px"):(o.style.maxHeight=i.style.maxHeight,i.style.overflow="hidden");return"vscroll"===n?new m({enableRtl:r},o).scrollStep=t.select(".e-"+n+"-bar",i).offsetHeight/2:new p({enableRtl:r},o).scrollStep=t.select(".e-"+n+"-bar",i).offsetWidth,o}function d(e,i,s){if(e){var n=t.select(".e-menu-parent",i);n?s&&s!==n||(e.destroy(),i.parentElement.appendChild(n),t.detach(i)):(e.destroy(),t.detach(i))}}var h=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),c=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},p=function(e){function i(t,i){return e.call(this,t,i)||this}return h(i,e),i.prototype.preRender=function(){this.browser=t.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=t.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=t.getUniqueID("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add("e-rtl")},i.prototype.render=function(){this.touchModule=new t.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),t.EventHandler.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add("e-scroll-device"),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},i.prototype.setScrollState=function(){t.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"});t.setAttribute("tabindex","-1");for(var i=this.element,s=0,n=[].slice.call(i.children);s<n.length;s++){var r=n[s];e.appendChild(r)}t.appendChild(e),i.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},i.prototype.getPersistData=function(){var e=["scrollStep"];return this.addOnPersist(e)},i.prototype.getModuleName=function(){return"hScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",i.classList.remove("e-hscroll"),i.classList.remove("e-scroll-device");var s=t.selectAll(".e-"+i.id+"_nav.e-scroll-nav",i),n=t.selectAll(".e-scroll-overlay",i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var r=0,l=[].slice.call(this.scrollItems.children);r<l.length;r++){var o=l[r];i.appendChild(o)}this.uniqueId&&this.element.removeAttribute("id"),t.detach(this.scrollEle),s.length>0&&(t.detach(s[0]),t.isNullOrUndefined(s[1])||t.detach(s[1])),t.EventHandler.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},i.prototype.disable=function(e){var i=t.selectAll(".e-scroll-nav:not(.e-overlay)",this.element);e?this.element.classList.add("e-overlay"):this.element.classList.remove("e-overlay"),[].slice.call(i).forEach(function(t){t.setAttribute("tabindex",e?"-1":"0")})},i.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),i=this.createElement("div",{className:"e-scroll-overlay e-scroll-right-overlay"}),s="e-"+e.id.concat("_nav e-scroll-nav e-scroll-right-nav"),n=this.createElement("div",{id:t.concat("_right"),className:s}),r=this.createElement("div",{className:"e-nav-right-arrow e-nav-arrow e-icons"});n.appendChild(r);var l=this.createElement("div",{className:"e-scroll-overlay e-scroll-left-overlay"});this.ieCheck&&n.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(n),e.insertBefore(l,e.firstChild),this.eventBinding([n])},i.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav e-scroll-nav e-scroll-right-nav"),s=this.createElement("div",{id:t.concat("_right"),className:i});s.setAttribute("aria-disabled","false");var n=this.createElement("div",{className:"e-nav-right-arrow e-nav-arrow e-icons"}),r="e-"+e.id.concat("_nav e-scroll-nav e-scroll-left-nav"),l=this.createElement("div",{id:t.concat("_left"),className:r+" e-overlay"});l.setAttribute("aria-disabled","true");var o=this.createElement("div",{className:"e-nav-left-arrow e-nav-arrow e-icons"});l.appendChild(o),s.appendChild(n),e.appendChild(s),e.insertBefore(l,e.firstChild),this.ieCheck&&(s.classList.add("e-ie-align"),l.classList.add("e-ie-align")),this.eventBinding([s,l])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){var i=function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)};this.keyTimer=window.setTimeout(function(){i()},100)}},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var i=this;[].slice.call(e).forEach(function(e){new t.Touch(e,{tapHold:i.tabHoldHandler.bind(i),tapHoldThreshold:500}),e.addEventListener("keydown",i.onKeyPress.bind(i)),e.addEventListener("keyup",i.onKeyUp.bind(i)),e.addEventListener("mouseup",i.repeatScroll.bind(i)),e.addEventListener("touchend",i.repeatScroll.bind(i)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),t.EventHandler.add(e,"click",i.clickEventHandler,i)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target;i=this.contains(i,"e-scroll-nav")?i.firstElementChild:i;var s=function(){t.eleScrolling(10,i,!0)};this.timeout=window.setInterval(function(){s()},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=this.element,n=t.classList;n.contains("e-scroll-nav")&&(n=t.querySelector(".e-nav-arrow").classList),this.contains(s,"e-rtl")&&this.browserCheck&&(e=-e),!this.contains(s,"e-rtl")||this.browserCheck||this.ieCheck?n.contains("e-nav-right-arrow")?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains("e-nav-left-arrow")?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.swipeHandler=function(e){var t,i=this.scrollEle;t=e.velocity<=1?e.distanceX/(10*e.velocity):e.distanceX/e.velocity;var s=.5,n=function(){var r=Math.sin(s);r<=0?window.cancelAnimationFrame(r):("Left"===e.swipeDirection?i.scrollLeft+=t*r:"Right"===e.swipeDirection&&(i.scrollLeft-=t*r),s-=.5,window.requestAnimationFrame(n))};n()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e},i.prototype.frameScrollRequest=function(e,i,s){var n=this;if(s)return void this.scrollUpdating(e,i);this.customStep||[].slice.call(t.selectAll(".e-scroll-overlay",this.element)).forEach(function(t){e-=t.offsetWidth});var r=function(){var t,s;n.contains(n.element,"e-rtl")&&n.browserCheck?(t=-e,s=-10):(t=e,s=10),t<10?window.cancelAnimationFrame(s):(n.scrollUpdating(s,i),e-=s,window.requestAnimationFrame(r))};r()},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,"e-rtl")&&(i=-i),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+i:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-i)},i.prototype.arrowDisabling=function(e,i){if(this.isDevice){var s=(t.isNullOrUndefined(e)?i:e).querySelector(".e-nav-arrow");t.isNullOrUndefined(e)?t.classList(s,["e-nav-right-arrow"],["e-nav-left-arrow"]):t.classList(s,["e-nav-left-arrow"],["e-nav-right-arrow"])}else e.classList.add("e-overlay"),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove("e-overlay"),i.setAttribute("aria-disabled","false"),i.setAttribute("tabindex","0");this.repeatScroll()},i.prototype.scrollHandler=function(e){var t=e.target,i=t.offsetWidth,s=this.element,n=this.element.querySelector(".e-scroll-left-nav"),r=this.element.querySelector(".e-scroll-right-nav"),l=this.element.querySelector(".e-scroll-left-overlay"),o=this.element.querySelector(".e-scroll-right-overlay"),a=t.scrollLeft;if(a<=0&&(a=-a),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(l=this.element.querySelector(".e-scroll-right-overlay"),o=this.element.querySelector(".e-scroll-left-overlay")),l.style.width=a<40?a+"px":"40px",t.scrollWidth-Math.ceil(i+a)<40?o.style.width=t.scrollWidth-Math.ceil(i+a)+"px":o.style.width="40px"),0===a)!this.contains(s,"e-rtl")||this.browserCheck||this.ieCheck?this.arrowDisabling(n,r):this.arrowDisabling(r,n);else if(Math.ceil(i+a+.1)>=t.scrollWidth)!this.contains(s,"e-rtl")||this.browserCheck||this.ieCheck?this.arrowDisabling(r,n):this.arrowDisabling(n,r);else{var d=this.element.querySelector(".e-scroll-nav.e-overlay");d&&(d.classList.remove("e-overlay"),d.setAttribute("aria-disabled","false"),d.setAttribute("tabindex","0"))}},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")}},c([t.Property(null)],i.prototype,"scrollStep",void 0),i=c([t.NotifyPropertyChanges],i)}(t.Component),u=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),f=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},m=function(e){function i(t,i){return e.call(this,t,i)||this}return u(i,e),i.prototype.preRender=function(){this.browser=t.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=t.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=t.getUniqueID("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add("e-rtl")},i.prototype.render=function(){this.touchModule=new t.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),t.EventHandler.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add("e-scroll-device"),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),t.EventHandler.add(this.element,"wheel",this.wheelEventHandler,this)},i.prototype.setScrollState=function(){t.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){var e=t.createElement("div",{className:"e-vscroll-content"}),i=t.createElement("div",{className:"e-vscroll-bar"});i.setAttribute("tabindex","-1");for(var s=this.element,n=0,r=[].slice.call(s.children);n<r.length;n++){var l=r[n];e.appendChild(l)}i.appendChild(e),s.appendChild(i),i.style.overflowY="hidden",this.scrollEle=i,this.scrollItems=e},i.prototype.getPersistData=function(){var e=["scrollStep"];return this.addOnPersist(e)},i.prototype.getModuleName=function(){return"vScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",t.removeClass([this.element],["e-vscroll","e-scroll-device"]);var s=t.selectAll(".e-"+i.id+"_nav.e-scroll-nav",i),n=t.selectAll(".e-scroll-overlay",i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var r=0,l=[].slice.call(this.scrollItems.children);r<l.length;r++){var o=l[r];i.appendChild(o)}this.uniqueId&&this.element.removeAttribute("id"),t.detach(this.scrollEle),s.length>0&&(t.detach(s[0]),t.isNullOrUndefined(s[1])||t.detach(s[1])),t.EventHandler.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},i.prototype.disable=function(e){var i=t.selectAll(".e-scroll-nav:not(.e-overlay)",this.element);e?this.element.classList.add("e-overlay"):this.element.classList.remove("e-overlay"),[].slice.call(i).forEach(function(t){t.setAttribute("tabindex",e?"-1":"0")})},i.prototype.createOverlayElement=function(e){var i=e.id.concat("_nav"),s=t.createElement("div",{className:"e-scroll-overlay e-scroll-down-overlay"}),n="e-"+e.id.concat("_nav e-scroll-nav e-scroll-down-nav"),r=t.createElement("div",{id:i.concat("down"),className:n}),l=t.createElement("div",{className:"e-nav-down-arrow e-nav-arrow e-icons"});r.appendChild(l);var o=t.createElement("div",{className:"e-scroll-overlay e-scroll-up-overlay"});this.ieCheck&&r.classList.add("e-ie-align"),e.appendChild(s),e.appendChild(r),e.insertBefore(o,e.firstChild),this.eventBinding([r])},i.prototype.createNavIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav e-scroll-nav e-scroll-down-nav"),n=t.createElement("div",{id:i.concat("_down"),className:s});n.setAttribute("aria-disabled","false");var r=t.createElement("div",{className:"e-nav-down-arrow e-nav-arrow e-icons"}),l="e-"+e.id.concat("_nav e-scroll-nav e-scroll-up-nav"),o=t.createElement("div",{id:i.concat("_up"),className:l+" e-overlay"});o.setAttribute("aria-disabled","true");var a=t.createElement("div",{className:"e-nav-up-arrow e-nav-arrow e-icons"});o.appendChild(a),n.appendChild(r),n.setAttribute("tabindex","0"),e.appendChild(n),e.insertBefore(o,e.firstChild),this.ieCheck&&(n.classList.add("e-ie-align"),o.classList.add("e-ie-align")),this.eventBinding([n,o])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){var i=function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)};this.keyTimer=window.setTimeout(function(){i()},100)}},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var i=this;[].slice.call(e).forEach(function(e){new t.Touch(e,{tapHold:i.tabHoldHandler.bind(i),tapHoldThreshold:500}),e.addEventListener("keydown",i.onKeyPress.bind(i)),e.addEventListener("keyup",i.onKeyUp.bind(i)),e.addEventListener("mouseup",i.repeatScroll.bind(i)),e.addEventListener("touchend",i.repeatScroll.bind(i)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),t.EventHandler.add(e,"click",i.clickEventHandler,i)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target;i=this.contains(i,"e-scroll-nav")?i.firstElementChild:i;var s=function(){t.eleScrolling(10,i,!0)};this.timeout=window.setInterval(function(){s()},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=t.classList;s.contains("e-scroll-nav")&&(s=t.querySelector(".e-nav-arrow").classList),s.contains("e-nav-down-arrow")?this.frameScrollRequest(e,"add",i):s.contains("e-nav-up-arrow")&&this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.wheelEventHandler=function(e){e.preventDefault(),this.frameScrollRequest(this.scrollStep,e.deltaY>0?"add":"",!1)},i.prototype.swipeHandler=function(e){var t,i=this.scrollEle;t=e.velocity<=1?e.distanceY/(10*e.velocity):e.distanceY/e.velocity;var s=.5,n=function(){var r=Math.sin(s);r<=0?window.cancelAnimationFrame(r):("Up"===e.swipeDirection?i.scrollTop+=t*r:"Down"===e.swipeDirection&&(i.scrollTop-=t*r),s-=.02,window.requestAnimationFrame(n))};n()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},i.prototype.frameScrollRequest=function(e,i,s){var n=this;if(s)return void this.scrollUpdating(e,i);this.customStep||[].slice.call(t.selectAll(".e-scroll-overlay",this.element)).forEach(function(t){e-=t.offsetHeight});var r=function(){e<10?window.cancelAnimationFrame(10):(n.scrollUpdating(10,i),e-=10,window.requestAnimationFrame(r))};r()},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceY;"Up"===e.scrollDirection?t.scrollTop=t.scrollTop+i:"Down"===e.scrollDirection&&(t.scrollTop=t.scrollTop-i)},i.prototype.arrowDisabling=function(e,i){if(this.isDevice){var s=(t.isNullOrUndefined(e)?i:e).querySelector(".e-nav-arrow");t.isNullOrUndefined(e)?t.classList(s,["e-nav-down-arrow"],["e-nav-up-arrow"]):t.classList(s,["e-nav-up-arrow"],["e-nav-down-arrow"])}else e.classList.add("e-overlay"),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove("e-overlay"),i.setAttribute("aria-disabled","false"),i.setAttribute("tabindex","0");this.repeatScroll()},i.prototype.scrollEventHandler=function(e){var t=e.target,i=t.offsetHeight,s=this.element.querySelector(".e-scroll-up-nav"),n=this.element.querySelector(".e-scroll-down-nav"),r=this.element.querySelector(".e-scroll-up-overlay"),l=this.element.querySelector(".e-scroll-down-overlay"),o=t.scrollTop;if(o<=0&&(o=-o),this.isDevice&&(r.style.height=o<40?o+"px":"40px",t.scrollHeight-Math.ceil(i+o)<40?l.style.height=t.scrollHeight-Math.ceil(i+o)+"px":l.style.height="40px"),0===o)this.arrowDisabling(s,n);else if(Math.ceil(i+o+.1)>=t.scrollHeight)this.arrowDisabling(n,s);else{var a=this.element.querySelector(".e-scroll-nav.e-overlay");a&&(a.classList.remove("e-overlay"),a.setAttribute("aria-disabled","false"),a.setAttribute("tabindex","0"))}},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")}},f([t.Property(null)],i.prototype,"scrollStep",void 0),i=f([t.NotifyPropertyChanges],i)}(t.Component),v=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),g=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},y="e-focused",b="e-menu-header",C="e-selected",N="e-menu-item",E="e-menu-hide",x="e-menu-popup",O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return v(i,e),g([t.Property("id")],i.prototype,"itemId",void 0),g([t.Property("parentId")],i.prototype,"parentId",void 0),g([t.Property("text")],i.prototype,"text",void 0),g([t.Property("iconCss")],i.prototype,"iconCss",void 0),g([t.Property("url")],i.prototype,"url",void 0),g([t.Property("separator")],i.prototype,"separator",void 0),g([t.Property("items")],i.prototype,"children",void 0),i}(t.ChildProperty),S=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return v(i,e),g([t.Property(null)],i.prototype,"iconCss",void 0),g([t.Property("")],i.prototype,"id",void 0),g([t.Property(!1)],i.prototype,"separator",void 0),g([t.Collection([],i)],i.prototype,"items",void 0),g([t.Property("")],i.prototype,"text",void 0),g([t.Property("")],i.prototype,"url",void 0),i}(t.ChildProperty),w=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return v(i,e),g([t.Property("SlideDown")],i.prototype,"effect",void 0),g([t.Property(400)],i.prototype,"duration",void 0),g([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),I=function(e){function n(i,s){var n=e.call(this,i,s)||this;return n.navIdx=[],n.animation=new t.Animation({}),n.isTapHold=!1,n.tempItem=[],n.showSubMenuOn="Auto",n}return v(n,e),n.prototype.preRender=function(){if(!this.isMenu){r=void 0;if("EJS-CONTEXTMENU"===this.element.tagName){r=this.createElement("ul",{id:t.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()});var e=t.getValue("ej2_instances",this.element);t.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=r,t.setValue("ej2_instances",e,this.element)}else{r=this.createElement("ul",{id:t.getUniqueID(this.getModuleName())}),t.append([].slice.call(this.element.cloneNode(!0).children),r);var i=this.element.nextElementSibling;i?this.element.parentElement.insertBefore(r,i):this.element.parentElement.appendChild(r),this.clonedElement=r}this.clonedElement.style.display="none"}if("EJS-MENU"===this.element.tagName){for(var s=this.element,n=t.getValue("ej2_instances",s),r=this.createElement("ul"),l=this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,a=s.attributes.length;o<a;o++)r.setAttribute(s.attributes[o].nodeName,s.attributes[o].nodeValue);s.parentNode.insertBefore(l,s),t.detach(s),s=r,l.appendChild(s),t.setValue("ej2_instances",n,s),this.clonedElement=l,this.element=s,this.element.id||(this.element.id=t.getUniqueID(this.getModuleName()))}},n.prototype.render=function(){var e=this;if(this.initialize(),this.renderItems(),this.isMenu&&this.template&&t.isBlazor()){var i=this.element.id+"Template";t.resetBlazorTemplate(i,"Template"),Object.keys(t.blazorTemplates).length&&t.extend(this.tempItem,t.blazorTemplates[i],[],!0),t.updateBlazorTemplate(i,"Template",this)}this.wireEvents(),this.renderComplete();var s=this.getWrapper();this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){o(e.createElement,s,e.element,"hscroll",e.enableRtl)})},n.prototype.initialize=function(){var e=this.getWrapper();e||(e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.isMenu?this.element.parentElement.insertBefore(e,this.element):document.body.appendChild(e)),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.enableRtl&&e.classList.add("e-rtl"),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick},n.prototype.renderItems=function(){if(!this.items.length){var e=i.ListBase.createJsonFromElement(this.element,{fields:{child:"items"}});this.setProperties({items:e},!0),t.isBlazor()?this.element=this.removeChildElement(this.element):this.element.innerHTML=""}var s=this.createItems(this.items);if(t.append(Array.prototype.slice.call(s.children),this.element),this.element.classList.add("e-menu-parent"),this.isMenu&&(!this.hamburgerMode&&this.element.classList.contains("e-vertical")&&this.setBlankIconStyle(this.element),this.enableScrolling)){var n=this.getWrapper();this.element.classList.contains("e-vertical")?o(this.createElement,n,this.element,"vscroll",this.enableRtl):o(this.createElement,n,this.element,"hscroll",this.enableRtl)}},n.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var i=void 0,n=t.selectAll(this.target),r=0,l=n.length;r<l;r++)i=n[r],this.isMenu?t.EventHandler.add(i,"click",this.menuHeaderClickHandler,this):t.Browser.isIos?new t.Touch(i,{tapHold:this.touchHandler.bind(this)}):t.EventHandler.add(i,"contextmenu",this.cmenuHandler,this);if(this.targetElement=i,!this.isMenu){t.EventHandler.add(this.targetElement,"scroll",this.scrollHandler,this);for(var o=0,a=s.getScrollableParent(this.targetElement);o<a.length;o++){var d=a[o];t.EventHandler.add(d,"scroll",this.scrollHandler,this)}}}t.Browser.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),t.EventHandler.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),t.EventHandler.add(document,"mousedown",this.delegateMouseDownHandler,this)),this.delegateClickHandler=this.clickHandler.bind(this),t.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=t.rippleEffect(e,{selector:"."+N})},n.prototype.wireKeyboardEvent=function(e){var i={downarrow:"downarrow",uparrow:"uparrow",enter:"enter",leftarrow:"leftarrow",rightarrow:"rightarrow",escape:"escape"};this.isMenu&&(i.home="home",i.end="end"),new t.KeyboardEvents(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:i})},n.prototype.mouseDownHandler=function(e){t.closest(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||t.closest(e.target,".e-"+this.getModuleName()+"-popup")||this.closeMenu(this.isMenu?null:this.navIdx.length,e)},n.prototype.keyBoardHandler=function(e){var i="",s=e.target,n=this.isMenu&&!this.hamburgerMode&&!this.element.classList.contains("e-vertical")&&this.navIdx.length<1;if(e.preventDefault(),this.enableScrolling&&13===e.keyCode&&s.classList.contains("e-scroll-nav")&&this.removeLIStateByClass([y,C],[t.closest(s,".e-"+this.getModuleName()+"-wrapper")]),n)switch(e.action){case"rightarrow":i="rightarrow",e.action="downarrow";break;case"leftarrow":i="leftarrow",e.action="uparrow";break;case"downarrow":i="downarrow",e.action="rightarrow";break;case"uparrow":i="uparrow",e.action=""}else if(this.enableRtl)switch(e.action){case"leftarrow":n=!0,i="leftarrow",e.action="rightarrow";break;case"rightarrow":n=!0,i="rightarrow",e.action="leftarrow"}switch(e.action){case"downarrow":case"uparrow":case"end":case"home":this.upDownKeyHandler(e);break;case"rightarrow":this.rightEnterKeyHandler(e);break;case"leftarrow":this.leftEscKeyHandler(e);break;case"enter":this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):this.rightEnterKeyHandler(e);break;case"escape":this.leftEscKeyHandler(e)}n&&(e.action=i)},n.prototype.upDownKeyHandler=function(e){var t=this.getUlByNavIdx(),i="downarrow"===e.action||"home"===e.action?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,y);n&&("end"!==e.action&&"home"!==e.action&&(s=this.getIdx(t,n)),n.classList.remove(y),"end"!==e.action&&"home"!==e.action&&("downarrow"===e.action?s++:s--,s===("downarrow"===e.action?t.childElementCount:-1)&&(s=i)));var r=t.children[s];s=this.isValidLI(r,s,e.action),t.children[s].classList.add(y),t.children[s].focus()},n.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx();return(e.classList.contains("e-separator")||e.classList.contains("e-disabled")||e.classList.contains(E))&&("downarrow"===i||"rightarrow"===i?t++:t--),((e=s.children[t]).classList.contains("e-separator")||e.classList.contains("e-disabled")||e.classList.contains(E))&&(t=this.isValidLI(e,t,i)),t},n.prototype.getUlByNavIdx=function(e){if(void 0===e&&(e=this.navIdx.length),this.isMenu){var i=[this.getWrapper()].concat([].slice.call(t.selectAll("."+x)))[e];return t.isNullOrUndefined(i)?null:t.select(".e-menu-parent",i)}return this.getWrapper().children[e]},n.prototype.rightEnterKeyHandler=function(e){var t,i=this.getUlByNavIdx(),s=this.getLIByClass(i,y);if(s){var n=this.getIdx(i,s),r=this.navIdx.concat(n),l=this.getItem(r);l.items.length?(this.navIdx.push(n),this.keyType="right",this.action=e.action,this.openMenu(s,l,-1,-1,e)):"enter"===e.action&&(this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([C],[this.getWrapper()]):s.classList.remove(y),s.classList.add(C),t={element:s,item:l,event:e},this.trigger("select",t),this.closeMenu(null,e))}},n.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):"escape"===e.action&&this.closeMenu(null,e)},n.prototype.scrollHandler=function(e){this.closeMenu(null,e)},n.prototype.touchHandler=function(e){this.isTapHold=!0,this.cmenuHandler(e.originalEvent)},n.prototype.cmenuHandler=function(e){e.preventDefault(),this.isCMenu=!0,this.pageX=e.changedTouches?e.changedTouches[0].pageX+1:e.pageX+1,this.pageY=e.changedTouches?e.changedTouches[0].pageY+1:e.pageY+1,this.closeMenu(null,e),this.isCMenu&&(this.canOpen(e.target)&&this.openMenu(null,null,this.pageY,this.pageX,e),this.isCMenu=!1)},n.prototype.closeMenu=function(e,i,n){var r=this;if(void 0===e&&(e=0),void 0===i&&(i=null),this.isMenuVisible()){var l,o,a=void 0,h=this.getWrapper(),c=void 0,p=this.getPopups(),u=!1,f=this.isMenu?p.length+1:h.childElementCount,v=this.isMenu&&1!==f?t.select(".e-ul",p[f-2]):t.selectAll(".e-menu-parent",h)[f-1];if(this.isMenu&&v.classList.contains("e-menu")&&((a=this.getLIByClass(v,C))&&a.classList.remove(C),u=!0),!u){var g=i&&i.target&&this.getLI(i.target);l=this.navIdx.length?this.getItem(this.navIdx):null,o=l?l.items:this.items,c={element:v,parentItem:this.isMenu&&t.isBlazor()?this.getMenuItemModel(l,e):l,items:o,event:i,cancel:!1,isFocused:!0},this.trigger("beforeClose",c,function(a){var h,c,p,u="",f=!a.cancel;(f||r.isCMenu)&&(r.isMenu?(h=t.closest(v,"."+x),r.hamburgerMode&&(h.parentElement.style.minHeight="",t.closest(v,".e-menu-item").setAttribute("aria-expanded","false")),r.unWireKeyboardEvent(h),d(t.getInstance(h.children[0],m),h.children[0]),(p=t.getInstance(h,s.Popup)).hide(),u=h.id,p.destroy(),t.detach(h)):r.toggleAnimation(v,!1),c={element:v,parentItem:l,items:o},r.trigger("onClose",c),r.navIdx.pop()),r.updateReactTemplate();var b,N,E,O=r.getWrapper()&&r.getUlByNavIdx();r.isCMenu&&(r.canOpen(i.target)&&r.openMenu(null,null,r.pageY,r.pageX,i),r.isCMenu=!1),r.isMenu&&O&&u.length&&(b=new RegExp("(.*)-ej2menu-"+r.element.id+"-popup").exec(u)[1],N=O.querySelector('[id="'+b+'"]'),E=g&&O.querySelector('[id="'+g.id+'"]'));var S=g&&g.querySelectorAll(".e-menu-item");if(f&&r.hamburgerMode&&e&&!S.length)r.afterCloseMenu(i);else if(f&&!r.hamburgerMode&&r.navIdx.length&&N&&!E){var w=i&&i.target.classList.contains("e-vscroll")?t.closest(i.target,".e-menu-wrapper"):null;w?(w=w.querySelector(".e-menu-item"),(r.showItemOnClick||w&&r.getIndex(w.id,!0).length<=r.navIdx.length)&&r.closeMenu(r.navIdx[r.navIdx.length-1],i,!0)):r.closeMenu(r.navIdx[r.navIdx.length-1],i)}else if(f&&!n&&!e&&(r.hamburgerMode&&r.navIdx.length||1===r.navIdx.length))r.closeMenu(null,i);else if(f&&t.isNullOrUndefined(e)&&r.navIdx.length)r.closeMenu(null,i);else if(!f||r.isMenu||e||0!==r.navIdx.length||r.isMenusClosed)if(f&&r.isMenu&&i&&i.target&&0!==r.navIdx.length&&t.closest(i.target,".e-menu-parent.e-control"))r.closeMenu(0,i);else{if(!f||"right"!==r.keyType&&"click"!==r.keyType){var I=r.getUlByNavIdx(),k=r.getLIByClass(I,C);if(k&&(k.setAttribute("aria-expanded","false"),k.classList.remove(C),a.isFocused&&g&&(k.classList.add(y),k.focus())),!f&&r.hamburgerMode&&g&&"false"===g.getAttribute("aria-expanded")&&"true"===g.getAttribute("aria-haspopup")){t.closest(g,".e-menu-parent.e-control")?r.navIdx=[]:r.navIdx.pop(),r.navIdx.push(r.cliIdx);var L=r.getItem(r.navIdx);g.setAttribute("aria-expanded","true"),r.openMenu(g,L,-1,-1,i)}}else r.afterCloseMenu(i);r.navIdx.length<1&&("Hover"!==r.showSubMenuOn&&"Click"!==r.showSubMenuOn||(r.showItemOnClick=r.defaultOption,r.showSubMenuOn="Auto"))}else r.isMenusClosed=!0,r.closeMenu(0,i);r.removeStateWrapper()})}}},n.prototype.updateReactTemplate=function(){if(this.isReact&&this.template&&0===this.navIdx.length){var e=this.portals.splice(0,this.items.length);this.clearTemplate(["template"]),this.portals=e,this.renderReactTemplates()}},n.prototype.getMenuItemModel=function(e,i){if(t.isNullOrUndefined(e))return null;t.isNullOrUndefined(i)&&(i=0);var s=this.getFields(i);return{text:e[s.text],id:e[s.id],items:e[s.child],separator:e[s.separator],iconCss:e[s.iconCss],url:e[s.url]}},n.prototype.getPopups=function(){var e=this,i=[];return[].slice.call(document.querySelectorAll("."+x)).forEach(function(s){!t.isNullOrUndefined(s.querySelector("."+N))&&e.getIndex(s.querySelector("."+N).id,!0).length&&i.push(s)}),i},n.prototype.isMenuVisible=function(){return this.navIdx.length>0||this.element.classList.contains("e-contextmenu")&&t.isVisible(this.element).valueOf()},n.prototype.canOpen=function(e){var i=!0;if(this.filter){i=!1;for(var s=this.filter.split(" "),n=0,r=s.length;n<r;n++)if(t.closest(e,"."+s[n])){i=!0;break}}return i},n.prototype.openMenu=function(e,i,n,r,l,o){var a=this;void 0===n&&(n=0),void 0===r&&(r=0),void 0===l&&(l=null),void 0===o&&(o=this.targetElement);var d=this.getWrapper();this.lItem=e;var h=""!==this.element.id?this.element.id:"menu";if(this.isMenusClosed=!1,t.isNullOrUndefined(n)&&(n=-1),t.isNullOrUndefined(r)&&(r=-1),e){if(this.uList=this.createItems(i[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&t.Browser.isDevice){d.lastChild.style.display="none";var c={text:i[this.getField("text")].toString(),iconCss:"e-icons e-previous"},p=new S(this.items[0],"items",c,!0),u=this.createItems([p]).children[0];u.classList.add(b),this.uList.insertBefore(u,this.uList.children[0])}this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+x,id:e.id+"-ej2menu-"+h+"-popup"}),this.hamburgerMode?(n=e.offsetHeight,e.appendChild(this.popupWrapper)):document.body.appendChild(this.popupWrapper),this.isNestedOrVertical=this.element.classList.contains("e-vertical")||1!==this.navIdx.length,this.popupObj=this.generatePopup(this.popupWrapper,this.uList,e,this.isNestedOrVertical),this.template&&this.renderReactTemplates(),this.hamburgerMode?this.calculateIndentSize(this.uList,e):(this.cssClass&&t.addClass([this.popupWrapper],this.cssClass.split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,i,l,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){a.triggerBeforeOpen(e,a.uList,i,l,0,0,"menu")},this.hoverDelay))):(this.uList.style.zIndex=this.element.style.zIndex,d.appendChild(this.uList),!this.showItemOnClick&&this.hoverDelay?(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){a.triggerBeforeOpen(e,a.uList,i,l,n,r,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,i,l,n,r,"none"))}else this.uList=this.element,this.uList.style.zIndex=s.getZindexPartial(o||this.element).toString(),this.triggerBeforeOpen(e,this.uList,i,l,n,r,"none");if(this.isMenu&&this.template&&t.isBlazor()){var f=this.element.id+"Template";if(Object.keys(t.blazorTemplates).length){var m=t.blazorTemplates[f];this.tempItem=this.tempItem.concat(m),t.blazorTemplates[f]=this.tempItem}t.updateBlazorTemplate(f,"Template",this)}},n.prototype.calculateIndentSize=function(e,t){var i=getComputedStyle(t),s=parseInt(i.textIndent,10);this.navIdx.length<2&&!t.classList.contains("e-blankicon")?s*=2:s+=s/4,e.style.textIndent=s+"px";var n=e.querySelectorAll(".e-blankicon");if(n&&n.length)for(var r=e.querySelector(".e-menu-icon"),l=getComputedStyle(r),o=parseInt(l.marginRight,10)+r.offsetWidth+s,a=0;a<n.length;a++)n[a].style.textIndent=o+"px"},n.prototype.generatePopup=function(e,i,n,r){var l=this,o=new s.Popup(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:n,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:r||this.enableRtl?"none":"flip",Y:"fit"},position:r&&!this.hamburgerMode?{X:"right",Y:"top"}:{X:"left",Y:"bottom"},targetType:"relative",enableRtl:this.enableRtl,content:i,open:function(){var e=t.select(".e-menu-vscroll",o.element);e&&(e.style.height="inherit",e.style.maxHeight="");var i=t.select(".e-ul",o.element);o.element.style.maxHeight="",i.focus(),l.triggerOpen(i)}});return o},n.prototype.createHeaderContainer=function(e){e=e||this.getWrapper();var i=this.createElement("span",{className:"e-"+this.getModuleName()+"-header"}),s=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.title):this.title,n=this.createElement("span",{className:"e-"+this.getModuleName()+"-title",innerHTML:s}),r=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});i.appendChild(n),i.appendChild(r),e.insertBefore(i,this.element)},n.prototype.openHamburgerMenu=function(e){this.hamburgerMode&&this.triggerBeforeOpen(null,this.element,null,e,0,0,"hamburger")},n.prototype.closeHamburgerMenu=function(e){var t=this,i={element:this.element,parentItem:null,event:e,items:this.items,cancel:!1};this.trigger("beforeClose",i,function(i){i.cancel||(t.closeMenu(null,e),t.element.classList.add("e-hide-menu"),t.trigger("onClose",{element:t.element,parentItem:null,items:t.items}))})},n.prototype.callFit=function(e,t,i,n,r){return s.fit(e,null,{X:t,Y:i},{top:n,left:r})},n.prototype.triggerBeforeOpen=function(e,i,s,n,r,l,a){var d=this,h=e?s[this.getField("children",this.navIdx.length-1)]:this.items,c={element:i,items:h,parentItem:this.isMenu&&t.isBlazor()?this.getMenuItemModel(s,this.navIdx.length-1):s,event:n,cancel:!1,top:r,left:l,showSubMenuOn:"Auto"},p=a;this.trigger("beforeOpen",c,function(r){switch(p){case"menu":d.hamburgerMode||("Auto"!==r.showSubMenuOn&&(d.showItemOnClick=!d.defaultOption,d.showSubMenuOn=r.showSubMenuOn),d.top=r.top,d.left=r.left),d.popupWrapper.style.display="block",d.hamburgerMode||(d.popupWrapper.style.maxHeight=d.popupWrapper.getBoundingClientRect().height+"px",d.enableScrolling&&o(d.createElement,d.popupWrapper,d.uList,"vscroll",d.enableRtl),d.checkScrollOffset(n)),d.hamburgerMode||d.left||d.top?(d.popupObj.collision={X:"none",Y:"none"},d.popupWrapper.style.display=""):(d.popupObj.refreshPosition(d.lItem,!0),d.left=parseInt(d.popupWrapper.style.left,10),d.top=parseInt(d.popupWrapper.style.top,10),d.enableRtl&&(d.left=d.isNestedOrVertical?d.left-d.popupWrapper.offsetWidth-d.lItem.parentElement.offsetWidth+2:d.left-d.popupWrapper.offsetWidth+d.lItem.offsetWidth),d.template&&(d.isReact||d.isAngular)?requestAnimationFrame(function(){d.collision(),d.popupWrapper.style.display=""}):(d.collision(),d.popupWrapper.style.display=""));break;case"none":d.top=r.top,d.left=r.left;break;case"hamburger":r.cancel||(d.element.classList.remove("e-hide-menu"),d.triggerOpen(d.element))}if("hamburger"!==p)if(r.cancel)d.isMenu?(d.popupObj.destroy(),t.detach(d.popupWrapper)):i.className.indexOf("e-ul")>-1&&t.detach(i),d.navIdx.pop();else if(d.isMenu)if(d.hamburgerMode)d.popupWrapper.style.top=d.top+"px",d.popupWrapper.style.left="0px",d.toggleAnimation(d.popupWrapper);else{d.setBlankIconStyle(d.popupWrapper),d.wireKeyboardEvent(d.popupWrapper),t.rippleEffect(d.popupWrapper,{selector:"."+N}),d.popupWrapper.style.left=d.left+"px",d.popupWrapper.style.top=d.top+"px";var l="None"!==d.animationSettings.effect?{name:d.animationSettings.effect,duration:d.animationSettings.duration,timingFunction:d.animationSettings.easing}:null;d.popupObj.show(l,d.lItem)}else d.setBlankIconStyle(d.uList),d.setPosition(d.lItem,d.uList,d.top,d.left),d.toggleAnimation(d.uList);if("right"===d.keyType){var a=d.getUlByNavIdx();if(e.classList.remove(y),d.isMenu&&1===d.navIdx.length&&d.removeLIStateByClass([C],[d.getWrapper()]),e.classList.add(C),"enter"===d.action){var h={element:e,item:s,event:n};d.trigger("select",h)}e.focus(),a=d.getUlByNavIdx();var c=d.isValidLI(a.children[0],0,d.action);a.children[c].classList.add(y),a.children[c].focus()}})},n.prototype.collision=function(){var e;if(e=s.isCollide(this.popupWrapper,null,this.left,this.top),(this.isNestedOrVertical||this.enableRtl)&&(e.indexOf("right")>-1||e.indexOf("left")>-1)){this.popupObj.collision.X="none";var i=t.closest(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth;this.left=this.enableRtl?s.calculatePosition(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-i+2}((e=s.isCollide(this.popupWrapper,null,this.left,this.top)).indexOf("left")>-1||e.indexOf("right")>-1)&&(this.left=this.callFit(this.popupWrapper,!0,!1,this.top,this.left).left),this.popupWrapper.style.left=this.left+"px"},n.prototype.setBlankIconStyle=function(e){var t=[].slice.call(e.getElementsByClassName("e-blankicon"));if(t.length){var i=e.querySelector(".e-menu-item:not(.e-blankicon):not(.e-separator)"),s=i.querySelector(".e-menu-icon");if(s){var n=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},r=getComputedStyle(s),l=parseInt(r.fontSize,10);parseInt(r.width,10)&&parseInt(r.width,10)>l&&(l=parseInt(r.width,10));var o=l+parseInt(r[n.margin],10)+parseInt(getComputedStyle(i)[n.padding],10)+"px";t.forEach(function(e){e.style[n.padding]=o})}}},n.prototype.checkScrollOffset=function(e){var i=this.getWrapper();if(i.children[0].classList.contains("e-menu-hscroll")&&1===this.navIdx.length){var s=t.isNullOrUndefined(e)?this.element:t.closest(e.target,"."+N),n=t.select(".e-hscroll-bar",i);n.scrollLeft>s.offsetLeft&&(n.scrollLeft-=n.scrollLeft-s.offsetLeft);var r=n.scrollLeft+n.offsetWidth,l=s.offsetLeft+s.offsetWidth;r<l&&(n.scrollLeft+=l-r)}},n.prototype.setPosition=function(e,i,n,r){if(this.toggleVisiblity(i),i===this.element||r>-1&&n>-1){if((d=s.isCollide(i,null,r,n)).indexOf("right")>-1&&(r-=i.offsetWidth),d.indexOf("bottom")>-1&&(n=(a=this.callFit(i,!1,!0,n,r)).top-20)<0){var l=pageYOffset+document.documentElement.clientHeight-i.getBoundingClientRect().height;l>-1&&(n=l)}(d=s.isCollide(i,null,r,n)).indexOf("left")>-1&&(r=(a=this.callFit(i,!0,!1,n,r)).left)}else if(t.Browser.isDevice)n=Number(this.element.style.top.replace("px","")),r=Number(this.element.style.left.replace("px",""));else{var o=this.enableRtl?"left":"right",a=s.calculatePosition(e,o,"top");n=a.top,r=a.left;var d=s.isCollide(i,null,this.enableRtl?r-i.offsetWidth:r,n),h=d.indexOf("left")>-1||d.indexOf("right")>-1;h&&(r=(a=s.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||h)&&(r=this.enableRtl&&h?r:r-i.offsetWidth),d.indexOf("bottom")>-1&&(n=(a=this.callFit(i,!1,!0,n,r)).top)}this.toggleVisiblity(i,!1),i.style.top=n+"px",i.style.left=r+"px"},n.prototype.toggleVisiblity=function(e,t){void 0===t&&(t=!0),e.style.visibility=t?"hidden":"",e.style.display=t?"block":"none"},n.prototype.createItems=function(e){var s=this,n=this.navIdx?this.navIdx.length:0,r=this.getFields(n);if(t.isBlazor()&&this.template&&e.length&&e[0].properties){var l=[];e.forEach(function(e,i){l.push({}),l[i][r.text]=e[r.text],e[r.id]||(e[r.id]=t.getUniqueID("menuitem")),l[i][r.id]=e[r.id],l[i][r.iconCss]=e[r.iconCss],l[i][r.url]=e[r.url],l[i][r.child]=e[r.child],l[i][r.separator]=e[r.separator]}),e=l}var o=this.hasField(e,this.getField("iconCss",n)),a={showIcon:o,moduleName:"menu",fields:r,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[r.id]]||(e.curData[e.fields[r.id]]=t.getUniqueID("menuitem")),e.curData.htmlAttributes={role:"menuitem",tabindex:"-1"},s.isMenu&&!e.curData[s.getField("separator",n)]&&(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]),""===e.curData[e.fields[r.iconCss]]&&(e.curData[e.fields[r.iconCss]]=null)},itemCreated:function(e){if(e.curData[s.getField("separator",n)]&&(e.item.classList.add("e-separator"),e.item.removeAttribute("role")),!o||e.curData[e.fields.iconCss]||e.curData[s.getField("separator",n)]||e.item.classList.add("e-blankicon"),e.curData[e.fields.child]&&e.curData[e.fields.child].length){var t=s.createElement("span",{className:"e-icons e-caret"});e.item.appendChild(t),e.item.setAttribute("aria-haspopup","true"),e.item.setAttribute("aria-expanded","false"),s.isMenu||e.item.removeAttribute("role"),e.item.classList.add("e-menu-caret-icon")}s.isMenu&&s.template&&(e.item.setAttribute("id",e.curData[e.fields.id].toString()),e.item.removeAttribute("data-uid"),e.item.classList.contains("e-level-1")&&e.item.classList.remove("e-level-1"),e.item.classList.contains("e-has-child")&&e.item.classList.remove("e-has-child"));var i={item:e.curData,element:e.item};s.trigger("beforeItemRender",i)}};this.setProperties({items:this.items},!0),this.isMenu&&(a.templateID=this.element.id+"Template");var d=i.ListBase.createList(this.createElement,e,a,!this.template,this);return d.setAttribute("tabindex","0"),this.isMenu&&d.setAttribute("role","menu"),d},n.prototype.moverHandler=function(e){var i=e.target;this.liTrgt=i;var s=this.getLI(i),n=s?t.closest(s,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),r=this.getWrapper(),l=new RegExp("-ej2menu-(.*)-popup"),o=!1;if(n){if((""!==n.id?l.exec(n.id)[1]:n.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([y,C],[this.getWrapper()]),!this.navIdx.length)return;o=!0}s&&t.closest(s,".e-"+this.getModuleName()+"-wrapper")&&!o?(this.removeLIStateByClass([y],this.isMenu?[n].concat(this.getPopups()):[n]),this.removeLIStateByClass([y],this.isMenu?[r].concat(this.getPopups()):[r]),s.classList.add(y),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!o&&this.removeLIStateByClass([y],[n].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||i.parentElement===n||t.closest(i,".e-"+this.getModuleName()+"-popup")||s&&(!s||this.getIndex(s.id,!0).length)||"Hover"===this.showSubMenuOn?o&&!this.showItemOnClick&&this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e)):(this.removeLIStateByClass([y],[n]),this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e))),this.isClosed||this.removeStateWrapper(),this.isClosed=!1)}},n.prototype.removeStateWrapper=function(){if(this.liTrgt){var e=t.closest(this.liTrgt,".e-menu-vscroll");"DIV"===this.liTrgt.tagName&&e&&this.removeLIStateByClass([y,C],[e])}},n.prototype.removeLIStateByClass=function(e,i){for(var s,n=0;n<i.length;n++)!function(n){e.forEach(function(e){(s=t.select("."+e,i[n]))&&s.classList.remove(e)})}(n)},n.prototype.getField=function(e,t){void 0===t&&(t=0);var i=this.fields[e];return"string"==typeof i?i:i[t]?i[t].toString():i[i.length-1].toString()},n.prototype.getFields=function(e){return void 0===e&&(e=0),{id:this.getField("itemId",e),iconCss:this.getField("iconCss",e),text:this.getField("text",e),url:this.getField("url",e),child:this.getField("children",e),separator:this.getField("separator",e)}},n.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][t])return!0;return!1},n.prototype.menuHeaderClickHandler=function(e){t.closest(e.target,".e-menu-wrapper").querySelector("ul.e-menu-parent").id===this.element.id&&(this.element.classList.contains("e-hide-menu")?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},n.prototype.clickHandler=function(e){if(this.isTapHold)this.isTapHold=!1;else{var i=this.getWrapper(),s=e.target,n=this.cli=this.getLI(s),r=new RegExp("-ej2menu-(.*)-popup"),l=n?t.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,o=n&&l&&(this.isMenu?this.getIndex(n.id,!0).length>0:i.firstElementChild.id===l.firstElementChild.id);if(t.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([y],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&l&&this.isMenu){var a=l.id?r.exec(l.id)[1]:l.querySelector(".e-menu-parent").id;if(this.element.id!==a)return}if(o&&"click"===e.type&&!n.classList.contains(b)){this.setLISelected(n);var d=this.getIndex(n.id,!0),h={element:n,item:this.getItem(d),event:e};this.trigger("select",h)}if(o&&("mouseover"===e.type||t.Browser.isDevice||this.showItemOnClick)){var c=void 0;if(n.classList.contains(b))c=i.children[this.navIdx.length-1],this.toggleAnimation(c),(f=this.getLIByClass(c,C))&&f.classList.remove(C),t.detach(n.parentNode),this.navIdx.pop();else if(!n.classList.contains("e-separator")){this.showSubMenu=!0;var p=n.parentNode;if(this.cliIdx=this.getIdx(p,n),this.isMenu||!t.Browser.isDevice){var u=this.isMenu?Array.prototype.indexOf.call([i].concat(this.getPopups()),t.closest(p,".e-"+this.getModuleName()+"-wrapper")):this.getIdx(i,p);if(this.navIdx[u]===this.cliIdx&&(this.showSubMenu=!1),u!==this.navIdx.length&&("mouseover"!==e.type||this.showSubMenu)){var f=this.getLIByClass(p,C);f&&f.classList.remove(C),this.isClosed=!0,this.keyType="click",this.showItemOnClick&&this.setLISelected(n),this.closeMenu(u+1,e),this.showItemOnClick&&this.setLISelected(n)}}this.isClosed||this.afterCloseMenu(e),this.isClosed=!1}}else if(this.isMenu&&"DIV"===s.tagName&&this.navIdx.length&&t.closest(s,".e-menu-vscroll")){var m=t.closest(s,"."+x),v=Array.prototype.indexOf.call(this.getPopups(),m)+1;v<this.navIdx.length&&(this.closeMenu(v+1,e),m&&this.removeLIStateByClass([y,C],[m]))}else this.isMenu&&this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):"UL"===s.tagName&&(this.isMenu?!s.parentElement.classList.contains("e-menu-wrapper")||this.getIndex(s.querySelector("."+N).id,!0).length:s.parentElement===i)||(n||this.removeLIStateByClass([C],[i]),n&&n.querySelector(".e-caret")||this.closeMenu(null,e))}},n.prototype.afterCloseMenu=function(e){var i;if(this.showSubMenu){i=this.showItemOnClick&&0===this.navIdx.length?t.closest(e.target,".e-menu-parent.e-control"):t.closest(this.element,".e-menu-parent.e-control");var s=this.navIdx.concat(this.cliIdx),n=this.getItem(s);if(n&&n[this.getField("children",s.length-1)]&&n[this.getField("children",s.length-1)].length?(("mouseover"===e.type||t.Browser.isDevice&&this.isMenu)&&this.setLISelected(this.cli),(!this.hamburgerMode&&i||this.hamburgerMode&&"false"===this.cli.getAttribute("aria-expanded"))&&(this.cli.setAttribute("aria-expanded","true"),this.navIdx.push(this.cliIdx),this.openMenu(this.cli,n,null,null,e))):"mouseover"!==e.type&&this.closeMenu(null,e),!i){var r=this.getUlByNavIdx(),l=this.getLIByClass(r,C);l&&(l.setAttribute("aria-expanded","false"),l.classList.remove(C))}}this.keyType=""},n.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,C);t&&t.classList.remove(C),this.isMenu||e.classList.remove(y),e.classList.add(C)},n.prototype.getLIByClass=function(e,t){for(var i=0,s=e.children.length;i<s;i++)if(e.children[i].classList.contains(t))return e.children[i];return null},n.prototype.getItemIndex=function(e,t){var i;i="string"==typeof e?e:e.id;var s=!1!==t;return this.getIndex(i,s)},n.prototype.setItem=function(e,t,i){var s=t||e.id,n=!1!==i,r=this.getIndex(s,n),l=this.getItem(r);l.iconCss=e.iconCss,l.id=e.id,l.text=e.text,l.url=e.url,l.separator=e.separator,l.items=e.items},n.prototype.getItem=function(e){var t=(e=e.slice()).pop();return this.getItems(e)[t]},n.prototype.getItems=function(e){for(var t=this.items,i=0;i<e.length;i++)t=t[e[i]][this.getField("children",i)];return t},n.prototype.setItems=function(e,t){var i=this.getItems(t);i.splice(0,i.length);for(var s=0;s<e.length;s++)i.splice(s,0,e[s])},n.prototype.getIdx=function(e,i,s){void 0===s&&(s=!0);var n=Array.prototype.indexOf.call(e.querySelectorAll("li"),i);return n=this.isMenu&&this.template&&t.isBlazor()?Array.prototype.indexOf.call(e.querySelectorAll(i.tagName),i):Array.prototype.indexOf.call(e.children,i),s&&e.children[0].classList.contains(b)&&n--,n},n.prototype.getLI=function(e){return"LI"===e.tagName&&e.classList.contains("e-menu-item")?e:t.closest(e,"li.e-menu-item")},n.prototype.updateItemsByNavIdx=function(){for(var e=this.items,t=0,i=0;i<this.navIdx.length&&(e=e[i].items);i++){t++;var s=this.getUlByNavIdx(t);if(!s)break;this.updateItem(s,e)}},n.prototype.removeChildElement=function(e){for(;e.firstElementChild;)e.removeChild(e.firstElementChild);return e},n.prototype.onPropertyChanged=function(e,i){for(var s=this,n=this.getWrapper(),r=this,l=0,a=Object.keys(e);l<a.length;l++)!function(l){switch(l){case"cssClass":i.cssClass&&t.removeClass([n],i.cssClass.split(" ")),e.cssClass&&t.addClass([n],e.cssClass.split(" "));break;case"enableRtl":n.classList.toggle("e-rtl");break;case"showItemOnClick":r.unWireEvents(),r.showItemOnClick=e.showItemOnClick,r.wireEvents();break;case"enableScrolling":if(e.enableScrolling){var a;r.element.classList.contains("e-vertical")?o(r.createElement,n,r.element,"vscroll",r.enableRtl):o(r.createElement,n,r.element,"hscroll",r.enableRtl),r.getPopups().forEach(function(e){a=t.select(".e-ul",e),o(s.createElement,e,a,"vscroll",s.enableRtl)})}else{var h=n.children[0];r.element.classList.contains("e-vertical")?d(t.getInstance(h,m),h):d(t.getInstance(h,p),h),n.style.overflow="",n.appendChild(r.element),r.getPopups().forEach(function(e){h=e.children[0],d(t.getInstance(h,m),h),e.style.overflow=""})}break;case"items":var c=void 0,u=void 0,f=void 0;if(Object.keys(i.items).length)for(var v=Object.keys(e.items),g=0;g<v.length;g++)(u=r.getChangedItemIndex(e,[],Number(v[g]))).length<=r.getWrapper().children.length&&(c=u.pop(),f=r.getItems(u),r.insertAfter([f[c]],f[c].text),r.removeItem(f,u,c),r.setItems(f,u)),u.length=0;else{if(r.updateItem(r.element,r.items),!r.hamburgerMode)for(var g=1,y=n.childElementCount;g<y;g++)t.detach(n.lastElementChild);r.isMenu&&t.isBlazor()?r.updateItemsByNavIdx():r.navIdx=[]}}}(a[l])},n.prototype.updateItem=function(e,i){t.isBlazor()?e=this.removeChildElement(e):e.innerHTML="",[].slice.call(this.createItems(i).children).forEach(function(t){e.appendChild(t)})},n.prototype.getChangedItemIndex=function(e,t,i){t.push(i);var s=Object.keys(e.items[i]).pop();if("items"===s){var n=e.items[i],r=Object.keys(n.items).pop();r&&this.getChangedItemIndex(n,t,Number(r))}else"isParentArray"===s&&t.length>1&&t.pop();return t},n.prototype.removeItem=function(e,i,s){e.splice(s,1);var n=this.getWrapper().children;i.length<n.length&&t.detach(n[i.length].children[s])},n.prototype.unWireEvents=function(e){void 0===e&&(e=this.target);var i=this.getWrapper();if(e){for(var n=void 0,r=void 0,l=t.selectAll(e),o=0,a=l.length;o<a;o++)n=l[o],this.isMenu?t.EventHandler.remove(n,"click",this.menuHeaderClickHandler):t.Browser.isIos?(r=t.getInstance(n,t.Touch))&&r.destroy():t.EventHandler.remove(n,"contextmenu",this.cmenuHandler);if(!this.isMenu){t.EventHandler.remove(this.targetElement,"scroll",this.scrollHandler);for(var d=0,h=s.getScrollableParent(this.targetElement);d<h.length;d++){var c=h[d];t.EventHandler.remove(c,"scroll",this.scrollHandler)}}}t.Browser.isDevice||(t.EventHandler.remove(this.isMenu?document:i,"mouseover",this.delegateMoverHandler),t.EventHandler.remove(document,"mousedown",this.delegateMouseDownHandler)),t.EventHandler.remove(document,"click",this.delegateClickHandler),this.unWireKeyboardEvent(i),this.rippleFn()},n.prototype.unWireKeyboardEvent=function(e){var i=t.getInstance(e,t.KeyboardEvents);i&&i.destroy()},n.prototype.toggleAnimation=function(e,t){var i=this;void 0===t&&(t=!0);var s,n;"None"!==this.animationSettings.effect&&t?this.animation.animate(e,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){i.hamburgerMode?(n=e.element.parentElement,e.element.style.position="absolute",s=n.offsetHeight,e.element.style.maxHeight=e.element.offsetHeight+"px",n.style.maxHeight=""):(e.element.style.display="block",e.element.style.maxHeight=e.element.getBoundingClientRect().height+"px")},progress:function(e){i.hamburgerMode&&(n.style.minHeight=s+e.element.offsetHeight+"px")},end:function(e){i.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",n.style.minHeight="",e.element.style.top="0px",e.element.children[0].focus(),i.triggerOpen(e.element.children[0])):i.end(e.element,t)}}):this.end(e,t)},n.prototype.triggerOpen=function(e){var t=this.navIdx.length?this.getItem(this.navIdx):null,i={element:e,parentItem:t,items:t?t.items:this.items};this.trigger("onOpen",i)},n.prototype.end=function(e,i){if(i)if(e.style.display="block",e.style.maxHeight="",this.triggerOpen(e),e.querySelector("."+y))e.querySelector("."+y).focus();else{var s=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1];s?s.querySelector("."+C).focus():this.element.focus()}else if(e===this.element){var n=this.getLIByClass(this.element,y);n&&n.classList.remove(y);var r=this.getLIByClass(this.element,C);r&&r.classList.remove(C),e.style.display="none"}else t.detach(e)},n.prototype.getPersistData=function(){return""},n.prototype.getWrapper=function(){return t.closest(this.element,".e-"+this.getModuleName()+"-wrapper")},n.prototype.getIndex=function(e,t,i,s,n,r){void 0===i&&(i=this.items),void 0===s&&(s=[]),void 0===n&&(n=!1),void 0===r&&(r=0);var l;r=n?r+1:0;for(var o=0,a=i.length;o<a;o++){if(l=i[o],(t?l[this.getField("itemId",r)]:l[this.getField("text",r)])===e){s.push(o);break}if(l[this.getField("children",r)]&&l[this.getField("children",r)].length){if(-1!==(s=this.getIndex(e,t,l[this.getField("children",r)],s,!0,r))[s.length-1]){s.unshift(o);break}o!==a-1&&s.pop()}else o===a-1&&s.push(-1)}return n||-1!==s[0]?s:[]},n.prototype.enableItems=function(e,i,s){void 0===i&&(i=!0);for(var n,r,l,o,a="e-disabled",d=0;d<e.length;d++){if(l=this.getIndex(e[d],s),this.navIdx.length){if(1!==l.length){o=!1;for(var h=0,c=l.length-1;h<c;h++)if(l[h]!==this.navIdx[h]){o=!0;break}if(o)continue}}else if(1!==l.length)continue;r=l.pop(),(n=this.getUlByNavIdx(l.length))&&(i?this.isMenu?(n.children[r].classList.remove(a),n.children[r].removeAttribute("aria-disabled")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.remove(a):n.children[r].classList.remove(a):this.isMenu?(n.children[r].classList.add(a),n.children[r].setAttribute("aria-disabled","true")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.add(a):n.children[r].classList.add(a))}},n.prototype.showItems=function(e,t){this.showHideItems(e,!1,t)},n.prototype.hideItems=function(e,t){this.showHideItems(e,!0,t)},n.prototype.showHideItems=function(e,i,s){for(var n,r,l,o=0;o<e.length;o++)r=(l=this.getIndex(e[o],s)).pop(),(n=this.getUlByNavIdx(l.length))&&(i?t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.add(E):n.children[r].classList.add(E):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.remove(E):n.children[r].classList.remove(E))},n.prototype.removeItems=function(e,t){for(var i,s,n,r=0;r<e.length;r++)i=(s=this.getIndex(e[r],t)).pop(),n=this.getItems(s),this.removeItem(n,s,i)},n.prototype.insertAfter=function(e,t,i){this.insertItems(e,t,i)},n.prototype.insertBefore=function(e,t,i){this.insertItems(e,t,i,!1)},n.prototype.insertItems=function(e,i,s,n){void 0===n&&(n=!0);for(var r,l,o,a,d,h=0;h<e.length;h++){l=(o=this.getIndex(i,s)).pop(),a=this.getItems(o),d=new S(a[0],"items",e[h],!0),a.splice(n?l+1:l,0,d);var c=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);if(o.length<c.length){l=n?l+1:l,r=this.createItems(a).children[l];var p=this.isMenu?t.select(".e-menu-parent",c[o.length]):c[o.length];p.insertBefore(r,p.children[l])}}},n.prototype.removeAttributes=function(){var e=this;["top","left","display","z-index"].forEach(function(t){e.element.style.removeProperty(t)}),["role","tabindex","class","style"].forEach(function(t){"class"===t&&e.element.classList.contains("e-menu-parent")&&e.element.classList.remove("e-menu-parent"),-1!==["class","style"].indexOf(t)&&e.element.getAttribute(t)||e.element.removeAttribute(t),e.isMenu&&"class"===t&&e.element.classList.contains("e-vertical")&&e.element.classList.remove("e-vertical")})},n.prototype.destroy=function(){var i=this.getWrapper();if(i){if(this.unWireEvents(),this.isMenu)this.closeMenu(),t.isBlazor()?this.element=this.removeChildElement(this.element):this.element.innerHTML="",this.removeAttributes(),i.parentNode.insertBefore(this.element,i),this.clonedElement=null;else{if(this.clonedElement.style.display="","EJS-CONTEXTMENU"===this.clonedElement.tagName)t.addClass([this.clonedElement],["e-control","e-lib","e-"+this.getModuleName()]),this.element=this.clonedElement;else if(this.refreshing&&this.clonedElement.childElementCount&&"LI"===this.clonedElement.children[0].tagName&&this.setProperties({items:[]},!0),document.getElementById(this.clonedElement.id)){var s=this.clonedElement.nextElementSibling;s&&s!==i?this.clonedElement.parentElement.insertBefore(this.element,s):this.clonedElement.parentElement.appendChild(this.element),t.isBlazor()?this.element=this.removeChildElement(this.element):this.element.innerHTML="",t.append([].slice.call(this.clonedElement.children),this.element),t.detach(this.clonedElement),this.removeAttributes()}this.clonedElement=null}this.isMenu&&this.clonedElement?(t.detach(this.element),i.style.display="",i.classList.remove("e-"+this.getModuleName()+"-wrapper"),i.removeAttribute("data-ripple")):t.detach(i),e.prototype.destroy.call(this),this.template&&this.clearTemplate(["template"])}},g([t.Event()],n.prototype,"beforeItemRender",void 0),g([t.Event()],n.prototype,"beforeOpen",void 0),g([t.Event()],n.prototype,"onOpen",void 0),g([t.Event()],n.prototype,"beforeClose",void 0),g([t.Event()],n.prototype,"onClose",void 0),g([t.Event()],n.prototype,"select",void 0),g([t.Event()],n.prototype,"created",void 0),g([t.Property("")],n.prototype,"cssClass",void 0),g([t.Property(0)],n.prototype,"hoverDelay",void 0),g([t.Property(!1)],n.prototype,"showItemOnClick",void 0),g([t.Property("")],n.prototype,"target",void 0),g([t.Property("")],n.prototype,"filter",void 0),g([t.Property(null)],n.prototype,"template",void 0),g([t.Property(!1)],n.prototype,"enableScrolling",void 0),g([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),g([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},O)],n.prototype,"fields",void 0),g([t.Collection([],S)],n.prototype,"items",void 0),g([t.Complex({duration:400,easing:"ease",effect:"SlideDown"},w)],n.prototype,"animationSettings",void 0),n=g([t.NotifyPropertyChanges],n)}(t.Component),k=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),L=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},A="e-toolbar-items",D="e-toolbar-item",P="e-toolbar-popup",T=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),L([t.Property("")],i.prototype,"id",void 0),L([t.Property("")],i.prototype,"text",void 0),L([t.Property("auto")],i.prototype,"width",void 0),L([t.Property("")],i.prototype,"cssClass",void 0),L([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),L([t.Property(!1)],i.prototype,"disabled",void 0),L([t.Property("")],i.prototype,"prefixIcon",void 0),L([t.Property("")],i.prototype,"suffixIcon",void 0),L([t.Property(!0)],i.prototype,"visible",void 0),L([t.Property("None")],i.prototype,"overflow",void 0),L([t.Property("")],i.prototype,"template",void 0),L([t.Property("Button")],i.prototype,"type",void 0),L([t.Property("Both")],i.prototype,"showTextOn",void 0),L([t.Property(null)],i.prototype,"htmlAttributes",void 0),L([t.Property("")],i.prototype,"tooltipText",void 0),L([t.Property("Left")],i.prototype,"align",void 0),L([t.Event()],i.prototype,"click",void 0),i}(t.ChildProperty),M=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.resizeContext=s.resize.bind(s),s.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},s}return k(i,e),i.prototype.destroy=function(){var i=this;this.isReact&&this.clearTemplate();var s=this.element.querySelectorAll(".e-control.e-btn");for([].slice.call(s).forEach(function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),e.prototype.destroy.call(this),this.unwireEvents(),this.tempId.forEach(function(e){t.isNullOrUndefined(i.element.querySelector(e))||(document.body.appendChild(i.element.querySelector(e)).style.display="none")});this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&this.element.appendChild(this.ctrlTem),this.clearProperty(),this.popObj=null,this.tbarAlign=null,this.remove(this.element,"e-toolpop"),this.cssClass&&t.removeClass([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","aria-haspopup","role"].forEach(function(e){return i.element.removeAttribute(e)})},i.prototype.preRender=function(){var e={enableCollision:this.enableCollision,scrollStep:this.scrollStep};this.trigger("beforeCreate",e),this.enableCollision=e.enableCollision,this.scrollStep=e.scrollStep,this.scrollModule=null,this.popObj=null,this.tempId=[],this.tbarItemsCol=this.items,this.isVertical=!!this.element.classList.contains("e-vertical"),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,"e-rtl")},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),this.allowKeyboard&&this.wireKeyboardEvent()},i.prototype.wireKeyboardEvent=function(){this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),t.EventHandler.add(this.element,"keydown",this.docKeyDown,this),this.element.setAttribute("tabIndex","0")},i.prototype.unwireKeyboardEvent=function(){this.keyModule&&(t.EventHandler.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},i.prototype.docKeyDown=function(e){if("INPUT"!==e.target.tagName){var i=!t.isNullOrUndefined(this.popObj)&&t.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode;9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&i&&this.popObj.hide({name:"FadeOut",duration:100}),(40===e.keyCode||38===e.keyCode||35===e.keyCode||36===e.keyCode)&&e.preventDefault()}},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),t.EventHandler.remove(document,"scroll",this.docEvent),t.EventHandler.remove(document,"click",this.docEvent)},i.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},i.prototype.docEvent=function(e){var i=t.closest(e.target,".e-popup");this.popObj&&t.isVisible(this.popObj.element)&&!i&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},i.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,"e-tbar-pos"),this.scrollModule.destroy(),this.scrollModule=null)},i.prototype.destroyItems=function(){this.element&&[].slice.call(this.element.querySelectorAll("."+D)).forEach(function(e){t.detach(e)});var e=this.element.querySelector("."+A);this.tbarAlign&&([].slice.call(e.children).forEach(function(e){t.detach(e)}),this.tbarAlign=!1,this.remove(e,"e-tbar-pos")),this.clearProperty()},i.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,"e-rtl"),this.destroyScroll()),this.remove(this.element,"e-tbar-extended"),this.remove(this.element,"e-extended-toolbar");var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,"e-toolbar-multirow"),this.popObj&&this.popupRefresh(this.popObj.element,!0)},i.prototype.add=function(e,t){e.classList.add(t)},i.prototype.remove=function(e,t){e.classList.remove(t)},i.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},i.prototype.clstElement=function(e,i){return e&&this.popObj&&t.isVisible(this.popObj.element)?this.popObj.element.querySelector("."+D):this.element===i||e?this.element.querySelector("."+D+":not(.e-overlay ):not(.e-separator ):not(.e-hidden )"):t.closest(i,"."+D)},i.prototype.keyHandling=function(e,i,s,n,r){var l,o,a=this.popObj,d=this.element,h={name:"FadeOut",duration:100},c="moveUp"===i.action?"previous":"next";switch(i.action){case"moveRight":if(this.isVertical)return;d===s?this.elementFocus(e):n||this.eleFocus(e,"next");break;case"moveLeft":if(this.isVertical)return;n||this.eleFocus(e,"previous");break;case"home":case"end":if(e){var p=t.closest(e,".e-popup");p?t.isVisible(this.popObj.element)&&(o=[].slice.call(p.children),l="home"===i.action?o[0]:o[o.length-1]):(o=this.element.querySelectorAll("."+A+" ."+D),l="home"===i.action?o[0]:o[o.length-1]),l&&this.elementFocus(l)}break;case"moveUp":case"moveDown":if(this.isVertical)"moveUp"===i.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next");else if(a&&t.closest(s,".e-popup")){var u=a.element,f=u.firstElementChild;if("previous"===c&&f===e||"next"===c&&u.lastElementChild===e)return;this.eleFocus(e,c)}else"moveDown"===i.action&&a&&t.isVisible(a.element)&&this.elementFocus(e);break;case"tab":if(!r&&!n){var m=e.firstElementChild;d===s&&(this.activeEle?this.activeEle.focus():(this.activeEleRemove(m),m.focus()),this.element.removeAttribute("tabindex"))}break;case"popupClose":a&&"Extended"!==this.overflowMode&&a.hide(h);break;case"popupOpen":if(!n)return;a&&!t.isVisible(a.element)?(a.element.style.top=d.offsetHeight+"px",a.show({name:"FadeIn",duration:100})):a.hide(h)}},i.prototype.keyActionHandler=function(e){var t=e.target;if("INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!this.element.classList.contains("e-overlay")){e.preventDefault();var i=t.classList.contains("e-hor-nav"),s=t.classList.contains("e-scroll-nav"),n=this.clstElement(i,t);(n||s)&&this.keyHandling(n,e,t,i,s)}},i.prototype.disable=function(e){var i=this.element;e?i.classList.add("e-overlay"):i.classList.remove("e-overlay"),i.setAttribute("tabindex",e?"-1":"0"),this.activeEle&&this.activeEle.setAttribute("tabindex",e?"-1":"0"),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(t.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),i.querySelector("#"+i.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},i.prototype.eleContains=function(e){return e.classList.contains("e-separator")||e.classList.contains("e-overlay")||e.getAttribute("disabled")||e.classList.contains("e-hidden")||!t.isVisible(e)},i.prototype.eleFocus=function(e,i){var s=Object(e)[i+"ElementSibling"];if(s){if(this.eleContains(s))return void this.eleFocus(s,i);this.elementFocus(s)}else if(this.tbarAlign){var n=Object(e.parentElement)[i+"ElementSibling"];if(t.isNullOrUndefined(n)||0!==n.children.length||(n=Object(n)[i+"ElementSibling"]),!t.isNullOrUndefined(n)&&n.children.length>0)if("next"===i){r=n.querySelector("."+D);this.eleContains(r)?this.eleFocus(r,i):(r.firstElementChild.focus(),this.activeEleSwitch(r))}else{var r=n.lastElementChild;this.eleContains(r)?this.eleFocus(r,i):this.elementFocus(r)}}},i.prototype.clickHandler=function(e){var i=this,s=e.target,n=this.element,r=!t.isNullOrUndefined(t.closest(s,".e-toolbar-pop")),l=s.classList,o=t.closest(s,".e-hor-nav");o||(o=s),n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!l.contains("e-hor-nav")||(l=s.querySelector(".e-icons").classList),(l.contains("e-popup-up-icon")||l.contains("e-popup-down-icon"))&&this.popupClickHandler(n,o,"e-rtl");var a,d=t.closest(e.target,"."+D);if(!t.isNullOrUndefined(d)&&!d.classList.contains("e-overlay")||o.classList.contains("e-hor-nav")){d&&(a=this.items[this.tbarEle.indexOf(d)]);var h={originalEvent:e,item:a};a&&!t.isNullOrUndefined(a.click)&&this.trigger("items["+this.tbarEle.indexOf(d)+"].click",h),h.cancel||this.trigger("clicked",h,function(e){!t.isNullOrUndefined(i.popObj)&&r&&!e.cancel&&"Popup"===i.overflowMode&&e.item&&"Input"!==e.item.type&&i.popObj.hide({name:"FadeOut",duration:100})})}},i.prototype.popupClickHandler=function(e,i,s){var n=this.popObj;t.isVisible(n.element)?(i.classList.remove("e-nav-active"),n.hide({name:"FadeOut",duration:100})):(e.classList.contains(s)&&(n.enableRtl=!0,n.position={X:"left",Y:"top"}),0!==n.offsetX||e.classList.contains(s)||(n.enableRtl=!1,n.position={X:"right",Y:"top"}),n.dataBind(),n.refreshPosition(),n.element.style.top=this.getElementOffsetY()+"px","Extended"===this.overflowMode&&(n.element.style.minHeight="0px"),i.classList.add("e-nav-active"),n.show({name:"FadeIn",duration:100}))},i.prototype.render=function(){this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){var e=t.formatUnit(this.width),i=t.formatUnit(this.height);"msie"===t.Browser.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||t.setStyleAttribute(this.element,{height:i}),t.setStyleAttribute(this.element,{width:e});var s={role:"toolbar","aria-disabled":"false","aria-haspopup":"false","aria-orientation":this.isVertical?"vertical":"horizontal"};t.attributes(this.element,s),this.cssClass&&t.addClass([this.element],this.cssClass.split(" "))},i.prototype.renderControl=function(){var e=this.element;this.trgtEle=e.children.length>0?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},i.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&this.popObj.element.childElementCount>1&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},i.prototype.itemsAlign=function(e,t){var i,s;this.tbarEle||(this.tbarEle=[]);for(var n=0;n<e.length;n++)i=this.renderSubComponent(e[n],n),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[n],t,n),(s=t.querySelector(".e-toolbar-"+e[n].align.toLowerCase()))?(e[n].showAlwaysInPopup&&"Show"!==e[n].overflow||this.tbarAlgEle[(e[n].align+"s").toLowerCase()].push(i),s.appendChild(i)):t.appendChild(i);if(this.isReact){this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates()}},i.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove("e-vertical"),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add("e-vertical"),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),t.setStyleAttribute(this.element,{height:t.formatUnit(this.height),width:t.formatUnit(this.width)})),this.destroyMode(),this.refreshOverflow()},i.prototype.initScroll=function(e,i){!this.scrollModule&&this.checkOverflow(e,i[0])&&(this.tbarAlign&&this.element.querySelector("."+A+" .e-toolbar-center").removeAttribute("style"),this.isVertical?this.scrollModule=new m({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]):this.scrollModule=new p({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]),this.remove(this.scrollModule.element,"e-tbar-pos"),t.setStyleAttribute(this.element,{overflow:"hidden"}))},i.prototype.itemWidthCal=function(e){var i,s=this,n=0;return[].slice.call(t.selectAll("."+D,e)).forEach(function(e){t.isVisible(e)&&(i=window.getComputedStyle(e),n+=s.isVertical?e.offsetHeight:e.offsetWidth,n+=parseFloat(s.isVertical?i.marginTop:i.marginRight),n+=parseFloat(s.isVertical?i.marginBottom:i.marginLeft))}),n},i.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},i.prototype.checkOverflow=function(e,i){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||!t.isVisible(e))return!1;var s=this.isVertical?e.offsetHeight:e.offsetWidth,n=this.isVertical?i.offsetHeight:i.offsetWidth;(this.tbarAlign||this.scrollModule||s===n)&&(n=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(i):i));var r=e.querySelector(".e-hor-nav"),l=e.querySelector(".e-scroll-nav"),o=0;return r?o=this.isVertical?r.offsetHeight:r.offsetWidth:l&&(o=this.isVertical?2*l.offsetHeight:2*l.offsetWidth),n>s-o},i.prototype.refreshOverflow=function(){this.resize()},i.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,"e-tbar-pos"),this.itemPositioning())},i.prototype.renderOverflowMode=function(){var e=this.element,i=e.querySelector("."+A),s=this.popupPriCount>0;if(e&&e.children.length>0)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===t.Browser.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":t.isNullOrUndefined(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(A)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,i)||s)&&this.setOverflowAttributes(e),this.toolbarAlign(i);break;case"MultiRow":this.add(i,"e-toolbar-multirow"),this.checkOverflow(e,i)&&this.tbarAlign&&(this.removePositioning(),this.add(i,"e-multirow-pos")),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==t.Browser.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,"e-extended-toolbar"),(this.checkOverflow(e,i)||s)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(i)}},i.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(t.selectAll("."+A+" ."+D,e))),this.element.querySelector(".e-hor-nav").setAttribute("tabIndex","0"),this.element.querySelector(".e-hor-nav").setAttribute("role","list")},i.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll(".e-separator")),i=e.querySelector(".e-multirow-separator"),s=e.querySelector(".e-extended-separator"),n="MultiRow"===this.overflowMode?i:s;null!==n&&("MultiRow"===this.overflowMode?n.classList.remove("e-multirow-separator"):"Extended"===this.overflowMode&&n.classList.remove("e-extended-separator"));for(var r=0;r<=t.length-1;r++)t[r].offsetLeft<30&&0!==t[r].offsetLeft&&("MultiRow"===this.overflowMode?t[r].classList.add("e-multirow-separator"):"Extended"===this.overflowMode&&t[r].classList.add("e-extended-separator"))},i.prototype.createPopupEle=function(e,i){var s=e.querySelector(".e-hor-nav"),n=this.isVertical;s||this.createPopupIcon(e),s=e.querySelector(".e-hor-nav");var r=n?s.offsetHeight:s.offsetWidth,l=(n?e.offsetHeight:e.offsetWidth)-r;this.element.classList.remove("e-rtl"),t.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,i,l,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},i.prototype.pushingPoppedEle=function(e,i,s,n,r){var l=e.element,o=[].slice.call(t.selectAll("."+P,l.querySelector("."+A))),a=t.selectAll(".e-overflow-show",s),d=0,h=0;o.forEach(function(l,o){a=t.selectAll(".e-overflow-show",s),l.classList.contains("e-overflow-show")&&a.length>0?e.tbResize&&a.length>o?(s.insertBefore(l,a[o]),++h):(s.insertBefore(l,s.children[a.length]),++h):l.classList.contains("e-overflow-show")?(s.insertBefore(l,s.firstChild),++h):e.tbResize&&l.classList.contains("e-overflow-hide")&&s.children.length>0&&0===a.length?(s.insertBefore(l,s.firstChild),++h):l.classList.contains("e-overflow-hide")?i.push(l):e.tbResize?(s.insertBefore(l,s.childNodes[d+h]),++d):s.appendChild(l),l.classList.contains("e-separator")?t.setStyleAttribute(l,{display:"",height:r+"px"}):t.setStyleAttribute(l,{display:"",height:n+"px"})}),i.forEach(function(e){s.appendChild(e)});for(var c=t.selectAll("."+D,l.querySelector("."+A)),p=c.length-1;p>=0;p--){var u=c[p];if(!u.classList.contains("e-separator")||"Extended"===this.overflowMode)break;t.setStyleAttribute(u,{display:"none"})}},i.prototype.createPopup=function(){var e,i,s=this.element;"Extended"===this.overflowMode&&(i=s.querySelector(".e-separator:not(."+P+")"),e="auto"===s.style.height||""===s.style.height?null:i.offsetHeight);var n,r=s.querySelector("."+D+":not(.e-separator):not(."+P+")"),l="auto"===s.style.height||""===s.style.height?null:r&&r.offsetHeight,o=[];if(t.select("#"+s.id+"_popup.e-toolbar-pop",s))n=t.select("#"+s.id+"_popup.e-toolbar-pop",s);else{var a=this.createElement("div",{id:s.id+"_popup",className:"e-toolbar-pop e-toolbar-extended"}),d=this.createElement("div",{id:s.id+"_popup",className:"e-toolbar-pop"});n="Extended"===this.overflowMode?a:d}this.pushingPoppedEle(this,o,n,l,e),this.popupInit(s,n)},i.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},i.prototype.popupInit=function(e,i){if(this.popObj){var n=this.popObj.element;t.setStyleAttribute(n,{maxHeight:"",display:"block"}),t.setStyleAttribute(n,{maxHeight:n.offsetHeight+"px",display:""})}else{e.appendChild(i),t.setStyleAttribute(this.element,{overflow:""});var r=window.getComputedStyle(this.element),l=new s.Popup(null,{relateTo:this.element,offsetY:this.isVertical?0:this.getElementOffsetY(),enableRtl:this.enableRtl,open:this.popupOpen.bind(this),close:this.popupClose.bind(this),collision:{Y:this.enableCollision?"flip":"none"},position:this.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"}});if(l.appendTo(i),"Extended"===this.overflowMode&&(l.width=parseFloat(r.width)+2*parseFloat(r.borderRightWidth),l.offsetX=0),t.EventHandler.add(document,"scroll",this.docEvent.bind(this)),t.EventHandler.add(document,"click ",this.docEvent.bind(this)),l.element.style.maxHeight=l.element.offsetHeight+"px",this.isVertical&&(l.element.style.visibility="hidden"),this.isExtendedOpen){var o=this.element.querySelector(".e-hor-nav");o.classList.add("e-nav-active"),t.classList(o.firstElementChild,["e-popup-up-icon"],["e-popup-down-icon"]),this.element.querySelector(".e-toolbar-extended").classList.add("e-popup-open")}else l.hide();this.popObj=l,this.element.setAttribute("aria-haspopup","true")}},i.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,"e-tbar-extended"):this.remove(this.element,"e-tbar-extended"))},i.prototype.popupOpen=function(e){var i=this.popObj;this.isVertical||(i.offsetY=this.getElementOffsetY(),i.dataBind());var n=this.popObj.element,r=this.popObj.element.parentElement,l=r.querySelector(".e-hor-nav");t.setStyleAttribute(i.element,{height:"auto",maxHeight:""}),i.element.style.maxHeight=i.element.offsetHeight+"px","Extended"===this.overflowMode&&(i.element.style.minHeight="");var o=n.offsetTop+n.offsetHeight+s.calculatePosition(r).top,a=l.firstElementChild;l.classList.add("e-nav-active"),t.classList(a,["e-popup-up-icon"],["e-popup-down-icon"]),this.tbarPopupHandler(!0);var d=t.isNullOrUndefined(window.scrollY)?0:window.scrollY;if(!this.isVertical&&window.innerHeight+d<o&&this.element.offsetTop<n.offsetHeight){var h=n.offsetHeight-(o-window.innerHeight-d+5);i.height=h+"px";for(var c=0;c<=n.childElementCount;c++){var p=n.children[c];if(p.offsetTop+p.offsetHeight>h){h=p.offsetTop;break}}t.setStyleAttribute(i.element,{maxHeight:h+"px"})}else if(this.isVertical){var u=this.element.getBoundingClientRect();t.setStyleAttribute(i.element,{maxHeight:u.top+this.element.offsetHeight+"px",bottom:0,visibility:""})}if(i){var f=n.getBoundingClientRect();f.right>document.documentElement.clientWidth&&f.width>r.getBoundingClientRect().width&&(i.collision={Y:"none"},i.dataBind()),i.refreshPosition()}},i.prototype.popupClose=function(e){var i=this.element.querySelector(".e-hor-nav"),s=i.firstElementChild;i.classList.remove("e-nav-active"),t.classList(s,["e-popup-down-icon"],["e-popup-up-icon"]),this.tbarPopupHandler(!1)},i.prototype.checkPriority=function(e,i,s,n){for(var r,l=this.popupPriCount>0,o=s,a=0,d=0,h=0,c=function(e,t){var i=!1;return t.forEach(function(t){e.classList.contains(t)&&(i=!0)}),i},p=i.length-1;p>=0;p--){var u=void 0,f=window.getComputedStyle(i[p]);this.isVertical?(u=parseFloat(f.marginTop),u+=parseFloat(f.marginBottom)):(u=parseFloat(f.marginRight),u+=parseFloat(f.marginLeft));var m=i[p]===this.tbarEle[0];m&&(this.tbarEleMrgn=u),r=this.isVertical?i[p].offsetHeight:i[p].offsetWidth;var v=m?r+u:r;if(c(i[p],["e-popup-alone"])&&l&&(i[p].classList.add(P),this.isVertical?t.setStyleAttribute(i[p],{display:"none",minHeight:v+"px"}):t.setStyleAttribute(i[p],{display:"none",minWidth:v+"px"}),h++),this.isVertical?i[p].offsetTop+i[p].offsetHeight+u>s:i[p].offsetLeft+i[p].offsetWidth+u>s){if(i[p].classList.contains("e-separator")){if("Extended"===this.overflowMode)d===h&&c(g=i[p],["e-separator","e-ignore"])&&(i[p].classList.add(P),h++),d++;else if("Popup"===this.overflowMode){if(a>0&&d===h){var g=i[p+d+(a-1)];c(g,["e-separator","e-ignore"])&&t.setStyleAttribute(g,{display:"none"})}a++,d=0,h=0}}else d++;i[p].classList.contains("e-overflow-show")&&n?s-=(this.isVertical?i[p].offsetHeight:i[p].offsetWidth)+u:c(i[p],["e-separator","e-ignore"])?s-=(this.isVertical?i[p].offsetHeight:i[p].offsetWidth)+u:(i[p].classList.add(P),this.isVertical?t.setStyleAttribute(i[p],{display:"none",minHeight:v+"px"}):t.setStyleAttribute(i[p],{display:"none",minWidth:v+"px"}),h++)}}if(n){var y=t.selectAll("."+D+":not(."+P+")",this.element);this.checkPriority(e,y,o,!1)}},i.prototype.createPopupIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav e-hor-nav");s="Extended"===this.overflowMode?s+" e-expended-nav":s;var n=this.createElement("div",{id:i,className:s});"msie"!==t.Browser.info.name&&"edge"!==t.Browser.info.name||n.classList.add("e-ie-align");var r=this.createElement("div",{className:"e-popup-down-icon e-icons"});n.appendChild(r),n.setAttribute("tabindex","0"),n.setAttribute("role","list"),e.appendChild(n)},i.prototype.tbarPriRef=function(e,i,s,n,r,l,o,a){var d=a,h=this.popObj.element,c=t.selectAll("."+P+":not(.e-overflow-show)",h).length,p=function(e,t){return e.classList.contains(t)};if(0===t.selectAll(".e-toolbar-item:not(.e-separator):not(.e-overflow-show)",e).length){var u=e.children[i-(i-s)-1],f=!t.isNullOrUndefined(u)&&p(u,"e-ignore");if(!t.isNullOrUndefined(u)&&p(u,"e-separator")&&!t.isVisible(u)||f){u.style.display="inherit";var m=u.offsetWidth+2*parseFloat(window.getComputedStyle(u).marginRight),v=u.previousElementSibling;l+m<o||r?(e.insertBefore(n,e.children[i+d-(i-s)]),t.isNullOrUndefined(v)||(v.style.display="")):v.classList.contains("e-separator")&&(v.style.display="none"),u.style.display=""}else e.insertBefore(n,e.children[i+d-(i-s)])}else e.insertBefore(n,e.children[i+d-c])},i.prototype.popupRefresh=function(e,i){var s=this,n=this.element,r=this.isVertical,l=n.querySelector("."+A),o=n.querySelector(".e-hor-nav");if(!t.isNullOrUndefined(o)){l.removeAttribute("style"),e.style.display="block";var a;a=r?n.offsetHeight-(o.offsetHeight+l.offsetHeight):n.offsetWidth-(o.offsetWidth+l.offsetWidth);var d=0;[].slice.call(e.children).forEach(function(e){d+=s.popupEleWidth(e),t.setStyleAttribute(e,{position:""})}),a+(r?o.offsetHeight:o.offsetWidth)>d&&0===this.popupPriCount&&(i=!0),this.popupEleRefresh(a,e,i),e.style.display="",0===e.children.length&&o&&this.popObj&&(t.detach(o),o=null,this.popObj.destroy(),t.detach(this.popObj.element),this.popObj=null,n.setAttribute("aria-haspopup","false"))}},i.prototype.ignoreEleFetch=function(e,t){var i=[].slice.call(t.querySelectorAll(".e-ignore")),s=[],n=0;return i.length>0?(i.forEach(function(e){s.push([].slice.call(t.children).indexOf(e))}),s.forEach(function(t){t<=e&&n++}),n):0},i.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var i=this.popupEleWidth(t.firstElementChild);t.firstElementChild.style.removeProperty("Position");var s=e.offsetWidth-e.querySelector(".e-hor-nav").offsetWidth,n=e.querySelector("."+A).offsetWidth;return t.style.removeProperty("display"),s>i+n},i.prototype.popupEleWidth=function(e){e.style.position="absolute";var i=this.isVertical?e.offsetHeight:e.offsetWidth,s=e.querySelector(".e-tbar-btn-text");if(e.classList.contains("e-tbtn-align")||e.classList.contains("e-popup-text")){var n=e.children[0];!t.isNullOrUndefined(s)&&e.classList.contains("e-popup-text")?s.style.display="none":!t.isNullOrUndefined(s)&&e.classList.contains("e-toolbar-text")&&(s.style.display="block"),n.style.minWidth="0%",i=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),n.style.minWidth="",n.style.minHeight="",t.isNullOrUndefined(s)||(s.style.display="")}return i},i.prototype.popupEleRefresh=function(e,i,s){for(var n,r,l=this.popupPriCount>0,o=this.tbarEle,a=this.element.querySelector("."+A),d=0,h=this,c=0,p=[].slice.call(i.children);c<p.length&&"break"!==function(i){if(i.classList.contains("e-popup-alone")&&l&&!s)return"continue";var c=h.popupEleWidth(i);if(i===h.tbarEle[0]&&(c+=h.tbarEleMrgn),i.style.position="",!(c<e||s))return"break";if(t.setStyleAttribute(i,{minWidth:"",height:"",minHeight:""}),i.classList.contains("e-overflow-hide")||i.classList.remove(P),r=h.tbarEle.indexOf(i),h.tbarAlign){var p=h.items[r].align;r=h.tbarAlgEle[(p+"s").toLowerCase()].indexOf(i),o=h.tbarAlgEle[(p+"s").toLowerCase()],a=h.element.querySelector("."+A+" .e-toolbar-"+p.toLowerCase())}var u=0;"Extended"!==h.overflowMode&&o.slice(0,r).forEach(function(t){(t.classList.contains("e-overflow-show")||t.classList.contains("e-separator"))&&(t.classList.contains("e-separator")&&(t.style.display="",e-=t.offsetWidth),u++)}),d=h.ignoreEleFetch(r,a),i.classList.contains("e-overflow-show")?(h.tbarPriRef(a,r,u,i,s,c,e,d),e-=i.offsetWidth):0===r?(a.insertBefore(i,a.firstChild),e-=i.offsetWidth):(n=t.selectAll(".e-overflow-show",h.popObj.element).length,a.insertBefore(i,a.children[r+d-n]),e-=i.offsetWidth),i.style.height=""}(p[c]);c++);this.checkOverflow(this.element,this.element.getElementsByClassName(A)[0])&&!s&&this.renderOverflowMode()},i.prototype.removePositioning=function(){var e=this.element.querySelector("."+A);if(!t.isNullOrUndefined(e)&&e.classList.contains("e-tbar-pos")){this.remove(e,"e-tbar-pos");var i=[].slice.call(e.childNodes);i[1].removeAttribute("style"),i[2].removeAttribute("style")}},i.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+A);this.add(e,"e-tbar-pos"),this.itemPositioning()},i.prototype.itemPositioning=function(){var e,i=this.element.querySelector("."+A);if(!t.isNullOrUndefined(i)&&i.classList.contains("e-tbar-pos")){var s,n=this.element.querySelector(".e-hor-nav");if(this.scrollModule){var r=this.isVertical?"e-vscroll-content":"e-hscroll-content";s=[].slice.call(i.querySelector("."+r).children)}else s=[].slice.call(i.childNodes);e=this.isVertical?s[0].offsetHeight+s[2].offsetHeight:s[0].offsetWidth+s[2].offsetWidth;var l=this.isVertical?this.element.offsetHeight:this.element.offsetWidth;if(n){l-=this.isVertical?n.offsetHeight:n.offsetWidth;var o=(this.isVertical?n.offsetHeight:n.offsetWidth)+"px";s[2].removeAttribute("style"),this.isVertical?this.enableRtl?s[2].style.top=o:s[2].style.bottom=o:this.enableRtl?s[2].style.left=o:s[2].style.right=o}if(!(l<=e)){var a=(l-e-(this.isVertical?s[1].offsetHeight:s[1].offsetWidth))/2;s[1].removeAttribute("style");var d=(this.isVertical?s[0].offsetHeight:s[0].offsetWidth)+a+"px";this.isVertical?this.enableRtl?s[1].style.marginBottom=d:s[1].style.marginTop=d:this.enableRtl?s[1].style.marginRight=d:s[1].style.marginLeft=d}}},i.prototype.tbarItemAlign=function(e,t,i){var s=this;if(!e.showAlwaysInPopup||"Show"===e.overflow){var n=[];if(n.push(this.createElement("div",{className:"e-toolbar-left"})),n.push(this.createElement("div",{className:"e-toolbar-center"})),n.push(this.createElement("div",{className:"e-toolbar-right"})),0===i&&"Left"!==e.align)n.forEach(function(e){t.appendChild(e)}),this.tbarAlign=!0,this.add(t,"e-tbar-pos");else if("Left"!==e.align){var r=t.childNodes,l=n[0];[].slice.call(r).forEach(function(e){s.tbarAlgEle.lefts.push(e),l.appendChild(e)}),t.appendChild(l),t.appendChild(n[1]),t.appendChild(n[2]),this.tbarAlign=!0,this.add(t,"e-tbar-pos")}}},i.prototype.ctrlTemplate=function(){var e=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,A),this.tbarEle=[],[].slice.call(this.trgtEle.children).forEach(function(t){"DIV"===t.tagName&&(e.tbarEle.push(t),t.setAttribute("aria-disabled","false"),e.add(t,D))})},i.prototype.renderItems=function(){var e=this.element,t=this.items;if(null!=this.trgtEle)this.ctrlTemplate();else if(e&&t.length>0){var i=void 0;e&&e.children.length>0&&(i=e.querySelector("."+A)),i||(i=this.createElement("div",{className:A})),this.itemsAlign(t,i),e.appendChild(i)}},i.prototype.setAttr=function(e,t){for(var i,s=Object.keys(e),n=0;n<s.length;n++)"class"===(i=s[n])?this.add(t,e[i]):t.setAttribute(i,e[i])},i.prototype.enableItems=function(e,i){var s,n=e,r=n.length;t.isNullOrUndefined(i)&&(i=!0);var l=function(e,t){e?(t.classList.remove("e-overlay"),t.setAttribute("aria-disabled","false")):(t.classList.add("e-overlay"),t.setAttribute("aria-disabled","true"))};if(!t.isNullOrUndefined(r)&&r>=1){for(var o=0,a=[].slice.call(n);o<r;o++){var d=a[o];if("number"==typeof d){if(s=this.getElementByIndex(d),t.isNullOrUndefined(s))return;n[o]=s}else s=d;l(i,s)}i?t.removeClass(n,"e-overlay"):t.addClass(n,"e-overlay")}else{if("number"==typeof n){if(s=this.getElementByIndex(n),t.isNullOrUndefined(s))return}else s=e;l(i,s)}},i.prototype.getElementByIndex=function(e){return this.tbarEle[e]?this.tbarEle[e]:null},i.prototype.addItems=function(e,i){var s;this.extendedOpen();var n=this.element.querySelector("."+A);if(t.isNullOrUndefined(n))return void this.itemsRerender(e);var r,l="Left";t.isNullOrUndefined(i)&&(i=0),e.forEach(function(e){t.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==l||(l=e.align)});for(var o=0,a=e;o<a.length;o++){var d=a[o];if(t.isNullOrUndefined(d.type)&&(d.type="Button"),s=t.selectAll("."+D,this.element),d.align=l,r=this.renderSubComponent(d,i),this.tbarEle.length>=i&&s.length>=0){t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var h="L"===d.align[0]?0:"C"===d.align[0]?1:2,c=void 0;this.tbarAlign||"Left"===l?this.tbarAlign?((c=t.closest(s[0],"."+A).children[h]).insertBefore(r,c.children[i]),this.tbarAlgEle[(d.align+"s").toLowerCase()].splice(i,0,r),this.refreshPositioning()):0===s.length?(s=t.selectAll("."+A,this.element))[0].appendChild(r):s[0].parentNode.insertBefore(r,s[i]):(this.tbarItemAlign(d,n,1),this.tbarAlign=!0,(c=t.closest(s[0],"."+A).children[h]).appendChild(r),this.tbarAlgEle[(d.align+"s").toLowerCase()].push(r),this.refreshPositioning()),this.items.splice(i,0,d),this.tbarEle.splice(i,0,r),i++,this.offsetWid=n.offsetWidth}}n.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},i.prototype.removeItems=function(e){var i,s=e,n=[].slice.call(t.selectAll("."+D,this.element));if("number"==typeof s)i=parseInt(e.toString(),10),this.removeItemByIndex(i,n);else if(s&&s.length>1)for(var r=0,l=[].slice.call(s);r<l.length;r++){o=l[r];i=this.tbarEle.indexOf(o),this.removeItemByIndex(i,n),n=t.selectAll("."+D,this.element)}else{var o=s&&s.length&&1===s.length?s[0]:e;i=n.indexOf(o),this.removeItemByIndex(i,n)}this.resize()},i.prototype.removeItemByIndex=function(e,i){if(this.tbarEle[e]&&i[e]){var s=this.tbarEle.indexOf(i[e]);if(this.tbarAlign){var n=this.tbarAlgEle[(this.items[s].align+"s").toLowerCase()].indexOf(this.tbarEle[s]);this.tbarAlgEle[(this.items[s].align+"s").toLowerCase()].splice(n,1)}this.isReact&&this.clearTemplate();var r=i[e].querySelector(".e-control.e-btn");t.isNullOrUndefined(r)||t.isNullOrUndefined(r.ej2_instances[0])||r.ej2_instances[0].isDestroyed||r.ej2_instances[0].destroy(),t.detach(i[e]),this.items.splice(s,1),this.tbarEle.splice(s,1)}},i.prototype.templateRender=function(e,i,s,n){var r,l=s.type,o=e;if("object"==typeof e&&(r="function"==typeof o.appendTo),"string"!=typeof e&&r){if("Input"===l){var a=this.createElement("input");s.id?a.id=s.id:a.id=t.getUniqueID("tbr-ipt"),i.appendChild(a),o.appendTo(a)}}else{var d=void 0,h=e;h="string"==typeof e?e.trim():e;try{if("object"!=typeof e||t.isNullOrUndefined(e.tagName)){if(document.querySelectorAll(h).length){var c=(a=document.querySelector(h)).outerHTML.trim();i.appendChild(a),a.style.display="",t.isNullOrUndefined(c)||this.tempId.push(h)}}else i.appendChild(e)}catch(e){d=t.compile(h)}var p=void 0;t.isNullOrUndefined(d)||(p=d({},this,"template",this.element.id+n+"_template",this.isStringTemplate)),!t.isNullOrUndefined(p)&&p.length>0&&[].slice.call(p).forEach(function(e){t.isNullOrUndefined(e.tagName)||(e.style.display=""),i.appendChild(e)})}this.add(i,"e-template"),this.tbarEle.push(i)},i.prototype.buttonRendering=function(e,i){var s=this.createElement("button",{className:"e-tbar-btn"});s.setAttribute("type","button");var r,l,o=e.text;e.id?s.id=e.id:s.id=t.getUniqueID("e-tbr-btn");var a=this.createElement("span",{className:"e-tbar-btn-text"});o?(a.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(o):o,s.appendChild(a),s.classList.add("e-tbtn-txt")):this.add(i,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(e.prefixIcon&&e.suffixIcon||e.prefixIcon?(r=e.prefixIcon+" e-icons",l="Left"):(r=e.suffixIcon+" e-icons",l="Right"));var d=new n.Button({iconCss:r,iconPosition:l});return d.createElement=this.createElement,d.appendTo(s),e.width&&t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),s},i.prototype.renderSubComponent=function(e,i){var s,n=this.createElement("div",{className:D});n.setAttribute("aria-disabled","false");var r=this.createElement("div",{innerHTML:this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,n),e.tooltipText&&n.setAttribute("title",r.textContent),e.cssClass&&(n.className=n.className+" "+e.cssClass),e.template)this.templateRender(e.template,n,e,i);else switch(e.type){case"Button":(s=this.buttonRendering(e,n)).setAttribute("tabindex","-1"),s.setAttribute("aria-label",e.text||e.tooltipText),n.appendChild(s),n.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(n,"e-separator")}if(e.showTextOn){var l=e.showTextOn;"Toolbar"===l?(this.add(n,"e-toolbar-text"),this.add(n,"e-tbtn-align")):"Overflow"===l&&this.add(n,"e-popup-text")}if(e.overflow){var o=e.overflow;"Show"===o?this.add(n,"e-overflow-show"):"Hide"===o&&(n.classList.contains("e-separator")||this.add(n,"e-overflow-hide"))}return"Show"!==e.overflow&&e.showAlwaysInPopup&&!n.classList.contains("e-separator")&&(this.add(n,"e-popup-alone"),this.popupPriCount++),e.disabled&&this.add(n,"e-overlay"),!1===e.visible&&this.add(n,"e-hidden"),n},i.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},i.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},i.prototype.activeEleRemove=function(e){t.isNullOrUndefined(this.activeEle)||this.activeEle.setAttribute("tabindex","-1"),this.activeEle=e,t.isNullOrUndefined(this.trgtEle)&&!e.parentElement.classList.contains("e-template")?e.removeAttribute("tabindex"):this.activeEle.setAttribute("tabindex","0")},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.getModuleName=function(){return"toolbar"},i.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,this.isReact&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},i.prototype.resize=function(){var e=this.element;this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide();var i=this.checkOverflow(e,e.getElementsByClassName(A)[0]);if(!i){this.destroyScroll();var s=e.querySelector("."+A);t.isNullOrUndefined(s)||(this.remove(s,"e-multirow-pos"),this.tbarAlign&&this.add(s,"e-tbar-pos"))}if(!i||!this.scrollModule||this.offsetWid!==e.offsetWidth){if((this.offsetWid>e.offsetWidth||i)&&this.renderOverflowMode(),this.popObj){if("Extended"===this.overflowMode){var n=window.getComputedStyle(this.element);this.popObj.width=parseFloat(n.width)+2*parseFloat(n.borderRightWidth)}this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign&&this.refreshPositioning()}this.element.querySelector(".e-hscroll-bar")&&(this.scrollStep=this.element.querySelector(".e-hscroll-bar").offsetWidth),this.offsetWid=e.offsetWidth,this.tbResize=!1,this.separator()}},i.prototype.extendedOpen=function(){var e=this.element.querySelector(".e-toolbar-extended");"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains("e-popup-open"))},i.prototype.onPropertyChanged=function(e,i){var s=this.element,n=s.offsetWidth;this.extendedOpen();for(var r=0,l=Object.keys(e);r<l.length;r++)switch(l[r]){case"items":if(e.items instanceof Array&&i.items instanceof Array||this.isServerRendered)this.itemsRerender(e.items);else for(var o=Object.keys(e.items),a=0;a<o.length;a++){var d=parseInt(Object.keys(e.items)[a],10),h=Object.keys(e.items[d])[0],c=Object(e.items[d])[h];if("function"!=typeof c){if(this.tbarAlign||"align"===h){this.refresh(),this.trigger("created");break}var p="showAlwaysInPopup"===h&&!c,u="overflow"===h&&0!==this.popupPriCount;(p||this.items[d].showAlwaysInPopup&&u)&&--this.popupPriCount,t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var f=[].slice.call(t.selectAll("."+A+" ."+D,s));this.isReact&&this.clearTemplate(),t.detach(f[d]),this.tbarEle.splice(d,1),this.addItems([this.items[d]],d),this.items.splice(d,1),this.items[d].template&&this.tbarEle.splice(this.items.length,1)}}break;case"width":t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),this.renderOverflowMode(),this.popObj&&n<s.offsetWidth&&this.popupRefresh(this.popObj.element,!1);break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(s,"e-rtl"),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(s,"e-rtl"):this.remove(s,"e-rtl"),t.isNullOrUndefined(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,"e-rtl"):this.remove(this.scrollModule.element,"e-rtl")),t.isNullOrUndefined(this.popObj)||(e.enableRtl?this.add(this.popObj.element,"e-rtl"):this.remove(this.popObj.element,"e-rtl")),this.tbarAlign&&this.itemPositioning();break;case"scrollStep":this.scrollModule&&(this.scrollModule.scrollStep=this.scrollStep);break;case"enableCollision":this.popObj&&(this.popObj.collision={Y:this.enableCollision?"flip":"none"});break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}},i.prototype.hideItem=function(e,i){var s,n,r="object"==typeof e,l=e,o=[].slice.call(t.selectAll("."+D,this.element));if(r?n=e:this.tbarEle[l]&&(n=[].slice.call(t.selectAll("."+D,this.element))[l]),n){if(i?n.classList.add("e-hidden"):n.classList.remove("e-hidden"),i&&t.isNullOrUndefined(this.element.getAttribute("tabindex"))&&!n.classList.contains("e-separator")){if(t.isNullOrUndefined(n.firstElementChild.getAttribute("tabindex"))){n.firstElementChild.setAttribute("tabindex","-1");var a=[].slice.call(t.selectAll("."+D,this.element));r&&(l=a.indexOf(n));for(var d=a[++l];d;){if(!(u=this.eleContains(d))){d.firstElementChild.removeAttribute("tabindex");break}d=a[++l]}}}else if(t.isNullOrUndefined(this.element.getAttribute("tabindex"))&&!n.classList.contains("e-separator"))for(var h=!1,c=!1,p=o[s=0];p;)if(p.classList.contains("e-separator"))p=o[++s];else if(t.isNullOrUndefined(p.firstElementChild.getAttribute("tabindex")))p.firstElementChild.setAttribute("tabindex","-1"),h=!0;else{if(h&&c)break;var u=this.eleContains(p);u||(p.firstElementChild.removeAttribute("tabindex"),c=!0),p=o[++s]}this.refreshOverflow()}},L([t.Collection([],T)],i.prototype,"items",void 0),L([t.Property("auto")],i.prototype,"width",void 0),L([t.Property("auto")],i.prototype,"height",void 0),L([t.Property("")],i.prototype,"cssClass",void 0),L([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),L([t.Property()],i.prototype,"scrollStep",void 0),L([t.Property(!0)],i.prototype,"enableCollision",void 0),L([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),L([t.Property(!0)],i.prototype,"allowKeyboard",void 0),L([t.Event()],i.prototype,"clicked",void 0),L([t.Event()],i.prototype,"created",void 0),L([t.Event()],i.prototype,"destroyed",void 0),L([t.Event()],i.prototype,"beforeCreate",void 0),i=L([t.NotifyPropertyChanges],i)}(t.Component),U=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),H=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},B="e-acrdn-item",R="e-acrdn-header",j="e-acrdn-panel",q="e-acrdn-content",F=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),H([t.Property("SlideDown")],i.prototype,"effect",void 0),H([t.Property(400)],i.prototype,"duration",void 0),H([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),H([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},F)],i.prototype,"collapse",void 0),H([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},F)],i.prototype,"expand",void 0),i}(t.ChildProperty),V=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),H([t.Property(null)],i.prototype,"content",void 0),H([t.Property(null)],i.prototype,"header",void 0),H([t.Property(null)],i.prototype,"cssClass",void 0),H([t.Property(null)],i.prototype,"iconCss",void 0),H([t.Property(!1)],i.prototype,"expanded",void 0),H([t.Property(!0)],i.prototype,"visible",void 0),H([t.Property(!1)],i.prototype,"disabled",void 0),H([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),W=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.keyConfigs={moveUp:"uparrow",moveDown:"downarrow",enter:"enter",space:"space",home:"home",end:"end"},s}return U(i,e),i.prototype.destroy=function(){var i=this;this.isReact&&this.clearTemplate();var s=this.element;if(e.prototype.destroy.call(this),this.unwireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(s.children).forEach(function(e){s.removeChild(e)}),this.trgtEle)for(;this.ctrlTem.firstElementChild;)s.appendChild(this.ctrlTem.firstElementChild);s.classList.remove("e-acrdn-root"),s.removeAttribute("style"),["aria-disabled","aria-multiselectable","role","data-ripple"].forEach(function(e){i.element.removeAttribute(e)}),!this.isNested&&t.isRippleEnabled&&this.removeRippleEffect()},i.prototype.preRender=function(){var e=t.closest(this.element,"."+j);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),t.isNullOrUndefined(e)?this.element.classList.add("e-acrdn-root"):(e.classList.add("e-nested"),this.isNested=!0),this.enableRtl&&this.add(this.element,"e-rtl")},i.prototype.add=function(e,t){e.classList.add(t)},i.prototype.remove=function(e,t){e.classList.remove(t)},i.prototype.render=function(){this.isServerRendered?this.wireFocusEvents():(this.initializeheaderTemplate(),this.initializeItemTemplate(),this.initialize(),this.renderControl()),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){var e=t.formatUnit(this.width),i=t.formatUnit(this.height);t.setStyleAttribute(this.element,{width:e,height:i});var s={"aria-disabled":"false",role:"presentation","aria-multiselectable":"true"};t.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),t.attributes(this.element,s),"Single"===this.expandMode&&this.element.setAttribute("aria-multiselectable","false")},i.prototype.renderControl=function(){this.trgtEle=this.element.children.length>0?t.select("div",this.element):null,this.renderItems(),this.initItemExpand()},i.prototype.wireFocusEvents=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll("."+B));e<i.length;e++){var s=i[e],n=s.querySelector("."+R);s.childElementCount>0&&n&&(t.EventHandler.clearEvents(n),t.EventHandler.add(n,"focus",this.focusIn,this),t.EventHandler.add(n,"blur",this.focusOut,this))}},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),t.isNullOrUndefined(this.keyModule)||this.keyModule.destroy()},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this),this.isNested||this.isDestroy||(this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+R})),this.isNested||(this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}))},i.prototype.templateParser=function(e){if(e)try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(i){return t.compile(e)}},i.prototype.initializeheaderTemplate=function(){this.headerTemplate&&(this.headerTemplateFn=this.templateParser(this.headerTemplate))},i.prototype.initializeItemTemplate=function(){this.itemTemplate&&(this.itemTemplateFn=this.templateParser(this.itemTemplate))},i.prototype.getheaderTemplate=function(){return this.headerTemplateFn},i.prototype.getItemTemplate=function(){return this.itemTemplateFn},i.prototype.focusIn=function(e){e.target.parentElement.classList.add("e-item-focus")},i.prototype.focusOut=function(e){e.target.parentElement.classList.remove("e-item-focus")},i.prototype.ctrlTemplate=function(){this.ctrlTem=this.element.cloneNode(!0);var e,i=t.select(".e-accordion-container",this.element);e=i?i.children:this.element.children;var s=[];[].slice.call(e).forEach(function(e){s.push({header:e.childElementCount>0&&e.children[0]?e.children[0]:"",content:e.childElementCount>1&&e.children[1]?e.children[1]:""}),e.parentNode.removeChild(e)}),i&&this.element.removeChild(i),this.setProperties({items:s},!0)},i.prototype.toggleIconGenerate=function(){var e=this.createElement("div",{className:"e-toggle-icon"}),t=this.createElement("span",{className:"e-tgl-collapse-icon e-icons"});return e.appendChild(t),e},i.prototype.initItemExpand=function(){var e=this.initExpand.length;if(0!==e){if("Single"===this.expandMode)this.expandItem(!0,this.initExpand[e-1]);else for(var t=0;t<e;t++)this.expandItem(!0,this.initExpand[t]);this.isReact&&this.renderReactTemplates()}},i.prototype.renderItems=function(){var e,i,s=this,n=this.element;if(t.isNullOrUndefined(this.trgtEle)||this.ctrlTemplate(),this.dataSource.length>0)this.dataSource.forEach(function(e,r){i=s.renderInnerItem(e,r),n.appendChild(i),i.childElementCount>0&&(t.EventHandler.add(i.querySelector("."+R),"focus",s.focusIn,s),t.EventHandler.add(i.querySelector("."+R),"blur",s.focusOut,s))});else{var r=this.items;n&&r.length>0&&r.forEach(function(i,r){e=s.renderInnerItem(i,r),n.appendChild(e),e.childElementCount>0&&(t.EventHandler.add(e.querySelector("."+R),"focus",s.focusIn,s),t.EventHandler.add(e.querySelector("."+R),"blur",s.focusOut,s))})}this.isReact&&this.renderReactTemplates()},i.prototype.clickHandler=function(e){var i,s=this,n=e.target,r=this.getItems(),l={};if(t.closest(n,".e-accordion")===this.element){n.classList.add("e-target");var o=t.closest(n,"."+B),a=t.closest(n,"."+R),d=t.closest(n,"."+j);o&&(t.isNullOrUndefined(a)||t.isNullOrUndefined(d))&&(a=o.children[0],d=o.children[1]),a&&(i=t.select(".e-toggle-icon",a));var h;a?h=t.closest(a,"."+B):d&&(h=t.closest(d,"."+B));var c=this.getIndexByItem(o);if(h&&(l.item=r[this.getIndexByItem(h)]),l.originalEvent=e,!(!t.isNullOrUndefined(i)&&o.childElementCount<=1)||!t.isNullOrUndefined(d)&&t.isNullOrUndefined(t.select(".e-acrdn-header .e-toggle-icon",h)))this.afterContentRender(n,l,o,a,d,h);else if(this.isServerRendered){var p=o.id;this.items.length>0?this.interopAdaptor.invokeMethodAsync("OnItemClick",c).then(function(){s.isDestroyed||s.afterContentRender(n,l,o,a,d,h)}):this.interopAdaptor.invokeMethodAsync("OnDataClick",p).then(function(){s.isDestroyed||s.afterContentRender(n,l,o,a,d,h)})}else o.appendChild(this.contentRendering(c)),this.ariaAttrUpdate(o),this.afterContentRender(n,l,o,a,d,h);this.isReact&&this.renderReactTemplates()}},i.prototype.afterContentRender=function(e,i,s,n,r,l){var o=this,a=[];this.trigger("clicked",i);var d=r&&!t.isNullOrUndefined(t.select(".e-target",r)),h=r&&!t.isNullOrUndefined(t.select(".e-accordion",r))&&t.isNullOrUndefined(t.closest(e,".e-acrdn-panel .e-accordion")),c=r&&t.isNullOrUndefined(t.select(".e-accordion",r))||!(t.closest(e,".e-accordion")===this.element);if(d=d&&(h||c),e.classList.remove("e-target"),!(e.classList.contains(j)||e.classList.contains(q)||d)){var p=this.element.querySelector(".e-accordion-container"),u=p?p.children:this.element.children;[].slice.call(u).forEach(function(e){e.classList.contains("e-active")&&a.push(e)});var f=[].slice.call(this.element.querySelectorAll(".e-acrdn-item [e-animate]"));if(f.length>0)for(var m=0,v=f;m<v.length;m++){var g=v[m];a.push(g.parentElement)}var y=-1!==a.indexOf(l)&&"true"===r.getAttribute("e-animate"),b=!1;if(!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(n)){var C=t.select("."+j,s),N=t.closest(s,".e-acrdn-root").querySelector(".e-expand-state");if(t.isNullOrUndefined(C))return;b=N===s,!t.isVisible(C)||y&&!l.classList.contains("e-selected")?(a.length>0&&"Single"===this.expandMode&&!y&&a.forEach(function(e){o.collapse(t.select("."+j,e)),e.classList.remove("e-expand-state")}),this.expand(C)):this.collapse(C),t.isNullOrUndefined(N)||b||N.classList.remove("e-expand-state")}}},i.prototype.eleMoveFocus=function(e,i,s){var n,r=t.closest(s,"."+B);s===i?n=("moveUp"===e?s.lastElementChild:s).querySelector("."+R):s.classList.contains(R)&&(r="moveUp"===e?r.previousElementSibling:r.nextElementSibling)&&(n=t.select("."+R,r)),n&&n.focus()},i.prototype.keyActionHandler=function(e){var i=e.target,s=t.closest(e.target,R);if(!t.isNullOrUndefined(s)||i.classList.contains("e-accordion")||i.classList.contains(R)){var n,r=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,r,i);break;case"space":case"enter":n=i.nextElementSibling,!t.isNullOrUndefined(n)&&n.classList.contains(j)?"true"!==n.getAttribute("e-animate")&&i.click():i.click();break;case"home":case"end":("home"===e.action?r.firstElementChild.children[0]:r.lastElementChild.children[0]).focus()}}},i.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:R,id:t.getUniqueID("acrdn_header")}),i={tabindex:"0",role:"heading","aria-selected":"false","aria-label":"collapsed","aria-disabled":"false","aria-level":this.getItems().length.toString()};return t.attributes(e,i),e},i.prototype.renderInnerItem=function(e,i){var s=this.createElement("div",{className:B});if(s.id=t.getUniqueID("acrdn_item"),t.isNullOrUndefined(e.id)&&(e.id=s.id),t.attributes(s,{"aria-expanded":"false"}),this.headerTemplate){var n=this.headerEleGenerate(),r=this.createElement("div",{className:"e-acrdn-header-content"});return n.appendChild(r),t.append(this.getheaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),r),s.appendChild(n),n.appendChild(this.toggleIconGenerate()),this.add(s,"e-select"),s}if(e.header&&this.angularnativeCondiCheck(e,"header")){this.enableHtmlSanitizer&&"string"==typeof e.header&&(e.header=t.SanitizeHtmlHelper.sanitize(e.header));var n=this.headerEleGenerate(),r=this.createElement("div",{className:"e-acrdn-header-content"});n.appendChild(r),n.appendChild(this.fetchElement(r,e.header,i,!0)),s.appendChild(n)}var l=t.select("."+R,s);if(!e.expanded||t.isNullOrUndefined(i)||this.enablePersistence||-1===this.initExpand.indexOf(i)&&this.initExpand.push(i),e.cssClass&&t.addClass([s],e.cssClass.split(" ")),e.disabled&&t.addClass([s],"e-overlay"),!1===e.visible&&t.addClass([s],"e-hide"),e.iconCss){var o=this.createElement("div",{className:"e-acrdn-header-icon"}),a=this.createElement("span",{className:e.iconCss+" e-icons"});o.appendChild(a),t.isNullOrUndefined(l)?((l=this.headerEleGenerate()).appendChild(o),s.appendChild(l)):l.insertBefore(o,l.childNodes[0])}if(e.content&&this.angularnativeCondiCheck(e,"content")){var d=this.toggleIconGenerate();t.isNullOrUndefined(l)&&(l=this.headerEleGenerate(),s.appendChild(l)),l.appendChild(d),this.add(s,"e-select")}return s},i.prototype.angularnativeCondiCheck=function(e,i){var s="content"===i?e.content:e.header;if(this.isAngular&&!t.isNullOrUndefined(s.elementRef)){var n=s.elementRef.nativeElement.data;if(t.isNullOrUndefined(n)||""===n||-1===n.indexOf("bindings="))return!0;var r=JSON.parse(s.elementRef.nativeElement.data.replace("bindings=",""));return!(!t.isNullOrUndefined(r)&&"false"===r["ng-reflect-ng-if"])}return!0},i.prototype.fetchElement=function(e,i,s,n){var r,l;try{if(document.querySelectorAll(i).length&&"Button"!==i){var o=document.querySelector(i);l=o.outerHTML.trim(),e.appendChild(o),o.style.display=""}}catch(s){"string"==typeof i?e.innerHTML=t.SanitizeHtmlHelper.sanitize(i):!t.isNullOrUndefined(this.trgtEle)&&i instanceof HTMLElement?(e.appendChild(i),e.firstElementChild.style.display=""):r=t.compile(i)}var a;if(!t.isNullOrUndefined(r)){this.isReact&&this.renderReactTemplates();var d=void 0,h=void 0;e.classList.contains("e-acrdn-header-content")?(d=this.element.id+s+"_header",h="header"):e.classList.contains(q)&&(d=this.element.id+s+"_content",h="content"),a=r({},this,h,d,this.isStringTemplate)}return t.isNullOrUndefined(a)||!(a.length>0)||t.isNullOrUndefined(a[0].tagName)&&1===a.length?0===e.childElementCount&&(e.innerHTML=t.SanitizeHtmlHelper.sanitize(i)):[].slice.call(a).forEach(function(i){t.isNullOrUndefined(i.tagName)||(i.style.display=""),e.appendChild(i)}),t.isNullOrUndefined(l)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),e},i.prototype.ariaAttrUpdate=function(e){var i=t.select("."+R,e),s=t.select("."+j,e);i.setAttribute("aria-controls",s.id),s.setAttribute("aria-labelledby",i.id),s.setAttribute("role","definition")},i.prototype.contentRendering=function(e){var i=this.createElement("div",{className:j+" e-content-hide",id:t.getUniqueID("acrdn_panel")});t.attributes(i,{"aria-hidden":"true"});var s=this.createElement("div",{className:q});return this.dataSource.length>0?(this.isReact&&this.renderReactTemplates(),t.append(this.getItemTemplate()(this.dataSource[e],this,"itemTemplate",this.element.id+"_itemTemplate",!1),s),i.appendChild(s)):(this.enableHtmlSanitizer&&(this.items[e].content,!0)&&(this.items[e].content=t.SanitizeHtmlHelper.sanitize(this.items[e].content)),i.appendChild(this.fetchElement(s,this.items[e].content,e,!1))),i},i.prototype.expand=function(e){var i=this,s=this.getItems(),n=t.closest(e,"."+B);if(!(t.isNullOrUndefined(e)||t.isVisible(e)&&"true"!==e.getAttribute("e-animate")||n.classList.contains("e-overlay"))){var r=t.closest(n,".e-acrdn-root").querySelector(".e-expand-state"),l={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},o=t.select(".e-toggle-icon",n).firstElementChild,a={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+j),isExpanded:!0};this.trigger("expanding",a,function(s){s.cancel||(o.classList.add("e-toggle-animation"),i.expandedItemsPush(n),t.isNullOrUndefined(r)||r.classList.remove("e-expand-state"),n.classList.add("e-expand-state"),"None"===l.name?(i.expandProgress("begin",o,e,n,s),i.expandProgress("end",o,e,n,s)):i.expandAnimation(l.name,o,e,n,l,s))})}},i.prototype.expandAnimation=function(e,i,s,n,r,l){var o,a=this;this.lastActiveItemId=n.id,"SlideDown"===e?(r.begin=function(){a.expandProgress("begin",i,s,n,l),s.style.position="absolute",o=n.offsetHeight,s.style.maxHeight=s.offsetHeight+"px",n.style.maxHeight=""},r.progress=function(){n.style.minHeight=o+s.offsetHeight+"px"},r.end=function(){t.setStyleAttribute(s,{position:"",maxHeight:""}),n.style.minHeight="",a.expandProgress("end",i,s,n,l)}):(r.begin=function(){a.expandProgress("begin",i,s,n,l)},r.end=function(){a.expandProgress("end",i,s,n,l)}),new t.Animation(r).animate(s)},i.prototype.expandProgress=function(e,i,s,n,r){this.remove(s,"e-content-hide"),this.add(n,"e-selected"),this.add(i,"e-expand-icon"),"end"===e&&(this.add(n,"e-active"),s.setAttribute("aria-hidden","false"),t.attributes(n,{"aria-expanded":"true"}),t.attributes(s.previousElementSibling,{"aria-selected":"true","aria-label":"expanded"}),i.classList.remove("e-toggle-animation"),this.trigger("expanded",r))},i.prototype.expandedItemsPush=function(e){var t=this.getIndexByItem(e);if(-1===this.expandedIndices.indexOf(t)){var i=[].slice.call(this.expandedIndices);i.push(t),this.setProperties({expandedIndices:i},!0)}},i.prototype.getIndexByItem=function(e){var t=this.getItemElements();return[].slice.call(t).indexOf(e)},i.prototype.getItemElements=function(){var e=[],t=this.element.children;return[].slice.call(t).forEach(function(t){t.classList.contains(B)&&e.push(t)}),e},i.prototype.expandedItemsPop=function(e){var t=this.getIndexByItem(e),i=[].slice.call(this.expandedIndices);i.splice(i.indexOf(t),1),this.setProperties({expandedIndices:i},!0)},i.prototype.collapse=function(e){var i=this,s=this.getItems(),n=t.closest(e,"."+B);if(!t.isNullOrUndefined(e)&&t.isVisible(e)&&!n.classList.contains("e-overlay")){var r={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},l=t.select(".e-toggle-icon",n).firstElementChild,o={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+j),isExpanded:!1};this.trigger("expanding",o,function(t){t.cancel||(i.expandedItemsPop(n),n.classList.add("e-expand-state"),l.classList.add("e-toggle-animation"),"None"===r.name?(i.collapseProgress("begin",l,e,n,t),i.collapseProgress("end",l,e,n,t)):i.collapseAnimation(r.name,e,n,l,r,t))})}},i.prototype.collapseAnimation=function(e,i,s,n,r,l){var o,a,d,h,c=this;this.lastActiveItemId=s.id,"SlideUp"===e?(r.begin=function(){d=s.offsetHeight,s.style.minHeight=d+"px",i.style.position="absolute",o=s.offsetHeight,a=i.offsetHeight,i.style.maxHeight=a+"px",c.collapseProgress("begin",n,i,s,l)},r.progress=function(){(h=o-(a-i.offsetHeight))<d&&(s.style.minHeight=h+"px")},r.end=function(){i.style.display="none",c.collapseProgress("end",n,i,s,l),s.style.minHeight="",t.setStyleAttribute(i,{position:"",maxHeight:"",display:""})}):(r.begin=function(){c.collapseProgress("begin",n,i,s,l)},r.end=function(){c.collapseProgress("end",n,i,s,l)}),new t.Animation(r).animate(i)},i.prototype.collapseProgress=function(e,i,s,n,r){this.remove(i,"e-expand-icon"),this.remove(n,"e-selected"),"end"===e&&(this.add(s,"e-content-hide"),i.classList.remove("e-toggle-animation"),this.remove(n,"e-active"),s.setAttribute("aria-hidden","true"),t.attributes(n,{"aria-expanded":"false"}),t.attributes(s.previousElementSibling,{"aria-selected":"false","aria-label":"collapsed"}),this.trigger("expanded",r))},i.prototype.getModuleName=function(){return"accordion"},i.prototype.itemAttribUpdate=function(){var e=this.getItems(),i=this.getItemElements(),s=e.length;i.forEach(function(e){t.select("."+R,e).setAttribute("aria-level",""+s)})},i.prototype.getItems=function(){return this.itemTemplate&&this.headerTemplate?this.dataSource:this.items},i.prototype.addItem=function(e,i){var s=this,n=this.element,r=this.getItemElements(),l=this.getItems();t.isNullOrUndefined(i)&&(i=l.length),n.childElementCount>=i&&(e instanceof Array?e:[e]).forEach(function(e,o){var a=i+o;l.splice(a,0,e);var d=s.renderInnerItem(e,a);n.childElementCount===a?n.appendChild(d):n.insertBefore(d,r[a]),t.EventHandler.add(d.querySelector("."+R),"focus",s.focusIn,s),t.EventHandler.add(d.querySelector("."+R),"blur",s.focusOut,s),s.itemAttribUpdate(),s.expandedIndices=[],s.expandedItemRefresh(n),e&&e.expanded&&s.expandItem(!0,a)}),this.isReact&&this.renderReactTemplates()},i.prototype.expandedItemRefresh=function(e){var t=this,i=this.getItemElements();[].slice.call(i).forEach(function(e){e.classList.contains("e-selected")&&t.expandedItemsPush(e)})},i.prototype.removeItem=function(e){this.isReact&&this.clearTemplate(["headerTemplate","itemTemplate"],e);var i=this.getItemElements()[e],s=this.getItems();t.isNullOrUndefined(i)||(this.restoreContent(e),t.detach(i),s.splice(e,1),this.itemAttribUpdate(),this.expandedIndices=[],this.expandedItemRefresh(this.element))},i.prototype.select=function(e){var i=this.getItemElements()[e];t.isNullOrUndefined(i)||t.isNullOrUndefined(t.select("."+R,i))||i.children[0].focus()},i.prototype.hideItem=function(e,i){var s=this.getItemElements()[e];t.isNullOrUndefined(s)||(t.isNullOrUndefined(i)&&(i=!0),i?this.add(s,"e-hide"):this.remove(s,"e-hide"))},i.prototype.enableItem=function(e,i){var s=this.getItemElements()[e];if(!t.isNullOrUndefined(s)){var n=s.firstElementChild;i?(this.remove(s,"e-overlay"),t.attributes(n,{tabindex:"0","aria-disabled":"false"}),n.focus()):(s.classList.contains("e-active")&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,n)),this.add(s,"e-overlay"),n.setAttribute("aria-disabled","true"),n.removeAttribute("tabindex"))}},i.prototype.refresh=function(){this.isServerRendered||e.prototype.refresh.call(this)},i.prototype.expandItem=function(e,i){var s=this,n=this.getItemElements();if(t.isNullOrUndefined(i))if("Single"===this.expandMode&&e){o=n[n.length-1];this.itemExpand(e,o,this.getIndexByItem(o))}else{var r=t.select("#"+this.lastActiveItemId,this.element);[].slice.call(n).forEach(function(t){s.itemExpand(e,t,s.getIndexByItem(t)),t.classList.remove("e-expand-state")});var l=t.select(".e-expand-state",this.element);l&&l.classList.remove("e-expand-state"),r&&r.classList.add("e-expand-state")}else{var o=n[i];if(t.isNullOrUndefined(o)||!o.classList.contains("e-select")||o.classList.contains("e-active")&&e)return;"Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(e,o,i)}},i.prototype.itemExpand=function(e,i,s){var n=this,r=i.children[1];if(!i.classList.contains("e-overlay")){if(t.isNullOrUndefined(r)&&e)if(this.isServerRendered){var l=i.id;this.items.length>0?this.interopAdaptor.invokeMethodAsync("OnItemClick",s).then(function(){n.isDestroyed||(r=i.children[1],n.expand(r))}):this.interopAdaptor.invokeMethodAsync("OnDataClick",l).then(function(){n.isDestroyed||(r=i.children[1],n.expand(r))})}else r=this.contentRendering(s),i.appendChild(r),this.ariaAttrUpdate(i),this.expand(r);else t.isNullOrUndefined(r)||(e?this.expand(r):this.collapse(r));this.isReact&&this.renderReactTemplates()}},i.prototype.destroyItems=function(){this.restoreContent(null),this.isReact&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+B)).forEach(function(e){t.detach(e)})},i.prototype.restoreContent=function(e){var i;i=t.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+B)[e],this.templateEle.forEach(function(e){t.isNullOrUndefined(i.querySelector(e))||(document.body.appendChild(i.querySelector(e)).style.display="none")})},i.prototype.updateItem=function(e,i){if(!t.isNullOrUndefined(e)){var s=this.getItems(),n=s[i];s.splice(i,1),this.restoreContent(i),t.detach(e),this.addItem(n,i)}},i.prototype.setTemplate=function(e,t,i){t.innerHTML="",this.templateCompile(t,e,i),this.isReact&&this.renderReactTemplates()},i.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.fetchElement(s,t,i,!1),0!==s.childNodes.length&&[].slice.call(s.childNodes).forEach(function(t){e.appendChild(t)})},i.prototype.getPersistData=function(){var e=["expandedIndices"];return this.addOnPersist(e)},i.prototype.onPropertyChanged=function(e,i){for(var s=this.element,n=!1,r=0,l=Object.keys(e);r<l.length;r++)switch(l[r]){case"items":if(this.isServerRendered){this.wireFocusEvents();break}if(e.items instanceof Array&&i.items instanceof Array)n=!0;else for(var o=Object.keys(e.items),a=0;a<o.length;a++){var d=parseInt(Object.keys(e.items)[a],10),h=Object.keys(e.items[d])[0],c=t.selectAll("."+B,this.element)[d],p=Object(i.items[d])[h],u=Object(e.items[d])[h],f=h;if(("header"===f||"iconCss"===f||"expanded"===f||"content"===f&&""===p)&&this.updateItem(c,d),"cssClass"!==h||t.isNullOrUndefined(c)||(c.classList.remove(p),c.classList.add(u)),"visible"!==h||t.isNullOrUndefined(c)||(!1===Object(e.items[d])[h]?c.classList.add("e-hide"):c.classList.remove("e-hide")),"disabled"!==h||t.isNullOrUndefined(c)||this.enableItem(d,!u),"content"===h&&!t.isNullOrUndefined(c)&&2===c.children.length)if("function"==typeof u){var m=c.querySelector("."+q);m.innerHTML="",this.setTemplate(u,m,d)}else c.classList.contains("e-selected")&&this.expandItem(!1,d),t.detach(c.querySelector("."+j))}break;case"dataSource":case"expandedIndices":null===this.expandedIndices&&(this.expandedIndices=[]),n=!0;break;case"headerTemplate":this.initializeheaderTemplate(),n=!0;break;case"itemTemplate":this.initializeItemTemplate(),n=!0;break;case"enableRtl":e.enableRtl?this.add(s,"e-rtl"):this.remove(s,"e-rtl");break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)});break;case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(e.width)});break;case"expandMode":"Single"===e.expandMode?(this.element.setAttribute("aria-multiselectable","false"),this.expandedIndices.length>1&&this.expandItem(!1)):this.element.setAttribute("aria-multiselectable","true")}n&&!this.isServerRendered&&(this.initExpand=[],this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},H([t.Collection([],V)],i.prototype,"items",void 0),H([t.Property([])],i.prototype,"dataSource",void 0),H([t.Property()],i.prototype,"itemTemplate",void 0),H([t.Property()],i.prototype,"headerTemplate",void 0),H([t.Property("100%")],i.prototype,"width",void 0),H([t.Property("auto")],i.prototype,"height",void 0),H([t.Property([])],i.prototype,"expandedIndices",void 0),H([t.Property("Multiple")],i.prototype,"expandMode",void 0),H([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),H([t.Complex({},z)],i.prototype,"animation",void 0),H([t.Event()],i.prototype,"clicked",void 0),H([t.Event()],i.prototype,"expanding",void 0),H([t.Event()],i.prototype,"expanded",void 0),H([t.Event()],i.prototype,"created",void 0),H([t.Event()],i.prototype,"destroyed",void 0),i=H([t.NotifyPropertyChanges],i)}(t.Component),_=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),K=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},Y=function(e){function i(t,i){return e.call(this,t,i)||this}return _(i,e),i.prototype.preRender=function(){this.isMenu=!1,this.element.id=this.element.id||t.getUniqueID("ej2-contextmenu"),e.prototype.preRender.call(this)},i.prototype.initialize=function(){e.prototype.initialize.call(this),t.attributes(this.element,{role:"menubar",tabindex:"0"}),this.element.style.zIndex=s.getZindexPartial(this.element).toString()},i.prototype.open=function(t,i,s){e.prototype.openMenu.call(this,null,null,t,i,null,s)},i.prototype.close=function(){e.prototype.closeMenu.call(this)},i.prototype.onPropertyChanged=function(t,i){e.prototype.onPropertyChanged.call(this,t,i);for(var s=0,n=Object.keys(t);s<n.length;s++)switch(n[s]){case"filter":this.close(),this.filter=t.filter;break;case"target":this.unWireEvents(i.target),this.wireEvents()}},i.prototype.getModuleName=function(){return"contextmenu"},K([t.Property("")],i.prototype,"target",void 0),K([t.Property("")],i.prototype,"filter",void 0),K([t.Collection([],S)],i.prototype,"items",void 0),i=K([t.NotifyPropertyChanges],i)}(I),X=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),G=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},Q="e-vertical",J=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.tempItems=[],s}return X(i,e),i.prototype.getModuleName=function(){return"menu"},i.prototype.preRender=function(){if(this.isMenu=!0,this.element.id=this.element.id||t.getUniqueID("ej2-menu"),this.template)try{document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}else this.updateMenuItems(this.items);e.prototype.preRender.call(this)},i.prototype.initialize=function(){e.prototype.initialize.call(this),t.attributes(this.element,{role:"menubar",tabindex:"0"}),"Vertical"===this.orientation?(this.element.classList.add(Q),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(Q),this.element.setAttribute("aria-orientation","vertical")):t.Browser.isDevice&&!this.enableScrolling&&this.element.parentElement.classList.add("e-scrollable"),this.hamburgerMode&&(this.element.parentElement.classList.add("e-hamburger"),"Horizontal"===this.orientation&&this.element.classList.add("e-hide-menu"))},i.prototype.updateMenuItems=function(e){this.tempItems=e,this.items=[],this.tempItems.map(this.createMenuItems,this),this.setProperties({items:this.items},!0),this.tempItems=[]},i.prototype.onPropertyChanged=function(i,s){for(var n=this,r=0,l=Object.keys(i);r<l.length;r++)switch(l[r]){case"orientation":"Vertical"===i.orientation?(this.element.classList.add(Q),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(Q),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(Q),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(Q),this.element.classList.add("e-hide-menu")),this.element.removeAttribute("aria-orientation"));break;case"items":Object.keys(s.items).length||this.updateMenuItems(i.items);break;case"hamburgerMode":this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),i.hamburgerMode?(this.element.parentElement.classList.add("e-hamburger"),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[n.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove("e-hamburger"),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(Q),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(Q):this.element.previousElementSibling.classList.remove(Q),this.element.classList[i.hamburgerMode?"add":"remove"]("e-hide-menu"));break;case"title":this.hamburgerMode&&this.element.previousElementSibling&&(i.title=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.title):i.title,this.element.previousElementSibling.querySelector(".e-menu-title").innerHTML=i.title);break;case"target":this.hamburgerMode&&(this.unWireEvents(s.target),this.wireEvents(),"Horizontal"===this.orientation&&(i.target?this.element.previousElementSibling.classList.add(Q):(this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(Q)),this.element.classList.add("e-hide-menu")))}e.prototype.onPropertyChanged.call(this,i,s)},i.prototype.createMenuItems=function(e){var t,i,s=this.items,n=this.getField("parentId");if(e[n]){for(t=this.getIndex(e[n].toString(),!0),i=0;i<t.length;i++)s[t[i]].items||(s[t[i]].items=[]),s=s[t[i]].items;s.push(e)}else this.items.push(e)},i.prototype.open=function(){e.prototype.openHamburgerMenu.call(this)},i.prototype.close=function(){e.prototype.closeHamburgerMenu.call(this)},G([t.Property("Horizontal")],i.prototype,"orientation",void 0),G([t.Property("")],i.prototype,"target",void 0),G([t.Property(null)],i.prototype,"template",void 0),G([t.Property(!1)],i.prototype,"enableScrolling",void 0),G([t.Property(!1)],i.prototype,"hamburgerMode",void 0),G([t.Property("Menu")],i.prototype,"title",void 0),G([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),G([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},O)],i.prototype,"fields",void 0),i=G([t.NotifyPropertyChanges],i)}(I),Z=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),$=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},ee="e-tab-header",te="e-tab-wrap",ie="e-toolbar-items",se="e-toolbar-item",ne="e-toolbar-popup",re="e-vertical-tab",le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Property("SlideLeftIn")],i.prototype,"effect",void 0),$([t.Property(600)],i.prototype,"duration",void 0),$([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},le)],i.prototype,"previous",void 0),$([t.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},le)],i.prototype,"next",void 0),i}(t.ChildProperty),ae=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Property("")],i.prototype,"text",void 0),$([t.Property("")],i.prototype,"iconCss",void 0),$([t.Property("left")],i.prototype,"iconPosition",void 0),i}(t.ChildProperty),de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Complex({},ae)],i.prototype,"header",void 0),$([t.Property(null)],i.prototype,"headerTemplate",void 0),$([t.Property("")],i.prototype,"content",void 0),$([t.Property("")],i.prototype,"cssClass",void 0),$([t.Property(!1)],i.prototype,"disabled",void 0),$([t.Property(!0)],i.prototype,"visible",void 0),$([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),he=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.show={},s.hide={},s.maxHeight=0,s.title="Close",s.lastIndex=0,s.isAdd=!1,s.isIconAlone=!1,s.draggableItems=[],s.resizeContext=s.refreshActElePosition.bind(s),s.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},s}return Z(i,e),i.prototype.destroy=function(){var i=this;if(this.isReact&&this.clearTemplate(),t.isNullOrUndefined(this.tbObj)||this.tbObj.destroy(),this.unWireEvents(),["role","aria-disabled","aria-activedescendant","tabindex","aria-orientation"].forEach(function(e){i.element.removeAttribute(e)}),this.expTemplateContent(),this.isTemplate){var s=t.select(".e-tab > .e-content",this.element);this.element.classList.remove("e-template"),t.isNullOrUndefined(s)||(s.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)t.remove(this.element.firstElementChild);e.prototype.destroy.call(this),this.trigger("destroyed")},i.prototype.refresh=function(){this.isReact&&this.clearTemplate(),this.isServerRendered?this.isServerRendered&&"Dynamic"!==this.loadOn&&this.setActiveBorder():e.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},i.prototype.preRender=function(){var e=t.closest(this.element,".e-content");this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwipeed=!1,this.itemIndexArray=[],this.templateEle=[],t.isNullOrUndefined(e)||(e.parentElement.classList.add("e-nested"),this.isNested=!0);var i=t.Browser.info.name,s="msie"===i?"e-ie":"edge"===i?"e-edge":"safari"===i?"e-safari":"";t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),this.setCssClass(this.element,this.cssClass,!0),t.attributes(this.element,{role:"tablist","aria-disabled":"false","aria-activedescendant":""}),this.setCssClass(this.element,s,!0),this.updatePopAnimationConfig()},i.prototype.render=function(){this.btnCls=this.createElement("span",{className:"e-icons e-close-icon",attrs:{title:this.title}}),this.tabId=this.element.id.length>0?"-"+this.element.id:t.getRandomId(),this.renderContainer(),this.wireEvents(),this.initRender=!1},i.prototype.renderContainer=function(){if(this.isServerRendered)return void(this.isTemplate=!1);var e=this.element;if(this.items.forEach(function(e,i){t.isNullOrUndefined(e.id)&&!t.isNullOrUndefined(e.setProperties)&&e.setProperties({id:"tabitem_"+i.toString()},!0)}),this.items.length>0&&0===e.children.length)e.appendChild(this.createElement("div",{className:"e-content"})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:ee})),this.isTemplate=!1;else if(this.element.children.length>0){this.isTemplate=!0,e.classList.add("e-template");var i=e.querySelector(".e-tab-header");i&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,i)}if(!t.isNullOrUndefined(t.select(".e-tab-header",this.element))&&!t.isNullOrUndefined(t.select(".e-content",this.element))){if(this.renderHeader(),this.tbItems=t.select(".e-tab-header ."+ie,this.element),t.isNullOrUndefined(this.tbItems)||t.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),t.selectAll("."+se,this.element).length>0){this.tbItems=t.select(".e-tab-header ."+ie,this.element),this.bdrLine=this.createElement("div",{className:"e-indicator e-hidden e-ignore"});var s=t.select("."+this.scrCntClass,this.tbItems);t.isNullOrUndefined(s)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):s.insertBefore(this.bdrLine,s.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)}if(!t.isNullOrUndefined(this.tbItem))for(var n=0;n<this.items.length;n++){var r=this.items[n].id;this.tbItem[n].setAttribute("data-id",r)}this.setRTL(this.enableRtl)}},i.prototype.serverItemsChanged=function(){if(this.enableAnimation=!1,this.setActive(this.selectedItem,!0),"Dynamic"!==this.loadOn&&!t.isNullOrUndefined(this.cntEle)){var e=[].slice.call(this.cntEle.children),i="e-content"+this.tabId+"_"+this.selectedItem;e.forEach(function(e){e.classList.contains("e-active")&&e.id!==i&&e.classList.remove("e-active"),e.id===i&&e.classList.add("e-active")}),this.prevIndex=this.selectedItem,this.triggerAnimation("e-item"+this.tabId+"_"+this.selectedItem,!1)}this.enableAnimation=!0},i.prototype.headerReady=function(){if(this.initRender=!0,this.hdrEle=this.getTabHeader(),this.setOrientation(this.headerPlacement,this.hdrEle),t.isNullOrUndefined(this.hdrEle)||(this.tbObj=this.hdrEle&&this.hdrEle.ej2_instances[0]),this.tbObj.clicked=this.clickHandler.bind(this),this.tbObj.on("onItemsChanged",this.serverItemsChanged.bind(this)),this.tbItems=t.select(".e-tab-header ."+ie,this.element),t.isNullOrUndefined(this.tbItems)||t.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),t.selectAll("."+se,this.element).length>0){this.bdrLine=t.select(".e-indicator.e-ignore",this.element);var e=t.select("."+this.scrCntClass,this.tbItems);t.isNullOrUndefined(e)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstElementChild):e.insertBefore(this.bdrLine,e.firstElementChild),this.select(this.selectedItem)}if(this.cntEle=t.select(".e-tab > .e-content",this.element),t.isNullOrUndefined(this.cntEle)||(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)})),"Demand"===this.loadOn){var i=this.setActiveContent();this.triggerAnimation(i,!1)}this.initRender=!1,this.renderComplete()},i.prototype.setActiveContent=function(){var e="e-item"+this.tabId+"_"+this.selectedItem,i=this.getTrgContent(this.cntEle,this.extIndex(e));return t.isNullOrUndefined(i)||i.classList.add("e-active"),e},i.prototype.renderHeader=function(){var e=this,i=this.headerPlacement,s=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){this.element.children.length>1&&this.element.children[1].classList.contains(ee)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var n=this.hdrEle.children.length,r=[],l=0;l<n;l++)r.push(this.hdrEle.children.item(l).innerHTML);if(n>0){for(;this.hdrEle.firstElementChild;)t.detach(this.hdrEle.firstElementChild);var o=this.createElement("div",{className:"e-items"});this.hdrEle.appendChild(o),r.forEach(function(i,s){e.lastIndex=s;var n={className:"e-item",id:"e-item"+e.tabId+"_"+s,attrs:{role:"tab","aria-controls":"e-content"+e.tabId+"_"+s,"aria-selected":"false"}},r=e.createElement("span",{className:"e-tab-text",innerHTML:i,attrs:{role:"presentation"}}).outerHTML,l=e.createElement("div",{className:"e-text-wrap",innerHTML:r+e.btnCls.outerHTML}).outerHTML,a=e.createElement("div",{className:te,innerHTML:l,attrs:{tabIndex:"-1"}});o.appendChild(e.createElement("div",n)),t.selectAll(".e-item",o)[s].appendChild(a)})}}else s=this.parseObject(this.items,0);this.tbObj=new M({width:"Left"===i||"Right"===i?"auto":"100%",height:"Left"===i||"Right"===i?"100%":"auto",overflowMode:this.overflowMode,items:0!==s.length?s:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),t.attributes(this.hdrEle,{"aria-label":"tab-header"}),this.updateOrientationAttribute(),this.setCloseButton(this.showCloseButton)},i.prototype.renderContent=function(){this.cntEle=t.select(".e-content",this.element);var e=t.selectAll("."+se,this.element);if(this.isTemplate){this.cnt=this.cntEle.children.length>0?this.cntEle.innerHTML:"";for(var i=this.cntEle.children,s=0;s<e.length;s++)i.length-1>=s&&(i.item(s).className+="e-item",t.attributes(i.item(s),{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_"+s}),i.item(s).id="e-content"+this.tabId+"_"+s)}},i.prototype.reRenderItems=function(){this.renderContainer(),t.isNullOrUndefined(this.cntEle)||(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},i.prototype.parseObject=function(e,i){var s,n=this,r=t.selectAll("."+se,this.element).length,l=[],o=[];return e.forEach(function(e,a){var d=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,h=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss;if(t.isNullOrUndefined(e.headerTemplate)&&(t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.text)||0===e.header.text.length&&""===h))return void o.push(a);var c=e.headerTemplate||e.header.text;"string"==typeof c&&n.enableHtmlSanitizer&&(c=t.SanitizeHtmlHelper.sanitize(c)),n.lastIndex=0===r?a:n.isReplace?i+a:n.lastIndex+1;var p=e.disabled?" e-disable e-overlay":"",u=!1===e.visible?" e-hidden":"";s=n.createElement("div",{className:"e-tab-text",attrs:{role:"presentation"}});var f=c instanceof Object?c.outerHTML:c,m=!t.isNullOrUndefined(f)&&""!==f;t.isNullOrUndefined(c.tagName)?n.headerTextCompile(s,c,a):s.appendChild(c);var v=n.createElement("span",{className:"e-icons e-tab-icon e-icon-"+d+" "+h}),g=n.createElement("div",{className:"e-text-wrap"});g.appendChild(s),""!==c&&void 0!==c&&""!==h?("left"===d||"top"===d?g.insertBefore(v,g.firstElementChild):g.appendChild(v),s,n.isIconAlone=!1):(""===h?s:v)===v&&(t.detach(s),g.appendChild(v),n.isIconAlone=!0);var y=e.disabled?{}:{tabIndex:"-1"};g.appendChild(n.btnCls.cloneNode(!0));var b=n.createElement("div",{className:te,attrs:y});b.appendChild(g),n.itemIndexArray===[]?n.itemIndexArray.push("e-item"+n.tabId+"_"+n.lastIndex):n.itemIndexArray.splice(i+a,0,"e-item"+n.tabId+"_"+n.lastIndex);var C={htmlAttributes:{id:"e-item"+n.tabId+"_"+n.lastIndex,role:"tab","aria-selected":"false"},template:b};C.cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+p+" "+u+(""!==h?"e-i"+d:"")+" "+(m?"":"e-icon"),"top"!==d&&"bottom"!==d||n.element.classList.add("e-vertical-icon"),l.push(C),a++}),this.isAdd||o.forEach(function(e){n.items.splice(e,1)}),this.isIconAlone?this.element.classList.add("e-icon-tab"):this.element.classList.remove("e-icon-tab"),l},i.prototype.removeActiveClass=function(){var e=this.getTabHeader();if(e){var i=t.selectAll(".e-toolbar-item.e-active",e);[].slice.call(i).forEach(function(e){return e.classList.remove("e-active")})}},i.prototype.checkPopupOverflow=function(e){this.tbPop=t.select(".e-toolbar-pop",this.element);var i=t.select(".e-hor-nav",this.element),s=t.select("."+ie,this.element),n=s.lastChild,r=!1;return!this.isVertical()&&(this.enableRtl&&i.offsetLeft+i.offsetWidth>s.offsetLeft||!this.enableRtl&&i.offsetLeft<s.offsetWidth)?r=!0:this.isVertical()&&i.offsetTop<n.offsetTop+n.offsetHeight&&(r=!0),r&&(e.classList.add(ne),this.tbPop.insertBefore(e,t.selectAll("."+ne,this.tbPop)[0])),!0},i.prototype.popupHandler=function(e){var i=e.querySelector(".e-ripple-element");t.isNullOrUndefined(i)||(i.outerHTML="",e.querySelector("."+te).classList.remove("e-ripple")),this.tbItem=t.selectAll(".e-toolbar-items ."+se,this.hdrEle);var s=this.tbItem[this.tbItem.length-1];if(0!==this.tbItem.length){if(e.classList.remove(ne),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(s)){var n=this.tbItems.lastChild.previousElementSibling;this.checkPopupOverflow(n)}this.isPopup=!0}return t.selectAll("."+se,this.tbItems).length-1},i.prototype.updateOrientationAttribute=function(){t.attributes(this.element,{"aria-orientation":this.isVertical()?"vertical":"horizontal"})},i.prototype.setCloseButton=function(e){var i=t.select(".e-tab-header",this.element);!0===e?i.classList.add("e-close-show"):i.classList.remove("e-close-show"),this.tbObj.refreshOverflow(),this.refreshActElePosition()},i.prototype.prevCtnAnimation=function(e,t){this.enableRtl||this.element.classList.contains("e-rtl");return this.isPopup||e<=t?"SlideLeftIn"===this.animation.previous.effect?{name:"SlideLeftOut",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:null:"SlideRightIn"===this.animation.next.effect?{name:"SlideRightOut",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}:null},i.prototype.triggerPrevAnimation=function(e,i){var s=this,n=this.prevCtnAnimation(i,this.selectedItem);t.isNullOrUndefined(n)?e.classList.remove("e-active"):(n.begin=function(){t.setStyleAttribute(e,{position:"absolute"}),e.classList.add("e-progress"),e.classList.add("e-view")},n.end=function(){e.style.display="none",e.classList.remove("e-active"),e.classList.remove("e-progress"),e.classList.remove("e-view"),t.setStyleAttribute(e,{display:"",position:""}),0!==e.childNodes.length||s.isTemplate||t.detach(e)},new t.Animation(n).animate(e))},i.prototype.triggerAnimation=function(e,i){var s,n,r=this,l=this.prevIndex;if(!this.isServerRendered||this.isServerRendered&&"Dynamic"!==this.loadOn){[].slice.call(this.element.querySelector(".e-content").children).forEach(function(e){e.id===r.prevActiveEle&&(s=e)});var o=this.tbItem[l];if(n=this.getTrgContent(this.cntEle,this.extIndex(e)),t.isNullOrUndefined(s)&&!t.isNullOrUndefined(o)){var a=this.extIndex(o.id);s=this.getTrgContent(this.cntEle,a)}}else n=this.cntEle.firstElementChild;if(t.isNullOrUndefined(n)||(this.prevActiveEle=n.id),this.initRender||!1===i||this.animation==={}||t.isNullOrUndefined(this.animation))return void(s&&s!==n&&s.classList.remove("e-active"));var d,h=t.select(".e-content",this.element);if(this.prevIndex>this.selectedItem&&!this.isPopup){var c=this.animation.previous.effect;d={name:"None"===c?"":"SlideLeftIn"!==c?c:"SlideLeftIn",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}}else if(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem){var p=this.animation.next.effect;d={name:"None"===p?"":"SlideRightIn"!==p?p:"SlideRightIn",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}}d.progress=function(){h.classList.add("e-progress"),r.setActiveBorder()},d.end=function(){h.classList.remove("e-progress"),n.classList.add("e-active")},this.initRender||t.isNullOrUndefined(s)||this.triggerPrevAnimation(s,l),this.isPopup=!1,""===d.name?n.classList.add("e-active"):new t.Animation(d).animate(n)},i.prototype.keyPressed=function(e){var i=t.closest(e,".e-tab-header ."+se),s=this.getEleIndex(i);!t.isNullOrUndefined(this.popEle)&&e.classList.contains("e-hor-nav")?this.popEle.classList.contains("e-popup-open")?this.popObj.hide(this.hide):this.popObj.show(this.show):e.classList.contains("e-scroll-nav")?e.click():t.isNullOrUndefined(i)||!1!==i.classList.contains("e-active")||(this.select(s),t.isNullOrUndefined(this.popEle)||this.popObj.hide(this.hide))},i.prototype.getTabHeader=function(){if(!t.isNullOrUndefined(this.element)){var e=[].slice.call(this.element.children).filter(function(e){return e.classList.contains(ee)});if(e.length>0)return e[0];var i=[].slice.call(this.element.children).filter(function(e){return!e.classList.contains("blazor-template")})[0];if(i)return[].slice.call(i.children).filter(function(e){return e.classList.contains(ee)})[0]}},i.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(t.selectAll("."+se,this.getTabHeader()),e)},i.prototype.extIndex=function(e){return e.replace("e-item"+this.tabId+"_","")},i.prototype.expTemplateContent=function(){var e=this;this.templateEle.forEach(function(i){t.isNullOrUndefined(e.element.querySelector(i))||(document.body.appendChild(e.element.querySelector(i)).style.display="none")})},i.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.compileElement(s,t,"content",i),0!==s.childNodes.length&&e.appendChild(s),this.isReact&&this.renderReactTemplates()},i.prototype.compileElement=function(e,i,s,n){var r;"string"==typeof i?(i=i.trim(),e.innerHTML=t.SanitizeHtmlHelper.sanitize(i)):r=t.compile(i);var l;t.isNullOrUndefined(r)||(l=r({},this,s)),!t.isNullOrUndefined(r)&&l.length>0&&[].slice.call(l).forEach(function(t){e.appendChild(t)})},i.prototype.headerTextCompile=function(e,t,i){this.compileElement(e,t,"headerTemplate",i)},i.prototype.getContent=function(e,i,s,n){var r;if("string"==typeof i||t.isNullOrUndefined(i.innerHTML))if("string"==typeof i&&this.enableHtmlSanitizer&&(i=t.SanitizeHtmlHelper.sanitize(i)),"."===i[0]||"#"===i[0])if(document.querySelectorAll(i).length){var l=document.querySelector(i);r=l.outerHTML.trim(),"clone"===s?e.appendChild(l.cloneNode(!0)):(e.appendChild(l),l.style.display="")}else this.templateCompile(e,i,n);else this.templateCompile(e,i,n);else e.appendChild(i);t.isNullOrUndefined(r)||-1===this.templateEle.indexOf(i.toString())&&this.templateEle.push(i.toString())},i.prototype.getTrgContent=function(e,i){return this.element.classList.contains("e-nested")?t.select(".e-nested> .e-content > #e-content"+this.tabId+"_"+i,this.element):this.findEle(e.children,"e-content"+this.tabId+"_"+i)},i.prototype.findEle=function(e,t){for(var i,s=0;s<e.length;s++)if(e[s].id===t){i=e[s];break}return i},i.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},i.prototype.addVerticalClass=function(){if(this.isVertical()){var e="Left"===this.headerPlacement?"e-vertical-left":"e-vertical-right";t.addClass([this.hdrEle],["e-vertical",e]),this.element.classList.contains("e-nested")?t.addClass([this.hdrEle],[re,e]):t.addClass([this.element],[re,e])}"Bottom"===this.headerPlacement&&t.addClass([this.hdrEle],["e-horizontal-bottom"])},i.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},i.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var i=this.hdrEle.querySelector(".e-active"),s=!!this.hdrEle.classList.contains("e-vertical");t.removeClass([this.element],[re]),t.removeClass([this.hdrEle],["e-vertical","e-vertical-left","e-vertical-right"]),s!==this.isVertical()&&(this.changeToolbarOrientation(),!t.isNullOrUndefined(i)&&i.classList.contains(ne)&&this.popupHandler(i)),this.addVerticalClass(),this.updateOrientationAttribute(),this.setActiveBorder(),this.focusItem()},i.prototype.focusItem=function(){var e=t.select(" #e-item"+this.tabId+"_"+this.selectedItem,this.hdrEle);t.isNullOrUndefined(e)||e.firstElementChild.focus()},i.prototype.serverChangeOrientation=function(e,i){this.setOrientation(e,this.hdrEle),t.removeClass([this.element],[re]),("Left"===e||"Right"===e)!==("Left"===i||"Right"===i)&&this.changeToolbarOrientation(),this.isVertical()&&t.addClass([this.element],[re]),this.updateOrientationAttribute(),this.setActiveBorder(),this.focusItem()},i.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},i.prototype.setOrientation=function(e,i){var s=Array.prototype.indexOf.call(this.element.children,i),n=Array.prototype.indexOf.call(this.element.children,this.element.querySelector(".e-content"));"Bottom"===e&&n>s?this.element.appendChild(i):(t.removeClass([i],["e-horizontal-bottom"]),this.element.insertBefore(i,t.select(".e-content",this.element)))},i.prototype.setCssClass=function(e,t,i){if(""!==t)for(var s=t.split(" "),n=0;n<s.length;n++)i?e.classList.add(s[n]):e.classList.remove(s[n])},i.prototype.setContentHeight=function(e){if(this.element.classList.contains("e-fill-mode")&&t.removeClass([this.element],["e-fill-mode"]),!t.isNullOrUndefined(this.cntEle)){var i=this.getTabHeader();if("None"===this.heightAdjustMode){if("auto"===this.height)return;this.isVertical()||t.setStyleAttribute(this.cntEle,{height:this.element.offsetHeight-i.offsetHeight+"px"})}else if("Fill"===this.heightAdjustMode)t.addClass([this.element],["e-fill-mode"]),t.setStyleAttribute(this.element,{height:"100%"}),t.setStyleAttribute(this.cntEle,{height:this.element.offsetHeight-i.offsetHeight+"px"});else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var s=t.selectAll(".e-content > .e-item",this.element),n=0;n<s.length;n++)s[n].setAttribute("style","display:block; visibility: visible"),this.maxHeight=Math.max(this.maxHeight,this.getHeight(s[n])),s[n].style.removeProperty("display"),s[n].style.removeProperty("visibility");else{this.cntEle=t.select(".e-content",this.element),!0===e&&this.cntEle.appendChild(this.createElement("div",{id:"e-content"+this.tabId+"_0",className:"e-item e-active",attrs:{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_0"}}));for(var r=this.cntEle.children.item(0),n=0;n<this.items.length;n++)for(this.getContent(r,this.items[n].content,"clone",n),this.maxHeight=Math.max(this.maxHeight,this.getHeight(r));r.firstChild;)r.removeChild(r.firstChild);this.clearTemplate(["content"]),this.templateEle=[],this.getContent(r,this.items[0].content,"render",0),r.classList.remove("e-active")}t.setStyleAttribute(this.cntEle,{height:this.maxHeight+"px"})}else t.setStyleAttribute(this.cntEle,{height:"auto"})}},i.prototype.getHeight=function(e){var t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.getPropertyValue("padding-top"))+parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))},i.prototype.setActiveBorder=function(){var e=this.getTabHeader(),i=t.select(".e-toolbar-item.e-active",e);if(null!==i){this.isServerRendered&&i.classList.contains(ne)&&this.popupHandler(i);var s=t.closest(i,".e-tab");if(this.element===s){this.tbItems=t.select("."+ie,e);var n=t.select(".e-indicator",e),r=t.select(".e-toolbar-items ."+this.scrCntClass,e);if(this.isVertical())t.setStyleAttribute(n,{left:"",right:""}),0!==(t.isNullOrUndefined(r)?this.tbItems.offsetHeight:r.offsetHeight)?t.setStyleAttribute(n,{top:i.offsetTop+"px",height:i.offsetHeight+"px"}):t.setStyleAttribute(n,{top:0,height:0});else{if("MultiRow"===this.overflowMode){var l=t.select(".e-indicator",this.element);t.setStyleAttribute(l,{top:i.offsetHeight+i.offsetTop+"px",height:""})}else t.setStyleAttribute(n,{top:"",height:""});var o=t.isNullOrUndefined(r)?this.tbItems.offsetWidth:r.offsetWidth;0!==o?t.setStyleAttribute(n,{left:i.offsetLeft+"px",right:o-(i.offsetLeft+i.offsetWidth)+"px"}):t.setStyleAttribute(n,{left:"auto",right:"auto"})}t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.remove("e-hidden")}}},i.prototype.setActive=function(e,i){void 0===i&&(i=!1),this.tbItem=t.selectAll("."+se,this.getTabHeader());var s=this.tbItem[e];if(this.isServerRendered&&s&&(e=parseInt(s.getAttribute("data-index"),10)),!(e<0||isNaN(e)||0===this.tbItem.length)){if(e>=0&&!i&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),s.classList.contains("e-active"))return void this.setActiveBorder();if(!this.isTemplate){var n=this.tbItem[this.prevIndex];t.isNullOrUndefined(n)||n.removeAttribute("aria-controls"),t.attributes(s,{"aria-controls":"e-content"+this.tabId+"_"+e})}var r=s.id;this.removeActiveClass(),s.classList.add("e-active"),this.tbItem[this.prevIndex].setAttribute("aria-selected","false"),s.setAttribute("aria-selected","true");var l=Number(this.extIndex(r));if(t.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle="e-content"+this.tabId+"_"+l),t.attributes(this.element,{"aria-activedescendant":r}),this.isTemplate){if(t.select(".e-content",this.element).children.length>0){var o=this.findEle(t.select(".e-content",this.element).children,"e-content"+this.tabId+"_"+l);t.isNullOrUndefined(o)||o.classList.add("e-active"),this.triggerAnimation(r,this.enableAnimation)}}else if(!this.isServerRendered||this.isServerRendered&&"Init"===this.loadOn){this.cntEle=t.select(".e-tab > .e-content",this.element);var a=this.getTrgContent(this.cntEle,this.extIndex(r));if(t.isNullOrUndefined(a)){this.cntEle.appendChild(this.createElement("div",{id:"e-content"+this.tabId+"_"+this.extIndex(r),className:"e-item e-active",attrs:{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_"+this.extIndex(r)}}));var d=this.getTrgContent(this.cntEle,this.extIndex(r)),h=Array.prototype.indexOf.call(this.itemIndexArray,r);this.getContent(d,this.items[h].content,"render",h)}else a.classList.add("e-active");this.triggerAnimation(r,this.enableAnimation)}if(this.setActiveBorder(),this.refreshItemVisibility(s),!this.initRender&&!i){s.firstElementChild.focus();var c={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:s,selectedIndex:e,selectedContent:t.select("#e-content"+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed};this.trigger("selected",c)}}},i.prototype.contentReady=function(){var e=this.setActiveContent();this.triggerAnimation(e,this.enableAnimation)},i.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=t.select("."+ie,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},i.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,"e-rtl",e),this.refreshActiveBorder()},i.prototype.refreshActiveBorder=function(){t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add("e-hidden"),this.setActiveBorder()},i.prototype.showPopup=function(e){var i=t.select(".e-popup.e-toolbar-pop",this.hdrEle);if(i.classList.contains("e-popup-close")){var s=i&&i.ej2_instances[0];s.position.X="Left"===this.headerPlacement?"left":"right",s.dataBind(),s.show(e)}},i.prototype.bindDraggable=function(){var e=this;this.allowDragAndDrop&&this.element.querySelectorAll("."+se).forEach(function(t){e.initializeDrag(t)})},i.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),t.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.element,"keydown",this.spaceKeyDown,this),t.isNullOrUndefined(this.cntEle)||(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)})),this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},i.prototype.unWireEvents=function(){t.isNullOrUndefined(this.keyModule)||this.keyModule.destroy(),t.isNullOrUndefined(this.tabKeyModule)||this.tabKeyModule.destroy(),t.isNullOrUndefined(this.cntEle)||t.isNullOrUndefined(this.touchModule)||this.touchModule.destroy(),window.removeEventListener("resize",this.resizeContext),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove("e-rtl"),this.element.classList.remove("e-focused")},i.prototype.clickHandler=function(e){this.element.classList.remove("e-focused");var i=e.originalEvent.target,s=t.closest(i,"."+se),n=this.getEleIndex(s);i.classList.contains("e-close-icon")?this.removeTab(n):this.isVertical()&&t.closest(i,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,this.isServerRendered&&!t.isNullOrUndefined(s)?parseInt(s.getAttribute("data-index"),10)!==this.selectedItem&&this.select(n):t.isNullOrUndefined(s)||n===this.selectedItem&&n===this.prevIndex||this.select(n,e.originalEvent))},i.prototype.swipeHandler=function(e){if(!(e.velocity<3&&t.isNullOrUndefined(e.originalEvent.changedTouches))){if(e.originalEvent&&e.originalEvent.stopPropagation(),this.isSwipeed=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var i=this.selectedItem-1;i>=0;i--)if(!this.tbItem[i].classList.contains("e-hidden")){this.select(i);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==t.selectAll("."+se,this.element).length-1)for(var s=this.selectedItem+1;s<this.tbItem.length;s++)if(!this.tbItem[s].classList.contains("e-hidden")){this.select(s);break}this.isSwipeed=!1}},i.prototype.spaceKeyDown=function(e){if(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which){var i=t.closest(e.target,".e-tab-header");t.isNullOrUndefined(i)||e.preventDefault()}},i.prototype.keyHandler=function(e){if(!this.element.classList.contains("e-disable")){this.element.classList.add("e-focused");var i=e.target,s=this.getTabHeader(),n=t.select(".e-active",s);this.popEle=t.select(".e-toolbar-pop",s),t.isNullOrUndefined(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]);var r=t.closest(document.activeElement,"."+se),l=t.closest(i,"."+se);switch(e.action){case"space":case"enter":if(i.parentElement.classList.contains("e-disable"))return;if("enter"===e.action&&i.classList.contains("e-hor-nav")){this.showPopup(this.show);break}this.keyPressed(i);break;case"tab":case"shiftTab":i.classList.contains(te)&&!1===t.closest(i,"."+se).classList.contains("e-active")&&i.setAttribute("tabindex","-1"),this.popObj&&t.isVisible(this.popObj.element)&&this.popObj.hide(this.hide),n.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":t.isNullOrUndefined(r)||this.refreshItemVisibility(r);break;case"openPopup":e.preventDefault(),!t.isNullOrUndefined(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":if(!0===this.showCloseButton&&!t.isNullOrUndefined(l)){var o=l.nextSibling;!t.isNullOrUndefined(o)&&o.classList.contains(se)&&o.firstElementChild.focus(),this.removeTab(this.getEleIndex(l))}this.setActiveBorder()}}},i.prototype.refreshActElePosition=function(){var e=t.select(".e-toolbar-item.e-toolbar-popup.e-active",this.element);t.isNullOrUndefined(e)||this.select(this.getEleIndex(e)),this.refreshActiveBorder()},i.prototype.refreshItemVisibility=function(e){var i=t.select("."+this.scrCntClass,this.tbItems);if(!this.isVertical()&&!t.isNullOrUndefined(i)){var s=t.select(".e-hscroll-bar",this.tbItems),n=s.scrollLeft,r=n+s.offsetWidth,l=e.offsetLeft,o=e.offsetWidth,a=e.offsetLeft+e.offsetWidth;if(n<l&&r<a){d=r-l;s.scrollLeft=n+(o-d)}else if(n>l&&r>a){var d=a-n;s.scrollLeft=n-(o-d)}}},i.prototype.hoverHandler=function(e){var i=e.target;!t.isNullOrUndefined(i.classList)&&i.classList.contains("e-close-icon")&&i.setAttribute("title",new t.L10n("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},i.prototype.evalOnPropertyChangeItems=function(e,i){if(e.items instanceof Array&&i.items instanceof Array)if(this.lastIndex=0,t.isNullOrUndefined(this.tbObj))this.reRenderItems();else{this.isRect&&this.clearTemplate(),this.setItems(e.items),this.templateEle.length>0&&this.expTemplateContent(),this.templateEle=[];for(var s=t.select(".e-tab > .e-content",this.element);s.firstElementChild&&!t.isBlazor();)t.detach(s.firstElementChild);this.select(this.selectedItem)}else for(var n=Object.keys(e.items),r=0;r<n.length;r++){var l=parseInt(Object.keys(e.items)[r],10),o=Object.keys(e.items[l])[0],a=Object(i.items[l])[o],d=Object(e.items[l])[o],h=t.select(".e-toolbar-items #e-item"+this.tabId+"_"+l,this.element),c=t.select(".e-content #e-content"+this.tabId+"_"+l,this.element);if("header"===o||"headerTemplate"===o){var p=t.isNullOrUndefined(this.items[l].header)||t.isNullOrUndefined(this.items[l].header.iconCss)?"":this.items[l].header.iconCss;if(""===(this.items[l].headerTemplate||this.items[l].header.text)&&""===p)this.removeTab(l);else{var u=[];u.push(this.items[l]),this.items.splice(l,1),this.itemIndexArray.splice(l,1),this.tbObj.items.splice(l,1);var f=h.classList.contains("e-hidden");t.detach(h),this.isReplace=!0,this.addTab(u,l),f&&this.hideTab(l),this.isReplace=!1}}if("content"===o&&!t.isNullOrUndefined(c))if(("string"==typeof d||t.isNullOrUndefined(d.innerHTML))&&("."===d[0]||"#"===d[0])&&d.length){var m=document.querySelector(d);c.appendChild(m),m.style.display=""}else""===d&&"#"===a[0]?(document.body.appendChild(this.element.querySelector(a)).style.display="none",c.innerHTML=d):this.isReact&&"object"==typeof d?(c.innerHTML="",this.templateCompile(c,d,l)):"function"!=typeof d&&(c.innerHTML=d);"cssClass"===o&&(t.isNullOrUndefined(h)||(h.classList.remove(a),h.classList.add(d)),t.isNullOrUndefined(c)||(c.classList.remove(a),c.classList.add(d))),"disabled"===o&&this.enableTab(l,!0!==d),"visible"===o&&this.hideTab(l,!0!==d)}},i.prototype.initializeDrag=function(e){var i=this;this.dragArea=t.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" .e-tab-header":this.dragArea;var s=new t.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+se,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var s,n,r=i.getEleIndex(i.dragItem),l={draggedItem:i.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+se),clonedElement:i.cloneElement,index:r};if(t.isNullOrUndefined(e.target.closest(".e-tab"))||e.target.closest(".e-tab").isEqualNode(i.element)||".e-tab-header"===i.dragArea){if(e.target.closest(i.dragArea)||"Popup"===i.overflowMode?(document.body.style.cursor="",i.dragItem.querySelector("."+te).style.visibility="hidden",i.cloneElement.classList.contains("e-hidden")&&t.removeClass([i.cloneElement],"e-hidden")):(document.body.style.cursor="not-allowed",t.addClass([i.cloneElement],"e-hidden"),i.dragItem.classList.contains("e-hidden")&&t.removeClass([i.dragItem],"e-hidden"),i.dragItem.querySelector("."+te).style.visibility="visible"),"Scrollable"===i.overflowMode&&!t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))){var o=i.element.querySelector(".e-scroll-right-nav"),a=i.element.querySelector(".e-scroll-left-nav"),d=i.element.querySelector(".e-hscroll-bar");!t.isNullOrUndefined(o)&&Math.abs(o.offsetWidth/2+o.offsetLeft)>i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&(d.scrollLeft-=10),!t.isNullOrUndefined(a)&&Math.abs(a.offsetLeft+a.offsetWidth-i.cloneElement.offsetLeft)>a.offsetWidth/2&&(d.scrollLeft+=10)}i.cloneElement.style.pointerEvents="none";var h=i.cloneElement.getBoundingClientRect().left,c=i.cloneElement.getBoundingClientRect().top,p=document.elementFromPoint(h,c);n=t.closest(p,"."+se);var u=0;"Scrollable"!==i.overflowMode||t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))||(u=i.element.querySelector(".e-hscroll-content").offsetWidth),null!=n&&!n.isSameNode(i.dragItem)&&n.closest(".e-tab").isSameNode(i.dragItem.closest(".e-tab"))&&((s=i.getEleIndex(n))<r&&Math.abs(n.offsetLeft+n.offsetWidth-i.cloneElement.offsetLeft)>n.offsetWidth/2&&i.dragAction(n,r,s),s>r&&Math.abs(n.offsetWidth/2)+n.offsetLeft-u<i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&i.dragAction(n,r,s)),i.droppedIndex=i.getEleIndex(i.dragItem),i.trigger("dragging",l)}else i.trigger("dragging",l)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(s)},i.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),t.addClass([this.cloneElement],"e-tab-clone-element"),this.element.querySelector(".e-tab-header").classList.contains("e-close-show")&&t.addClass([this.cloneElement],"e-close-show"),t.removeClass([this.cloneElement.querySelector("."+te)],"e-ripple"),t.isNullOrUndefined(this.cloneElement.querySelector(".e-ripple-element"))||t.remove(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},i.prototype.itemDragStart=function(e){var i=this;this.draggingItems=this.items.map(function(e){return e}),this.dragItem=e.element;var s={draggedItem:e.element,event:e.event,target:e.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1};this.trigger("onDragStart",s,function(s){s.cancel?t.detach(i.cloneElement):(i.removeActiveClass(),t.addClass([i.tbItems.querySelector(".e-indicator")],"e-hidden"),i.dragItem.querySelector("."+te).style.visibility="hidden"),t.isBlazor()&&e.bindEvents(t.getElement(e.dragElement))})},i.prototype.dragAction=function(e,t,i){if(this.items.length>0){var s=this.draggingItems[t];this.draggingItems.splice(t,1),this.draggingItems.splice(i,0,s)}if("MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),t>i)if(this.dragItem.parentElement.isSameNode(e.parentElement))this.dragItem.parentNode.insertBefore(this.dragItem,e);else if("Extended"===this.overflowMode)if(e.isSameNode(e.parentElement.lastChild)){r=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),r.insertBefore(e.parentElement.lastChild,r.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e);else{var n=e.parentElement.lastChild;if(e.isSameNode(n)){var r=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),r.insertBefore(n,r.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)}t<i&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(e,this.dragItem):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},i.prototype.itemDragStop=function(e){var i=this;t.detach(this.cloneElement),this.dragItem.querySelector("."+te).style.visibility="visible",document.body.style.cursor="";var s={draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1};this.trigger("dragged",s,function(e){e.cancel?i.refresh():i.items.length>0&&i.draggingItems.length>0?(i.items=i.draggingItems,i.selectedItem=i.droppedIndex,i.refresh()):(i.dragItem.querySelector("."+te).style.visibility="",t.removeClass([i.tbItems.querySelector(".e-indicator")],"e-hidden"),i.select(i.droppedIndex))})},i.prototype.enableTab=function(e,i){var s=t.selectAll("."+se,this.element)[e];t.isNullOrUndefined(s)||(!0===i?(s.classList.remove("e-disable","e-overlay"),s.firstElementChild.setAttribute("tabindex","-1")):(s.classList.add("e-disable","e-overlay"),s.firstElementChild.removeAttribute("tabindex"),s.classList.contains("e-active")&&this.select(e+1)),t.isNullOrUndefined(this.items[e])||(this.items[e].disabled=!i,this.dataBind()),s.setAttribute("aria-disabled",!0===i?"false":"true"))},i.prototype.addTab=function(e,t){var i=this,s={addedItems:e,cancel:!1};this.isReplace?this.addingTabContent(e,t):this.trigger("adding",s,function(s){s.cancel||i.addingTabContent(e,t)}),this.isReact&&this.renderReactTemplates()},i.prototype.addingTabContent=function(e,i){var s=this,n=0;if(this.hdrEle=t.select(".e-tab-header",this.element),t.isNullOrUndefined(this.hdrEle))this.items=e,this.reRenderItems();else{var r=t.selectAll("."+se,this.element).length;if(0!==r&&(n=this.lastIndex+1),t.isNullOrUndefined(i)&&(i=r-1),r<i||i<0||isNaN(i))return;0!==r||t.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add("e-hidden"),this.tbItems=t.select("."+ie,this.getTabHeader()),this.isAdd=!0;var l=this.parseObject(e,i);this.isAdd=!1;var o,a=0;e.forEach(function(e,r){if(o=e.headerTemplate||e.header.text,t.isNullOrUndefined(e.headerTemplate||e.header)||t.isNullOrUndefined(o)||0===o.length&&t.isNullOrUndefined(e.header.iconCss)||(s.items.splice(i+a,0,e),a++),s.isTemplate&&!t.isNullOrUndefined(e.header)&&!t.isNullOrUndefined(e.header.text)){var l=n+r,d=s.createElement("div",{id:"e-content"+s.tabId+"_"+l,className:"e-item",attrs:{role:"tabpanel","aria-labelledby":"e-item_"+l}});s.cntEle.insertBefore(d,s.cntEle.children[i+r]);var h=s.getTrgContent(s.cntEle,l.toString());s.getContent(h,e.content,"render",i)}}),this.tbObj.addItems(l,i),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===i?this.select(i):this.setActiveBorder(),this.bindDraggable()}},i.prototype.removeTab=function(e){var i=this,s=t.selectAll("."+se,this.element)[e];if(!t.isNullOrUndefined(s)){var n={removedItem:s,removedIndex:e,cancel:!1};this.trigger("removing",n,function(n){if(!n.cancel){i.tbObj.removeItems(e),i.allowDragAndDrop&&e!==Array.prototype.indexOf.call(i.itemIndexArray,s.id)&&(e=Array.prototype.indexOf.call(i.itemIndexArray,s.id)),i.items.splice(e,1),i.itemIndexArray.splice(e,1),i.refreshActiveBorder();var r=t.select("#e-content"+i.tabId+"_"+i.extIndex(s.id),t.select(".e-content",i.element));t.isNullOrUndefined(r)||t.detach(r),i.trigger("removed",n),s.classList.contains("e-active")&&(e=e>t.selectAll(".e-toolbar-item:not(.e-toolbar-popup)",i.element).length-1?e-1:e,i.enableAnimation=!1,i.selectedItem=e,i.select(e)),0===t.selectAll("."+se,i.element).length&&(i.hdrEle.style.display="none"),i.enableAnimation=!0}})}},i.prototype.hideTab=function(e,i){var s,n=t.selectAll("."+se,this.element)[e];if(!t.isNullOrUndefined(n)){if(t.isNullOrUndefined(i)&&(i=!0),this.bdrLine.classList.add("e-hidden"),!0===i)if(n.classList.add("e-hidden"),0!==(s=t.selectAll(".e-toolbar-item:not(.e-hidden)",this.tbItems)).length&&n.classList.contains("e-active")){if(0!==e)for(var r=e-1;r>=0;r--){if(!this.tbItem[r].classList.contains("e-hidden")){this.select(r);break}if(0===r)for(l=e+1;l<this.tbItem.length;l++)if(!this.tbItem[l].classList.contains("e-hidden")){this.select(l);break}}else for(var l=e+1;l<this.tbItem.length;l++)if(!this.tbItem[l].classList.contains("e-hidden")){this.select(l);break}}else 0===s.length&&this.element.classList.add("e-hidden");else this.element.classList.remove("e-hidden"),s=t.selectAll(".e-toolbar-item:not(.e-hidden)",this.tbItems),n.classList.remove("e-hidden"),0===s.length&&this.select(e);this.setActiveBorder(),n.setAttribute("aria-hidden",""+i),!this.isServerRendered&&"Popup"===this.overflowMode&&this.tbObj&&this.tbObj.refreshOverflow()}},i.prototype.select=function(e,i){var s=this,n=this.getTabHeader();this.tbItems=t.select("."+ie,n),this.tbItem=t.selectAll("."+se,n),this.content=t.select(".e-content",this.element),this.prevItem=this.tbItem[this.prevIndex],t.isNullOrUndefined(this.selectedItem)||this.selectedItem<0||this.tbItem.length<=this.selectedItem||isNaN(this.selectedItem)?this.selectedItem=0:this.selectedID=this.extIndex(this.tbItem[this.selectedItem].id);var r=this.tbItem[e];t.isNullOrUndefined(r)?this.selectedID="0":this.selectingID=this.extIndex(r.id),t.isNullOrUndefined(this.prevItem)||this.prevItem.classList.contains("e-disable")||this.prevItem.children.item(0).setAttribute("tabindex","-1");var l={event:i,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:t.isNullOrUndefined(this.content)?null:t.select("#e-content"+this.tabId+"_"+this.selectedID,this.content),selectingItem:r,selectingIndex:e,selectingContent:t.isNullOrUndefined(this.content)?null:t.select("#e-content"+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed,cancel:!1};this.initRender?this.selectingContent(e):this.trigger("selecting",l,function(t){t.cancel||s.selectingContent(e)})},i.prototype.selectingContent=function(e){if("number"==typeof e){if(!t.isNullOrUndefined(this.tbItem[e])&&(this.tbItem[e].classList.contains("e-disable")||this.tbItem[e].classList.contains("e-hidden")))for(var i=e+1;i<this.items.length;i++){if(!1===this.items[i].disabled&&!0===this.items[i].visible){e=i;break}e=0}if(this.tbItem.length>e&&e>=0&&!isNaN(e))if(this.prevIndex=this.selectedItem,this.tbItem[e].classList.contains(ne)){if(this.setActive(this.popupHandler(this.tbItem[e])),!t.isNullOrUndefined(this.items)&&this.items.length>0&&this.allowDragAndDrop){this.tbItem=t.selectAll(".e-toolbar-items ."+se,this.hdrEle);var s=this.items[e];this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,s)}}else this.setActive(e);else this.setActive(0)}else e instanceof HTMLElement&&this.setActive(this.getEleIndex(e))},i.prototype.getItemIndex=function(e){for(var t,i=0;i<this.tbItem.length;i++)if(e===this.tbItem[i].getAttribute("data-id")){t=i;break}return t},i.prototype.disable=function(e){this.setCssClass(this.element,"e-disable",e),this.element.setAttribute("aria-disabled",""+e)},i.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},i.prototype.getModuleName=function(){return"tab"},i.prototype.onPropertyChanged=function(e,i){for(var s=this,n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(e.width)});break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)}),this.isServerRendered||this.setContentHeight(!1);break;case"cssClass":""!==i.cssClass?(this.setCssClass(this.element,i.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0)):this.setCssClass(this.element,e.cssClass,!0);break;case"items":this.isServerRendered||this.evalOnPropertyChangeItems(e,i);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"selectedItem":this.isServerRendered||(this.selectedItem=i.selectedItem,this.select(e.selectedItem));break;case"headerPlacement":this.isServerRendered?this.serverChangeOrientation(e.headerPlacement,i.headerPlacement):this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActElePosition();break;case"heightAdjustMode":this.isServerRendered||(this.setContentHeight(!1),this.select(this.selectedItem));break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=s.dragArea}),this.refresh())}},i.prototype.refreshActiveTab=function(){if(this.isReact&&this.clearTemplate(),this.isTemplate){var e=this.element.querySelector("."+ie),i=this.element.querySelector(".e-toolbar-item.e-active"),s=i.id,n=s.indexOf("_"),r=parseInt(s.substring(n+1),10),l=i.innerText,o=this.element.querySelector(".e-content").querySelector(".e-active").children[0],a=o.innerHTML;t.detach(i),t.detach(o);var d={className:se+" e-template e-active",id:"e-item"+this.tabId+"_"+r,attrs:{role:"tab","aria-controls":"e-content"+this.tabId+"_"+r,"aria-disabled":"false","aria-selected":"true"}},h=this.createElement("span",{className:"e-tab-text",innerHTML:l,attrs:{role:"presentation"}}).outerHTML,c=this.createElement("div",{className:"e-text-wrap",innerHTML:h+this.btnCls.outerHTML}).outerHTML,p=this.createElement("div",{className:te,innerHTML:c,attrs:{tabIndex:"-1"}});e.insertBefore(this.createElement("div",d),e.children[r+1]),this.element.querySelector(".e-toolbar-item.e-active").appendChild(p);E=this.createElement("div",{innerHTML:a});this.element.querySelector(".e-content").querySelector(".e-active").appendChild(E)}else if(this.element.querySelector(".e-toolbar-item.e-active")){t.detach(this.element.querySelector(".e-toolbar-item.e-active").children[0]),t.detach(this.element.querySelector(".e-content").querySelector(".e-active").children[0]);var u=this.items[this.selectedItem],f=t.isNullOrUndefined(u.header)||t.isNullOrUndefined(u.header.iconPosition)?"":u.header.iconPosition,m=t.isNullOrUndefined(u.header)||t.isNullOrUndefined(u.header.iconCss)?"":u.header.iconCss,v=u.headerTemplate||u.header.text,g=this.createElement("div",{className:"e-tab-text",attrs:{role:"presentation"}});t.isNullOrUndefined(v.tagName)?this.headerTextCompile(g,v,this.selectedItem):g.appendChild(v);var y=this.createElement("span",{className:"e-icons e-tab-icon e-icon-"+f+" "+m}),b=this.createElement("div",{className:"e-text-wrap"});b.appendChild(g),""!==v&&void 0!==v&&""!==m?("left"===f||"top"===f?b.insertBefore(y,b.firstElementChild):b.appendChild(y),g,this.isIconAlone=!1):(""===m?g:y)===y&&(t.detach(g),b.appendChild(y),this.isIconAlone=!0);var C=u.disabled?{}:{tabIndex:"-1"};b.appendChild(this.btnCls.cloneNode(!0));var N=this.createElement("div",{className:te,attrs:C});N.appendChild(b),"top"!==f&&"bottom"!==f||this.element.classList.add("e-vertical-icon"),this.element.querySelector(".e-toolbar-item.e-active").appendChild(N);var E=this.createElement("div"),x=u.content,O=void 0;if("string"==typeof x||t.isNullOrUndefined(x.innerHTML))if("string"==typeof x&&this.enableHtmlSanitizer&&(x=t.SanitizeHtmlHelper.sanitize(x)),"."===x[0]||"#"===x[0])if(document.querySelectorAll(x).length){var S=document.querySelector(x);O=S.outerHTML.trim(),E.appendChild(S),S.style.display=""}else this.compileElement(E,x,"content",this.selectedItem);else this.compileElement(E,x,"content",this.selectedItem);else E.appendChild(x);t.isNullOrUndefined(O)||-1===this.templateEle.indexOf(x.toString())&&this.templateEle.push(x.toString()),this.element.querySelector(".e-item.e-active").appendChild(E)}this.isReact&&this.renderReactTemplates()},$([t.Collection([],de)],i.prototype,"items",void 0),$([t.Property("100%")],i.prototype,"width",void 0),$([t.Property("auto")],i.prototype,"height",void 0),$([t.Property("")],i.prototype,"cssClass",void 0),$([t.Property(0)],i.prototype,"selectedItem",void 0),$([t.Property("Top")],i.prototype,"headerPlacement",void 0),$([t.Property("Content")],i.prototype,"heightAdjustMode",void 0),$([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),$([t.Property("Dynamic")],i.prototype,"loadOn",void 0),$([t.Property(!1)],i.prototype,"enablePersistence",void 0),$([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),$([t.Property(!1)],i.prototype,"showCloseButton",void 0),$([t.Property()],i.prototype,"scrollStep",void 0),$([t.Property()],i.prototype,"dragArea",void 0),$([t.Property(!1)],i.prototype,"allowDragAndDrop",void 0),$([t.Complex({},oe)],i.prototype,"animation",void 0),$([t.Event()],i.prototype,"created",void 0),$([t.Event()],i.prototype,"adding",void 0),$([t.Event()],i.prototype,"added",void 0),$([t.Event()],i.prototype,"selecting",void 0),$([t.Event()],i.prototype,"selected",void 0),$([t.Event()],i.prototype,"removing",void 0),$([t.Event()],i.prototype,"removed",void 0),$([t.Event()],i.prototype,"onDragStart",void 0),$([t.Event()],i.prototype,"dragging",void 0),$([t.Event()],i.prototype,"dragged",void 0),$([t.Event()],i.prototype,"destroyed",void 0),i=$([t.NotifyPropertyChanges],i)}(t.Component),ce=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),pe=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},ue="e-treeview",fe="e-icon-collapsible",me="e-icon-expandable",ve="e-list-item",ge="e-list-text",ye="e-list-parent",be="e-hover",Ce="e-active",Ne="e-icons-spinner",Ee="e-process",xe="e-icons",Oe="e-text-content",Se="e-drop-in",we="e-drop-next",Ie="e-fullrow",ke="e-check",Le="e-checkbox-wrapper",Ae="e-node-focus",De={treeRole:"tree",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("child")],i.prototype,"child",void 0),pe([t.Property([])],i.prototype,"dataSource",void 0),pe([t.Property("expanded")],i.prototype,"expanded",void 0),pe([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),pe([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),pe([t.Property("iconCss")],i.prototype,"iconCss",void 0),pe([t.Property("id")],i.prototype,"id",void 0),pe([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),pe([t.Property("isChecked")],i.prototype,"isChecked",void 0),pe([t.Property("parentID")],i.prototype,"parentID",void 0),pe([t.Property(null)],i.prototype,"query",void 0),pe([t.Property("selected")],i.prototype,"selected",void 0),pe([t.Property(null)],i.prototype,"tableName",void 0),pe([t.Property("text")],i.prototype,"text",void 0),pe([t.Property("tooltip")],i.prototype,"tooltip",void 0),pe([t.Property("navigateUrl")],i.prototype,"navigateUrl",void 0),i}(t.ChildProperty),Te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("SlideDown")],i.prototype,"effect",void 0),pe([t.Property(400)],i.prototype,"duration",void 0),pe([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},Te)],i.prototype,"collapse",void 0),pe([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},Te)],i.prototype,"expand",void 0),i}(t.ChildProperty),Ue=function(e){function o(t,i){var s=e.call(this,t,i)||this;return s.isRefreshed=!1,s.preventExpand=!1,s.checkedElement=[],s.disableNode=[],s.validArr=[],s.validNodes=[],s.expandChildren=[],s.isFieldChange=!1,s.changeDataSource=!1,s.isBlazorExpandedNodes=[],s.hasTemplate=!1,s.mouseDownStatus=!1,s}ce(o,e),a=o,o.prototype.getModuleName=function(){return"treeview"},o.prototype.preRender=function(){var e=this;this.isBlazorPlatform=t.isBlazor()&&this.isServerRendered,this.checkActionNodes=[],this.parentNodeCheck=[],this.dragStartAction=!1,this.isAnimate=!1,this.keyConfigs={escape:"escape",end:"end",enter:"enter",f2:"f2",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",ctrlA:"ctrl+A",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:me,ariaAttributes:De,expandIconPosition:"Left",itemCreated:function(t){e.beforeNodeCreate(t)},enableHtmlSanitizer:this.enableHtmlSanitizer,itemNavigable:this.fullRowNavigable},this.updateListProp(this.fields),this.aniObj=new t.Animation({}),this.treeList=[],this.isLoaded=!1,this.isInitalExpand=!1,this.expandChildren=[],this.index=0,this.setTouchClass(),t.isNullOrUndefined(this.selectedNodes)&&this.setProperties({selectedNodes:[]},!0),t.isNullOrUndefined(this.checkedNodes)&&this.setProperties({checkedNodes:[]},!0),t.isNullOrUndefined(this.expandedNodes)?this.setProperties({expandedNodes:[]},!0):this.isInitalExpand=!0},o.prototype.getPersistData=function(){var e=["selectedNodes","checkedNodes","expandedNodes"];return this.addOnPersist(e)},o.prototype.render=function(){this.initialRender=!0,this.blazorInitialRender=!1,this.initialize(),this.setDataBinding(!1),this.setDisabledMode(),this.setExpandOnType(),this.disabled||this.setRipple(),this.wireEditingEvents(this.allowEditing),this.setDragAndDrop(this.allowDragAndDrop),this.disabled||this.wireEvents(),this.isBlazorPlatform||(this.initialRender=!1),this.renderComplete()},o.prototype.initialize=function(){this.isBlazorPlatform||(this.element.setAttribute("role","tree"),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect)),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},o.prototype.setDisabledMode=function(){this.disabled?this.element.classList.add("e-disabled"):this.element.classList.remove("e-disabled")},o.prototype.setEnableRtl=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},o.prototype.setRipple=function(){var e={selector:".e-fullrow,.e-text-content",ignore:"."+Oe+" > ."+xe+",.e-input-group,.e-input, ."+Le};this.rippleFn=t.rippleEffect(this.element,e);var i={selector:"."+Oe+" > ."+xe,isCenterRipple:!0};this.rippleIconFn=t.rippleEffect(this.element,i)},o.prototype.setFullRow=function(e){(e?t.addClass:t.removeClass)([this.element],"e-fullrow-wrap")},o.prototype.setMultiSelect=function(e){var i=t.select("."+ye,this.element);e?i.setAttribute("aria-multiselectable","true"):i.removeAttribute("aria-multiselectable")},o.prototype.templateComplier=function(e){if(e){this.hasTemplate=!0,this.element.classList.add("e-interaction");try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}catch(i){return t.compile(e)}}this.element.classList.remove("e-interaction")},o.prototype.setDataBinding=function(e){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof r.DataManager?(this.isOffline=this.isBlazorPlatform?this.fields.dataSource.offline:this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.isBlazorPlatform?i.fields.dataSource.offline:i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof r.DataManager&&i.isOffline&&(i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),i.renderItems(!0),0!==i.treeList.length||i.isLoaded||i.finalize())}).catch(function(e){i.trigger("actionFailure",{error:e})}):this.fields.dataSource.executeQuery(this.getQuery(this.fields)).then(function(t){i.treeList.pop(),i.treeData=t.result,i.isNumberTypeId=i.getType(),i.setRootData(),e&&(i.changeDataSource=!0),i.renderItems(!0),i.changeDataSource=!1,0!==i.treeList.length||i.isLoaded||i.finalize()}).catch(function(e){i.trigger("actionFailure",{error:e})})):(this.treeList.pop(),t.isNullOrUndefined(this.fields.dataSource)?this.rootData=this.treeData=[]:(this.treeData=JSON.parse(JSON.stringify(this.fields.dataSource)),this.setRootData()),this.isNumberTypeId=this.getType(),this.renderItems(!1)),0!==this.treeList.length||this.isLoaded||this.finalize()},o.prototype.getQuery=function(e,s){void 0===s&&(s=null);var n,l=[];if(e.query)n=e.query.clone();else{n=new r.Query;for(var o=this.getActualProperties(e),a=0,d=Object.keys(o);a<d.length;a++){var h=d[a];"dataSource"!==h&&"tableName"!==h&&"child"!==h&&e[h]&&"url"!==h&&-1===l.indexOf(e[h])&&l.push(e[h])}n.select(l),o.hasOwnProperty("tableName")&&n.from(e.tableName)}return i.ListBase.addSorting(this.sortOrder,e.text,n),t.isNullOrUndefined(s)||t.isNullOrUndefined(e.parentID)||n.where(e.parentID,"equal",this.isNumberTypeId?parseFloat(s):s),n},o.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof t.getValue(this.fields.id,this.treeData[0])},o.prototype.setRootData=function(){if(this.dataType=this.getDataType(this.treeData,this.fields),1===this.dataType){this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID);var e=this.getChildNodes(this.treeData,void 0,!0);t.isNullOrUndefined(e)?this.rootData=[]:this.rootData=e}else this.rootData=this.treeData},o.prototype.renderItems=function(e){if(!this.isBlazorPlatform||this.isBlazorPlatform&&this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName||this.changeDataSource){this.listBaseOption.ariaAttributes.level=1;var s=this.getSortedData(this.rootData);this.ulElement=i.ListBase.createList(this.createElement,e?this.rootData:s,this.listBaseOption),this.element.appendChild(this.ulElement);var n=this.ulElement.querySelectorAll(".e-list-item");if(!1===this.loadOnDemand)for(var l=0;l<n.length;)this.renderChildNodes(n[l],!0,null,!0),l++;(1===t.selectAll("."+ye,this.element).length&&n&&0!==n.length||this.loadOnDemand)&&this.finalizeNode(this.element)}this.updateTemplateForBlazor(),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()},o.prototype.updateTemplateForBlazor=function(){this.nodeTemplate&&this.isBlazorPlatform&&!this.isStringTemplate&&this.updateBlazorTemplate()},o.prototype.updateCheckedStateFromDS=function(e){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var i=this.fields,s=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.isChecked,"equal",!0,!1)),n=0;n<s.length;n++){var l=s[n][this.fields.id]?s[n][this.fields.id].toString():null;s[n][this.fields.parentID]&&s[n][this.fields.parentID].toString();if(-1!==this.checkedNodes.indexOf(l)||this.isLoaded||this.checkedNodes.push(l),s[n][this.fields.hasChildren])for(var o=s[n][this.fields.id],a=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.parentID,"equal",o,!1)),d=0;d<a.length;d++){var h=a[d][this.fields.id]?a[d][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(h)&&this.autoCheck&&this.checkedNodes.push(h)}}for(n=0;n<this.checkedNodes.length;n++){var c=this.fields,p=new r.DataManager(this.treeData).executeLocal((new r.Query).where(c.id,"equal",this.checkedNodes[n],!0));if(p[0]&&this.autoCheck&&(this.getCheckedNodeDetails(c,p),this.checkIndeterminateState(p[0])),p.length>0){m=p[0][this.fields.id]?p[0][this.fields.id].toString():null;this.checkedNodes.indexOf(m)>-1&&-1===this.validNodes.indexOf(m)&&this.validNodes.push(m)}for(var u=new r.DataManager(this.treeData).executeLocal((new r.Query).where(c.parentID,"equal",this.checkedNodes[n],!0)),f=0;f<u.length;f++){var m=u[f][this.fields.id]?u[f][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(m)&&this.autoCheck&&this.checkedNodes.push(m),this.checkedNodes.indexOf(m)>-1&&-1===this.validNodes.indexOf(m)&&this.validNodes.push(m)}}}else if(2===this.dataType||this.fields.dataSource instanceof r.DataManager&&this.isOffline)for(f=0;f<this.treeData.length;f++){var v=this.treeData[f][this.fields.id]?this.treeData[f][this.fields.id].toString():"";this.treeData[f][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(v)&&this.checkedNodes.push(v),this.checkedNodes.indexOf(v)>-1&&-1===this.validNodes.indexOf(v)&&this.validNodes.push(v);var g=t.getValue(this.fields.child.toString(),this.treeData[f]);g&&this.updateChildCheckState(g,this.treeData[f])}this.setProperties({checkedNodes:this.validNodes},!0)}},o.prototype.getCheckedNodeDetails=function(e,i){var s=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,n=0,l=this.element.querySelector('[data-uid="'+i[0][this.fields.id]+'"]'),o=this.element.querySelector('[data-uid="'+i[0][this.fields.parentID]+'"]');if(l||o)o&&(t.select("."+ke,o)||this.changeState(o,"indeterminate",null,!0,!0));else{this.parentNodeCheck.length;-1===this.parentNodeCheck.indexOf(s)&&this.parentNodeCheck.push(s);for(var a=this.getChildNodes(this.treeData,s),d=0;d<a.length;d++){var h=a[d][this.fields.id]?a[d][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(h)&&n++,n===a.length&&-1===this.checkedNodes.indexOf(s)&&this.checkedNodes.push(s)}var c=new r.DataManager(this.treeData).executeLocal((new r.Query).where(e.id,"equal",s,!0));this.getCheckedNodeDetails(e,c)}},o.prototype.updateParentCheckState=function(){for(var e,i=t.selectAll(".e-stop",this.element),s=0;s<i.length;s++){var n=t.closest(i[s],"."+ve),l=n.getAttribute("data-uid").toString(),o=0;if(e=1===this.dataType?new r.DataManager(this.treeData).executeLocal((new r.Query).where(this.fields.parentID,"equal",l,!0)):this.getChildNodes(this.treeData,l)){for(var a=0;a<e.length;a++){var d=e[a][this.fields.id].toString();-1!==this.checkedNodes.indexOf(d)&&o++}if(o===e.length){var h=n.getAttribute("data-uid");-1===this.checkedNodes.indexOf(h)&&this.checkedNodes.push(h),this.changeState(n,"check",null,!0,!0)}else 0===o&&0===this.checkedNodes.length&&this.changeState(n,"uncheck",null,!0,!0)}}},o.prototype.checkIndeterminateState=function(e){var t;if(t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]'))"true"!==t.querySelector("."+Le).getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0);else if(2===this.dataType){this.parentNodeCheck.length;-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())}},o.prototype.updateChildCheckState=function(e,i){for(var s=0,n=i[this.fields.id]?i[this.fields.id].toString():"",r=0;r<e.length;r++){var l=e[r][this.fields.id]?e[r][this.fields.id].toString():"";e[r][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(l)&&this.checkedNodes.push(l),-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(l)&&this.autoCheck&&this.checkedNodes.push(l),-1!==this.checkedNodes.indexOf(l)&&this.autoCheck&&s++,this.checkedNodes.indexOf(l)>-1&&-1===this.validNodes.indexOf(l)&&this.validNodes.push(l);var o=t.getValue(this.fields.child.toString(),e[r]);o&&(this.parentCheckData.push(i),this.updateChildCheckState(o,e[r])),s===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(n)&&this.checkedNodes.push(n)}if(0!==s&&this.autoCheck){this.checkIndeterminateState(i);for(var a=0;a<this.parentCheckData.length;a++)i!==this.parentCheckData[a]&&this.parentCheckData[a]&&this.checkIndeterminateState(this.parentCheckData[a])}this.parentCheckData=[]},o.prototype.beforeNodeCreate=function(e){if(this.showCheckBox){var i=n.createCheckBox(this.createElement,!0,{cssClass:this.touchClass});i.setAttribute("role","checkbox");var s=t.select("div."+xe,e.item),r=e.item.getAttribute("data-uid");e.item.childNodes[0].insertBefore(i,e.item.childNodes[0].childNodes[t.isNullOrUndefined(s)?0:1]);var l=t.getValue(e.fields.isChecked,e.curData);this.checkedNodes.indexOf(r)>-1?(t.select(".e-frame",i).classList.add(ke),i.setAttribute("aria-checked","true"),this.addCheck(e.item)):t.isNullOrUndefined(l)||"true"!==l.toString()?i.setAttribute("aria-checked","false"):(t.select(".e-frame",i).classList.add(ke),i.setAttribute("aria-checked","true"),this.addCheck(e.item));var o=t.select(".e-frame",i);t.EventHandler.add(o,"mousedown",this.frameMouseHandler,this),t.EventHandler.add(o,"mouseup",this.frameMouseHandler,this)}this.fullRowSelect&&this.createFullRow(e.item),this.allowMultiSelection&&!e.item.classList.contains("e-selected")&&e.item.setAttribute("aria-selected","false");var a=e.fields;if(this.addActionClass(e,a.selected,"e-selected"),this.addActionClass(e,a.expanded,"e-expanded"),!t.isNullOrUndefined(this.nodeTemplateFn)){var d=e.item.querySelector("."+ge),h=e.item.getAttribute("data-uid");d.innerHTML="",this.renderNodeTemplate(e.curData,d,h)}var c={node:e.item,nodeData:e.curData,text:e.text};this.isRefreshed||this.trigger("drawNode",c)},o.prototype.frameMouseHandler=function(e){var i=t.select(".e-ripple-container",e.target.parentElement);n.rippleMouseHandler(e,i)},o.prototype.addActionClass=function(e,i,s){var n=e.curData,r=t.getValue(i,n);t.isNullOrUndefined(r)||"false"===r.toString()||e.item.classList.add(s)},o.prototype.getDataType=function(e,i){if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName){for(s=0;s<e.length;s++)if(this.isOffline){if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[s]))&&!t.isNullOrUndefined(t.getValue(i.parentID,e[s])))return 1}else if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[s])))return 1;return 2}for(var s=0,n=e.length;s<n;s++){if("string"==typeof i.child&&!t.isNullOrUndefined(t.getValue(i.child,e[s])))return 2;if(!t.isNullOrUndefined(t.getValue(i.parentID,e[s]))||!t.isNullOrUndefined(t.getValue(i.hasChildren,e[s])))return 1}return 1},o.prototype.getGroupedData=function(e,t){for(var s=(new r.Query).group(t),n=i.ListBase.getDataSource(e,s),l=[],o=0;o<n.length;o++){var a=n[o].items;l.push(a)}return l},o.prototype.getSortedData=function(e){return e&&"None"!==this.sortOrder&&(e=i.ListBase.getDataSource(e,i.ListBase.addSorting(this.sortOrder,this.fields.text))),e},o.prototype.finalizeNode=function(e){for(var i=t.selectAll(".e-list-img",e),s=0;s<i.length;s++)i[s].setAttribute("alt","e-list-img");if(this.isLoaded){for(var n=t.selectAll(".e-selected",e),r=0;r<n.length;r++){this.selectNode(n[r],null);break}t.removeClass(n,"e-selected")}for(var l=t.selectAll(".e-list-item:not(.e-expanded)",e),o=0;o<l.length;o++){var a=t.select("div."+xe,l[o]);a&&a.classList.contains(me)&&this.disableExpandAttr(l[o])}var d=t.selectAll(".e-expanded",e);if(!this.isInitalExpand)for(r=0;r<d.length;r++)this.renderChildNodes(d[r]);t.removeClass(d,"e-expanded"),this.updateList(),this.isLoaded&&this.updateCheckedProp()},o.prototype.updateCheckedProp=function(){if(this.showCheckBox){var e=[].concat([],this.checkedNodes);this.setProperties({checkedNodes:e},!0)}},o.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=t.selectAll("li",this.element),i=0;i<e.length;i++)e[i].classList.contains(ve)&&(t.select("."+ye,e[i])?this.ensureParentCheckState(e[i]):this.ensureChildCheckState(e[i]));else for(var s=t.selectAll(".e-stop",this.element),i=0;i<s.length;i++)s[i].classList.remove("e-stop")},o.prototype.ensureParentCheckState=function(e){if(!t.isNullOrUndefined(e)){if(e.classList.contains(ue))return;var i=e;e.classList.contains(ve)&&(i=t.select("."+ye,e));var s=t.selectAll("."+ke,i),n=t.selectAll(".e-stop",i),r=t.selectAll("."+ve,i),l=e.getElementsByClassName(Le)[0];r.length===s.length?this.changeState(l,"check",null,!0,!0):s.length>0||n.length>0?this.changeState(l,"indeterminate",null,!0,!0):0===s.length&&this.changeState(l,"uncheck",null,!0,!0);var o=t.closest(e,"."+ye);if(!t.isNullOrUndefined(o)){var a=t.closest(o,"."+ve);this.ensureParentCheckState(a)}}},o.prototype.ensureChildCheckState=function(e,i){if(!t.isNullOrUndefined(e)){var s=t.select("."+ye,e),n=void 0;if(!t.isNullOrUndefined(s)){n=t.selectAll("."+Le,s);for(var r=e.getElementsByClassName("e-frame")[0].classList.contains(ke),l=e.getElementsByClassName("e-frame")[0].classList.contains("e-stop"),o=s.querySelectorAll("li"),a=(s.parentElement.getAttribute("aria-expanded"),void 0),d=0;d<n.length;d++){var h=o[d].getAttribute("data-uid");if(t.isNullOrUndefined(this.currentLoadData)||t.isNullOrUndefined(t.getValue(this.fields.isChecked,this.currentLoadData[d]))){var c=n[d].getElementsByClassName("e-frame")[0].classList.contains(ke);r?a="check":c&&!this.isLoaded?a="check":-1!==this.checkedNodes.indexOf(h)&&this.isLoaded&&(l||r)?a="check":o[d].classList.contains("e-has-child")&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(r||l)&&-1!==this.parentNodeCheck.indexOf(h)?(a="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):1===this.dataType&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(r||l)&&-1!==this.parentNodeCheck.indexOf(h)?(a="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):a="uncheck"}else a=t.getValue(this.fields.isChecked,this.currentLoadData[d])?"check":"uncheck",-1!==this.ele&&(a=r?"check":"uncheck"),"uncheck"===a&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(h)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1),a="indeterminate");this.changeState(n[d],a,i,!0,!0)}}this.autoCheck&&this.isLoaded&&this.updateParentCheckState()}},o.prototype.doCheckBoxAction=function(e,i){t.selectAll("."+ve,this.element);if(t.isNullOrUndefined(e)){var s=t.selectAll("."+Le,this.element);if(this.loadOnDemand)for(n=0;n<s.length;n++)this.updateFieldChecked(s[n],i),this.changeState(s[n],i?"check":"uncheck",null,null,null,i);else for(var n=0;n<s.length;n++)this.updateFieldChecked(s[n],i),this.changeState(s[n],i?"check":"uncheck")}else for(var r=e.length;r>=0;r--){var l=void 0;if(l=1===e.length?this.getElement(e[r-1]):this.getElement(e[r]),t.isNullOrUndefined(l)){p=void 0;if(""!==(p=e[r-e.length]?e[r-e.length].toString():e[r]?e[r].toString():null)&&i&&p)this.setValidCheckedNode(p),this.dynamicCheckState(p,i);else if(-1!==this.checkedNodes.indexOf(p)&&""!==p&&!i){this.checkedNodes.splice(this.checkedNodes.indexOf(p),1);var o=this.getChildNodes(this.treeData,p);if(o){for(var a=0;a<o.length;a++){var d=o[a][this.fields.id]?o[a][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(d)&&this.checkedNodes.splice(this.checkedNodes.indexOf(d),1)}-1!==this.parentNodeCheck.indexOf(p)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)}p&&this.dynamicCheckState(p,i),this.updateField(this.treeData,this.fields,p,"isChecked",null)}}else{var h=t.select(".e-list-parent ."+Le,l);this.validateCheckNode(h,!i,l,null)}}if(e)for(var c=0;c<e.length;c++){var p=e[c]?e[c].toString():"";i||this.updateField(this.treeData,this.fields,p,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},o.prototype.updateFieldChecked=function(e,i){var s=t.closest(e,"."+ve),n=s.getAttribute("data-uid");"true"!==this.getNodeData(s).isChecked||i||this.updateField(this.treeData,this.fields,n,"isChecked",null)},o.prototype.dynamicCheckState=function(e,i){if(1===this.dataType){var s=0,n=new r.DataManager(this.treeData).executeLocal((new r.Query).where(this.fields.id,"equal",e,!0));if(n[0]){var l=n[0][this.fields.id]?n[0][this.fields.id].toString():null,o=n[0][this.fields.parentID]?n[0][this.fields.parentID].toString():null,a=((p=this.element.querySelector('[data-uid="'+o+'"]'))&&t.select(".e-stop",p),p?t.select("."+ke,p):null),d=this.element.querySelector('[data-uid="'+l+'"]'),h=this.getChildNodes(this.treeData,o);if(h)for(u=0;u<h.length;u++){var c=h[u][this.fields.id]?h[u][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(c)&&s++}-1!==this.checkedNodes.indexOf(e)&&p&&l===e&&this.autoCheck?this.changeState(p,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&d&&l===e&&!i?this.changeState(d,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&d&&l===e&&i?this.changeState(d,"check",null):-1===this.checkedNodes.indexOf(e)&&!d&&p&&l===e&&this.autoCheck&&0!==s?this.changeState(p,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!d&&p&&l===e&&this.autoCheck&&0===s?this.changeState(p,"uncheck",null):d||p||l!==e||!this.autoCheck||this.updateIndeterminate(e,i)}}else if(2===this.dataType||this.fields.dataSource instanceof r.DataManager&&this.isOffline)for(var l=void 0,p=void 0,a=void 0,u=0;u<this.treeData.length;u++){l=this.treeData[u][this.fields.id]?this.treeData[u][this.fields.id].toString():"",a=(p=this.element.querySelector('[data-uid="'+l+'"]'))?t.select("."+ke,p):null,-1===this.checkedNodes.indexOf(l)&&p&&a&&!i&&this.changeState(p,"uncheck",null);var f=t.getValue(this.fields.child.toString(),this.treeData[u]);f&&this.updateChildIndeterminate(f,l,e,i,l)}},o.prototype.updateIndeterminate=function(e,t){var i,s=this.getTreeData(e),n=0;1===this.dataType&&(i=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null);var r=this.getChildNodes(this.treeData,i);if(r)for(var l=0;l<r.length;l++){var o=r[l][this.fields.id]?r[l][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(o)&&n++}var a=this.element.querySelector('[data-uid="'+i+'"]');a&&t?this.changeState(a,"indeterminate",null):!t&&a&&-1===this.parentNodeCheck.indexOf(i)&&0!==n?this.changeState(a,"indeterminate",null):!t&&a&&-1===this.parentNodeCheck.indexOf(i)&&0===n?this.changeState(a,"uncheck",null):a||(t||-1!==this.checkedNodes.indexOf(i)||-1===this.parentNodeCheck.indexOf(i)?t&&-1===this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)?this.parentNodeCheck.push(i):t||-1===this.checkedNodes.indexOf(i)||-1!==this.parentNodeCheck.indexOf(i)||0===n||this.parentNodeCheck.push(i):this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i),1),this.updateIndeterminate(i,t),-1===this.checkedNodes.indexOf(i)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(i),1))},o.prototype.updateChildIndeterminate=function(e,i,s,n,r){for(var l=0,o=0;o<e.length;o++){var a=e[o][this.fields.id]?e[o][this.fields.id].toString():"";-1!==this.checkedNodes.indexOf(a)&&l++;var d=this.element.querySelector('[data-uid="'+i+'"]'),h=d?t.select(".e-stop",d):null,c=d?t.select("."+ke,d):null,p=this.element.querySelector('[data-uid="'+a+'"]'),u=p?t.select("."+ke,p):null;if(-1!==this.checkedNodes.indexOf(s)&&d&&a===s&&this.autoCheck)this.changeState(d,"indeterminate",null);else if(-1!==this.checkedNodes.indexOf(s)||!d||p||a!==s||n){if(-1===this.checkedNodes.indexOf(s)&&p&&a===s&&!n)this.changeState(p,"uncheck",null);else if(-1===this.checkedNodes.indexOf(s)&&h&&a===s&&this.autoCheck&&0===l&&!n)h.classList.remove("e-stop");else if(-1===this.checkedNodes.indexOf(s)&&!p&&c&&a===s&&0===l)this.changeState(d,"uncheck",null);else if(-1===this.checkedNodes.indexOf(a)&&p&&u&&0===l)this.changeState(p,"uncheck",null);else if(!p&&!d&&a===s||-1!==this.parentNodeCheck.indexOf(i)&&this.autoCheck){var f=this.element.querySelector('[data-uid="'+r+'"]');n&&0!==l?this.changeState(f,"indeterminate",null):n&&l===e.length&&-1===this.checkedNodes.indexOf(i)?this.checkedNodes.push(i):n||0!==l||-1===this.parentNodeCheck.indexOf(i)||this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i)),-1===this.parentNodeCheck.indexOf(i)&&this.parentNodeCheck.push(i)}}else this.autoCheck?this.changeState(d,"uncheck",null):0!==l?this.changeState(d,"indeterminate",null):this.changeState(d,"uncheck",null);var m=t.getValue(this.fields.child.toString(),e[o]);m&&this.updateChildIndeterminate(m,a,s,n,r)}},o.prototype.changeState=function(e,i,s,n,r,l){var o,a=this,d=t.closest(e,"."+ve);n?this.nodeCheckAction(e,i,d,o,s,n,r,l):(this.checkActionNodes=[],o=this.getCheckEvent(d,i,s),this.trigger("nodeChecking",o,function(t){t.cancel||a.nodeCheckAction(e,i,d,t,s,n,r,l)}))},o.prototype.nodeCheckAction=function(e,i,s,n,r,l,o,a){var d,h=e.getElementsByClassName("e-frame")[0];if("check"!==i||h.classList.contains(ke)?"uncheck"===i&&(h.classList.contains(ke)||h.classList.contains("e-stop"))?(t.removeClass([h],[ke,"e-stop"]),this.removeCheck(s),d="false"):"indeterminate"===i&&this.autoCheck&&(h.classList.remove(ke),h.classList.add("e-stop"),this.removeCheck(s),d="mixed"):(h.classList.remove("e-stop"),h.classList.add(ke),this.addCheck(s),d="true"),d="check"===i?"true":"uncheck"===i?"false":d,t.isNullOrUndefined(d)||e.setAttribute("aria-checked",d),o){var c=[].concat([],this.checkActionNodes);n=this.getCheckEvent(s,i,r),t.isUndefined(l)&&(n.data=c)}void 0!==a&&this.ensureStateChange(s,a),l||t.isNullOrUndefined(d)||(e.setAttribute("aria-checked",d),this.allowServerDataBinding=!0,this.updateServerProperties("check"),this.allowServerDataBinding=!1,n.data[0].checked=d,this.trigger("nodeChecked",n),this.checkActionNodes=[])},o.prototype.addCheck=function(e){var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.checkedNodes.indexOf(i)||this.checkedNodes.push(i)},o.prototype.removeCheck=function(e){var t=this.checkedNodes.indexOf(e.getAttribute("data-uid"));t>-1&&this.checkedNodes.splice(t,1)},o.prototype.getCheckEvent=function(e,i,s){this.checkActionNodes.push(this.getNodeData(e));var n=this.checkActionNodes;return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,data:n}},o.prototype.finalize=function(){var e=t.select("."+ye,this.element);if(!t.isNullOrUndefined(e)){e.setAttribute("role",De.treeRole),this.setMultiSelect(this.allowMultiSelection);var i=t.select("."+ve,this.element);i&&(t.addClass([i],Ae),this.updateIdAttr(null,i)),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&this.rootData[0].hasOwnProperty(this.fields.parentID),this.doExpandAction()}},o.prototype.doExpandAction=function(){var e=this.expandedNodes;if(this.isInitalExpand&&e.length>0){if(this.setProperties({expandedNodes:[]},!0),this.isBlazorPlatform&&!this.initialRender)return;if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName)this.expandGivenNodes(e);else{for(var i=0;i<e.length;i++){var s=t.select('[data-uid="'+e[i]+'"]',this.element);if(t.isNullOrUndefined(s))e[i]&&-1===this.expandChildren.indexOf(e[i])&&this.expandChildren.push(e[i].toString());else{var n=t.select("."+me,t.select("."+Oe,s));t.isNullOrUndefined(n)||this.expandAction(s,n,null)}}this.afterFinalized()}}else this.afterFinalized()},o.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){++t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()})},o.prototype.expandCallback=function(e,i){var s=t.select('[data-uid="'+e+'"]',this.element);if(t.isNullOrUndefined(s))i();else{var n=t.select("."+me,t.select("."+Oe,s));t.isNullOrUndefined(n)?i():this.expandAction(s,n,null,!1,i)}},o.prototype.afterFinalized=function(){if((!this.isBlazorPlatform||this.isBlazorPlatform&&!this.initialRender)&&this.doSelectionAction(),this.updateCheckedProp(),this.isBlazorPlatform&&(this.initialRender&&this.setCheckedNodes(this.checkedNodes),this.updateInstance(),this.initialRender=!1),this.isAnimate=!0,this.isInitalExpand=!1,!this.isLoaded||this.isFieldChange){var e={data:this.treeData};this.trigger("dataBound",e)}this.isLoaded=!0},o.prototype.doSelectionAction=function(){var e=t.selectAll(".e-selected",this.element),i=this.selectedNodes;if(i.length>0){this.setProperties({selectedNodes:[]},!0);for(var s=0;s<i.length;s++){var n=t.select('[data-uid="'+i[s]+'"]',this.element);if(n&&!n.classList.contains("e-active")?this.selectNode(n,null,!0):this.selectedNodes.push(i[s]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);t.removeClass(e,"e-selected")},o.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[t].classList.contains("e-disable")||this.selectNode(e[t],null,!0),this.allowMultiSelection);t++);},o.prototype.clickHandler=function(e){var i=e.originalEvent.target;if(t.EventHandler.remove(this.element,"contextmenu",this.preventContextMenu),i&&!this.dragStartAction){var s=i.classList,n=t.closest(i,"."+ve);if(n){if(3!==e.originalEvent.which){var r=t.select(".e-ripple-element",n),l=t.select("."+xe,n);if(this.removeHover(),this.setFocusElement(n),this.showCheckBox&&!n.classList.contains("e-disable")){var o=t.closest(i,"."+Le);if(!t.isNullOrUndefined(o)){var a=t.select(".e-frame",o);return this.validateCheckNode(o,a.classList.contains(ke),n,e.originalEvent),void this.triggerClickEvent(e.originalEvent,n)}}s.contains(me)?this.expandAction(n,i,e):s.contains(fe)?this.collapseNode(n,i,e):r&&l?l.classList.contains("e-ripple")&&l.classList.contains(me)?this.expandAction(n,l,e):l.classList.contains("e-ripple")&&l.classList.contains(fe)?this.collapseNode(n,l,e):s.contains(ye)||s.contains(ve)||this.toggleSelect(n,e.originalEvent,!1):s.contains(ye)||s.contains(ve)||this.toggleSelect(n,e.originalEvent,!1)}this.triggerClickEvent(e.originalEvent,n)}}},o.prototype.nodeCheckedEvent=function(e,i,s){t.closest(e,"."+ve);var n=this.getCheckEvent(e,i?"uncheck":"check",s);n.data=n.data.splice(0,n.data.length-1),this.trigger("nodeChecked",n)},o.prototype.triggerClickEvent=function(e,t){var i={event:e,node:t};this.trigger("nodeClicked",i)},o.prototype.expandNode=function(e,i,s){var n=this;if(this.renderReactTemplates(),i.classList.contains(Ne)&&this.hideSpinner(i),this.initialRender||i.classList.add("interaction"),!0!==s||!0===s&&e.classList.contains("e-expanded")){if(!0!==this.preventExpand){t.removeClass([i],me),t.addClass([i],fe);var l=0,o=0,a=this,d=t.select("."+ye,e),h=e;this.setHeight(h,d);var c=t.select(".e-list-item."+Ce,e);this.isAnimate&&!this.isRefreshed?this.aniObj.animate(d,{name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(i){h.style.overflow="hidden",!t.isNullOrUndefined(c)&&c instanceof HTMLElement&&c.classList.add("e-animation-active"),l=h.offsetHeight,o=t.select("."+Oe,e).offsetHeight},progress:function(e){e.element.style.display="block",a.animateHeight(e,l,o)},end:function(e){e.element.style.display="block",!t.isNullOrUndefined(c)&&c instanceof HTMLElement&&c.classList.remove("e-animation-active"),n.expandedNode(h,d,i)}}):this.expandedNode(h,d,i)}}else t.select("."+ye,e).style.display="none",this.fields.dataSource instanceof r.DataManager==!0&&(this.preventExpand=!1);this.initialRender&&i.classList.add("interaction")},o.prototype.expandedNode=function(e,i,s){i.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",t.removeClass([s],Ee),this.addExpand(e),this.allowServerDataBinding=!0,this.updateServerProperties("expand"),this.allowServerDataBinding=!1,this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.trigger("nodeExpanded",this.expandArgs))},o.prototype.addExpand=function(e){e.setAttribute("aria-expanded","true"),t.removeClass([e],"e-node-collapsed");var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.expandedNodes.indexOf(i)||this.expandedNodes.push(i)},o.prototype.collapseNode=function(e,i,s){var n=this;if(!i.classList.contains(Ee)){t.addClass([i],Ee);var r;this.isLoaded?(r=this.getExpandEvent(e,s),this.trigger("nodeCollapsing",r,function(s){s.cancel?t.removeClass([i],Ee):n.nodeCollapseAction(e,i,s)})):this.nodeCollapseAction(e,i,r)}},o.prototype.nodeCollapseAction=function(e,i,s){var n=this;t.removeClass([i],fe),t.addClass([i],me);var r=0,l=0,o=this,a=t.select("."+ye,e),d=e,h=t.select(".e-list-item."+Ce,e);this.isAnimate?this.aniObj.animate(a,{name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(i){d.style.overflow="hidden",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.add("e-animation-active"),r=t.select("."+Oe,e).offsetHeight,l=d.offsetHeight},progress:function(e){o.animateHeight(e,r,l)},end:function(e){e.element.style.display="none",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.remove("e-animation-active"),n.collapsedNode(d,a,i,s)}}):this.collapsedNode(d,a,i,s)},o.prototype.collapsedNode=function(e,i,s,n){i.style.display="none",e.style.overflow="",e.style.height="",t.removeClass([s],Ee),this.allowServerDataBinding=!0,this.updateServerProperties("expand"),this.allowServerDataBinding=!1,this.removeExpand(e),this.isLoaded&&(n=this.getExpandEvent(e,null),this.trigger("nodeCollapsed",n))},o.prototype.removeExpand=function(e,t){t?e.removeAttribute("aria-expanded"):this.disableExpandAttr(e);var i=this.expandedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.expandedNodes.splice(i,1)},o.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),t.addClass([e],"e-node-collapsed")},o.prototype.setHeight=function(e,t){t.style.display="block",t.style.visibility="hidden",e.style.height=e.offsetHeight+"px",t.style.display="none",t.style.visibility=""},o.prototype.animateHeight=function(e,t,i){var s=(i-t)*((e.duration-e.timeStamp)/e.duration)+t;e.element.parentElement.style.height=s+"px"},o.prototype.renderChildNodes=function(e,s,n,l){var o=this,a=t.select("div."+xe,e);if(!t.isNullOrUndefined(a)){this.showSpinner(a);var d;if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName){var h=this.parents(e,"."+ye).length,c=this.getChildFields(this.fields,h,1);if(t.isNullOrUndefined(c)||t.isNullOrUndefined(c.dataSource))return t.detach(a),void this.removeExpand(e,!0);this.treeList.push("false"),this.fields.dataSource instanceof r.DataManager&&this.isOffline?(this.treeList.pop(),d=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.loadChild(d,c,a,e,s,n,l),this.updateTemplateForBlazor()):c.dataSource.executeQuery(this.getQuery(c,e.getAttribute("data-uid"))).then(function(t){o.treeList.pop(),d=t.result,1===o.dataType&&(o.dataType=2),o.loadChild(d,c,a,e,s,n,l),o.updateTemplateForBlazor()}).catch(function(e){o.trigger("actionFailure",{error:e})})}else{if(d=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.currentLoadData=this.getSortedData(d),t.isNullOrUndefined(d)||0===d.length)return t.detach(a),void this.removeExpand(e,!0);this.isBlazorPlatform&&this.initialRender||(this.listBaseOption.ariaAttributes.level=parseFloat(e.getAttribute("aria-level"))+1,e.appendChild(i.ListBase.createList(this.createElement,this.currentLoadData,this.listBaseOption))),this.expandNode(e,a,l),this.setSelectionForChildNodes(d),this.ensureCheckNode(e),this.finalizeNode(e),this.loadOnDemand&&this.nodeTemplate&&this.isBlazorPlatform&&!this.isStringTemplate&&this.updateBlazorTemplate(),this.disableTreeNodes(d),this.renderSubChild(e,s,l)}}},o.prototype.loadChild=function(e,s,n,l,o,a,d){if(this.currentLoadData=e,t.isNullOrUndefined(e)||0===e.length)t.detach(n),this.removeExpand(l,!0);else{if(this.updateListProp(s),this.fields.dataSource instanceof r.DataManager&&!this.isOffline){var h=l.getAttribute("data-uid"),c=this.getNodeObject(h);t.setValue("child",e,c)}this.listBaseOption.ariaAttributes.level=parseFloat(l.getAttribute("aria-level"))+1,l.appendChild(i.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(l,n,d),this.setSelectionForChildNodes(e),this.ensureCheckNode(l),this.finalizeNode(l),this.disableTreeNodes(e),this.renderSubChild(l,o,d)}a&&a(),0!==this.treeList.length||this.isLoaded||this.finalize()},o.prototype.disableTreeNodes=function(e){for(var t=0;t<e.length;){var i=e[t][this.fields.id]?e[t][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(i)&&this.doDisableAction([i]),t++}},o.prototype.setSelectionForChildNodes=function(e){var t;for(t=0;t<e.length;t++){var i=e[t][this.fields.id]?e[t][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(i)&&this.doSelectionAction()}},o.prototype.ensureCheckNode=function(e){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck&&(this.ensureChildCheckState(e),this.ensureParentCheckState(e))),this.currentLoadData=null},o.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},o.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},o.prototype.getChildMapper=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},o.prototype.getChildNodes=function(e,i,s){void 0===s&&(s=!1);var n;if(t.isNullOrUndefined(e))return n;if(1===this.dataType)return this.getChildGroup(this.groupedData,i,s);if("string"==typeof this.fields.child)for(var r=0,l=e.length;r<l;r++){var o=t.getValue(this.fields.id,e[r]);if(o&&o.toString()===i)return t.getValue(this.fields.child,e[r]);if(!t.isNullOrUndefined(t.getValue(this.fields.child,e[r]))&&void 0!==(n=this.getChildNodes(t.getValue(this.fields.child,e[r]),i)))break}return n},o.prototype.getChildGroup=function(e,i,s){if(!t.isNullOrUndefined(e))for(var n=0,r=e.length;n<r;n++){if(t.isNullOrUndefined(e[n][0])||t.isNullOrUndefined(t.getValue(this.fields.parentID,e[n][0])))return s?e[n]:[];if(t.getValue(this.fields.parentID,e[n][0]).toString()===i)return e[n]}},o.prototype.renderSubChild=function(e,i,s){if(i)for(var n=t.selectAll("."+me,e),r=0,l=n.length;r<l;r++){var o=n[r];if(e.querySelector(".e-icons")!==n[r]){var a=t.closest(o,"."+ve);this.expandArgs=this.getExpandEvent(a,null),!0!==s&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(a,i,null,s)}}},o.prototype.toggleSelect=function(e,t,i){e.classList.contains("e-disable")||(this.allowMultiSelection&&(t&&t.ctrlKey||i)&&this.isActive(e)?this.unselectNode(e,t):this.selectNode(e,t,i))},o.prototype.isActive=function(e){return!!e.classList.contains(Ce)},o.prototype.selectNode=function(e,i,s){var n=this;if(t.isNullOrUndefined(e)||!this.allowMultiSelection&&this.isActive(e)&&!t.isNullOrUndefined(i))return void this.setFocusElement(e);var r;this.isLoaded?(r=this.getSelectEvent(e,"select",i),this.trigger("nodeSelecting",r,function(t){t.cancel||n.nodeSelectAction(e,i,t,s)})):this.nodeSelectAction(e,i,r,s)},o.prototype.nodeSelectAction=function(e,i,s,n){if(this.allowMultiSelection&&(n||i&&(!i||i.ctrlKey))||this.removeSelectAll(),this.allowMultiSelection&&i&&i.shiftKey){this.startNode||(this.startNode=e);var r=this.liList.indexOf(this.startNode),l=this.liList.indexOf(e);if(r>l){var o=r;r=l,l=o}for(var a=r;a<=l;a++){var d=this.liList[a];t.isVisible(d)&&!d.classList.contains("e-disable")&&this.addSelect(d)}}else this.startNode=e,this.addSelect(e);this.setFocusElement(e),this.isLoaded&&(this.allowServerDataBinding=!0,this.updateServerProperties("select"),this.allowServerDataBinding=!1,s.nodeData=this.getNodeData(e),this.trigger("nodeSelected",s))},o.prototype.unselectNode=function(e,t){var i,s=this;this.isLoaded?(i=this.getSelectEvent(e,"un-select",t),this.trigger("nodeSelecting",i,function(t){t.cancel||(s.allowServerDataBinding=!0,s.updateServerProperties("select"),s.allowServerDataBinding=!1,s.nodeUnselectAction(e,t))})):this.nodeUnselectAction(e,i)},o.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(this.allowServerDataBinding=!0,this.updateServerProperties("select"),this.allowServerDataBinding=!1,t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},o.prototype.setFocusElement=function(e){if(!t.isNullOrUndefined(e)){var i=this.getFocusedNode();i&&t.removeClass([i],Ae),t.addClass([e],Ae),this.updateIdAttr(i,e)}},o.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),t.addClass([e],Ce);var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.selectedNodes.indexOf(i)||this.selectedNodes.push(i)},o.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),t.removeClass([e],Ce);var i=this.selectedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.selectedNodes.splice(i,1)},o.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+Ce),i=0,s=e;i<s.length;i++){var n=s[i];this.allowMultiSelection?n.setAttribute("aria-selected","false"):n.removeAttribute("aria-selected")}t.removeClass(e,Ce),this.setProperties({selectedNodes:[]},!0)},o.prototype.getSelectEvent=function(e,i,s){var n=this.getNodeData(e);return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,nodeData:n}},o.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?t.Browser.isDevice?"Click":"DblClick":this.expandOn},o.prototype.expandHandler=function(e){var i=e.originalEvent.target;!i||i.classList.contains("e-input")||i.classList.contains(ue)||i.classList.contains(ye)||i.classList.contains(ve)||i.classList.contains(xe)||this.showCheckBox&&t.closest(i,"."+Le)||this.expandCollapseAction(t.closest(i,"."+ve),e)},o.prototype.expandCollapseAction=function(e,i){var s=t.select("div."+xe,e);if(s&&!s.classList.contains(Ee)){var n=s.classList;n.contains(me)?this.expandAction(e,s,i):n.contains(fe)&&this.collapseNode(e,s,i)}},o.prototype.expandAction=function(e,i,s,n,r){var l=this;i.classList.contains(Ee)||(t.addClass([i],Ee),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(e,s),this.trigger("nodeExpanding",this.expandArgs,function(s){s.cancel?t.removeClass([i],Ee):l.nodeExpandAction(e,i,n,r)})):this.nodeExpandAction(e,i,n,r))},o.prototype.nodeExpandAction=function(e,i,s,n){var r=t.select("."+ye,e);if(r&&"UL"===r.nodeName)this.expandNode(e,i);else{this.renderChildNodes(e,s,n);for(var l=t.selectAll("."+ve,e),o=0;o<l.length;o++){var a=this.getId(l[o]);if(-1!==this.expandChildren.indexOf(a)&&void 0!==this.expandChildren){var d=t.select("."+me,t.select("."+Oe,l[o]));t.isNullOrUndefined(d)||this.expandAction(l[o],d,null),this.expandChildren.splice(this.expandChildren.indexOf(a),1)}}}},o.prototype.keyActionHandler=function(e){var i=this,s=e.target,n=this.getFocusedNode();if(s&&s.classList.contains("e-input")){var r=s;return void("enter"===e.action?(r.blur(),this.element.focus(),t.addClass([n],be)):"escape"===e.action&&(r.value=this.oldText,r.blur(),this.element.focus(),t.addClass([n],be)))}e.preventDefault();var l={cancel:!1,event:e,node:n};this.trigger("keyPress",l,function(s){if(!s.cancel)switch(e.action){case"space":i.showCheckBox&&i.checkNode(e);break;case"moveRight":i.openNode(!i.enableRtl,e);break;case"moveLeft":i.openNode(!!i.enableRtl,e);break;case"shiftDown":i.shiftKeySelect(!0,e);break;case"moveDown":case"ctrlDown":case"csDown":i.navigateNode(!0);break;case"shiftUp":i.shiftKeySelect(!1,e);break;case"moveUp":case"ctrlUp":case"csUp":i.navigateNode(!1);break;case"home":case"shiftHome":case"ctrlHome":case"csHome":i.navigateRootNode(!0);break;case"end":case"shiftEnd":case"ctrlEnd":case"csEnd":i.navigateRootNode(!1);break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":i.toggleSelect(n,e);break;case"f2":i.allowEditing&&!n.classList.contains("e-disable")&&i.createTextbox(n,e);break;case"ctrlA":if(i.allowMultiSelection){var r=t.selectAll(".e-list-item:not(.e-active)",i.element);i.selectGivenNodes(r)}}})},o.prototype.navigateToFocus=function(e){var i=this.getFocusedNode().querySelector("."+Oe),s=i.getBoundingClientRect(),n=this.getScrollParent(this.element);if(!t.isNullOrUndefined(n)){var r=n.getBoundingClientRect();s.bottom>r.bottom?n.scrollTop+=s.bottom-r.bottom:s.top<r.top&&(n.scrollTop-=r.top-s.top)}this.isVisibleInViewport(i)||i.scrollIntoView(e)},o.prototype.isVisibleInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},o.prototype.getScrollParent=function(e){return t.isNullOrUndefined(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},o.prototype.shiftKeySelect=function(e,t){if(this.allowMultiSelection){var i=this.getFocusedNode(),s=e?this.getNextNode(i):this.getPrevNode(i);this.removeHover(),this.setFocusElement(s),this.toggleSelect(s,t,!1),this.navigateToFocus(!e)}else this.navigateNode(e)},o.prototype.checkNode=function(e){var i=this.getFocusedNode(),s=t.select("."+Le,i),n=t.select(" .e-frame",s).classList.contains(ke);i.classList.contains("e-disable")||0==i.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(s,n,i,e)},o.prototype.validateCheckNode=function(e,i,s,n){var r=this,l=t.closest(e,"."+ve);this.checkActionNodes=[];var o=i?"false":"true";t.isNullOrUndefined(o)||e.setAttribute("aria-checked",o);var a=this.getCheckEvent(l,i?"uncheck":"check",n);this.trigger("nodeChecking",a,function(t){t.cancel||r.nodeCheckingAction(e,i,s,t,n)})},o.prototype.nodeCheckingAction=function(e,i,s,n,r){if(-1===this.checkedElement.indexOf(s.getAttribute("data-uid"))){this.checkedElement.push(s.getAttribute("data-uid"));var l=this.getChildNodes(this.treeData,s.getAttribute("data-uid"));null!==l?this.allCheckNode(l,this.checkedElement,null,null,!1):l=null}if(this.changeState(e,i?"uncheck":"check",r,!0),this.autoCheck){this.ensureChildCheckState(s),this.ensureParentCheckState(t.closest(t.closest(s,"."+ye),"."+ve));var o=void 0;"check"===n.action?o=!0:"uncheck"===n.action&&(o=!1),this.ensureStateChange(s,o)}this.allowServerDataBinding=!0,this.updateServerProperties("check"),this.allowServerDataBinding=!1,this.nodeCheckedEvent(e,i,r)},o.prototype.ensureStateChange=function(e,i){var s=t.select("."+ye,e),n=e.getAttribute("data-uid"),l=this.fields;if(1===this.dataType&&this.autoCheck)for(var o=new r.DataManager(this.treeData).executeLocal((new r.Query).where(l.parentID,"equal",n,!0)),a=0;a<o.length;a++){var d=o[a][this.fields.id]?o[a][this.fields.id].toString():null,h=o[a][this.fields.isChecked]?o[a][this.fields.isChecked].toString():null;if(-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(d)){this.checkedNodes.push(d);p=this.getChildNodes(this.treeData,d);this.getChildItems(p,i),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)}else if(-1===this.checkedNodes.indexOf(n)&&null===s&&-1!==this.checkedNodes.indexOf(d)){if(this.checkedNodes.splice(this.checkedNodes.indexOf(d),1),"true"===h&&this.updateField(this.treeData,this.fields,d,"isChecked",null),-1===this.checkedNodes.indexOf(n)&&null===s||-1!==this.parentNodeCheck.indexOf(d)){var c=this.getChildNodes(this.treeData,d);this.getChildItems(c,i),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)}}else{var p=this.getChildNodes(this.treeData,d);this.getChildItems(p,i)}}else if(1!==this.dataType||this.autoCheck)(p=this.getChildNodes(this.treeData,n))&&this.childStateChange(p,n,s,i);else if(i)for(a=0;a<this.treeData.length;a++){var u=this.treeData[a][this.fields.id]?this.treeData[a][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(u)&&this.checkedNodes.push(u)}else{for(var f=new r.DataManager(this.treeData).executeLocal((new r.Query).where(l.isChecked,"equal",!0,!1)),a=0;a<f.length;a++){var m=f[a][this.fields.id]?f[a][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(m)&&this.checkedNodes.splice(this.checkedNodes.indexOf(m),1),this.updateField(this.treeData,this.fields,m,"isChecked",null)}this.checkedNodes=[]}},o.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var s=e[i][this.fields.id]?e[i][this.fields.id].toString():null,n=e[i][this.fields.isChecked]?e[i][this.fields.isChecked].toString():null;-1===this.checkedNodes.indexOf(s)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(s),1),-1===this.checkedNodes.indexOf(s)&&t&&this.checkedNodes.push(s),"true"!==n||t||this.updateField(this.treeData,this.fields,s,"isChecked",null);var r=this.getChildNodes(this.treeData,s);r.length>0&&this.getChildItems(r,t)}},o.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var r=e[n][this.fields.id]?e[n][this.fields.id].toString():"",l=e[n][this.fields.isChecked]?e[n][this.fields.isChecked].toString():null;this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(r)?(this.checkedNodes.push(r),-1!==this.parentNodeCheck.indexOf(r)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(r),1)):-1!==this.checkedNodes.indexOf(t)||-1===this.checkedNodes.indexOf(r)||s||(this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),"true"===l&&this.updateField(this.treeData,this.fields,r,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(r)&&this.checkedNodes.push(r):(-1!==this.checkedNodes.indexOf(r)&&this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),this.updateField(this.treeData,this.fields,r,"isChecked",null),this.checkedNodes=[]));var o=this.getChildNodes([e[n]],r);o&&this.childStateChange(o,t,i,s)}},o.prototype.allCheckNode=function(e,i,s,n,r){if(e)for(var l=0;l<e.length;l++){var o=t.getValue(this.fields.id,e[l]),a=this.element.querySelector('[data-uid="'+o+'"]');if(!1!==r&&-1===this.checkedElement.indexOf(o.toString())&&(null===a&&!t.isNullOrUndefined(e[l][this.fields.isChecked])&&-1===i.indexOf(o.toString())||0===n||2===s)&&(!1!==e[l][this.fields.isChecked]||2===s?i.push(o.toString()):n=null,n=!1!==e[l][this.fields.isChecked]||2===s?0:null),-1===i.indexOf(o.toString())&&t.isNullOrUndefined(s)&&i.push(o.toString()),!0===t.getValue(this.fields.hasChildren,e[l])||t.getValue(this.fields.child.toString(),e[l])){var d=t.getValue(this.fields.id,e[l]),h=this.getChildNodes(this.treeData,d.toString());h&&(t.isNullOrUndefined(r)?this.allCheckNode(h,i,s,n):this.allCheckNode(h,i,s,n,r),n=null)}n=null}},o.prototype.openNode=function(e,i){var s=this.getFocusedNode(),n=t.select("div."+xe,s);if(e){if(!n)return;n.classList.contains(me)?this.expandAction(s,n,i):this.focusNextNode(s,!0)}else if(n&&n.classList.contains(fe))this.collapseNode(s,n,i);else{var r=t.closest(t.closest(s,"."+ye),"."+ve);if(!r)return;r.classList.contains("e-disable")||(this.setFocus(s,r),this.navigateToFocus(!0))}},o.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},o.prototype.navigateRootNode=function(e){var t=this.getFocusedNode(),i=e?this.getRootNode():this.getEndNode();i.classList.contains("e-disable")||(this.setFocus(t,i),this.navigateToFocus(e))},o.prototype.getFocusedNode=function(){var e,i=t.select(".e-list-item."+Ae,this.element);return t.isNullOrUndefined(i)&&(e=t.select("."+ve,this.element)),t.isNullOrUndefined(i)?t.isNullOrUndefined(e)?this.element.firstElementChild:e:i},o.prototype.focusNextNode=function(e,t){var i=t?this.getNextNode(e):this.getPrevNode(e);if(this.setFocus(e,i),this.navigateToFocus(!t),i.classList.contains("e-disable")){var s=i.lastChild;null==i.previousSibling&&i.classList.contains("e-level-1")?this.focusNextNode(i,!0):null==i.nextSibling&&i.classList.contains("e-node-collapsed")?this.focusNextNode(i,!1):null==i.nextSibling&&s.classList.contains(Oe)?this.focusNextNode(i,!1):this.focusNextNode(i,t)}},o.prototype.getNextNode=function(e){var i,s=this.liList.indexOf(e);do{if(s++,i=this.liList[s],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},o.prototype.getPrevNode=function(e){var i,s=this.liList.indexOf(e);do{if(s--,i=this.liList[s],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},o.prototype.getRootNode=function(){var e,i=0;do{e=this.liList[i],i++}while(!t.isVisible(e));return e},o.prototype.getEndNode=function(){var e,i=this.liList.length-1;do{e=this.liList[i],i--}while(!t.isVisible(e));return e},o.prototype.setFocus=function(e,i){t.removeClass([e],[be,Ae]),i.classList.contains("e-disable")||(t.addClass([i],[be,Ae]),this.updateIdAttr(e,i))},o.prototype.updateIdAttr=function(e,t){this.element.removeAttribute("aria-activedescendant"),e&&e.removeAttribute("id"),t.setAttribute("id",this.element.id+"_active"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active")},o.prototype.focusIn=function(){this.mouseDownStatus||t.addClass([this.getFocusedNode()],be),this.mouseDownStatus=!1},o.prototype.focusOut=function(){t.removeClass([this.getFocusedNode()],be)},o.prototype.onMouseOver=function(e){var i=e.target,s=i.classList,n=t.closest(i,"."+ve);if(!n||s.contains(ye)||s.contains(ve))return void this.removeHover();n&&!n.classList.contains("e-disable")&&this.setHover(n)},o.prototype.setHover=function(e){e.classList.contains(be)||(this.removeHover(),t.addClass([e],be))},o.prototype.onMouseLeave=function(e){this.removeHover()},o.prototype.removeHover=function(){var e=t.selectAll("."+be,this.element);e&&e.length&&t.removeClass(e,be)},o.prototype.getNodeData=function(e,i){if(!t.isNullOrUndefined(e)&&e.classList.contains(ve)&&!t.isNullOrUndefined(t.closest(e,".e-control"))&&t.closest(e,".e-control").classList.contains(ue)){var s=e.getAttribute("data-uid"),n=this.getText(e,i),r=t.closest(e.parentNode,"."+ve),l=r?r.getAttribute("data-uid"):null,o=e.classList.contains(Ce),a="true"===e.getAttribute("aria-expanded"),d=null!==e.getAttribute("aria-expanded")||null!=(t.select("."+me,e)||t.select("."+fe,e)),h=null;return this.showCheckBox&&(h=t.select("."+Le,e).getAttribute("aria-checked")),{id:s,text:n,parentID:l,selected:o,expanded:a,isChecked:h,hasChildren:d}}return{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},o.prototype.getText=function(e,i){if(i){var s=this.getNodeObject(e.getAttribute("data-uid")),n=parseFloat(e.getAttribute("aria-level")),r=this.getFields(this.fields,n,1);return t.getValue(r.text,s)}return t.select("."+ge,e).textContent},o.prototype.getExpandEvent=function(e,i){var s=this.getNodeData(e);return{cancel:!1,isInteracted:!t.isNullOrUndefined(i),node:e,nodeData:s,event:i}},o.prototype.renderNodeTemplate=function(e,i,s){var n=this.nodeTemplateFn(e,this,"nodeTemplate"+s,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,i);n&&(n=Array.prototype.slice.call(n),t.append(n,i))},o.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},o.prototype.reRenderNodes=function(){this.updateListProp(this.fields),t.resetBlazorTemplate(this.element.id+"nodeTemplate","NodeTemplate"),t.Browser.isIE?(this.ulElement=this.element.querySelector(".e-list-parent.e-ul"),this.ulElement.parentElement.removeChild(this.ulElement)):this.element.innerHTML="",t.isNullOrUndefined(this.nodeTemplateFn)||this.clearTemplate(),this.setTouchClass(),this.setProperties({selectedNodes:[],checkedNodes:[],expandedNodes:[]},!0),this.checkedElement=[],this.isLoaded=!1,this.setDataBinding(!0)},o.prototype.setCssClass=function(e,i){t.isNullOrUndefined(e)||""===e||t.removeClass([this.element],e.split(" ")),t.isNullOrUndefined(i)||""===i||t.addClass([this.element],i.split(" "))},o.prototype.editingHandler=function(e){var i=e.target;if(!(!i||i.classList.contains(ue)||i.classList.contains(ye)||i.classList.contains(ve)||i.classList.contains(xe)||i.classList.contains("e-input")||i.classList.contains("e-input-group"))){var s=t.closest(i,"."+ve);this.createTextbox(s,e)}},o.prototype.createTextbox=function(e,i){var s=this,n=t.select(".e-tree-input",this.element);n&&n.blur();var r=t.select("."+ge,e);this.updateOldText(e);var o=this.createElement("input",{className:"e-tree-input",attrs:{value:this.oldText}}),a=this.getEditEvent(e,null,o.outerHTML);this.trigger("nodeEditing",a,function(i){if(!i.cancel){var n="width:"+(r.offsetWidth+5)+"px";t.addClass([e],"e-editing"),t.isNullOrUndefined(s.nodeTemplateFn)||s.destroyTemplate(e),r.innerHTML=a.innerHtml;var o=t.select(".e-tree-input",r);s.inputObj=l.Input.createInput({element:o,properties:{enableRtl:s.enableRtl}},s.createElement),s.inputObj.container.setAttribute("style",n),o.focus();var d=o;d.setSelectionRange(0,d.value.length),s.wireInputEvents(o)}})},o.prototype.updateOldText=function(e){var i=e.getAttribute("data-uid");this.editData=this.getNodeObject(i);var s=parseFloat(e.getAttribute("aria-level"));this.editFields=this.getFields(this.fields,s,1),this.oldText=t.getValue(this.editFields.text,this.editData)},o.prototype.inputFocusOut=function(e){if(t.select(".e-tree-input",this.element)){var i=e.target,s=i.value,n=t.closest(i,"."+ge),l=t.closest(i,"."+ve);t.detach(this.inputObj.container),this.fields.dataSource instanceof r.DataManager&&!this.isOffline&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName?this.crudOperation("update",null,l,s,null,null,!0):this.appendNewText(l,n,s,!0)}},o.prototype.appendNewText=function(e,t,i,s){var n=this,r=this.getEditEvent(e,i,null);this.trigger("nodeEdited",r,function(r){i=r.cancel?r.oldText:r.newText,n.updateText(e,t,i,s),r.oldText!==i&&n.triggerEvent()})},o.prototype.updateText=function(e,i,s,n){var r=t.setValue(this.editFields.text,s,this.editData);if(t.isNullOrUndefined(this.nodeTemplateFn))i.innerText=s;else{i.innerText="";var l=e.getAttribute("data-uid");this.renderNodeTemplate(r,i,l),this.updateBlazorTemplate(),this.renderReactTemplates()}n&&(t.removeClass([e],"e-editing"),i.focus())},o.prototype.getElement=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?this.element.querySelector('[data-uid="'+e+'"]'):"object"==typeof e?t.getElement(e):null},o.prototype.getId=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?e:"object"==typeof e?t.getElement(e).getAttribute("data-uid"):null},o.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},o.prototype.getNodeObject=function(e){if(!t.isNullOrUndefined(e)){if(1!==this.dataType)return this.getChildNodeObject(this.treeData,this.fields,e);for(var i=0,s=this.treeData.length;i<s;i++){var n=t.getValue(this.fields.id,this.treeData[i]);if(!t.isNullOrUndefined(this.treeData[i])&&!t.isNullOrUndefined(n)&&n.toString()===e)return this.treeData[i]}}},o.prototype.getChildNodeObject=function(e,i,s){var n;if(t.isNullOrUndefined(e))return n;for(var l=0,o=e.length;l<o;l++){var a=t.getValue(i.id,e[l]);if(e[l]&&a&&a.toString()===s)return e[l];if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[l]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[l]))){if(void 0!==(n=this.getChildNodeObject(t.getValue("child",e[l]),this.getChildMapper(i),s)))break}}else{var d=t.getValue(i.child,e[l]);if(void 0!==(n=this.getChildNodeObject(d,this.getChildMapper(i),s)))break}}return n},o.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},o.prototype.initializeDrag=function(){var e,i=this,s=this;this.dragObj=new t.Draggable(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+Oe,helper:function(n){i.dragTarget=n.sender.target;var r=t.closest(i.dragTarget,"."+ue),l=t.closest(i.dragTarget,"."+Oe);if(i.dragLi=t.closest(i.dragTarget,"."+ve),i.fullRowSelect&&!l&&i.dragTarget.classList.contains(Ie)&&(l=i.dragTarget.nextElementSibling),!i.dragTarget||!n.element.isSameNode(r)||!l||i.dragTarget.classList.contains(ue)||i.dragTarget.classList.contains(ye)||i.dragTarget.classList.contains(ve)||i.dragLi.classList.contains("e-disable"))return!1;var o=l.cloneNode(!0);if(t.isNullOrUndefined(t.select("div."+xe,o))){var a=s.createElement("div",{className:xe+" "+me});o.insertBefore(a,o.children[0])}var d="e-drag-item "+ue+" "+i.cssClass+" "+(i.enableRtl?"e-rtl":"");(e=s.createElement("div",{className:d})).appendChild(o);var h=i.selectedNodes.length;if(h>1&&i.allowMultiSelection&&i.dragLi.classList.contains(Ce)){var c=s.createElement("span",{className:"e-drop-count",innerHTML:""+h});e.appendChild(c)}return document.body.appendChild(e),document.body.style.cursor="",i.dragData=i.getNodeData(i.dragLi),e},dragStart:function(s){t.addClass([i.element],"e-dragging");var n,r=t.closest(s.target,".e-list-item");r&&(n=parseInt(r.getAttribute("aria-level"),10));var l=i.getDragEvent(s.event,i,null,s.target,null,e,n);l.draggedNode.classList.contains("e-editing")?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.trigger("nodeDragStart",l,function(n){n.cancel?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.dragStartAction=!0,t.isBlazor()&&s.bindEvents(t.getElement(s.dragElement))})},drag:function(s){i.dragObj.setProperties({cursorAt:{top:!t.isNullOrUndefined(s.event.targetTouches)||t.Browser.isDevice?60:-20}}),i.dragAction(s,e)},dragStop:function(e){t.removeClass([i.element],"e-dragging"),i.removeVirtualEle();var s=e.target,n=t.closest(s,".e-droppable"),r=!0;s&&n||(t.detach(e.helper),document.body.style.cursor="",r=!1);var l,o=t.closest(s,".e-list-item");o&&(l=parseInt(o.getAttribute("aria-level"),10));var a=i.getDragEvent(e.event,i,s,s,null,e.helper,l);a.preventTargetExpand=!1,(i.isBlazorPlatform&&i.dragStartAction||!i.isBlazorPlatform)&&i.trigger("nodeDragStop",a,function(s){i.dragParent=s.draggedParentNode,i.preventExpand=s.preventTargetExpand,s.cancel&&(e.helper.parentNode&&t.detach(e.helper),document.body.style.cursor="",r=!1),i.dragStartAction=!1,i.isBlazorPlatform&&r&&i.dropAction(e,!0)})}}),this.dropObj=new t.Droppable(this.element,{out:function(e){t.isNullOrUndefined(e)||e.target.classList.contains("e-sibling")||(document.body.style.cursor="not-allowed")},over:function(e){document.body.style.cursor=""},drop:function(e){i.isBlazorPlatform||i.dropAction(e)}})},o.prototype.dragCancelAction=function(e){t.detach(e),t.removeClass([this.element],"e-dragging"),this.dragStartAction=!1},o.prototype.dragAction=function(e,i){var s=t.closest(e.target,".e-droppable"),n=t.closest(e.target,"."+Oe),r=t.select("div."+xe,i);t.removeClass([r],[Se,we,"e-drop-out","e-no-drop"]),this.removeVirtualEle(),document.body.style.cursor="";var l=e.target.classList;if(this.fullRowSelect&&!n&&!t.isNullOrUndefined(l)&&l.contains(Ie)&&(n=e.target.nextElementSibling),s){var o=t.closest(e.target,"."+ve),a=t.closest(e.target,"."+Le),d=t.closest(e.target,"."+fe),h=t.closest(e.target,"."+me);if(!s.classList.contains(ue)||n&&!o.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,o))if(this.hasTemplate&&o){var c=t.select(this.fullRowSelect?"."+Ie:"."+Oe,o);if(e&&!h&&!d&&e.event.offsetY<7&&!a||h&&e.event.offsetY<5||d&&e.event.offsetX<3){p=this.fullRowSelect?1:0;this.appendIndicator(o,r,p)}else if(e&&!h&&!d&&!a&&c&&e.event.offsetY>c.offsetHeight-10||h&&e.event.offsetY>19||d&&e.event.offsetX>19){p=this.fullRowSelect?2:1;this.appendIndicator(o,r,p)}else t.addClass([r],Se)}else if(o&&e&&!h&&!d&&e.event.offsetY<7&&!a||h&&e.event.offsetY<5||d&&e.event.offsetX<3){p=this.fullRowSelect?1:0;this.appendIndicator(o,r,p)}else if(o&&e&&!h&&!d&&e.target.offsetHeight>0&&e.event.offsetY>e.target.offsetHeight-10&&!a||h&&e.event.offsetY>19||d&&e.event.offsetX>19){var p=this.fullRowSelect?2:1;this.appendIndicator(o,r,p)}else t.addClass([r],Se);else"LI"!==e.target.nodeName||o.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,o)?e.target.classList.contains("e-sibling")?t.addClass([r],we):t.addClass([r],"e-drop-out"):(t.addClass([r],we),this.renderVirtualEle(e))}else t.addClass([r],"e-no-drop"),document.body.style.cursor="not-allowed";var u,f=t.closest(e.target,".e-list-item");f&&(u=parseInt(f.getAttribute("aria-level"),10));var m=this.getDragEvent(e.event,this,e.target,e.target,null,i,u);m.dropIndicator&&t.removeClass([r],m.dropIndicator),this.trigger("nodeDragging",m),m.dropIndicator&&t.addClass([r],m.dropIndicator)},o.prototype.appendIndicator=function(e,i,s){t.addClass([i],we);var n=this.createElement("div",{className:"e-sibling"});e.insertBefore(n,e.children[s])},o.prototype.dropAction=function(e,i){var s,n,l,o=e.event.offsetY,d=e.target,h=!1;l=i?e.element:e.dragData.draggable;for(m=0;m<l.ej2_instances.length;m++)if(l.ej2_instances[m]instanceof a){s=l.ej2_instances[m];break}if(s&&s.dragTarget){var c=s.dragTarget,p=t.closest(c,"."+ve),u=t.closest(d,"."+ve);if(null==u&&d.classList.contains(ue)&&(u=d.firstElementChild),i?t.detach(e.helper):t.detach(e.droppedElement),document.body.style.cursor="",!u||u.isSameNode(p)||this.isDescendant(p,u))return void(this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1));if(s.allowMultiSelection&&p.classList.contains(Ce)){var f=t.selectAll("."+Ce,s.element);if(e.target.offsetHeight<=33&&o>e.target.offsetHeight-10&&o>6)for(m=f.length-1;m>=0;m--)u.isSameNode(f[m])||this.isDescendant(f[m],u)||this.appendNode(d,f[m],u,e,s,o);else for(var m=0;m<f.length;m++)u.isSameNode(f[m])||this.isDescendant(f[m],u)||this.appendNode(d,f[m],u,e,s,o)}else this.appendNode(d,p,u,e,s,o);n=parseInt(p.getAttribute("aria-level"),10),h=!0}this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1),i?this.trigger("nodeDropped",this.getDragEvent(e.event,s,d,e.target,e.element,null,n,h)):this.trigger("nodeDropped",this.getDragEvent(e.event,s,d,e.target,e.dragData.draggedElement,null,n,h)),s.element.id!==this.element.id&&s.triggerEvent(),this.triggerEvent()},o.prototype.appendNode=function(e,i,s,n,r,l){var o=t.closest(e,"."+Le),a=t.closest(n.target,"."+fe),d=t.closest(n.target,"."+me);i.classList.contains("e-disable")||o||!(d&&n.event.offsetY<5||a&&n.event.offsetX<3||d&&n.event.offsetY>19||a&&n.event.offsetX>19||!d&&!a)?this.dropAsChildNode(i,s,r,null,n,l,!0):"LI"===e.nodeName?this.dropAsSiblingNode(i,s,n,r):e.firstElementChild&&e.classList.contains(ue)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(i,s,n,r):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(i,s,n,r):this.dropAsChildNode(i,s,r,null,n,l)},o.prototype.dropAsSiblingNode=function(e,i,s,n){var r,l=t.closest(i,"."+ye),o=t.closest(e,"."+ye),a=t.closest(o,"."+ve);if(s.target.offsetHeight>0&&s.event.offsetY>s.target.offsetHeight-2?r=!1:s.event.offsetY<2?r=!0:(s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible"))&&(s.event.offsetY<5||s.event.offsetX<3?r=!0:(s.event.offsetY>15||s.event.offsetX>17)&&(r=!1)),s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible")){var d=s.target.closest("li");l.insertBefore(e,r?d:d.nextElementSibling)}else l.insertBefore(e,r?s.target:s.target.nextElementSibling);this.moveData(e,i,l,r,n),this.updateElement(o,a),this.updateAriaLevel(e),n.element.id===this.element.id?this.updateList():(n.updateInstance(),this.updateInstance())},o.prototype.dropAsChildNode=function(e,i,s,n,r,l,o){var a,d=t.closest(e,"."+ye),h=t.closest(d,"."+ve),c=t.closest(i,"."+ye);if(r&&r.target&&(a=t.select(this.fullRowSelect?"."+Ie:"."+Oe,i)),r&&l<7&&!o)c.insertBefore(e,i),this.moveData(e,i,c,!0,s);else if(r&&r.target.offsetHeight>0&&l>r.target.offsetHeight-10&&!o&&!this.hasTemplate)c.insertBefore(e,i.nextElementSibling),this.moveData(e,i,c,!1,s);else if(this.hasTemplate&&a&&l>a.offsetHeight-10&&!o)c.insertBefore(e,i.nextElementSibling),this.moveData(e,i,c,!1,s);else{var p=this.expandParent(i),u=p.childNodes[n];p.insertBefore(e,u),this.moveData(e,u,p,!0,s)}this.updateElement(d,h),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},o.prototype.moveData=function(e,i,s,n,r){var l=t.closest(s,"."+ve),o=this.getId(e),a=r.updateChildField(r.treeData,r.fields,o,null,null,!0),d=this.getId(i),h=this.getDataPos(this.treeData,this.fields,d),c=this.getId(l);if(1===this.dataType){this.updateField(this.treeData,this.fields,c,"hasChildren",!0);var p=t.isNullOrUndefined(h)?this.treeData.length:n?h:h+1;if(t.isNullOrUndefined(c)&&!this.hasPid)delete a[0][this.fields.parentID];else{var u=this.isNumberTypeId?parseFloat(c):c;t.setValue(this.fields.parentID,u,a[0])}if(this.treeData.splice(p,0,a[0]),r.element.id!==this.element.id){var f=r.removeChildNodes(o);p++;for(var m=0,v=f.length;m<v;m++)this.treeData.splice(p,0,f[m]),p++;r.groupedData=r.getGroupedData(r.treeData,r.fields.parentID)}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.addChildData(this.treeData,this.fields,c,a,n?h:h+1)},o.prototype.expandParent=function(e){var s=t.select("div."+xe,e);s&&s.classList.contains(me)&&!0!==this.preventExpand&&this.expandAction(e,s,null);var n=t.select("."+ye,e);if(!0===this.preventExpand&&!n&&s&&this.renderChildNodes(e),n=t.select("."+ye,e),t.isNullOrUndefined(n)||!0!==this.preventExpand||(n.style.display="none"),t.isNullOrUndefined(n)||!1!==this.preventExpand||(n.style.display="block"),t.isNullOrUndefined(n)&&!0===this.preventExpand&&(t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,me,this.listBaseOption),(r=t.select("div."+xe,e))&&r.classList.add("e-icon-expandable"),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),r?t.removeClass([r],fe):i.ListBase.generateIcon(this.createElement,e,me,this.listBaseOption),e.setAttribute("aria-expanded","false"),n.style.display="none"),t.isNullOrUndefined(n)){this.trigger("nodeExpanding",this.getExpandEvent(e,null)),t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,fe,this.listBaseOption);var r=t.select("div."+xe,e);r?t.removeClass([r],me):(i.ListBase.generateIcon(this.createElement,e,fe,this.listBaseOption),r=t.select("div."+xe,e),t.removeClass([r],me)),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))}return n},o.prototype.updateElement=function(e,i){if(i&&0===e.childElementCount){var s=t.select("div."+xe,i);t.detach(e),t.detach(s);var n=this.getId(i);this.updateField(this.treeData,this.fields,n,"hasChildren",!1),this.removeExpand(i,!0)}},o.prototype.updateAriaLevel=function(e){var i=this.parents(e,"."+ye).length;e.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+ye,e),i+1)},o.prototype.updateChildAriaLevel=function(e,i){if(!t.isNullOrUndefined(e))for(var s=e.childNodes,n=0,r=s.length;n<r;n++){var l=s[n];l.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+ye,l),i+1)}},o.prototype.renderVirtualEle=function(e){var t;e.event.offsetY>e.target.offsetHeight-2?t=!1:e.event.offsetY<2&&(t=!0);var i=this.createElement("div",{className:"e-sibling"}),s=this.fullRowSelect?t?1:2:t?0:1;e.target.insertBefore(i,e.target.children[s])},o.prototype.removeVirtualEle=function(){var e=t.select(".e-sibling");e&&t.detach(e)},o.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},o.prototype.getDragEvent=function(e,i,s,n,l,o,a,d){var h=s?t.closest(s,"."+ve):null,c=h?this.getNodeData(h):null,p=i?i.dragLi:l,u=i?i.dragData:null,f=s?this.parents(s,"."+ve):null,m=i.dragLi.parentElement,v=i.dragLi?t.closest(m,"."+ve):null,g=null,y=null,b=[we,Se,"e-drop-out","e-no-drop"],C=null,N=!0===d?p:h,E=N?t.closest(N,".e-list-parent"):null,x=0,O=null;if(v=i.dragLi&&null===v?t.closest(m,"."+ue):v,v=!0===d?this.dragParent:v,o)for(;x<4;){if(t.select("."+xe,o).classList.contains(b[x])){C=b[x];break}x++}if(E){var S=0;for(x=0;x<E.childElementCount;x++){if(S=!0!==d&&E.children[x]===p&&h!==p?++S:S,!0!==d&&E.children[x].classList.contains("e-hover")){y=e.offsetY>=23?x+1:x;break}if(E.children[x]===N){e.offsetY,y=x;break}}y=0!==S?--y:y,O="e-drop-in"==C?"Inside":e.offsetY<7?"Before":"After"}if(s&&(g=0===f.length?null:s.classList.contains(ve)?f[0]:f[1]),h===p&&(g=h),s&&n.offsetHeight<=33&&e.offsetY<n.offsetHeight-10&&e.offsetY>6&&(g=h,!0!==d)){a=++a;var w=g?t.select(".e-list-parent",g):null;if(y=w?w.children.length:0,!(this.fields.dataSource instanceof r.DataManager)&&null===w&&g){var I=g.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,g.getAttribute("data-uid").toString()):null;y=I?I.length:0}}return{cancel:!1,clonedNode:o,event:e,draggedNode:p,draggedNodeData:u,droppedNode:h,droppedNodeData:c,dropIndex:y,dropLevel:a,draggedParentNode:v,dropTarget:g,dropIndicator:C,target:n,position:O}},o.prototype.addFullRow=function(e){var i=this.liList.length;if(e)for(s=0;s<i;s++)this.createFullRow(this.liList[s]);else for(var s=0;s<i;s++){var n=t.select("."+Ie,this.liList[s]);t.detach(n)}},o.prototype.createFullRow=function(e){var t=this.createElement("div",{className:Ie});e.insertBefore(t,e.childNodes[0])},o.prototype.addMultiSelect=function(e){if(e)for(var i=0,s=n=t.selectAll('.e-list-item:not([aria-selected="true"])',this.element);i<s.length;i++)(o=s[i]).setAttribute("aria-selected","false");else for(var n=t.selectAll('.e-list-item[aria-selected="false"]',this.element),r=0,l=n;r<l.length;r++){var o=l[r];o.removeAttribute("aria-selected")}},o.prototype.collapseByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),r=0,l=n.length;r<l;r++){var o=n[r],a=t.select("."+fe,t.select("."+Oe,o));t.isNullOrUndefined(a)||this.collapseNode(o,a,null),this.collapseByLevel(t.select("."+ye,o),i-1,s)}},o.prototype.collapseAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+fe,this.element)),s=0,n=i.length;s<n;s++){var r=i[s],l=t.closest(r,"."+ve);this.collapseNode(l,r,null)}},o.prototype.expandByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),r=0,l=n.length;r<l;r++){var o=n[r],a=t.select("."+me,t.select("."+Oe,o));t.isNullOrUndefined(a)||this.expandAction(o,a,null),this.expandByLevel(t.select("."+ye,o),i-1,s)}},o.prototype.expandAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+me,this.element)),s=0,n=i.length;s<n;s++){var r=i[s],l=t.closest(r,"."+ve);this.expandAction(l,r,null,!0)}},o.prototype.getVisibleNodes=function(e,i){var s=Array.prototype.slice.call(i);if(e)for(var n=0;n<s.length;n++)t.isVisible(s[n])||(s.splice(n,1),n--);return s},o.prototype.removeNode=function(e){var i=t.closest(e,"."+ye),s=t.closest(i,"."+ve);t.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),t.detach(e),this.updateElement(i,s),this.updateInstance(),this.removeData(e)},o.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes(),this.allowServerDataBinding=!1,this.updateServerProperties("expand"),this.updateServerProperties("check"),this.updateServerProperties("select"),this.allowServerDataBinding=!0},o.prototype.updateServerProperties=function(e){this.isBlazorPlatform&&("expand"==e?(this.isBlazorExpandedNodes=this.expandedNodes,this.setProperties({expandedNodes:[]},!0)):"check"==e?this.setProperties({checkedNodes:this.checkedNodes},!0):this.setProperties({selectedNodes:this.selectedNodes},!0))},o.prototype.updateList=function(){this.liList=Array.prototype.slice.call(t.selectAll("."+ve,this.element))},o.prototype.updateSelectedNodes=function(){if(!this.isBlazorPlatform||this.isBlazorPlatform&&!this.initialRender){this.setProperties({selectedNodes:[]},!0);e=t.selectAll("."+Ce,this.element);this.selectGivenNodes(e)}else if(this.isBlazorPlatform&&this.initialRender)for(var e=t.selectAll("."+Ce,this.element),i=0;i<e.length;i++){var s=e[i].getAttribute("data-uid").toString();t.isNullOrUndefined(s)||-1!==this.selectedNodes.indexOf(s)||this.selectedNodes.push(s)}},o.prototype.updateExpandedNodes=function(){if(!this.isBlazorPlatform||this.isBlazorPlatform&&!this.initialRender){this.setProperties({expandedNodes:[]},!0);for(var e=0,i=(s=t.selectAll('[aria-expanded="true"]',this.element)).length;e<i;e++)this.addExpand(s[e])}else if(this.isBlazorPlatform&&this.initialRender)for(var s=t.selectAll('[aria-expanded="true"]',this.element),n=0;n<s.length;n++){var r=s[n].getAttribute("data-uid").toString();t.isNullOrUndefined(r)||-1!==this.expandedNodes.indexOf(r)||this.expandedNodes.push(r)}},o.prototype.removeData=function(e){if(1===this.dataType){var t=new r.DataManager(this.treeData),i=this.getId(e),s={},n=this.isNumberTypeId?parseFloat(i):i;s[this.fields.id]=n,t.remove(this.fields.id,s),this.removeChildNodes(i)}else{i=this.getId(e);this.updateChildField(this.treeData,this.fields,i,null,null,!0)}},o.prototype.removeChildNodes=function(e){var i=this.getChildGroup(this.groupedData,e,!1),s=[];if(i)for(var n=0,l=i.length;n<l;n++){var o=new r.DataManager(this.treeData),a=t.getValue(this.fields.id,i[n]).toString(),d={},h=this.isNumberTypeId?parseFloat(a):a;d[this.fields.id]=h;var c=o.remove(this.fields.id,d);s.push(c[0]),this.removeChildNodes(a)}return s},o.prototype.doGivenAction=function(e,i,s){for(var n=0,r=e.length;n<r;n++){var l=this.getElement(e[n]);if(!t.isNullOrUndefined(l)){var o=t.select("."+i,t.select("."+Oe,l));t.isNullOrUndefined(o)||(s?this.expandAction(l,o,null):this.collapseNode(l,o,null))}}},o.prototype.addGivenNodes=function(e,s,n,r,l){if(0!==e.length){var o=this.getSortedData(e),a=s?parseFloat(s.getAttribute("aria-level"))+1:1;r&&this.updateMapper(a);for(var d,h=i.ListBase.createListItemFromJson(this.createElement,o,this.listBaseOption,a),c=(d=l||(s?this.expandParent(s):t.select("."+ye,this.element))).childNodes[n],p=0;p<h.length;p++)d.insertBefore(h[p],c);this.nodeTemplate&&this.isBlazorPlatform&&!this.isStringTemplate&&this.updateBlazorTemplate();var u=this.getId(s);if(1===this.dataType){this.updateField(this.treeData,this.fields,u,"hasChildren",!0);for(var f=this.getId(c),m=t.isNullOrUndefined(f)?this.treeData.length:this.getDataPos(this.treeData,this.fields,f),v=0;v<e.length;v++){if(!t.isNullOrUndefined(u)){var g=this.isNumberTypeId?parseFloat(u):u;t.setValue(this.fields.parentID,g,e[v])}this.treeData.splice(m,0,e[v]),m++}}else this.addChildData(this.treeData,this.fields,u,e,n);this.finalizeNode(d)}},o.prototype.updateMapper=function(e){var t=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(t)},o.prototype.updateListProp=function(e){var t=this.getActualProperties(e);this.listBaseOption.fields=t,this.listBaseOption.fields.url=t.hasOwnProperty("navigateUrl")?t.navigateUrl:"navigateUrl"},o.prototype.getDataPos=function(e,i,s){for(var n=null,l=0,o=e.length;l<o;l++){var a=t.getValue(i.id,e[l]);if(e[l]&&a&&a.toString()===s)return l;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[l]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[l]))){var d=t.getValue("child",e[l]);if(null!==(n=this.getDataPos(d,this.getChildMapper(i),s)))break}}else{var h=t.getValue(i.child,e[l]);if(null!==(n=this.getDataPos(h,this.getChildMapper(i),s)))break}}return n},o.prototype.addChildData=function(e,i,s,n,l){var o;if(t.isNullOrUndefined(s)){l=t.isNullOrUndefined(l)?e.length:l;for(var a=0,d=n.length;a<d;a++)e.splice(l,0,n[a]),l++;return o}for(var h=0,c=e.length;h<c;h++){var p=t.getValue(i.id,e[h]);if(e[h]&&p&&p.toString()===s){if("string"==typeof i.child&&e[h].hasOwnProperty(i.child)&&null!==e[h][i.child]||this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName&&e[h].hasOwnProperty("child")){var u="string"==typeof i.child?i.child:"child",f=t.getValue(u,e[h]);t.isNullOrUndefined(f)&&(f=[]),l=t.isNullOrUndefined(l)?f.length:l;for(var a=0,d=n.length;a<d;a++)f.splice(l,0,n[a]),l++}else{u="string"==typeof i.child?i.child:"child";e[h][u]=n}return!0}if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[h]))){if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName&&!t.isNullOrUndefined(t.getValue("child",e[h]))){f=t.getValue("child",e[h]);if(void 0!==(o=this.addChildData(f,this.getChildMapper(i),s,n,l)))break}}else{var m=t.getValue(i.child,e[h]);if(void 0!==(o=this.addChildData(m,this.getChildMapper(i),s,n,l)))break}}return o},o.prototype.doDisableAction=function(e){var i=this.nodeType(e),s=this.checkValidId(i);this.validArr=[];for(var n=0,r=s.length;n<r;n++){var l=s[n][this.fields.id].toString();l&&-1===this.disableNode.indexOf(l)&&this.disableNode.push(l);var o=this.getElement(l);o&&(o.setAttribute("aria-disabled","true"),t.addClass([o],"e-disable"))}},o.prototype.doEnableAction=function(e){for(var i=this.nodeType(e),s=0,n=i.length;s<n;s++){var r=this.getElement(i[s]),l=i[s];l&&-1!==this.disableNode.indexOf(l)&&this.disableNode.splice(this.disableNode.indexOf(l),1),r&&(r.removeAttribute("aria-disabled"),t.removeClass([r],"e-disable"))}},o.prototype.nodeType=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=void 0;"string"==typeof e[i]?n=e[i]?e[i].toString():null:"object"==typeof e[i]&&(n=e[i]?e[i].getAttribute("data-uid").toString():null),-1==t.indexOf(n)&&t.push(n)}return t},o.prototype.checkValidId=function(e){var i=this;if(1===this.dataType)this.validArr=this.treeData.filter(function(t){return-1!==e.indexOf(t[i.fields.id]?t[i.fields.id].toString():null)});else if(2===this.dataType)for(var s=0;s<this.treeData.length;s++){var n=this.treeData[s][this.fields.id]?this.treeData[s][this.fields.id].toString():null;-1!==e.indexOf(n)&&this.validArr.push(this.treeData[s]);var r=t.getValue(this.fields.child.toString(),this.treeData[s]);r&&this.filterNestedChild(r,e)}return this.validArr},o.prototype.filterNestedChild=function(e,i){for(var s=0;s<e.length;s++){var n=e[s][this.fields.id]?e[s][this.fields.id].toString():null;-1!==i.indexOf(n)&&this.validArr.push(e[s]);var r=t.getValue(this.fields.child.toString(),e[s]);r&&this.filterNestedChild(r,i)}},o.prototype.setTouchClass=function(){var e=t.closest(this.element,".e-bigger");this.touchClass=t.isNullOrUndefined(e)?"":"e-small"},o.prototype.updatePersistProp=function(){this.removeField(this.treeData,this.fields,["selected","expanded"]);for(var e=this.selectedNodes,t=0,i=e.length;t<i;t++)this.updateField(this.treeData,this.fields,e[t],"selected",!0);var s=this.expandedNodes;this.isBlazorPlatform&&(s=this.isBlazorExpandedNodes);for(var n=0,r=s.length;n<r;n++)this.updateField(this.treeData,this.fields,s[n],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);for(var l=this.checkedNodes,o=0,r=l.length;o<r;o++)this.updateField(this.treeData,this.fields,l[o],"isChecked",!0)}},o.prototype.removeField=function(e,i,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i))for(var n=0,l=e.length;n<l;n++){for(var o=0;o<s.length;o++){var a=this.getMapperProp(i,s[o]);t.isNullOrUndefined(e[n][a])||delete e[n][a]}"string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[n]))?this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[n]))&&this.removeField(t.getValue("child",e[n]),this.getChildMapper(i),s):this.removeField(t.getValue(i.child,e[n]),this.getChildMapper(i),s)}},o.prototype.getMapperProp=function(e,i){switch(i){case"selected":return t.isNullOrUndefined(e.selected)?"selected":e.selected;case"expanded":return t.isNullOrUndefined(e.expanded)?"expanded":e.expanded;case"isChecked":return t.isNullOrUndefined(e.isChecked)?"isChecked":e.isChecked;case"hasChildren":return t.isNullOrUndefined(e.hasChildren)?"hasChildren":e.hasChildren;default:return i}},o.prototype.updateField=function(e,i,s,n,l){if(!t.isNullOrUndefined(s))if(1===this.dataType){var o=this.isNumberTypeId?parseFloat(s):s,a=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.id,"equal",o,!1));t.setValue(this.getMapperProp(i,n),l,a[0])}else this.updateChildField(e,i,s,n,l)},o.prototype.updateChildField=function(e,i,s,n,l,o){var a;if(t.isNullOrUndefined(e))return a;for(var d=0,h=e.length;d<h;d++){var c=t.getValue(i.id,e[d]);if(e[d]&&c&&c.toString()===s)return o?a=e.splice(d,1):(t.setValue(this.getMapperProp(i,n),l,e[d]),a=[]),a;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[d]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[d]))){var p=t.getValue("child",e[d]);if(void 0!==(a=this.updateChildField(p,this.getChildMapper(i),s,n,l,o)))break}}else{var u=t.getValue(i.child,e[d]);if(void 0!==(a=this.updateChildField(u,this.getChildMapper(i),s,n,l,o)))break}}return a},o.prototype.triggerEvent=function(){this.updateTemplateForBlazor(),this.renderReactTemplates();var e={data:this.treeData};this.trigger("dataSourceChanged",e)},o.prototype.updateBlazorTemplate=function(){t.updateBlazorTemplate(this.element.id+"nodeTemplate","NodeTemplate",this,!1)},o.prototype.clientUpdateInitial=function(){this.blazorInitialRender=!0},o.prototype.wireInputEvents=function(e){t.EventHandler.add(e,"blur",this.inputFocusOut,this)},o.prototype.wireEditingEvents=function(e){var i=this;if(e&&!this.disabled){var s=this;this.touchEditObj=new t.Touch(this.element,{tap:function(e){i.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),s.editingHandler(e.originalEvent))}})}else this.touchEditObj&&this.touchEditObj.destroy()},o.prototype.wireClickEvent=function(e){if(e){var i=this;this.touchClickObj=new t.Touch(this.element,{tap:function(e){i.clickHandler(e)}})}else this.touchClickObj&&this.touchClickObj.destroy()},o.prototype.wireExpandOnEvent=function(e){var i=this;if(e){var s=this;this.touchExpandObj=new t.Touch(this.element,{tap:function(e){("Click"===i.expandOnType||"DblClick"===i.expandOnType&&i.isDoubleTapped(e)&&2===e.tapCount)&&3!==e.originalEvent.which&&s.expandHandler(e)}})}else this.touchExpandObj&&this.touchExpandObj.destroy()},o.prototype.mouseDownHandler=function(e){this.mouseDownStatus=!0,(e.shiftKey||e.ctrlKey)&&e.preventDefault(),e.ctrlKey&&this.allowMultiSelection&&t.EventHandler.add(this.element,"contextmenu",this.preventContextMenu,this)},o.prototype.preventContextMenu=function(e){e.preventDefault()},o.prototype.wireEvents=function(){t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),this.wireClickEvent(!0),"None"!==this.expandOnType&&this.wireExpandOnEvent(!0),t.EventHandler.add(this.element,"focus",this.focusIn,this),t.EventHandler.add(this.element,"blur",this.focusOut,this),t.EventHandler.add(this.element,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.element,"mouseout",this.onMouseLeave,this),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},o.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),t.EventHandler.remove(this.element,"focus",this.focusIn),t.EventHandler.remove(this.element,"blur",this.focusOut),t.EventHandler.remove(this.element,"mouseover",this.onMouseOver),t.EventHandler.remove(this.element,"mouseout",this.onMouseLeave),this.disabled||this.keyboardModule.destroy()},o.prototype.parents=function(e,i){for(var s=[],n=e.parentNode;!t.isNullOrUndefined(n);)t.matches(n,i)&&s.push(n),n=n.parentNode;return s},o.prototype.isDoubleTapped=function(e){var i,s=e.originalEvent.target;return s&&e.tapCount&&(1===e.tapCount?this.firstTap=t.closest(s,"."+ve):2===e.tapCount&&(i=t.closest(s,"."+ve))),this.firstTap===i},o.prototype.isDescendant=function(e,i){for(var s=i.parentNode;!t.isNullOrUndefined(s);){if(s===e)return!0;s=s.parentNode}return!1},o.prototype.showSpinner=function(e){t.addClass([e],Ne),s.createSpinner({target:e,width:t.Browser.isDevice?16:14},this.createElement),s.showSpinner(e)},o.prototype.hideSpinner=function(e){s.hideSpinner(e),e.innerHTML="",t.removeClass([e],Ne)},o.prototype.setCheckedNodes=function(e){e=JSON.parse(JSON.stringify(e)),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),e.length>0&&this.checkAll(e)},o.prototype.setValidCheckedNode=function(e){if(1===this.dataType){var i=this.fields,s=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.id,"equal",e,!0));if(s[0]&&(this.setChildCheckState(s,e,s[0]),this.autoCheck)){for(var n=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null,l=this.getChildNodes(this.treeData,n),o=0,a=0;a<l.length;a++){var d=l[a][this.fields.id].toString();-1!==this.checkedNodes.indexOf(d)&&o++}o===l.length&&-1===this.checkedNodes.indexOf(n)&&n&&this.checkedNodes.push(n)}}else if(2===this.dataType)for(var h=0;h<this.treeData.length;h++){if((this.treeData[h][this.fields.id]?this.treeData[h][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkedNodes.push(e);break}var c=t.getValue(this.fields.child.toString(),this.treeData[h]);c&&this.setChildCheckState(c,e,this.treeData[h])}},o.prototype.setChildCheckState=function(e,i,s){var n,r=0;if(1===this.dataType){s&&(n=s[this.fields.id]?s[this.fields.id].toString():null);for(o=0;o<e.length;o++){var l=e[o][this.fields.id]?e[o][this.fields.id].toString():null;s&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(l)&&this.checkedNodes.push(l),l===i&&-1===this.checkedNodes.indexOf(i)&&this.checkedNodes.push(i),(d=this.getChildNodes(this.treeData,l))&&this.setChildCheckState(d,i,s)}}else{s&&(n=s[this.fields.id]?s[this.fields.id].toString():"");for(var o=0;o<e.length;o++){var a=e[o][this.fields.id]?e[o][this.fields.id].toString():"";s&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(a)&&this.checkedNodes.push(a),a===i&&-1===this.checkedNodes.indexOf(i)&&this.checkedNodes.push(i);var d=t.getValue(this.fields.child.toString(),e[o]);d&&this.setChildCheckState(d,i,e[o]),-1!==this.checkedNodes.indexOf(a)&&this.autoCheck&&r++,r===e.length&&-1===this.checkedNodes.indexOf(n)&&this.autoCheck&&this.checkedNodes.push(n)}}},o.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[t])},o.prototype.updatePosition=function(e,t,i,s){if(1===this.dataType){var n=this.getDataPos(this.treeData,this.fields,e);if(this.treeData.splice(n,1,t),i){this.removeChildNodes(e);for(var r=0;r<s.length;r++)this.treeData.splice(n,0,s[r]),n++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},o.prototype.updateChildPosition=function(e,i,s,n,l){for(var o,a=0,d=e.length;a<d;a++){var h=t.getValue(i.id,e[a]);if(e[a]&&h&&h.toString()===s)return e[a]=n[0],!0;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[a]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[a]))){var c=t.getValue("child",e[a]);if(void 0!==(o=this.updateChildPosition(c,this.getChildMapper(i),s,n,l)))break}}else{var p=t.getValue(i.child,e[a]);if(void 0!==(o=this.updateChildPosition(p,this.getChildMapper(i),s,n,l)))break}}return o},o.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},o.prototype.crudOperation=function(e,i,s,n,r,l,o){var a,d=this,h=this.fields.dataSource,c=[],p=this.getQuery(this.fields),u=this.fields.id,f={addedRecords:[],deletedRecords:[],changedRecords:[]},m=[];i?m=this.nodeType(i):s&&("string"==typeof s?m[0]=s.toString():"object"==typeof s&&(m[0]=s.getAttribute("data-uid").toString()));for(var v=0,g=m.length;v<g;v++){var y=this.getElement(m[v]);if(!t.isNullOrUndefined(y)){var b=this.getNodeObject(m[v]);c.push(b)}}switch(e){case"delete":1==i.length?a=h.remove(u,c[0],p.fromTable,p):(f.deletedRecords=c,a=h.saveChanges(f,u,p.fromTable,p)),a.then(function(e){return d.deleteSuccess(m)}).catch(function(e){return d.dmFailure(e)});break;case"update":c[0][this.fields.text]=n,(a=h.update(u,c[0],p.fromTable,p)).then(function(e){return d.editSucess(s,n,o)}).catch(function(e){return d.dmFailure(e,s,o)});break;case"insert":if(1==r.length)a=h.insert(r[0],p.fromTable,p);else{for(var C=[],v=0,g=r.length;v<g;v++)C.push(r[v]);f.addedRecords=C,a=h.saveChanges(f,u,p.fromTable,p)}a.then(function(e){var t=d.getElement(s);d.addSuccess(r,t,l),d.preventExpand=!1}).catch(function(e){return d.dmFailure(e)})}},o.prototype.deleteSuccess=function(e){for(var i=0,s=e.length;i<s;i++){var n=this.getElement(e[i]);t.isNullOrUndefined(n)||this.removeNode(n)}1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.triggerEvent()},o.prototype.editSucess=function(e,i,s){var n=this.getElement(e),r=t.select("."+ge,n);this.appendNewText(n,r,i,s)},o.prototype.addSuccess=function(e,t,i){var s,n=t?t.querySelector("."+xe):null,r=this;t&&n&&n.classList.contains(me)&&null===t.querySelector("."+ye)?r.renderChildNodes(t,null,function(){s=t.querySelector("."+ye),r.addGivenNodes(e,t,i,!0,s),r.triggerEvent()}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent())},o.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},o.prototype.updatePreviousText=function(e,i){var s=this.getElement(e),n=t.select("."+ge,s);this.updateText(s,n,this.oldText,i)},o.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"allowDragAndDrop":this.setDragAndDrop(this.allowDragAndDrop);break;case"dragArea":this.allowDragAndDrop&&(this.dragObj.dragArea=this.dragArea);break;case"allowEditing":this.wireEditingEvents(this.allowEditing);break;case"allowMultiSelection":if(this.selectedNodes.length>1){var r=this.getElement(this.selectedNodes[0]);this.isLoaded=!1,this.removeSelectAll(),this.selectNode(r,null),this.isLoaded=!0}this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);break;case"checkedNodes":this.showCheckBox&&(this.checkedNodes=i.checkedNodes,this.setCheckedNodes(e.checkedNodes));break;case"autoCheck":this.showCheckBox&&(this.autoCheck=e.autoCheck,this.ensureIndeterminate());break;case"cssClass":this.setCssClass(i.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"expandedNodes":this.isAnimate=!1,this.isBlazorPlatform||this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.isBlazorPlatform||this.setProperties({expandedNodes:t.isNullOrUndefined(e.expandedNodes)?[]:e.expandedNodes},!0),this.doExpandAction(),this.isInitalExpand=!1,this.isAnimate=!0;break;case"expandOn":this.wireExpandOnEvent(!1),this.setExpandOnType(),"None"===this.expandOnType||this.disabled||this.wireExpandOnEvent(!0);break;case"disabled":this.setDisabledMode(),this.dynamicState();break;case"fields":this.isAnimate=!1,this.isFieldChange=!0,this.initialRender=!0,this.blazorInitialRender||this.reRenderNodes(),this.blazorInitialRender=!1,this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect);break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var l=this.element.querySelectorAll("li"),o=0;o<l.length;)"true"!==l[o].getAttribute("aria-expanded")&&this.renderChildNodes(l[o],!0,null,!0),o++;this.onLoaded=!0}break;case"nodeTemplate":this.hasTemplate=!1,this.nodeTemplateFn=this.templateComplier(this.nodeTemplate),this.reRenderNodes();break;case"selectedNodes":this.removeSelectAll(),this.setProperties({selectedNodes:e.selectedNodes},!0),this.doSelectionAction();break;case"showCheckBox":case"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes()}},o.prototype.destroy=function(){t.resetBlazorTemplate(this.element.id+"nodeTemplate","NodeTemplate"),this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.element.removeAttribute("tabindex"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.isBlazorPlatform&&(this.ulElement=this.element.querySelector(".e-list-parent.e-ul")),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),this.isBlazorPlatform||e.prototype.destroy.call(this)},o.prototype.addNodes=function(e,i,s,n){if(!t.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var l=this.getElement(i);if(this.preventExpand=n,this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName)this.isOffline?this.addSuccess(e,l,s):this.crudOperation("insert",null,i,null,e,s,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,l,s);else{if(l)this.addGivenNodes(e,l,s);else{e=this.getSortedData(e);for(var o=0;o<e.length;o++){var a=t.getValue(this.fields.parentID,e[o]);l=a?this.getElement(a.toString()):a,this.addGivenNodes([e[o]],l,s)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}this.updateCheckedStateFromDS(),this.showCheckBox&&l&&this.ensureParentCheckState(l),(this.fields.dataSource instanceof r.DataManager==!1||this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"===this.fields.dataSource.adaptorName)&&(this.preventExpand=!1,this.triggerEvent())}},o.prototype.beginEdit=function(e){var i=this.getElement(e);t.isNullOrUndefined(i)||this.disabled||this.createTextbox(i,null)},o.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},o.prototype.collapseAll=function(e,i,s){t.isNullOrUndefined(e)?i>0?this.collapseByLevel(t.select("."+ye,this.element),i,s):this.collapseAllNodes(s):this.doGivenAction(e,fe,!1)},o.prototype.disableNodes=function(e){t.isNullOrUndefined(e)||this.doDisableAction(e)},o.prototype.enableNodes=function(e){t.isNullOrUndefined(e)||this.doEnableAction(e)},o.prototype.ensureVisible=function(e){var i=this.getElement(e);if(!t.isNullOrUndefined(i)){var s=this.parents(i,"."+ve);this.expandAll(s),setTimeout(function(){i.scrollIntoView(!0)},450)}},o.prototype.expandAll=function(e,i,s){t.isNullOrUndefined(e)?i>0?this.expandByLevel(t.select("."+ye,this.element),i,s):this.expandAllNodes(s):this.doGivenAction(e,me,!0)},o.prototype.getAllCheckedNodes=function(){return this.checkedNodes},o.prototype.getDisabledNodes=function(){return this.disableNode},o.prototype.getNode=function(e){var t=this.getElement(e);return this.getNodeData(t,!0)},o.prototype.getTreeData=function(e){var i=this.getId(e);if(this.updatePersistProp(),t.isNullOrUndefined(i))return this.treeData;var s=this.getNodeObject(i);return t.isNullOrUndefined(s)?[]:[s]},o.prototype.moveNodes=function(e,i,s,n){var l=this.getElement(i);if(!t.isNullOrUndefined(l)){for(var o=0;o<e.length;o++){var a=this.getElement(e[o]);t.isNullOrUndefined(a)||l.isSameNode(a)||this.isDescendant(a,l)||(this.preventExpand=n,this.dropAsChildNode(a,l,this,s))}this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent()}},o.prototype.refreshNode=function(e,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(s)){var n,r=!1;if(1==this.dataType&&s.length>1)r=!0;else if(2==this.dataType&&1===s.length){var l=t.getValue(this.fields.child.toString(),s[0]);t.isNullOrUndefined(l)||(r=!0)}var o=this.getElement(e);n=o?o.getAttribute("data-uid"):e?e.toString():null,this.refreshData=this.getNodeObject(n),s=JSON.parse(JSON.stringify(s));var a,d;if(1==this.dataType&&r){for(var h=0;h<s.length;h++)if(t.isNullOrUndefined(s[h][this.fields.parentID])){d=s[h],s.splice(h,1);break}a=t.extend({},this.refreshData,d)}else a=t.extend({},this.refreshData,s[0]);if(t.isNullOrUndefined(o))return void this.updatePosition(n,a,r,s);this.isRefreshed=!0;var c=parseFloat(o.getAttribute("aria-level")),p=i.ListBase.createListItemFromJson(this.createElement,[a],this.listBaseOption,c),u=t.select("."+ye,o),f=t.getValue(this.fields.child.toString(),a);if(r&&u||r&&!t.isNullOrUndefined(f)){var m=o.parentElement,v=Array.prototype.indexOf.call(m.childNodes,o);t.remove(o),m.insertBefore(p[0],m.childNodes[v]),this.updatePosition(n,a,r,s),r&&u&&this.expandAll([n])}else{var g=t.select("."+Oe,o),y=t.select("."+Oe,p[0]),b=t.select("div."+xe,g),C=t.select("div."+xe,y);b&&C&&(C.classList.contains(me)&&b.classList.contains(fe)?(t.removeClass([C],me),t.addClass([C],fe)):C.classList.contains(fe)&&b.classList.contains(me)?(t.removeClass([C],fe),t.addClass([C],me)):b.classList.contains("interaction")&&t.addClass([C],"interaction")),t.remove(g);var N=t.select("."+Ie,o);N.parentNode.insertBefore(y,N.nextSibling),this.updatePosition(n,a,r,s)}if(o=this.getElement(e),a[this.fields.tooltip]&&o.setAttribute("title",a[this.fields.tooltip]),a.hasOwnProperty(this.fields.htmlAttributes)&&a[this.fields.htmlAttributes]){var E={};t.merge(E,a[this.fields.htmlAttributes]),E.class?(t.addClass([o],E.class.split(" ")),delete E.class):t.attributes(o,E)}-1!==this.selectedNodes.indexOf(n)&&(o.setAttribute("aria-selected","true"),t.addClass([o],Ce)),this.isRefreshed=!1,this.triggerEvent()}},o.prototype.removeNodes=function(e){t.isNullOrUndefined(e)||(this.fields.dataSource instanceof r.DataManager&&!this.isOffline&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName?this.crudOperation("delete",e):this.deleteSuccess(e))},o.prototype.updateNode=function(e,i){var s=this;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)&&this.allowEditing){var n=this.getElement(e);if(!t.isNullOrUndefined(n)){var l=t.select("."+ge,n);this.updateOldText(n);var o=this.getEditEvent(n,null,null);this.trigger("nodeEditing",o,function(t){t.cancel||(s.fields.dataSource instanceof r.DataManager&&!s.isOffline&&"BlazorAdaptor"!==s.fields.dataSource.adaptorName?s.crudOperation("update",null,e,i,null,null,!1):s.appendNewText(n,l,i,!1))})}}},o.prototype.uncheckAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!1)};var a;return pe([t.Property(!1)],o.prototype,"allowDragAndDrop",void 0),pe([t.Property(!1)],o.prototype,"allowEditing",void 0),pe([t.Property(!1)],o.prototype,"allowMultiSelection",void 0),pe([t.Complex({},Me)],o.prototype,"animation",void 0),pe([t.Property()],o.prototype,"checkedNodes",void 0),pe([t.Property("")],o.prototype,"cssClass",void 0),pe([t.Property(!1)],o.prototype,"disabled",void 0),pe([t.Property(null)],o.prototype,"dragArea",void 0),pe([t.Property(!1)],o.prototype,"enableHtmlSanitizer",void 0),pe([t.Property(!1)],o.prototype,"enablePersistence",void 0),pe([t.Property()],o.prototype,"expandedNodes",void 0),pe([t.Property("Auto")],o.prototype,"expandOn",void 0),pe([t.Complex({},Pe)],o.prototype,"fields",void 0),pe([t.Property(!0)],o.prototype,"fullRowSelect",void 0),pe([t.Property(!0)],o.prototype,"loadOnDemand",void 0),pe([t.Property()],o.prototype,"locale",void 0),pe([t.Property()],o.prototype,"nodeTemplate",void 0),pe([t.Property()],o.prototype,"selectedNodes",void 0),pe([t.Property("None")],o.prototype,"sortOrder",void 0),pe([t.Property(!1)],o.prototype,"showCheckBox",void 0),pe([t.Property(!0)],o.prototype,"autoCheck",void 0),pe([t.Property(!1)],o.prototype,"fullRowNavigable",void 0),pe([t.Event()],o.prototype,"actionFailure",void 0),pe([t.Event()],o.prototype,"created",void 0),pe([t.Event()],o.prototype,"dataBound",void 0),pe([t.Event()],o.prototype,"dataSourceChanged",void 0),pe([t.Event()],o.prototype,"drawNode",void 0),pe([t.Event()],o.prototype,"destroyed",void 0),pe([t.Event()],o.prototype,"keyPress",void 0),pe([t.Event()],o.prototype,"nodeChecked",void 0),pe([t.Event()],o.prototype,"nodeChecking",void 0),pe([t.Event()],o.prototype,"nodeClicked",void 0),pe([t.Event()],o.prototype,"nodeCollapsed",void 0),pe([t.Event()],o.prototype,"nodeCollapsing",void 0),pe([t.Event()],o.prototype,"nodeDragging",void 0),pe([t.Event()],o.prototype,"nodeDragStart",void 0),pe([t.Event()],o.prototype,"nodeDragStop",void 0),pe([t.Event()],o.prototype,"nodeDropped",void 0),pe([t.Event()],o.prototype,"nodeEdited",void 0),pe([t.Event()],o.prototype,"nodeEditing",void 0),pe([t.Event()],o.prototype,"nodeExpanded",void 0),pe([t.Event()],o.prototype,"nodeExpanding",void 0),pe([t.Event()],o.prototype,"nodeSelected",void 0),pe([t.Event()],o.prototype,"nodeSelecting",void 0),o=a=pe([t.NotifyPropertyChanges],o)}(t.Component),He=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Be=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},Re="e-close",je="e-open",qe="e-right",Fe="e-left",ze="e-over",Ve="e-push",We="e-sidebar-context",_e=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.isBlazor=!1,s}return He(i,e),i.prototype.preRender=function(){this.isBlazor=t.isBlazor()&&this.isServerRendered,this.isBlazor||this.setWidth()},i.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){this.setTarget(),this.addClass(),this.isBlazor||this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?this.show():this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.isBlazor||this.setEnableRTL(),t.Browser.isDevice&&(this.windowWidth=window.innerWidth)},i.prototype.setEnableRTL=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},i.prototype.setTarget=function(){this.targetEle=this.element.nextElementSibling,this.sidebarEleCopy=this.element.cloneNode(!0),"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),this.target&&(this.target.insertBefore(this.element,this.target.children[0]),t.addClass([this.element],"e-sidebar-absolute"),t.addClass([this.target],We),this.targetEle=this.getTargetElement())},i.prototype.getTargetElement=function(){for(var e=this.element.nextElementSibling;!t.isNullOrUndefined(e)&&e.classList.contains("e-sidebar");)e=e.nextElementSibling;return e},i.prototype.setCloseOnDocumentClick=function(){this.closeOnDocumentClick?t.EventHandler.add(document,"mousedown touchstart",this.documentclickHandler,this):t.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler)},i.prototype.setWidth=function(){this.enableDock&&"Left"===this.position?t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock&&"Right"===this.position?t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock||t.setStyleAttribute(this.element,{width:this.setDimension(this.width)})},i.prototype.setDimension=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:t.formatUnit(e):"100%"},i.prototype.setZindex=function(){t.setStyleAttribute(this.element,{"z-index":""+this.zIndex})},i.prototype.addClass=function(){var e=document.querySelector(".e-main-content");t.isNullOrUndefined(e||this.targetEle)||t.addClass([e||this.targetEle],["e-content-animation"]),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.isBlazor||(this.enableDock||"Auto"===this.type||t.addClass([this.element],["e-visibility"]),t.removeClass([this.element],[je,Re,qe,Fe,"e-slide",Ve,ze]),this.element.classList.add("e-sidebar"),t.addClass([this.element],"Right"===this.position?qe:Fe),this.enableDock&&t.addClass([this.element],"e-dock"),this.element.setAttribute("tabindex",this.tabIndex)),"Auto"!==this.type||t.Browser.isDevice?this.isOpen||t.addClass([this.element],Re):this.show()},i.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(Re)||e||this.hide()},i.prototype.transitionEnd=function(e){this.setDock(),t.isNullOrUndefined(e)||this.triggerChange(),t.EventHandler.remove(this.element,"transitionend",this.transitionEnd)},i.prototype.destroyBackDrop=function(){var e=document.querySelector(".e-main-content")||this.targetEle;this.target&&this.showBackdrop&&e?t.removeClass([e],"e-backdrop"):this.showBackdrop&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},i.prototype.hide=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};t.isBlazor()&&delete s.model,this.trigger("close",s,function(e){if(!e.cancel){if(i.element.classList.contains(Re))return;i.element.classList.contains(je)&&!i.animate&&i.triggerChange(),t.addClass([i.element],Re),t.removeClass([i.element],je),t.setStyleAttribute(i.element,{width:t.formatUnit(i.enableDock?i.dockSize:i.width)}),i.setType(i.type);var s=document.querySelector(".e-main-content")||i.targetEle;!i.enableDock&&s&&(s.style.transform="translateX(0px)",s.style["Left"===i.position?"marginLeft":"marginRight"]="0px"),i.destroyBackDrop(),i.setAnimation(),"Slide"===i.type&&document.body.classList.remove("e-sidebar-overflow"),i.setProperties({isOpen:!1},!0),i.enableDock&&setTimeout(function(){return i.setTimeOut()},50),t.EventHandler.add(i.element,"transitionend",i.transitionEnd,i)}})},i.prototype.setTimeOut=function(){var e=document.querySelector(".e-main-content")||this.targetEle,t=this.element.getBoundingClientRect().width;this.element.classList.contains(je)&&e?"Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.width?t:this.width):e.style.marginRight=this.setDimension("auto"===this.width?t:this.width):this.element.classList.contains(Re)&&e&&("Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.dockSize?t:this.dockSize):e.style.marginRight=this.setDimension("auto"===this.dockSize?t:this.dockSize))},i.prototype.show=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};t.isBlazor()&&delete s.model,this.trigger("open",s,function(e){if(!e.cancel){if(t.removeClass([i.element],"e-visibility"),i.element.classList.contains(je))return;i.element.classList.contains(Re)&&!i.animate&&i.triggerChange(),t.addClass([i.element],[je,"e-transition"]),t.setStyleAttribute(i.element,{transform:""}),t.removeClass([i.element],Re),t.setStyleAttribute(i.element,{width:t.formatUnit(i.width)}),i.setType(i.type),i.createBackDrop(),i.setAnimation(),"Slide"===i.type&&document.body.classList.add("e-sidebar-overflow"),i.setProperties({isOpen:!0},!0),t.EventHandler.add(i.element,"transitionend",i.transitionEnd,i)}})},i.prototype.setAnimation=function(){this.animate?t.removeClass([this.element],"e-disable-animation"):t.addClass([this.element],"e-disable-animation")},i.prototype.triggerChange=function(){var e={name:"change",element:this.element};this.trigger("change",e)},i.prototype.setDock=function(){this.enableDock&&"Left"===this.position&&!this.getState()?t.setStyleAttribute(this.element,{transform:"translateX(-100%) translateX("+this.setDimension(this.dockSize)+")"}):this.enableDock&&"Right"===this.position&&!this.getState()&&t.setStyleAttribute(this.element,{transform:"translateX(100%) translateX(-"+this.setDimension(this.dockSize)+")"}),this.element.classList.contains(Re)&&this.enableDock&&t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)})},i.prototype.createBackDrop=function(){if(this.target&&this.showBackdrop&&this.getState()){var e=document.querySelector(".e-main-content")||this.targetEle;t.addClass([e],"e-backdrop")}else this.showBackdrop&&!this.modal&&this.getState()&&(this.modal=this.createElement("div"),this.modal.className="e-sidebar-overlay",this.modal.style.display="block",document.body.appendChild(this.modal))},i.prototype.getPersistData=function(){return this.addOnPersist(["type","position","isOpen"])},i.prototype.getModuleName=function(){return"sidebar"},i.prototype.toggle=function(){this.element.classList.contains(je)?this.hide():this.show()},i.prototype.getState=function(){return!!this.element.classList.contains(je)},i.prototype.setMediaQuery=function(){if(this.mediaQuery){("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery).matches:this.mediaQuery.matches)&&this.windowWidth!==window.innerWidth?this.show():this.getState()&&this.windowWidth!==window.innerWidth&&this.hide()}},i.prototype.resize=function(){"Auto"===this.type&&(t.Browser.isDevice?t.addClass([this.element],ze):t.addClass([this.element],Ve)),this.setMediaQuery(),t.Browser.isDevice&&(this.windowWidth=window.innerWidth)},i.prototype.documentclickHandler=function(e){t.closest(e.target,".e-control.e-sidebar")||this.hide(e)},i.prototype.enableGestureHandler=function(e){!this.isOpen&&"Left"===this.position&&"Right"===e.swipeDirection&&e.startX<=20&&e.distanceX>=50&&e.velocity>=.5?this.show():this.isOpen&&"Left"===this.position&&"Left"===e.swipeDirection?this.hide():this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide():!this.isOpen&&"Right"===this.position&&"Left"===e.swipeDirection&&window.innerWidth-e.startX<=20&&e.distanceX>=50&&e.velocity>=.5&&this.show()},i.prototype.setEnableGestures=function(){this.enableGestures?(this.mainContentEle=new t.Touch(document.body,{swipe:this.enableGestureHandler.bind(this)}),this.sidebarEle=new t.Touch(this.element,{swipe:this.enableGestureHandler.bind(this)})):this.mainContentEle&&this.sidebarEle&&(this.mainContentEle.destroy(),this.sidebarEle.destroy())},i.prototype.wireEvents=function(){this.setEnableGestures(),window.addEventListener("resize",this.resize.bind(this))},i.prototype.unWireEvents=function(){window.removeEventListener("resize",this.resize.bind(this)),t.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler),this.mainContentEle&&this.mainContentEle.destroy(),this.sidebarEle&&this.sidebarEle.destroy()},i.prototype.onPropertyChanged=function(i,s){for(var n=document.querySelector(".e-main-content")||this.targetEle,r=this.isServerRendered,l=0,o=Object.keys(i);l<o.length;l++)switch(o[l]){case"isOpen":this.isOpen?this.show():this.hide();break;case"width":this.setWidth(),this.getState()||this.setDock();break;case"animate":this.setAnimation();break;case"type":this.checkType(!1),t.removeClass([this.element],["e-visibility"]),this.addClass(),t.addClass([this.element],"Auto"===this.type?t.Browser.isDevice?["e-over"]:["e-push"]:["e-"+this.type.toLowerCase()]);break;case"position":this.element.style.transform="",this.setDock(),n&&(n.style["Left"===this.position?"marginRight":"marginLeft"]="0px"),"Right"===this.position?(t.removeClass([this.element],Fe),t.addClass([this.element],qe)):(t.removeClass([this.element],qe),t.addClass([this.element],Fe)),this.setType(this.type);break;case"showBackdrop":this.showBackdrop?this.createBackDrop():this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null);break;case"target":"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),t.isNullOrUndefined(this.target)&&(t.removeClass([this.element],"e-sidebar-absolute"),t.removeClass([s.target],We),t.setStyleAttribute(n,{"margin-left":0,"margin-right":0}),document.body.insertAdjacentElement("afterbegin",this.element)),this.isServerRendered=!1,e.prototype.refresh.call(this),this.isServerRendered=r;break;case"closeOnDocumentClick":this.setCloseOnDocumentClick();break;case"enableDock":this.getState()||this.setDock();break;case"zIndex":this.setZindex();break;case"mediaQuery":this.setMediaQuery();break;case"enableGestures":this.setEnableGestures();break;case"enableRtl":this.setEnableRTL()}},i.prototype.setType=function(e){var i=this.element.getBoundingClientRect().width;this.setZindex();var s=document.querySelector(".e-main-content")||this.targetEle;s&&(s.style.transform="translateX(0px)",t.Browser.isDevice||"Auto"===this.type||(s.style["Left"===this.position?"marginLeft":"marginRight"]="0px"));var n=(this.position,i+"px"),r="Left"===this.position?i:-i;switch(t.removeClass([this.element],[Ve,ze,"e-slide"]),e){case"Push":t.addClass([this.element],[Ve]),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n);break;case"Slide":t.addClass([this.element],["e-slide"]),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style.transform="translateX("+r+"px)");break;case"Over":t.addClass([this.element],[ze]),this.enableDock&&this.element.classList.contains(Re)&&s&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n);break;case"Auto":t.addClass([this.element],["e-transition"]),t.Browser.isDevice?s&&this.enableDock&&!this.getState()?(s.style["Left"===this.position?"marginLeft":"marginRight"]=n,t.addClass([this.element],Ve)):t.addClass([this.element],ze):(t.addClass([this.element],Ve),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n)),this.createBackDrop()}},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.target&&t.removeClass([this.target],We),this.destroyBackDrop(),this.element&&(t.removeClass([this.element],[je,Re,Ve,"e-slide",ze,Fe,qe,"e-transition"]),t.removeClass([this.element],"e-sidebar-absolute"),this.element.style.width="",this.element.style.zIndex="",this.element.style.transform="",t.isNullOrUndefined(this.sidebarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.windowWidth=null;var i=document.querySelector(".e-main-content")||this.targetEle;t.isNullOrUndefined(i)||(i.style.margin="",i.style.transform=""),this.unWireEvents()},Be([t.Property("auto")],i.prototype,"dockSize",void 0),Be([t.Property(null)],i.prototype,"mediaQuery",void 0),Be([t.Property(!1)],i.prototype,"enableDock",void 0),Be([t.Property("en-US")],i.prototype,"locale",void 0),Be([t.Property(!1)],i.prototype,"enablePersistence",void 0),Be([t.Property(!0)],i.prototype,"enableGestures",void 0),Be([t.Property(!1)],i.prototype,"isOpen",void 0),Be([t.Property(!1)],i.prototype,"enableRtl",void 0),Be([t.Property(!0)],i.prototype,"animate",void 0),Be([t.Property("auto")],i.prototype,"height",void 0),Be([t.Property(!1)],i.prototype,"closeOnDocumentClick",void 0),Be([t.Property("Left")],i.prototype,"position",void 0),Be([t.Property(null)],i.prototype,"target",void 0),Be([t.Property(!1)],i.prototype,"showBackdrop",void 0),Be([t.Property("Auto")],i.prototype,"type",void 0),Be([t.Property("auto")],i.prototype,"width",void 0),Be([t.Property(1e3)],i.prototype,"zIndex",void 0),Be([t.Event()],i.prototype,"created",void 0),Be([t.Event()],i.prototype,"close",void 0),Be([t.Event()],i.prototype,"open",void 0),Be([t.Event()],i.prototype,"change",void 0),Be([t.Event()],i.prototype,"destroyed",void 0),i=Be([t.NotifyPropertyChanges],i)}(t.Component);return e.MenuAnimationSettings=w,e.MenuItem=S,e.HScroll=p,e.VScroll=m,e.addScrolling=o,e.destroyScroll=d,e.Item=T,e.Toolbar=M,e.AccordionActionSettings=F,e.AccordionAnimationSettings=z,e.AccordionItem=V,e.Accordion=W,e.ContextMenu=Y,e.Menu=J,e.TabActionSettings=le,e.TabAnimationSettings=oe,e.Header=ae,e.TabItem=de,e.Tab=he,e.FieldsSettings=Pe,e.ActionSettings=Te,e.NodeAnimationSettings=Me,e.TreeView=Ue,e.Sidebar=_e,e}({},ej.base,ej.lists,ej.popups,ej.buttons,ej.data,ej.inputs),this.ejs=ej;
- /*!
- * filename: ej2-svg-base.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.svgbase=function(t,e){"use strict";function i(t){var e;switch(t){case"Highcontrast":case"HighContrast":e={tooltipFill:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696"};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":e={tooltipFill:"#F4F4F4",tooltipBoldLabel:"#282727",tooltipLightLabel:"#333232",tooltipHeaderLine:"#9A9A9A"};break;case"Bootstrap4":e={tooltipFill:"rgba(0, 0, 0, 0.9)",tooltipBoldLabel:"rgba(255, 255, 255)",tooltipLightLabel:"rgba(255, 255, 255, 0.9)",tooltipHeaderLine:"rgba(255, 255, 255, 0.2)"};break;case"Tailwind":e={tooltipFill:"#111827",tooltipBoldLabel:"#D1D5DB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#6B7280"};break;case"TailwindDark":e={tooltipFill:"#F9FAFB",tooltipBoldLabel:"#6B7280",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#9CA3AF"};break;default:e={tooltipFill:"rgba(0, 8, 22, 0.75)",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff"}}return e}function r(t,i){var r=t||"",o=document.getElementById("chartmeasuretext");if(null===o&&(o=e.createElement("text",{id:"chartmeasuretext"}),document.body.appendChild(o)),"string"==typeof t&&(t.indexOf("<")>-1||t.indexOf(">")>-1)){for(var n=t.split(" "),s=0;s<n.length;s++)-1===n[s].indexOf("<br/>")&&(n[s]=n[s].replace(/[<>]/g,"&"));t=n.join(" ")}return o.innerHTML=r.indexOf("<br>")>-1||r.indexOf("<br/>")>-1?r:t,o.style.position="fixed",o.style.fontSize=i.size,o.style.fontWeight=i.fontWeight,o.style.fontStyle=i.fontStyle,o.style.fontFamily=i.fontFamily,o.style.visibility="hidden",o.style.top="-100",o.style.left="0",o.style.whiteSpace="nowrap",o.style.lineHeight="normal",new u(o.clientWidth,o.clientHeight)}function o(t,e,i,r,o,n,s,a,h,l,p){var d="",c=i.x,u=i.y,y=i.x+i.width,g=i.y+i.height;return p=p||0,n?(d=(d=d.concat("M "+c+" "+(u+e)+" Q "+c+" "+u+" "+(c+t)+" "+u+" L "+(y-t)+" "+u+" Q "+y+" "+u+" "+y+" "+(u+e))).concat(" L "+y+" "+(g-e)+" Q "+y+" "+g+" "+(y-t)+" "+g),0!==o&&(d=(d=d.concat(" L "+(r.x+o/2)+" "+g)).concat(" L "+(h+p)+" "+(g+o-p)),d+=" Q "+h+" "+(g+o)+" "+(h-p)+" "+(g+o-p)),d=r.x-o/2>c?d.concat(" L "+(r.x-o/2)+" "+g+" L "+(c+t)+" "+g+" Q "+c+" "+g+" "+c+" "+(g-e)+" z"):0===o?d.concat(" L "+(c+t)+" "+g+" Q "+c+" "+g+" "+c+" "+(g-e)+" z"):d.concat(" L "+c+" "+(g+e)+" z")):s?(d=(d=d.concat("M "+c+" "+(u+e)+" Q "+c+" "+u+" "+(c+t)+" "+u+" L "+(r.x-o/2)+" "+u)).concat(" L "+(h-p)+" "+(r.y+p)),d=(d=(d+=" Q "+h+" "+r.y+" "+(h+p)+" "+(r.y+p)).concat(" L "+(r.x+o/2)+" "+u+" L "+(y-t)+" "+u+" Q "+y+" "+u+" "+y+" "+(u+e))).concat(" L "+y+" "+(g-e)+" Q "+y+" "+g+" "+(y-t)+" "+g+" L "+(c+t)+" "+g+" Q "+c+" "+g+" "+c+" "+(g-e)+" z")):a?(d=(d=(d=d.concat("M "+c+" "+(u+e)+" Q "+c+" "+u+" "+(c+t)+" "+u)).concat(" L "+(y-t)+" "+u+" Q "+y+" "+u+" "+y+" "+(u+e)+" L "+y+" "+(r.y-o/2))).concat(" L "+(y+o-p)+" "+(l-p)),d=(d=(d+=" Q "+(y+o)+" "+l+" "+(y+o-p)+" "+(l+p)).concat(" L "+y+" "+(r.y+o/2)+" L "+y+" "+(g-e)+" Q "+y+" "+g+" "+(y-t)+" "+g)).concat(" L "+(c+t)+" "+g+" Q "+c+" "+g+" "+c+" "+(g-e)+" z")):(d=(d=d.concat("M "+(c+t)+" "+u+" Q "+c+" "+u+" "+c+" "+(u+e)+" L "+c+" "+(r.y-o/2))).concat(" L "+(c-o+p)+" "+(l-p)),d=(d=(d+=" Q "+(c-o)+" "+l+" "+(c-o+p)+" "+(l+p)).concat(" L "+c+" "+(r.y+o/2)+" L "+c+" "+(g-e)+" Q "+c+" "+g+" "+(c+t)+" "+g)).concat(" L "+(y-t)+" "+g+" Q "+y+" "+g+" "+y+" "+(g-e)+" L "+y+" "+(u+e)+" Q "+y+" "+u+" "+(y-t)+" "+u+" z")),d}function n(t){return document.getElementById(t)}function s(t){var i=n(t);i&&e.remove(i)}function a(t,e,i,r,o,n){var s=new p(""),a=h(t,i,e,o,r),l=s["draw"+a.functionName](a.renderOption);return l.setAttribute("aria-label",n),l}function h(t,i,r,o,n){var s,a="Path",h=i.width,l=i.height,p=t.x,d=t.y,c=t.x+-h/2,u=t.y+-l/2;switch(r){case"Circle":case"Bubble":a="Ellipse",e.merge(o,{rx:h/2,ry:l/2,cx:p,cy:d});break;case"Cross":s="M "+c+" "+d+" L "+(p+h/2)+" "+d+" M "+p+" "+(d+l/2)+" L "+p+" "+(d+-l/2),e.merge(o,{d:s});break;case"HorizontalLine":s="M "+c+" "+d+" L "+(p+h/2)+" "+d,e.merge(o,{d:s});break;case"VerticalLine":s="M "+p+" "+(d+l/2)+" L "+p+" "+(d+-l/2),e.merge(o,{d:s});break;case"Diamond":s="M "+c+" "+d+" L "+p+" "+(d+-l/2)+" L "+(p+h/2)+" "+d+" L "+p+" "+(d+l/2)+" L "+c+" "+d+" z",e.merge(o,{d:s});break;case"Rectangle":s="M "+c+" "+(d+-l/2)+" L "+(p+h/2)+" "+(d+-l/2)+" L "+(p+h/2)+" "+(d+l/2)+" L "+c+" "+(d+l/2)+" L "+c+" "+(d+-l/2)+" z",e.merge(o,{d:s});break;case"Triangle":s="M "+c+" "+(d+l/2)+" L "+p+" "+(d+-l/2)+" L "+(p+h/2)+" "+(d+l/2)+" L "+c+" "+(d+l/2)+" z",e.merge(o,{d:s});break;case"InvertedTriangle":s="M "+(p+h/2)+" "+(d-l/2)+" L "+p+" "+(d+l/2)+" L "+(p-h/2)+" "+(d-l/2)+" L "+(p+h/2)+" "+(d-l/2)+" z",e.merge(o,{d:s});break;case"Pentagon":for(var y=void 0,g=void 0,f=0;f<=5;f++)y=h/2*Math.cos(Math.PI/180*(72*f)),g=l/2*Math.sin(Math.PI/180*(72*f)),s=0===f?"M "+(p+y)+" "+(d+g)+" ":s.concat("L "+(p+y)+" "+(d+g)+" ");s=s.concat("Z"),e.merge(o,{d:s});break;case"Image":a="Image",e.merge(o,{href:n,height:l,width:h,x:c,y:u})}return{renderOption:o,functionName:a}}function l(t,e,i,r){var o={},n=new p("");o={id:t.id,x:t.x,y:t.y,fill:i,"font-size":e.size,"font-style":e.fontStyle,"font-family":e.fontFamily,"font-weight":e.fontWeight,"text-anchor":t.anchor,transform:t.transform,opacity:e.opacity,"dominant-baseline":t.baseLine};var s="string"==typeof t.text?t.text:t.text[0],a=n.createText(o,s);return a.style.fontFamily=e.fontFamily,a.style.fontStyle=e.fontStyle,a.style.fontSize=e.size,a.style.fontWeight=e.fontWeight,a.style.color=e.color,r.appendChild(a),a}var p=function(){function t(t){this.svgLink="http://www.w3.org/2000/svg",this.rootId=t}return t.prototype.getOptionValue=function(t,e){return t[e]},t.prototype.createSvg=function(t){return e.isNullOrUndefined(t.id)&&(t.id=this.rootId+"_svg"),this.svgObj=document.getElementById(t.id),e.isNullOrUndefined(document.getElementById(t.id))&&(this.svgObj=document.createElementNS(this.svgLink,"svg")),this.svgObj=this.setElementAttributes(t,this.svgObj),this.setSVGSize(t.width,t.height),this.svgObj},t.prototype.setSVGSize=function(t,i){var r=document.getElementById(this.rootId),o=e.isNullOrUndefined(r)?null:r.getBoundingClientRect();e.isNullOrUndefined(this.width)||this.width<=0?this.svgObj.setAttribute("width",t?t.toString():o.width.toString()):this.svgObj.setAttribute("width",this.width.toString()),e.isNullOrUndefined(this.height)||this.height<=0?this.svgObj.setAttribute("height",i?i.toString():"450"):this.svgObj.setAttribute("height",this.height.toString())},t.prototype.drawPath=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"path")),e=this.setElementAttributes(t,e)},t.prototype.drawLine=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"line")),e=this.setElementAttributes(t,e)},t.prototype.drawRectangle=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"rect")),e=this.setElementAttributes(t,e)},t.prototype.drawCircle=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"circle")),e=this.setElementAttributes(t,e)},t.prototype.drawPolyline=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"polyline")),e=this.setElementAttributes(t,e)},t.prototype.drawEllipse=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"ellipse")),e=this.setElementAttributes(t,e)},t.prototype.drawPolygon=function(t){var e=document.getElementById(t.id);return null===e&&(e=document.createElementNS(this.svgLink,"polygon")),e=this.setElementAttributes(t,e)},t.prototype.drawImage=function(t){var i=document.createElementNS(this.svgLink,"image");return i.setAttributeNS(null,"height",t.height.toString()),i.setAttributeNS(null,"width",t.width.toString()),i.setAttributeNS("http://www.w3.org/1999/xlink","href",t.href),i.setAttributeNS(null,"x",t.x.toString()),i.setAttributeNS(null,"y",t.y.toString()),i.setAttributeNS(null,"id",t.id),i.setAttributeNS(null,"visibility",t.visibility),e.isNullOrUndefined(this.getOptionValue(t,"clip-path"))||i.setAttributeNS(null,"clip-path",this.getOptionValue(t,"clip-path")),e.isNullOrUndefined(t.preserveAspectRatio)||i.setAttributeNS(null,"preserveAspectRatio",t.preserveAspectRatio),i},t.prototype.createText=function(t,i){var r=document.createElementNS(this.svgLink,"text");return r=this.setElementAttributes(t,r),e.isNullOrUndefined(i)||(r.textContent=i),r},t.prototype.createTSpan=function(t,i){var r=document.createElementNS(this.svgLink,"tspan");return r=this.setElementAttributes(t,r),e.isNullOrUndefined(i)||(r.textContent=i),r},t.prototype.createTitle=function(t){var e=document.createElementNS(this.svgLink,"title");return e.textContent=t,e},t.prototype.createDefs=function(){return document.createElementNS(this.svgLink,"defs")},t.prototype.createClipPath=function(t){var e=document.createElementNS(this.svgLink,"clipPath");return e=this.setElementAttributes(t,e)},t.prototype.createForeignObject=function(t){var e=document.createElementNS(this.svgLink,"foreignObject");return e=this.setElementAttributes(t,e)},t.prototype.createGroup=function(t){var e=document.createElementNS(this.svgLink,"g");return e=this.setElementAttributes(t,e)},t.prototype.createPattern=function(t,e){var i=document.createElementNS(this.svgLink,e);return i=this.setElementAttributes(t,i)},t.prototype.createRadialGradient=function(t,i,r){var o;if(e.isNullOrUndefined(t[0].colorStop))o=t[0].color.toString();else{var n={id:this.rootId+"_"+i+"radialGradient",cx:r.cx+"%",cy:r.cy+"%",r:r.r+"%",fx:r.fx+"%",fy:r.fy+"%"};this.drawGradient("radialGradient",n,t),o="url(#"+this.rootId+"_"+i+"radialGradient)"}return o},t.prototype.createLinearGradient=function(t,i,r){var o;if(e.isNullOrUndefined(t[0].colorStop))o=t[0].color.toString();else{var n={id:this.rootId+"_"+i+"linearGradient",x1:r.x1+"%",y1:r.y1+"%",x2:r.x2+"%",y2:r.y2+"%"};this.drawGradient("linearGradient",n,t),o="url(#"+this.rootId+"_"+i+"linearGradient)"}return o},t.prototype.drawGradient=function(t,i,r){var o=this.createDefs(),n=document.createElementNS(this.svgLink,t);n=this.setElementAttributes(i,n);for(var s=0;s<r.length;s++){var a=document.createElementNS(this.svgLink,"stop");a.setAttribute("offset",r[s].colorStop),a.setAttribute("stop-color",r[s].color),a.setAttribute("stop-opacity",r[s].opacity?r[s].opacity:"1"),e.isNullOrUndefined(r[s].style)||a.setAttribute("style",r[s].style),n.appendChild(a)}return o.appendChild(n),o},t.prototype.drawClipPath=function(t){var e=this.createDefs(),i=this.createClipPath({id:t.id});t.id=t.id+"_Rect";var r=this.drawRectangle(t);return i.appendChild(r),e.appendChild(i),e},t.prototype.drawCircularClipPath=function(t){var e=this.createDefs(),i=this.createClipPath({id:t.id});t.id=t.id+"_Circle";var r=this.drawCircle(t);return i.appendChild(r),e.appendChild(i),e},t.prototype.setElementAttributes=function(t,e){for(var i=Object.keys(t),r=0;r<i.length;r++)e.setAttribute(i[r],t[i[r]]);return e},t.prototype.createCanvas=function(){return null},t}(),d=function(){function t(t){this.rootId=t}return t.prototype.getOptionValue=function(t,e){return t[e]},t.prototype.createCanvas=function(t){var e=document.createElement("canvas");return e.setAttribute("id",this.rootId+"_canvas"),this.ctx=e.getContext("2d"),this.canvasObj=e,this.setCanvasSize(t.width,t.height),this.canvasObj},t.prototype.setCanvasSize=function(t,i){var r=document.getElementById(this.rootId),o=e.isNullOrUndefined(r)?null:r.getBoundingClientRect();e.isNullOrUndefined(this.width)?this.canvasObj.setAttribute("width",t?t.toString():o.width.toString()):this.canvasObj.setAttribute("width",this.width.toString()),e.isNullOrUndefined(this.height)?this.canvasObj.setAttribute("height",i?i.toString():"450"):this.canvasObj.setAttribute("height",this.height.toString())},t.prototype.setAttributes=function(t){this.ctx.lineWidth=this.getOptionValue(t,"stroke-width");var i=this.getOptionValue(t,"stroke-dasharray");if(!e.isNullOrUndefined(i)){var r=i.split(",");this.ctx.setLineDash([parseInt(r[0],10),parseInt(r[1],10)])}this.ctx.strokeStyle=this.getOptionValue(t,"stroke")},t.prototype.drawLine=function(t){this.ctx.save(),this.ctx.beginPath(),this.ctx.lineWidth=this.getOptionValue(t,"stroke-width"),this.ctx.strokeStyle=t.stroke,this.ctx.moveTo(t.x1,t.y1),this.ctx.lineTo(t.x2,t.y2),this.ctx.stroke(),this.ctx.restore()},t.prototype.drawRectangle=function(t,e){var i=this.ctx,r=t.rx;return this.ctx.save(),this.ctx.beginPath(),e&&this.ctx.translate(e[0],e[1]),this.ctx.globalAlpha=this.getOptionValue(t,"opacity"),this.setAttributes(t),this.ctx.rect(t.x,t.y,t.width,t.height),null!==r&&r>=0?this.drawCornerRadius(t):("none"===t.fill&&(t.fill="transparent"),this.ctx.fillStyle=t.fill,this.ctx.fillRect(t.x,t.y,t.width,t.height),this.ctx.stroke()),this.ctx.restore(),this.ctx=i,this.canvasObj},t.prototype.drawCornerRadius=function(t){var e=t.rx,i=t.x,r=t.y,o=t.width,n=t.height;"none"===t.fill&&(t.fill="transparent"),this.ctx.fillStyle=t.fill,o<2*e&&(e=o/2),n<2*e&&(e=n/2),this.ctx.beginPath(),this.ctx.moveTo(i+o-e,r),this.ctx.arcTo(i+o,r,i+o,r+n,e),this.ctx.arcTo(i+o,r+n,i,r+n,e),this.ctx.arcTo(i,r+n,i,r,e),this.ctx.arcTo(i,r,i+o,r,e),this.ctx.closePath(),this.ctx.fill(),this.ctx.stroke()},t.prototype.drawPath=function(t,e){var i=t.d.split(" "),r=this.getOptionValue(t,"stroke-width"),o=this.ctx,n=!0;this.ctx.save(),this.ctx.beginPath(),e&&this.ctx.translate(e[0],e[1]),this.ctx.globalAlpha=t.opacity?t.opacity:this.getOptionValue(t,"fill-opacity"),this.setAttributes(t);for(var s=0;s<i.length;s+=3){var a=parseFloat(i[s+1]),h=parseFloat(i[s+2]);switch(i[s]){case"M":t.innerR||t.cx||this.ctx.moveTo(a,h);break;case"L":t.innerR||this.ctx.lineTo(a,h);break;case"Q":var l=parseFloat(i[s+3]),p=parseFloat(i[s+4]);this.ctx.quadraticCurveTo(a,h,l,p),s+=2;break;case"C":var d=parseFloat(i[s+3]),c=parseFloat(i[s+4]),u=parseFloat(i[s+5]),y=parseFloat(i[s+6]);this.ctx.bezierCurveTo(a,h,d,c,u,y),s+=4;break;case"A":t.innerR?n&&(this.ctx.arc(t.x,t.y,t.radius,t.start,t.end,t.counterClockWise),this.ctx.arc(t.x,t.y,t.innerR,t.end,t.start,!t.counterClockWise),n=!1):t.cx?this.ctx.arc(t.cx,t.cy,t.radius,0,2*Math.PI,t.counterClockWise):(this.ctx.moveTo(t.x,t.y),this.ctx.arc(t.x,t.y,t.radius,t.start,t.end,t.counterClockWise),this.ctx.lineTo(t.x,t.y)),s+=5;break;case"z":case"Z":this.ctx.closePath(),s-=2}}return"none"!==t.fill&&void 0!==t.fill&&(this.ctx.fillStyle=t.fill,this.ctx.fill()),r>0&&this.ctx.stroke(),this.ctx.restore(),this.ctx=o,this.canvasObj},t.prototype.createText=function(t,i,r,o,n,s){var a=this.getOptionValue(t,"font-weight");e.isNullOrUndefined(a)||"regular"!==a.toLowerCase()||(a="normal");var h=this.getOptionValue(t,"font-size"),l=this.getOptionValue(t,"font-family"),p=this.getOptionValue(t,"font-style").toLowerCase()+" "+a+" "+h+" "+l,d=this.getOptionValue(t,"text-anchor"),c=void 0!==t.opacity?t.opacity:1;if("middle"===d&&(d="center"),this.ctx.save(),this.ctx.fillStyle=t.fill,this.ctx.font=p,this.ctx.textAlign=d,this.ctx.globalAlpha=c,t.baseline&&(this.ctx.textBaseline=t.baseline),!s){this.ctx.translate(t.x+0+(r||0),t.y+(o||0)),this.ctx.rotate(t.labelRotation*Math.PI/180)}return this.ctx.fillText(i,s?t.x:0,s?n:0),this.ctx.restore(),this.canvasObj},t.prototype.drawCircle=function(t,e){var i=this.ctx;return this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.cx,t.cy,t.r,0,2*Math.PI),this.ctx.fillStyle=t.fill,this.ctx.globalAlpha=t.opacity,this.ctx.fill(),e&&this.ctx.translate(e[0],e[1]),this.setAttributes(t),this.ctx.stroke(),this.ctx.restore(),this.ctx=i,this.canvasObj},t.prototype.drawPolyline=function(t){this.ctx.save(),this.ctx.beginPath();for(var e=t.points.split(" "),i=0;i<e.length-1;i++){var r=e[i].split(","),o=parseFloat(r[0]),n=parseFloat(r[1]);0===i?this.ctx.moveTo(o,n):this.ctx.lineTo(o,n)}this.ctx.lineWidth=this.getOptionValue(t,"stroke-width"),this.ctx.strokeStyle=t.stroke,this.ctx.stroke(),this.ctx.restore()},t.prototype.drawEllipse=function(t,e){var i=this.ctx,r=Math.max(t.rx,t.ry),o=t.rx/r,n=t.ry/r;this.ctx.save(),this.ctx.beginPath(),this.ctx.translate(t.cx,t.cy),e&&this.ctx.translate(e[0],e[1]),this.ctx.save(),this.ctx.scale(o,n),this.ctx.arc(0,0,r,0,2*Math.PI,!1),this.ctx.fillStyle=t.fill,this.ctx.fill(),this.ctx.restore(),this.ctx.lineWidth=this.getOptionValue(t,"stroke-width"),this.ctx.strokeStyle=t.stroke,this.ctx.stroke(),this.ctx.restore(),this.ctx=i},t.prototype.drawImage=function(t){this.ctx.save();var i=new Image;e.isNullOrUndefined(t.href)||(i.src=t.href,this.ctx.drawImage(i,t.x,t.y,t.width,t.height)),this.ctx.restore()},t.prototype.createLinearGradient=function(t){var i;return e.isNullOrUndefined(t[0].colorStop)||(i=this.ctx.createLinearGradient(0,0,0,this.canvasObj.height)),this.setGradientValues(t,i)},t.prototype.createRadialGradient=function(t){var i;return e.isNullOrUndefined(t[0].colorStop)||(i=this.ctx.createRadialGradient(0,0,0,0,0,this.canvasObj.height)),this.setGradientValues(t,i)},t.prototype.setGradientValues=function(t,i){var r;if(e.isNullOrUndefined(t[0].colorStop))r=t[0].color.toString();else{for(var o=0;o<=t.length-1;o++){var n=t[o].color,s=t[o].colorStop.slice(0,-1),a=parseInt(s,10)/100;i.addColorStop(a,n)}r=i.toString()}return r},t.prototype.setElementAttributes=function(t,e){for(var i=Object.keys(t),r=Object.keys(t).map(function(e){return t[e]}),o=0;o<i.length;o++)e.setAttribute(i[o],r[o]);return null},t.prototype.updateCanvasAttributes=function(t){this.setElementAttributes(t,this.canvasObj);var i=this.ctx;if(!e.isNullOrUndefined(this.dataUrl)){var r=new Image;r.onload=function(){i.drawImage(r,0,0)},r.src=this.dataUrl}},t.prototype.clearRect=function(t){this.ctx.restore(),this.ctx.clearRect(t.x,t.y,t.width,t.height)},t.prototype.createGroup=function(){return null},t.prototype.drawClipPath=function(){return null},t.prototype.canvasClip=function(t){this.ctx.save(),this.ctx.fillStyle="transparent",this.ctx.rect(t.x,t.y,t.width,t.height),this.ctx.fill(),this.ctx.clip()},t.prototype.canvasRestore=function(){this.ctx.restore()},t.prototype.drawPolygon=function(){return null},t.prototype.createDefs=function(){return null},t.prototype.createClipPath=function(){return null},t.prototype.createSvg=function(){return null},t}(),c=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),u=function(){function t(t,e){this.width=t,this.height=e}return t}(),y=function(){function t(t,e,i,r){this.x=t,this.y=e,this.width=i,this.height=r}return t}(),g=function(){function t(t,e){this.isRight=e,this.isBottom=t}return t}(),f=function(){function t(t){this.id=t}return t}(),m=function(t){function e(e,i,r,o,n,s,a,h){void 0===s&&(s="");var l=t.call(this,e)||this;return l.transform="",l.baseLine="auto",l.labelRotation=0,l.x=i,l.y=r,l.anchor=o,l.text=n,l.transform=s,l.baseLine=a,l.labelRotation=h,l}return c(e,t),e}(f),x=function(t){function e(e,i,r,o,n,s,a){var h=t.call(this,e)||this;return h.opacity=n,h.fill=i,h.stroke=o,h["stroke-width"]=r,h["stroke-dasharray"]=s,h.d=a,h}return c(e,t),e}(f),v=function(){function t(t,e){this.x=t,this.y=e}return t}(),b=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),w=function(t,e,i,r){var o,n=arguments.length,s=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,i,s):o(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s},S=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),w([e.Property(null)],i.prototype,"size",void 0),w([e.Property("")],i.prototype,"color",void 0),w([e.Property("Segoe UI")],i.prototype,"fontFamily",void 0),w([e.Property("Normal")],i.prototype,"fontWeight",void 0),w([e.Property("Normal")],i.prototype,"fontStyle",void 0),w([e.Property(1)],i.prototype,"opacity",void 0),i}(e.ChildProperty),P=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),w([e.Property("")],i.prototype,"color",void 0),w([e.Property(1)],i.prototype,"width",void 0),i}(e.ChildProperty),L=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),w([e.Property(0)],i.prototype,"x",void 0),w([e.Property(0)],i.prototype,"y",void 0),w([e.Property(0)],i.prototype,"width",void 0),w([e.Property(0)],i.prototype,"height",void 0),i}(e.ChildProperty),O=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),w([e.Property(0)],i.prototype,"x",void 0),w([e.Property(0)],i.prototype,"y",void 0),i}(e.ChildProperty),T=function(t){function h(e,i){return t.call(this,e,i)||this}return b(h,t),h.prototype.preRender=function(){this.allowServerDataBinding=!1,this.initPrivateVariable(),this.isCanvas||this.removeSVG(),this.createTooltipElement()},h.prototype.initPrivateVariable=function(){this.renderer=new p(this.element.id),this.themeStyle=i(this.theme),this.formattedText=[],this.padding=5,this.isFirst=!0,this.markerPoint=[]},h.prototype.removeSVG=function(){var t=document.getElementById(this.element.id+"_svg"),i=document.getElementById(this.element.id+"parent_template");this.blazorTemplate&&e.resetBlazorTemplate(this.element.id+"parent_template_blazorTemplate"),t&&t.parentNode&&e.remove(t),i&&i.parentNode&&e.remove(i)},h.prototype.render=function(){if(this.fadeOuted=!1,this.template)this.updateTemplateFn(),this.createTemplate(this.areaBounds,this.location);else{this.renderText(this.isFirst);var t={cancel:!1,name:"tooltipRender",tooltip:this};this.trigger("tooltipRender",t);var i=this.renderTooltipElement(this.areaBounds,this.location);this.drawMarker(i.isBottom,i.isRight,this.markerSize)}this.trigger("loaded",{tooltip:this});var r=document.getElementById("chartmeasuretext");r&&e.remove(r),this.allowServerDataBinding=!0},h.prototype.createTooltipElement=function(){if(this.textElements=[],!this.template||this.shared){var t=this.renderer.createSvg({id:this.element.id+"_svg"});this.element.appendChild(t);var e=document.getElementById(this.element.id+"_group");e||(e=this.renderer.createGroup({id:this.element.id+"_group"})).setAttribute("transform","translate(0,0)"),t.appendChild(e);var i=this.renderer.drawPath({id:this.element.id+"_path","stroke-width":this.border.width,fill:this.fill||this.themeStyle.tooltipFill,opacity:"TailwindDark"!==this.theme&&"Tailwind"!==this.theme||.75!==this.opacity?this.opacity:1,stroke:this.border.color});e.appendChild(i)}},h.prototype.drawMarker=function(t,e,i){if(this.shapes.length<=0)return null;for(var r,o=0,s=this.renderer.createGroup({id:this.element.id+"_trackball_group"}),h=n(this.element.id+"_group"),l=2*this.marginX+i/2+(e?this.arrowPadding:0),p=0,d=this.shapes;p<d.length;p++){var c=d[p];"None"!==c&&(r=new x(this.element.id+"_Trackball_"+o,this.palette[o],1,"#cccccc",1,null),this.markerPoint[o]&&s.appendChild(a(new v(l,this.markerPoint[o]-this.padding+(t?this.arrowPadding:0)),c,new u(i,i),"",r,null)),o++)}h.appendChild(s)},h.prototype.renderTooltipElement=function(t,i){var s,a=n(this.element.id),h=new v(0,0),l=new v(0,0),p=n(this.element.id+"_svg"),d=n(this.element.id+"_group"),c=n(this.element.id+"_path"),u=!1,f=!1,m=!1,x=0,b=0;if(this.tipRadius=1,""!==this.header&&(this.elementSize.height+=this.marginY),this.content.length>1?(s=this.sharedTooltipLocation(t,this.location.x,this.location.y),u=!0):(s=this.tooltipLocation(t,i,h,l),this.inverted?x=(f=s.x<i.x+this.clipBounds.x)?0:this.arrowPadding:(m=!(u=s.y<i.y+this.clipBounds.y),b=u?0:this.arrowPadding)),""!==this.header){var w=r(this.isWrap?this.wrappedText:this.header,this.textStyle).height+2*this.marginY+(m?this.arrowPadding:0)+(this.isWrap?5:0),S="M "+(3*this.marginX+(f||u||m?0:this.arrowPadding))+" "+w+"L "+(s.width+(f||u||m?0:this.arrowPadding)-2*this.marginX)+" "+w,P=this.renderer.drawPath({id:this.element.id+"_header_path","stroke-width":1,fill:null,opacity:.8,stroke:this.themeStyle.tooltipHeaderLine,d:S});d.appendChild(P)}var L=this.border.width/2,O=new y(L+x,L+b,s.width-L,s.height-L);if(d.setAttribute("opacity","1"),!this.enableAnimation||this.shared||this.isFirst?this.updateDiv(a,s.x,s.y):this.animateTooltipDiv(a,s),p.setAttribute("height",(s.height+this.border.width+(this.inverted?0:this.arrowPadding)+5).toString()),p.setAttribute("width",(s.width+this.border.width+(this.inverted?this.arrowPadding:0)+5).toString()),p.setAttribute("opacity","1"),e.isNullOrUndefined(this.tooltipPlacement)||(u=this.tooltipPlacement.indexOf("Top")>-1,m=this.tooltipPlacement.indexOf("Bottom")>-1,f=this.tooltipPlacement.indexOf("Left")>-1),c.setAttribute("d",o(this.rx,this.ry,O,h,this.arrowPadding,u,m,f,l.x,l.y,this.tipRadius)),this.enableShadow&&"Bootstrap4"!==this.theme){var T=this.element.id+"_shadow";"Tailwind"===this.theme||"TailwindDark"===this.theme?c.setAttribute("box-shadow","0px 1px 2px rgba(0, 0, 0, 0.06), 0px 1px 3px rgba(0, 0, 0, 0.1)"):c.setAttribute("filter",e.Browser.isIE?"":"url(#"+T+")");var A='<filter id="'+T+'" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="3"/>';A+='<feOffset dx="3" dy="3" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="0.5"/>',A+='</feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>';var C=this.renderer.createDefs();C.setAttribute("id",this.element.id+"SVG_tooltip_definition"),d.appendChild(C),C.innerHTML=A}return c.setAttribute("stroke",this.border.color),this.changeText(new v(x,b),m,!f&&!u&&!m),new g(m,!f&&!u&&!m)},h.prototype.changeText=function(t,e,i){var r=document.getElementById(this.element.id+"_text");e&&r.setAttribute("transform","translate(0,"+this.arrowPadding+")"),i&&r.setAttribute("transform","translate("+this.arrowPadding+" 0)")},h.prototype.findFormattedText=function(){this.formattedText=[],""!==this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim()&&(this.formattedText=this.formattedText.concat(this.header)),this.formattedText=this.formattedText.concat(this.content)},h.prototype.renderText=function(t){var i,o,a,h,p,d=0,c=0,y=0,g=e.extend({},this.textStyle,null,!0).properties,f=n(this.element.id+"_group"),x="";this.findFormattedText();var v="rtl"===document.body.getAttribute("dir")?"end":"start";this.leftSpace=this.areaBounds.x+this.location.x,this.rightSpace=this.areaBounds.x+this.areaBounds.width-this.leftSpace;var b=this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim(),w=this.header.indexOf("<b>")>-1&&this.header.indexOf("</b>")>-1,S=r(this.formattedText[0],g).width+2*this.marginX+this.arrowPadding,P=this.location.x-S<this.location.x,L=this.areaBounds.x+this.areaBounds.width<this.location.x+S,O=""!==b?this.marginY:0,T=!0,A=!0;this.markerPoint=[];var C,k=this.shapes.length>0?10:0,E=this.shapes.length>0?5:0,B="Normal",N=this.themeStyle.tooltipLightLabel,z=22/parseFloat("13px")*parseFloat(g.size);t&&!this.isCanvas||(s(this.element.id+"_text"),s(this.element.id+"_header_path"),s(this.element.id+"_trackball_group"),s(this.element.id+"SVG_tooltip_definition"));for(var F=new m(this.element.id+"_text",2*this.marginX,2*this.marginY+2*this.padding+(2===this.marginY?3:0),v,""),_=l(F,g,null,f),I=1===this.formattedText.length&&this.formattedText[0].indexOf(" : <b>")>-1,R=""!==this.header,j=R&&w?16:13,M=0,D=this.formattedText.length;M<D;M++)if(a=this.formattedText[M].replace(/<(b|strong)>/g,"<b>").replace(/<\/(b|strong)>/g,"</b>").split(/<br.*?>/g),0===M&&!I&&this.isTextWrap&&(this.leftSpace<S||P)&&(this.rightSpace<S||L)&&(C=Math.round(this.leftSpace>this.rightSpace?this.leftSpace/j:this.rightSpace/j),a=(""!==b?b:this.formattedText[M]).match(new RegExp(".{1,"+C+"}","g")),this.wrappedText=w?"<b>"+a.join("<br>")+"</b>":a.join("<br>"),this.isWrap=a.length>1),""!==a[0]){0===M&&""!==b||this.markerPoint.push((""!==b?this.marginY:0)+F.y+d);for(var V=0,G=a.length;V<G;V++){y=0,A=!0,d+=z;for(var U=0,W=(i=a[V].replace(/<b>/g,"<br><b>").replace(/<\/b>/g,"</b><br>").replace(/:/g,"<br>:<br>").split("<br>")).length;U<W;U++)h=i[U],/\S/.test(h)||""===h||(h=" "),(!A&&" "===h||""!==h.replace(/<b>/g,"").replace(/<\/b>/g,"").trim())&&(y+=" "!==h?4:0,A&&!T?(p={x:2*this.marginX+(k+E),dy:z+(A?O:0),fill:""},O=null):p=T&&A?{x:""===b?2*this.marginX+(k+E):2*this.marginX+(this.isWrap?k+E:0)}:{},A=!1,o=this.renderer.createTSpan(p,""),_.appendChild(o),h.indexOf("<b>")>-1||w&&0===U&&0===M&&(R||this.isWrap)?(B="bold",N=this.themeStyle.tooltipBoldLabel,x="font-weight:"+B,g.fontWeight=B,o.setAttribute("fill",this.textStyle.color||N)):(x="bold"===B?"font-weight:"+B:"",g.fontWeight=B,o.setAttribute("fill",this.textStyle.color||N)),(h.indexOf("</b>")>-1||w&&U===W-1&&0===M&&(R||this.isWrap))&&(B="Normal",N=this.themeStyle.tooltipLightLabel),o.textContent=h=this.getTooltipTextContent(h),y+=r(h,g).width,""!==x&&(o.style.fontWeight=x.split("font-weight:")[1],o.style.color=o.getAttribute("fill")),o.style.fontFamily="inherit",o.style.fontStyle="inherit",o.style.fontSize="inherit",T=!1);y-=4,c=Math.max(c,y)}}this.elementSize=new u(c+(c>0?2*this.marginX:0),d),this.elementSize.width+=k+E;var Q=_.childNodes[0];if(""!==b&&Q&&!this.isWrap){g.fontWeight="bold";var H=(this.elementSize.width+2*this.padding)/2-r(b,g).width/2;Q.setAttribute("x",H.toString())}},h.prototype.getTooltipTextContent=function(t){var i=t.match(/<[a-zA-Z\/](.|\n)*?>/g);if(e.isNullOrUndefined(i))return t;for(var r=/[\u0590-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(t),o=0;o<i.length;o++)this.isValidHTMLElement(i[o].replace("<","").replace("/","").replace(">","").trim())&&(t=t.replace(i[o],r?"":""));return t},h.prototype.isValidHTMLElement=function(t){return"[object HTMLUnknownElement]"!=document.createElement(t).toString()},h.prototype.createTemplate=function(t,i){var r={cancel:!1,name:"tooltipRender",tooltip:this};this.trigger("tooltipRender",r);var o=document.getElementById(this.element.id);this.isCanvas&&this.removeSVG();var s=o.firstElementChild;if(s&&e.remove(s),r.cancel)e.remove(n(this.element.id+"_tooltip"));else{for(var a=e.createElement("div",{id:this.element.id+"parent_template"}),h=this.templateFn(this.data,this.controlInstance,a.id,a.id+"_blazorTemplate","");h&&h.length>0;)e.isBlazor()||1===h.length?(a.appendChild(h[0]),h=null):a.appendChild(h[0]);o.appendChild(a);var l=this.isCanvas?a:this.element,p=l.getBoundingClientRect();this.padding=0,this.elementSize=new u(p.width,p.height);var d=this.shared?this.sharedTooltipLocation(t,this.location.x,this.location.y):this.tooltipLocation(t,i,new v(0,0),new v(0,0));if(!this.enableAnimation||this.shared||this.isFirst?this.updateDiv(l,d.x,d.y):this.animateTooltipDiv(this.element,d),this.blazorTemplate){var c=function(){var e=n(y.element.id).getBoundingClientRect();y.elementSize=new u(e.width,e.height);var r=y.tooltipLocation(t,i,new v(0,0),new v(0,0));y.updateDiv(n(y.element.id),r.x,r.y)},y=this;c.bind(y,t,i),e.updateBlazorTemplate(this.element.id+"parent_template_blazorTemplate",this.blazorTemplate.name,this.blazorTemplate.parent,void 0,c)}}},h.prototype.sharedTooltipLocation=function(t,e,i){var r=this.elementSize.width+2*this.marginX,o=this.elementSize.height+2*this.marginY,n=new y(e+2*this.padding,i-o-this.padding,r,o);return n.y<t.y&&(n.y+=n.height+2*this.padding),n.x+n.width>t.x+t.width&&(n.x-=n.width+4*this.padding),n},h.prototype.getCurrentPosition=function(t,e,i,r){var o=this.tooltipPlacement,n=this.clipBounds.x,s=this.clipBounds.y,a=this.offset,h=this.elementSize.width+2*this.marginX,l=this.elementSize.height+2*this.marginY,p=new v(e.x,e.y);return"Top"===o||"Bottom"===o?(p=new v(p.x+n-this.elementSize.width/2-this.padding,p.y+s-this.elementSize.height-2*this.padding-this.arrowPadding-a),i.x=r.x=h/2,"Bottom"===o&&(p.y=e.y+s+a),t.x+t.width<p.x+h?(p.x=t.width>h?t.x+t.width-h+6:t.x,i.x=r.x=t.width>h?t.x+e.x-p.x:e.x):t.x>p.x&&(p.x=t.x,i.x=r.x=e.x)):(p=new v(p.x+n+a,p.y+s-this.elementSize.height/2-this.padding),i.y=r.y=l/2,"Left"===o&&(p.x=e.x+n-a-(h+this.arrowPadding)),t.y+t.height<p.y+l?(p.y=t.height>l?t.y+t.height-l+6:t.y,i.y=r.y=t.height>l?t.y+e.y-p.y:e.y):t.y>p.y&&(p.y=t.y,i.y=r.y=e.y)),new y(p.x,p.y,h,l)},h.prototype.tooltipLocation=function(t,i,r,o){if(!e.isNullOrUndefined(this.tooltipPlacement))return this.getCurrentPosition(t,i,r,o);var n=new v(i.x,i.y),s=this.elementSize.width+2*this.marginX,a=this.elementSize.height+2*this.marginY,h=this.offset,l=this.clipBounds.x,p=this.clipBounds.y,d=t.x,c=t.y;return this.inverted?(n=new v(n.x+l+h,n.y+p-this.elementSize.height/2-this.padding),r.y=o.y=a/2,(n.x+s+this.arrowPadding>d+t.width||this.isNegative)&&(n.x=(i.x>t.width?t.width:i.x)+l-h-(s+this.arrowPadding)),n.x<d&&(n.x=(i.x<0?0:i.x)+l+h),n.y<=c&&(r.y-=c-n.y,o.y-=c-n.y,n.y=c),n.y+a>=c+t.height&&(r.y+=n.y+a-(c+t.height),o.y+=n.y+a-(c+t.height),n.y-=n.y+a-(c+t.height)),r.y+this.arrowPadding/2>a-this.ry&&(r.y=a-this.ry-this.arrowPadding/2,o.y=a,this.tipRadius=0),r.y-this.arrowPadding/2<this.ry&&(r.y=this.ry+this.arrowPadding/2,o.y=0,this.tipRadius=0)):(n=new v(n.x+l-this.elementSize.width/2-this.padding,n.y+p-this.elementSize.height-2*this.padding-this.arrowPadding-h),r.x=o.x=s/2,(n.y<c||this.isNegative)&&(n.y=(i.y<0?0:i.y)+p+h),n.y+a+this.arrowPadding>c+t.height&&(n.y=Math.min(i.y,c+t.height)+p-this.elementSize.height-2*this.padding-this.arrowPadding-h),o.x=s/2,n.x<d&&(r.x-=d-n.x,o.x-=d-n.x,n.x=d),n.x+s>d+t.width&&(r.x+=n.x+s-(d+t.width),o.x+=n.x+s-(d+t.width),n.x-=n.x+s-(d+t.width)),r.x+this.arrowPadding/2>s-this.rx&&(r.x=s-this.rx-this.arrowPadding/2,o.x=s,this.tipRadius=0),r.x-this.arrowPadding/2<this.rx&&(r.x=this.rx+this.arrowPadding/2,o.x=0,this.tipRadius=0)),new y(n.x,n.y,s,a)},h.prototype.animateTooltipDiv=function(t,i){var r,o=this,n=parseFloat(t.style.left),s=parseFloat(t.style.top);new e.Animation({}).animate(t,{duration:this.duration,progress:function(e){r=e.timeStamp/e.duration,t.style.animation=null,t.style.left=n+r*(i.x-n)+"px",t.style.top=s+r*(i.y-s)+"px"},end:function(e){o.updateDiv(t,i.x,i.y),o.trigger("animationComplete",{tooltip:o})}})},h.prototype.updateDiv=function(t,e,i){t.style.left=e+"px",t.style.top=i+"px"},h.prototype.updateTemplateFn=function(){if(this.template)try{document.querySelectorAll(this.template).length&&(this.templateFn=e.compile(document.querySelector(this.template).innerHTML.trim()))}catch(t){this.templateFn=e.compile(this.template)}},h.prototype.fadeOut=function(){var t=this,i=n(this.isCanvas&&!this.template?this.element.id+"_svg":this.element.id);if(i){var r=i.firstChild;if(this.isCanvas&&!this.template&&(r=document.getElementById(this.element.id+"_group")?document.getElementById(this.element.id+"_group"):r),!r)return null;var o=parseFloat(r.getAttribute("opacity"))||1;new e.Animation({}).animate(r,{duration:200,progress:function(e){t.progressAnimation(r,o,e.timeStamp/e.duration)},end:function(){t.fadeOuted=!0,t.endAnimation(r)}})}},h.prototype.progressAnimation=function(t,e,i){t.style.animation="",t.setAttribute("opacity",(e-i).toString())},h.prototype.endAnimation=function(t){t.setAttribute("opacity","0"),this.template&&(t.style.display="none"),this.trigger("animationComplete",{tooltip:this})},h.prototype.getPersistData=function(){var t=[];return this.addOnPersist(t)},h.prototype.getModuleName=function(){return"tooltip"},h.prototype.destroy=function(){t.prototype.destroy.call(this),this.element.classList.remove("e-tooltip")},h.prototype.onPropertyChanged=function(t,i){this.blazorTemplate&&e.resetBlazorTemplate(this.element.id+"parent_template_blazorTemplate"),this.isFirst=!1,this.render()},w([e.Property(!1)],h.prototype,"enable",void 0),w([e.Property(!1)],h.prototype,"shared",void 0),w([e.Property(!0)],h.prototype,"enableShadow",void 0),w([e.Property(null)],h.prototype,"fill",void 0),w([e.Property("")],h.prototype,"header",void 0),w([e.Property(.75)],h.prototype,"opacity",void 0),w([e.Complex({size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},S)],h.prototype,"textStyle",void 0),w([e.Property(null)],h.prototype,"template",void 0),w([e.Property(!0)],h.prototype,"enableAnimation",void 0),w([e.Property(300)],h.prototype,"duration",void 0),w([e.Property(!1)],h.prototype,"inverted",void 0),w([e.Property(!1)],h.prototype,"isNegative",void 0),w([e.Complex({color:"#cccccc",width:.5},P)],h.prototype,"border",void 0),w([e.Property([])],h.prototype,"content",void 0),w([e.Property(10)],h.prototype,"markerSize",void 0),w([e.Complex({x:0,y:0},O)],h.prototype,"clipBounds",void 0),w([e.Property([])],h.prototype,"palette",void 0),w([e.Property([])],h.prototype,"shapes",void 0),w([e.Complex({x:0,y:0},O)],h.prototype,"location",void 0),w([e.Property(0)],h.prototype,"offset",void 0),w([e.Property(2)],h.prototype,"rx",void 0),w([e.Property(2)],h.prototype,"ry",void 0),w([e.Property(5)],h.prototype,"marginX",void 0),w([e.Property(5)],h.prototype,"marginY",void 0),w([e.Property(12)],h.prototype,"arrowPadding",void 0),w([e.Property(null)],h.prototype,"data",void 0),w([e.Property("Material")],h.prototype,"theme",void 0),w([e.Complex({x:0,y:0,width:0,height:0},L)],h.prototype,"areaBounds",void 0),w([e.Property(null)],h.prototype,"availableSize",void 0),w([e.Property()],h.prototype,"blazorTemplate",void 0),w([e.Property(!1)],h.prototype,"isCanvas",void 0),w([e.Property(!1)],h.prototype,"isTextWrap",void 0),w([e.Property(null)],h.prototype,"tooltipPlacement",void 0),w([e.Property(null)],h.prototype,"controlInstance",void 0),w([e.Event()],h.prototype,"tooltipRender",void 0),w([e.Event()],h.prototype,"loaded",void 0),w([e.Event()],h.prototype,"animationComplete",void 0),h=w([e.NotifyPropertyChanges],h)}(e.Component);return t.TextStyle=S,t.TooltipBorder=P,t.AreaBounds=L,t.ToolLocation=O,t.Tooltip=T,t.getTooltipThemeColor=i,t.measureText=r,t.findDirection=o,t.Size=u,t.Rect=y,t.Side=g,t.CustomizeOption=f,t.TextOption=m,t.getElement=n,t.removeElement=s,t.drawSymbol=a,t.calculateShapes=h,t.PathOption=x,t.textElement=l,t.TooltipLocation=v,t.SvgRenderer=p,t.CanvasRenderer=d,t}({},ej.base),this.ejs=ej;
- /*!
- * filename: ej2-charts.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.charts=function(e,t,i,r,o,n,a,s,l){"use strict";function h(e){var t;switch(e){case"Fabric":t=["#4472c4","#ed7d31","#ffc000","#70ad47","#5b9bd5","#c1c1c1","#6f6fe2","#e269ae","#9e480e","#997300"];break;case"Bootstrap4":case"Bootstrap":t=["#a16ee5","#f7ce69","#55a5c2","#7ddf1e","#ff6ea6","#7953ac","#b99b4f","#407c92","#5ea716","#b91c52"];break;case"HighContrastLight":case"Highcontrast":case"HighContrast":t=["#79ECE4","#E98272","#DFE6B6","#C6E773","#BA98FF","#FA83C3","#00C27A","#43ACEF","#D681EF","#D8BC6E"];break;case"MaterialDark":t=["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"];break;case"FabricDark":t=["#4472c4","#ed7d31","#ffc000","#70ad47","#5b9bd5","#c1c1c1","#6f6fe2","#e269ae","#9e480e","#997300"];break;case"BootstrapDark":t=["#a16ee5","#f7ce69","#55a5c2","#7ddf1e","#ff6ea6","#7953ac","#b99b4f","#407c92","#5ea716","#b91c52"];break;case"Tailwind":t=["#5A61F6","#65A30D","#334155","#14B8A6","#8B5CF6","#0369A1","#F97316","#9333EA","#F59E0B","#15803D"];break;case"TailwindDark":t=["#8B5CF6","#22D3EE","#F87171","#4ADE80","#E879F9","#FCD34D","#F97316","#2DD4BF","#F472B6","#10B981"];break;default:t=["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"]}return t}function c(e){var t,i="MaterialDark"===e?"#303030":"FabricDark"===e?"#201F1F":"1A1A1A";switch(e){case"HighContrastLight":case"Highcontrast":case"HighContrast":t={axisLabel:"#ffffff",axisTitle:"#ffffff",axisLine:"#ffffff",majorGridLine:"#BFBFBF",minorGridLine:"#969696",majorTickLine:"#BFBFBF",minorTickLine:"#969696",chartTitle:"#ffffff",legendLabel:"#ffffff",background:"#000000",areaBorder:"#ffffff",errorBar:"#ffffff",crosshairLine:"#ffffff",crosshairFill:"#ffffff",crosshairLabel:"#000000",tooltipFill:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696",markerShadow:"#BFBFBF",selectionRectFill:"rgba(255, 217, 57, 0.3)",selectionRectStroke:"#ffffff",selectionCircleStroke:"#FFD939"};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":t={axisLabel:"#DADADA",axisTitle:"#ffffff",axisLine:" #6F6C6C",majorGridLine:"#414040",minorGridLine:"#514F4F",majorTickLine:"#414040",minorTickLine:" #4A4848",chartTitle:"#ffffff",legendLabel:"#DADADA",background:i,areaBorder:" #9A9A9A",errorBar:"#ffffff",crosshairLine:"#F4F4F4",crosshairFill:"#F4F4F4",crosshairLabel:"#282727",tooltipFill:"#F4F4F4",tooltipBoldLabel:"#282727",tooltipLightLabel:"#333232",tooltipHeaderLine:"#9A9A9A",markerShadow:null,selectionRectFill:"rgba(56,169,255, 0.1)",selectionRectStroke:"#38A9FF",selectionCircleStroke:"#282727"};break;case"Bootstrap4":t={axisLabel:"#212529",axisTitle:"#212529",axisLine:"#CED4DA",majorGridLine:"#CED4DA",minorGridLine:"#DEE2E6",majorTickLine:"#ADB5BD",minorTickLine:"#CED4DA",chartTitle:"#212529",legendLabel:"#212529",background:"#FFFFFF",areaBorder:"#DEE2E6",errorBar:"#000000",crosshairLine:"#6C757D",crosshairFill:"#495057",crosshairLabel:"#FFFFFF",tooltipFill:"rgba(0, 0, 0, 0.9)",tooltipBoldLabel:"rgba(255,255,255)",tooltipLightLabel:"rgba(255,255,255, 0.9)",tooltipHeaderLine:"rgba(255,255,255, 0.2)",markerShadow:null,selectionRectFill:"rgba(255,255,255, 0.1)",selectionRectStroke:"rgba(0, 123, 255)",selectionCircleStroke:"#495057"};break;case"Tailwind":t={axisLabel:"#6B728",axisTitle:"#374151",axisLine:" #D1D5DB",majorGridLine:"#E5E7EB",minorGridLine:"#E5E7EB",majorTickLine:"#D1D5DB",minorTickLine:" #D1D5DB",chartTitle:"#374151",legendLabel:"#374151",background:"rgba(255,255,255, 0.0)",areaBorder:" #E5E7EB",errorBar:"#374151",crosshairLine:"#1F2937",crosshairFill:"#111827",crosshairLabel:"#F9FAFB",tooltipFill:"#111827",tooltipBoldLabel:"#D1D5DB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#6B7280",markerShadow:null,selectionRectFill:"rgba(79,70,229, 0.1)",selectionRectStroke:"#4F46E5",selectionCircleStroke:"#6B7280"};break;case"TailwindDark":t={axisLabel:"#9CA3AF",axisTitle:"#9CA3AF",axisLine:" #4B5563",majorGridLine:"#374151",minorGridLine:"#374151",majorTickLine:"#4B5563",minorTickLine:" #4B5563",chartTitle:"#D1D5DB",legendLabel:"#D1D5DB",background:"rgba(255,255,255, 0.0)",areaBorder:" #374151",errorBar:"#374151",crosshairLine:"#9CA3AF",crosshairFill:"#F9FAFB",crosshairLabel:"#1F2937",tooltipFill:"#F9FAFB",tooltipBoldLabel:"#6B7280",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#9CA3AF",markerShadow:null,selectionRectFill:"rgba(34,211,238, 0.1)",selectionRectStroke:"#22D3EE",selectionCircleStroke:"#282727"};break;default:t={axisLabel:"#686868",axisTitle:"#424242",axisLine:"#b5b5b5",majorGridLine:"#dbdbdb",minorGridLine:"#eaeaea",majorTickLine:"#b5b5b5",minorTickLine:"#d6d6d6",chartTitle:"#424242",legendLabel:"#353535",background:"#FFFFFF",areaBorder:"Gray",errorBar:"#000000",crosshairLine:"#4f4f4f",crosshairFill:"#4f4f4f",crosshairLabel:"#e5e5e5",tooltipFill:"rgba(0, 8, 22, 0.75)",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff",markerShadow:null,selectionRectFill:"rgba(41, 171, 226, 0.1)",selectionRectStroke:"#29abe2",selectionCircleStroke:"#29abe2"}}return t}function d(e){var t;switch(e){case"HighContrastLight":t={backRect:"#333",thumb:"#bfbfbf",circle:"#fff",circleHover:"#685708",arrow:"#333",grip:"#333",arrowHover:"#fff",backRectBorder:"#969696"};break;case"Bootstrap":t={backRect:"#f5f5f5",thumb:"#e6e6e6",circle:"#fff",circleHover:"#eee",arrow:"#8c8c8c",grip:"#8c8c8c"};break;case"Fabric":t={backRect:"#f8f8f8",thumb:"#eaeaea",circle:"#fff",circleHover:"#eaeaea",arrow:"#a6a6a6",grip:"#a6a6a6"};break;default:t={backRect:"#f5f5f5",thumb:"#e0e0e0",circle:"#fff",circleHover:"#eee",arrow:"#9e9e9e",grip:"#9e9e9e"}}return t}function p(e,i,r){var o=t.extend([],e,null);return o.sort(function(e,t){for(var o=0,n=0,a=0;a<i.length;a++)o+=e[i[a]],n+=t[i[a]];return!r&&o<n||r&&o>n?-1:o===n?0:1}),o}function u(e){return-1!==e.indexOf("<br>")}function g(e){for(var i,r=t.extend([],e.points,null,!0),o=[],n=0,a=0;a<r.length;a++)i=r[a],t.isNullOrUndefined(i.x)||""===i.x||(i.index=n++,o.push(i));return o}function y(e,r,o,n){var a,s,l,h,c,d=new i.SvgRenderer(n.element.id),p=[],g={id:"rotate_text",x:n.initialClipRect.x,y:n.initialClipRect.y,"font-size":e.size,"font-style":e.fontStyle,"font-family":e.fontFamily,"font-weight":e.fontWeight,transform:"rotate("+o+", 0, 0)","text-anchor":"middle"};a=u(r)?(p=r.split("<br>"))[0]:r;var y=d.createText(g,a);if(n.delayRedraw||n.redraw||n.element.appendChild(n.svgObject),"string"!=typeof p&&p.length>1)for(var m=1,v=p.length;m<v;m++)s=i.measureText(p[m],e).height,l=g.y+m*s,h=p[m],c=d.createTSpan({x:g.x,id:g.id,y:l},h),y.appendChild(c);n.svgObject.appendChild(y);var f=y.getBoundingClientRect();return t.remove(y),n.delayRedraw||n.redraw||t.remove(n.svgObject),new i.Size(f.right-f.left,f.bottom-f.top)}function m(e){if(!e)return null;var i="string"==typeof e?he(e):e;i&&t.remove(i)}function v(e,t){return Math.log(e)/Math.log(t)}function f(e,r,o,n,a,s,l,h){var c=document.getElementById(a),d=i.measureText(e,{fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"Regular"}),p=d.width+5;r=r+p>n?r-(p+15):r,o=h?o-d.height/2:o+15,c?(c.innerHTML=e,c.style.top=o.toString()+"px",c.style.left=(r+15).toString()+"px"):(c=t.createElement("div",{innerHTML:e,id:a,styles:"top:"+o.toString()+"px;left:"+(r+15).toString()+'px;background-color: rgb(255, 255, 255) !important; color:black !important; position:absolute;border:1px solid rgb(112, 112, 112); padding-left : 3px; padding-right : 2px;padding-bottom : 2px; padding-top : 2px; font-size:12px; font-family: "Segoe UI"'}),s.appendChild(c),parseInt(c.style.left.replace("px",""),10)<0&&(c.style.left="0px")),l&&setTimeout(function(){m(a)},1500)}function b(e,t){return e<t.max&&e>t.min}function x(e,t){return e<=t.max&&e>=t.min}function w(e,t){return"Logarithmic"===t.valueType?v(e,t.logBase):e}function S(e,t,i,r){var o=w(t.xValue,r.xAxis),n=e?w(e.xValue,r.xAxis):o,a=i?w(i.xValue,r.xAxis):o,s=Math.floor(r.xAxis.visibleRange.min),l=Math.ceil(r.xAxis.visibleRange.max);return n>=s&&n<=l||o>=s&&o<=l||a>=s&&a<=l||s>=n&&s<=a}function C(e){for(var t=0,i=0,r=e;i<r.length;i++)t+=r[i];return t}function P(e,i,r,o,n){var a=0;if(null!==o)for(s=i+1;s<r;s++)-1===o.indexOf(s)&&(a+=e[s][n.yName]);else for(var s=i+1;s<r;s++)t.isNullOrUndefined(e[s][n.yName])||(a+=e[s][n.yName]);return a}function L(e,t){return e.x+=t.left,e.y+=t.top,e.width-=t.left+t.right,e.height-=t.top+t.bottom,e}function R(e,t){return e.x+=t.x,e.y+=t.y,e.width-=t.x+t.width,e.height-=t.y+t.height,e}function M(e,t,i){var r=e*Math.PI/180;return new Vi(Math.cos(r)*t+i.x,Math.sin(r)*t+i.y)}function A(e){return e*(Math.PI/180)}function k(e,t,i,r){for(var o=[],n=0;n<4;n++){var a=e[n],s=a.x-t,l=a.y-i,h=s*Math.cos(A(r))-l*Math.sin(A(r)),c=s*Math.sin(A(r))+l*Math.cos(A(r));a.x=h+t,a.y=c+i,o.push(new Vi(a.x,a.y))}return o}function T(e,i){var r,o,n,a,s,l,h,c,d=[e,i];for(a=0;a<d.length;a++){var p=d[a];for(s=0;s<p.length;s++){var u=(s+1)%p.length,g=p[s],y=p[u],m=new Vi(y.y-g.y,g.x-y.x);for(r=o=void 0,l=0;l<e.length;l++)n=m.x*e[l].x+m.y*e[l].y,(t.isNullOrUndefined(r)||n<r)&&(r=n),(t.isNullOrUndefined(o)||n>o)&&(o=n);for(h=c=void 0,l=0;l<i.length;l++)n=m.x*i[l].x+m.y*i[l].y,(t.isNullOrUndefined(h)||n<h)&&(h=n),(t.isNullOrUndefined(c)||n>c)&&(c=n);if(o<h||c<r)return!1}}return!0}function _(e,t,i,r,o,n){var a=M(270,i,new Vi(e,t)),s=M(270,i,new Vi(e+o/10,t));return"M "+e+" "+t+" L "+(e+i)+" "+t+" A "+i+" "+i+" 0 1 1 "+a.x+" "+a.y+" Z M "+(e+o/10)+" "+(t-r/10)+" L"+(e+i)+" "+(t-r/10)+" A "+i+" "+i+" 0 0 0 "+s.x+" "+s.y+" Z"}function O(e,t){var i=Math.atan2(t.y-e.y,t.x-e.x);return(i=i<0?6.283+i:i)*(180/Math.PI)}function E(e,t){for(var i=[],r=0;r<=t-1;r++)i.push(e[r]);return i}function I(e,t){var i=t.visibleRange,r=(e-i.min)/i.delta;return t.isInversed?1-r:r}function z(e,t,i,r,o,n){e="Logarithmic"===i.valueType?v(e>1?e:1,i.logBase):e,t="Logarithmic"===r.valueType?v(t>1?t:1,r.logBase):t,e+="Category"===i.valueType&&"BetweenTicks"===i.labelPlacement&&"Radar"!==n.type?.5:0;var a=n.chart.radius*I(t,r),s=B(F(e,i),n.chart.primaryXAxis.startAngle);return{x:n.clipRect.width/2+n.clipRect.x+a*s.x,y:n.clipRect.height/2+n.clipRect.y+a*s.y}}function D(e,t){void 0===t&&(t=!1);var i=["NaN","NaN"];return e.indexOf("_Point_")>-1?i=e.split("_Series_")[1].split("_Point_"):e.indexOf("_shape_")>-1&&(!t||t&&-1===e.indexOf("_legend_"))?(i=e.split("_shape_"))[0]="0":e.indexOf("_text_")>-1&&(!t||t&&-1===e.indexOf("_legend_"))&&((i=e.split("_text_"))[0]="0"),new Jt(parseInt(i[0],10),parseInt(i[1],10))}function B(e,t){t=t<0?t+360:t;var i=Math.PI*(1.5-2*e);return i+=t*Math.PI/180,{x:Math.cos(i),y:Math.sin(i)}}function F(e,t){var i,r,o=t.visibleRange;return"Category"!==t.valueType?(i=o.max-("DateTime"===t.valueType?t.dateTimeInterval:o.interval)-o.min,r=t.visibleLabels.length-1,i=0===i?1:i):(i=1===t.visibleLabels.length?1:t.visibleLabels[t.visibleLabels.length-1].value-t.visibleLabels[0].value,r=t.visibleLabels.length),t.isInversed?(e-o.min)/i*(1-1/r):1-(e-o.min)/i*(1-1/r)}function N(e,i,r,o,n){var a=he(e),s="top:"+r.toString()+"px;left:"+o.toString()+"px;color:black !important; background:#FFFFFF !important; position:absolute;border:1px solid #707070;font-size:"+n+";border-radius:2px; z-index:1";a?(a.setAttribute("innerHTML"," "+i+" "),a.setAttribute("styles",s)):(a=t.createElement("div",{id:e,innerHTML:" "+i+" ",styles:s}),document.body.appendChild(a))}function V(e,t,r,o,n,a){for(var s,l,h,c,d,p=t.opposedPosition,u=n?"start":"auto",g=e.availableSize.width,y=t.scrollbarSettings.enable||t.zoomingScrollBar&&t.zoomingScrollBar.svgObject?t.scrollBarHeight:0,m=0;m<2;m++)s=i.measureText(m?t.endLabel:t.startLabel,t.labelStyle),n?(c=m?new Vi(a.x-y,a.y+3):new Vi(t.rect.x-y,a.y+a.height-3),l=a.x+(p?a.width+5+y:-(s.width+5+5+y)),h=a.y+(m?0:a.height-s.height-5),l+=l<0||g<l+s.width+5?p?-s.width/2:s.width/2:0,d=i.findDirection(3,3,new i.Rect(l,h,s.width+5,s.height+5),c,5,!1,!1,!p,c.x,c.y+(m?-3:3))):(c=m?new Vi(a.x+a.width-3,a.y+a.height+y):new Vi(a.x+3,a.y+a.height+y),l=a.x+(m?a.width-s.width-5:0),h=p?a.y-s.height-10-y:a.y+a.height+5+y,d=i.findDirection(3,3,new i.Rect(l,h,s.width+5,s.height+5),c,5,p,!p,!1,c.x+(m?3:-3),c.y)),l+=2.5,h=h+s.height/4*3+2.5,r.appendChild(e.renderer.drawPath(new i.PathOption(e.element.id+"_Zoom_"+o+"_AxisLabel_Shape_"+m,e.themeStyle.crosshairFill,2,e.themeStyle.crosshairFill,1,null,d))),Ve(e.renderer,new i.TextOption(e.element.id+"_Zoom_"+o+"_AxisLabel_"+m,l,h,u,m?t.endLabel:t.startLabel),{color:e.themeStyle.crosshairLabel,fontFamily:"Segoe UI",fontWeight:"Regular",size:"11px"},e.themeStyle.crosshairLabel,r);return r}function j(e,t,i,r,o){return void 0===r&&(r=0),void 0===o&&(o=0),e>=i.x-r&&e<=i.x+i.width+r&&t>=i.y-o&&t<=i.y+i.height+o}function H(e,t,i){return(i.isInversed?1-e/t:e/t)*i.visibleRange.delta+i.visibleRange.min}function X(e,t,i){return(i.isInversed?e/t:1-e/t)*i.visibleRange.delta+i.visibleRange.min}function Y(e){var t=e.clipRect;e.chart.requireInvertedAxis?(t.x=e.yAxis.rect.x,t.y=e.xAxis.rect.y,t.width=e.yAxis.rect.width,t.height=e.xAxis.rect.height):(t.x=e.xAxis.rect.x,t.y=e.yAxis.rect.y,t.width=e.xAxis.rect.width,t.height=e.yAxis.rect.height)}function G(e){return e.substr(0,1).toLowerCase()+e.substr(1)}function W(e,t,r){var o,n,a,s;return r?(o=t.rect.x,n=e.rect.y,a=t.rect.width,s=e.rect.height):(o=e.rect.x,n=t.rect.y,a=e.rect.width,s=t.rect.height),new i.Rect(o,n,a,s)}function U(e,i){for(var r,o,n,a=Number.MAX_VALUE,s=0;s<i.length;s++){var l=i[s];if(r=[],l.visible&&(e.name===l.xAxisName||"primaryXAxis"===e.name&&null===l.xAxisName||e.name===l.chart.primaryXAxis.name&&!l.xAxisName))if((r=l.points.map(function(e){return e.xValue})).sort(function(e,t){return e-t}),1===r.length)n="DateTime"===e.valueType&&l.xMin===l.xMax?l.xMin-2592e6:l.xMin,0!==(o=r[0]-(t.isNullOrUndefined(n)?e.visibleRange.min:n))&&(a=Math.min(a,o));else for(var h=0;h<r.length;h++){var c=r[h];h>0&&c&&0!==(o=c-r[h-1])&&(a=Math.min(a,o))}}return a===Number.MAX_VALUE&&(a=1),a}function Z(e){var t;switch(e){case"Linear":t=q}return t}function q(e,t,i,r){return-i*Math.cos(e/r*(Math.PI/2))+i+t}function Q(e,i,r,o,n,a,s){var l=a.x,h=a.y,c=0;e.style.visibility="hidden",new t.Animation({}).animate(e,{duration:r,delay:i,progress:function(t){t.timeStamp>t.delay&&(t.element.style.visibility="visible",c=(t.timeStamp-t.delay)/t.duration,e.setAttribute("transform","translate("+l+" "+h+") scale("+c+") translate("+-l+" "+-h+")"))},end:function(){e.style.visibility="","Scatter"!==o.type&&"Bubble"!==o.type||s||n!==o.points.length-1||o.chart.trigger("animationComplete",{series:o.chart.isBlazor?{}:o})}})}function $(e,r,o,n,a){var s=function(t){e.setAttribute("x",t.x+""),e.setAttribute("y",t.y+""),e.setAttribute("width",t.width+""),e.setAttribute("height",t.height+"")};new t.Animation({}).animate(t.createElement("div"),{duration:o,delay:r,progress:function(e){s(new i.Rect(q(e.timeStamp,a.x,n.x-a.x,e.duration),q(e.timeStamp,a.y,n.y-a.y,e.duration),q(e.timeStamp,a.width,n.width-a.width,e.duration),q(e.timeStamp,a.height,n.height-a.height,e.duration)))},end:function(){s(n)}})}function J(e,i,r,o,n){if(!r||!o&&!e)return null;var a=300;n&&(a=n);var s,l,h,c=o||e.getAttribute("d"),d=c.split(/(?=[LMCZAQ])/),p=i.split(/(?=[LMCZAQ])/),u=[],g=[];e.setAttribute("d",c),new t.Animation({}).animate(t.createElement("div"),{duration:a,progress:function(t){s="",d.map(function(e,i){if(u=e.split(" "),g=p[i]?p[i].split(" "):u,"Z"===u[0]?s+="Z ":s+=u[0]+" "+q(t.timeStamp,+u[1],+g[1]-+u[1],t.duration)+" "+q(t.timeStamp,+u[2],+g[2]-+u[2],t.duration)+" ","C"===u[0]||"Q"===u[0])for(l=3,h="Q"===u[0]?4:6;l<h;)s+=q(t.timeStamp,+u[l],+g[l]-+u[l],t.duration)+" "+q(t.timeStamp,+u[++l],+g[l]-+u[l],t.duration)+" ",++l;"A"===u[0]&&(s+="0 0 1 "+q(t.timeStamp,+u[6],+g[6]-+u[6],t.duration)+" "+q(t.timeStamp,+u[7],+g[7]-+u[7],t.duration)+" ")}),e.setAttribute("d",s)},end:function(){e.setAttribute("d",i)}})}function K(e,t,i,r){void 0===r&&(r="drawClipPath");var o=Fe(e,t.id,t,i);if(o){var n=i.createDefs();return n.appendChild(o),n}return i[r](t)}function ee(e,t,i,r,o){var n={cancel:!1,name:ai,axis:o,text:i,value:t,labelStyle:r};if(e.trigger(ai,n),!n.cancel){var a=-1!==n.text.indexOf("<br>"),s=o.enableTrim?a?De(o.maximumLabelWidth,n.text,o.labelStyle):ze(o.maximumLabelWidth,n.text,o.labelStyle):n.text;o.visibleLabels.push(new Ti(s,n.value,n.labelStyle,n.text))}}function te(e){return null!=e.minimum&&null!=e.maximum}function ie(e){return e.zoomFactor<1&&e.zoomPosition>=0}function re(e,i){var r="Horizontal"===i.orientation?e.width:e.height;if(t.isNullOrUndefined(i.desiredIntervals)){var o=("Horizontal"===i.orientation?.533:1)*i.maximumLabels;return o=Math.max(r*(o/100),1)}return i.desiredIntervals}function oe(e,i,r,o,n){new t.Animation({}).animate(e,{duration:r,delay:i,name:o,progress:function(e){e.element.style.visibility="visible"},end:function(e){n?t.remove(e.element):e.element.style.visibility="visible"}})}function ne(e,t,r,o,n,a,s,l,h,c){var d=s||new i.SvgRenderer(""),p=ae(e,r,t,n,o,h,c);return d["draw"+p.functionName](p.renderOption,l?new Int32Array([l.x,l.y]):null)}function ae(e,r,o,n,a,s,l){var h,c,d,p="Path",u=s,g=u&&"Circle"===o?r.width-2:r.width,y=u&&"Circle"===o?r.height-2:r.height,m=u?l.targetWidth:0,v=e.x,f=e.y,b=e.y+-y/2,x=e.x+-g/2;switch(o){case"Bubble":case"Circle":p="Ellipse",t.merge(n,{rx:g/2,ry:y/2,cx:v,cy:f});break;case"Cross":h="M "+x+" "+f+" L "+(v+g/2)+" "+f+" M "+v+" "+(f+y/2)+" L "+v+" "+(f+-y/2),t.merge(n,{d:h,stroke:n.fill});break;case"Multiply":h="M "+(v-m)+" "+(f-m)+" L "+(v+m)+" "+(f+m)+" M "+(v-m)+" "+(f+m)+" L "+(v+m)+" "+(f-m),t.merge(n,{d:h,stroke:n.fill});break;case"HorizontalLine":h="M "+x+" "+f+" L "+(v+g/2)+" "+f,t.merge(n,{d:h});break;case"VerticalLine":h="M "+v+" "+(f+y/2)+" L "+v+" "+(f+-y/2),t.merge(n,{d:h});break;case"Diamond":h="M "+x+" "+f+" L "+v+" "+(f+-y/2)+" L "+(v+g/2)+" "+f+" L "+v+" "+(f+y/2)+" L "+x+" "+f+" z",t.merge(n,{d:h});break;case"ActualRect":h="M "+x+" "+(f+-y/8)+" L "+(v+m)+" "+(f+-y/8)+" L "+(v+m)+" "+(f+y/8)+" L "+x+" "+(f+y/8)+" L "+x+" "+(f+-y/8)+" z",t.merge(n,{d:h});break;case"TargetRect":h="M "+(x+m)+" "+(f+-y/2)+" L "+(v+m/2)+" "+(f+-y/2)+" L "+(v+m/2)+" "+(f+y/2)+" L "+(x+m)+" "+(f+y/2)+" L "+(x+m)+" "+(f+-y/2)+" z",t.merge(n,{d:h});break;case"Rectangle":case"Hilo":case"HiloOpenClose":case"Candle":case"Waterfall":case"BoxAndWhisker":case"StepArea":case"StackingStepArea":case"Square":case"Flag":h="M "+x+" "+(f+-y/2)+" L "+(v+g/2)+" "+(f+-y/2)+" L "+(v+g/2)+" "+(f+y/2)+" L "+x+" "+(f+y/2)+" L "+x+" "+(f+-y/2)+" z",t.merge(n,{d:h});break;case"Pyramid":case"Triangle":h="M "+x+" "+(f+y/2)+" L "+v+" "+(f+-y/2)+" L "+(v+g/2)+" "+(f+y/2)+" L "+x+" "+(f+y/2)+" z",t.merge(n,{d:h});break;case"Funnel":case"InvertedTriangle":h="M "+(v+g/2)+" "+(f-y/2)+" L "+v+" "+(f+y/2)+" L "+(v-g/2)+" "+(f-y/2)+" L "+(v+g/2)+" "+(f-y/2)+" z",t.merge(n,{d:h});break;case"Pentagon":for(var w=0;w<=5;w++)c=g/2*Math.cos(Math.PI/180*(72*w)),d=y/2*Math.sin(Math.PI/180*(72*w)),h=0===w?"M "+(v+c)+" "+(f+d)+" ":h.concat("L "+(v+c)+" "+(f+d)+" ");h=h.concat("Z"),t.merge(n,{d:h});break;case"Image":p="Image",t.merge(n,{href:a,height:y,width:g,x:x,y:b})}return n=Ie(e,new i.Size(g,y),o,n).renderOption,{renderOption:n,functionName:p}}function se(e,t,r){var o=t.x<r.x?r.x:t.x>r.x+r.width?r.x+r.width:t.x,n=t.y<r.y?r.y:t.y>r.y+r.height?r.y+r.height:t.y;return new i.Rect(o>e.x?e.x:o,n>e.y?e.y:n,Math.abs(o-e.x),Math.abs(n-e.y))}function le(e,t,i){return e>i?i:e<t?t:e}function he(e){return document.getElementById(e)}function ce(e){var i=null;try{document.querySelectorAll(e).length&&(i=t.compile(document.querySelector(e).innerHTML.trim()))}catch(r){i=t.compile(e)}return i}function de(e,t,i,r,o,n,a,s,l,h){var c=e.getBoundingClientRect();t.accumulationDataLabelModule.calculateLabelSize(i,e,n,r,o,a,s,l,h,c,!0)}function pe(e,t,i,r,o,n){var a=document.getElementById(t.element.id+"_Series_"+(void 0===r.index?r.category:r.index)+"_DataLabelCollections");a&&(0===i.index&&(t.dataLabelCollections=[]),t.dataLabelModule.calculateTemplateLabelSize(a,e,i,r,r.marker.dataLabel,o,r.clipRect,n,!0))}function ue(e,t,i,r,o,n,a,s,l,h,c,d,p,u,g){var y,m=ce(i);try{var v=window.Blazor?a?o:{point:o}:{chart:r,series:n,point:o},f=a?a+"_template":"template",b=m?m(v,r,f,a||e.id.replace(/[^a-zA-Z0-9]/g,"")):[];if(b.length)for(var x=(y=Array.prototype.slice.call(b)).length,w=0;w<x;w++)e.appendChild(y[w]);var S=void 0;"accumulationchart"===r.getModuleName()?(S=de.bind(this,e,r,h,c,l,c[t],d,p,u,g),r.isReact&&r.renderReactTemplates(S)):"chart"===r.getModuleName()&&(S=o&&n?pe.bind(this,e,r,o,n,s,g):S,r.isReact&&r.renderReactTemplates(S))}catch(t){return e}return e}function ge(e){return"font-size:"+e.size+"; font-style:"+e.fontStyle+"; font-weight:"+e.fontWeight+"; font-family:"+e.fontFamily+";opacity:"+e.opacity+"; color:"+e.color+";"}function ye(e,i,r){void 0===i&&(i=!1),r||document.body.appendChild(e);var o=e.getBoundingClientRect();return i?t.remove(e):r||m(e.id),o}function me(e,t){for(var i,r=0,o=e.length;r<o;r++)e[r].id.indexOf(t)>-1&&(i=e[r]);return i}function ve(e,t,i,r,o){e="Logarithmic"===i.valueType?v(e>0?e:Math.pow(i.logBase,i.visibleRange.min),i.logBase):e,t="Logarithmic"===r.valueType?v(t>0?t:Math.pow(r.logBase,r.visibleRange.min),r.logBase):t,e=I(e,i),t=I(t,r);var n=o?i.rect.height:i.rect.width,a=o?r.rect.width:r.rect.height;return new Vi(o?t*a:e*n,o?(1-e)*n:(1-t)*a)}function fe(e,t,i,r,o,n){if(void 0===i&&(i=!1),void 0===r&&(r=!1),void 0===o&&(o="x"),void 0===n&&(n="y"),!(e&&e.hasChildNodes()&&t))return null;be(!1,t,e,i,r,o,n)}function be(e,t,r,o,n,a,s,l,h,c,d,p,u){if(void 0===n&&(n=!1),void 0===a&&(a="x"),void 0===s&&(s="y"),void 0===c&&(c=!1),void 0===d&&(d=!1),void 0===p&&(p=null),e)return null;var g=t.querySelector("#"+r.id),y=g||he(r.id),m=r,v=u||300;o&&n&&y?(l=l||("DIV"===y.tagName?new Vi(+y.style[a].split("px")[0],+y.style[s].split("px")[0]):new Vi(+y.getAttribute(a),+y.getAttribute(s))),h&&"undefined"!==h?J(r,r.getAttribute("d"),o,h,v):d&&p?$(m,0,v,new i.Rect(+y.getAttribute("x"),+y.getAttribute("y"),+y.getAttribute("width"),+y.getAttribute("height")),p):Ne(m,v,l,"DIV"===m.tagName?new Vi(+m.style[a].split("px")[0],+m.style[s].split("px")[0]):new Vi(+m.getAttribute(a),+m.getAttribute(s)),a,s)):o&&n&&!y&&c&&oe(m,0,600,"FadeIn"),g?t.replaceChild(m,y):t.appendChild(m)}function xe(e,t,r,o,n){var a=Math.abs(e-r),s=Math.abs(t-o),l=Math.max(we(Math.min(e,r),a,n.x,n.width),n.x),h=Math.max(we(Math.min(t,o),s,n.y,n.height),n.y);return new i.Rect(l,h,Math.min(a,n.width),Math.min(s,n.height))}function we(e,t,i,r){return e<i?e=i:e+t>r+i&&(e=r+i-t),e}function Se(e,t,i){var r=t.yAxis.labelFormat,o=[],n=null!==r.match("{value}");switch(t.seriesType){case"XY":"PolarRadar"===t.chart.chartAreaType?-1!==t.drawType.indexOf("Stacking")?("Logarithmic"===t.yAxis.valueType&&w(t.stackedValues.endValues[e.index],t.yAxis)||x(t.stackedValues.endValues[e.index],t.yAxis.visibleRange))&&o.push(e.text||e.yValue.toString()):("Logarithmic"===t.yAxis.valueType&&w(e.yValue,t.yAxis)||x(e.yValue,t.yAxis.visibleRange))&&o.push(e.text||e.yValue.toString()):o.push(e.text||e.yValue.toString());break;case"HighLow":o.push(e.text||Math.max(e.high,e.low).toString()),o.push(e.text||Math.min(e.high,e.low).toString());break;case"HighLowOpenClose":o.push(e.text||Math.max(e.high,e.low).toString()),o.push(e.text||Math.min(e.high,e.low).toString()),o.push(e.text||Math.max(e.open,e.close).toString()),o.push(e.text||Math.min(e.open,e.close).toString());break;case"BoxPlot":o.push(e.text||e.median.toString()),o.push(e.text||e.maximum.toString()),o.push(e.text||e.minimum.toString()),o.push(e.text||e.upperQuartile.toString()),o.push(e.text||e.lowerQuartile.toString());for(var a=0,s=e.outliers;a<s.length;a++){var l=s[a];o.push(e.text||l.toString())}}if(r&&!e.text){t.yAxis.format=i.intl.getNumberFormat({format:n?"":r,useGrouping:i.useGroupingSeparator});for(var h=0;h<o.length;h++)o[h]=n?r.replace("{value}",t.yAxis.format(parseFloat(o[h]))):t.yAxis.format(parseFloat(o[h]))}return o}function Ce(e){window.clearInterval(e)}function Pe(e,t,r){var o=new i.Rect(e.x+r.x,e.y+r.y,e.width,e.height);return t.some(function(e){return o.x<e.x+e.width&&o.x+o.width>e.x&&o.y<e.y+e.height&&o.height+o.y>e.y})}function Le(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.height+e.y>t.y}function Re(e,t){return e.x<=t.x&&e.x+e.width>=t.x+t.width&&e.y<=t.y&&e.height+e.y>=t.y+t.height}function Me(e,t,r){return new i.Rect(e.x-t.width/2-r.left,e.y-t.height/2-r.top,t.width+r.left+r.right,t.height+r.top+r.bottom)}function Ae(e){return"#"+ke(e.r)+ke(e.g)+ke(e.b)}function ke(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function Te(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new Xi(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Xi(255,255,255)}function _e(e){e="transparent"===e?"white":e,document.body.appendChild(t.createElement("text",{id:"chartmeasuretext"}));var i=document.getElementById("chartmeasuretext");i.style.color=e,e=window.getComputedStyle(i).color,t.remove(i);var r=/^(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/.exec(e);return Ae(new Xi(parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10)))}function Oe(e,t){(e=(e=_e(e)).replace(/[^0-9a-f]/gi,"")).length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;for(var i,r="#",o=0;o<3;o++)i=parseInt(e.substr(2*o,2),16),r+=("00"+(i=Math.round(Math.min(Math.max(0,i+i*t),255))).toString(16)).substr(i.toString(16).length);return r}function Ee(e){var t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2}function Ie(e,i,r,o){var n="",a=i.height,s=i.width,l=e.x,h=e.y;switch(r){case"MultiColoredLine":case"Line":case"StackingLine":case"StackingLine100":n="M "+(l+-s/2)+" "+h+" L "+(l+s/2)+" "+h,t.merge(o,{d:n});break;case"StepLine":o.fill="transparent",n="M "+(l+-s/2-2.5)+" "+(h+a/2)+" L "+(l+-s/2+s/10)+" "+(h+a/2)+" L "+(l+-s/2+s/10)+" "+h+" L "+(l+-s/10)+" "+h+" L "+(l+-s/10)+" "+(h+a/2)+" L "+(l+s/5)+" "+(h+a/2)+" L "+(l+s/5)+" "+(h+-a/2)+" L "+(l+s/2)+" "+(h+-a/2)+"L "+(l+s/2)+" "+(h+a/2)+" L"+(l+s/2+2.5)+" "+(h+a/2),t.merge(o,{d:n});break;case"UpArrow":o.fill=o.stroke,o.stroke="transparent",n="M "+(l+-s/2)+" "+(h+a/2)+" L "+l+" "+(h-a/2)+" L "+(l+s/2)+" "+(h+a/2)+"L "+(l+s/2-2)+" "+(h+a/2)+" L "+l+" "+(h-a/2+4)+"L"+(l-s/2+2)+" "+(h+a/2)+" Z",t.merge(o,{d:n});break;case"DownArrow":n="M "+(l-s/2)+" "+(h-a/2)+" L "+l+" "+(h+a/2)+" L "+(l+s/2)+" "+(h-a/2)+"L "+(l+s/2-2)+" "+(h-a/2)+" L "+l+" "+(h+a/2-4)+"L"+(l-s/2+2)+" "+(h-a/2)+" Z",t.merge(o,{d:n});break;case"RightArrow":n="M "+(l+-s/2)+" "+(h-a/2)+" L "+(l+s/2)+" "+h+" L "+(l+-s/2)+" "+(h+a/2)+" L "+(l+-s/2)+" "+(h+a/2-2)+" L "+(l+s/2-4)+" "+h+" L"+(l+-s/2)+" "+(h-a/2+2)+" Z",t.merge(o,{d:n});break;case"LeftArrow":o.fill=o.stroke,o.stroke="transparent",n="M "+(l+s/2)+" "+(h-a/2)+" L "+(l+-s/2)+" "+h+" L "+(l+s/2)+" "+(h+a/2)+" L "+(l+s/2)+" "+(h+a/2-2)+" L "+(l+-s/2+4)+" "+h+" L"+(l+s/2)+" "+(h-a/2+2)+" Z",t.merge(o,{d:n});break;case"Column":case"Pareto":case"StackingColumn":case"StackingColumn100":case"RangeColumn":case"Histogram":n="M "+(l-s/5*3)+" "+(h-a/5)+" L "+(l+-s/10*3)+" "+(h-a/5)+" L "+(l+-s/10*3)+" "+(h+a/2)+" L "+(l-s/5*3)+" "+(h+a/2)+" Z M "+(l+-s/10-s/20)+" "+(h-a/4-5)+" L "+(l+s/10+s/20)+" "+(h-a/4-5)+" L "+(l+s/10+s/20)+" "+(h+a/2)+" L "+(l+-s/10-s/20)+" "+(h+a/2)+" Z M "+(l+s/10*3)+" "+h+" L "+(l+s/5*3)+" "+h+" L "+(l+s/5*3)+" "+(h+a/2)+" L "+(l+s/10*3)+" "+(h+a/2)+" Z",t.merge(o,{d:n});break;case"Bar":case"StackingBar":case"StackingBar100":n="M "+(l+-s/2+-2.5)+" "+(h-a/5*3)+" L "+(l+s/10*3)+" "+(h-a/5*3)+" L "+(l+s/10*3)+" "+(h-a/10*3)+" L "+(l-s/2-2.5)+" "+(h-a/10*3)+" Z M "+(l+-s/2+-2.5)+" "+(h-a/5+.5)+" L "+(l+s/2+2.5)+" "+(h-a/5+.5)+" L "+(l+s/2+2.5)+" "+(h+a/10+.5)+" L "+(l-s/2-2.5)+" "+(h+a/10+.5)+" Z M "+(l-s/2-2.5)+" "+(h+a/5+1)+" L "+(l+-s/4)+" "+(h+a/5+1)+" L "+(l+-s/4)+" "+(h+a/2+1)+" L "+(l-s/2-2.5)+" "+(h+a/2+1)+" Z",t.merge(o,{d:n});break;case"Spline":o.fill="transparent",n="M "+(l-s/2)+" "+(h+a/5)+" Q "+l+" "+(h-a)+" "+l+" "+(h+a/5)+" M "+l+" "+(h+a/5)+" Q "+(l+s/2)+" "+(h+a/2)+" "+(l+s/2)+" "+(h-a/2),t.merge(o,{d:n});break;case"Area":case"MultiColoredArea":case"RangeArea":case"StackingArea":case"StackingArea100":n="M "+(l-s/2-2.5)+" "+(h+a/2)+" L "+(l+-s/4+-1.25)+" "+(h-a/2)+" L "+l+" "+(h+a/4)+" L "+(l+s/4+1.25)+" "+(h+-a/2+a/4)+" L "+(l+a/2+2.5)+" "+(h+a/2)+" Z",t.merge(o,{d:n});break;case"SplineArea":case"SplineRangeArea":n="M "+(l-s/2)+" "+(h+a/5)+" Q "+l+" "+(h-a)+" "+l+" "+(h+a/5)+" Z M "+l+" "+(h+a/5)+" Q "+(l+s/2)+" "+(h+a/2)+" "+(l+s/2)+" "+(h-a/2)+" Z",t.merge(o,{d:n});break;case"Pie":case"Doughnut":o.stroke="transparent",n=_(l,h,Math.min(a,s)/2,a,s,r),t.merge(o,{d:n})}return{renderOption:o}}function ze(e,t,r){var o=t,n=i.measureText(t,r).width;if(n>e)for(var a=t.length-1;a>=0;--a)if(o=t.substring(0,a)+"...",(n=i.measureText(o,r).width)<=e)return o;return o}function De(e,t,r){for(var o=[],n=t.split("<br>"),a=0;a<n.length;a++){t=n[a];var s=i.measureText(t,r).width;if(s>e){for(var l=t.length-1;l>=0;--l)if(t=t.substring(0,l)+"...",(s=i.measureText(t,r).width)<=e){o.push(t);break}}else o.push(t)}return o}function Be(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function Fe(e,t,i,r){if(!e)return null;var o=he(t);return o&&i&&r.setElementAttributes(i,"clipPath"===o.tagName?o.childNodes[0]:o),o}function Ne(e,i,r,o,n,a){void 0===n&&(n="x"),void 0===a&&(a="y");var s="DIV"===e.tagName,l=function(t,i){s?(e.style[n]=t+"px",e.style[a]=i+"px"):(e.setAttribute(n,t+""),e.setAttribute(a,i+""))};l(r.x,r.y),new t.Animation({}).animate(t.createElement("div"),{duration:i,progress:function(e){l(q(e.timeStamp,r.x,o.x-r.x,e.duration),q(e.timeStamp,r.y,o.y-r.y,e.duration))},end:function(){l(o.x,o.y)}})}function Ve(e,t,r,o,n,a,s,l,h,c,d,p,u,g){void 0===a&&(a=!1),void 0===h&&(h=!1);var y,m,v,f,b={};b={id:t.id,x:t.x,y:t.y,fill:o||"black","font-size":r.size,"font-style":r.fontStyle,"font-family":r.fontFamily,"font-weight":r.fontWeight,"text-anchor":t.anchor,labelRotation:t.labelRotation,transform:t.transform,opacity:r.opacity,"dominant-baseline":t.baseLine};var x="string"==typeof t.text?t.text:a?t.text[t.text.length-1]:t.text[0],w=d?d.x:0,S=d?d.y:0,C=e.createText(b,x,w,S);if(C.style.fontFamily=r.fontFamily,C.style.fontStyle=r.fontStyle,C.style.fontSize=r.size,C.style.fontWeight=r.fontWeight,C.style.color=r.color,C.style.textAnchor=t.anchor,"string"!=typeof t.text&&t.text.length>1)for(var P=1,L=t.text.length;P<L;P++)m=i.measureText(t.text[P],r).height,v=t.y+(a?-P*m:P*m),f=a?t.text[t.text.length-(P+1)]:t.text[P],g?y=e.createText(b,f,null,null,v,!0):(y=e.createTSpan({x:t.x,id:t.id,y:v},f),C.appendChild(y));return u||be(e instanceof i.CanvasRenderer,n,C,s,l,"x","y",null,null,h,!1,null,c),C}function je(e){var r=e.element.clientWidth||e.element.offsetWidth,o=e.element.clientHeight;e.stockChart&&(r=e.stockChart.availableSize.width,o=e.stockChart.availableSize.height);var n,a=450;if("rangeNavigator"===e.getModuleName()){var s=e,l=s.tooltip.enable?35:0,h=s.periodSelectorSettings.periods.length?s.periodSelectorSettings.height:0;n=s.margin.top+s.margin.bottom+l;var c=i.measureText("tempString",s.labelStyle).height;a=(e.series.length?t.Browser.isDevice?80:120:(s.enableGrouping?55+c:40)+n)+h,s.disableRangeSelector&&(a=h)}e.availableSize=new i.Size(Be(e.width,r)||r||600,Be(e.height,o||a)||o||a)}function He(e){e.canvasRender=new i.CanvasRenderer(e.element.id),e.renderer=e.enableCanvas?e.canvasRender:new i.SvgRenderer(e.element.id),je(e),e.stockChart&&"chart"===e.getModuleName()?e.svgObject=e.stockChart.chartObject:e.stockChart&&"rangeNavigator"===e.getModuleName()?e.svgObject=e.stockChart.selectorObject:e.enableCanvas?e.svgObject=e.renderer.createCanvas({id:e.element.id+"_canvas",width:e.availableSize.width,height:e.availableSize.height}):e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height})}function Xe(e,t,i){var r=[];switch(t.textOverflow){case"Wrap":r=Ge(e,i,t);break;case"Trim":r.push(ze(i,e,t));break;default:r.push(e)}return r}function Ye(e,t){return"Near"===t.textAlignment?e.x:"Center"===t.textAlignment?e.x+e.width/2:e.x+e.width}function Ge(e,t,r){for(var o,n=e.split(" "),a="",s=[],l=0,h=n.length;l<h;l++)o=n[l],i.measureText(a.concat(o),r).width<t?a=a.concat((""===a?"":" ")+o):""!==a?(s.push(ze(t,a,r)),a=o):(s.push(ze(t,o,r)),o=""),a&&l===h-1&&s.push(ze(t,a,r));return s}function We(e,t){for(var i=e.replace(t," "),r=e.match(t),o=" ",n=" ",a=0,s={0:"₀",1:"₁",2:"₂",3:"₃",4:"₄",5:"₅",6:"₆",7:"₇",8:"₈",9:"₉"},l={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹"},h=0;h<=i.length-1;h++)if(" "===i[h]){o=t===si?r[a].replace(/~/g,""):r[a].replace(/\^/g,"");for(var c=0;c<o.length;c++)n+=t===si?s[o[c]]:l[o[c]];a++}else n+=i[h];return n.trim()}function Ue(e){for(var i=0;i<e.annotations.length;i++)t.resetBlazorTemplate((e.element.id+"_Annotation_"+i).replace(/[^a-zA-Z0-9]/g,""),"ContentTemplate");t.resetBlazorTemplate(e.element.id+"_tooltipparent_template_blazorTemplate","Template"),t.resetBlazorTemplate(e.element.id+"_DataLabel")}function Ze(e,t){return Number(t)===e.start?e.colors[0]:Number(t)===e.end?e.colors[e.colors.length-1]:Ae(qe(Number(t),e))}function qe(e,t){var i=t.start,r=t.end,o=0,n=r-i;o=(e-i)/n;var a,s;if(t.colors.length<=2)a="#"===t.colors[0].charAt(0)?t.colors[0]:_e(t.colors[0]),s="#"===t.colors[t.colors.length-1].charAt(0)?t.colors[t.colors.length-1]:_e(t.colors[t.colors.length-1]);else{a="#"===t.colors[0].charAt(0)?t.colors[0]:_e(t.colors[0]),s="#"===t.colors[t.colors.length-1].charAt(0)?t.colors[t.colors.length-1]:_e(t.colors[t.colors.length-1]);for(var l=n/(t.colors.length-1),h=t.colors.length-1,c=[],d={},p=1;p<h;p++)d={b:i+p*l,color:t.colors[p]},c.push(d);for(var u=0;u<c.length;u++)i<=e&&e<=c[u].b&&0===u?(s="#"===c[u].color.charAt(0)?c[u].color:_e(c[u].color),o=e<=c[u].b?1-Math.abs((e-c[u].b)/l):(e-c[u].b)/l):c[u].b<=e&&e<=r&&u===c.length-1&&(a="#"===c[u].color.charAt(0)?c[u].color:_e(c[u].color),o=e<c[u].b?1-Math.abs((e-c[u].b)/l):(e-c[u].b)/l),u!==c.length-1&&u<c.length&&c[u].b<=e&&e<=c[u+1].b&&(a="#"===c[u].color.charAt(0)?c[u].color:_e(c[u].color),s="#"===c[u+1].color.charAt(0)?c[u+1].color:_e(c[u+1].color),o=Math.abs(e-c[u+1].b)/l)}return Qe(o,a,s)}function Qe(e,t,i){var r=i.split("#")[1],o=t.split("#")[1],n=$e(e,parseInt(o.substr(0,2),16),parseInt(r.substr(0,2),16)),a=$e(e,parseInt(o.substr(2,2),16),parseInt(r.substr(2,2),16)),s=$e(e,parseInt(o.substr(4,2),16),parseInt(r.substr(4,2),16));return new Xi(n,a,s)}function $e(e,t,i){var r=i-t;return Math.round(t+r*e)}function Je(e,t){for(var i,r=e.axis.rect,o="Horizontal"===e.axis.orientation,n=!1,a=0,s=0,l=e.axis.series;s<l.length;s++)(d=l[s]).marker.visible&&d.marker.height>a&&(a=d.marker.height);for(var h=0,c=e.axis.series;h<c.length;h++){var d=c[h];if(d.visible&&(i=d.yMin.toString(),n=d.yData.some(function(e){return e===i})),n)break}e.svgObject=t.createSvg({id:e.component.element.id+"_scrollBar_svg"+e.axis.name,width:e.isVertical?e.height:e.width,height:e.isVertical?e.width:e.height,style:"position: absolute;top: "+((e.axis.opposedPosition&&o?-16:n?a:0)+r.y)+"px;left: "+((e.axis.opposedPosition&&!o?16:0)+r.x-(e.isVertical?e.height:0))+"px;cursor:auto;"}),e.elements.push(e.svgObject)}function Ke(e,t){for(var i=0,r=t;i<r.length;i++){var o=r[i];if(e===o.index)return o}return t[0]}function et(e,t){for(var i=0,r=t;i<r.length;i++){var o=r[i];if(o.index===e)return o}return null}function tt(e,t,i){var r=(e-t.min)/t.delta;return i?1-r:r}function it(e,t,i,r){return(e=tt(e,t,r))*i}function rt(e,t,i,r){return(r?1-e/t:e/t)*i.delta+i.min}function ot(e,t,i){var r=[];return e.map(function(e){e.xValue>=t&&e.xValue<=i&&r.push({x:e.x,y:e.y})}),r}function nt(e,t){return e.reduce(function(e,i){return Math.abs(i-t)<Math.abs(e-t)?i:e})}function at(e,i){var r=i.navigatorStyleSettings.thumb,o=t.isNullOrUndefined(r.width)?t.Browser.isDevice?15:20:r.width,n=t.isNullOrUndefined(r.height)?t.Browser.isDevice?15:20:r.height,a="HighContrast"===e?"#969696":"#6F6C6C",s="HighContrast"===e?"#4A4848":"#414040",l="MaterialDark"===e?"#303030":"FabricDark"===e?"#201F1F":"1A1A1A",h={gridLineColor:"#E0E0E0",axisLineColor:"#000000",labelFontColor:"#686868",unselectedRectColor:i.series.length?"rgba(255, 255, 255, 0.6)":"#EEEEEE",thumpLineColor:"rgba(189, 189, 189, 1)",thumbBackground:"rgba(250, 250, 250, 1)",gripColor:"#757575",background:"#FFFFFF",thumbHoverColor:"#EEEEEE",selectedRegionColor:i.series.length?"transparent":"#FF4081",tooltipBackground:"rgb(0, 8, 22)",tooltipFontColor:"#dbdbdb",thumbWidth:o,thumbHeight:n};switch(e){case"Fabric":h.selectedRegionColor=i.series.length?"transparent":"#007897";break;case"Bootstrap":h.selectedRegionColor=i.series.length?"transparent":"#428BCA";break;case"HighContrastLight":h={gridLineColor:"#bdbdbd",axisLineColor:"#969696",labelFontColor:"#ffffff",unselectedRectColor:i.series.length?"rgba(255, 255, 255, 0.3)":"#EEEEEE",thumpLineColor:"#ffffff",thumbBackground:"#262626",gripColor:"#ffffff",background:l,thumbHoverColor:"#BFBFBF",selectedRegionColor:i.series.length?"transparent":"#FFD939",tooltipBackground:"#ffffff",tooltipFontColor:"#000000",thumbWidth:o,thumbHeight:n};break;case"Highcontrast":case"HighContrast":h={gridLineColor:s,axisLineColor:a,labelFontColor:"#DADADA",unselectedRectColor:i.series.length?"rgba(43, 43, 43, 0.6)":"#514F4F",thumpLineColor:"#969696",thumbBackground:"#333232",gripColor:"#DADADA",background:"#000000",thumbHoverColor:"#BFBFBF",selectedRegionColor:i.series.length?"rgba(22, 22, 22, 0.6)":"#FFD939",tooltipBackground:"#F4F4F4",tooltipFontColor:"#282727",thumbWidth:o,thumbHeight:n};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":h={labelFontColor:"#DADADA",axisLineColor:" #6F6C6C",gridLineColor:"#414040",tooltipBackground:"#F4F4F4",tooltipFontColor:"#333232",unselectedRectColor:i.series.length?"rgba(43, 43, 43, 0.6)":"#514F4F",thumpLineColor:"#969696",thumbBackground:"#333232",gripColor:"#DADADA",background:l,thumbHoverColor:"#BFBFBF",selectedRegionColor:i.series.length?"rgba(22, 22, 22, 0.6)":"FabricDark"===e?"#007897":"BootstrapDark"===e?"#428BCA":"#FF4081",thumbWidth:o,thumbHeight:n};break;case"Bootstrap4":h={gridLineColor:"#E0E0E0",axisLineColor:"#CED4DA",labelFontColor:"#212529",unselectedRectColor:i.series.length?"rgba(255, 255, 255, 0.6)":"#514F4F",thumpLineColor:"rgba(189, 189, 189, 1)",thumbBackground:"#FFFFFF",gripColor:"#495057",background:"rgba(255, 255, 255, 0.6)",thumbHoverColor:"#EEEEEE",selectedRegionColor:i.series.length?"transparent":"#FFD939",tooltipBackground:"rgba(0, 0, 0, 0.9)",tooltipFontColor:"rgba(255, 255, 255)",thumbWidth:o,thumbHeight:n};break;case"Tailwind":h={gridLineColor:"#E5E7EB",axisLineColor:"#D1D5DB",labelFontColor:"#6B7280",unselectedRectColor:i.series.length?"transparent":"#E5E7EB",thumpLineColor:"#9CA3AF",thumbBackground:"#FFFFFF",gripColor:"#6B7280",background:"rgba(255, 255, 255, 0.6)",thumbHoverColor:"#374151",selectedRegionColor:i.series.length?"rgba(79, 70, 229, 0.3)":"#4F46E5",tooltipBackground:"#111827",tooltipFontColor:"#F9FAFB",thumbWidth:o,thumbHeight:n};break;case"TailwindDark":h={gridLineColor:"#374151",axisLineColor:"#4B5563",labelFontColor:"#9CA3AF",unselectedRectColor:i.series.length?"transparent":"#4B5563",thumpLineColor:"#6B7280",thumbBackground:"#1F2937",gripColor:"#D1D5DB",background:"rgba(255, 255, 255, 0.6)",thumbHoverColor:"#E5E7EB",selectedRegionColor:i.series.length?"rgba(255, 255, 255, 0.6)":"#22D3EE",tooltipBackground:"#F9FAFB",tooltipFontColor:"#1F2937",thumbWidth:o,thumbHeight:n};break;default:h.selectedRegionColor=i.series.length?"transparent":"#FF4081"}return h}function st(e,t,i){for(var r=[],o=0;o<e;++o){for(var n=[],a=0;a<t;++a)n[a]=i;r[o]=n}return r}function lt(e){var t={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"rgba(0,0,0,0.54)",categoryFontColor:"#666666",labelFontFamily:"SegoeUI",tooltipFill:"rgba(0, 8, 22, 0.75)",legendLabel:"#353535",tooltipBoldLabel:"#ffffff",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"rgba(0,0,0,0.87)",dataLabelFontColor:"#ffffff",titleFontFamily:"SegoeUI",subTitleFontColor:" rgba(0,0,0,0.54)",subTitleFontFamily:"SegoeUI",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}]};switch(e){case"Fabric":t={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"#666666",categoryFontColor:"#666666",labelFontFamily:"SegoeUI",tooltipFill:"rgba(0, 8, 22, 0.75)",legendLabel:"#353535",tooltipBoldLabel:"#ffffff",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"#333333",dataLabelFontColor:"#ffffff",titleFontFamily:"SegoeUI",subTitleFontColor:"#666666",subTitleFontFamily:"SegoeUI",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}]};break;case"Bootstrap":t={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"rgba(0,0,0,0.54)",categoryFontColor:"rgba(0,0,0,0.54)",labelFontFamily:"Helvetica",tooltipFill:"rgba(0, 0, 0, 0.9)",legendLabel:"#212529",tooltipBoldLabel:"rgba(255,255,255)",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"rgba(0,0,0,0.87)",dataLabelFontColor:"#ffffff",titleFontFamily:"Helvetica-Bold",subTitleFontColor:" rgba(0,0,0,0.54)",subTitleFontFamily:"Helvetica",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}]};break;case"HighContrast":t={majorTickLineColor:"#FFFFFF",minorTickLineColor:"#FFFFFF",background:"#000000",labelFontColor:"#FFFFFF",categoryFontColor:"#FFFFFF",labelFontFamily:"SegoeUI",tooltipFill:"#ffffff",legendLabel:"#ffffff",tooltipBoldLabel:"#000000",featuredMeasureColor:"#000000",comparativeMeasureColor:"#000000",titleFontColor:"#FFFFFF",dataLabelFontColor:"#ffffff",titleFontFamily:"HelveticaNeue",subTitleFontColor:"#FFFFFF",subTitleFontFamily:"SegoeUI",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",rangeStrokes:[{color:"#757575"},{color:"#BDBDBD"},{color:"#EEEEEE"}]};break;case"MaterialDark":case"FabricDark":case"BootstrapDark":t={majorTickLineColor:"#F0F0F0",minorTickLineColor:"#F0F0F0",background:"#000000",labelFontColor:"#FFFFFF",categoryFontColor:"#FFFFFF",labelFontFamily:"Helvetica",tooltipFill:"#F4F4F4",legendLabel:"#DADADA",tooltipBoldLabel:"#282727",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"#FFFFFF",dataLabelFontColor:"#ffffff",titleFontFamily:"Helvetica-Bold",subTitleFontColor:"#FFFFFF",subTitleFontFamily:"Helvetica",firstRangeColor:"#8D8D8D",secondRangeColor:"#ADADAD",thirdRangeColor:"#EEEEEE",rangeStrokes:[{color:"#8D8D8D"},{color:"#ADADAD"},{color:"#EEEEEE"}]};break;case"Bootstrap4":t={majorTickLineColor:"#424242",minorTickLineColor:"#424242",background:"#FFFFFF",labelFontColor:"#202528",categoryFontColor:"#202528",labelFontFamily:"HelveticaNeue",tooltipFill:"rgba(0, 0, 0, 0.9)",legendLabel:"#212529",tooltipBoldLabel:"rgba(255,255,255)",featuredMeasureColor:"#181818",comparativeMeasureColor:"#181818",titleFontColor:"#202528",dataLabelFontColor:"#ffffff",titleFontFamily:"HelveticaNeue-Bold",subTitleFontColor:"HelveticaNeue",subTitleFontFamily:"#202528",firstRangeColor:"#959595",secondRangeColor:"#BDBDBD",thirdRangeColor:"#E3E2E2",rangeStrokes:[{color:"#959595"},{color:"#BDBDBD"},{color:"#E3E2E2"}]};break;case"Tailwind":t={majorTickLineColor:"#D1D5DB",minorTickLineColor:"#D1D5DB",background:"transparent",labelFontColor:"#6B7280",categoryFontColor:"#6B7280",labelFontFamily:"Inter",tooltipFill:"#111827",legendLabel:"#374151",tooltipBoldLabel:"#F9FAFB",featuredMeasureColor:"#1F2937",comparativeMeasureColor:"#1F2937",titleFontColor:"#374151",dataLabelFontColor:"#F9FAFB",titleFontFamily:"Inter",subTitleFontColor:"#374151",subTitleFontFamily:"Inter",firstRangeColor:"#9CA3AF",secondRangeColor:"#D1D5DB",thirdRangeColor:"#E5E7EB",rangeStrokes:[{color:"#9CA3AF"},{color:"#D1D5DB"},{color:"#E5E7EB"}]};break;case"TailwindDark":t={majorTickLineColor:"#4B5563",minorTickLineColor:"#4B5563",background:"transparent",labelFontColor:"#9CA3AF",categoryFontColor:"#9CA3AF",labelFontFamily:"Inter",tooltipFill:"#F9FAFB",legendLabel:"#D1D5DB",tooltipBoldLabel:"#1F2937",featuredMeasureColor:"#1F2937",comparativeMeasureColor:"#1F2937",titleFontColor:"#D1D5DB",dataLabelFontColor:"#D1D5DB",titleFontFamily:"Inter",subTitleFontColor:"#D1D5DB",subTitleFontFamily:"Inter",firstRangeColor:"#6B7280",secondRangeColor:"#4B5563",thirdRangeColor:"#374151",rangeStrokes:[{color:"#6B7280"},{color:"#4B5563"},{color:"#374151"}]};break;default:t=t}return t}function ht(e){e.renderer=new i.SvgRenderer(e.element.id),yt(e),e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height})}function ct(e){return document.getElementById(e)}function dt(e,t,i){var r=t,o=ft(t,i).width;if(o>e)for(var n=t.length-1;n>=0;--n)if(r=t.substring(0,n)+"...",(o=ft(r,i).width)<=e||r.length<4)return r.length<4&&(r=" "),r;return r}function pt(e){var i=null;try{document.querySelectorAll(e).length&&(i=t.compile(document.querySelector(e).innerHTML.trim()))}catch(r){i=t.compile(e)}return i}function ut(e,i,r){for(var o=e[0].outerHTML,n=Object.keys(r),a=0;a<n.length;a++)o=o.replace(new RegExp("{{:"+n[a]+"}}","g"),r[n[a].toString()]);return t.createElement("div",{id:i,innerHTML:o,styles:"position: absolute"})}function gt(){for(var e=1;1+.5*e!=1;)e*=.5;return e}function yt(e){var t=e.element.clientWidth,i=e.element.clientHeight;e.availableSize=new $s(vt(e.width,t)||t||600,vt(e.height,i)||i||450)}function mt(e,i,r,o,n){var a,s;new t.Animation({}).animate(i,{duration:o,delay:r,name:n,progress:function(e){a=(e.timeStamp-e.delay)/e.duration,s=0+1*a,e.element.style.opacity=s.toString()},end:function(t){t.element.style.opacity=1..toString(),e.trigger("animationComplete",event)}})}function vt(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function ft(e,i){var r=document.getElementById("smithchartmeasuretext");return null===r&&(r=t.createElement("text",{id:"smithchartmeasuretext"}),document.body.appendChild(r)),r.innerHTML=e,r.style.position="absolute",r.style.visibility="hidden",r.style.left="0",r.style.top="-100",r.style.whiteSpace="nowrap",r.style.fontSize=i.size,r.style.fontWeight=i.fontWeight,r.style.fontStyle=i.fontStyle,r.style.fontFamily=i.fontFamily,r.style.lineHeight="normal",new $s(r.clientWidth,r.clientHeight)}function bt(e){var i=document.getElementById(e);return i?t.remove(i):null}function xt(e,t,i,r){return-i*Math.cos(e/r*(Math.PI/2))+i+t}function wt(e,t,i,r){return-t*Math.sin(e/r*(Math.PI/2))+i+t}function St(e){var t;switch(e){case"Linear":t=xt;break;case"Reverse":t=wt}return t}function Ct(e,t,r,o){var n={id:e.id,x:e.x,y:e.y,fill:r,"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight,"text-anchor":e.anchor,opacity:t.opacity},a=e.text,s=new i.SvgRenderer("").createText(n,a);return o.appendChild(s),s}function Pt(e){var t;switch(e.toLowerCase()){case"highcontrastlight":t=["#79ECE4","#E98272","#DFE6B6","#C6E773","#BA98FF","#FA83C3","#00C27A","#43ACEF","#D681EF","#D8BC6E"];break;case"fabric":t=["#4472c4","#ed7d31","#ffc000","#70ad47","#5b9bd5","#c1c1c1","#6f6fe2","#e269ae","#9e480e","#997300"];break;case"bootstrap":t=["#a16ee5","#f7ce69","#55a5c2","#7ddf1e","#ff6ea6","#7953ac","#b99b4f","#407c92","#5ea716","#b91c52"];break;case"tailwind":t=["#5A61F6","#65A30D","#334155","#14B8A6","#8B5CF6","#0369A1","#F97316","#9333EA","#F59E0B","#15803D"];break;case"tailwinddark":t=["#8B5CF6","#22D3EE","#F87171","#4ADE80","#E879F9","#FCD34D","#F97316","#2DD4BF","#F472B6","#10B981"];break;default:t=["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"]}return t}function Lt(e){var t;switch(e.toLowerCase()){case"highcontrast":t={axisLabel:"#ffffff",axisLine:"#ffffff",majorGridLine:"#BFBFBF",minorGridLine:"#969696",chartTitle:"#ffffff",legendLabel:"#ffffff",background:"#000000",areaBorder:"#ffffff",tooltipFill:"#ffffff",dataLabel:"#ffffff",tooltipBoldLabel:"#000000",tooltipLightLabel:"#000000",tooltipHeaderLine:"#969696"};break;case"materialdark":case"bootstrapdark":case"fabricdark":t={axisLabel:"#DADADA",axisLine:" #6F6C6C",majorGridLine:"#414040",minorGridLine:"#514F4F",chartTitle:"#ffffff",legendLabel:"#DADADA",background:"#000000",areaBorder:" #9A9A9A",tooltipFill:"#F4F4F4",dataLabel:"#DADADA",tooltipBoldLabel:"#282727",tooltipLightLabel:"#333232",tooltipHeaderLine:"#9A9A9A"};break;case"bootstrap4":t={axisLabel:"#212529",axisLine:"#ADB5BD",majorGridLine:"#CED4DA",minorGridLine:"#DEE2E6",chartTitle:"#212529",legendLabel:"#212529",background:"#FFFFFF",areaBorder:"#DEE2E6",tooltipFill:"#000000",dataLabel:"#212529",tooltipBoldLabel:"#FFFFFF",tooltipLightLabel:"#FFFFFF",tooltipHeaderLine:"#FFFFFF",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",labelFontFamily:"HelveticaNeue",tooltipFillOpacity:1,tooltipTextOpacity:.9};break;case"tailwind":t={axisLabel:"#6B7280",axisLine:"#D1D5DB",majorGridLine:"#E5E7EB",minorGridLine:"#D1D5DB",chartTitle:"#374151",legendLabel:"#374151",background:"#FFFFFF",areaBorder:"#D1D5DB6",tooltipFill:"#111827",dataLabel:"#F9FAFB",tooltipBoldLabel:"#F9FAFB",tooltipLightLabel:"#F9FAFB",tooltipHeaderLine:"#9CA3AF",fontFamily:"Inter",fontSize:"14px",labelFontFamily:"inter",tooltipFillOpacity:1,tooltipTextOpacity:1};break;case"tailwinddark":t={axisLabel:"#9CA3AF",axisLine:"#4B5563",majorGridLine:"#374151",minorGridLine:"#4B5563",chartTitle:"#D1D5DB",legendLabel:"#D1D5DB",background:"transprent",areaBorder:"#4B5563",tooltipFill:"#F9FAFB",dataLabel:"#D1D5DB",tooltipBoldLabel:"#1F2937",tooltipLightLabel:"#1F2937",tooltipHeaderLine:"#9CA3AF",fontFamily:"Inter",fontSize:"14px",labelFontFamily:"inter",tooltipFillOpacity:1,tooltipTextOpacity:1};break;default:t={axisLabel:"#686868",axisLine:"#b5b5b5",majorGridLine:"#dbdbdb",minorGridLine:"#eaeaea",chartTitle:"#424242",legendLabel:"#353535",background:"#FFFFFF",areaBorder:"Gray",tooltipFill:"rgba(0, 8, 22, 0.75)",dataLabel:"#424242",tooltipBoldLabel:"#ffffff",tooltipLightLabel:"#dbdbdb",tooltipHeaderLine:"#ffffff"}}return t}function Rt(e){var t;switch(e.toLowerCase()){case"bootstrapdark":case"fabricdark":case"materialdark":case"highcontrast":t={axisLineColor:"#ffffff",dataLabelColor:"#ffffff",rangeBandColor:"#ffffff",tooltipFill:"#ffffff",background:"#000000",tooltipFontColor:"#363F4C",trackerLineColor:"#ffffff"};break;case"bootstrap4":t={axisLineColor:"#6C757D",dataLabelColor:"#212529",rangeBandColor:"#212529",tooltipFill:"#000000",background:"#FFFFFF",tooltipFontColor:"#FFFFFF",trackerLineColor:"#212529",fontFamily:"HelveticaNeue-Medium",tooltipFillOpacity:1,tooltipTextOpacity:.9,labelFontFamily:"HelveticaNeue"};break;case"tailwind":t={axisLineColor:"#4B5563",dataLabelColor:"#212529",rangeBandColor:"#212529",background:"#FFFFFF",tooltipFill:"#111827",tooltipFontColor:"#F9FAFB",trackerLineColor:"#1F2937",fontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Inter"};break;case"tailwinddark":t={axisLineColor:"#D1D5DB",dataLabelColor:"#F9FAFB",rangeBandColor:"#F9FAFB",background:"transparent",tooltipFill:"#F9FAFB",tooltipFontColor:"#1F2937",trackerLineColor:"#9CA3AF",fontFamily:"Inter",tooltipFillOpacity:1,tooltipTextOpacity:1,labelFontFamily:"Inter"};break;default:t={axisLineColor:"#000000",dataLabelColor:"#424242",rangeBandColor:"#000000",background:"#FFFFFF",tooltipFill:"#363F4C",tooltipFontColor:"#ffffff",trackerLineColor:"#000000"}}return t}function Mt(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function At(e){var t=e.element.clientWidth?e.element.clientWidth:e.element.parentElement?e.element.parentElement.clientWidth?e.element.parentElement.clientWidth:window.innerWidth:100,i=e.element.clientHeight?e.element.clientHeight:e.element.parentElement?e.element.parentElement.clientHeight:50;e.availableSize=new oh(Mt(e.width,t)||t,Mt(e.height,i)||i||(e.isDevice?Math.min(window.innerWidth,window.innerHeight):i))}function kt(e){e.renderer=new i.SvgRenderer(e.element.id),At(e),e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height})}function Tt(e,t){return t&&t.appendChild(e),e}function _t(e,t,i){return Tt(e.renderer.drawCircle(t),i)}function Ot(e,t,i,r,o){return"M "+e.x+" "+(t+e.y)+" Q "+e.x+" "+e.y+" "+(e.x+t)+" "+e.y+" L "+(e.x+e.width-i)+" "+e.y+" Q "+(e.x+e.width)+" "+e.y+" "+(e.x+e.width)+" "+(e.y+i)+" L "+(e.x+e.width)+" "+(e.y+e.height-o)+" Q "+(e.x+e.width)+" "+(e.y+e.height)+" "+(e.x+e.width-o)+" "+(e.y+e.height)+" L "+(e.x+r)+" "+(e.y+e.height)+" Q "+e.x+" "+(e.y+e.height)+" "+e.x+" "+(e.y+e.height-r)+" L "+e.x+" "+(t+e.y)+" Z"}function Et(e,t,i){return t.d=Ot(t.rect,t.topLeft,t.topRight,t.bottomLeft,t.bottomRight),Tt(e.renderer.drawPath(t),i)}function It(e,t,i){return Tt(e.renderer.drawPath(t),i)}function zt(e,i){var r=document.getElementById("sparklinesmeasuretext");return null===r&&(r=t.createElement("text",{id:"sparklinesmeasuretext"}),document.body.appendChild(r)),r.innerHTML=e,r.style.fontStyle=i.fontStyle,r.style.fontFamily=i.fontFamily,r.style.visibility="hidden",r.style.top="-100",r.style.left="0",r.style.position="absolute",r.style.fontSize=i.size,r.style.fontWeight=i.fontWeight,r.style.whiteSpace="nowrap",r.style.lineHeight="normal",new oh(r.clientWidth,r.clientHeight)}function Dt(e,t,r,o){var n={id:e.id,x:e.x,y:e.y,transform:e.transform,opacity:t.opacity,fill:r,"font-family":t.fontFamily,"font-weight":t.fontWeight,"font-size":t.size,"font-style":t.fontStyle,"text-anchor":e.anchor,"dominant-baseline":e.baseLine},a=new i.SvgRenderer("").createText(n,e.text);return a.style["user-select"]="none",a.style["-moz-user-select"]="none",a.style["-webkit-touch-callout"]="none",a.style["-webkit-user-select"]="none",a.style["-khtml-user-select"]="none",a.style["-ms-user-select"]="none",a.style["-o-user-select"]="none",o.appendChild(a),a}function Bt(e){var i=document.getElementById(e);return i?t.remove(i):null}function Ft(e){return document.getElementById(e)}function Nt(e,t,i){return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height}!function(e){e.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.axisTitleFont={size:"14px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.chartTitleFont={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.chartSubTitleFont={size:"11px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.crosshairLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.tooltipLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.legendLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.legendTitleFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.stripLineLabelFont={size:"12px",fontWeight:"Regular",color:"#353535",fontStyle:"Normal",fontFamily:"Segoe UI"},e.stockEventFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"}}(e.Theme||(e.Theme={}));var Vt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jt=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Ht=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property("Line")],i.prototype,"type",void 0),jt([t.Property(null)],i.prototype,"color",void 0),jt([t.Property(1)],i.prototype,"width",void 0),jt([t.Property(null)],i.prototype,"length",void 0),jt([t.Property("")],i.prototype,"dashArray",void 0),i}(t.ChildProperty),Xt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property("Normal")],i.prototype,"fontStyle",void 0),jt([t.Property("16px")],i.prototype,"size",void 0),jt([t.Property("Normal")],i.prototype,"fontWeight",void 0),jt([t.Property("")],i.prototype,"color",void 0),jt([t.Property("Center")],i.prototype,"textAlignment",void 0),jt([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),jt([t.Property(1)],i.prototype,"opacity",void 0),jt([t.Property("Trim")],i.prototype,"textOverflow",void 0),i}(t.ChildProperty),Yt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property("")],i.prototype,"color",void 0),jt([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),Gt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(0)],i.prototype,"x",void 0),jt([t.Property(0)],i.prototype,"y",void 0),i}(t.ChildProperty),Wt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Complex({},Yt)],i.prototype,"border",void 0),jt([t.Property("transparent")],i.prototype,"background",void 0),jt([t.Property(1)],i.prototype,"opacity",void 0),jt([t.Property(null)],i.prototype,"backgroundImage",void 0),i}(t.ChildProperty),Ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(10)],i.prototype,"left",void 0),jt([t.Property(10)],i.prototype,"right",void 0),jt([t.Property(10)],i.prototype,"top",void 0),jt([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),Zt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(0)],i.prototype,"left",void 0),jt([t.Property(0)],i.prototype,"right",void 0),jt([t.Property(0)],i.prototype,"top",void 0),jt([t.Property(0)],i.prototype,"bottom",void 0),i}(t.ChildProperty),qt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(!0)],i.prototype,"enable",void 0),jt([t.Property(1e3)],i.prototype,"duration",void 0),jt([t.Property(0)],i.prototype,"delay",void 0),i}(t.ChildProperty),Qt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(0)],i.prototype,"series",void 0),jt([t.Property(0)],i.prototype,"point",void 0),i}(t.ChildProperty),$t=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(0)],i.prototype,"topLeft",void 0),jt([t.Property(0)],i.prototype,"topRight",void 0),jt([t.Property(0)],i.prototype,"bottomLeft",void 0),jt([t.Property(0)],i.prototype,"bottomRight",void 0),i}(t.ChildProperty),Jt=function(){function e(e,t){this.series=e,this.point=t}return e}(),Kt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(null)],i.prototype,"fill",void 0),jt([t.Complex({color:"transparent",width:0},Yt)],i.prototype,"border",void 0),jt([t.Property("Gap")],i.prototype,"mode",void 0),i}(t.ChildProperty),ei=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(!1)],i.prototype,"enable",void 0),jt([t.Property(null)],i.prototype,"minY",void 0),jt([t.Property(null)],i.prototype,"maxY",void 0),jt([t.Property(null)],i.prototype,"fill",void 0),i}(t.ChildProperty),ti=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return Vt(r,i),jt([t.Property(!1)],r.prototype,"enable",void 0),jt([t.Property(!0)],r.prototype,"enableMarker",void 0),jt([t.Property(!1)],r.prototype,"shared",void 0),jt([t.Property(null)],r.prototype,"fill",void 0),jt([t.Property(null)],r.prototype,"header",void 0),jt([t.Property(.75)],r.prototype,"opacity",void 0),jt([t.Complex(e.Theme.tooltipLabelFont,Xt)],r.prototype,"textStyle",void 0),jt([t.Property(null)],r.prototype,"format",void 0),jt([t.Property(null)],r.prototype,"template",void 0),jt([t.Property(!0)],r.prototype,"enableAnimation",void 0),jt([t.Property(300)],r.prototype,"duration",void 0),jt([t.Property(1e3)],r.prototype,"fadeOutDuration",void 0),jt([t.Property(!1)],r.prototype,"enableTextWrap",void 0),jt([t.Complex({color:"#cccccc",width:.5},Yt)],r.prototype,"border",void 0),r}(t.ChildProperty),ii=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property("Years")],i.prototype,"intervalType",void 0),jt([t.Property(1)],i.prototype,"interval",void 0),jt([t.Property(null)],i.prototype,"text",void 0),jt([t.Property(!1)],i.prototype,"selected",void 0),i}(t.ChildProperty),ri=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Vt(i,e),jt([t.Property(43)],i.prototype,"height",void 0),jt([t.Property("Bottom")],i.prototype,"position",void 0),jt([t.Collection([],ii)],i.prototype,"periods",void 0),i}(t.ChildProperty),oi=function(){function e(e,t){e<t?(this.mStart=e,this.mEnd=t):(this.mStart=t,this.mEnd=e)}return Object.defineProperty(e.prototype,"start",{get:function(){return this.mStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.mEnd},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delta",{get:function(){return this.mEnd-this.mStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"median",{get:function(){return this.mStart+(this.mEnd-this.mStart)/2},enumerable:!0,configurable:!0}),e}(),ni=function(){function e(e){this.isColumn=0,this.chart=e}return e.prototype.calculateNumericNiceInterval=function(e,i,r){var o=re(r,e),n=i/o;if(!t.isNullOrUndefined(e.desiredIntervals))return n;for(var a=Math.pow(10,Math.floor(v(n,10))),s=0,l=e.intervalDivs;s<l.length;s++){var h=a*l[s];if(o<i/h)break;n=h}return n},e.prototype.getActualRange=function(e,t){this.initializeDoubleRange(e),!e.startFromZero&&this.isColumn>0?(e.actualRange.interval=e.interval||this.calculateNumericNiceInterval(e,e.doubleRange.delta,t),e.actualRange.max=e.doubleRange.end+e.actualRange.interval,e.doubleRange.start-e.actualRange.interval<0&&e.doubleRange.start>0?e.actualRange.min=0:e.actualRange.min=e.doubleRange.start-e.actualRange.interval):(e.actualRange.interval=e.interval||this.calculateNumericNiceInterval(e,e.doubleRange.delta,t),e.actualRange.min=e.doubleRange.start,e.actualRange.max=e.doubleRange.end)},e.prototype.initializeDoubleRange=function(e){null!==e.minimum?this.min=e.minimum:null!==this.min&&this.min!==Number.POSITIVE_INFINITY||(this.min=0),null!==e.maximum?this.max=e.maximum:null!==this.max&&this.max!==Number.NEGATIVE_INFINITY||(this.max=5),this.min===this.max&&(this.max=e.valueType.indexOf("Category")>-1?this.max:this.min+1),e.doubleRange=new oi(this.min,this.max),e.actualRange={}},e.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t,this.chart)},e.prototype.calculateRange=function(e){if(this.min=null,this.max=null,!te(e))for(var t=0,i=e.series;t<i.length;t++){var r=i[t];r.visible&&(this.paddingInterval=0,e.maxPointLength=r.points.length,((r.type.indexOf("Column")>-1||r.type.indexOf("Histogram")>-1)&&"Horizontal"===e.orientation||r.type.indexOf("Bar")>-1&&"Vertical"===e.orientation)&&("Double"!==r.xAxis.valueType&&"DateTime"!==r.xAxis.valueType||"Auto"!==r.xAxis.rangePadding||(this.paddingInterval=.5*U(r.xAxis,e.series))),"Horizontal"===e.orientation&&(this.chart.requireInvertedAxis?this.yAxisRange(e,r):this.findMinMax(r.xMin-this.paddingInterval,r.xMax+this.paddingInterval)),"Vertical"===e.orientation&&(this.isColumn+="Column"===r.type||"Bar"===r.type||"Column"===r.drawType?1:0,this.chart.requireInvertedAxis?this.findMinMax(r.xMin-this.paddingInterval,r.xMax+this.paddingInterval):this.yAxisRange(e,r)))}},e.prototype.yAxisRange=function(e,t){t.dragSettings.enable&&this.chart.dragY&&(this.chart.dragY>=e.visibleRange.max&&(t.yMax=this.chart.dragY+e.visibleRange.interval),this.chart.dragY<=e.visibleRange.min&&(t.yMin=this.chart.dragY-e.visibleRange.interval)),this.findMinMax(t.yMin,t.yMax)},e.prototype.findMinMax=function(e,t){(null===this.min||this.min>e)&&(this.min=e),(null===this.max||this.max<t)&&(this.max=t),this.max===this.min&&this.max<0&&this.min<0&&(this.max=0)},e.prototype.applyRangePadding=function(e,t){var i=e.actualRange.min,r=e.actualRange.max;if(!te(e)){var o=e.actualRange.interval,n=e.getRangePadding(this.chart);"Additional"===n||"Round"===n?this.findAdditional(e,i,r,o):"Normal"===n?this.findNormal(e,i,r,o,t):this.updateActualRange(e,i,r,o)}e.actualRange.delta=e.actualRange.max-e.actualRange.min,this.calculateVisibleRange(t,e)},e.prototype.updateActualRange=function(e,t,i,r){e.actualRange={min:null!=e.minimum?e.minimum:t,max:null!=e.maximum?e.maximum:i,interval:null!=e.interval?e.interval:r,delta:e.actualRange.delta}},e.prototype.findAdditional=function(e,t,i,r){var o,n;o=Math.floor(t/r)*r,n=Math.ceil(i/r)*r,"Additional"===e.rangePadding&&(o-=r,n+=r),this.updateActualRange(e,o,n,r)},e.prototype.findNormal=function(e,t,i,r,o){var n,a,s=t;t<0?(s=0,.365*r>=r+(n=t+.05*t)%r&&(n-=r),n%r<0&&(n=n-r-n%r)):(n=t<5/6*i?0:t-.5*(i-t))%r>0&&(n-=n%r),.365*r>=r-(a=i>0?i+.05*(i-s):i-.05*(i-s))%r&&(a+=r),a%r>0&&(a=a+r-a%r),e.doubleRange=new oi(n,a),0===n&&(r=this.calculateNumericNiceInterval(e,e.doubleRange.delta,o),a=Math.ceil(a/r)*r),this.updateActualRange(e,n,a,r)},e.prototype.calculateVisibleRange=function(e,i){if(i.visibleRange={max:i.actualRange.max,min:i.actualRange.min,delta:i.actualRange.delta,interval:i.actualRange.interval},"Cartesian"===this.chart.chartAreaType){var r=!t.isNullOrUndefined(i.zoomingScrollBar)&&i.zoomingScrollBar.isLazyLoad;(i.zoomFactor<1||i.zoomPosition>0)&&!r&&(i.calculateVisibleRangeOnZooming(this.chart),i.calculateAxisRange(e,this.chart),i.visibleRange.interval=i.enableAutoIntervalOnZooming&&"Category"!==i.valueType?this.calculateNumericNiceInterval(i,i.doubleRange.delta,e):i.visibleRange.interval)}i.triggerRangeRender(this.chart,i.visibleRange.min,i.visibleRange.max,i.visibleRange.interval)},e.prototype.calculateVisibleLabels=function(e,i){e.visibleLabels=[];var r,o=e.visibleRange.min;!("chart"===i.getModuleName()&&"PolarRadar"===i.chartAreaType)&&(e.zoomFactor<1||e.zoomPosition>0||this.paddingInterval)&&(o=e.visibleRange.min-e.visibleRange.min%e.visibleRange.interval);var n=this.getFormat(e),a=null!==n.match("{value}"),s=0,l=0;e.labelFormat&&e.labelFormat.indexOf("n")>-1&&(l=parseInt(e.labelFormat.substring(1,e.labelFormat.length),10)),e.format=i.intl.getNumberFormat({format:a?"":n,useGrouping:i.useGroupingSeparator}),e.startLabel=e.format(e.visibleRange.min),e.endLabel=e.format(e.visibleRange.max),e.visibleRange.interval&&(e.visibleRange.interval+"").indexOf(".")>=0&&(s=(e.visibleRange.interval+"").split(".")[1].length);for(var h;o<=e.visibleRange.max&&h!==o;o+=e.visibleRange.interval)h=o,r=t.extend({},t.getValue("properties",e.labelStyle),null,!0),x(o,e.visibleRange)&&ee(i,o,this.formatValue(e,a,n,o),r,e);o&&(o+"").indexOf(".")>=0&&(o+"").split(".")[1].length>10&&(o=(o+"").split(".")[1].length>(l||s)?+o.toFixed(l||s):o)<=e.visibleRange.max&&ee(i,o,this.formatValue(e,a,n,o),r,e),e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},e.prototype.getFormat=function(e){return e.labelFormat?0===e.labelFormat.indexOf("p")&&-1===e.labelFormat.indexOf("{value}")&&e.isStack100?"{value}%":e.labelFormat:e.isStack100?"{value}%":""},e.prototype.formatValue=function(e,t,i,r){return t?i.replace("{value}",e.format(r)):e.format(r)},e}(),ai="axisLabelRender",si=/~\d+~/g,li=/\^\d+\^/g,hi="onZooming",ci=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),di=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},pi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),di([t.Property("0")],i.prototype,"x",void 0),di([t.Property("0")],i.prototype,"y",void 0),di([t.Property(null)],i.prototype,"content",void 0),di([t.Property("Center")],i.prototype,"horizontalAlignment",void 0),di([t.Property("Pixel")],i.prototype,"coordinateUnits",void 0),di([t.Property("Chart")],i.prototype,"region",void 0),di([t.Property("Middle")],i.prototype,"verticalAlignment",void 0),di([t.Property(null)],i.prototype,"xAxisName",void 0),di([t.Property(null)],i.prototype,"yAxisName",void 0),di([t.Property(null)],i.prototype,"description",void 0),i}(t.ChildProperty),ui=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),di([t.Property("")],i.prototype,"color",void 0),di([t.Property(1)],i.prototype,"width",void 0),di([t.Property("Rectangle")],i.prototype,"type",void 0),i}(t.ChildProperty),gi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),di([t.Property(null)],i.prototype,"start",void 0),di([t.Property(null)],i.prototype,"end",void 0),di([t.Property("")],i.prototype,"text",void 0),di([t.Property(null)],i.prototype,"maximumTextWidth",void 0),di([t.Property(null)],i.prototype,"customAttributes",void 0),di([t.Property("")],i.prototype,"type",void 0),i}(t.ChildProperty),yi=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ci(r,i),di([t.Property(!0)],r.prototype,"visible",void 0),di([t.Property(!1)],r.prototype,"startFromAxis",void 0),di([t.Property(null)],r.prototype,"start",void 0),di([t.Property(null)],r.prototype,"end",void 0),di([t.Property(null)],r.prototype,"size",void 0),di([t.Property("#808080")],r.prototype,"color",void 0),di([t.Property(null)],r.prototype,"dashArray",void 0),di([t.Property("Auto")],r.prototype,"sizeType",void 0),di([t.Property(!1)],r.prototype,"isRepeat",void 0),di([t.Property(null)],r.prototype,"repeatEvery",void 0),di([t.Property(null)],r.prototype,"repeatUntil",void 0),di([t.Property(!1)],r.prototype,"isSegmented",void 0),di([t.Property(null)],r.prototype,"segmentStart",void 0),di([t.Property(null)],r.prototype,"segmentEnd",void 0),di([t.Property(null)],r.prototype,"segmentAxisName",void 0),di([t.Complex({color:"transparent",width:1},Yt)],r.prototype,"border",void 0),di([t.Property("")],r.prototype,"text",void 0),di([t.Property(null)],r.prototype,"rotation",void 0),di([t.Property("Middle")],r.prototype,"horizontalAlignment",void 0),di([t.Property("Middle")],r.prototype,"verticalAlignment",void 0),di([t.Complex(e.Theme.stripLineLabelFont,Xt)],r.prototype,"textStyle",void 0),di([t.Property("Behind")],r.prototype,"zIndex",void 0),di([t.Property(1)],r.prototype,"opacity",void 0),r}(t.ChildProperty),mi=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ci(r,i),di([t.Property("Center")],r.prototype,"alignment",void 0),di([t.Property("Wrap")],r.prototype,"overflow",void 0),di([t.Complex(e.Theme.axisLabelFont,Xt)],r.prototype,"textStyle",void 0),di([t.Complex({color:null,width:1,type:"Rectangle"},ui)],r.prototype,"border",void 0),di([t.Collection([],gi)],r.prototype,"categories",void 0),r}(t.ChildProperty),vi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),di([t.Property(null)],i.prototype,"minimum",void 0),di([t.Property(null)],i.prototype,"maximum",void 0),i}(t.ChildProperty),fi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ci(i,e),di([t.Property(!1)],i.prototype,"enable",void 0),di([t.Property(null)],i.prototype,"pointsLength",void 0),di([t.Complex({},vi)],i.prototype,"range",void 0),i}(t.ChildProperty),bi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xi=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},wi=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.axes=[],t.nearSizes=[],t.farSizes=[],t}return bi(i,e),i.prototype.computeSize=function(e,t){var i=0;e.visible&&e.internalVisibility&&(i+=e.findTickSize(e.crossInAxis)+t+e.findLabelSize(e.crossInAxis,5)+.5*e.lineStyle.width),e.opposedPosition?this.farSizes.push(i):this.nearSizes.push(i)},xi([t.Property("100%")],i.prototype,"height",void 0),xi([t.Complex({},Yt)],i.prototype,"border",void 0),i}(t.ChildProperty),Si=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.axes=[],t.nearSizes=[],t.farSizes=[],t.padding=0,t}return bi(i,e),i.prototype.computeSize=function(e,t){var i=0;e.visible&&e.internalVisibility&&(i+=e.findTickSize(e.crossInAxis)+t+e.findLabelSize(e.crossInAxis,5)+.5*e.lineStyle.width),e.opposedPosition?this.farSizes.push(i):this.nearSizes.push(i)},xi([t.Property("100%")],i.prototype,"width",void 0),xi([t.Complex({},Yt)],i.prototype,"border",void 0),i}(t.ChildProperty),Ci=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),xi([t.Property(1)],i.prototype,"width",void 0),xi([t.Property("")],i.prototype,"dashArray",void 0),xi([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Pi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),xi([t.Property(.7)],i.prototype,"width",void 0),xi([t.Property("")],i.prototype,"dashArray",void 0),xi([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Li=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),xi([t.Property(1)],i.prototype,"width",void 0),xi([t.Property("")],i.prototype,"dashArray",void 0),xi([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Ri=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),xi([t.Property(1)],i.prototype,"width",void 0),xi([t.Property(5)],i.prototype,"height",void 0),xi([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Mi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bi(i,e),xi([t.Property(.7)],i.prototype,"width",void 0),xi([t.Property(5)],i.prototype,"height",void 0),xi([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Ai=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return bi(r,i),xi([t.Property(!1)],r.prototype,"enable",void 0),xi([t.Property(null)],r.prototype,"fill",void 0),xi([t.Complex(e.Theme.crosshairLabelFont,Xt)],r.prototype,"textStyle",void 0),r}(t.ChildProperty),ki=function(r){function o(e,t,o,n){var a=r.call(this,e,t,o,n)||this;return a.visibleLabels=[],a.series=[],a.rect=new i.Rect(void 0,void 0,0,0),a.axisBottomLine=null,a.intervalDivs=[10,5,2,1],a.isStack100=!1,a.crossAt=null,a.updatedRect=null,a.multiLevelLabelHeight=0,a.isChart=!0,a.isIntervalInDecimal=!0,a.titleCollection=[],a.titleSize=new i.Size(0,0),a.internalVisibility=!0,a.angle=a.labelRotation,a}return bi(o,r),o.prototype.findTickSize=function(e){return"Inside"===this.tickPosition?0:!e||e.visibleRange&&!this.isInside(e.visibleRange)?this.majorTickLines.height:0},o.prototype.isInside=function(e){return b(this.crossAt,e)||!this.opposedPosition&&this.crossAt>=e.max||this.opposedPosition&&this.crossAt<=e.min},o.prototype.findLabelSize=function(e,t){var r=0,o="Horizontal"===this.orientation;if(this.title&&(this.titleSize=i.measureText(this.title,this.titleStyle),r=this.titleSize.height+t,this.rect.width||this.rect.height)){var n=o?this.rect.width:this.rect.height;this.titleCollection=Xe(this.title,this.titleStyle,n),r*=this.titleCollection.length}if("Inside"===this.labelPosition)return r+t;var a,s,l=r+t+this.titlePadding+this.labelPadding+("Vertical"===this.orientation?this.maxLabelSize.width:this.maxLabelSize.height)+this.multiLevelLabelHeight;if(e&&this.placeNextToAxisLine){var h=e.visibleRange,c="Horizontal"===e.orientation?e.rect.width:e.rect.height;if(!h||!c)return 0;this.isInside(h)&&(l=(a=(s=this.findDifference(e))*((c-((a=s*(c/h.delta))<l?l-a:0))/h.delta))<l?l-a:0)}return l},o.prototype.updateCrossValue=function(){var e=this.crossAt;if(null===e||!this.isInside(this.crossInAxis.visibleRange))return this.updatedRect=this.rect,null;var i=this.crossInAxis.visibleRange;this.opposedPosition?this.crossAt<i.min&&(e=i.min):this.crossAt>i.max&&(e=i.max),this.updatedRect=t.extend({},this.rect,null,!0),"Horizontal"===this.orientation?(e=this.crossInAxis.rect.height-I(e,this.crossInAxis)*this.crossInAxis.rect.height,this.updatedRect.y=this.crossInAxis.rect.y+e):(e=I(e,this.crossInAxis)*this.crossInAxis.rect.width,this.updatedRect.x=this.crossInAxis.rect.x+e)},o.prototype.findDifference=function(e){var t=0;return t=this.opposedPosition?e.isInversed?e.visibleRange.min:e.visibleRange.max:e.isInversed?e.visibleRange.max:e.visibleRange.min,Math.abs(this.crossAt-t)},o.prototype.calculateVisibleRangeOnZooming=function(e){if(ie(this)){var t=this.actualRange,i=void 0,r=void 0;r=!this.isInversed||e.zoomModule?(i=this.actualRange.min+this.zoomPosition*this.actualRange.delta)+this.zoomFactor*this.actualRange.delta:(i=this.actualRange.max-this.zoomPosition*this.actualRange.delta)-this.zoomFactor*this.actualRange.delta,i<t.min&&(r+=t.min-i,i=t.min),r>t.max&&(i-=r-t.max,r=t.max),this.doubleRange=new oi(i,r),this.visibleRange={min:this.doubleRange.start,max:this.doubleRange.end,delta:this.doubleRange.delta,interval:this.visibleRange.interval}}},o.prototype.calculateAxisRange=function(e,i){if(i.enableAutoIntervalOnBothAxis){if("Horizontal"===this.orientation&&"X"===i.zoomSettings.mode)for(l=0;l<this.series.length;l++){for(var r=[],o=0,n=this.series[l].visiblePoints;o<n.length;o++)(p=n[o]).xValue>this.visibleRange.min&&p.xValue<this.visibleRange.max&&r.push(p.yValue);for(var a=0,s=i.axisCollections;a<s.length;a++)"Vertical"!==(y=s[a]).orientation||t.isNullOrUndefined(y.series[l])||(y.series[l].yMin=Math.min.apply(Math,r),y.series[l].yMax=Math.max.apply(Math,r),y.baseModule.calculateRangeAndInterval(e,y))}if("Vertical"===this.orientation&&"Y"===i.zoomSettings.mode)for(var l=0;l<this.series.length;l++){for(var h=[],c=0,d=this.series[l].visiblePoints;c<d.length;c++){var p=d[c];p.yValue>this.visibleRange.min&&p.yValue<this.visibleRange.max&&h.push(p.xValue)}for(var u=0,g=i.axisCollections;u<g.length;u++){var y=g[u];"Horizontal"!==y.orientation||t.isNullOrUndefined(y.series[l])||(y.series[l].xMin=Math.min.apply(Math,h),y.series[l].xMax=Math.max.apply(Math,h),y.baseModule.calculateRangeAndInterval(e,y))}}}},o.prototype.triggerRangeRender=function(e,t,i,r){var o={cancel:!1,name:"axisRangeCalculated",axis:this,minimum:t,maximum:i,interval:r};e.trigger("axisRangeCalculated",o),o.cancel||(this.visibleRange={min:o.minimum,max:o.maximum,interval:o.interval,delta:o.maximum-o.minimum})},o.prototype.getRangePadding=function(e){var t=this.rangePadding;if("Auto"!==t)return t;switch(this.orientation){case"Horizontal":t=e.requireInvertedAxis?this.isStack100||this.baseModule.chart.stockChart?"Round":"Normal":"None";break;case"Vertical":t=e.requireInvertedAxis?"None":this.isStack100||this.baseModule.chart.stockChart?"Round":"Normal"}return t},o.prototype.getMaxLabelWidth=function(e){var r,o,n=0,a=!1;this.angle=this.labelRotation,this.maxLabelSize=new i.Size(0,0);for(var s,l=this.labelIntersectAction,h=0,c=this.visibleLabels.length;h<c;h++){(o=u((s=this.visibleLabels[h]).originalText))?(s.size=i.measureText(s.originalText.replace(/<br>/g," "),this.labelStyle),s.breakLabelSize=i.measureText(this.enableTrim?s.text.join("<br>"):s.originalText,this.labelStyle)):s.size=i.measureText(s.text,this.labelStyle);var d=o?s.breakLabelSize.width:s.size.width;d>this.maxLabelSize.width&&(this.maxLabelSize.width=d,this.rotatedLabel=s.text);var p=o?s.breakLabelSize.height:s.size.height;if(p>this.maxLabelSize.height&&(this.maxLabelSize.height=p),o&&(s.text=this.enableTrim?s.text:s.originalText.split("<br>")),"None"!==l&&"Hide"!==l&&"Trim"!==l&&("None"!==l||this.angle%360==0)&&"Horizontal"===this.orientation&&this.rect.width>0&&!a){var g=o?s.breakLabelSize.width:s.size.width;switch(r=I(s.value,this)*this.rect.width+this.rect.x,r-=g/2,"Shift"===this.edgeLabelPlacement&&(0===h&&r<this.rect.x&&(r=this.rect.x),h===this.visibleLabels.length-1&&r+g>this.rect.x+this.rect.width&&(r=this.rect.x+this.rect.width-g)),l){case"MultipleRows":h>0&&this.findMultiRows(h,r,s,o);break;case"Rotate45":case"Rotate90":h>0&&(this.isInversed?r+g>=n:r<=n)&&(this.angle="Rotate45"===l?45:90,a=!0);break;default:if(o){for(var m=void 0,v=[],f=void 0,b=0;b<s.text.length;b++)if((m=Ge(s.text[b],this.rect.width/this.visibleLabels.length,this.labelStyle)).length>1)for(var x=0;x<m.length;x++)f=m[x],v.push(f);else v.push(m[0]);s.text=v}else s.text=Ge(s.text,this.rect.width/this.visibleLabels.length,this.labelStyle);var w=s.size.height*s.text.length;w>this.maxLabelSize.height&&(this.maxLabelSize.height=w)}n=this.isInversed?r:r+g}}if(0!==this.angle&&"Horizontal"===this.orientation){this.rotatedLabel=t.isNullOrUndefined(this.rotatedLabel)?"":this.rotatedLabel;var S=-360===this.angle||0===this.angle||-180===this.angle||180===this.angle||360===this.angle;"Outside"===this.labelPosition&&!S&&u(this.rotatedLabel)?this.maxLabelSize=new i.Size(this.maxLabelSize.height,this.maxLabelSize.width):this.maxLabelSize=y(this.labelStyle,this.rotatedLabel,this.angle,e)}e.multiLevelLabelModule&&this.multiLevelLabels.length>0&&e.multiLevelLabelModule.getMultilevelLabelsHeight(this)},o.prototype.findMultiRows=function(e,t,i,r){for(var o,n,a,s=[],l=e-1;l>=0;l--)o=this.visibleLabels[l],a=r?o.breakLabelSize.width:o.size.width,n=I(o.value,this)*this.rect.width+this.rect.x,(this.isInversed?t+i.size.width>n-.5*a:t<n+.5*a)?(s.push(o.index),i.index=i.index>o.index?i.index:o.index+1):i.index=s.indexOf(o.index)>-1?i.index:o.index;var h=(r?i.breakLabelSize.height:i.size.height)*i.index+5*(i.index-1);h>this.maxLabelSize.height&&(this.maxLabelSize.height=h)},o.prototype.getModule=function(e){"Double"===this.valueType?this.baseModule=new ni(e):this.baseModule=e[G(this.valueType)+"Module"]},xi([t.Complex(e.Theme.axisLabelFont,Xt)],o.prototype,"labelStyle",void 0),xi([t.Complex({},Ai)],o.prototype,"crosshairTooltip",void 0),xi([t.Property("")],o.prototype,"title",void 0),xi([t.Complex(e.Theme.axisTitleFont,Xt)],o.prototype,"titleStyle",void 0),xi([t.Property("")],o.prototype,"labelFormat",void 0),xi([t.Property("")],o.prototype,"skeleton",void 0),xi([t.Property("DateTime")],o.prototype,"skeletonType",void 0),xi([t.Property("Center")],o.prototype,"lineBreakAlignment",void 0),xi([t.Property(0)],o.prototype,"plotOffset",void 0),xi([t.Property(null)],o.prototype,"plotOffsetLeft",void 0),xi([t.Property(null)],o.prototype,"plotOffsetTop",void 0),xi([t.Property(null)],o.prototype,"plotOffsetRight",void 0),xi([t.Property(null)],o.prototype,"plotOffsetBottom",void 0),xi([t.Property(!1)],o.prototype,"isIndexed",void 0),xi([t.Property(10)],o.prototype,"logBase",void 0),xi([t.Property(0)],o.prototype,"columnIndex",void 0),xi([t.Property(0)],o.prototype,"rowIndex",void 0),xi([t.Property(1)],o.prototype,"span",void 0),xi([t.Property(null)],o.prototype,"desiredIntervals",void 0),xi([t.Property(3)],o.prototype,"maximumLabels",void 0),xi([t.Property(1)],o.prototype,"zoomFactor",void 0),xi([t.Property(0)],o.prototype,"zoomPosition",void 0),xi([t.Property(!0)],o.prototype,"enableScrollbarOnZooming",void 0),xi([t.Property(!1)],o.prototype,"opposedPosition",void 0),xi([t.Property(!0)],o.prototype,"enableAutoIntervalOnZooming",void 0),xi([t.Property("Auto")],o.prototype,"rangePadding",void 0),xi([t.Property("Double")],o.prototype,"valueType",void 0),xi([t.Property("None")],o.prototype,"edgeLabelPlacement",void 0),xi([t.Property("Auto")],o.prototype,"intervalType",void 0),xi([t.Property("BetweenTicks")],o.prototype,"labelPlacement",void 0),xi([t.Property("Outside")],o.prototype,"tickPosition",void 0),xi([t.Property("Outside")],o.prototype,"labelPosition",void 0),xi([t.Property("")],o.prototype,"name",void 0),xi([t.Property(!0)],o.prototype,"visible",void 0),xi([t.Property(0)],o.prototype,"minorTicksPerInterval",void 0),xi([t.Property(0)],o.prototype,"labelRotation",void 0),xi([t.Property(null)],o.prototype,"crossesAt",void 0),xi([t.Property(!0)],o.prototype,"placeNextToAxisLine",void 0),xi([t.Property(null)],o.prototype,"crossesInAxis",void 0),xi([t.Property(null)],o.prototype,"minimum",void 0),xi([t.Property(null)],o.prototype,"maximum",void 0),xi([t.Property(null)],o.prototype,"interval",void 0),xi([t.Property(34)],o.prototype,"maximumLabelWidth",void 0),xi([t.Property(!1)],o.prototype,"enableTrim",void 0),xi([t.Property(5)],o.prototype,"labelPadding",void 0),xi([t.Property(5)],o.prototype,"titlePadding",void 0),xi([t.Complex({},Ri)],o.prototype,"majorTickLines",void 0),xi([t.Complex({},Mi)],o.prototype,"minorTickLines",void 0),xi([t.Complex({},Ci)],o.prototype,"majorGridLines",void 0),xi([t.Complex({},Pi)],o.prototype,"minorGridLines",void 0),xi([t.Complex({},Li)],o.prototype,"lineStyle",void 0),xi([t.Property("Trim")],o.prototype,"labelIntersectAction",void 0),xi([t.Property(!1)],o.prototype,"isInversed",void 0),xi([t.Property(100)],o.prototype,"coefficient",void 0),xi([t.Property(0)],o.prototype,"startAngle",void 0),xi([t.Property(!0)],o.prototype,"startFromZero",void 0),xi([t.Property(null)],o.prototype,"description",void 0),xi([t.Property(2)],o.prototype,"tabIndex",void 0),xi([t.Collection([],yi)],o.prototype,"stripLines",void 0),xi([t.Collection([],mi)],o.prototype,"multiLevelLabels",void 0),xi([t.Complex({color:null,width:0,type:"Rectangle"},ui)],o.prototype,"border",void 0),xi([t.Complex({},fi)],o.prototype,"scrollbarSettings",void 0),o}(t.ChildProperty),Ti=function(){function e(e,t,r,o,n,a,s){void 0===n&&(n=new i.Size(0,0)),void 0===a&&(a=new i.Size(0,0)),void 0===s&&(s=1),this.text=e,this.originalText=o,this.value=t,this.labelStyle=r,this.size=n,this.breakLabelSize=a,this.index=s}return e}(),_i=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Oi=function(){function e(e,t,i,r,o,n){this.verticalStandardMean=e,this.horizontalStandardMean=i,this.verticalSquareRoot=t,this.horizontalSquareRoot=r,this.verticalMean=o,this.horizontalMean=n}return e}(),Ei=function(){function e(e,t,i,r,o){this.startAngle=e,this.endAngle=t,this.innerRadius=i,this.radius=r,this.currentXPosition=o}return e}(),Ii=function(){function e(e){this.id=e}return e}(),zi=function(){function e(e,t){this.startValues=e,this.endValues=t}return e}(),Di=function(e){function t(t,i,r,o,n,a,s,l,h){var c=e.call(this,t,i,r.width,r.color,o,h)||this;return c.y=n.y,c.x=n.x,c.height=n.height,c.width=n.width,c.rx=a||0,c.ry=s||0,c.transform=l||"",c.stroke=0!==r.width&&""!==c.stroke?r.color:"transparent",c}return _i(t,e),t}(i.PathOption),Bi=function(){function e(e,t,i,r,o,n,a,s){this.height=e,this.width=t,this.href=i,this.x=r,this.y=o,this.id=n,this.visibility=a,this.preserveAspectRatio=s}return e}(),Fi=function(e){function t(t,i,r,o,n,a,s){var l=e.call(this,t,i,r.width,r.color,o)||this;return l.cy=a,l.cx=n,l.r=s,l}return _i(t,e),t}(i.PathOption),Ni=function(){function e(e,t,i){this.id=e,this.points=t,this.fill=i}return e}(),Vi=function(){function e(e,t){this.x=e,this.y=t}return e}(),ji=function(){function e(e,t){this.x=0,this.y=0,this.x=e,this.y=t}return e}(),Hi=function(){function e(e,t,i,r){this.left=e,this.right=t,this.top=i,this.bottom=r}return e}(),Xi=function(){function e(e,t,i){this.r=e,this.g=t,this.b=i}return e}(),Yi=function(){function e(e,t,i){void 0===i&&(i=0),this.point=e,this.series=t,this.lierIndex=i}return e}(),Gi=function(){function e(e,t,i){void 0===i&&(i=0),this.point=e,this.series=t,this.index=i}return e}(),Wi=function(){function e(e,t){this.controlPoint1=e,this.controlPoint2=t}return e}(),Ui=function(){function e(e){this.chart=e,this.padding=5}return e.prototype.measureAxis=function(e){var t=this.chart;this.crossAt(t),this.seriesClipRect=new i.Rect(e.x,e.y,e.width,e.height),this.initialClipRect=e,this.leftSize=0,this.rightSize=0,this.topSize=0,this.bottomSize=0,this.measureRowAxis(t,this.initialClipRect),this.initialClipRect=L(this.initialClipRect,new Hi(this.leftSize,this.rightSize,0,0)),this.measureColumnAxis(t,this.initialClipRect),this.initialClipRect=L(this.initialClipRect,new Hi(0,0,this.topSize,this.bottomSize)),this.chart.delayRedraw||this.calculateAxisSize(this.initialClipRect),this.leftSize=0,this.rightSize=0,this.topSize=0,this.bottomSize=0,this.measureRowAxis(t,this.initialClipRect),this.seriesClipRect=L(this.seriesClipRect,new Hi(this.leftSize,this.rightSize,0,0)),this.measureColumnAxis(t,this.initialClipRect),this.seriesClipRect=L(this.seriesClipRect,new Hi(0,0,this.topSize,this.bottomSize)),this.chart.delayRedraw||(t.refreshAxis(),this.calculateAxisSize(this.seriesClipRect))},e.prototype.measureRowAxis=function(e,t){var r;this.calculateRowSize(t);for(var o=0,n=e.rows;o<n.length;o++)(r=n[o]).nearSizes=[],r.farSizes=[],this.arrangeAxis(r),this.measureDefinition(r,e,new i.Size(e.availableSize.width,r.computedHeight)),this.leftSize<C(r.nearSizes)&&(this.leftSize=C(r.nearSizes)),this.rightSize<C(r.farSizes)&&(this.rightSize=C(r.farSizes))},e.prototype.measureColumnAxis=function(e,t){var r;this.calculateColumnSize(t);for(var o=0,n=e.columns;o<n.length;o++)(r=n[o]).farSizes=[],r.nearSizes=[],this.arrangeAxis(r),this.measureDefinition(r,e,new i.Size(r.computedWidth,e.availableSize.height)),this.bottomSize<C(r.nearSizes)&&(this.bottomSize=C(r.nearSizes)),this.topSize<C(r.farSizes)&&(this.topSize=C(r.farSizes))},e.prototype.measureDefinition=function(e,t,i){for(var r=0,o=e.axes;r<o.length;r++){var n=o[r];n.scrollBarHeight=t.scrollBarModule&&t.zoomModule&&t.zoomSettings.enableScrollbar&&n.enableScrollbarOnZooming&&t.zoomModule.isZoomed&&(n.zoomFactor<1||n.zoomPosition>0)?16:0,n.scrollBarHeight=t.scrollBarModule&&(t.zoomModule&&t.zoomSettings.enableScrollbar&&n.enableScrollbarOnZooming&&t.zoomModule.isZoomed&&(n.zoomFactor<1||n.zoomPosition>0)||n.scrollbarSettings.enable)?16:0,n.getModule(t),n.baseModule.calculateRangeAndInterval(i,n),e.computeSize(n,n.scrollBarHeight)}e.farSizes.length>0&&(e.farSizes[e.farSizes.length-1]-=10),e.nearSizes.length>0&&(e.nearSizes[e.nearSizes.length-1]-=10)},e.prototype.calculateAxisSize=function(e){var t,i,r,o,n,a,s,l=this.chart,h=0,c=0,d=0;this.calculateRowSize(e);for(var p=0,u=l.rows.length;p<u;p++){h=0,c=0;for(var g=0,y=(t=l.rows[p]).axes.length;g<y;g++){if(o=t.axes[g],s=o.plotOffset,0===o.rect.height){o.rect.height=t.computedHeight,d=0;for(var m=p+1,v=p+o.span;m<v;m++)d+=(r=l.rows[m]).computedHeight;o.rect.y=t.computedTop-d+(o.plotOffsetTop?o.plotOffsetTop:s),o.rect.height=o.rect.height+d-this.getAxisOffsetValue(o.plotOffsetTop,o.plotOffsetBottom,o.plotOffset),o.rect.width=0}o.opposedPosition?(n=e.x+e.width+C(E(t.farSizes,c)),o.rect.x=o.rect.x>=n?o.rect.x:n,c++):(n=e.x-C(E(t.nearSizes,h)),o.rect.x=o.rect.x<=n?o.rect.x:n,h++)}}this.calculateColumnSize(e);for(var p=0,u=l.columns.length;p<u;p++){h=0,c=0;for(var g=0,f=(i=l.columns[p]).axes.length;g<f;g++){if(o=i.axes[g],s=o.plotOffset,0===o.rect.width){for(var m=p,b=p+o.span;m<b;m++)r=l.columns[m],o.rect.width+=r.computedWidth;o.rect.x=i.computedLeft+(o.plotOffsetLeft?o.plotOffsetLeft:s),o.rect.width-=this.getAxisOffsetValue(o.plotOffsetLeft,o.plotOffsetRight,o.plotOffset),o.rect.height=0}o.opposedPosition?(a=e.y-C(E(i.farSizes,c)),o.rect.y=o.rect.y<=a?o.rect.y:a,c++):(a=e.y+e.height+C(E(i.nearSizes,h)),o.rect.y=o.rect.y>=a?o.rect.y:a,h++)}}},e.prototype.measure=function(){for(var e,t,i,r,o,n=this.chart,a=0,s=n.axisCollections;a<s.length;a++){var l=s[a];if("Vertical"===l.orientation){n.verticalAxes.push(l),r=this.getActualRow(l),e=n.rows[r],this.pushAxis(e,l),o=r+l.span>n.rows.length?n.rows.length:r+l.span;for(h=r+1;h<o;h++)(i=n.rows[h]).axes[e.axes.length-1]=l,n.rows[h]=i;n.rows[r]=e}else{n.horizontalAxes.push(l),r=this.getActualColumn(l),t=n.columns[r],this.pushAxis(t,l),o=r+l.span>n.columns.length?n.columns.length:r+l.span;for(var h=r+1;h<o;h++)(i=n.columns[h]).axes[t.axes.length-1]=l,n.columns[h]=i;n.columns[r]=t}}},e.prototype.getAxisOffsetValue=function(e,t,i){return e?e+(t||i):t?t+i:2*i},e.prototype.crossAt=function(e){for(var t=0,i=e.axisCollections;t<i.length;t++){var r=i[t];if(null!==r.crossesAt)if(r.crossesInAxis)for(var o=2,n=e.axisCollections.length;o<n;o++)r.crossesInAxis!==e.axisCollections[o].name||(r.crossInAxis=e.axisCollections[o],r.crossAt=this.updateCrossAt(r.crossInAxis,r.crossesAt));else e.requireInvertedAxis?r.crossInAxis="Horizontal"===r.orientation?e.primaryXAxis:e.primaryYAxis:r.crossInAxis="Horizontal"===r.orientation?e.primaryYAxis:e.primaryXAxis,r.crossAt=this.updateCrossAt(r.crossInAxis,r.crossesAt)}},e.prototype.updateCrossAt=function(e,t){switch(e.valueType){case"DateTime":var i={skeleton:"full",type:"dateTime"},o=this.chart.intl.getDateParser(i),n=this.chart.intl.getDateFormat(i);return Date.parse(o(n(new Date(r.DataUtil.parse.parseJson({val:t}).val))));case"Category":return parseFloat(t)?parseFloat(t):e.labels.indexOf(t);case"Logarithmic":return v(t,e.logBase);default:return t}},e.prototype.pushAxis=function(e,t){for(var i=0,r=e.axes.length;i<=r;i++)if(!e.axes[i]){e.axes[i]=t;break}},e.prototype.arrangeAxis=function(e){for(var t=[],i=0,r=e.axes.length;i<=r;i++)e.axes[i]&&t.push(e.axes[i]);e.axes=t},e.prototype.getActualColumn=function(e){var t=this.chart.columns.length,i=e.columnIndex;return i>=t?t-1:i<0?0:i},e.prototype.getActualRow=function(e){var t=this.chart.rows.length,i=e.rowIndex;return i>=t?t-1:i<0?0:i},e.prototype.calculateRowSize=function(e){for(var t,i=this.chart,r=e.y+e.height,o=0,n=Math.max(0,e.height),a=0,s=i.rows.length;a<s;a++)o=-1!==(t=i.rows[a]).height.indexOf("%")?Math.min(n,e.height*parseInt(t.height,10)/100):Math.min(n,parseInt(t.height,10)),o=a!==s-1?o:n,t.computedHeight=o,r-=o,t.computedTop=r,n-=o},e.prototype.calculateColumnSize=function(e){for(var t,i=this.chart,r=e.x,o=0,n=Math.max(0,e.width),a=0,s=i.columns.length;a<s;a++)o=-1!==(t=i.columns[a]).width.indexOf("%")?Math.min(n,e.width*parseInt(t.width,10)/100):Math.min(n,parseInt(t.width,10)),o=a!==s-1?o:n,t.computedWidth=o,t.computedLeft=r,r+=o,n-=o},e.prototype.renderAxes=function(){for(var e,t,i,r=this.chart,o=r.renderer.createGroup({id:r.element.id+"AxisInsideCollection"}),n=r.renderer.createGroup({id:r.element.id+"AxisOutsideCollection"}),a=0,s=r.axisCollections.length;a<s;a++)e=r.axisCollections[a],this.element=r.renderer.createGroup({id:r.element.id+"AxisGroup"+a+"Inside"}),t=r.renderer.createGroup({id:r.element.id+"AxisGroup"+a+"Outside"}),i=this.findAxisPosition(e),"Horizontal"===e.orientation?(e.updateCrossValue(),e.visible&&e.internalVisibility&&e.lineStyle.width>0&&this.drawAxisLine(e,a,e.plotOffset,0,i?t:this.element,e.updatedRect),(e.majorGridLines.width>0||e.majorTickLines.width>0)&&this.drawXAxisGridLine(e,a,i||"Inside"===e.tickPosition?t:this.element,e.updatedRect),e.visible&&e.internalVisibility&&(this.drawXAxisLabels(e,a,i||"Inside"===e.labelPosition?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect),this.drawXAxisBorder(e,a,i||"Inside"===e.labelPosition?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect),this.drawXAxisTitle(e,a,i?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect))):(e.updateCrossValue(),e.visible&&e.internalVisibility&&e.lineStyle.width>0&&this.drawAxisLine(e,a,0,e.plotOffset,i?t:this.element,e.updatedRect),(e.majorGridLines.width>0||e.majorTickLines.width>0)&&this.drawYAxisGridLine(e,a,i||"Inside"===e.tickPosition?t:this.element,e.updatedRect),e.visible&&e.internalVisibility&&(this.drawYAxisLabels(e,a,i||"Inside"===e.labelPosition?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect),this.drawYAxisBorder(e,a,i||"Inside"===e.labelPosition?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect),this.drawYAxisTitle(e,a,i?t:this.element,e.placeNextToAxisLine?e.updatedRect:e.rect))),this.chart.enableCanvas||(o.appendChild(this.element),t&&t.childNodes.length>0&&n.appendChild(t)),r.scrollBarModule&&(r.zoomSettings.enableScrollbar&&e.enableScrollbarOnZooming||e.scrollbarSettings.enable)&&this.renderScrollbar(r,e);this.element=r.renderer.createGroup({id:r.element.id+"DefinitionLine"});for(var l=0,s=r.rows.length;l<s;l++){var h=r.rows[l];h.border.color&&this.drawBottomLine(h,l,!0)}for(var l=0,s=r.columns.length;l<s;l++){var c=r.columns[l];c.border.color&&this.drawBottomLine(c,l,!1)}return this.chart.enableCanvas||o.appendChild(this.element),be(r.enableCanvas,r.svgObject,o,r.redraw),n},e.prototype.renderScrollbar=function(e,i){(!t.isNullOrUndefined(e.zoomModule)&&e.zoomModule.isZoomed&&(i.zoomFactor<1||i.zoomPosition>0)||i.scrollbarSettings.enable&&(i.zoomFactor<=1||i.zoomPosition>=0))&&(!i.zoomingScrollBar.isScrollUI||e.visibleSeries[0].type.indexOf("Bar")>=0)?(e.scrollElement||(e.scrollElement=Fe(e.redraw,e.element.id+"_scrollElement")||t.createElement("div",{id:e.element.id+"_scrollElement"})),be(!1,e.scrollElement,i.zoomingScrollBar.render(!0),!0)):1===i.zoomFactor&&0===i.zoomPosition&&i.zoomingScrollBar.svgObject&&!i.scrollbarSettings.enable&&i.zoomingScrollBar.destroy(),i.zoomingScrollBar.isScrollUI&&(i.zoomingScrollBar.isScrollUI=!1)},e.prototype.findAxisPosition=function(e){return null!==e.crossAt&&e.isInside(e.crossInAxis.visibleRange)},e.prototype.drawBottomLine=function(e,t,i){var r,o,n,a,s,l=this.chart,h={};i?(n=a=(e=e).computedTop+e.computedHeight,o=(r=this.seriesClipRect.x)+this.seriesClipRect.width,s="Row"):(r=o=(e=e).computedLeft,a=(n=this.seriesClipRect.y)+this.seriesClipRect.height,s="Column"),h={id:l.element.id+"_AxisBottom_"+s+t,x1:r,y1:n,x2:o,y2:a,"stroke-width":e.border.width,stroke:e.border.color},this.htmlObject=l.renderer.drawLine(h),this.element.appendChild(this.htmlObject)},e.prototype.drawAxisLine=function(e,t,i,r,o,n){var a=this.chart,s={},l=he(a.element.id+"AxisLine_"+t),h=l?l.getAttribute("d"):"";l=null,s={id:a.element.id+"AxisLine_"+t,d:"M "+(n.x-i)+" "+(n.y-r)+" L "+(n.x+n.width+i)+" "+(n.y+n.height+r),"stroke-dasharray":e.lineStyle.dashArray,"stroke-width":e.lineStyle.width,stroke:e.lineStyle.color||a.themeStyle.axisLine},this.htmlObject=a.renderer.drawPath(s),be(a.enableCanvas,o,this.htmlObject,a.redraw,!0,"x","y",null,h)},e.prototype.drawYAxisGridLine=function(e,i,r,o){var n,a,s="Logarithmic"===e.valueType,l=e.valueType.indexOf("Category")>-1,h=0,c="",d="",p=e.opposedPosition?e.majorTickLines.height:-e.majorTickLines.height,u=e.opposedPosition?.5*e.lineStyle.width:.5*-e.lineStyle.width,g="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0,y=t.isNullOrUndefined(e.crossesAt)?e.opposedPosition?e.scrollBarHeight:-e.scrollBarHeight:0,m="Inside"===e.tickPosition,v=m?o.x-p-u:o.x+p+u+y,f=e.visibleLabels.length,x=this.chart.themeStyle;e.valueType.indexOf("Category")>-1&&"BetweenTicks"===e.labelPlacement&&f>0&&(f+=1);for(var w=e.minorGridLines,S=e.minorTickLines,C=0;C<f;C++)(h=-1*(h=I(n=e.visibleLabels[C]?e.visibleLabels[C].value-g:e.visibleLabels[C-1].value+e.visibleRange.interval-g,e)*o.height)+(o.y+o.height))>=o.y&&o.y+o.height>=h&&((b(n,e.visibleRange)||this.isBorder(e,C,h))&&(c="M "+this.seriesClipRect.x+" "+h+" L "+(this.seriesClipRect.x+this.seriesClipRect.width)+" "+h,this.renderGridLine(e,i,c,e.majorGridLines,"_MajorGridLine_",C,this.element,x.majorGridLine,e.majorGridLines.dashArray)),d="M "+(o.x+u+(m?y:0))+" "+h+" L "+v+" "+h,this.renderGridLine(e,i,d,e.majorTickLines,"_MajorTickLine_",C,r,x.majorTickLine),(w.width>0||S.width>0)&&e.minorTicksPerInterval>0&&(0!==C||!ie(e)||s||l||this.renderMinorGridOnZooming(e,n,o,C,i,x,r),a=this.drawAxisMinorLine(e,n,o,C),this.renderGridLine(e,i,a[0],w,"_MinorGridLine_",C,this.element,x.minorGridLine,w.dashArray),this.renderGridLine(e,i,a[1],S,"_MinorTickLine_",C,r,x.minorTickLine),C===f-1&&ie(e)&&s&&!l&&this.renderMinorGridOnZooming(e,n+e.visibleRange.interval,o,C,i,x,r)))},e.prototype.isBorder=function(e,t,i){var r=this.chart.chartArea.border,o=this.seriesClipRect,n=e.orientation,a="Horizontal"===n?o.x:o.y,s="Horizontal"===n?o.width:o.height,l="Horizontal"===n?0:e.visibleLabels.length-1,h="Horizontal"===n?e.visibleLabels.length-1:0;return e.plotOffset>0||((i===a||i===a+s)&&(r.width<=0||"transparent"===r.color)||(i!==a&&t===l||i!==a+s&&t===h))},e.prototype.drawYAxisLabels=function(e,r,o,n){var a,s,l,h=this.chart,c=0,d=0,p=e.labelPadding,g="Inside"===e.labelPosition,y=e.opposedPosition,m=(e.labelPosition===e.tickPosition?e.majorTickLines.height:0)+p+.5*e.lineStyle.width;m=e.opposedPosition?m:-m;var v=y&&g||!y&&!g?"end":"start";v=h.isRtlEnabled?e.opposedPosition?"end":"start":v;for(var f,b,x,w=h.renderer.createGroup({id:h.element.id+"AxisLabels"+r}),S=t.isNullOrUndefined(e.crossesAt)?e.scrollBarHeight*(y?1:-1):0,C=0,P=e.visibleLabels.length;C<P;C++){l=u(e.visibleLabels[C].originalText),c=g?n.x-m:n.x+m+S,a=l?e.visibleLabels[C].breakLabelSize:e.visibleLabels[C].size,d=I(e.visibleLabels[C].value,e)*n.height+(h.stockChart?7:0),d=Math.floor(-1*d+(n.y+n.height)),f=a.height/8*e.visibleLabels[C].text.length/2,b=a.height/4*3+3,d=l?"Inside"===e.labelPosition?d-a.height/2-f+b:d-f:"Inside"===e.labelPosition?d+b:d+a.height/4,x=e.majorGridLines.width>e.majorTickLines.width?e.majorGridLines.width:e.majorTickLines.width,"Far"===e.labelStyle.textAlignment?d=d-x-10:"Near"===e.labelStyle.textAlignment?d=d+x+10:"Center"===e.labelStyle.textAlignment&&(d=d),c=l?this.getAxisLabelXvalue(c,e,a.width):c;var L=l?this.getAnchor(e):v;if(s=new i.TextOption(h.element.id+r+"_AxisLabel_"+C,c,d,L,e.visibleLabels[C].text),e.edgeLabelPlacement)switch(e.edgeLabelPlacement){case"None":break;case"Hide":((0===C||e.isInversed&&C===P-1)&&s.y>n.y+n.height||(C===P-1||e.isInversed&&0===C)&&s.y-.5*a.height<n.y)&&(s.text="");break;case"Shift":(0===C||e.isInversed&&C===P-1)&&s.y>n.y+n.height?s.y=d=n.y+n.height:(C===P-1||e.isInversed&&0===C)&&s.y-.5*a.height<n.y&&(s.y=d=n.y+.5*a.height)}Ve(h.renderer,s,e.labelStyle,e.labelStyle.color||h.themeStyle.axisLabel,w,!1,h.redraw,!0,!0,null,null,null,null,h.enableCanvas)}this.chart.enableCanvas||(h.delayRedraw?e.visible&&e.internalVisibility&&this.createZoomingLabel(this.chart,w,e,r,n):be(h.enableCanvas,o,w,h.redraw))},e.prototype.getAxisLabelXvalue=function(e,t,i){var r=t.lineBreakAlignment,o="Inside"===t.labelPosition,n=t.opposedPosition;return n&&o||!n&&!o?"Right"===r?e:"Center"===r?e-i/2:e-i:"Left"===r?e:"Center"===r?e+i/2:e+i},e.prototype.drawYAxisBorder=function(e,t,i,r){if(e.border.width>0){var o=void 0,n=void 0,a="Outside"===e.labelPosition?e.scrollBarHeight:0;a=(e.opposedPosition?1:-1)*a;for(var s=r.height/e.visibleRange.delta*("DateTime"===e.valueType?e.dateTimeInterval:e.visibleRange.interval),l=void 0,h=e.maxLabelSize.width+10+(e.tickPosition===e.labelPosition?e.majorTickLines.height:0),c="",d="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?-.5:0,p=e.opposedPosition&&"Inside"===e.labelPosition||!e.opposedPosition&&"Outside"===e.labelPosition?r.x-h+a:r.x+h+a,u=0,g=e.visibleLabels.length;u<g;u++)switch(n=I(e.visibleLabels[u].value+d,e),n=(e.isInversed?1-n:n)*r.height,"Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?(o=-1*n+(r.y+r.height),l=-1*n-s+(r.y+r.height)):(o=-1*n+s/2+(r.y+r.height),l=-1*n-s/2+(r.y+r.height)),e.border.type){case"Rectangle":case"WithoutTopBorder":o>r.y+r.height?c+="M "+p+" "+(r.y+r.height)+" L "+p+" "+l+" ":Math.floor(r.y)>l?c+="M "+(r.x+a)+" "+o+" L "+p+" "+o+" L "+p+" "+r.y+" ":(c+="M "+(r.x+a)+" "+o+" L "+p+" "+o+" L "+p+" "+l+" ",u===e.visibleLabels.length-1&&(c+="M "+(r.x+a)+" "+l+" L "+p+" "+l+" "));break;case"WithoutTopandBottomBorder":o>r.y+r.height||l<Math.floor(r.y)||(c+="M "+(r.x+a)+" "+o+" L "+p+" "+o+" M "+p+" "+l+" L "+(r.x+a)+" "+l)}""!==(c+="Rectangle"===e.border.type?"M "+(r.x+a)+" "+r.y+" L "+(r.x+a)+" "+(r.y+r.height)+" ":"")&&this.createAxisBorderElement(e,t,c,i)}e.multiLevelLabels.length>0&&this.chart.multiLevelLabelModule&&this.chart.multiLevelLabelModule.renderYAxisMultiLevelLabels(e,t,i,r)},e.prototype.drawYAxisTitle=function(e,t,r,o){if(e.title){var n=this.chart,a=e.opposedPosition?90:-90,s=("Inside"===e.tickPosition?0:e.majorTickLines.height+e.titlePadding)+("Inside"===e.labelPosition?0:e.maxLabelSize.width+e.multiLevelLabelHeight+this.padding);s=e.opposedPosition?s+e.scrollBarHeight:-s-e.scrollBarHeight;var l=o.x+s,h=o.y+.5*o.height,c=e.titleSize.height*(e.titleCollection.length-1),d=new i.TextOption(n.element.id+"_AxisTitle_"+t,l,h-e.labelPadding-c,"middle",e.titleCollection,"rotate("+a+","+l+","+h+")",null,a),p=Ve(n.renderer,d,e.titleStyle,e.titleStyle.color||n.themeStyle.axisTitle,r,null,null,null,null,null,null,null,null,n.enableCanvas);p.setAttribute("tabindex",e.tabIndex.toString()),p.setAttribute("aria-label",e.description||e.title)}},e.prototype.drawXAxisGridLine=function(e,i,r,o){var n,a,s="Logarithmic"===e.valueType,l=e.valueType.indexOf("Category")>-1,h=0,c="",d="",p=e.opposedPosition?-e.majorTickLines.height:e.majorTickLines.height,u=e.opposedPosition?.5*-e.lineStyle.width:.5*e.lineStyle.width,g=t.isNullOrUndefined(e.crossesAt)?e.opposedPosition?-e.scrollBarHeight:e.scrollBarHeight:0,y=e.valueType.indexOf("Category")>-1&&"BetweenTicks"===e.labelPlacement?.5:0,m=e.visibleLabels.length,v="Inside"===e.tickPosition,f=v?o.y-p-u:o.y+p+u+g,x=this.chart.themeStyle;e.valueType.indexOf("Category")>-1&&m>0&&"BetweenTicks"===e.labelPlacement&&(m+=1);for(var w=0;w<m;w++)(h=I(n="DateTimeCategory"!==e.valueType?e.visibleLabels[w]?e.visibleLabels[w].value-y:e.visibleLabels[w-1].value+e.visibleRange.interval-y:e.visibleLabels[w]?e.visibleLabels[w].value-y:e.visibleRange.max,e)*o.width+o.x)>=o.x&&o.x+o.width>=h&&((b(n,e.visibleRange)||this.isBorder(e,w,h))&&(c="M "+h+" "+(this.seriesClipRect.y+this.seriesClipRect.height)+" L "+h+" "+this.seriesClipRect.y,this.renderGridLine(e,i,c,e.majorGridLines,"_MajorGridLine_",w,this.element,x.majorGridLine,e.majorGridLines.dashArray)),d="M "+h+" "+(o.y+u+(v?g:0))+" L "+h+" "+f,this.renderGridLine(e,i,d,e.majorTickLines,"_MajorTickLine_",w,r,x.majorTickLine),e.minorTicksPerInterval>0&&(e.minorGridLines.width>0||e.minorTickLines.width>0)&&(0!==w||!ie(e)||s||l||this.renderMinorGridOnZooming(e,n,o,w,i,x,r),a=this.drawAxisMinorLine(e,n,o,w),this.renderGridLine(e,i,a[0],e.minorGridLines,"_MinorGridLine_",w,this.element,x.minorGridLine,e.minorGridLines.dashArray),this.renderGridLine(e,i,a[1],e.minorTickLines,"_MinorTickLine_",w,r,x.minorTickLine),w===m-1&&ie(e)&&s&&!l&&this.renderMinorGridOnZooming(e,n+e.visibleRange.interval,o,w,i,x,r)))},e.prototype.renderMinorGridOnZooming=function(e,t,i,r,o,n,a){var s=this.drawAxisMinorLine(e,t,i,r,!0);this.renderGridLine(e,o,s[0],e.minorGridLines,"_MinorGridLine_",-1,this.element,n.minorGridLine,e.minorGridLines.dashArray),this.renderGridLine(e,o,s[1],e.minorTickLines,"_MinorTickLine_",-1,a,n.minorTickLine)},e.prototype.drawAxisMinorLine=function(e,t,i,r,o){var n,a=t,s=0,l=0,h=e.visibleRange,c="Inside"===e.tickPosition,d=[],p=e.opposedPosition?-e.minorTickLines.height:e.minorTickLines.height,u=1,g=1,y=c?i.y-p:i.y+p,m=c?i.x+p:i.x-p,v="",f="";if("Logarithmic"===e.valueType&&(g=(n=Math.pow(e.logBase,a-h.interval))+(u=(Math.pow(e.logBase,a)-n)/(e.minorTicksPerInterval+1))),"Horizontal"===e.orientation)for(x=0;x<e.minorTicksPerInterval;x++)a=this.findLogNumeric(e,g,a,r,o),g+=u,b(a,h)&&(l=(a-h.min)/(h.max-h.min),l=Math.ceil((e.isInversed?1-l:l)*i.width),s=Math.floor(l+i.x),v=v.concat("M "+s+" "+this.seriesClipRect.y+"L "+s+" "+(this.seriesClipRect.y+this.seriesClipRect.height)),s=Math.floor(l+i.x),f=f.concat("M "+s+" "+i.y+"L "+s+" "+(y+e.scrollBarHeight)));else for(var x=0;x<e.minorTicksPerInterval;x++)b(a=this.findLogNumeric(e,g,a,r,o),h)&&(l=(a-h.min)/(h.max-h.min),l=-1*Math.ceil((e.isInversed?1-l:l)*i.height),s=Math.floor(l+i.y+i.height),v=v.concat("M "+this.seriesClipRect.x+" "+s+"L "+(this.seriesClipRect.x+this.seriesClipRect.width)+" "+s+" "),s=Math.floor(l+i.y+i.height),f=f.concat("M "+i.x+" "+s+"L "+(m-e.scrollBarHeight)+" "+s+" ")),g+=u;return d.push(v),d.push(f),d},e.prototype.findLogNumeric=function(e,t,i,r,o){var n,a=e.visibleRange;if("Logarithmic"===e.valueType)i=v(t,e.logBase);else if("DateTime"===e.valueType)n=e.dateTimeInterval/(e.minorTicksPerInterval+1),i=o?i-n:i+n;else if("DateTimeCategory"===e.valueType){var s="BetweenTicks"===e.labelPlacement?.5:0;i+=((e.visibleLabels[r+1]?e.visibleLabels[r+1].value-s:e.visibleRange.max)-(e.visibleLabels[r]?e.visibleLabels[r].value-s:e.visibleRange.min))/(e.minorTicksPerInterval+1)}else n=a.interval/(e.minorTicksPerInterval+1),i=o?i-n:i+n;return i},e.prototype.drawXAxisLabels=function(e,r,o,n){var a,s,l,h,c,d,p,g,y,m=this.chart,v=0,f=0,b=e.labelPadding,x=m.renderer.createGroup({id:m.element.id+"AxisLabels"+r}),w="Inside"===e.labelPosition,S=e.opposedPosition,C=e.labelPosition===e.tickPosition?e.majorTickLines.height:0,P=C+b+.5*e.lineStyle.width,L=e.angle%360,R=0===L||-180===L||180===L,M=e.isInversed?n.x+n.width:n.x,A=0,_=e.visibleLabels.length,O=e.scrollbarSettings.enable||!w&&t.isNullOrUndefined(e.crossesAt)&&(e.zoomFactor<1||e.zoomPosition>0)?e.scrollBarHeight:0,E=[],z=!1;P+=90===L||270===L||-90===L||-270===L?w?5:-5:0;for(var D=!S&&!w||S&&w,B=D?360>=L&&L>=180||-1>=L&&L>=-180:1<=L&&L<=180||-181>=L&&L>=-360,F=0,N=_;F<N;F++){y=u((g=e.visibleLabels[F]).originalText),v=I(g.value,e)*n.width+n.x,s=g.size,p=n.width/_,d=y?g.breakLabelSize.width:s.width,A=("Trim"===e.labelIntersectAction||"Wrap"===e.labelIntersectAction)&&0===L&&d>p?p:d,a=s.height/4,v-=y||0!==L?0:A/2,0!==L&&(v-=y?"Left"===e.lineBreakAlignment?g.breakLabelSize.width/2:"Right"===e.lineBreakAlignment?-g.breakLabelSize.width/2:0:-90===L||270===L?-a:90===L||-270===L?a:0),"Far"===e.labelStyle.textAlignment?v=v+A-10:"Near"===e.labelStyle.textAlignment?v=v-A+10:"Center"===e.labelStyle.textAlignment&&(v=v),y&&"Center"!==e.lineBreakAlignment&&0===L&&(v+="Left"===e.lineBreakAlignment?-A/2:A/2);var V=y?R?s.height:g.breakLabelSize.width/2:0;if(P=y?C+b+.5*e.lineStyle.width:P,w&&L?f=y?S?n.y+P+V:n.y-P-V:S?n.y+P+a:n.y-P-a:(l=y?D?P+O+(L?V:3*a):-(P+O+V):D?P+O+(L?1:3)*a:-(P+O+(L?a:g.index>1?2*a:0)),f=n.y+l*g.index),h=y?this.getAnchor(e):m.isRtlEnabled||B?"end":"",c=new i.TextOption(m.element.id+r+"_AxisLabel_"+F,v,f,h),e.edgeLabelPlacement&&0===L)switch(e.edgeLabelPlacement){case"None":break;case"Hide":if((0===F||e.isInversed&&F===N-1)&&c.x<n.x||(F===N-1||e.isInversed&&0===F)&&c.x+A>n.x+n.width)continue;break;case"Shift":(0===F||e.isInversed&&F===N-1)&&c.x<n.x?(p-=n.x-c.x,c.x=v=n.x):(F===N-1||e.isInversed&&0===F)&&c.x+A>n.x+n.width&&(s.width>p&&"Trim"===e.labelIntersectAction?p-=c.x+A-(n.x+n.width):p=A,c.x=v=n.x+n.width-p)}c.text=this.getLabelText(g,e,p);var j=void 0,H=void 0;if(y&&0===L?"Right"===e.lineBreakAlignment?(j=c.x-A,H=c.x):"Center"===e.lineBreakAlignment?(j=c.x-A/2,H=c.x+A/2):(j=c.x,H=c.x+A):(j=c.x,H=c.x+A),0!==L||"Hide"!==e.labelIntersectAction||0===F||!(e.isInversed?H>=M:j<=M)){if(M=y?"Right"===e.lineBreakAlignment?e.isInversed?c.x-A:c.x:"Center"===e.lineBreakAlignment?e.isInversed?c.x-A/2:c.x+A/2:e.isInversed?c.x:c.x+A:e.isInversed?c.x:c.x+A,0!==L){var X=void 0,Y=void 0;if(y){var G=0,W=0;X=g.breakLabelSize.height,W=g.breakLabelSize.height-4,"Center"===e.lineBreakAlignment?G=-g.breakLabelSize.width/2:"Right"===e.lineBreakAlignment&&(G=-g.breakLabelSize.width),D&&(W=g.breakLabelSize.height/(c.text.length+1)),Y=new i.Rect(c.x+G,c.y-W,g.breakLabelSize.width,X)}else X=f-(c.y-(g.size.height/2+10)),Y=new i.Rect(c.x,c.y-(g.size.height/2-5),g.size.width,X);var U=this.getRectanglePoints(Y),Z=y?Y.x+Y.width/2:v,q=y?Y.y+Y.height/2:f-X/2;c.transform=y?"rotate("+L+","+Z+","+q+")":"rotate("+L+","+v+","+f+")",E.push(k(U,Z,q,L)),z=!1;for(var Q=F;Q>0;Q--)if(E[F]&&E[Q-1]&&T(E[F],E[Q-1])){z=!0,E[F]=null;break}}Ve(m.renderer,c,g.labelStyle,g.labelStyle.color||m.themeStyle.axisLabel,x,e.opposedPosition!==("Inside"===e.labelPosition),m.redraw,!0,null,null,null,g.size,z,m.enableCanvas)}}this.chart.enableCanvas||(m.delayRedraw?e.visible&&e.internalVisibility&&this.createZoomingLabel(this.chart,x,e,r,n):o.appendChild(x))},e.prototype.getAnchor=function(e){return"Center"===e.lineBreakAlignment?"middle":"Left"===e.lineBreakAlignment?"start":"end"},e.prototype.getRectanglePoints=function(e){return[new Vi(e.x,e.y),new Vi(e.x+e.width,e.y),new Vi(e.x+e.width,e.y+e.height),new Vi(e.x,e.y+e.height)]},e.prototype.getLabelText=function(e,t,i){if(u(e.originalText)){for(var r=[],o=void 0,n=0;n<e.text.length;n++)o=this.findAxisLabel(t,e.text[n],i),r.push(o);return r}return this.findAxisLabel(t,e.text,i)},e.prototype.drawXAxisBorder=function(e,t,i,r){if(e.border.width>0){for(var o="Outside"===e.labelPosition?e.scrollBarHeight:0,n=void 0,a=r.y+(e.opposedPosition?-1:1)*o,s=void 0,l=r.width/e.visibleRange.delta*("DateTime"===e.valueType?e.dateTimeInterval:e.visibleRange.interval),h=void 0,c=e.maxLabelSize.height+(e.tickPosition===e.labelPosition?e.majorTickLines.height:0),d="",p="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?-.5:0,u=e.opposedPosition&&"Inside"===e.labelPosition||!e.opposedPosition&&"Outside"===e.labelPosition?r.y+c+10+o:r.y-c-10-o,g=0,y=e.visibleLabels.length;g<y;g++)switch(s=I(e.visibleLabels[g].value+p,e),s=(e.isInversed?1-s:s)*r.width,"Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?(n=s+r.x,h=s+l+r.x):(n=s-.5*l+r.x,h=s+.5*l+r.x),e.border.type){case"Rectangle":case"WithoutTopBorder":n<r.x?d+="M "+r.x+" "+u+" L "+h+" "+u+" ":Math.floor(h)>r.width+r.x&&1!==e.visibleLabels.length?d+="M "+n+" "+a+" L "+n+" "+u+" L "+(r.width+r.x)+" "+u+" ":(d+="M "+n+" "+a+" L "+n+" "+u+" L "+h+" "+u+" ",0===g&&(d+="M "+n+" "+a+" L "+n+" "+u+" M "+n+" "+u+" L "+r.x+" "+u),g===e.visibleLabels.length-1&&(d+="M "+h+" "+a+" L "+h+" "+u+" M "+h+" "+u+" L "+(r.width+r.x)+" "+u));break;case"WithoutTopandBottomBorder":n<r.x||Math.floor(h)>r.width+r.x||(d+="M "+n+" "+a+" L "+n+" "+u+" M "+h+" "+a+" L "+h+" "+u)}""!==(d+="Rectangle"===e.border.type?"M "+r.x+" "+a+"L "+(r.x+r.width)+" "+a:"")&&this.createAxisBorderElement(e,t,d,i)}this.chart.multiLevelLabelModule&&e.multiLevelLabels.length>0&&this.chart.multiLevelLabelModule.renderXAxisMultiLevelLabels(e,t,i,r)},e.prototype.createAxisBorderElement=function(e,t,r,o){var n=he(this.chart.element.id+"_BorderLine_"+t),a=n?n.getAttribute("d"):"",s=this.chart.renderer.drawPath(new i.PathOption(this.chart.element.id+"_BorderLine_"+t,"transparent",e.border.width,e.border.color||this.chart.themeStyle.axisLine,1,"",r));s.setAttribute("style","pointer-events: none"),be(this.chart.enableCanvas,o,s,this.chart.redraw,!0,"x","y",null,a,!0)},e.prototype.findAxisLabel=function(e,t,i){return"Trim"===e.labelIntersectAction?e.angle%360!=0||e.enableTrim?t:ze(i,t,e.labelStyle):t},e.prototype.drawXAxisTitle=function(e,r,o,n){if(e.title){var a=this.chart,s=i.measureText(e.title,e.titleStyle),l=t.isNullOrUndefined(e.crossesAt)?e.scrollBarHeight:0,h=("Inside"===e.tickPosition?0:e.majorTickLines.height+e.titlePadding)+("Inside"===e.labelPosition?0:e.maxLabelSize.height+e.multiLevelLabelHeight+e.labelPadding),c=e.titleSize.height*(e.titleCollection.length-1);h=e.opposedPosition?-(h+s.height/4+l+c):h+3*s.height/4+l;var d=new i.TextOption(a.element.id+"_AxisTitle_"+r,n.x+.5*n.width,n.y+h,"middle",e.titleCollection),p=Ve(a.renderer,d,e.titleStyle,e.titleStyle.color||a.themeStyle.axisTitle,o,null,null,null,null,null,null,null,null,a.enableCanvas);p.setAttribute("aria-label",e.description||e.title),p.setAttribute("tabindex",e.tabIndex.toString())}},e.prototype.renderGridLine=function(e,t,r,o,n,a,s,l,h){void 0===h&&(h=null);var c,d,p=this.chart;o.width>0&&e.visible&&e.internalVisibility&&r&&(c=(d=he(p.element.id+n+t+"_"+a))?d.getAttribute("d"):null,d=null,this.htmlObject=p.renderer.drawPath(new i.PathOption(p.element.id+n+t+"_"+a,"transparent",o.width,o.color||l,null,h,r)),be(p.enableCanvas,s,this.htmlObject,p.redraw,!0,"x","y",null,c,!0))},e.prototype.findParentNode=function(e,t,i){return document.getElementById(e+"AxisGroup"+i+"Inside").contains(document.getElementById(t.id))?document.getElementById(e+"AxisGroup"+i+"Inside"):document.getElementById(e+"AxisGroup"+i+"Outside")},e.prototype.createZoomingLabel=function(e,t,i,r,o){var n=this.findParentNode(e.element.id,t,r);t.setAttribute("opacity","0.3");var a=e.renderer.createGroup({id:e.element.id+"AxisLabels_Zoom"+r});a=V(e,i,a,r,"Vertical"===i.orientation,o),n.replaceChild(t,document.getElementById(t.id)),he(e.element.id+"AxisLabels_Zoom"+r)?n.replaceChild(a,document.getElementById(a.id)):n.appendChild(a)},e}(),Zi=function(){function e(e){this.currentPoints=[],this.previousPoints=[],this.insideRegion=!1,this.chart=e,this.lierIndex=0}return e.prototype.getData=function(){for(var e,t,i,r,o=this.chart,n=null,a=null,s=o.visibleSeries.length-1;s>=0;s--){if(a=o.visibleSeries[s],e="Scatter"===a.type||"Scatter"===a.drawType||a.marker.visible?(a.marker.height+5)/2:0,t="Scatter"===a.type||"Scatter"===a.drawType||a.marker.visible?(a.marker.width+5)/2:0,i=o.mouseX,r=o.mouseY,a.dragSettings.enable&&a.isRectSeries)if("Bar"===a.type&&o.isTransposed||!o.isTransposed&&"Bar"!==a.type){var l=a.marker.height/2;r=a.yAxis.isInversed?r-l:r+l}else{var h=a.marker.width/2;i=a.yAxis.isInversed?i+h:i-h}if(a.visible&&j(i,r,a.clipRect,e,t)&&(n=this.getRectPoint(a,a.clipRect,i,r)),n)return new Yi(n,a)}return new Yi(n,a)},e.prototype.isSelected=function(e){return(e.selectionMode.indexOf("Drag")>-1||e.selectionMode.indexOf("Lasso")>-1)&&e.selectionModule&&null!==e.selectionModule.rectPoints},e.prototype.getRectPoint=function(e,t,i,r){var o,n,a,s,l,h,c=0;if(this.chart.isScrolling)return null;for(var d=0,p=e.points;d<p.length;d++){var u=p[d];if(u.regionData||u.regions&&u.regions.length){if(u.regionData&&"PolarRadar"===this.chart.chartAreaType&&e.drawType.indexOf("Column")>-1&&(o=i-(e.clipRect.width/2+e.clipRect.x),n=r-(e.clipRect.height/2+e.clipRect.y),c=2*Math.PI*(u.regionData.currentXPosition<0?1+u.regionData.currentXPosition:u.regionData.currentXPosition),a=(Math.atan2(n,o)+.5*Math.PI-c)%(2*Math.PI),a=a<0?2*Math.PI+a:a,a+=2*Math.PI*e.chart.primaryXAxis.startAngle,s=u.regionData.startAngle,s-=c,s=s<0?2*Math.PI+s:s,l=u.regionData.endAngle,l-=c,l=l<0?2*Math.PI+l:l,h=Math.sqrt(Math.pow(Math.abs(o),2)+Math.pow(Math.abs(n),2)),a>=s&&a<=l&&(h>=u.regionData.innerRadius&&h<=u.regionData.radius||h<=u.regionData.innerRadius&&h>=u.regionData.radius)&&h<=e.chart.radius))return u;if((e.dragSettings.enable&&e.isRectSeries||e.isRectSeries&&e.marker.visible)&&this.isPointInThresholdRegion(i,r,u,t,e))return this.insideRegion=!0,u;if(!this.insideRegion&&this.checkRegionContainsPoint(u.regions,t,i,r))return u;if(this.insideRegion&&this.checkRegionContainsPoint(u.regions,t,i,r))return u}}return null},e.prototype.checkRegionContainsPoint=function(e,t,r,o){var n=this;return e.some(function(e,a){return n.lierIndex=a,j(r,o,new i.Rect(("Cartesian"===n.chart.chartAreaType?t.x:0)+e.x,("Cartesian"===n.chart.chartAreaType?t.y:0)+e.y,e.width,e.height))})},e.prototype.isPointInThresholdRegion=function(e,t,r,o,n){var a,s=this,l="Bar"===n.type,h=n.yAxis.isInversed,c=n.chart.isTransposed,d=0,p=0,u=a=20;return h&&c?l?(d=r.regions[0].height-10,a=r.regions[0].width):(p=-10,u=r.regions[0].height):h||r.yValue<0?l?(p=-10,u=r.regions[0].height):(d=r.regions[0].height-10,a=r.regions[0].width):c?l?(d=-10,a=r.regions[0].width):(p=r.regions[0].width-10,u=r.regions[0].height):l?(p=r.regions[0].width-10,u=r.regions[0].height):(d=-10,a=r.regions[0].width),r.regions.some(function(r){return j(e,t,new i.Rect(("Cartesian"===s.chart.chartAreaType?o.x:0)+r.x+p,("Cartesian"===s.chart.chartAreaType?o.y:0)+r.y+d,a,u))})},e.prototype.getClosest=function(e,t,i){var r,o,n=i||e.xData;if(t>=e.xMin-.5&&t<=e.xMax+.5)for(var a=0;a<n.length;a++)o=n[a],(null==r||Math.abs(o-t)<Math.abs(r-t))&&(r=o);return-1!==e.xData.indexOf(r)?r:null},e.prototype.getClosestX=function(e,t,i){var r,o=t.clipRect;r=e.requireInvertedAxis?X(e.mouseY-o.y,o.height,t.xAxis):H(e.mouseX-o.x,o.width,t.xAxis);for(var n=this.getClosest(t,r,i),a=0,s=t.points;a<s.length;a++){var l=s[a];if(n===l.xValue&&l.visible)return new Yi(l,t)}return null},e.prototype.mergeXvalues=function(e){for(var t=[],i=0;i<e.length;i++)t=t.concat(e[i].xData);return t.filter(function(e,i){return i===t.indexOf(e)})},e}(),qi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qi=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},$i=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Qi([t.Property(!1)],i.prototype,"visible",void 0),Qi([t.Property(!0)],i.prototype,"showZero",void 0),Qi([t.Property(null)],i.prototype,"name",void 0),Qi([t.Property("transparent")],i.prototype,"fill",void 0),Qi([t.Property(1)],i.prototype,"opacity",void 0),Qi([t.Property(0)],i.prototype,"angle",void 0),Qi([t.Property(!1)],i.prototype,"enableRotation",void 0),Qi([t.Property("Auto")],i.prototype,"position",void 0),Qi([t.Property(5)],i.prototype,"rx",void 0),Qi([t.Property(5)],i.prototype,"ry",void 0),Qi([t.Property("Center")],i.prototype,"alignment",void 0),Qi([t.Complex({width:null,color:null},Yt)],i.prototype,"border",void 0),Qi([t.Complex({left:5,right:5,top:5,bottom:5},Ut)],i.prototype,"margin",void 0),Qi([t.Complex({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},Xt)],i.prototype,"font",void 0),Qi([t.Property(null)],i.prototype,"template",void 0),Qi([t.Property("Hide")],i.prototype,"labelIntersectAction",void 0),i}(t.ChildProperty),Ji=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Qi([t.Property(!1)],i.prototype,"visible",void 0),Qi([t.Property("Circle")],i.prototype,"shape",void 0),Qi([t.Property("")],i.prototype,"imageUrl",void 0),Qi([t.Property(5)],i.prototype,"height",void 0),Qi([t.Property(5)],i.prototype,"width",void 0),Qi([t.Complex({width:2,color:null},Yt)],i.prototype,"border",void 0),Qi([t.Complex({x:0,y:0},Gt)],i.prototype,"offset",void 0),Qi([t.Property(null)],i.prototype,"fill",void 0),Qi([t.Property(1)],i.prototype,"opacity",void 0),Qi([t.Complex({},$i)],i.prototype,"dataLabel",void 0),i}(t.ChildProperty),Ki=function(){function e(){this.symbolLocations=null,this.regions=null,this.percentage=null,this.regionData=null,this.isSelect=!1,this.marker={visible:!1},this.isPointInRange=!0}return e}(),er=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.clipRect=new i.Rect(0,0,0,0),t}return qi(r,e),r.prototype.setDataSource=function(e,t){e&&(this.points=e.points),t.trendLineModule.initDataSource(this),t.visibleSeriesCount++},Qi([t.Property("")],r.prototype,"name",void 0),Qi([t.Property("0")],r.prototype,"dashArray",void 0),Qi([t.Property(!0)],r.prototype,"visible",void 0),Qi([t.Property("Linear")],r.prototype,"type",void 0),Qi([t.Property(2)],r.prototype,"period",void 0),Qi([t.Property(2)],r.prototype,"polynomialOrder",void 0),Qi([t.Property(0)],r.prototype,"backwardForecast",void 0),Qi([t.Property(0)],r.prototype,"forwardForecast",void 0),Qi([t.Complex({},qt)],r.prototype,"animation",void 0),Qi([t.Complex({},Ji)],r.prototype,"marker",void 0),Qi([t.Property(!0)],r.prototype,"enableTooltip",void 0),Qi([t.Property(null)],r.prototype,"intercept",void 0),Qi([t.Property("")],r.prototype,"fill",void 0),Qi([t.Property(1)],r.prototype,"width",void 0),Qi([t.Property("SeriesType")],r.prototype,"legendShape",void 0),r}(t.ChildProperty),tr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Qi([t.Property(1)],i.prototype,"width",void 0),Qi([t.Property(10)],i.prototype,"length",void 0),Qi([t.Property(null)],i.prototype,"color",void 0),Qi([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),ir=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Qi([t.Property(null)],i.prototype,"value",void 0),Qi([t.Property(null)],i.prototype,"color",void 0),Qi([t.Property("0")],i.prototype,"dashArray",void 0),i}(t.ChildProperty),rr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return qi(i,e),Qi([t.Property(!1)],i.prototype,"visible",void 0),Qi([t.Property("Fixed")],i.prototype,"type",void 0),Qi([t.Property("Both")],i.prototype,"direction",void 0),Qi([t.Property("Vertical")],i.prototype,"mode",void 0),Qi([t.Property(null)],i.prototype,"color",void 0),Qi([t.Property(1)],i.prototype,"verticalError",void 0),Qi([t.Property(1)],i.prototype,"width",void 0),Qi([t.Property(1)],i.prototype,"horizontalError",void 0),Qi([t.Property(3)],i.prototype,"verticalPositiveError",void 0),Qi([t.Property(3)],i.prototype,"verticalNegativeError",void 0),Qi([t.Property(1)],i.prototype,"horizontalPositiveError",void 0),Qi([t.Property(1)],i.prototype,"horizontalNegativeError",void 0),Qi([t.Complex(null,tr)],i.prototype,"errorBarCap",void 0),i}(t.ChildProperty),or=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.currentViewData=[],t.clipRect=new i.Rect(0,0,0,0),t.seriesType="XY",t.isRectTypeSeries=!1,t}return qi(o,e),o.prototype.processJsonData=function(){var e=0,i=new Ki,o=this instanceof nr&&"Histogram"===this.type?"x":this.xName,n=this instanceof nr&&this.marker.dataLabel.name?this.marker.dataLabel.name:"";this instanceof nr&&("Waterfall"!==this.type&&"Histogram"!==this.type||(this.currentViewData=this.chart[G(this.type)+"SeriesModule"].processInternalData(t.extend([],this.currentViewData,null,!0),this)),"Pareto"===this.category&&(this.currentViewData=p(t.extend([],this.currentViewData,null,!0),[this.yName],!0),"Line"===this.type&&(this.currentViewData=this.chart.paretoSeriesModule.performCumulativeCalculation(this.currentViewData,this))),this.isRectTypeSeries=this.type.indexOf("Column")>-1||this.type.indexOf("Bar")>-1||this.type.indexOf("Histogram")>-1);var a=Object.keys(this.currentViewData).length;if(this.points=[],this.xMin=1/0,this.xMax=-1/0,this.yMin=1/0,this.yMax=-1/0,this.sizeMax=-1/0,this.getSeriesType(),"Category"===this.xAxis.valueType)for(;e<a;)i=this.dataPoint(e,n,o),this.pushCategoryData(i,e,i.x),this.pushData(i,e),this.setEmptyPoint(i,e),e++;else if(this.xAxis.valueType.indexOf("DateTime")>-1)for(var s={skeleton:"full",type:"dateTime"},l=this.chart.intl.getDateParser(s),h=this.chart.intl.getDateFormat(s);e<a;)i=this.dataPoint(e,n,o),t.isNullOrUndefined(i.x)||""===i.x?i.visible=!1:(i.x=new Date(r.DataUtil.parse.parseJson({val:i.x}).val),"DateTime"===this.xAxis.valueType?i.xValue=Date.parse(i.x.toString()):this.chart.isBlazor?this.pushCategoryData(i,e,Date.parse(i.x.toString()).toString()):this.pushCategoryData(i,e,Date.parse(l(h(i.x))).toString()),this.pushData(i,e),this.setEmptyPoint(i,e)),e++;else for(;e<a;)(i=this.dataPoint(e,n,o)).xValue=i.x,this.pushData(i,e),this.setEmptyPoint(i,e),e++;if(this instanceof nr)if(this.type.indexOf("Spline")>-1||this.drawType.indexOf("Spline")>-1&&"PolarRadar"===this.chart.chartAreaType){var c=this.type.indexOf("Area")>-1||this.drawType.indexOf("Area")>-1,d=this.type.indexOf("Range")>-1;this.chart["spline"+(c?d?"RangeArea":"Area":"")+"SeriesModule"].findSplinePoint(this)}else this.type.indexOf("Histogram")>-1&&(this.xAxis.maximum||this.xAxis.minimum)&&this.chart.histogramSeriesModule.calculateBinValues(this)},o.prototype.pushData=function(e,t){e.index=t,e.yValue=e.y,this.xMin=Math.min(this.xMin,e.xValue),this.xMax=Math.max(this.xMax,e.xValue),this.xData.push(e.xValue)},o.prototype.dataPoint=function(e,i,r){this.points[e]=new Ki;var o=this.points[e],n=this.currentViewData,a=this.enableComplexProperty?t.getValue:this.getObjectValue;return o.x=a(r,n[e]),o.high=a(this.high,n[e]),o.low=a(this.low,n[e]),o.open=a(this.open,n[e]),o.close=a(this.close,n[e]),o.volume=a(this.volume,n[e]),o.interior=a(this.pointColorMapping,n[e]),this instanceof nr&&(o.y=a(this.yName,n[e]),o.size=a(this.size,n[e]),o.text=a(i,n[e]),o.tooltip=a(this.tooltipMappingName,n[e]),this.chart.rangeColorSettings&&this.chart.rangeColorSettings.length>0&&this.isAdvancedColorSupported()&&(this.colorName&&this.colorName.length>0?o.colorValue=a(this.colorName,n[e]):o.colorValue=a(this.yName,n[e]),o.interior=this.getPointFillColor(o.interior,o.colorValue))),o},o.prototype.isAdvancedColorSupported=function(){return 1===this.chart.visibleSeries.length&&("Column"===this.chart.series[0].type||"Bar"===this.chart.series[0].type||"Scatter"===this.chart.series[0].type||"Bubble"===this.chart.series[0].type)},o.prototype.getPointFillColor=function(e,t){var i=e;if(t&&this.chart.rangeColorSettings&&this.chart.rangeColorSettings.length>0)for(var r=0,o=this.chart.rangeColorSettings;r<o.length;r++){var n=o[r];t>=n.start&&t<=n.end&&(i=n.colors.length>1?Ze(n,t):n.colors[0])}return i},o.prototype.getObjectValue=function(e,t){return t[e]},o.prototype.setEmptyPoint=function(e,i){if(!this.findVisibility(e))return e.visible=!0,null;switch(e.isEmpty=!0,this instanceof nr&&e.isPointInRange?this.emptyPointSettings.mode:"Drop"){case"Zero":e.visible=!0,this instanceof nr&&this.seriesType.indexOf("HighLow")>-1?(e.high=e.low=0,this.seriesType.indexOf("HighLowOpenClose")>-1&&(e.open=e.close=0)):e.y=e.yValue=this.yData[i]=0;break;case"Average":this instanceof nr&&(this.seriesType.indexOf("HighLow")>-1?(e.high=t.isNullOrUndefined(e.high)||isNaN(+e.high)?this.getAverage(this.high,i):e.high,e.low=t.isNullOrUndefined(e.low)||isNaN(+e.low)?this.getAverage(this.low,i):e.low,this.seriesType.indexOf("HighLowOpenClose")>-1&&(e.open=t.isNullOrUndefined(e.open)||isNaN(+e.open)?this.getAverage(this.open,i):e.open,e.close=t.isNullOrUndefined(e.close)||isNaN(+e.close)?this.getAverage(this.close,i):e.close)):e.y=e.yValue=this.yData[i]=this.getAverage(this.yName,i)),e.visible=!0;break;case"Drop":case"Gap":this.yData[i]=null,e.visible=!1}},o.prototype.findVisibility=function(e){var i,r=this instanceof nr?this.seriesType:"HighLowOpenClose",o=this.yAxis.minimum,n=this.yAxis.maximum;switch(r){case"XY":return"PolarRadar"===this.chart.chartAreaType&&(!t.isNullOrUndefined(o)&&e.yValue<o||!t.isNullOrUndefined(n)&&e.yValue>n)?(e.isPointInRange=!1,!0):(this.setXYMinMax(e.yValue),this.yData.push(e.yValue),this instanceof nr&&"Bubble"===this.type&&(this.sizeMax=Math.max(this.sizeMax,t.isNullOrUndefined(e.size)||isNaN(+e.size)?this.sizeMax:e.size)),t.isNullOrUndefined(e.x)||t.isNullOrUndefined(e.y)||isNaN(+e.y));case"HighLow":return this.setHiloMinMax(e.high,e.low),t.isNullOrUndefined(e.x)||t.isNullOrUndefined(e.low)||isNaN(+e.low)||t.isNullOrUndefined(e.high)||isNaN(+e.high);case"HighLowOpenClose":return this.setHiloMinMax(e.high,e.low),t.isNullOrUndefined(e.x)||t.isNullOrUndefined(e.low)||isNaN(+e.low)||t.isNullOrUndefined(e.open)||isNaN(+e.open)||t.isNullOrUndefined(e.close)||isNaN(+e.close)||t.isNullOrUndefined(e.high)||isNaN(+e.high);case"BoxPlot":return i=(e.y||[null]).filter(function(e){return!t.isNullOrUndefined(e)&&!isNaN(e)}).sort(function(e,t){return e-t}),e.y=i,this.yMin=Math.min(this.yMin,Math.min.apply(Math,i)),this.yMax=Math.max(this.yMax,Math.max.apply(Math,i)),!i.length}},o.prototype.setXYMinMax=function(e){var i,r="Logarithmic"===this.yAxis.valueType||"Logarithmic"===this.xAxis.valueType,o=e<0;i=this.isRectTypeSeries&&!te(this.yAxis)?r?e:o?e:0:e,this.yMin=r?Math.min(this.yMin,t.isNullOrUndefined(i)||isNaN(i)||0===i?this.yMin:i):Math.min(this.yMin,t.isNullOrUndefined(i)||isNaN(i)?this.yMin:i),this.yMax=Math.max(this.yMax,t.isNullOrUndefined(e)||isNaN(e)?this.yMax:e)},o.prototype.setHiloMinMax=function(e,i){this.yMin=Math.min(this.yMin,Math.min(t.isNullOrUndefined(i)||isNaN(i)?this.yMin:i,t.isNullOrUndefined(e)||isNaN(e)?this.yMin:e)),this.yMax=Math.max(this.yMax,Math.max(t.isNullOrUndefined(i)||isNaN(i)?this.yMax:i,t.isNullOrUndefined(e)||isNaN(e)?this.yMax:e))},o.prototype.getSeriesType=function(){var e;if(this instanceof nr){var t="PolarRadar"===this.chart.chartAreaType?this.drawType:this.type;if(t)switch(t){case"RangeColumn":case"RangeArea":case"SplineRangeArea":case"Hilo":e="HighLow";break;case"HiloOpenClose":case"Candle":e="HighLowOpenClose";break;case"BoxAndWhisker":e="BoxPlot";break;default:e="XY"}}this.seriesType=e},o.prototype.pushCategoryData=function(e,t,i){if(!this.chart.tooltip.shared&&!this.visible)return null;this.xAxis.isIndexed?(this.xAxis.labels[t]?this.xAxis.labels[t]+=", "+i:this.xAxis.labels.push(i),e.xValue=t):(this.xAxis.labels.indexOf(i)<0&&this.xAxis.labels.push(i),e.xValue=this.xAxis.labels.indexOf(i))},o.prototype.getAverage=function(e,t,i){return void 0===i&&(i=this.currentViewData),((i[t-1]?i[t-1][e]||0:0)+(i[t+1]?i[t+1][e]||0:0))/2},o.prototype.refreshDataManager=function(e){var i=this;this.chart=e;var o;if(!((o=e.isAngular?Object.keys(this.dataSource).length?this.dataSource:e.dataSource:this.dataSource||e.dataSource)instanceof r.DataManager)&&t.isNullOrUndefined(this.query))return void this.dataManagerSuccess({result:o,count:o.length},!1);this.dataModule.getData(this.dataModule.generateQuery().requiresCount()).then(function(e){return i.dataManagerSuccess(e)})},o.prototype.dataManagerSuccess=function(e,t){if(void 0===t&&(t=!0),this.currentViewData=e.count?e.result:[],this.chart.allowServerDataBinding=!1,this instanceof nr){this.chart.stockChart&&(this.chart.stockChart.series[this.index].localData=this.currentViewData);var i={name:"seriesRender",series:this,data:this.currentViewData,fill:this.interior};this.chart.trigger("seriesRender",i),this.interior=i.fill,this.currentViewData=i.data}!this.chart.stockChart||this instanceof nr||(this.currentViewData=this.chart.stockChart.findCurrentData(this.chart.stockChart.series[0].localData,this.chart.stockChart.series[0].xName)),this.processJsonData(),this.recordsCount=e.count,this.refreshChart(t),this.currentViewData=null},o.prototype.refreshChart=function(e){var t=this.chart;if(this instanceof nr&&(t.visibleSeriesCount+=e?1:0),t.refreshTechnicalIndicator(this),this instanceof nr&&"TrendLine"!==this.category)for(var i=0,r=this.trendlines;i<r.length;i++)r[i].setDataSource(this,t);t.visibleSeries.length===t.visibleSeriesCount&&(t.refreshBound(),t.trigger("loaded",{chart:t.isBlazor?{}:t}),this.chart.stockChart&&this.chart.stockChart.initialRender&&(this.chart.stockChart.initialRender=!1,this.chart.stockChart.stockChartDataManagerSuccess())),this instanceof nr&&(t.visibleSeriesCount+=e?0:1)},Qi([t.Property("")],o.prototype,"xName",void 0),Qi([t.Property("")],o.prototype,"colorName",void 0),Qi([t.Property("")],o.prototype,"high",void 0),Qi([t.Property("")],o.prototype,"low",void 0),Qi([t.Property("")],o.prototype,"open",void 0),Qi([t.Property("")],o.prototype,"close",void 0),Qi([t.Property("")],o.prototype,"volume",void 0),Qi([t.Property("")],o.prototype,"pointColorMapping",void 0),Qi([t.Property(!0)],o.prototype,"visible",void 0),Qi([t.Property(null)],o.prototype,"xAxisName",void 0),Qi([t.Property(null)],o.prototype,"yAxisName",void 0),Qi([t.Complex(null,qt)],o.prototype,"animation",void 0),Qi([t.Property(null)],o.prototype,"fill",void 0),Qi([t.Property(1)],o.prototype,"width",void 0),Qi([t.Property("0")],o.prototype,"dashArray",void 0),Qi([t.Property("")],o.prototype,"dataSource",void 0),Qi([t.Property()],o.prototype,"query",void 0),Qi([t.Collection([],ir)],o.prototype,"segments",void 0),Qi([t.Property("X")],o.prototype,"segmentAxis",void 0),Qi([t.Property(!1)],o.prototype,"enableComplexProperty",void 0),o}(t.ChildProperty),nr=function(e){function i(t,i,r,o){var n=e.call(this,t,i,r,o)||this;return n.visibleSeriesCount=0,n.category="Series",n.isRectSeries=!1,n.drawPoints=[],n.lowDrawPoints=[],n.delayedAnimation=!1,n}return qi(i,e),i.prototype.refreshAxisLabel=function(){if("Category"!==this.xAxis.valueType)return null;this.xAxis.labels=[];for(var e=0,t=this.xAxis.series;e<t.length;e++){var i=t[e];if(i.visible&&"TrendLine"!==i.category){i.xMin=1/0,i.xMax=-1/0;for(var r=0,o=i.points;r<o.length;r++){var n=o[r];i.pushCategoryData(n,n.index,n.x),i.xMin=Math.min(i.xMin,n.xValue),i.xMax=Math.max(i.xMax,n.xValue)}}}},i.prototype.findSeriesCollection=function(e,t,i){for(var r=[],o=0,n=t.axes;o<n.length;o++)for(var a=0,s=n[o].series;a<s.length;a++)for(var l=s[a],h=0,c=e.axes;h<c.length;h++)for(var d=0,p=c[h].series;d<p.length;d++){var u=p[d];u===l&&u.visible&&this.rectSeriesInChart(u,i)&&r.push(u)}return r},i.prototype.rectSeriesInChart=function(e,t){var i=e.type.toLowerCase();return-1!==i.indexOf("column")||-1!==i.indexOf("bar")||-1!==i.indexOf("histogram")||-1!==i.indexOf("hiloopenclose")||-1!==i.indexOf("candle")||-1!==i.indexOf("pareto")||-1!==i.indexOf("hilo")||-1!==e.drawType.indexOf("Column")||-1!==i.indexOf("waterfall")||-1!==i.indexOf("boxandwhisker")||t},i.prototype.calculateStackedValue=function(e,t){for(var i=0,r=t.columns;i<r.length;i++)for(var o=r[i],n=0,a=t.rows;n<a.length;n++){var s=a[n];this.calculateStackingValues(this.findSeriesCollection(o,s,!0),e)}},i.prototype.calculateStackingValues=function(e,t){var i,r,o,n,a,s=[],l=[],h=[],c=[];t&&(c=this.findFrequencies(e));for(var d=[],p=[],u=[],y=0,m=e;y<m.length;y++){var v=m[y];if(-1!==v.type.indexOf("Stacking")||-1!==v.drawType.indexOf("Stacking")&&"PolarRadar"===v.chart.chartAreaType){l[o=-1!==v.type.indexOf("StackingArea")?"StackingArea100":-1!==v.type.indexOf("StackingLine")?"StackingLine100":v.stackingGroup]||(l[o]=[],h[o]=[]),s=v.yData,i=[],r=[],d.push(v);for(var f=0,b=(u=g(v)).length;f<b;f++)n=0,a=+s[f],void 0===l[o][u[f].xValue]&&(l[o][u[f].xValue]=0),void 0===h[o][u[f].xValue]&&(h[o][u[f].xValue]=0),t?(a=a/c[o][u[f].xValue]*100,a=isNaN(a)?0:a,u[f].percentage=+a.toFixed(2)):p[f]=p[f]?p[f]+Math.abs(a):Math.abs(a),a>=0?(n=l[o][u[f].xValue],l[o][u[f].xValue]+=a):(n=h[o][u[f].xValue],h[o][u[f].xValue]+=a),i.push(n),r.push(a+n),t&&r[f]>100&&(r[f]=100);v.stackedValues=new zi(i,r);var x="Logarithmic"===v.yAxis.valueType,w=-1!==v.type.indexOf("Column")||-1!==v.type.indexOf("Bar");v.yMin=x&&w&&v.yMin<1?v.yMin:Math.min.apply(0,i),v.yMax=Math.max.apply(0,r),v.yMin>Math.min.apply(0,r)&&(v.yMin=t?-100:x&&w&&v.yMin<1?v.yMin:Math.min.apply(0,r)),v.yMax<Math.max.apply(0,i)&&(v.yMax=0)}}this.findPercentageOfStacking(d,p,t)},i.prototype.findPercentageOfStacking=function(e,t,i){for(var r=0,o=e;r<o.length;r++){var n=o[r];if(i)return null;for(var a=0,s=g(n);a<s.length;a++){var l=s[a];l.percentage=Math.abs(+(l.y/t[l.index]*100).toFixed(2))}}},i.prototype.findFrequencies=function(e){for(var t,i=[],r=[],o=0,n=e;o<n.length;o++){var a=n[o];if(a.yAxis.isStack100=-1!==a.type.indexOf("100"),r=g(a),-1!==a.type.indexOf("Stacking")){i[t=-1!==a.type.indexOf("StackingArea")?"StackingArea100":-1!==a.type.indexOf("StackingLine")?"StackingLine100":a.stackingGroup]||(i[t]=[]);for(var s=0,l=r.length;s<l;s++)void 0===i[t][r[s].xValue]&&(i[t][r[s].xValue]=0),a.yData[s]>0?i[t][r[s].xValue]+=a.yData[s]:i[t][r[s].xValue]-=a.yData[s]}}return i},i.prototype.renderSeries=function(e){var t=G(this.type);e[(t=t.replace("100",""))+"SeriesModule"]&&("Indicator"!==this.category&&"TrendLine"!==this.category&&this.createSeriesElements(e),this.visiblePoints=g(this),e[t+"SeriesModule"].render(this,this.xAxis,this.yAxis,e.requireInvertedAxis),"Indicator"!==this.category&&(this.errorBar.visible&&this.chart.errorBarModule.render(this),this.marker.dataLabel.visible&&e.dataLabelModule.render(this,this.chart,this.marker.dataLabel),this.appendSeriesElement(e.seriesElements,e)),this.chart.enableCanvas||this.performAnimation(e,t,this.errorBar,this.marker,this.marker.dataLabel))},i.prototype.createSeriesElements=function(e){if("Indicator"!==this.category){var t=e.element.id,i=this.marker.border.width+8+5,r="Scatter"===this.type||"Bubble"===this.type?e.svgRenderer:e.renderer,o=void 0===this.index?this.category:this.index,n=void 0,a=void 0,s=void 0;if("Scatter"===this.type?(n=e.primaryYAxis.maximum||e.primaryXAxis.maximum?0:(this.marker.height+i)/2,a=e.primaryYAxis.maximum||e.primaryXAxis.maximum?0:(this.marker.width+i)/2):(n=0,a=0),"PolarRadar"===e.chartAreaType){var l="Scatter"===this.drawType?Math.max(this.marker.width,this.marker.height):0;s=new Fi(t+"_ChartSeriesClipRect_"+o,"transparent",{width:1,color:"Gray"},1,this.clipRect.width/2+this.clipRect.x,this.clipRect.height/2+this.clipRect.y,e.radius+l),this.clipRectElement=K(e.redraw,s,r,"drawCircularClipPath")}else s=new Di(t+"_ChartSeriesClipRect_"+o,"transparent",{width:1,color:"Gray"},1,{x:-a,y:-n,width:this.clipRect.width+2*a,height:this.clipRect.height+2*n}),this.clipRectElement=K(e.redraw,s,r);var h="Cartesian"===e.chartAreaType?"translate("+this.clipRect.x+","+this.clipRect.y+")":"";this.symbolElement=null,this.seriesElement=r.createGroup({id:t+"SeriesGroup"+o,transform:h,"clip-path":"url(#"+t+"_ChartSeriesClipRect_"+o+")"}),this.chart.enableCanvas&&"Scatter"!==this.type&&"Bubble"!==this.type||this.seriesElement.appendChild(this.clipRectElement)}},i.prototype.appendSeriesElement=function(e,t){var i=this.marker,r=i.dataLabel,o=t.redraw;"TrendLine"!==this.category&&(be(t.enableCanvas,t.seriesElements,this.seriesElement,o),this.errorBar.visible&&("PolarRadar"===t.chartAreaType?be(t.enableCanvas,t.seriesElements,this.seriesElement,o):be(t.enableCanvas,t.seriesElements,this.errorBarElement,o)),"Scatter"!==this.type&&"Bubble"!==this.type||be(!1,t.seriesElements,this.seriesElement,o)),i.visible&&("Cartesian"===t.chartAreaType||"Scatter"!==this.drawType&&"PolarRadar"===t.chartAreaType)&&"Scatter"!==this.type&&"Bubble"!==this.type&&"Candle"!==this.type&&"Hilo"!==this.type&&"HiloOpenClose"!==this.type&&this.symbolElement&&be(t.enableCanvas,t.seriesElements,this.symbolElement,o),r.visible&&this.textElement&&(be(t.enableCanvas,t.dataLabelElements,this.shapeElement,o),be(t.enableCanvas,t.dataLabelElements,this.textElement,o)),!t.enableCanvas&&t.dataLabelElements.hasChildNodes()&&t.seriesElements.appendChild(t.dataLabelElements)},i.prototype.performAnimation=function(e,i,r,o,n){this.animation.enable&&e.animateSeries&&(e[i+"SeriesModule"].doAnimation(this),r.visible&&e.errorBarModule.doErrorBarAnimation(this),o.visible&&e.markerRender.doMarkerAnimation(this),n.visible&&"edge"!==t.Browser.info.name&&!t.Browser.isIE&&e.dataLabelModule.doDataLabelAnimation(this))},i.prototype.setPointColor=function(e,t){return t=e.interior||t,e.isEmpty?this.emptyPointSettings.fill||t:t},i.prototype.setBorderColor=function(e,t){return t.width=e.isEmpty?this.emptyPointSettings.border.width||t.width:t.width,t.color=e.isEmpty?this.emptyPointSettings.border.color||t.color:t.color,t},Qi([t.Property("")],i.prototype,"name",void 0),Qi([t.Property("")],i.prototype,"yName",void 0),Qi([t.Property("Line")],i.prototype,"drawType",void 0),Qi([t.Property(!0)],i.prototype,"isClosed",void 0),Qi([t.Property("#2ecd71")],i.prototype,"bearFillColor",void 0),Qi([t.Property("#e74c3d")],i.prototype,"bullFillColor",void 0),Qi([t.Property(!1)],i.prototype,"enableSolidCandles",void 0),Qi([t.Property("")],i.prototype,"size",void 0),Qi([t.Property(null)],i.prototype,"binInterval",void 0),Qi([t.Property(!1)],i.prototype,"showNormalDistribution",void 0),Qi([t.Property("")],i.prototype,"stackingGroup",void 0),Qi([t.Complex({color:"transparent",width:0},Yt)],i.prototype,"border",void 0),Qi([t.Property(1)],i.prototype,"opacity",void 0),Qi([t.Property(0)],i.prototype,"zOrder",void 0),Qi([t.Property("Line")],i.prototype,"type",void 0),Qi([t.Complex(null,rr)],i.prototype,"errorBar",void 0),Qi([t.Complex(null,Ji)],i.prototype,"marker",void 0),Qi([t.Complex({},ei)],i.prototype,"dragSettings",void 0),Qi([t.Collection([],er)],i.prototype,"trendlines",void 0),Qi([t.Property(!0)],i.prototype,"enableTooltip",void 0),Qi([t.Property("")],i.prototype,"tooltipFormat",void 0),Qi([t.Property("")],i.prototype,"tooltipMappingName",void 0),Qi([t.Property("SeriesType")],i.prototype,"legendShape",void 0),Qi([t.Property("")],i.prototype,"legendImageUrl",void 0),Qi([t.Property(null)],i.prototype,"selectionStyle",void 0),Qi([t.Property(null)],i.prototype,"unSelectedStyle",void 0),Qi([t.Property(null)],i.prototype,"nonHighlightStyle",void 0),Qi([t.Property(1)],i.prototype,"minRadius",void 0),Qi([t.Property(3)],i.prototype,"maxRadius",void 0),Qi([t.Property("Natural")],i.prototype,"splineType",void 0),Qi([t.Property(.5)],i.prototype,"cardinalSplineTension",void 0),Qi([t.Complex(null,Kt)],i.prototype,"emptyPointSettings",void 0),Qi([t.Property(!0)],i.prototype,"showMean",void 0),Qi([t.Property("Normal")],i.prototype,"boxPlotMode",void 0),Qi([t.Property(null)],i.prototype,"columnWidth",void 0),Qi([t.Property(0)],i.prototype,"columnSpacing",void 0),Qi([t.Property("#C64E4A")],i.prototype,"negativeFillColor",void 0),Qi([t.Property("#4E81BC")],i.prototype,"summaryFillColor",void 0),Qi([t.Property()],i.prototype,"intermediateSumIndexes",void 0),Qi([t.Property()],i.prototype,"sumIndexes",void 0),Qi([t.Complex({color:"black",width:2},Ht)],i.prototype,"connector",void 0),Qi([t.Complex(null,$t)],i.prototype,"cornerRadius",void 0),i}(or),ar=function(){function e(e,t){this.initDataManager(e,t)}return e.prototype.initDataManager=function(e,t){this.dataManager=e instanceof r.DataManager?e:new r.DataManager(e),this.query=t instanceof r.Query?t:new r.Query},e.prototype.generateQuery=function(){return this.query.clone()},e.prototype.getData=function(e){var t=this;if(this.dataManager.ready){var i=new r.Deferred;return this.dataManager.ready.then(function(){t.dataManager.executeQuery(e).then(function(e){i.resolve(e)})}).catch(function(e){i.reject(e)}),i.promise}return this.dataManager.executeQuery(e)},e}(),sr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lr=function(e){function r(t){var i=e.call(this,t)||this;return i.elementId=t.element.id,i}return sr(r,e),r.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},r.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(t.Browser.touchMoveEvent,this.mouseMoveHandler),this.chart.off(t.Browser.touchEndEvent,this.mouseUpHandler))},r.prototype.mouseUpHandler=function(){var e=this.chart;!e.isTouch||e.crosshair.enable||this.isSelected(e)||this.markerMove(!0)},r.prototype.mouseMoveHandler=function(){var e=this.chart;e.crosshair.enable&&!e.tooltip.enable||e.isTouch&&!e.startMove||this.isSelected(e)||this.markerMove(!1)},r.prototype.markerMove=function(e){var i=this,r=this.chart;this.currentPoints=[];var o,n,a,s;if(r.tooltip.shared&&r.tooltip.enable){if(!j(r.mouseX,r.mouseY,r.chartAxisLayoutPanel.seriesClipRect))return null;if(r.tooltip.enable)for(var l="PolarRadar"===r.chartAreaType?this.getData():null,h=this.mergeXvalues(this.chart.visibleSeries),c=0,d=r.visibleSeries;c<d.length;c++){var p=d[c];p.enableTooltip&&"Indicator"!==p.category&&("Cartesian"===r.chartAreaType&&p.visible?o=this.getClosestX(r,p,h):"PolarRadar"===r.chartAreaType&&p.visible&&null!==l.point&&(o=new Yi(p.points[l.point.index],p)),o&&(this.currentPoints.push(o),o=null))}}else o=this.getData(),s=o.series,n=this.previousPoints[0],a=s&&("Bubble"===s.type||"Scatter"===s.drawType||"Scatter"===s.type||"Candle"!==s.type&&"Hilo"!==s.type&&"HiloOpenClose"!==s.type&&s.marker.visible&&0!==s.marker.width&&0!==s.marker.height),o.lierIndex=this.lierIndex,o.point&&a&&(!n||n.point!==o.point||n&&n.lierIndex>3&&n.lierIndex!==this.lierIndex)&&this.currentPoints.push(o),o.point&&a&&r.isPointMouseDown&&this.currentPoints.push(o);var u=this.previousPoints.length;if(this.currentPoints.length>0&&(0===u||r.isPointMouseDown||u>0&&this.previousPoints[0].point!==this.currentPoints[0].point)){this.previousPoints.length>0&&this.removeHighlightedMarker();for(var g=this,y=0,m=this.currentPoints;y<m.length;y++)!function(e){(e&&e.point||"Candle"!==s.type&&"Hilo"!==s.type&&"HiloOpenClose"!==s.type)&&(Ce(g.markerExplode),g.isRemove=!0,e.point.symbolLocations.map(function(t,r){e.series.isRectSeries&&!e.point.marker.visible||i.drawTrackBall(e.series,e.point,t,r)}))}(m[y]);this.previousPoints=t.extend([],this.currentPoints,null,!0)}r.tooltip.enable||!(0===this.currentPoints.length&&this.isRemove||e&&this.isRemove)&&j(r.mouseX,r.mouseY,r.chartAxisLayoutPanel.seriesClipRect)||(this.isRemove=!1,this.markerExplode=+setTimeout(function(){i.removeHighlightedMarker()},2e3)),this.currentPoints=[]},r.prototype.drawTrackBall=function(e,r,o,n){var a=r.marker,s=e.marker,l=a.shape||s.shape;if("None"===l)return null;var h,c=e.symbolElement||e.seriesElement;this.chart.highlightModule&&"None"!==this.chart.highlightMode&&(h=this.chart.highlightModule.generateStyle(e)),this.chart.selectionModule&&"None"!==this.chart.selectionMode&&(h=this.chart.selectionModule.generateStyle(e));for(var d=this.elementId+"_Series_"+e.index+"_Point_"+r.index+"_Trackball"+(n||""),p=new i.Size((a.width||s.width)+5,(a.height||s.height)+5),u=a.border||e.border,g="BoxAndWhisker"===e.type||"Bubble"===e.type||"Scatter"===e.type,y=u.color&&"transparent"!==u.color?u.color:a.fill||r.interior||(g?r.color:e.interior),m=Te(_e(y)),v=a.border?a.border.width:s.border.width,f=e.chart.themeStyle.markerShadow||"rgba("+m.r+","+m.g+","+m.b+",0.2)",b=0;b<2;b++){var x=new i.PathOption(d+"_"+b,b?a.fill||r.color||(g?e.interior:"#ffffff"):"transparent",v+(b?0:8),b?y:f,a.opacity||s.opacity,null,null),w=ne(o,l,p,a.imageUrl,x,"",this.chart.svgRenderer,e.clipRect);w.setAttribute("class","EJ2-Trackball");var S=-1!==c.id.indexOf("Symbol")?"_Symbol":"",C=document.getElementById(this.elementId+"_Series_"+e.index+"_Point_"+r.index+S);""===h||t.isNullOrUndefined(h)||t.isNullOrUndefined(C)||!C.hasAttribute("class")||h!==C.getAttribute("class")||w.classList.add(h),w.setAttribute("clip-path",c.getAttribute("clip-path")),w.setAttribute("transform",c.getAttribute("transform")),this.chart.svgObject.appendChild(w)}},r.prototype.removeHighlightedMarker=function(){for(var e=document.getElementsByClassName("EJ2-Trackball"),i=0,r=e.length;i<r;i++)t.remove(e[0]);this.previousPoints=[]},r}(Zi),hr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cr=function(e){function r(t){var i=e.call(this,t)||this;return i.addEventListener(),i}return hr(r,e),r.prototype.render=function(e){var t=this,i=e.chart.redraw;this.createElement(e,i);for(var r=0,o=e.points;r<o.length;r++)!function(r){r.visible&&r.symbolLocations&&r.symbolLocations.length&&r.symbolLocations.map(function(o,n){"None"!==e.marker.shape&&t.renderMarker(e,r,o,n,i)})}(o[r])},r.prototype.renderMarker=function(e,r,o,n,a){var s,l,h,c,d=void 0===e.index?e.category:e.index,p=e.marker,u={color:p.border.color,width:p.border.width},g=p.border.color;o.x=o.x+p.offset.x,o.y=o.y-p.offset.y;var y,m="BoxAndWhisker"===e.type,v=p.fill||(m?r.interior||e.interior:"#ffffff"),f=m?me(e.seriesElement.childNodes,"Series_"+e.index+"_Point_"+r.index):e.symbolElement;u.color=g||e.setPointColor(r,e.interior);var b=this.elementId+"_Series_"+d+"_Point_"+r.index+"_Symbol"+(n||""),x={cancel:!1,name:"pointRender",series:e,point:r,fill:r.isEmpty?e.emptyPointSettings.fill||v:v,border:{color:"BoxAndWhisker"===e.type?t.isNullOrUndefined(g)||"transparent"===g?Oe(v,-.6):g:u.color,width:u.width},height:p.height,width:p.width,shape:p.shape};if(x.border=e.setBorderColor(r,{width:x.border.width,color:x.border.color}),e.isRectSeries&&"BoxAndWhisker"!==e.type||(this.chart.trigger("pointRender",x),r.color=x.fill),r.color=x.fill,x.cancel)o=null,r.marker={visible:!1};else{var w=void 0;w="RangeArea"===e.type||"RangeColumn"===e.type||"RangeColumn"===e.drawType||"SplineRangeArea"===e.type?n?r.low:r.high:m?r.outliers[n]:r.y;var S=x.point.marker.fill||x.fill,C=void 0;C=t.isNullOrUndefined(x.point.marker.border)?{color:x.border.color,width:x.border.width}:{color:x.point.marker.border.color||x.border.color,width:x.point.marker.border.width||x.border.width};var P=x.point.marker.width||x.width,L=x.point.marker.height||x.height,R=x.point.marker.opacity||p.opacity,M=x.point.marker.shape||x.shape,A=x.point.marker.imageUrl||p.imageUrl;c=new i.PathOption(b,S,C.width,C.color,R,null),(void 0!==f&&null!==f||this.chart.enableCanvas)&&(a&&he(c.id)&&(y=he(c.id),h="Circle"===M?"c":"",s={x:+y.getAttribute(h+"x"),y:+y.getAttribute(h+"y")},l=y.getAttribute("d")),y=ne(o,M,new i.Size(P,L),A,c,r.x.toString()+":"+w.toString(),this.chart.renderer,e.clipRect),be(this.chart.enableCanvas,f,y,a,!0,h+"x",h+"y",s,l,!1,!1,null,e.chart.duration)),r.marker={border:C,fill:S,height:L,visible:!0,shape:M,width:P,imageUrl:A}}},r.prototype.createElement=function(e,t){var i,r,o=e.marker,n=o.border.width+8+5,a=e.chart.svgRenderer,s=void 0===e.index?e.category:e.index,l="Cartesian"===e.chart.chartAreaType?"translate("+e.clipRect.x+","+e.clipRect.y+")":"";if(o.visible){var h=(o.height+n)/2,c=(o.width+n)/2;i="Cartesian"===e.chart.chartAreaType?K(t,r=new Di(this.elementId+"_ChartMarkerClipRect_"+s,"transparent",{width:1,color:"Gray"},1,{x:-c,y:-h,width:e.clipRect.width+2*c,height:e.clipRect.height+2*h}),a):K(t,r=new Fi(this.elementId+"_ChartMarkerClipRect_"+s,"transparent",{width:1,color:"Gray"},1,e.clipRect.width/2+e.clipRect.x,e.clipRect.height/2+e.clipRect.y,e.chart.radius+Math.max(h,c)),a,"drawCircularClipPath"),r={id:this.elementId+"SymbolGroup"+s,transform:l,"clip-path":"url(#"+this.elementId+"_ChartMarkerClipRect_"+s+")"},e.symbolElement=a.createGroup(r),e.symbolElement.appendChild(i),this.chart.enableCanvas&&document.getElementById(this.chart.element.id+"_tooltip_svg").appendChild(e.symbolElement)}},r.prototype.getRangeLowPoint=function(e,t){var i=e.x,r=e.y;return t.chart.requireInvertedAxis?(r+=e.height/2,i+=t.yAxis.isInversed?e.width:0):(r+=t.yAxis.isInversed?0:e.height,i+=e.width/2),{x:i,y:r}},r.prototype.doMarkerAnimation=function(e){if("Scatter"!==e.type&&"Bubble"!==e.type&&"Candle"!==e.type&&"Hilo"!==e.type&&"HiloOpenClose"!==e.type&&("PolarRadar"!==e.chart.chartAreaType||"Scatter"!==e.drawType))for(var t=e.symbolElement.childNodes,i=e.animation.delay+e.animation.duration,r=e.chart.animated?e.chart.duration:200,o=1,n="RangeArea"===e.type||"RangeColumn"===e.type||"SplineRangeArea"===e.type?2:1,a=0;a<e.points.length;a++)if(e.points[a].symbolLocations){if(!e.points[a].symbolLocations.length||!t[o])continue;if(Q(t[o],i,r,e,a,e.points[a].symbolLocations[0],!1),2===n){var s=this.getRangeLowPoint(e.points[a].regions[0],e);Q(t[o+1],i,r,e,a,s,!1)}o+=n}},r}(lr),dr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pr=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ur=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return dr(i,e),pr([t.Property(0)],i.prototype,"x",void 0),pr([t.Property(0)],i.prototype,"y",void 0),i}(t.ChildProperty),gr=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return dr(r,i),pr([t.Property(!0)],r.prototype,"visible",void 0),pr([t.Property(null)],r.prototype,"height",void 0),pr([t.Property(null)],r.prototype,"width",void 0),pr([t.Complex({x:0,y:0},ur)],r.prototype,"location",void 0),pr([t.Property("Auto")],r.prototype,"position",void 0),pr([t.Property("Series")],r.prototype,"mode",void 0),pr([t.Property(8)],r.prototype,"padding",void 0),pr([t.Property("Center")],r.prototype,"alignment",void 0),pr([t.Complex(e.Theme.legendLabelFont,Xt)],r.prototype,"textStyle",void 0),pr([t.Property(10)],r.prototype,"shapeHeight",void 0),pr([t.Property(10)],r.prototype,"shapeWidth",void 0),pr([t.Complex({},Yt)],r.prototype,"border",void 0),pr([t.Complex({left:0,right:0,top:0,bottom:0},Ut)],r.prototype,"margin",void 0),pr([t.Complex({left:0,right:0,top:0,bottom:0},Zt)],r.prototype,"containerPadding",void 0),pr([t.Property(5)],r.prototype,"shapePadding",void 0),pr([t.Property("transparent")],r.prototype,"background",void 0),pr([t.Property(1)],r.prototype,"opacity",void 0),pr([t.Property(!0)],r.prototype,"toggleVisibility",void 0),pr([t.Property(null)],r.prototype,"description",void 0),pr([t.Property(3)],r.prototype,"tabIndex",void 0),pr([t.Property(null)],r.prototype,"title",void 0),pr([t.Complex(e.Theme.legendTitleFont,Xt)],r.prototype,"titleStyle",void 0),pr([t.Property("Top")],r.prototype,"titlePosition",void 0),pr([t.Property(100)],r.prototype,"maximumTitleWidth",void 0),pr([t.Property(!0)],r.prototype,"enablePages",void 0),pr([t.Property(!1)],r.prototype,"isInversed",void 0),r}(t.ChildProperty),yr=function(){function e(e){this.pageXCollections=[],this.legendTitleCollections=[],this.legendRegions=[],this.pagingRegions=[],this.chart=e,this.legend=e.legendSettings,this.legendID=e.element.id+"_chart_legend",this.isChartControl="chart"===e.getModuleName(),this.isBulletChartControl="bulletChart"===e.getModuleName(),this.isStockChartControl="stockChart"===e.getModuleName(),this.bulletChart=this.chart,this.fivePixel=5,this.rowCount=0,this.pageButtonSize=8,this.maxColumns=0,this.maxWidth=0,this.currentPage=1,this.backwardArrowOpacity=0,this.forwardArrowOpacity=1,this.arrowWidth=2*(this.fivePixel+this.pageButtonSize+this.fivePixel),this.arrowHeight=this.arrowWidth,this.isTop=!1,this.isTitle=!1,this.currentPageNumber=1}return e.prototype.calculateLegendBounds=function(e,t,r){var o=this.legend,n=this.isBulletChartControl?"40%":"20%";this.getPosition(o.position,t),this.legendBounds=new i.Rect(e.x,e.y,0,0),this.isVertical="Left"===this.position||"Right"===this.position,this.isVertical?(this.legendBounds.height=Be(o.height,t.height-(e.y-this.chart.margin.top))||e.height,this.legendBounds.width=Be(o.width||n,t.width)):(this.legendBounds.width=Be(o.width,t.width)||e.width,this.legendBounds.height=Be(o.height||n,t.height)),this.library.getLegendBounds(t,this.legendBounds,o),this.isBulletChartControl||(this.legendBounds.width+=this.legend.containerPadding.left+this.legend.containerPadding.right,this.legendBounds.height+=this.legend.containerPadding.top+this.legend.containerPadding.bottom),this.getLocation(this.position,o.alignment,this.legendBounds,e,t,r)},e.prototype.getPosition=function(e,t){var i=this.chart,r=this.chart;this.isChartControl||this.isBulletChartControl||this.isStockChartControl?this.position="Auto"!==e?e:"Bottom":("Auto"===e&&((i||r).visibleSeries&&"Funnel"===(i||r).visibleSeries[0].type||"Pyramid"===(i||r).visibleSeries[0].type)&&(e="Top"),this.position="Auto"!==e?e:t.width>t.height?"Right":"Bottom")},e.prototype.setBounds=function(e,t,i,r){var o=i.title&&"Top"===i.titlePosition?this.legendTitleSize.height+this.fivePixel:0;this.isVertical&&this.isPaging&&!i.enablePages&&!this.isBulletChartControl&&(o=i.title&&"Top"===i.titlePosition?this.legendTitleSize.height+this.fivePixel:0,o+=this.pageButtonSize+this.fivePixel),e=Math.min(e,r.width),t=Math.min(t,r.height),"Gradient"===i.mode?(r.width=i.width?r.width:this.isVertical?e:.75*r.width,r.height=i.height?r.height:this.isVertical?.75*r.height:t):(r.width=i.width?r.width:e,r.height=i.height?r.height:t),this.isBulletChartControl||this.isTop&&"None"!==i.titleStyle.textOverflow&&(this.calculateLegendTitle(i,r),r.height+="Wrap"===i.titleStyle.textOverflow&&this.legendTitleCollections.length>1?this.legendTitleSize.height-this.legendTitleSize.height/this.legendTitleCollections.length:0),this.rowCount=Math.max(1,Math.ceil((r.height-i.padding-o)/(this.maxItemHeight+i.padding)))},e.prototype.getLocation=function(e,t,i,r,o,n){var a=this.legend.border.width,s=this.isBulletChartControl,l=this.bulletChart,h="Inside"===l.labelPosition,c="Inside"===l.tickPosition,d="Vertical"===l.orientation,p=s&&""!==l.categoryField?n.width+this.chart.border.width+3*a:0,u=this.chart.margin.bottom,g=i.height+a+this.legend.margin.top+this.legend.margin.bottom,y=i.width+a+this.legend.margin.left+this.legend.margin.right;"Bottom"===e?(i.x=this.alignLegend(i.x,o.width,i.width,t),i.y=r.y+(r.height-g)+a+this.legend.margin.top,i.y+=!s||l.opposedPosition||h||c||d?d&&""!==l.categoryField?n.height+2*a:0:l.majorTickLines.height+u+this.legend.border.width+2*a,L(r,new Hi(0,0,0,g))):"Top"===e?(i.x=this.alignLegend(i.x,o.width,i.width,t),i.y=r.y+a+this.legend.margin.top,i.y-=!s||!l.opposedPosition||h||c||d?0:l.majorTickLines.height+this.chart.margin.top,L(r,new Hi(0,0,g-=s?2*-a:0,0))):"Right"===e?(i.x=r.x+(r.width-i.width)-this.legend.margin.right,i.y=r.y+this.alignLegend(0,o.height-(r.y+u),i.height,t),y+=s&&l.opposedPosition&&!h&&!c&&d?this.chart.margin.left+this.chart.margin.right+l.majorTickLines.height:0,L(r,new Hi(0,y,0,0))):"Left"===e?(i.x=i.x+this.legend.margin.left,i.y=r.y+this.alignLegend(0,o.height-(r.y+u),i.height,t),y+=!s||l.opposedPosition||h||c||!d?"Vertical"!==l.orientation&&""!==l.categoryField?p:0:i.x-this.chart.margin.left+a+l.majorTickLines.height,L(r,new Hi(y,0,0,0))):(i.x=this.legend.location.x,i.y=this.legend.location.y,L(r,new Hi(0,0,0,0)))},e.prototype.alignLegend=function(e,t,i,r){switch(r){case"Far":e=t-i-e;break;case"Center":e=(t-i)/2}return e},e.prototype.renderLegend=function(e,t,r,o){var n=0,a=0,s=(new i.Rect(0,0,0,0),new i.Rect(0,0,0,0)),l=this.findFirstLegendPosition(this.legendCollections),h=t.padding,c=t.enablePages,d=t.titlePosition,p=this.isPaging&&!t.enablePages&&this.isVertical?this.pageButtonSize:0,u=e.renderer.createGroup({id:this.legendID+"_g"}),g=this.createLegendElements(e,r,u,t,this.legendID,o);this.legendRegions=[];for(var y=0,m=0;m<this.legendCollections.length;m++)if(""!==this.legendCollections[m].text){y=Math.max(this.legendCollections[m].textSize.height,y);break}if(this.maxItemHeight=Math.max(y,t.shapeHeight),c||!this.isPaging||this.isVertical?this.isPaging||this.isVertical||(a=this.isTitle&&"Left"===d?this.fivePixel+this.legendTitleSize.width:0):(a=this.isTitle&&"Left"===d?this.legendTitleSize.width:0,a+=this.pageButtonSize+2*this.fivePixel),n=this.isTitle&&(this.isTop||this.isVertical)?this.legendTitleSize.height:0,"Gradient"===e.legendSettings.mode&&this.legendCollections.length>1)this.getLinearLegend(r,e,t,g),this.totalPages=1;else if(l!==this.legendCollections.length){var v=void 0,f=0,b=this.legendCollections[l],x=new Vi(this.isBulletChartControl?r.x+a+h+t.shapeWidth/2:r.x+a+h+t.shapeWidth/2+t.containerPadding.left,this.isBulletChartControl?r.y+n+p+h+this.maxItemHeight/2:r.y+n+p+h+this.maxItemHeight/2+t.containerPadding.top),w=e.isRtlEnabled?"end":"start",S=new i.TextOption("",x.x,x.y,w),C=t.shapePadding+h+t.shapeWidth;if(this.totalPages=this.totalPages=this.isChartControl||this.isBulletChartControl||this.isStockChartControl?this.totalPages:0,this.pageXCollections=[],this.legendCollections[l].location=x,!t.enablePages&&this.isPaging){var P=x.x-this.fivePixel,L=x.y-this.fivePixel,R=this.isTitle&&!this.isVertical&&"Left"===d?this.legendTitleSize.width+this.fivePixel:0,M=this.isVertical?this.pageButtonSize+Math.abs(L-r.y):0,A=this.isTitle&&!this.isVertical&&"Right"===d?this.legendTitleSize.width+this.fivePixel:0;A+=this.isVertical?0:this.fivePixel+this.pageButtonSize+this.fivePixel,s=new i.Rect(P,L,r.width-A-R,r.height-M)}else s=r;for(var k=0,T=this.legendCollections;k<T.length;k++){var _=T[k];"accumulationchart"===this.chart.getModuleName()&&(_.fill=(this.chart||this.chart||this.chart).visibleSeries[0].points[_.pointIndex].color),"stockChart"===this.chart.getModuleName()&&(_.type=this.chart.visibleSeries[f].type),this.accessbilityText=this.isBulletChartControl?"Legend of bullet chart"+_.text:"Click to show or hide the "+_.text+" series",_.render&&""!==_.text&&((v=e.renderer.createGroup({id:this.legendID+this.generateId(_,"_g_",f)}))&&(v.setAttribute("tabindex",t.tabIndex.toString()),v.setAttribute("aria-label",t.description||this.accessbilityText)),this.library.getRenderPoint(_,x,C,b,s,f,l),this.renderSymbol(_,v,f),this.renderText(e,_,v,S,f),v&&v.setAttribute("style","outline: none; cursor: "+(!t.toggleVisibility&&("None"===e.selectionMode||"None"===e.highlightMode||"None"===e.selectionMode)||this.isBulletChartControl?"auto":"pointer")),g&&g.appendChild(v),b=_),f++}this.isPaging?this.renderPagingElements(e,r,S,u):this.totalPages=1}be(e.enableCanvas,e.svgObject,u,o)},e.prototype.getLinearLegend=function(e,t,r,o){var n="http://www.w3.org/2000/svg",a=this.legendCollections[0],s=this.legendCollections[1],l=this.chart.renderer.createDefs(),h=document.createElementNS(n,"linearGradient"),c=[],d=[];r.title&&(this.isVertical?(e.y+=this.legendTitleSize.height,e.height-=this.legendTitleSize.height):"Left"===r.titlePosition?(e.x+=this.legendTitleSize.width,e.width-=this.legendTitleSize.width):"Right"===r.titlePosition?e.width-=this.legendTitleSize.width:"Top"===r.titlePosition&&(e.y+=this.legendTitleSize.height,e.height-=this.legendTitleSize.height));for(var p=0,u=this.chart.rangeColorSettings;p<u.length;p++){var g=u[p];if(d.indexOf(g.start)<0&&d.push(g.start),g.colors.length>2){var y=g.end-g.start,m=g.colors.length-1;if(y>0){y/=m;for(f=1;f<m;f++){var v=g.start+y*f;d.push(v)}}else for(var f=1;f<m;f++)d.push(g.start)}d.indexOf(g.end)<0&&d.push(g.end);for(var b=0,x=g.colors;b<x.length;b++){var w=x[b];c.indexOf(w)<0&&c.push(w)}g.colors.length>0&&g.colors.length<2&&c.push(g.colors[0])}var S=this.isVertical?"0":"100",C=this.isVertical?"100":"0";h.setAttribute("id",this.generateId(a,"linearGradient",0)),h.setAttribute("x1","0%"),h.setAttribute("y1","0%"),h.setAttribute("x2",S+"%"),h.setAttribute("y2",C+"%");for(var P=d[d.length-1]-d[0],L=0;L<c.length;L++){var R=d[L]-d[0];R/=P;var M=document.createElementNS(n,"stop");M.setAttribute("offset",R.toString()),M.setAttribute("stop-color",c[L]),M.setAttribute("stop-opacity",1..toString()),h.appendChild(M)}var A,k,T,_,O=a.text.toString(),E=s.text.toString(),I=i.measureText(O,r.textStyle),z=i.measureText(E,r.textStyle),D=I.width>z.width?I.width:z.width,B=I.height>z.height?I.height:z.height,F=2*D+4*r.padding,N=e.width,V=e.height,j=e.x+D+2*r.padding,H=e.y+r.padding;if(this.isVertical){if(F=2*B+4*r.padding,N=e.width-2*r.padding,V=e.height-F,j=e.x+r.padding,H=e.y+B+2*r.padding,A=e.y+r.padding+B,k=H+V+B,T=e.x+.5*e.width-.5*D,_=T,N>30){var X=N-30;N=30,j+=X/2}}else if(N=e.width-F,V=e.height-2*r.padding,T=e.x+r.padding+(D-I.width),_=e.x+N+3*r.padding+D,A=e.y+.5*e.height+.25*B,k=A,V>30){var Y=V-30;V=30,H+=Y/2}var G=new i.TextOption("",T,A,"",O);G.id=this.legendID+this.generateId(a,"_text_",1);var W=a.visible?r.textStyle.color||t.themeStyle.legendLabel:"#D3D3D3",U=!this.isStockChartControl&&this.chart.enableCanvas;Ve(t.renderer,G,r.textStyle,W,o,!1,!1,!1,!1,null,this.currentPageNumber&&U?new i.Rect(0,-this.translatePage(null,this.currentPageNumber-1,this.currentPageNumber),0,0):null),(G=new i.TextOption("",_,k,"",E)).id=this.legendID+this.generateId(a,"_text_",2),Ve(t.renderer,G,r.textStyle,W,o,!1,!1,!1,!1,null,this.currentPageNumber&&U?new i.Rect(0,-this.translatePage(null,this.currentPageNumber-1,this.currentPageNumber),0,0):null);var Z=t.renderer.drawRectangle({width:N,height:V,x:j,y:H,fill:"url(#"+this.generateId(a,"linearGradient",0)+")"});l.appendChild(h),o.appendChild(l),o.appendChild(Z)},e.prototype.findFirstLegendPosition=function(e){for(var t=0,i=0,r=e;i<r.length;i++){var o=r[i];if(o.render&&""!==o.text)break;t++}return t},e.prototype.calculateLegendTitle=function(e,t){if(e.title){this.isTop="Top"===e.titlePosition;var r="Trim"===e.titleStyle.textOverflow?2*e.padding:0;this.isTop||this.isVertical?this.legendTitleCollections=Xe(e.title,e.titleStyle,t.width-r):this.legendTitleCollections[0]=ze(e.maximumTitleWidth,e.title,e.titleStyle);var o=this.isTop?e.title:this.legendTitleCollections[0];this.legendTitleSize=i.measureText(o,e.titleStyle),this.legendTitleSize.height*=this.legendTitleCollections.length}else this.legendTitleSize=new i.Size(0,0)},e.prototype.renderLegendTitle=function(e,t,r,o){var n=t.padding,a=t.titleStyle.textAlignment;this.isTop="Top"===t.titlePosition;var s="Near"===a?"start":"Far"===a?"end":"middle",l=Ye(r,t.titleStyle);s=this.isTop||this.isVertical?s:"",l="Near"===a?l+n:"Far"===a?l-n:l,l=this.isTop||this.isVertical?l:r.x+("Left"===t.titlePosition?5:r.width-this.legendTitleSize.width-5);var h=r.height/2+this.legendTitleSize.height/4,c=r.y+(this.isTop||this.isVertical?this.legendTitleSize.height/this.legendTitleCollections.length:h),d=new i.TextOption(this.legendID+"_title",l,c,s,this.legendTitleCollections);Ve(e.renderer,d,t.titleStyle,t.titleStyle.color,o)},e.prototype.createLegendElements=function(e,t,i,r,o,n){var a=r.padding,s=new Di(o+"_element",r.background,r.border,r.opacity,t),l=e.renderer.createGroup({id:o+"_collections"}),h=!this.isStockChartControl&&e.enableCanvas,c=e.renderer.createClipPath({id:o+"_clipPath"});return i?i.appendChild(e.renderer.drawRectangle(s)):e.renderer.drawRectangle(s),r.title&&this.renderLegendTitle(e,r,t,i),h||i.appendChild(l),this.legendTranslateGroup=e.renderer.createGroup({id:o+"_translate_g"}),h||l.appendChild(this.legendTranslateGroup),s.y+=a+(this.isTop?this.legendTitleSize.height:0),s.id+="_clipPath_rect",s.width=this.isChartControl||"bulletChart"===e.getModuleName()||this.isStockChartControl||!this.isVertical?t.width:this.maxWidth-a+r.containerPadding.left+r.containerPadding.right,h?this.pagingClipRect=s:(this.clipRect=e.renderer.drawRectangle(s),c.appendChild(this.clipRect)),be(h,e.svgObject,c,n),h||l.setAttribute("style","clip-path:url(#"+c.id+")"),this.legendTranslateGroup},e.prototype.renderSymbol=function(e,t,r){var o,n,a=this.isBulletChartControl?this.chart:null,s=e.visible?e.fill:"#D3D3D3",l=("chart"===this.chart.getModuleName()||"stockChart"===this.chart.getModuleName())&&"SeriesType"===e.shape&&e.type.toLowerCase().indexOf("line")>-1&&-1===e.type.toLowerCase().indexOf("area"),h=!("chart"!==this.chart.getModuleName()&&"stockChart"!==this.chart.getModuleName()||"Scatter"!==e.type&&"Bubble"!==e.type),c=!this.isStockChartControl&&this.chart.enableCanvas,d="SeriesType"===e.shape?e.type:e.shape,p=l?"Series"===this.legend.mode?this.chart.visibleSeries[r].width:this.chart.visibleSeries[0].width:this.isBulletChartControl&&"Multiply"===e.shape?4:1;if(d="Scatter"===d?e.markerShape:d,h&&r<this.chart.visibleSeries.length){var u=this.chart.visibleSeries[r].border;o=u.color?u.color:s,p=u.width?u.width:1}var g=new i.PathOption(this.legendID+this.generateId(e,"_shape_",r),s,p,h?o:s,1,"",""),y=i.measureText(e.text,this.legend.textStyle),m=this.legend.isInversed?e.location.x+y.width+this.legend.shapePadding:e.location.x,v=e.location.y;c?(n=-this.translatePage(null,this.currentPageNumber-1,this.currentPageNumber),ne({x:m,y:v},d,new i.Size(this.legend.shapeWidth,this.legend.shapeHeight),"",g,this.accessbilityText,this.chart.renderer,this.currentPageNumber?new i.Rect(0,n,0,0):null,this.isBulletChartControl,a),this.legendRegions.push({rect:new i.Rect(e.location.x,e.location.y,this.legend.shapeWidth,this.legend.shapeHeight+n),index:r})):t.appendChild(ne({x:m,y:v},d,new i.Size(this.legend.shapeWidth,this.legend.shapeHeight),e.url,g,this.accessbilityText,this.chart.renderer,null,this.isBulletChartControl,a)),("Line"===d&&e.markerVisibility&&"Image"!==e.markerShape||"Doughnut"===e.type&&"Doughnut"===d)&&(g.id=this.legendID+this.generateId(e,"_shape_marker_",r),d="Doughnut"===e.type?"Circle":e.markerShape,g.fill="Doughnut"===e.type?"#FFFFFF":g.fill,c?ne({x:m,y:v},d,new i.Size(this.legend.shapeWidth/2,this.legend.shapeHeight/2),"",g,this.accessbilityText,this.chart.renderer,this.currentPageNumber?new i.Rect(0,-this.translatePage(null,this.currentPageNumber-1,this.currentPageNumber),0,0):null,this.isBulletChartControl,a):t.appendChild(ne({x:m,y:v},d,new i.Size(this.legend.shapeWidth/2,this.legend.shapeHeight/2),"",g,this.accessbilityText,null,null,this.isBulletChartControl,a)))},e.prototype.renderText=function(e,t,r,o,n){var a=e.legendSettings,s=t.visible?a.textStyle.color||e.themeStyle.legendLabel:"#D3D3D3",l=!this.isStockChartControl&&this.chart.enableCanvas;o.id=this.legendID+this.generateId(t,"_text_",n),o.text=t.text,o.x=a.isInversed?t.location.x-a.shapeWidth/2:t.location.x+a.shapeWidth/2+a.shapePadding,o.y=t.location.y+this.maxItemHeight/4;var h=Ve(e.renderer,o,a.textStyle,s,r,!1,!1,!1,!1,null,this.currentPageNumber&&l?new i.Rect(0,-this.translatePage(null,this.currentPageNumber-1,this.currentPageNumber),0,0):null);if(h&&h.setAttribute("aria-label",a.description||this.accessbilityText),l){var c=i.measureText(o.text,a.textStyle);this.legendRegions[n].rect.y=o.y<this.legendRegions[n].rect.y?o.y:this.legendRegions[n].rect.y,this.legendRegions[n].rect.width+=c.width,this.legendRegions[n].rect.height=c.height,this.legendRegions[n].rect.y-=.5*c.height}},e.prototype.renderPagingElements=function(e,t,r,o){var n=e.renderer.createGroup({id:this.legendID+"_navigation"}),a=!this.isStockChartControl&&e.enableCanvas,s=this.isBulletChartControl?0:this.legendTitleSize.height,l=e.legendSettings,h=new i.PathOption(this.legendID+"_pageup","transparent",5,"#545454",1,"",""),c=this.pageButtonSize,d=l.enablePages||!this.isPaging||this.isVertical||this.isBulletChartControl?this.rowCount-1:1,p=this.isTitle&&"Left"===l.titlePosition?this.legendTitleSize.width:0;this.pagingRegions=[],this.backwardArrowOpacity=1!==this.currentPage?1:0,this.forwardArrowOpacity=this.currentPage===this.totalPages?0:1,a||o.appendChild(n),this.isChartControl||this.isBulletChartControl||this.isStockChartControl||!this.isVertical?this.totalPages=Math.ceil(this.totalPages/Math.max(1,this.rowCount-1)):this.totalPages=Math.ceil(this.totalPages/this.maxColumns),n&&n.setAttribute("style","cursor: pointer"),this.clipPathHeight=d*(this.maxItemHeight+l.padding),a?(this.pagingClipRect.height=this.legendBounds.height-this.clipPathHeight-(this.pagingClipRect.y-this.legendBounds.y)-l.border.width,this.pagingClipRect.y=this.pagingClipRect.y+this.clipPathHeight,this.pagingClipRect.x+=l.border.width,this.pagingClipRect.width-=l.border.width+l.border.width/2,this.chart.renderer.clearRect(new i.Rect(this.pagingClipRect.x,this.pagingClipRect.y,this.pagingClipRect.width,this.pagingClipRect.height))):this.clipRect.setAttribute("height",this.clipPathHeight.toString());var u,g=t.x+c/2,y=t.y+this.clipPathHeight+(s+t.height-this.clipPathHeight)/2;!this.isPaging||l.enablePages||this.isVertical||this.isBulletChartControl||(g=t.x+this.fivePixel+this.pageButtonSize+p,y=l.title&&this.isTop?t.y+8+s+c/1+.5:t.y+8+c+.5);var m=i.measureText(this.totalPages+"/"+this.totalPages,l.textStyle);a?ne({x:g,y:y},"LeftArrow",new i.Size(c,c),"",h,"LeftArrow",this.chart.renderer,new i.Rect(t.width-(2*(c+8)+8+m.width),0,0,0)):!this.isVertical||l.enablePages||this.isBulletChartControl?(h.opacity=this.isBulletChartControl?h.opacity:l.enablePages?1:this.backwardArrowOpacity,n.appendChild(ne({x:g,y:y},"LeftArrow",new i.Size(c,c),"",h,"LeftArrow"))):(g=t.x+t.width/2,y=t.y+c/2+8+s,h.opacity=this.backwardArrowOpacity,n.appendChild(ne({x:g,y:y},"UpArrow",new i.Size(c,c),"",h,"UpArrow"))),this.pagingRegions.push(new i.Rect(g+t.width-(2*(c+8)+8+m.width)-.5*c,y-.5*c,c,c)),r.x=g+c/2+8,r.y=y+m.height/4,r.id=this.legendID+"_pagenumber",r.text="1/"+this.totalPages,a&&this.totalNoOfPages&&(r.text=this.currentPageNumber+"/"+this.totalNoOfPages),(l.enablePages||this.isBulletChartControl)&&(u=Ve(e.renderer,r,l.textStyle,l.textStyle.color,n,!1,!1,!1,!1,null,new i.Rect(t.width-(2*(c+8)+8+m.width),0,0,0))),g=r.x+8+c/2+m.width,!this.isPaging||l.enablePages||this.isVertical||(g=t.x+t.width-this.fivePixel-this.pageButtonSize-(l.title&&"Right"===l.titlePosition?this.legendTitleSize.width+this.fivePixel:0)),h.id=this.legendID+"_pagedown",h.opacity=l.enablePages?1:this.forwardArrowOpacity,a?ne({x:g,y:y},"RightArrow",new i.Size(c,c),"",h,"RightArrow",this.chart.renderer,new i.Rect(t.width-(2*(c+8)+8+m.width),0,0,0)):!this.isVertical||l.enablePages||this.isBulletChartControl?n.appendChild(ne({x:g,y:y},"RightArrow",new i.Size(c,c),"",h,"RightArrow")):(g=t.x+t.width/2,y=t.y+t.height-c/2-8,n.appendChild(ne({x:g,y:y},"DownArrow",new i.Size(c,c),"",h,"DownArrow"))),this.pagingRegions.push(new i.Rect(g+(t.width-(2*(c+8)+8+m.width)-.5*c),y-.5*c,c,c)),a||!l.enablePages&&!this.isBulletChartControl?(1===this.currentPageNumber&&this.calTotalPage&&(l.enablePages||this.isBulletChartControl)&&(this.totalNoOfPages=this.totalPages,this.calTotalPage=!1),l.enablePages||this.isBulletChartControl||this.translatePage(null,this.currentPage-1,this.currentPage,l)):n.setAttribute("transform","translate("+(t.width-(2*(c+8)+8+m.width))+", 0)"),(l.enablePages||this.isBulletChartControl)&&this.translatePage(u,this.currentPage-1,this.currentPage,l)},e.prototype.translatePage=function(e,t,i,r){var o=this.clipPathHeight*t,n="translate(0,-"+o+")";return this.isChartControl||this.isBulletChartControl||this.isStockChartControl||!this.isVertical||(n="translate(-"+(o=(o=this.pageXCollections[t*this.maxColumns]-this.legendBounds.x)<0?0:o)+",0)"),this.chart.enableCanvas||this.legendTranslateGroup.setAttribute("transform",n),this.chart.enableCanvas||!r.enablePages&&!this.isBulletChartControl||(e.textContent=i+"/"+this.totalPages),this.currentPage=i,o},e.prototype.changePage=function(e,t){var i=this.chart.legendSettings,r=document.getElementById(this.legendID+"_pageup"),o=document.getElementById(this.legendID+"_pagedown"),n=i.enablePages||this.isBulletChartControl?document.getElementById(this.legendID+"_pagenumber"):null,a=i.enablePages||this.isBulletChartControl?parseInt(n.textContent.split("/")[0],10):this.currentPage;t&&a>1?this.translatePage(n,a-2,a-1,i):!t&&a<this.totalPages&&this.translatePage(n,a,a+1,i),!this.isPaging||i.enablePages||this.isBulletChartControl||(this.currentPage===this.totalPages?this.hideArrow(o):this.showArrow(o),1===this.currentPage?this.hideArrow(r):this.showArrow(r))},e.prototype.hideArrow=function(e){e.setAttribute("opacity","0")},e.prototype.showArrow=function(e){e.setAttribute("opacity","1")},e.prototype.generateId=function(e,t,i){return this.isChartControl||this.isStockChartControl?t+i:t+e.pointIndex},e.prototype.move=function(e){var t=this,i=this.chart.mouseX,r=this.chart.mouseY;if(e.target.textContent.indexOf("...")>-1){var o=e.target.id.split(this.legendID+"_text_");if(2===o.length){var n=parseInt(o[1],10),a=this.chart.element;isNaN(n)||(this.chart.isTouch&&m(this.chart.element.id+"_EJ2_Legend_Tooltip"),this.isChartControl?f(this.chart.series[n].name,i,r,a.offsetWidth,a.id+"_EJ2_Legend_Tooltip",he(this.chart.element.id+"_Secondary_Element")):f(this.chart.visibleSeries[0].points[n].x.toString(),i+10,r+10,a.offsetWidth,a.id+"_EJ2_Legend_Tooltip",he(this.chart.element.id+"_Secondary_Element")))}}else m(this.chart.element.id+"_EJ2_Legend_Tooltip");this.chart.isTouch&&(clearTimeout(this.clearTooltip),this.clearTooltip=+setTimeout(function(){m(t.chart.element.id+"_EJ2_Legend_Tooltip")},1e3))},e}(),mr=function(){function e(e,t,i,r,o,n,a,s,l,h){this.location={x:0,y:0},this.text=e,this.fill=t,this.shape=i,this.url=n,this.visible=r,this.type=o,this.markerVisibility=s,this.markerShape=a,this.pointIndex=l,this.seriesIndex=h}return e}(),vr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fr=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},br=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.clipRect=new i.Rect(0,0,0,0),t}return vr(r,e),r.prototype.setDataSource=function(e,t){e&&(this.xData=e.xData,this.yData=e.yData,this.points=e.points),t[G(this.type)+"IndicatorModule"].initDataSource(this,t),t.visibleSeriesCount+=this.targetSeries.length},fr([t.Property("Sma")],r.prototype,"type",void 0),fr([t.Property(14)],r.prototype,"period",void 0),fr([t.Property(14)],r.prototype,"kPeriod",void 0),fr([t.Property(3)],r.prototype,"dPeriod",void 0),fr([t.Property(80)],r.prototype,"overBought",void 0),fr([t.Property(20)],r.prototype,"overSold",void 0),fr([t.Property(2)],r.prototype,"standardDeviation",void 0),fr([t.Property("Close")],r.prototype,"field",void 0),fr([t.Property(12)],r.prototype,"slowPeriod",void 0),fr([t.Property(26)],r.prototype,"fastPeriod",void 0),fr([t.Property(!0)],r.prototype,"showZones",void 0),fr([t.Complex({color:"#ff9933",width:2},Ht)],r.prototype,"macdLine",void 0),fr([t.Property("Both")],r.prototype,"macdType",void 0),fr([t.Property("#2ecd71")],r.prototype,"macdPositiveColor",void 0),fr([t.Property("#e74c3d")],r.prototype,"macdNegativeColor",void 0),fr([t.Property("rgba(211,211,211,0.25)")],r.prototype,"bandColor",void 0),fr([t.Complex({color:"#ffb735",width:1},Ht)],r.prototype,"upperLine",void 0),fr([t.Complex({color:"#f2ec2f",width:1},Ht)],r.prototype,"lowerLine",void 0),fr([t.Complex({color:"#f2ec2f",width:1},Ht)],r.prototype,"periodLine",void 0),fr([t.Property("")],r.prototype,"seriesName",void 0),r}(or),xr=function(){function e(e){this.control=e}return e.prototype.print=function(e){this.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWindow.moveTo(0,0),this.printWindow.resizeTo(screen.availWidth,screen.availHeight);var i={cancel:!1,htmlContent:this.getHTMLContent(e),name:"beforePrint"};this.control.trigger("beforePrint",i),i.cancel||t.print(i.htmlContent,this.printWindow)},e.prototype.getHTMLContent=function(e){var i=t.createElement("div");if(e)if(e instanceof Array)for(var r=0;r<e.length;r++){var o=e[r];i.appendChild(he(o).cloneNode(!0))}else e instanceof Element?i.appendChild(e.cloneNode(!0)):i.appendChild(he(e).cloneNode(!0));else i.appendChild(this.control.element.cloneNode(!0));return i},e.prototype.export=function(e,i,r,n,a,s,l,h,c){var d=this,p=this.getControlsValue(n,l);a=a||p.width,s=s||p.height;var u,g=this.control.svgObject,y=this.control.enableCanvas;y||(g=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:a.toString(),height:s.toString()}}));var v=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1);r=t.isNullOrUndefined(r)?o.PdfPageOrientation.Landscape:r;var f='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+p.svg.outerHTML+"</svg>",b=window.URL.createObjectURL(new Blob("SVG"===e?[f]:[(new XMLSerializer).serializeToString(p.svg)],{type:"image/svg+xml"}));if("SVG"===e)if("msie"===t.Browser.info.name){var x=new Blob([(new XMLSerializer).serializeToString(p.svg)],{type:"application/octet-stream"});window.navigator.msSaveOrOpenBlob(x,i+"."+e.toLocaleLowerCase())}else this.triggerDownload(i,e,b,v);else if("msie"===t.Browser.info.name){var w=g;y||(w=this.createCanvas()),u=w.toDataURL(),"PDF"===e?this.exportPdf(w,r,a,s,v,i,h,c):this.doexport(e,u,i)}else{var S=new Image,C=g.getContext("2d");S.onload=function(){C.drawImage(S,0,0),window.URL.revokeObjectURL(b),"PDF"===e?d.exportPdf(g,r,a,s,v,i,h,c):window.navigator.msSaveOrOpenBlob?window.navigator.msSaveOrOpenBlob(g.toBlob(null),i+"."+e.toLocaleLowerCase()):d.triggerDownload(i,e,g.toDataURL("image/"+e.toLowerCase()),v)},S.src=b}y||m(document.getElementById(this.control.element.id+"_canvas"))},e.prototype.getDataUrl=function(e){var i=this.getControlsValue([e]),r=this.control.svgObject,o=this.control.enableCanvas;o||(r=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:i.width.toString(),height:i.height.toString()}}));var n=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(i.svg)],{type:"image/svg+xml"}));if("msie"===t.Browser.info.name){var a=r;o||(a=this.createCanvas());var s={name:"afterExport",cancel:!1,dataUrl:r.toDataURL("image/png")};return e.trigger("afterExport",s),{element:a,dataUrl:a.toDataURL()}}var l=new Image,h=r.getContext("2d");return l.onload=function(){h.drawImage(l,0,0),window.URL.revokeObjectURL(n);var t={name:"afterExport",cancel:!1,dataUrl:r.toDataURL("image/png")};return e.trigger("afterExport",t),t.dataUrl},l.src=n,{element:r,blobUrl:n}},e.prototype.triggerDownload=function(e,i,r,o){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(o?"click":"move",{view:window,bubbles:!1,cancelable:!0}))},e.prototype.getControlsValue=function(e,r){var o=0,n=0,a=this.control.enableCanvas,s=new i.SvgRenderer("").createSvg({id:"Svg_Export_Element",width:200,height:200});return e.map(function(e){var i=e.svgObject.cloneNode(!0),l=e.renderer.createGroup({style:t.isNullOrUndefined(r)||r?"transform: translateY("+n+"px)":"transform: translateX("+o+"px)"}),h=i.childNodes[0].getAttribute("fill");"Tailwind"!==e.theme&&"TailwindDark"!==e.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h||i.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)"),a||l.appendChild(i),o=t.isNullOrUndefined(r)||r?Math.max(e.availableSize.width,o):o+e.availableSize.width,n=t.isNullOrUndefined(r)||r?n+e.availableSize.height:Math.max(e.availableSize.height,n),a||s.appendChild(l)}),a||(s.setAttribute("width",o+""),s.setAttribute("height",n+"")),{width:o,height:n,svg:s}},e.prototype.createCanvas=function(){var e=this.control;this.canvasRender(!0,e);var t=e.svgObject;return this.canvasRender(!1,e),t},e.prototype.canvasRender=function(e,t){t.enableCanvas=e,t.preRender(),t.render()},e.prototype.exportPdf=function(e,t,i,r,n,a,s,l){var h=new o.PdfDocument,c=h.pageSettings.margins,d=h.pageSettings.width,p=h.pageSettings.height,u=e.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");h.pageSettings.orientation=t;var g=d<i?i+c.left+c.right:d,y=p<r?r+c.top+c.bottom:p;if(void 0!==s){var m=new o.PdfStandardFont(1,s.fontSize||15),v=new o.PdfPageTemplateElement(g,40);v.graphics.drawString(s.content+"",m,null,new o.PdfSolidBrush(new o.PdfColor(0,0,0)),s.x,s.y,null),h.template.top=v}if(void 0!==l){var m=new o.PdfStandardFont(1,l.fontSize||15),f=new o.PdfPageTemplateElement(g,40);f.graphics.drawString(l.content+"",m,null,new o.PdfSolidBrush(new o.PdfColor(0,0,0)),l.x,l.y,null),h.template.bottom=f}h.pageSettings.size=new o.SizeF(g,y),u=u.slice(u.indexOf(",")+1),h.pages.add().graphics.drawImage(new o.PdfBitmap(u),0,0,i,r),n&&(h.save(a+".pdf"),h.destroy())},e.prototype.doexport=function(e,t,i){var r=[],o=e||"JPG";r=[t],this.exportImage(r,i,o,t)},e.prototype.exportImage=function(e,i,r,o){for(var n=[],a=e instanceof HTMLElement?0:e.length,s=0;s<a;s++){for(var l=(o=(o=e[s]).replace(/^data:[a-z]*;,/,"")).split(","),h=atob(l[1]),c=new ArrayBuffer(h.length),d=new Uint8Array(c),p=0;p<h.length;p++)d[p]=h.charCodeAt(p);n.push(c)}for(var u=0;u<n.length;u++){var g=new Blob([n[u]],{type:"application/octet-stream"});"msie"===t.Browser.info.name&&window.navigator.msSaveOrOpenBlob(g,i+"."+r.toLocaleLowerCase())}},e}(),wr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Sr=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Cr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return wr(i,e),Sr([t.Property()],i.prototype,"start",void 0),Sr([t.Property()],i.prototype,"end",void 0),Sr([t.Property([])],i.prototype,"colors",void 0),Sr([t.Property("")],i.prototype,"label",void 0),i}(t.ChildProperty),Pr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return wr(i,e),Sr([t.Property(!1)],i.prototype,"enable",void 0),Sr([t.Property("")],i.prototype,"dashArray",void 0),Sr([t.Complex({color:null,width:1},Yt)],i.prototype,"line",void 0),Sr([t.Property("Both")],i.prototype,"lineType",void 0),i}(t.ChildProperty),Lr=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return wr(i,e),Sr([t.Property(!1)],i.prototype,"enableSelectionZooming",void 0),Sr([t.Property(!1)],i.prototype,"enablePinchZooming",void 0),Sr([t.Property(!1)],i.prototype,"enableMouseWheelZooming",void 0),Sr([t.Property(!0)],i.prototype,"enableDeferredZooming",void 0),Sr([t.Property("XY")],i.prototype,"mode",void 0),Sr([t.Property(["Zoom","ZoomIn","ZoomOut","Pan","Reset"])],i.prototype,"toolbarItems",void 0),Sr([t.Property(!1)],i.prototype,"enablePan",void 0),Sr([t.Property(!1)],i.prototype,"enableScrollbar",void 0),i}(t.ChildProperty),Rr=function(r){function o(e,i){var o=r.call(this,e,i)||this;return o.rotatedDataLabelCollections=[],o.animated=!1,o.isPointMouseDown=!1,o.isScrolling=!1,o.checkResize=0,o.visible=0,o.clickCount=0,o.singleClickTimer=0,o.chartAreaType="Cartesian",o.isRtlEnabled=!1,o.chartid=57723,t.setValue("mergePersistData",o.mergePersistChartData,o),o}return wr(o,r),o.prototype.mergePersistChartData=function(){var e=window.localStorage.getItem(this.getModuleName()+this.element.id);if(!t.isNullOrUndefined(e)&&""!==e){var i=JSON.parse(e),r=Object.keys(i);this.isProtectedOnChange=!0;for(var o=0,n=r;o<n.length;o++){var a=n[o];"object"!=typeof this[a]||t.isNullOrUndefined(this[a])?this[a]=i[a]:t.extend(this[a],i[a])}this.isProtectedOnChange=!1}},o.prototype.isIdHasSpecialCharacter=function(e){var t=/^[A-Za-z0-9 ]+$/,i="";if(t.test(e))return e;for(var r=0;r<e.length;r++)t.test(e[r])||-1!==e.indexOf("-")||-1!==e.indexOf("_")||-1!==e.indexOf("\\")?i+=e[r]:i+="\\"+e[r];return i},o.prototype.preRender=function(){this.element.id=this.isIdHasSpecialCharacter(this.element.id);this.isBlazor=window.Blazor,this.allowServerDataBinding=!1,this.unWireEvents(),this.initPrivateVariable(),this.setCulture(),this.wireEvents(),this.stockChart&&(null===this.stockChart.tooltip.header&&(this.tooltip.header="<b>${point.x}</b>"),null===this.stockChart.tooltip.format&&(this.tooltip.format="High : <b>${point.high}</b><br/>Low : <b>${point.low}</b><br/>Open : <b>${point.open}</b><br/>Close : <b>${point.close}</b>",""!==this.stockChart.series[0].volume&&(this.tooltip.format+="<br/>Volume : <b>${point.volume}</b>")),this.animateSeries=!1)},o.prototype.initPrivateVariable=function(){if(this.animateSeries=!0,this.delayRedraw=!1,this.horizontalAxes=[],this.verticalAxes=[],this.refreshAxis(),this.refreshDefinition(this.rows),this.refreshDefinition(this.columns),this.tooltipModule&&(this.tooltipModule.previousPoints=[]),""===this.element.id){var e=document.getElementsByClassName("e-chart").length;this.element.id="chart_"+this.chartid+"_"+e}this.svgId=this.stockChart?this.stockChart.element.id+"_stockChart_chart":this.element.id+(this.enableCanvas?"_canvas":"_svg")},o.prototype.render=function(){var e=this;this.svgRenderer=new i.SvgRenderer(this.element.id);var t={chart:this.isBlazor?{}:this,theme:this.theme,name:"load",cancel:!1};this.stockChart?(this.isRtlEnabled="rtl"===window.getComputedStyle(document.querySelector("body")).direction,this.cartesianChartRendering(t)):this.trigger("load",t,function(){t.cancel||e.cartesianChartRendering(t)})},o.prototype.cartesianChartRendering=function(e){this.theme=this.isBlazor?e.theme:this.theme,this.createChartSvg(),this.setTheme(),this.markerRender=new cr(this),this.calculateAreaType(),this.calculateVisibleSeries(),this.initTechnicalIndicators(),this.initTrendLines(),this.calculateVisibleAxis(),this.processData(),this.renderComplete(),this.allowServerDataBinding=!0},o.prototype.getLocalizedLabel=function(e){return this.localeObject.getConstant(e)},o.prototype.animate=function(e){this.redraw=!0,this.animated=!0,this.duration=e||1e3},o.prototype.refreshBound=function(){if(this.rotatedDataLabelCollections=[],this.legendModule&&this.legendSettings.visible&&this.legendModule.getLegendOptions(this.visibleSeries,this),this.tooltip.enable&&this.tooltipModule&&(this.tooltipModule.previousPoints=[]),this.calculateStackValues(),this.calculateBounds(),this.stockChart&&!this.stockChart.rangeFound&&(this.stockChart.enablePeriodSelector||this.stockChart.enableSelector))return null;this.renderElements(),m("chartmeasuretext"),this.removeSelection()},o.prototype.calculateStackValues=function(){for(var e,t=!1,i=0,r=this.visibleSeries.length;i<r;i++)(e=this.visibleSeries[i]).position=e.rectCount=void 0,-1===e.type.indexOf("Stacking")&&(-1===e.drawType.indexOf("Stacking")||"PolarRadar"!==this.chartAreaType)||t||(e.calculateStackedValue(e.type.indexOf("100")>-1,this),t=!0)},o.prototype.removeSelection=function(){for(var e=0,t=this.visibleSeries;e<t.length;e++){var r=t[e];if(r.visible)for(var o=0,n=r.points;o<n.length;o++)n[o].isSelect=!1}he(this.element.id+"_ej2_drag_multi_group")?(this.selectionMode.indexOf("Drag")>-1&&(this.selectionModule.filterArray=[]),m(this.element.id+"_ej2_drag_multi_group"),this.selectionModule.calculateDragSelectedElements(this,new i.Rect(0,0,0,0),!0)):he(this.element.id+"_ej2_drag_group")&&("Lasso"!==this.selectionMode&&(this.selectionModule.filterArray=[]),m(this.element.id+"_ej2_drag_group"),this.selectionModule.calculateDragSelectedElements(this,new i.Rect(0,0,0,0),!0))},o.prototype.renderElements=function(){this.renderBorder(),this.renderTitle(),this.renderAreaBorder(),this.renderSeriesElements(this.renderAxes()),this.renderLegend(),this.applyZoomkit(),this.performSelection(),this.setSecondaryElementPosition();for(var e=0,i=this.visibleSeries;e<i.length;e++){var r=i[e];t.updateBlazorTemplate(this.element.id+"_DataLabel","Template",r.marker.dataLabel)}this.renderAnnotation()},o.prototype.renderAxes=function(){this.yAxisElements=this.renderer.createGroup({id:this.element.id+"yAxisCollection"});var e;return this.rows.length>0&&this.columns.length>0&&(e=this.chartAxisLayoutPanel.renderAxes()),this.stripLineModule&&this.stripLineModule.renderStripLine(this,"Behind",this.axisCollections),e},o.prototype.renderLegend=function(){if(this.legendModule&&this.legendModule.legendCollections.length&&this.legendSettings.visible){this.legendModule.calTotalPage=!0;var e=this.legendSettings.border.width,t=this.legendModule.legendBounds,r=new i.Rect(t.x,t.y,t.width,t.height);this.enableCanvas&&(r=new i.Rect(r.x-e/2,r.y-e/2,r.width+e,r.height+e),this.renderer.canvasClip(r)),this.legendModule.renderLegend(this,this.legendSettings,t),this.enableCanvas&&this.renderer.canvasRestore()}this.redraw||(this.stockChart?he(this.stockChart.chartObject.id)||this.stockChart.mainObject.appendChild(this.svgObject):this.element.appendChild(this.svgObject))},o.prototype.setSecondaryElementPosition=function(){var e=he(this.element.id+"_Secondary_Element");if(e){var t=this.element.getBoundingClientRect(),i=he(this.svgId).getBoundingClientRect();e.style.left=Math.max(i.left-t.left,0)+"px",e.style.top=Math.max(i.top-t.top,0)+"px"}},o.prototype.initializeModuleElements=function(){this.dataLabelCollections=[];var e=this.element.id;this.series.length&&(this.seriesElements="Scatter"===this.series[0].type||"Bubble"===this.series[0].type?this.svgRenderer.createGroup({id:e+"SeriesCollection"}):this.renderer.createGroup({id:e+"SeriesCollection"})),this.indicators.length&&(this.indicatorElements=this.renderer.createGroup({id:e+"IndicatorCollection"})),this.hasTrendlines()&&(this.trendLineElements=this.renderer.createGroup({id:e+"TrendLineCollection"})),this.dataLabelElements=this.renderer.createGroup({id:e+"DataLabelCollection"})},o.prototype.hasTrendlines=function(){for(var e,t=0,i=this.series;t<i.length&&!(e=!!i[t].trendlines.length);t++);return e},o.prototype.renderSeriesElements=function(e){this.initializeModuleElements();var t=this.element.id;if("g"!==this.element.tagName){var i=Fe(this.redraw,t+"_Secondary_Element")||this.createElement("div");i.id=t+"_Secondary_Element",i.setAttribute("style","position: relative"),be(!1,this.element,i,this.redraw)}if(this.enableCanvas){var r=document.getElementById(t+"_Secondary_Element");r=r||this.createElement("div",{id:t+"_Secondary_Element",attrs:{style:"position: relative; left:0px; top:0px"}});var o=this.svgRenderer.createSvg({id:t+"_tooltip_svg",width:this.availableSize.width,height:this.availableSize.height});o.setAttribute("style","position: absolute; pointer-events: none"),r.appendChild(o)}this.tooltip.enable&&be(this.enableCanvas,this.svgObject,this.renderer.createGroup({id:t+"_UserInteraction",style:"pointer-events:none;"}),this.redraw),this.rows.length>0&&this.columns.length>0&&(this.initializeIndicator(),this.initializeTrendLine(),this.renderSeries(),this.trendLineElements&&be(this.enableCanvas,this.svgObject,this.trendLineElements,this.redraw),this.appendElementsAfterSeries(e))},o.prototype.renderSeries=function(){this.enableCanvas&&this.renderer.canvasClip(this.chartAxisLayoutPanel.seriesClipRect);for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];("TrendLine"===i.category?this.series[i.sourceIndex].trendlines[i.index].visible:i.visible)&&(this.visible++,Y(i),this.enableCanvas&&this.renderCanvasSeries(i),i.renderSeries(this),this.enableCanvas&&this.renderer.canvasRestore())}this.visible=0;var r={id:this.element.id+"_ChartAreaClipRect_",x:this.chartAxisLayoutPanel.seriesClipRect.x,y:this.chartAxisLayoutPanel.seriesClipRect.y,width:this.chartAxisLayoutPanel.seriesClipRect.width,height:this.chartAxisLayoutPanel.seriesClipRect.height,fill:"transparent","stroke-width":1,stroke:"Gray"};if(this.seriesElements){this.enableCanvas||this.seriesElements.appendChild(K(this.redraw,r,this.renderer));var o=document.getElementById(this.element.id+"_series_svg");o?be(!1,o,this.seriesElements,this.redraw):be(this.enableCanvas,this.svgObject,this.seriesElements,this.redraw)}},o.prototype.renderCanvasSeries=function(e){var t,i;if("Bubble"===e.type||"Scatter"===e.type){t=t||this.svgRenderer.createSvg({id:this.element.id+"_series_svg",width:this.availableSize.width,height:this.availableSize.height}),(i=i||this.createElement("div",{id:this.element.id+"_series"})).setAttribute("style","position: absolute");var r=document.getElementById(this.element.id+"_Secondary_Element");i.appendChild(t),r.appendChild(i)}t=!this.enableCanvas||"Bubble"!==e.type&&"Scatter"!==e.type?this.svgObject:t;(!this.enableCanvas||"Bubble"!==e.type&&"Scatter"!==e.type)&&this.enableCanvas},o.prototype.initializeIndicator=function(){for(var e=0,t=this.indicators;e<t.length;e++){var i=t[e];this[G(i.type)+"IndicatorModule"]&&this[G(i.type)+"IndicatorModule"].createIndicatorElements(this,i,i.index)}this.indicatorElements&&be(this.enableCanvas,this.svgObject,this.indicatorElements,this.redraw)},o.prototype.initializeTrendLine=function(){for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];i.trendlines.length&&this.trendLineModule.getTrendLineElements(i,this)}},o.prototype.appendElementsAfterSeries=function(e){"PolarRadar"===this.chartAreaType&&be(this.enableCanvas,this.svgObject,this.yAxisElements,this.redraw),be(this.enableCanvas,this.svgObject,e,this.redraw),(this.zoomModule&&this.zoomSettings.enableScrollbar&&this.scrollElement.childElementCount||this.scrollElement&&this.scrollElement.childElementCount)&&be(!1,he(this.element.id+"_Secondary_Element"),this.scrollElement,this.redraw),this.stripLineModule&&this.stripLineModule.renderStripLine(this,"Over",this.axisCollections),this.tooltip.enable||be(this.enableCanvas,this.svgObject,this.renderer.createGroup({id:this.element.id+"_UserInteraction",style:"pointer-events:none;"}),this.redraw),this.stockChart&&this.stockChart.calculateStockEvents()},o.prototype.applyZoomkit=function(){"PolarRadar"!==this.chartAreaType&&(this.redraw||!this.zoomModule||this.zoomSettings.enablePan&&!this.zoomModule.performedUI||this.zoomModule.applyZoomToolkit(this,this.axisCollections))},o.prototype.renderAnnotation=function(){this.annotationModule&&this.annotationModule.renderAnnotations(he((this.stockChart?this.stockChart.element.id:this.element.id)+"_Secondary_Element"))},o.prototype.performSelection=function(){var e=[];this.selectionModule&&(e=t.extend([],this.selectionModule.selectedDataIndexes,null,!0),this.selectionModule.invokeSelection(this)),this.highlightModule&&this.highlightModule.invokeHighlight(this),e.length>0&&(this.selectionModule.selectedDataIndexes=e,this.selectionModule.redrawSelection(this,this.selectionMode))},o.prototype.processData=function(e){void 0===e&&(e=!0),this.visibleSeriesCount=0;for(var t=!0,i=0,r=this.visibleSeries;i<r.length;i++){var o=r[i];o.visible||this.legendSettings.visible?"Indicator"!==o.category&&"TrendLine"!==o.category&&this.initializeDataModule(o):this.visibleSeriesCount++}for(var n=0,a=this.indicators;n<a.length;n++){var s=a[n];if(s.dataSource){var l=s;this.initializeDataModule(l),t=!1}}e&&(!this.visibleSeries.length||this.visibleSeriesCount===this.visibleSeries.length&&t)&&(this.refreshBound(),this.trigger("loaded",{chart:this.isBlazor?{}:this}))},o.prototype.initializeDataModule=function(e){e.xData=[],e.yData=[];var t;t=this.isAngular?Object.keys(e.dataSource).length?e.dataSource:this.dataSource:e.dataSource||this.dataSource,e.dataModule=new ar(t,e.query),e.points=[],e.refreshDataManager(this)},o.prototype.calculateBounds=function(){var e=this.margin,t=0,r=0,o=0,n=e.left,a=this.availableSize.width-n-e.right-this.border.width;if(this.titleCollection=[],this.subTitleCollection=[],this.title&&(this.titleCollection=Xe(this.title,this.titleStyle,a),t=i.measureText(this.title,this.titleStyle).height*this.titleCollection.length+15,this.subTitle)){for(var s=0,l=0,h=this.titleCollection;l<h.length;l++){var c=h[l];s=(o=i.measureText(c,this.titleStyle).width)>s?o:s}this.subTitleCollection=Xe(this.subTitle,this.subTitleStyle,s),r=i.measureText(this.subTitle,this.subTitleStyle).height*this.subTitleCollection.length+15}var d=e.top+r+t+.5*this.chartArea.border.width,p=this.availableSize.height-d-this.border.width-e.bottom;this.stockChart&&this.stockChart.legendSettings.visible&&this.stockChart.stockLegendModule&&("Top"===this.stockChart.legendSettings.position?d+=this.stockChart.stockLegendModule.legendBounds.height:"Left"===this.stockChart.legendSettings.position&&(n+=this.stockChart.stockLegendModule.legendBounds.width)),this.initialClipRect=new i.Rect(n,d,a,p),this.legendModule&&this.legendSettings.visible&&this.legendModule.calculateLegendBounds(this.initialClipRect,this.availableSize,null),this.chartAxisLayoutPanel.measureAxis(this.initialClipRect)},o.prototype.print=function(e){new xr(this).print(e)},o.prototype.initTrendLines=function(){this.isProtectedOnChange=!0;for(var e=0,t=this.visibleSeries;e<t.length;e++)for(var i=t[e],r=0,o=0,n=i.trendlines;o<n.length;o++){var a=n[o];this.trendLineModule&&(a.index=r,a.sourceIndex=i.index,this.trendLineModule.initSeriesCollection(a,this),a.targetSeries&&(a.targetSeries.xAxisName=i.xAxisName,a.targetSeries.yAxisName=i.yAxisName,this.visibleSeries.push(a.targetSeries))),r++}this.isProtectedOnChange=!1},o.prototype.calculateAreaType=function(){var e=this.series[0];this.chartArea.border.width=this.stockChart?0:this.chartArea.border.width,e&&(this.requireInvertedAxis=-1!==e.type.indexOf("Bar")&&!this.isTransposed||-1===e.type.indexOf("Bar")&&this.isTransposed&&"PolarRadar"!==this.chartAreaType),this.chartAxisLayoutPanel="PolarRadar"===this.chartAreaType?this.polarSeriesModule||this.radarSeriesModule:new Ui(this)},o.prototype.calculateVisibleAxis=function(){var e,t=[this.primaryXAxis,this.primaryYAxis];t="Cartesian"===this.chartAreaType?t.concat(this.axes):t,this.paretoSeriesModule&&"Pareto"===this.series[0].type&&(t=t.concat(this.paretoSeriesModule.paretoAxes)),this.axisCollections=[],this.zoomModule&&(this.zoomModule.isPanning=this.zoomModule.isAxisZoomed(t)&&this.zoomSettings.enablePan,this.svgObject.setAttribute("cursor",this.zoomModule.isPanning?"pointer":"auto"),this.scrollBarModule&&(this.scrollBarModule.axes=t)),this.scrollSettingEnabled&&this.scrollBarModule&&(this.scrollBarModule.axes=t);for(var i=0,r=t.length;i<r;i++){(e=t[i]).series=[],e.labels=[];for(var o=0,n=this.visibleSeries;o<n.length;o++){var a=n[o];this.initAxis(a,e,!0)}for(var s=0,l=this.indicators;s<l.length;s++){var h=l[s];this.initAxis(h,e,!1)}this.scrollBarModule&&!e.zoomingScrollBar&&this.scrollBarModule.injectTo(e,this),null!=e.orientation&&this.axisCollections.push(e)}this.rows.length>0&&this.columns.length>0&&this.chartAxisLayoutPanel.measure()},o.prototype.initAxis=function(e,t,i){e.xAxisName===t.name||null==e.xAxisName&&"primaryXAxis"===t.name?(t.orientation=this.requireInvertedAxis?"Vertical":"Horizontal",e.xAxis=t,i&&t.series.push(e)):(e.yAxisName===t.name||null==e.yAxisName&&"primaryYAxis"===t.name)&&(t.orientation=this.requireInvertedAxis?"Horizontal":"Vertical",e.yAxis=t,i&&t.series.push(e))},o.prototype.initTechnicalIndicators=function(){for(var e=0,t=0,i=this.indicators;t<i.length;t++){var r=i[t],o=r,n=G(o.type);if(this[n+"IndicatorModule"]){o.index=e,this[n+"IndicatorModule"].initSeriesCollection(o,this);for(var a=0,s=o.targetSeries;a<s.length;a++){var l=s[a];(r.seriesName||r.dataSource)&&this.visibleSeries.push(l)}}e++}},o.prototype.refreshTechnicalIndicator=function(e){if(this.indicators.length){if(e instanceof nr&&"Indicator"!==e.category)for(var t=0,i=this.indicators;t<i.length;t++){var r=i[t];r.seriesName!==e.name||r.dataSource||r.setDataSource(e,this)}else e instanceof br&&e.setDataSource(e instanceof nr?e:null,this)}},o.prototype.calculateVisibleSeries=function(){var e;this.visibleSeries=[];for(var t=this.palettes.length?this.palettes:h(this.theme),i=t.length,r=this.series.sort(function(e,t){return e.zOrder-t.zOrder}),o=0,n=r.length;o<n;o++){switch(e=r[o],e.category="Pareto"===r[0].type?"Pareto":"Series",e.index=o,e.interior=e.fill||t[o%i],e.type){case"Bar":case"StackingBar":case"StackingBar100":if(-1===r[0].type.indexOf("Bar"))continue;break;case"Polar":case"Radar":if("PolarRadar"!==this.chartAreaType)continue;if("PolarRadar"===this.chartAreaType&&(null===e.xAxisName&&null!==e.yAxisName||null!==e.xAxisName&&null===e.yAxisName||null!==e.xAxisName&&null!==e.yAxisName))continue;break;case"Pareto":this.visibleSeries.push(e),this.paretoSeriesModule.initSeries(e,this);continue;default:if("PolarRadar"===this.chartAreaType||r[0].type.indexOf("Bar")>-1)continue}this.visibleSeries.push(e),r[o]=e}},o.prototype.renderTitle=function(){var e,t=this.margin;if(this.title){var r=this.titleStyle.textAlignment,o="Near"===r?"start":"Far"===r?"end":"middle",n=i.measureText(this.title,this.titleStyle);e=new i.Rect(t.left,0,this.availableSize.width-t.left-t.right,0);var a=new i.TextOption(this.element.id+"_ChartTitle",Ye(e,this.titleStyle),this.margin.top+3*n.height/4,o,this.titleCollection,"","auto"),s=Fe(this.redraw,this.element.id+"_ChartTitle",a,this.renderer)||Ve(this.renderer,a,this.titleStyle,this.titleStyle.color||this.themeStyle.chartTitle,this.svgObject,null,null,null,null,null,null,null,null,this.enableCanvas);s&&(s.setAttribute("aria-label",this.description||this.title),s.setAttribute("tabindex",this.tabIndex.toString())),this.subTitle&&this.renderSubTitle(a)}},o.prototype.renderSubTitle=function(e){for(var t=0,r=0,o=this.titleStyle.textAlignment,n=0,a=this.titleCollection;n<a.length;n++){var s=a[n];t=(r=i.measureText(s,this.titleStyle).width)>t?r:t}var l=i.measureText(this.subTitle,this.subTitleStyle),h=new i.Rect("Center"===o?e.x-.5*t:"Far"===o?e.x-t:e.x,0,t,0),c=new i.TextOption(this.element.id+"_ChartSubTitle",Ye(h,this.subTitleStyle),e.y*e.text.length+3*l.height/4+10,function(e){return"Near"===e?"start":"Far"===e?"end":"middle"}(this.subTitleStyle.textAlignment),this.subTitleCollection,"","auto"),d=Fe(this.redraw,this.element.id+"_ChartSubTitle",c,this.renderer)||Ve(this.renderer,c,this.subTitleStyle,this.subTitleStyle.color||this.themeStyle.chartTitle,this.svgObject,null,null,null,null,null,null,null,null,this.enableCanvas);d&&(d.setAttribute("aria-label",this.description||this.subTitle),d.setAttribute("tabindex",this.tabIndex.toString()))},o.prototype.renderBorder=function(){if(!this.stockChart){var e=this.border.width,t=this.backgroundImage,r=t?"transparent":this.background||this.themeStyle.background,o=new Di(this.element.id+"_ChartBorder",r,this.border,1,new i.Rect(.5*e,.5*e,this.availableSize.width-e,this.availableSize.height-e));if(this.htmlObject=Fe(this.redraw,this.element.id+"_ChartBorder",o,this.renderer)||this.renderer.drawRectangle(o),be(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw),t){var n=new Bi(this.availableSize.height-e,this.availableSize.width-e,t,0,0,this.element.id+"_ChartBackground","visible","none");this.htmlObject=Fe(this.redraw,this.element.id+"_ChartBackground",n,this.renderer)||this.renderer.drawImage(n),be(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw)}}},o.prototype.renderAreaBorder=function(){if("PolarRadar"===this.chartAreaType)return null;var e=he(this.element.id+"_ChartAreaBorder"),t=e?new i.Rect(+e.getAttribute("x"),+e.getAttribute("y"),+e.getAttribute("width"),+e.getAttribute("height")):null,r=new Di(this.element.id+"_ChartAreaBorder",this.chartArea.background,{width:this.chartArea.border.width,color:this.chartArea.border.color||this.themeStyle.areaBorder},this.chartArea.opacity,this.chartAxisLayoutPanel.seriesClipRect);this.htmlObject=this.renderer.drawRectangle(r),be(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw,!0,"x","y",null,null,!0,!0,t),this.htmlObject=null;var o=this.chartArea.backgroundImage;if(o){var n=this.chartArea.border.width,a=new Bi(this.initialClipRect.height-n,this.initialClipRect.width-n,o,this.initialClipRect.x,this.initialClipRect.y,this.element.id+"_ChartAreaBackground","visible","none");this.htmlObject=this.renderer.drawImage(a),be(this.enableCanvas,this.svgObject,this.htmlObject,this.redraw,!0,"x","y",null,null,!0,!0)}},o.prototype.addSeries=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r=new nr(this,"series",r),this.series.push(r)}this.refresh()},o.prototype.removeSeries=function(e){this.redraw=!1,this.series.splice(e,1),this.refresh()},o.prototype.clearSeries=function(){this.series=[],this.refresh()},o.prototype.addAxes=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r=new ki(this,"axes",r),this.isBlazor&&(r.interval=isNaN(r.interval)?null:r.interval,r.desiredIntervals=isNaN(r.desiredIntervals)?null:r.desiredIntervals),this.axes.push(r)}this.refresh()},o.prototype.removeAxis=function(e){this.redraw=!1,this.axes.splice(e,1),this.refresh()},o.prototype.destroy=function(){this.scrollBarModule&&this.scrollBarModule.destroy(),this.markerRender&&(this.markerRender.removeEventListener(),this.markerRender=null),this.horizontalAxes=[],this.verticalAxes=[],this.visibleSeries=[],this.axisCollections=[],this.rotatedDataLabelCollections=[],this.seriesElements=null,this.chartAxisLayoutPanel=null,this.dataLabelCollections=null,this.dataLabelElements=null,this.yAxisElements=null,this.element&&(this.unWireEvents(),this.isReact&&this.clearTemplate(),r.prototype.destroy.call(this),this.enableCanvas||(this.removeSvg(),this.svgObject=null))},o.prototype.getModuleName=function(){return"chart"},o.prototype.getPersistData=function(){var e=["loaded","animationComplete","primaryXAxis","primaryYAxis"];return this.addOnPersist(e)},o.prototype.createChartSvg=function(){this.removeSvg(),He(this)},o.prototype.unWireEvents=function(){var e=t.Browser.touchStartEvent,i=t.Browser.touchMoveEvent,r=t.Browser.touchEndEvent,o=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,e,this.chartOnMouseDown),t.EventHandler.remove(this.element,i,this.mouseMove),t.EventHandler.remove(this.element,r,this.mouseEnd),t.EventHandler.remove(this.element,"click",this.chartOnMouseClick),t.EventHandler.remove(this.element,"contextmenu",this.chartRightClick),t.EventHandler.remove(this.element,o,this.mouseLeave),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.touchObject&&(this.touchObject.destroy(),this.touchObject=null)},o.prototype.wireEvents=function(){if(this.element){var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.chartOnMouseDown,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMove,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEnd,this),t.EventHandler.add(this.element,"click",this.chartOnMouseClick,this),t.EventHandler.add(this.element,"contextmenu",this.chartRightClick,this),t.EventHandler.add(this.element,e,this.mouseLeave,this),this.resizeBound=this.chartResize.bind(this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.longPressBound=this.longPress.bind(this),this.touchObject=new t.Touch(this.element,{tapHold:this.longPressBound,tapHoldThreshold:500}),this.setStyle(this.element)}},o.prototype.chartRightClick=function(e){return!this.crosshair.enable||!this.crosshairModule||2!==e.buttons&&0!==e.which&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},o.prototype.setStyle=function(e){var t=this.zoomSettings,i=t.enableSelectionZooming||t.enablePinchZooming||"None"!==this.selectionMode||this.crosshair.enable||"None"!==this.highlightMode;e.style.touchAction=i?"none":"element",e.style.msTouchAction=i?"none":"element",e.style.msContentZooming="none",e.style.msUserSelect="none",e.style.webkitUserSelect="none",e.style.position="relative",e.style.display="block",e.style.overflow="hidden"},o.prototype.isOrientation=function(){return"orientation"in window&&"onorientationchange"in window},o.prototype.longPress=function(e){return this.mouseX=e&&e.originalEvent.changedTouches?e.originalEvent.changedTouches[0].clientX:0,this.mouseY=e&&e.originalEvent.changedTouches?e.originalEvent.changedTouches[0].clientY:0,this.startMove=!0,this.setMouseXY(this.mouseX,this.mouseY),this.notify("tapHold",e),!1},o.prototype.setMouseXY=function(e,t){if(he(this.svgId)){var i=he(this.svgId).getBoundingClientRect(),r=this.element.getBoundingClientRect();this.mouseY=t-r.top-Math.max(i.top-r.top,0),this.mouseX=e-r.left-Math.max(i.left-r.left,0)}},o.prototype.export=function(e,t){this.exportModule&&(this.exportModule.export(e,t),this.afterExport&&this.exportModule.getDataUrl(this))},o.prototype.chartResize=function(){var e=this;this.animateSeries=!1;var t={chart:this.isBlazor?{}:this,name:"resized",currentSize:new i.Size(0,0),previousSize:new i.Size(this.availableSize.width,this.availableSize.height)},r={name:"beforeResize",cancelResizedEvent:!1};return this.resizeTo&&clearTimeout(this.resizeTo),this.trigger("beforeResize",r),r.cancelResizedEvent||(this.resizeTo=+setTimeout(function(){if(e.isDestroyed||e.stockChart)return void clearTimeout(e.resizeTo);e.createChartSvg(),t.currentSize=e.availableSize,e.trigger("resized",t),e.refreshAxis(),e.refreshBound(),e.trigger("loaded",{chart:e.isBlazor?{}:e})},500)),!1},o.prototype.mouseMove=function(e){var t,i,r;return"touchmove"===e.type?(this.isTouch=!0,t=(r=e).changedTouches[0].clientX,i=r.changedTouches[0].clientY):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType||this.isTouch,t=e.clientX,i=e.clientY),he(this.svgId)&&(this.setMouseXY(t,i),this.chartOnMouseMove(e)),!1},o.prototype.mouseLeave=function(e){var t,i,r;return"touchleave"===e.type?(this.isTouch=!0,t=(r=e).changedTouches[0].clientX,i=r.changedTouches[0].clientY):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType,t=e.clientX,i=e.clientY),this.setMouseXY(t,i),this.chartOnMouseLeave(e),!1},o.prototype.chartOnMouseLeave=function(e){var i=e.target,r=t.Browser.isPointer?"pointerleave":"mouseleave";return this.trigger("chartMouseLeave",{target:i.id,x:this.mouseX,y:this.mouseY}),m(this.element.id+"_EJ2_AxisLabel_Tooltip"),this.isChartDrag=this.isPointMouseDown=!1,this.notify(r,e),!1},o.prototype.chartOnMouseClick=function(e){var t=this,i=e.target;this.trigger("chartMouseClick",{target:i.id,x:this.mouseX,y:this.mouseY}),this.clickCount++;var r=0;if(this.isAngular){r=this.pointDoubleClick.observers.length>0?400:0}else r=this.pointDoubleClick?400:0;return 1===this.clickCount&&this.pointClick?this.singleClickTimer=+setTimeout(function(){t.clickCount=0,t.triggerPointEvent("pointClick",e)},r):2===this.clickCount&&this.pointDoubleClick&&(clearTimeout(this.singleClickTimer),this.clickCount=0,this.triggerPointEvent("pointDoubleClick",e)),this.axisLabelClick&&this.triggerAxisLabelClickEvent("axisLabelClick",e),this.notify("click",e),!1},o.prototype.triggerPointEvent=function(e,t){var i=t,r=new Zi(this).getData();r.series&&r.point&&this.trigger(e,{series:this.isBlazor?{}:r.series,point:r.point,seriesIndex:r.series.index,pointIndex:r.point.index,x:this.mouseX,y:this.mouseY,pageX:i.pageX,pageY:i.pageY})},o.prototype.triggerAxisLabelClickEvent=function(e,t){var i=t.target,r=t;if(-1!==i.id.indexOf("_AxisLabel_")){var o=i.id.split("_AxisLabel_"),n=+o[0].slice(-1),a=+o[1],s=this.axisCollections[n];!s.visible||0!==n&&1!==n||this.trigger(e,{chart:this,axis:s,text:s.visibleLabels[a].text,labelID:i.id,index:a,location:new Vi(r.pageX,r.pageY),value:s.visibleLabels[a].value})}},o.prototype.chartOnMouseMove=function(e){var i=e.target;return this.trigger("chartMouseMove",{target:i.id,x:this.mouseX,y:this.mouseY}),this.pointMove&&this.triggerPointEvent("pointMove",e),this.isTouch||(this.titleTooltip(e,this.mouseX,this.mouseY),this.axisTooltip(e,this.mouseX,this.mouseY)),this.dataEditingModule&&this.dataEditingModule.pointMouseMove(e),this.notify(t.Browser.touchMoveEvent,e),this.isTouch=!1,!1},o.prototype.titleTooltip=function(e,t,i,r){var o=e.target.id,n=o===this.element.id+"_ChartTitle"||o===this.element.id+"_ChartSubTitle"||o.indexOf("_AxisTitle")>-1||o.indexOf("_legend_title")>-1,a=0;o.indexOf("_AxisTitle")>-1&&(a=parseInt(o.replace(this.element.id,"").replace("AxisLabel_","").split("_")[2],10)),n&&e.target.textContent.indexOf("...")>-1?f(o===this.element.id+"_ChartTitle"?this.title:o.indexOf("_AxisTitle")>-1?this.axisCollections[a].title:o.indexOf("_ChartSubTitle")>-1?this.subTitle:this.legendSettings.title,t,i,this.element.offsetWidth,this.element.id+"_EJ2_Title_Tooltip",he(this.element.id+"_Secondary_Element"),r):m(this.element.id+"_EJ2_Title_Tooltip")},o.prototype.axisTooltip=function(e,t,i,r){var o=e.target.id;if((o.indexOf("AxisLabel")>-1||o.indexOf("Axis_MultiLevelLabel")>-1)&&e.target.textContent.indexOf("...")>-1){var n=this.legendSettings.visible||""===this.primaryXAxis.title;f(this.findAxisLabel(o),t,i,this.element.offsetWidth,this.element.id+"_EJ2_AxisLabel_Tooltip",he(this.element.id+"_Secondary_Element"),r,n)}else m(this.element.id+"_EJ2_AxisLabel_Tooltip")},o.prototype.findAxisLabel=function(e){var t;return e.indexOf("AxisLabel")>-1?(t=e.replace(this.element.id,"").replace("AxisLabel_","").split("_"),this.axisCollections[parseInt(t[0],10)].visibleLabels[parseInt(t[1],10)].originalText):(t=e.replace(this.element.id,"").replace("Axis_MultiLevelLabel_Level_","").replace("Text_","").split("_"),this.axisCollections[parseInt(t[0],10)].multiLevelLabels[parseInt(t[1],10)].categories[parseInt(t[2],10)].text)},o.prototype.chartOnMouseDown=function(e){var i,r,o,n,a=t.Browser.isDevice?20:30,s=this.element.getBoundingClientRect(),l=e.target;this.trigger("chartMouseDown",{target:l.id,x:this.mouseX,y:this.mouseY}),"touchstart"===e.type?(this.isTouch=!0,i=(n=e).changedTouches[0].clientX,r=n.changedTouches[0].clientY,o=n.target):(this.isTouch="touch"===e.pointerType,i=e.clientX,r=e.clientY,o=e.target);var h=he(this.svgId).getBoundingClientRect();return this.mouseDownX=this.previousMouseMoveX=i-s.left-Math.max(h.left-s.left,0),this.mouseDownY=this.previousMouseMoveY=r-s.top-Math.max(h.top-s.top,0),this.isTouch&&(this.isDoubleTap=(new Date).getTime()<this.threshold&&-1===o.id.indexOf(this.element.id+"_Zooming_")&&(this.mouseDownX-a>=this.mouseX||this.mouseDownX+a>=this.mouseX)&&(this.mouseDownY-a>=this.mouseY||this.mouseDownY+a>=this.mouseY)&&(this.mouseX-a>=this.mouseDownX||this.mouseX+a>=this.mouseDownX)&&(this.mouseY-a>=this.mouseDownY||this.mouseY+a>=this.mouseDownY)),this.dataEditingModule&&this.dataEditingModule.pointMouseDown(),this.notify(t.Browser.touchStartEvent,e),!1},o.prototype.mouseEnd=function(e){var t,i,r;return"touchend"===e.type?(i=(r=e).changedTouches[0].clientX,this.isTouch=!0,t=r.changedTouches[0].clientY):(t=e.clientY,i=e.clientX,this.isTouch="touch"===e.pointerType||"2"===e.pointerType),this.setMouseXY(i,t),this.chartOnMouseUp(e),!1},o.prototype.chartOnMouseUp=function(e){var i=e.target;return this.trigger("chartMouseUp",{target:i.id,x:this.mouseX,y:this.mouseY}),this.isChartDrag=!1,this.isTouch&&(this.titleTooltip(e,this.mouseX,this.mouseY,this.isTouch),this.axisTooltip(e,this.mouseX,this.mouseY,this.isTouch),this.threshold=(new Date).getTime()+300),this.dataEditingModule&&this.dataEditingModule.pointMouseUp(),!this.enableCanvas&&this.seriesElements&&this.seriesElements.removeAttribute("clip-path"),this.notify(t.Browser.touchEndEvent,e),!1},o.prototype.setCulture=function(){this.intl=new t.Internationalization,this.setLocaleConstants(),this.localeObject=new t.L10n(this.getModuleName(),this.defaultLocalConstants,this.locale)},o.prototype.setAnnotationValue=function(e,t){var i,r=he(this.element.id+"_Annotation_Collections"),o=this.annotations[e];null!==t&&(o.content=t,r?(m(this.element.id+"_Annotation_"+e),i=this.createElement("div"),this.annotationModule.processAnnotation(o,e,i),r.appendChild(i.children[0])):this.annotationModule.renderAnnotations(he(this.element.id+"_Secondary_Element")))},o.prototype.setLocaleConstants=function(){this.defaultLocalConstants={ZoomIn:"Zoom in",Zoom:"Zoom",ZoomOut:"Zoom out",Pan:"Pan",Reset:"Reset",ResetZoom:"Reset Zoom"}},o.prototype.setTheme=function(){this.themeStyle=c(this.theme)},o.prototype.requiredModules=function(){var e,t=this,i=[],r=this.series,o=!1,n=!1,a=!1,s=!1,l=this.zoomSettings;return this.chartAreaType=r.length>0&&("Polar"===r[0].type||"Radar"===r[0].type)?"PolarRadar":"Cartesian",this.tooltip.enable&&i.push({member:"Tooltip",args:[this]}),r.map(function(o){t.isLegend=t.legendSettings.visible&&(""!==o.name||!!t.isLegend),e=-1!==o.type.indexOf("100")?o.type.replace("100","")+"Series":o.type+"Series",n=o.errorBar.visible||n,s=o.marker.dataLabel.visible||s,a=o.dragSettings.enable||a,i.some(function(t){return t.member===e})||i.push({member:e,args:[t,r]}),"PolarRadar"===t.chartAreaType&&i.push({member:o.drawType+"Series",args:[t,r]}),"Pareto"===o.type&&(i.push({member:"ColumnSeries",args:[t,r]}),i.push({member:"LineSeries",args:[t,r]}))}),this.findIndicatorModules(i),this.findTrendLineModules(i),i=this.findAxisModule(i),o=this.annotations.some(function(e){return null!==e.content}),n&&i.push({member:"ErrorBar",args:[this,r]}),this.isLegend&&i.push({member:"Legend",args:[this]}),(this.enableExport||this.allowExport)&&i.push({member:"Export",args:[this]}),"PolarRadar"!==this.chartAreaType&&!this.scrollSettingEnabled&&(l.enableSelectionZooming||l.enableMouseWheelZooming||l.enablePinchZooming||l.enablePan||l.enableScrollbar)&&(i.push({member:"Zoom",args:[this,this.zoomSettings]}),l.enableScrollbar&&i.push({member:"ScrollBar",args:[this]})),"None"===this.selectionMode||"PolarRadar"===this.chartAreaType&&this.selectionMode.indexOf("Drag")>-1||i.push({member:"Selection",args:[this]}),"None"!==this.highlightMode&&i.push({member:"Highlight",args:[this]}),s&&i.push({member:"DataLabel",args:[this,r]}),a&&i.push({member:"DataEditing",args:[this]}),o&&i.push({member:"Annotation",args:[this]}),"PolarRadar"!==this.chartAreaType&&this.crosshair.enable&&i.push({member:"Crosshair",args:[this]}),i},o.prototype.findAxisModule=function(e){var t=[];t.push(this.primaryXAxis),t.push(this.primaryYAxis);for(var i=!1,r=!1,o=!1,n=!1,a=!1,s=!1,l=0,h=t=t.concat(this.axes);l<h.length;l++){var c=h[l];i="DateTime"===c.valueType||i,r="Category"===c.valueType||r,o="Logarithmic"===c.valueType||o,a="DateTimeCategory"===c.valueType||a,n=this.findStriplineVisibility(c.stripLines)||n,s=c.multiLevelLabels.length>0||s,this.scrollSettingEnabled=!!c.scrollbarSettings.enable||this.scrollSettingEnabled}return i&&e.push({member:"DateTime",args:[this]}),r&&e.push({member:"Category",args:[this]}),o&&e.push({member:"Logarithmic",args:[this]}),n&&e.push({member:"StripLine",args:[this]}),s&&e.push({member:"MultiLevelLabel",args:[this]}),a&&e.push({member:"DateTimeCategory",args:[this]}),this.scrollSettingEnabled&&e.push({member:"ScrollBar",args:[this]}),e},o.prototype.findIndicatorModules=function(e){var t,i,r=this.indicators;if(this.indicators.length){e.push({member:"LineSeries",args:[this]}),r.map(function(e){t=t||"Macd"===e.type,i=i||"BollingerBands"===e.type}),t&&e.push({member:"ColumnSeries",args:[this]}),i&&e.push({member:"RangeAreaSeries",args:[this]}),i&&e.push({member:"SplineRangeAreaSeries",args:[this]});for(var o=0,n=this.indicators;o<n.length;o++){var a=n[o];e.push({member:a.type+"Indicator",args:[this]})}}},o.prototype.findTrendLineModules=function(e){for(var t,i,r=this,o=0,n=this.series;o<n.length;o++)!function(o){var n;o.trendlines.map(function(e){n=n||e.marker.visible,t=!(!t&&"Linear"!==e.type&&"MovingAverage"!==e.type),i=!(!i&&t)}),n&&e.push({member:"Marker",args:[r,o]})}(n[o]);(t||i)&&e.push({member:"TrendLine",args:[this]}),t&&e.push({member:"LineSeries",args:[this]}),i&&e.push({member:"SplineSeries",args:[this]})},o.prototype.findStriplineVisibility=function(e){for(var t=!1,i=0,r=e;i<r.length;i++)if(r[i].visible){t=!0;break}return t},o.prototype.removeSvg=function(){if(this.redraw)return null;if(Ue(this),this.enableCanvas&&this.svgObject&&"CANVAS"===this.svgObject.tagName)return this.renderer.clearRect(new i.Rect(0,0,this.availableSize.width,this.availableSize.height)),this.svgObject.parentNode&&t.remove(this.svgObject),null;m(this.element.id+"_Secondary_Element"),this.isReact&&this.clearTemplate();var e=0;if(this.zoomModule&&this.zoomModule.pinchTarget&&(this.zoomModule.pinchTarget.id="",this.zoomModule.pinchTarget.setAttribute("opacity","0"),this.svgObject.appendChild(this.zoomModule.pinchTarget),e=1),!t.isNullOrUndefined(this.resizeTo)){if(this.resizeTo!==this.checkResize&&this.isBlazor&&this.element.childElementCount)for(var r=document.querySelectorAll(".e-chart"),o=0;o<r.length;o++)for(var n=r[o];n.firstChild;)t.remove(n.firstChild);this.checkResize=this.resizeTo}if(this.svgObject){for(;this.svgObject.childNodes.length>e;)this.svgObject.removeChild(this.svgObject.firstChild);this.svgObject.hasChildNodes()||!this.svgObject.parentNode||this.stockChart||t.remove(this.svgObject)}},o.prototype.refreshDefinition=function(e){for(var t=0,i=e;t<i.length;t++)i[t].axes=[]},o.prototype.refreshAxis=function(){var e=this.primaryXAxis;e.rect=new i.Rect(void 0,void 0,0,0),(e=this.primaryYAxis).isStack100=!1,e.rect=new i.Rect(void 0,void 0,0,0);for(var t=0,r=this.axes;t<r.length;t++)(e=a=r[t]).rect=new i.Rect(void 0,void 0,0,0),e.isStack100=!1;if(this.paretoSeriesModule&&"Pareto"===this.series[0].type)for(var o=0,n=this.paretoSeriesModule.paretoAxes;o<n.length;o++){var a=n[o];(e=a).rect=new i.Rect(void 0,void 0,0,0),e.isStack100=!1}},o.prototype.axisChange=function(e){return!(!e.name&&!e.valueType)&&(this.refreshDefinition(this.columns),this.refreshDefinition(this.rows),this.calculateVisibleAxis(),this.processData(),!0)},o.prototype.getVisibleSeries=function(e,t){for(var i=0,r=e;i<r.length;i++){var o=r[i];if(t===o.index)return o}return null},o.prototype.refreshLiveData=function(){this.calculateVisibleSeries(),this.initTechnicalIndicators(),this.initTrendLines(),this.refreshDefinition(this.columns),this.refreshDefinition(this.rows),this.calculateVisibleAxis(),this.processData(!1),this.isBlazor||(this.enableCanvas?this.createChartSvg():this.removeSvg(),this.refreshAxis(),this.refreshBound(),this.trigger("loaded",{chart:this.isBlazor?{}:this}))},o.prototype.removeStyles=function(){m(this.element.id+"_ej2_chart_selection"),m(this.element.id+"_ej2_chart_highlight")},o.prototype.onPropertyChanged=function(e,i){var r=!1,o=!1;if(this.animateSeries=!1,!this.delayRedraw){for(var n=0,a=Object.keys(e);n<a.length;n++)switch(a[n]){case"primaryXAxis":o=this.axisChange(e.primaryXAxis),e.primaryXAxis.edgeLabelPlacement&&(r=!0),e.primaryXAxis.crosshairTooltip||(o=!0);break;case"primaryYAxis":o=this.axisChange(e.primaryYAxis),e.primaryYAxis.edgeLabelPlacement&&(r=!0),e.primaryYAxis.crosshairTooltip||(o=!0);break;case"axes":for(var s=0,l=Object.keys(e.axes);s<l.length;s++){var h=l[s];o=o||this.axisChange(e.axes[h]),e.axes[h].crosshairTooltip||(o=!0)}break;case"height":case"width":this.createChartSvg(),o=!0;break;case"subTitle":case"title":o=!0;break;case"titleStyle":e.titleStyle&&(e.titleStyle.size||e.titleStyle.textOverflow)?o=!0:r=!0;break;case"subTitleStyle":e.subTitleStyle&&(e.subTitleStyle.size||e.subTitleStyle.textOverflow)?o=!0:r=!0;break;case"border":r=!0;break;case"dataSource":this.processData(!1),o=!0;break;case"enableCanvas":this.refresh();break;case"series":for(var c=this.series.length,d=!1,p=void 0,u=void 0,g=0;g<c;g++)p=e.series[g],this.isBlazor&&p&&(p.visible!==i.series[g].visible||p.isClosed||p.marker||p.emptyPointSettings||p.type||p.boxPlotMode||p.showMean)&&(u=!0),p&&(p.dataSource||p.query||p.errorBar||p.xName||p.yName||p.size||p.high||p.low||p.open||p.close||p.fill||p.name||p.marker||u)&&(t.extend(this.getVisibleSeries(this.visibleSeries,g),p,null,!0),d=!0);d&&(this.calculateVisibleSeries(),this.initTechnicalIndicators(),this.initTrendLines(),this.refreshDefinition(this.columns),this.refreshDefinition(this.rows),this.calculateVisibleAxis(),this.processData(!1),o=!0);break;case"indicators":o=!0;break;case"zoomSettings":(e.zoomSettings.enableScrollbar||i.zoomSettings.enableScrollbar)&&(o=!0),r=!0;break;case"background":r=!0;break;case"chartArea":e.chartArea.border&&e.chartArea.border.width&&(o=!0),r=!0;break;case"legendSettings":e.legendSettings.background&&e.legendSettings.opacity||(o=!0),r=!0;break;case"palettes":this.calculateVisibleSeries(),r=!0;break;case"selectedDataIndexes":case"selectionMode":this.selectionModule&&e.selectionMode&&-1===e.selectionMode.indexOf("Drag")&&(this.selectionModule.currentMode=this.selectionMode,this.selectionModule.styleId=this.element.id+"_ej2_chart_selection",this.selectionModule.redrawSelection(this,i.selectionMode,!0));break;case"isMultiSelect":this.selectionModule&&!e.isMultiSelect&&this.selectionModule.selectedDataIndexes.length>1&&(this.selectionModule.currentMode=this.selectionMode,this.selectionModule.styleId=this.element.id+"_ej2_chart_selection",this.selectionModule.redrawSelection(this,i.selectionMode));break;case"highlightMode":case"selectionPattern":case"highlightPattern":this.removeStyles(),r=!0;break;case"theme":this.animateSeries=!0;break;case"locale":case"currencyCode":this.isBlazor?(this.setCulture(),r=!0):this.refresh();break;case"tooltip":this.tooltipModule&&(this.tooltipModule.previousPoints=[])}!o&&r&&(this.removeSvg(),this.renderElements(),this.trigger("loaded",{chart:this.isBlazor?{}:this})),o&&(this.enableCanvas?this.createChartSvg():this.removeSvg(),this.isReact&&this.clearTemplate(),this.refreshAxis(),this.refreshBound(),this.trigger("loaded",{chart:this.isBlazor?{}:this}),this.redraw=!1,this.animated=!1)}},Sr([t.Property(null)],o.prototype,"width",void 0),Sr([t.Property(null)],o.prototype,"height",void 0),Sr([t.Property("")],o.prototype,"title",void 0),Sr([t.Property("")],o.prototype,"dataSource",void 0),Sr([t.Complex(e.Theme.chartTitleFont,Xt)],o.prototype,"titleStyle",void 0),Sr([t.Property("")],o.prototype,"subTitle",void 0),Sr([t.Complex(e.Theme.chartSubTitleFont,Xt)],o.prototype,"subTitleStyle",void 0),Sr([t.Complex({},Ut)],o.prototype,"margin",void 0),Sr([t.Complex({color:"#DDDDDD",width:0},Yt)],o.prototype,"border",void 0),Sr([t.Property(null)],o.prototype,"background",void 0),Sr([t.Complex({border:{color:null,width:.5},background:"transparent"},Wt)],o.prototype,"chartArea",void 0),Sr([t.Complex({name:"primaryXAxis"},ki)],o.prototype,"primaryXAxis",void 0),Sr([t.Complex({name:"primaryYAxis"},ki)],o.prototype,"primaryYAxis",void 0),Sr([t.Collection([{}],wi)],o.prototype,"rows",void 0),Sr([t.Collection([{}],Si)],o.prototype,"columns",void 0),Sr([t.Collection([{}],ki)],o.prototype,"axes",void 0),Sr([t.Collection([{}],nr)],o.prototype,"series",void 0),Sr([t.Collection([{}],pi)],o.prototype,"annotations",void 0),Sr([t.Property([])],o.prototype,"palettes",void 0),Sr([t.Property("Material")],o.prototype,"theme",void 0),Sr([t.Complex({},ti)],o.prototype,"tooltip",void 0),Sr([t.Complex({},Pr)],o.prototype,"crosshair",void 0),Sr([t.Complex({},gr)],o.prototype,"legendSettings",void 0),Sr([t.Collection([{}],Cr)],o.prototype,"rangeColorSettings",void 0),Sr([t.Complex({},Lr)],o.prototype,"zoomSettings",void 0),Sr([t.Property("None")],o.prototype,"selectionMode",void 0),Sr([t.Property("None")],o.prototype,"highlightMode",void 0),Sr([t.Property("None")],o.prototype,"selectionPattern",void 0),Sr([t.Property("None")],o.prototype,"highlightPattern",void 0),Sr([t.Property(!1)],o.prototype,"isMultiSelect",void 0),Sr([t.Property(!1)],o.prototype,"allowMultiSelection",void 0),Sr([t.Property(!0)],o.prototype,"enableExport",void 0),Sr([t.Property(!1)],o.prototype,"allowExport",void 0),Sr([t.Collection([],Qt)],o.prototype,"selectedDataIndexes",void 0),Sr([t.Property(!1)],o.prototype,"useGroupingSeparator",void 0),Sr([t.Property(!1)],o.prototype,"enableAutoIntervalOnBothAxis",void 0),Sr([t.Property(!1)],o.prototype,"isTransposed",void 0),Sr([t.Property(!1)],o.prototype,"enableCanvas",void 0),Sr([t.Property(null)],o.prototype,"backgroundImage",void 0),Sr([t.Collection([],br)],o.prototype,"indicators",void 0),Sr([t.Property(!0)],o.prototype,"enableAnimation",void 0),Sr([t.Property(null)],o.prototype,"description",void 0),Sr([t.Property(1)],o.prototype,"tabIndex",void 0),Sr([t.Property(!0)],o.prototype,"enableSideBySidePlacement",void 0),Sr([t.Event()],o.prototype,"resized",void 0),Sr([t.Event()],o.prototype,"beforeResize",void 0),Sr([t.Event()],o.prototype,"annotationRender",void 0),Sr([t.Event()],o.prototype,"beforePrint",void 0),Sr([t.Event()],o.prototype,"loaded",void 0),Sr([t.Event()],o.prototype,"beforeExport",void 0),Sr([t.Event()],o.prototype,"afterExport",void 0),Sr([t.Event()],o.prototype,"load",void 0),Sr([t.Event()],o.prototype,"animationComplete",void 0),Sr([t.Event()],o.prototype,"legendRender",void 0),Sr([t.Event()],o.prototype,"textRender",void 0),Sr([t.Event()],o.prototype,"pointRender",void 0),Sr([t.Event()],o.prototype,"seriesRender",void 0),Sr([t.Event()],o.prototype,"axisLabelRender",void 0),Sr([t.Event()],o.prototype,"axisLabelClick",void 0),Sr([t.Event()],o.prototype,"axisRangeCalculated",void 0),Sr([t.Event()],o.prototype,"axisMultiLabelRender",void 0),Sr([t.Event()],o.prototype,"legendClick",void 0),Sr([t.Event()],o.prototype,"multiLevelLabelClick",void 0),Sr([t.Event()],o.prototype,"tooltipRender",void 0),Sr([t.Event()],o.prototype,"sharedTooltipRender",void 0),Sr([t.Event()],o.prototype,"chartMouseMove",void 0),Sr([t.Event()],o.prototype,"chartMouseClick",void 0),Sr([t.Event()],o.prototype,"pointClick",void 0),Sr([t.Event()],o.prototype,"pointDoubleClick",void 0),Sr([t.Event()],o.prototype,"pointMove",void 0),Sr([t.Event()],o.prototype,"chartMouseLeave",void 0),Sr([t.Event()],o.prototype,"chartMouseDown",void 0),Sr([t.Event()],o.prototype,"chartMouseUp",void 0),Sr([t.Event()],o.prototype,"dragComplete",void 0),Sr([t.Event()],o.prototype,"selectionComplete",void 0),Sr([t.Event()],o.prototype,"zoomComplete",void 0),Sr([t.Event()],o.prototype,"onZooming",void 0),Sr([t.Event()],o.prototype,"scrollStart",void 0),Sr([t.Event()],o.prototype,"scrollEnd",void 0),Sr([t.Event()],o.prototype,"scrollChanged",void 0),Sr([t.Event()],o.prototype,"dragStart",void 0),Sr([t.Event()],o.prototype,"drag",void 0),Sr([t.Event()],o.prototype,"dragEnd",void 0),Sr([t.Property("USD")],o.prototype,"currencyCode",void 0),o=Sr([t.NotifyPropertyChanges],o)}(t.Component),Mr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ar=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Mr(t,e),t.prototype.calculateDateTimeNiceInterval=function(e,t,i,r,o){void 0===o&&(o=!0);var n,a=new Date(i),s=new Date(r),l=Math.abs((a.getTime()-s.getTime())/864e5);switch(e.actualIntervalType=e.intervalType,e.intervalType){case"Years":n=this.calculateNumericNiceInterval(e,l/365,t);break;case"Quarter":n=this.calculateNumericNiceInterval(e,l/365*4,t);break;case"Months":n=this.calculateNumericNiceInterval(e,l/30,t);break;case"Weeks":n=this.calculateNumericNiceInterval(e,l/7,t);break;case"Days":n=this.calculateNumericNiceInterval(e,l,t);break;case"Hours":n=this.calculateNumericNiceInterval(e,24*l,t);break;case"Minutes":n=this.calculateNumericNiceInterval(e,24*l*60,t);break;case"Seconds":n=this.calculateNumericNiceInterval(e,24*l*60*60,t);break;case"Auto":return(n=this.calculateNumericNiceInterval(e,l/365,t))>=1?(e.actualIntervalType="Years",n):(n=this.calculateNumericNiceInterval(e,l/365*4,t))>=1&&!o?(e.actualIntervalType="Quarter",n):(n=this.calculateNumericNiceInterval(e,l/30,t))>=1?(e.actualIntervalType="Months",n):(n=this.calculateNumericNiceInterval(e,l/7,t))>=1&&!o?(e.actualIntervalType="Weeks",n):(n=this.calculateNumericNiceInterval(e,l,t))>=1?(e.actualIntervalType="Days",n):(n=this.calculateNumericNiceInterval(e,24*l,t))>=1?(e.actualIntervalType="Hours",n):(n=this.calculateNumericNiceInterval(e,24*l*60,t))>=1?(e.actualIntervalType="Minutes",n):(n=this.calculateNumericNiceInterval(e,24*l*60*60,t),e.actualIntervalType="Seconds",n)}return n},t.prototype.getSkeleton=function(e,t,i,r){var o,n=e.actualIntervalType;return e.skeleton?e.skeleton:("Years"===n?o=r?e.isChart?(e.valueType,"y"):"y":e.isChart?"DateTime"===e.valueType&&e.isIntervalInDecimal?"y":"yMMM":"y":"Quarter"===n?o=r?"y":"yMMM":"Months"===n?r?(e.isChart,o="m"):o=e.isChart?"MMMd":"MMM":o="Weeks"===n?r?"m":"MEd":"Days"===n?r?"d":e.isChart?this.getDayFormat(e,t,i):"MMMd":"Hours"===n?r?"t":e.isChart?"DateTime"===e.valueType?"Hm":"EHm":"h":"Minutes"===n?r?"T":e.isChart?"Hms":"hm":r?"T":e.isChart?"Hms":"hms",o)},t.prototype.getMonthFormat=function(e,t,i){return new Date(t).getFullYear()===new Date(i).getFullYear()?e.isIntervalInDecimal?"MMM":"MMM d":"y MMM"},t.prototype.getDayFormat=function(e,t,i){return"DateTime"===e.valueType?new Date(t).getMonth()!==new Date(i).getMonth()?"MMMd":e.isIntervalInDecimal?"d":"Ehm":"yMd"},t.prototype.findCustomFormats=function(e,t,i){var r=e.labelFormat?e.labelFormat:"";return!e.isChart||e.skeleton||"Months"!==e.actualIntervalType||r||(r="DateTime"===e.valueType?this.getMonthFormat(e,t,i):"yMMM"),r},t}(ni),kr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tr=function(e){function i(t){return e.call(this,t)||this}return kr(i,e),i.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t,this.chart)},i.prototype.getActualRange=function(e,t){var i={skeleton:"full",type:"dateTime"},o=this.chart.intl.getDateParser(i),n=this.chart.intl.getDateFormat(i);null!==e.minimum?this.min=this.chart.isBlazor?Date.parse(e.minimum.toString()):Date.parse(o(n(new Date(r.DataUtil.parse.parseJson({val:e.minimum}).val)))):null!==this.min&&this.min!==Number.POSITIVE_INFINITY||(this.min=Date.parse(o(n(new Date(1970,1,1))))),null!==e.maximum?this.max=this.chart.isBlazor?Date.parse(e.maximum.toString()):Date.parse(o(n(new Date(r.DataUtil.parse.parseJson({val:e.maximum}).val)))):null!==this.max&&this.max!==Number.NEGATIVE_INFINITY||(this.max=Date.parse(o(n(new Date(1970,5,1))))),this.min===this.max&&(this.max=this.max+2592e6,this.min=this.min-2592e6),e.actualRange={},e.doubleRange=new oi(this.min,this.max);var a=this.calculateDateTimeNiceInterval(e,t,e.doubleRange.start,e.doubleRange.end);e.interval?e.actualRange.interval=e.interval:e.actualRange.interval=a,e.actualRange.min=e.doubleRange.start,e.actualRange.max=e.doubleRange.end},i.prototype.applyRangePadding=function(e,t){this.min=e.actualRange.min,this.max=e.actualRange.max;var i,r,o=e.actualRange.interval;if(!te(e)){var n=e.getRangePadding(this.chart);i=new Date(this.min),r=new Date(this.max);var a=e.actualIntervalType;if("None"===n)this.min=i.getTime(),this.max=r.getTime();else if("Additional"===n||"Round"===n)switch(a){case"Years":this.getYear(i,r,n,o);break;case"Months":this.getMonth(i,r,n,o);break;case"Days":this.getDay(i,r,n,o);break;case"Hours":this.getHour(i,r,n,o);break;case"Minutes":var s=i.getMinutes()/o*o,l=r.getMinutes()+(i.getMinutes()-s);"Round"===n?(this.min=new Date(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),s,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),l,59).getTime()):(this.min=new Date(i.getFullYear(),r.getMonth(),i.getDate(),i.getHours(),s+-o,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),l+o,0).getTime());break;case"Seconds":var h=i.getSeconds()/o*o,c=r.getSeconds()+(i.getSeconds()-h);"Round"===n?(this.min=new Date(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),h,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),c,0).getTime()):(this.min=new Date(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),h+-o,0).getTime(),this.max=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),c+o,0).getTime())}}e.actualRange.min=(e.minimum,this.min),e.actualRange.max=(e.maximum,this.max),e.actualRange.delta=e.actualRange.max-e.actualRange.min,e.doubleRange=new oi(e.actualRange.min,e.actualRange.max),this.calculateVisibleRange(t,e)},i.prototype.getYear=function(e,t,i,r){var o=e.getFullYear(),n=t.getFullYear();"Additional"===i?(this.min=new Date(o-r,1,1,0,0,0).getTime(),this.max=new Date(n+r,1,1,0,0,0).getTime()):(this.min=new Date(o,0,0,0,0,0).getTime(),this.max=new Date(n,11,30,23,59,59).getTime())},i.prototype.getMonth=function(e,t,i,r){var o=e.getMonth(),n=t.getMonth();"Round"===i?(this.min=new Date(e.getFullYear(),o,0,0,0,0).getTime(),this.max=new Date(t.getFullYear(),n,new Date(t.getFullYear(),t.getMonth(),0).getDate(),23,59,59).getTime()):(this.min=new Date(e.getFullYear(),o+-r,1,0,0,0).getTime(),this.max=new Date(t.getFullYear(),n+r,2===n?28:30,0,0,0).getTime())},i.prototype.getDay=function(e,t,i,r){var o=e.getDate(),n=t.getDate();"Round"===i?(this.min=new Date(e.getFullYear(),e.getMonth(),o,0,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),n,23,59,59).getTime()):(this.min=new Date(e.getFullYear(),e.getMonth(),o+-r,0,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),n+r,0,0,0).getTime())},i.prototype.getHour=function(e,t,i,r){var o=e.getHours()/r*r,n=t.getHours()+(e.getHours()-o);"Round"===i?(this.min=new Date(e.getFullYear(),e.getMonth(),e.getDate(),o,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),t.getDate(),n,59,59).getTime()):(this.min=new Date(e.getFullYear(),e.getMonth(),e.getDate(),o+-r,0,0).getTime(),this.max=new Date(t.getFullYear(),t.getMonth(),t.getDate(),n+r,0,0).getTime())},i.prototype.calculateVisibleRange=function(e,i){i.visibleRange={min:i.actualRange.min,max:i.actualRange.max,interval:i.actualRange.interval,delta:i.actualRange.delta};var r=!t.isNullOrUndefined(i.zoomingScrollBar)&&i.zoomingScrollBar.isLazyLoad;ie(i)&&!r&&(i.calculateVisibleRangeOnZooming(this.chart),i.calculateAxisRange(e,this.chart),i.visibleRange.interval=i.enableAutoIntervalOnZooming?this.calculateDateTimeNiceInterval(i,e,i.visibleRange.min,i.visibleRange.max):i.visibleRange.interval),i.dateTimeInterval=this.increaseDateTimeInterval(i,i.visibleRange.min,i.visibleRange.interval).getTime()-i.visibleRange.min,i.triggerRangeRender(this.chart,i.visibleRange.min,i.visibleRange.max,i.visibleRange.interval)},i.prototype.calculateVisibleLabels=function(e,i){e.visibleLabels=[];var r,o,n=e.visibleRange.min,a=e.visibleLabels;for(te(e)||(n=this.alignRangeStart(e,n,e.visibleRange.interval).getTime());n<=e.visibleRange.max;)r=t.extend({},t.getValue("properties",e.labelStyle),null,!0),o=a.length?e.visibleLabels[a.length-1].value:n,e.format=i.intl.getDateFormat({format:this.findCustomFormats(e,n,o)||this.blazorCustomFormat(e),type:G(e.skeletonType),skeleton:this.getSkeleton(e,n,o,i.isBlazor)}),e.startLabel=e.format(new Date(e.visibleRange.min)),e.endLabel=e.format(new Date(e.visibleRange.max)),x(n,e.visibleRange)&&ee(i,n,e.format(new Date(n)),r,e),n=this.increaseDateTimeInterval(e,n,e.visibleRange.interval).getTime();"Months"!==e.actualIntervalType&&"Days"!==e.actualIntervalType||!e.isChart||(e.format=i.intl.getDateFormat({format:e.labelFormat||("Months"!==e.actualIntervalType||e.skeleton?"":"y MMM"),type:G(e.skeletonType),skeleton:e.skeleton||("Days"===e.actualIntervalType?"MMMd":"")})),e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},i.prototype.blazorCustomFormat=function(e){return this.chart.isBlazor?"Years"===e.actualIntervalType?e.isIntervalInDecimal?"yyyy":"MMM y":"Days"!==e.actualIntervalType||e.isIntervalInDecimal?"":"ddd HH tt":""},i.prototype.increaseDateTimeInterval=function(e,t,i){var r=new Date(t);e.interval?(e.isIntervalInDecimal=i%1==0,e.visibleRange.interval=i):(i=Math.ceil(i),e.visibleRange.interval=i);var o=e.actualIntervalType;if(e.isIntervalInDecimal)switch(o){case"Years":return r.setFullYear(r.getFullYear()+i),r;case"Quarter":return r.setMonth(r.getMonth()+3*i),r;case"Months":return r.setMonth(r.getMonth()+i),r;case"Weeks":return r.setDate(r.getDate()+7*i),r;case"Days":return r.setDate(r.getDate()+i),r;case"Hours":return r.setHours(r.getHours()+i),r;case"Minutes":return r.setMinutes(r.getMinutes()+i),r;case"Seconds":return r.setSeconds(r.getSeconds()+i),r}else r=this.getDecimalInterval(r,i,o);return r},i.prototype.alignRangeStart=function(e,t,i){var r=new Date(t);switch(e.actualIntervalType){case"Years":var o=Math.floor(Math.floor(r.getFullYear()/i)*i);return r=new Date(o,r.getMonth(),r.getDate(),0,0,0);case"Months":var n=Math.floor(Math.floor(r.getMonth()/i)*i);return r=new Date(r.getFullYear(),n,r.getDate(),0,0,0);case"Days":var a=Math.floor(Math.floor(r.getDate()/i)*i);return r=new Date(r.getFullYear(),r.getMonth(),a,0,0,0);case"Hours":var s=Math.floor(Math.floor(r.getHours()/i)*i);return r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),s,0,0);case"Minutes":var l=Math.floor(Math.floor(r.getMinutes()/i)*i);return r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),l,0,0);case"Seconds":var h=Math.floor(Math.floor(r.getSeconds()/i)*i);return r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),h,0)}return r},i.prototype.getDecimalInterval=function(e,t,i){var r=Math.floor(t),o=t-r;switch(i){case"Years":var n=Math.round(12*o);return e.setFullYear(e.getFullYear()+r),e.setMonth(e.getMonth()+n),e;case"Quarter":return e.setMonth(e.getMonth()+3*t),e;case"Months":var a=Math.round(30*o);return e.setMonth(e.getMonth()+r),e.setDate(e.getDate()+a),e;case"Weeks":return e.setDate(e.getDate()+7*t),e;case"Days":var s=Math.round(24*o);return e.setDate(e.getDate()+r),e.setHours(e.getHours()+s),e;case"Hours":var l=Math.round(60*o);return e.setHours(e.getHours()+r),e.setMinutes(e.getMinutes()+l),e;case"Minutes":var h=Math.round(60*o);return e.setMinutes(e.getMinutes()+r),e.setSeconds(e.getSeconds()+h),e;case"Seconds":var c=Math.round(1e3*o);return e.setSeconds(e.getSeconds()+r),e.setMilliseconds(e.getMilliseconds()+c),e}return e},i.prototype.getModuleName=function(){return"DateTime"},i.prototype.destroy=function(){},i}(Ar),_r=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Or=function(e){function i(t){return e.call(this,t)||this}return _r(i,e),i.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t)},i.prototype.getActualRange=function(e,t){this.initializeDoubleRange(e),e.actualRange={},e.interval?e.actualRange.interval=Math.ceil(e.interval):e.actualRange.interval=Math.max(1,Math.floor(e.doubleRange.delta/re(t,e))),e.actualRange.min=e.doubleRange.start,e.actualRange.max=e.doubleRange.end,e.actualRange.delta=e.doubleRange.delta},i.prototype.applyRangePadding=function(e,t){var i="BetweenTicks"===e.labelPlacement&&"PolarRadar"!==this.chart.chartAreaType?.5:0;i>0?(e.actualRange.min-=i,e.actualRange.max+=i):e.actualRange.max+=e.actualRange.max?0:.5,e.doubleRange=new oi(e.actualRange.min,e.actualRange.max),e.actualRange.delta=e.doubleRange.delta,this.calculateVisibleRange(t,e)},i.prototype.calculateVisibleLabels=function(e){e.visibleLabels=[];var i,r=Math.ceil(e.visibleRange.min);(e.zoomFactor<1||e.zoomPosition>0)&&(r=e.visibleRange.min-e.visibleRange.min%e.visibleRange.interval);var o;for(e.startLabel=e.labels[Math.round(e.visibleRange.min)],e.endLabel=e.labels[Math.floor(e.visibleRange.max)];r<=e.visibleRange.max;r+=e.visibleRange.interval)i=t.extend({},t.getValue("properties",e.labelStyle),null,!0),x(r,e.visibleRange)&&e.labels.length>0&&(o=Math.round(r),ee(this.chart,o,e.labels[o]?e.labels[o].toString():o.toString(),i,e));e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},i.prototype.getModuleName=function(){return"Category"},i.prototype.destroy=function(){},i}(Ar),Er=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ir=function(e){function i(t){return e.call(this,t)||this}return Er(i,e),i.prototype.calculateRangeAndInterval=function(e,t){this.calculateRange(t),this.getActualRange(t,e),this.calculateVisibleRange(e,t),this.calculateVisibleLabels(t,this.chart)},i.prototype.getActualRange=function(e,t){this.initializeDoubleRange(e),this.min=this.min<0?0:this.min;var i=v(this.min,e.logBase);i=isFinite(i)?i:this.min;var r=1===this.max?1:v(this.max,e.logBase);r=isFinite(i)?r:this.max,this.min=Math.floor(i/1),e.series&&e.series.some(function(e){return(-1!==e.type.indexOf("Column")||-1!==e.type.indexOf("Bar"))&&-1===e.type.indexOf("Range")})&&(this.min=this.min<=0?+this.min-1:this.min),this.max=Math.ceil(r/1),e.actualRange.interval=e.interval||this.calculateLogNiceInterval(this.max-this.min,t,e),e.actualRange.min=this.min,e.actualRange.max=this.max,e.actualRange.delta=this.max-this.min},i.prototype.calculateVisibleRange=function(e,i){i.visibleRange={interval:i.actualRange.interval,max:i.actualRange.max,min:i.actualRange.min,delta:i.actualRange.delta};var r=!t.isNullOrUndefined(i.zoomingScrollBar)&&i.zoomingScrollBar.isLazyLoad;(i.zoomFactor<1||i.zoomPosition>0)&&!r&&(i.calculateVisibleRangeOnZooming(this.chart),i.visibleRange.interval=i.enableAutoIntervalOnZooming?this.calculateLogNiceInterval(i.doubleRange.delta,e,i):i.visibleRange.interval,i.visibleRange.interval=0===Math.floor(i.visibleRange.interval)?1:Math.floor(i.visibleRange.interval),i.triggerRangeRender(this.chart,i.visibleRange.min,i.visibleRange.max,i.visibleRange.interval))},i.prototype.calculateLogNiceInterval=function(e,t,i){for(var r=re(t,i),o=e,n=Math.pow(i.logBase,Math.floor(v(o,10))),a=0,s=i.intervalDivs.length;a<s;a++){var l=n*i.intervalDivs[a];if(r<e/l)break;o=l}return o},i.prototype.calculateVisibleLabels=function(e,i){var r=e.visibleRange.min;e.visibleLabels=[];var o,n;(e.zoomFactor<1||e.zoomPosition>0)&&(r=e.visibleRange.min-e.visibleRange.min%e.visibleRange.interval);var a=this.getFormat(e),s=null!==a.match("{value}"),l=Math.pow(e.logBase,e.visibleRange.min);for(e.format=i.intl.getNumberFormat({format:s?"":a,useGrouping:i.useGroupingSeparator,maximumFractionDigits:l<1?20:3}),e.startLabel=e.format(l<1?+l.toPrecision(1):l),e.endLabel=e.format(Math.pow(e.logBase,e.visibleRange.max));r<=e.visibleRange.max;r+=e.visibleRange.interval)o=t.extend({},t.getValue("properties",e.labelStyle),null,!0),x(r,e.visibleRange)&&(n=Math.pow(e.logBase,r),ee(this.chart,r,this.formatValue(e,s,a,n<1?+n.toPrecision(1):n),o,e));e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},i.prototype.getModuleName=function(){return"Logarithmic"},i.prototype.destroy=function(){},i}(ni),zr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Dr=function(e){function i(t){return e.call(this,t)||this}return zr(i,e),i.prototype.calculateRangeAndInterval=function(e,t){this.axisSize=e,this.calculateRange(t),this.getActualRange(t,e),this.applyRangePadding(t,e),this.calculateVisibleLabels(t)},i.prototype.calculateVisibleLabels=function(e){e.visibleLabels=[];var i,r="BetweenTicks"===e.labelPlacement?.5:0;"Auto"===e.intervalType?this.calculateDateTimeNiceInterval(e,this.axisSize,parseInt(e.labels[0],10),parseInt(e.labels[e.labels.length-1],10)):e.actualIntervalType=e.intervalType,e.format=this.chart.intl.getDateFormat({format:e.labelFormat||this.blazorCustomFormat(e),type:G(e.skeletonType),skeleton:this.getSkeleton(e,null,null,this.chart.isBlazor)});for(var o=0;o<e.labels.length;o++)i=t.extend({},t.getValue("properties",e.labelStyle),null,!0),this.sameInterval(e.labels.map(Number)[o],e.labels.map(Number)[o-1],e.actualIntervalType,o)&&!e.isIndexed||x(o-r,e.visibleRange)&&ee(this.chart,o,e.isIndexed?this.getIndexedAxisLabel(e.labels[o],e.format):e.format(new Date(e.labels.map(Number)[o])),i,e);e.getMaxLabelWidth&&e.getMaxLabelWidth(this.chart)},i.prototype.blazorCustomFormat=function(e){return this.chart.isBlazor&&"Years"===e.actualIntervalType?"yyyy":""},i.prototype.getIndexedAxisLabel=function(e,t){for(var i=e.split(","),r=0;r<i.length;r++)i[r]=t(new Date(parseInt(i[r],10)));return i.join(", ")},i.prototype.sameInterval=function(e,t,i,r){var o;if(0===r)o=!1;else switch(i){case"Years":o=new Date(e).getFullYear()===new Date(t).getFullYear();break;case"Months":o=new Date(e).getFullYear()===new Date(t).getFullYear()&&new Date(e).getMonth()===new Date(t).getMonth();break;case"Days":o=Math.abs(e-t)<864e5&&new Date(e).getDay()===new Date(t).getDay();break;case"Hours":o=Math.abs(e-t)<36e5&&new Date(e).getDay()===new Date(t).getDay();break;case"Minutes":o=Math.abs(e-t)<6e4&&new Date(e).getMinutes()===new Date(t).getMinutes();break;case"Seconds":o=Math.abs(e-t)<1e3&&new Date(e).getDay()===new Date(t).getDay()}return o},i.prototype.getModuleName=function(){return"DateTimeCategory"},i.prototype.destroy=function(){},i}(Or),Br=function(){function e(){}return e.prototype.measureStripLine=function(e,t,r,o,n,a){var s,l,h=e.orientation,c="DateTime"===e.valueType;if(t.isRepeat&&null!==t.size)s=o,l=null;else if("DateTimeCategory"===e.valueType){var d=t.start,p=t.end;s=null!=d&&"number"!=typeof d?e.labels.indexOf(this.dateToMilliSeconds(d,a).toString()):d,l=null!=p&&"number"!=typeof p?e.labels.indexOf(this.dateToMilliSeconds(p,a).toString()):p}else s=null===t.start?null:c&&this.isCoreDate(t.start)?this.dateToMilliSeconds(t.start,a):+t.start,l=null===t.end?null:c&&this.isCoreDate(t.start)?this.dateToMilliSeconds(t.end,a):+t.end;var u=this.getFromTovalue(s,l,t.size,t.startFromAxis,e,t),g="Vertical"===h?(u.to-u.from)*e.rect.height:r.height,y="Horizontal"===h?(u.to-u.from)*e.rect.width:r.width,m="Vertical"===h?r.x:u.from*e.rect.width+e.rect.x,v="Horizontal"===h?r.y:e.rect.y+e.rect.height-("Pixel"===t.sizeType?u.from:u.to)*e.rect.height;if(t.isSegmented&&null!=t.segmentStart&&null!=t.segmentEnd&&"Pixel"!==t.sizeType){var d=c&&this.isCoreDate(t.segmentStart)?this.dateToMilliSeconds(t.segmentStart,a):+t.segmentStart,p=c&&this.isCoreDate(t.segmentEnd)?this.dateToMilliSeconds(t.segmentEnd,a):+t.segmentEnd,f=this.getFromTovalue(d,p,null,null,n,t);"Vertical"===n.orientation?(v=n.rect.y+n.rect.height-f.to*n.rect.height,g=(f.to-f.from)*n.rect.height):(m=f.from*n.rect.width+n.rect.x,y=(f.to-f.from)*n.rect.width)}return 0!==g&&0!==y||"Pixel"===t.sizeType&&(null!==t.start||t.startFromAxis)?new i.Rect(m,v,y,g):new i.Rect(0,0,0,0)},e.prototype.getFromTovalue=function(e,i,r,o,n,a){var s=!a.isRepeat&&o?n.visibleRange.min:e,l=this.getToValue(Math.max(e,t.isNullOrUndefined(i)?e:i),s,r,n,i,a);return s=this.findValue(s,n),l=this.findValue(l,n),{from:I(n.isInversed?l:s,n),to:I(n.isInversed?s:l,n)}},e.prototype.getToValue=function(e,t,i,r,o,n){var a=n.sizeType,s=null===o;if("DateTime"!==r.valueType)return"Pixel"===n.sizeType?t:s?t+i:e;var l=new Date(t);switch("Auto"===a&&(a=r.actualIntervalType,i*=r.visibleRange.interval),a){case"Years":return s?new Date(l.setFullYear(l.getFullYear()+i)):e;case"Months":return s?new Date(l.setMonth(l.getMonth()+i)):e;case"Days":return s?new Date(l.setDate(l.getDate()+i)):e;case"Hours":return s?new Date(l.setHours(l.getHours()+i)):e;case"Minutes":return s?new Date(l.setMinutes(l.getMinutes()+i)):e;case"Seconds":return s?new Date(l.setSeconds(l.getSeconds()+i)):e;default:return t}},e.prototype.findValue=function(e,t){return e<t.visibleRange.min?e=t.visibleRange.min:e>t.visibleRange.max&&(e=t.visibleRange.max),e},e.prototype.dateParse=function(e,t){var i=t.intl.getDateParser({skeleton:"full",type:"dateTime"}),o=t.intl.getDateFormat({skeleton:"full",type:"dateTime"});return new Date(Date.parse(i(o(new Date(r.DataUtil.parse.parseJson({val:e}).val)))))},e.prototype.renderStripLine=function(e,t,i){var r,o=e.element.id+"_stripline_"+t+"_",n=e.chartAxisLayoutPanel.seriesClipRect,a=0,s=0,l=null,h=new Di(o+"ClipRect","transparent",{width:1,color:"Gray"},1,{x:e.initialClipRect.x,y:e.initialClipRect.y,width:e.initialClipRect.width,height:e.initialClipRect.height}),c=e.renderer.createGroup({id:o+"collections","clip-path":"url(#"+o+"ClipRect)"});e.enableCanvas||c.appendChild(K(e.redraw,h,e.renderer));for(var d=0,p=i;d<p.length;d++)for(var u=p[d],g=0,y=0,m=u.stripLines;y<m.length;y++){var v=m[y];if(v.visible&&v.zIndex===t)if(v.isSegmented&&null!=v.segmentStart&&null!=v.segmentEnd&&"Pixel"!==v.sizeType&&(l=this.getSegmentAxis(i,u,v)),v.isRepeat&&null!=v.repeatEvery&&null!==v.size&&"Pixel"!==v.sizeType)for(a=null!=v.repeatUntil?"DateTime"===u.valueType?this.dateToMilliSeconds(v.repeatUntil,e):+v.repeatUntil:u.actualRange.max,s="DateTime"===u.valueType&&this.isCoreDate(v.start)?this.dateToMilliSeconds(v.start,e):v.start,(v.startFromAxis&&"DateTime"===u.valueType&&"Auto"===v.sizeType||v.start<u.visibleRange.min)&&(s=u.visibleLabels[0].value===u.visibleRange.min?u.visibleRange.min:u.visibleLabels[0].value-("DateTime"===u.valueType?u.dateTimeInterval:u.visibleRange.interval)),s=v.startFromAxis&&"DateTime"!==u.valueType?u.visibleRange.min:s;s<a;)r=x(s+("DateTime"===u.valueType?u.dateTimeInterval*+v.size:v.size),u.visibleRange),(s>=u.visibleRange.min&&s<u.visibleRange.max||r)&&this.renderStripLineElement(u,v,n,o,c,e,s,l,g),g++,s=this.getStartValue(u,v,s,e);else this.renderStripLineElement(u,v,n,o,c,e,null,l,g),g++}be(e.enableCanvas,e.svgObject,c,e.redraw)},e.prototype.isCoreDate=function(e){return"string"==typeof e},e.prototype.dateToMilliSeconds=function(e,t){return this.dateParse(e,t).getTime()},e.prototype.renderPath=function(e,t,r,o,n,a){var s=he(r),l=s?s.getAttribute("d"):"",h="Vertical"===a.orientation?"M"+t.x+" "+t.y+" L"+(t.x+t.width)+" "+t.y:"M"+t.x+" "+t.y+" L"+t.x+" "+(t.y+t.height);be(n.enableCanvas,o,n.renderer.drawPath(new i.PathOption(r,"none",e.size,e.color,e.opacity,e.dashArray,h)),n.redraw,!0,"x","y",null,l,!0)},e.prototype.renderRectangle=function(e,t,r,o,n){var a=he(r),s=a?new i.Rect(+a.getAttribute("x"),+a.getAttribute("y"),+a.getAttribute("width"),+a.getAttribute("height")):null;be(n.enableCanvas,o,n.renderer.drawRectangle(new Di(r,e.color,e.border,e.opacity,t,0,0,"",e.dashArray)),n.redraw,!0,"x","y",null,null,!0,!0,s)},e.prototype.renderText=function(e,t,r,o,n,a){var s,l=i.measureText(e.text,e.textStyle),h=null===e.rotation,c=h?l.height/8*3:0,d=t.y+t.height/2+c,p=h?"Vertical"===a.orientation?0:-90:e.rotation,u=t.x+t.width/2;"Horizontal"===a.orientation?(u=this.getTextStart(u+c*this.factor(e.horizontalAlignment),t.width,e.horizontalAlignment),d=this.getTextStart(d-c,t.height,e.verticalAlignment)+("Start"!==e.verticalAlignment||h?0:l.height/4),s=h?this.invertAlignment(e.verticalAlignment):e.horizontalAlignment):(u=this.getTextStart(u,t.width,e.horizontalAlignment),d=this.getTextStart(d+c*this.factor(e.verticalAlignment)-5,t.height,e.verticalAlignment),s=e.horizontalAlignment),Ve(n.renderer,new i.TextOption(r,u,d,s,e.text,"rotate("+p+" "+u+","+d+")","middle"),e.textStyle,e.textStyle.color,o,null,null,null,null,null,null,null,null,n.enableCanvas)},e.prototype.invertAlignment=function(e){switch(e){case"Start":e="End";break;case"End":e="Start"}return e},e.prototype.getStartValue=function(e,t,i,r){return"DateTime"===e.valueType?this.getToValue(null,i,+t.repeatEvery,e,null,t):i+ +t.repeatEvery},e.prototype.getSegmentAxis=function(e,t,i){var r;if(null==i.segmentAxisName)return"Horizontal"===t.orientation?e[1]:e[0];for(var o=0;o<e.length;o++)i.segmentAxisName===e[o].name&&(r=e[o]);return r},e.prototype.renderStripLineElement=function(e,t,i,r,o,n,a,s,l){var h=this.measureStripLine(e,t,i,a,s,n);"Pixel"===t.sizeType?this.renderPath(t,h,r+"path_"+e.name+"_"+l,o,n,e):0!==h.height&&0!==h.width&&this.renderRectangle(t,h,r+"rect_"+e.name+"_"+l,o,n),""!==t.text&&this.renderText(t,h,r+"text_"+e.name+"_"+l,o,n,e)},e.prototype.factor=function(e){var t=0;switch(e){case"Start":t=1;break;case"End":t=-1}return t},e.prototype.getTextStart=function(e,t,i){switch(i){case"Start":e=e-t/2+5;break;case"End":e=e+t/2-5}return e},e.prototype.getModuleName=function(){return"StripLine"},e.prototype.destroy=function(){},e}(),Fr=function(){function e(e){this.chart=e}return e.prototype.enableComplexProperty=function(e){for(var i=[],r=[],o=e.xAxis.visibleRange,n=e.yAxis.visibleRange,a=e.points,s=e.clipRect,l=Math.abs(o.delta/s.width),h=Math.abs(n.delta/s.height),c=a[0]&&a[0].x>l?0:l,d=a[0]&&a[0].y>h?0:h,p=0,u=0,g=0,y=a;g<y.length;g++){var m=y[g];m.symbolLocations=[],p=m.xValue?m.xValue:o.min,u=m.yValue?m.yValue:n.min,(Math.abs(c-p)>=l||Math.abs(d-u)>=h)&&(i.push(m),c=p,d=u)}for(var v,f=0;f<i.length;f++)v=i[f],t.isNullOrUndefined(v.x)||""===v.x||r.push(v);return r},e.prototype.getLineDirection=function(e,t,i,r,o,n){var a="";if(null!=e){var s=o(e.xValue,e.yValue,i.xAxis,i.yAxis,r,i),l=o(t.xValue,t.yValue,i.xAxis,i.yAxis,r,i);a=n+" "+s.x+" "+s.y+" L "+l.x+" "+l.y+" "}return a},e.prototype.appendLinePath=function(e,t,i){var r=he(e.id),o=t.chart,n=r?r.getAttribute("d"):null,a=t.chart.renderer.drawPath(e,new Int32Array([t.clipRect.x,t.clipRect.y]));a&&a.setAttribute("clip-path",i),t.pathElement=a,t.chart.enableCanvas||t.seriesElement.appendChild(a),t.isRectSeries=!1,J(r,e.d,t.chart.redraw,n,o.duration)},e.prototype.renderMarker=function(e){e.marker&&e.marker.visible&&e.chart.markerRender.render(e)},e.prototype.doProgressiveAnimation=function(e,i){var r,o=new t.Animation({}),n=e.pathElement,a=n.getAttribute("stroke-dasharray"),s=e.pathElement.getTotalLength();n.style.visibility="hidden",o.animate(n,{duration:i.duration,delay:i.delay,progress:function(e){e.timeStamp>=e.delay&&(n.style.visibility="visible",r=Math.abs(Math.round((e.timeStamp-e.delay)*s/e.duration)),n.setAttribute("stroke-dasharray",r+","+s))},end:function(){n.setAttribute("stroke-dasharray",a),e.chart.trigger("animationComplete",{series:e.chart.isBlazor?{}:e})}})},e.prototype.storePointLocation=function(e,t,r,o){var n=t.marker&&t.marker.width?t.marker.width:0,a=t.marker&&t.marker.height?t.marker.height:0;e.symbolLocations.push(o(e.xValue,e.yValue,t.xAxis,t.yAxis,r,t)),e.regions.push(new i.Rect(e.symbolLocations[0].x-n,e.symbolLocations[0].y-a,2*n,2*a))},e.prototype.withinYRange=function(e,t){return e.yValue>=t.visibleRange.min&&e.yValue<=t.visibleRange.max},e.prototype.getFirstLastVisiblePoint=function(e){for(var t=null,i=null,r=0,o=e;r<o.length;r++){var n=o[r];null===t&&n.visible&&(t=i=n),i=n.visible?n:i}return{first:t||e[0],last:i||e[e.length-1]}},e.prototype.doLinearAnimation=function(e,i){var r,o=e.clipRectElement.childNodes[0].childNodes[0],n=e.chart.animated?e.chart.duration:i.duration,a=Z("Linear"),s=+o.getAttribute("height"),l=+o.getAttribute("width"),h=+o.getAttribute("x"),c=e.chart.requireInvertedAxis?+o.getAttribute("height")+ +o.getAttribute("y"):+o.getAttribute("y");o.style.visibility="hidden",new t.Animation({}).animate(o,{duration:n,delay:i.delay,progress:function(t){t.timeStamp>=t.delay&&(o.style.visibility="visible",e.chart.requireInvertedAxis?(r=a(t.timeStamp-t.delay,0,s,t.duration),o.setAttribute("transform","translate("+h+" "+c+") scale(1,"+r/s+") translate("+-h+" "+-c+")")):(r=a(t.timeStamp-t.delay,0,l,t.duration),o.setAttribute("transform","translate("+h+" "+c+") scale("+r/l+", 1) translate("+-h+" "+-c+")")))},end:function(){o.setAttribute("transform","translate(0,0)"),e.chart.trigger("animationComplete",{series:e.chart.isBlazor?{}:e})}})},e}(),Nr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Nr(t,e),t.prototype.render=function(e,t,r,o){for(var n,a,s="",l=null,h="M",c=e.chart&&"PolarRadar"===e.chart.chartAreaType,d=e.emptyPointSettings&&"Drop"===e.emptyPointSettings.mode,p=c?z:ve,u="TrendLine"===e.category?e.points:this.enableComplexProperty(e),g=0,y=u;g<y.length;g++){var m=y[g];m.regions=[],m.symbolLocations=[],m.visible&&S(u[m.index-1],m,u[m.index+1],e)?(s+=this.getLineDirection(l,m,e,o,p,h),h=l?"L":h,l=m,this.storePointLocation(m,e,o,p)):(l=d?l:null,h=d?h:"M")}if(c&&e.isClosed){var v=this.getFirstLastVisiblePoint(u);a=p(v.last.xValue,v.last.yValue,t,r,o,e),n=p(v.first.xValue,v.first.yValue,t,r,o,e),s=s.concat(h+" "+a.x+" "+a.y+" L "+n.x+" "+n.y)}var f="Indicator"===e.category?e.chart.element.id+"_Indicator_"+e.index+"_"+e.name:"TrendLine"===e.category?e.chart.element.id+"_Series_"+e.sourceIndex+"_TrendLine_"+e.index:e.chart.element.id+"_Series_"+(void 0===e.index?e.category:e.index),b=new i.PathOption(f,"none",e.width,e.interior,e.opacity,e.dashArray,s);this.appendLinePath(b,e,""),this.renderMarker(e)},t.prototype.doAnimation=function(e){var t=e.animation;this.doProgressiveAnimation(e,t)},t.prototype.getModuleName=function(){return"LineSeries"},t.prototype.destroy=function(){},t}(Fr),jr=function(){function e(){}return e.prototype.getSideBySideInfo=function(e){e.chart.enableSideBySidePlacement&&!e.position&&this.getSideBySidePositions(e);var t=e.chart.enableSideBySidePlacement?e.position:0,i=e.chart.enableSideBySidePlacement?e.rectCount:1;e.isRectSeries=!0;var r,o=e.chart.visibleSeries,n=e.chart.enableSideBySidePlacement?e.columnSpacing:0,a=null===e.columnWidth||isNaN(+e.columnWidth)?"Histogram"===e.type?1:.7:e.columnWidth,s=U(e.xAxis,o)*a,l=t/i-.5,h=new oi(l,l+1/i);return isNaN(h.start)||isNaN(h.end)||(r=n*(h=new oi(h.start*s,h.end*s)).delta,h=new oi(h.start+r/2,h.end-r/2)),h},e.prototype.getRectangle=function(e,t,r,o,n){var a=ve(e,t,n.xAxis,n.yAxis,n.chart.requireInvertedAxis),s=ve(r,o,n.xAxis,n.yAxis,n.chart.requireInvertedAxis);return new i.Rect(Math.min(a.x,s.x),Math.min(a.y,s.y),Math.abs(s.x-a.x),Math.abs(s.y-a.y))},e.prototype.getSideBySidePositions=function(e){for(var t=e.chart,i=0,r=t.columns;i<r.length;i++)for(var o=r[i],n=0,a=t.rows;n<a.length;n++){var s=a[n];this.findRectPosition(e.findSeriesCollection(o,s,!1))}},e.prototype.findRectPosition=function(e){for(var t=[],i={rectCount:0,position:null},r=0;r<e.length;r++)-1!==(o=e[r]).type.indexOf("Stacking")?o.stackingGroup?void 0===t[o.stackingGroup]?(o.position=i.rectCount,t[o.stackingGroup]=i.rectCount++):o.position=t[o.stackingGroup]:null===i.position?(o.position=i.rectCount,i.position=i.rectCount++):o.position=i.position:o.position=i.rectCount++;for(r=0;r<e.length;r++){var o=e[r];o.rectCount=i.rectCount}},e.prototype.updateSymbolLocation=function(e,t,i){i.chart.requireInvertedAxis?this.updateYRegion(e,t,i):this.updateXRegion(e,t,i),"Histogram"===i.type&&(e.minimum=+e.x-i.histogramValues.binWidth/2,e.maximum=+e.x+i.histogramValues.binWidth/2)},e.prototype.updateXRegion=function(e,t,i){e.symbolLocations.push({x:t.x+t.width/2,y:"BoxPlot"===i.seriesType||-1!==i.seriesType.indexOf("HighLow")||e.yValue>=0==!i.yAxis.isInversed?t.y:t.y+t.height}),this.getRegion(e,t,i),"RangeColumn"===i.type&&e.symbolLocations.push({x:t.x+t.width/2,y:t.y+t.height})},e.prototype.updateYRegion=function(e,t,i){e.symbolLocations.push({x:"BoxPlot"===i.seriesType||-1!==i.seriesType.indexOf("HighLow")||e.yValue>=0==!i.yAxis.isInversed?t.x+t.width:t.x,y:t.y+t.height/2}),this.getRegion(e,t,i),"RangeColumn"===i.type&&e.symbolLocations.push({x:t.x,y:t.y+t.height/2})},e.prototype.renderMarker=function(e){e.marker&&e.marker.visible&&e.chart.markerRender.render(e)},e.prototype.getRegion=function(e,t,r){if(0===e.y){var o=r.marker&&r.marker.width?r.marker.width:0,n=r.marker&&r.marker.height?r.marker.height:0;e.regions.push(new i.Rect(e.symbolLocations[0].x-o,e.symbolLocations[0].y-n,2*o,2*n))}else e.regions.push(t)},e.prototype.triggerEvent=function(e,t,i,r){var o={cancel:!1,name:"pointRender",series:e,point:t,fill:e.setPointColor(t,i),border:e.setBorderColor(t,r)};return e.chart.trigger("pointRender",o),t.color=o.fill,o},e.prototype.drawRectangle=function(e,t,r,o){var n=e.chart;if((n.requireInvertedAxis?r.height:r.width)<=0)return null;var a;a=0===t.y?this.calculateRoundedRectPath(r,0,0,0,0):this.calculateRoundedRectPath(r,e.cornerRadius.topLeft,e.cornerRadius.topRight,e.cornerRadius.bottomLeft,e.cornerRadius.bottomRight);var s="Indicator"===e.category?n.element.id+"_Indicator_"+e.index+"_"+e.name+"_Point_"+t.index:n.element.id+"_Series_"+e.index+"_Point_"+t.index,l=Fe(n.redraw,s),h=l?l.getAttribute("d"):"",c=new i.PathOption(s,o.fill,o.border.width,o.border.color,e.opacity,e.dashArray,a),d=n.renderer.drawPath(c,new Int32Array([e.clipRect.x,e.clipRect.y]));switch(e.seriesType){case"XY":d.setAttribute("aria-label",t.x.toString()+":"+t.yValue.toString());break;case"HighLow":d.setAttribute("aria-label",t.x.toString()+":"+t.high.toString()+":"+t.low.toString())}be(e.chart.enableCanvas,e.seriesElement,d,n.redraw),e.chart.enableCanvas||J(d,a,n.redraw,h,n.duration)},e.prototype.animate=function(e){for(var t=e.seriesElement.childNodes,i="Indicator"===e.category?0:1,r=0,o=g(e);r<o.length;r++){var n=o[r];(n.symbolLocations.length||"BoxAndWhisker"===e.type&&n.regions.length)&&(this.animateRect(t[i],e,n),i++)}},e.prototype.animateRect=function(e,i,r){var o,n,a,s,l=i.animation,h=i.chart.animated?i.chart.duration:l.duration,c=Z("Linear"),d=r.yValue<0,p=+r.regions[0].height,u=+r.regions[0].width;i.chart.requireInvertedAxis?(n=+r.regions[0].y,i.type.indexOf("Stacking")>-1?(o=I(0,i.yAxis)*i.yAxis.rect.width,a=o,s=n):(o=+r.regions[0].x,s=d?n:n+p,a=-1!==i.seriesType.indexOf("HighLow")||-1!==i.type.indexOf("Waterfall")?o+u/2:d!==i.yAxis.isInversed?o+u:o)):(o=+r.regions[0].x,i.type.indexOf("Stacking")>-1?(n=(1-I(0,i.yAxis))*i.yAxis.rect.height,a=o,s=n):(n=+r.regions[0].y,s=-1!==i.seriesType.indexOf("HighLow")||-1!==i.type.indexOf("Waterfall")?n+p/2:d!==i.yAxis.isInversed?n:n+p,a=d?o:o+u));var g;t.isNullOrUndefined(e)||(e.style.visibility="hidden",new t.Animation({}).animate(e,{duration:h,delay:l.delay,progress:function(t){t.timeStamp>=t.delay&&(e.style.visibility="visible",i.chart.requireInvertedAxis?(u=u||1,g=c(t.timeStamp-t.delay,0,u,t.duration),e.setAttribute("transform","translate("+a+" "+s+") scale("+g/u+", 1) translate("+-a+" "+-s+")")):(p=p||1,g=c(t.timeStamp-t.delay,0,p,t.duration),e.setAttribute("transform","translate("+a+" "+s+") scale(1,"+g/p+") translate("+-a+" "+-s+")")))},end:function(){e.setAttribute("transform","translate(0,0)");var t=i.seriesElement;if((e===t.lastElementChild||r.index===i.points.length-1||"Waterfall"===i.type&&e===t.children[t.childElementCount-2])&&(i.chart.trigger("animationComplete",{series:i.chart.isBlazor?{}:i}),"Waterfall"===i.type))for(var o=t.childNodes,n=0;n<o.length;n++)-1!==o[n].id.indexOf("Connector")&&(o[n].style.visibility="visible",o[n].setAttribute("transform","translate(0,0)"))}}))},e.prototype.calculateRoundedRectPath=function(e,t,i,r,o){return"M "+e.x+" "+(t+e.y)+" Q "+e.x+" "+e.y+" "+(e.x+t)+" "+e.y+" L "+(e.x+e.width-i)+" "+e.y+" Q "+(e.x+e.width)+" "+e.y+" "+(e.x+e.width)+" "+(e.y+i)+" L "+(e.x+e.width)+" "+(e.y+e.height-o)+" Q "+(e.x+e.width)+" "+(e.y+e.height)+" "+(e.x+e.width-o)+" "+(e.y+e.height)+" L "+(e.x+r)+" "+(e.y+e.height)+" Q "+e.x+" "+(e.y+e.height)+" "+e.x+" "+(e.y+e.height-r)+" L "+e.x+" "+(t+e.y)+" Z"},e}(),Hr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Hr(t,e),t.prototype.render=function(e){for(var t,i,r=this.getSideBySideInfo(e),o=Math.max(e.yAxis.visibleRange.min,0),n=0,a=e.points;n<a.length;n++){var s=a[n];if(s.symbolLocations=[],s.regions=[],s.visible&&S(e.points[s.index-1],s,e.points[s.index+1],e)){t=this.getRectangle(s.xValue+r.start,s.yValue,s.xValue+r.end,o,e);var l="Indicator"===e.category?s.color:e.interior;(i=this.triggerEvent(e,s,l,{width:e.border.width,color:e.border.color})).cancel||(this.updateSymbolLocation(s,t,e),this.drawRectangle(e,s,t,i))}}this.renderMarker(e)},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.getModuleName=function(){return"ColumnSeries"},t.prototype.destroy=function(){},t}(jr),Yr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Yr(t,e),t.prototype.getAreaPathDirection=function(e,t,i,r,o,n,a){var s,l="";return null===n&&(l+=a+" "+(s=o(e,t,i.xAxis,i.yAxis,r,i)).x+" "+s.y+" "),l},t.prototype.getAreaEmptyDirection=function(e,t,i,r,o){var n="";return n+=this.getAreaPathDirection(e.x,e.y,i,r,o,null,"L"),n+=this.getAreaPathDirection(t.x,t.y,i,r,o,null,"L")},t.prototype.setPointColor=function(e,t,i,r,o){if(""===i.pointColorMapping){for(var n=void 0,a=0;a<o.length;a++)if(n=o[a],(r?e.xValue:e.yValue)<=this.getAxisValue(n.value,r?i.xAxis:i.yAxis,i.chart)||!n.value){e.interior=n.color;break}return null==e.interior&&(e.interior=i.interior),!1}return!!t&&i.setPointColor(e,i.interior)!==i.setPointColor(t,i.interior)},t.prototype.sortSegments=function(e,t){var i=this,r="X"===e.segmentAxis?e.xAxis:e.yAxis;return[].concat(t).sort(function(t,o){return i.getAxisValue(t.value,r,e.chart)-i.getAxisValue(o.value,r,e.chart)})},t.prototype.applySegmentAxis=function(e,t,i){var r=this;if(""!==e.pointColorMapping)return t.map(function(t){r.appendLinePath(t,e,"")}),null;var o,n="X"===e.segmentAxis,a=n?e.xAxis:e.yAxis,s=e.chart;this.includeSegment(i,a,e,i.length);for(var l,h,c,d=i.length,p=this,u=0;u<d;u++)!function(r){o=i[r],l=p.getAxisValue(o.value,a,e.chart),(h=p.createClipRect(r?p.getAxisValue(i[r-1].value,a,e.chart):a.visibleRange.min,l,e,r,n))&&t.map(function(t){J(he((c={"clip-path":h,"stroke-dasharray":o.dashArray,opacity:t.opacity,stroke:e.type.indexOf("Line")>-1?o.color||e.interior:e.border.color,"stroke-width":t["stroke-width"],fill:e.type.indexOf("Line")>-1?"none":o.color||e.interior,id:t.id+"_Segment_"+r,d:t.d}).id),c.d,s.redraw),e.seriesElement.appendChild(s.renderer.drawPath(c))})}(u)},t.prototype.includeSegment=function(e,t,i,r){if(r<=0)return e.push({value:t.visibleRange.max,color:i.interior}),null;this.getAxisValue(e[r-1].value,t,i.chart)<t.visibleRange.max&&e.push({value:t.visibleRange.max,color:i.interior})},t.prototype.createClipRect=function(e,t,i,r,o){var n,a=i.chart.requireInvertedAxis,s=ve(o?e:i.xAxis.visibleRange.min,o?i.yAxis.visibleRange.max:t,i.xAxis,i.yAxis,a),l=ve(o?t:i.xAxis.visibleRange.max,o?i.yAxis.visibleRange.min:e,i.xAxis,i.yAxis,a);return(l=a?[s,s=l][0]:l).x-s.x>0&&l.y-s.y>0?(n=new Di(i.chart.element.id+"_ChartSegment"+i.index+"ClipRect_"+r,"transparent",{width:1,color:"Gray"},1,{x:s.x,y:s.y,width:l.x-s.x,height:l.y-s.y}),i.seriesElement.appendChild(K(i.chart.redraw,n,i.chart.renderer)),"url(#"+i.chart.element.id+"_ChartSegment"+i.index+"ClipRect_"+r+")"):null},t.prototype.getAxisValue=function(e,t,i){if(null===e&&(e=t.visibleRange.max),"DateTime"===t.valueType){var o={skeleton:"full",type:"dateTime"};return Date.parse(i.intl.getDateParser(o)(i.intl.getDateFormat(o)(new Date(r.DataUtil.parse.parseJson({val:e}).val))))}if(t.valueType.indexOf("Category")>-1){var n="DateTimeCategory"===t.valueType?e.getTime().toString():e;return t.labels.indexOf(n)<0?+e:t.labels.indexOf(n)}return+e},t}(Fr),Wr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ur=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Wr(t,e),t.prototype.render=function(e,t,r,o){var n=null,a="",s=e.chart&&"PolarRadar"===e.chart.chartAreaType,l=Math.max(e.yAxis.visibleRange.min,0);s&&(l=this.getFirstLastVisiblePoint(e.points).first.yValue);for(var h,c,d=e.emptyPointSettings&&"Drop"===e.emptyPointSettings.mode,p=e.border?e.border.width:0,u=e.border?e.border.color:"transparent",g="PolarRadar"===e.chart.chartAreaType?z:ve,y=this.enableComplexProperty(e),m=0;m<y.length;m++)h=(c=y[m]).xValue,c.symbolLocations=[],c.regions=[],c.visible&&S(y[m-1],c,y[m+1],e)&&(a+=this.getAreaPathDirection(h,l,e,o,g,n,"M"),n=n||new Vi(h,l),a+=this.getAreaPathDirection(h,c.yValue,e,o,g,null,"L"),y[m+1]&&!y[m+1].visible&&(!s||s&&this.withinYRange(y[m+1],r))&&!d&&(a+=this.getAreaEmptyDirection({x:h,y:l},n,e,o,g),n=null),this.storePointLocation(c,e,o,g));if(s&&""!==a){var v="",f=this.chart;v+=this.getAreaPathDirection(0,l,e,o,g,null,"L"),(t.isInversed||r.isInversed)&&(a+="Polar"===e.type?f.polarSeriesModule.getPolarIsInversedPath(t,v):f.radarSeriesModule.getRadarIsInversedPath(t,v)),a=a.concat(a+" Z")}this.appendLinePath(new i.PathOption(e.chart.element.id+"_Series_"+e.index,e.interior,p,u,e.opacity,e.dashArray,e.points.length>1&&""!==a?a+this.getAreaPathDirection(e.points[e.points.length-1].xValue,"PolarRadar"===e.chart.chartAreaType?e.points[e.points.length-1].yValue:l,e,o,g,null,"L"):""),e,""),this.renderMarker(e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"AreaSeries"},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t}(Gr),Zr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Zr(t,e),t.prototype.render=function(e){for(var t,i,r=Math.max(e.yAxis.visibleRange.min,0),o=this.getSideBySideInfo(e),n=0,a=e.points;n<a.length;n++){var s=a[n];s.symbolLocations=[],s.regions=[],s.visible&&S(e.points[s.index-1],s,e.points[s.index+1],e)&&(t=this.getRectangle(s.xValue+o.start,s.yValue,s.xValue+o.end,r,e),(i=this.triggerEvent(e,s,e.interior,{width:e.border.width,color:e.border.color})).cancel||(this.updateSymbolLocation(s,t,e),this.drawRectangle(e,s,t,i)))}this.renderMarker(e)},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"BarSeries"},t}(jr),Qr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$r=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.visibleAxisLabelRect=[],t}return Qr(t,e),t.prototype.measureAxis=function(e){var t=this.chart;this.initialClipRect=e,this.seriesClipRect=new i.Rect(e.x,e.y,e.width,e.height),this.measureRowAxis(t,this.initialClipRect),this.measureColumnAxis(t,this.initialClipRect),this.calculateAxisSize()},t.prototype.measureRowAxis=function(e,t){this.calculateRowSize(t);var r=e.rows[0];this.measureDefinition(r,e,new i.Size(e.availableSize.width,r.computedHeight))},t.prototype.measureColumnAxis=function(e,t){this.calculateColumnSize(t);var r=e.columns[0];this.measureDefinition(r,e,new i.Size(r.computedWidth,e.availableSize.height))},t.prototype.measureDefinition=function(e,t,i){for(var r=0,o=e.axes;r<o.length;r++){var n=o[r];n.getModule(t),n.baseModule.calculateRangeAndInterval(i,n)}},t.prototype.calculateAxisSize=function(){var e=this.chart;this.centerX=.5*this.initialClipRect.width+this.initialClipRect.x,this.centerY=.5*this.initialClipRect.height+this.initialClipRect.y,e.radius=Math.min(this.initialClipRect.width,this.initialClipRect.height)/2-5-e.primaryXAxis.majorTickLines.height-e.primaryXAxis.maxLabelSize.height,e.radius=e.primaryXAxis.coefficient*e.radius/100,this.seriesClipRect.y=this.centerY-e.radius,this.seriesClipRect.x=this.centerX-e.radius,this.seriesClipRect.height=2*e.radius,this.seriesClipRect.width=2*e.radius,this.calculateRowSize(this.seriesClipRect),e.primaryYAxis.rect=this.seriesClipRect,this.calculateColumnSize(this.seriesClipRect),e.primaryXAxis.rect=this.seriesClipRect},t.prototype.measure=function(){var e=this.chart;e.verticalAxes.push(e.primaryYAxis);var t=e.rows[0];t.axes[0]=e.primaryYAxis,e.rows[0]=t,e.horizontalAxes.push(e.primaryXAxis);var i=e.columns[0];i.axes[0]=e.primaryXAxis,e.columns[0]=i},t.prototype.calculateRowSize=function(e){var t=this.chart,i=t.rows[0];i.computedHeight=e.height/2,i.computedTop=e.y,t.rows[0]=i},t.prototype.calculateColumnSize=function(e){var t=this.chart,i=t.columns[0];i.computedLeft=e.x,i.computedWidth=e.width,t.columns[0]=i},t.prototype.renderAxes=function(){var e,t=this.chart;this.startAngle=t.primaryXAxis.startAngle;for(var i=t.renderer.createGroup({id:t.element.id+"AxisCollection"}),r=t.renderer.createGroup({id:t.element.id+"AxisOutsideCollection"}),o=0,n=t.axisCollections.length;o<n;o++)this.element=t.renderer.createGroup({id:t.element.id+"AxisGroup"+o}),"Horizontal"===(e=t.axisCollections[o]).orientation?((e.majorGridLines.width>0||e.majorTickLines.width>0)&&this.drawXAxisGridLine(e,o),e.visible&&e.internalVisibility&&this.drawXAxisLabels(e,o)):(this.drawYAxisGridLine(e,o),e.lineStyle.width>0&&this.drawYAxisLine(e,o),e.visible&&e.internalVisibility&&this.drawYAxisLabels(e,o)),i.appendChild(this.element);return i.appendChild(this.element),be(t.enableCanvas,t.svgObject,i,t.redraw),r},t.prototype.drawYAxisLine=function(e,t){var i=this.chart,r={},o=B(F(e.visibleLabels[0].value,e),this.startAngle),n="M "+this.centerX+" "+this.centerY+"L "+(this.centerX+i.radius*o.x)+" "+(this.centerY+i.radius*o.y);r={id:i.element.id+"AxisLine_"+t,d:n,"stroke-dasharray":e.lineStyle.dashArray,"stroke-width":e.lineStyle.width,stroke:e.lineStyle.color||i.themeStyle.axisLine};var a=i.renderer.drawPath(r);this.setPointerEventNone(a),i.yAxisElements.appendChild(a)},t.prototype.drawYAxisLabels=function(e,t){var r,o,n,a,s=this.chart,l=0,h=0,c=this.startAngle<0?this.startAngle+360:this.startAngle,d=[],p=[];p[0]=!0;for(var u=e.labelIntersectAction,g=s.renderer.createGroup({id:s.element.id+"AxisLabels"+t}),y=B(F(e.visibleLabels[0].value,e),this.startAngle),m=0,v=e.visibleLabels.length;m<v;m++){if(a=!1,n=s.radius*I(e.visibleLabels[m].value,e),r=e.visibleLabels[m].size,n=s.radius*I(e.visibleLabels[m].value,e),l=this.centerX+n*y.x+(e.majorTickLines.height+r.width/2+2.5)*Math.cos(c*Math.PI/180)*("Inside"===e.labelPosition?1:-1),h=this.centerY+n*y.y+(e.majorTickLines.height+r.height/2)*Math.sin(c*Math.PI/180)*("Inside"===e.labelPosition?1:-1),h+=r.height/4,d[m]=this.getLabelRegion(l,h,e.visibleLabels[m],"middle"),0!==m&&"Hide"===u){for(var f=m;f>=0;f--){if(f=0===f?0:f===m?f-1:f,p[f]&&Le(d[m],d[f])){a=!0,p[m]=!1;break}p[m]=!0}if(a)continue;for(var b=0,x=this.visibleAxisLabelRect;b<x.length;b++){var w=x[b];if(Le(d[m],w)){a=!0;break}}}a||(this.visibleAxisLabelRect.push(d[m]),o=new i.TextOption(s.element.id+t+"_AxisLabel_"+m,l,h,"middle",e.visibleLabels[m].text),Ve(s.renderer,o,e.labelStyle,e.labelStyle.color||s.themeStyle.axisLabel,g,!1,s.redraw,!0,!0,null,null,null,null,s.enableCanvas))}s.yAxisElements.appendChild(g)},t.prototype.drawYAxisGridLine=function(e,t){var r,o,n,a,s,l,h,c=this.chart,d="",p="",u=this.startAngle<0?this.startAngle+360:this.startAngle,g={color:e.majorGridLines.color||c.themeStyle.majorGridLine,width:e.majorGridLines.width};if(e.majorGridLines.width>0)if("Polar"===c.visibleSeries[0].type){for(y=0;y<e.visibleLabels.length;y++)l=(h=he(c.element.id+"_MajorGridLine_"+t+"_"+y))?h.getAttribute("r"):null,o=c.radius*I(e.visibleLabels[y].value,e),r=new Fi(c.element.id+"_MajorGridLine_"+t+"_"+y,"transparent",g,e.majorGridLines.width,this.centerX,this.centerY,o),be(c.enableCanvas,this.element,c.renderer.drawCircle(r),c.redraw,!0,"r","r",new Vi(+l,+l),null,!0);o!==c.radius&&(r=new Fi(c.element.id+"_MajorGridLine_"+t+"_"+e.visibleLabels.length+1,"transparent",g,e.majorGridLines.width,this.centerX,this.centerY,c.radius),be(c.enableCanvas,this.element,c.renderer.drawCircle(r),c.redraw,!0,"r","r",new Vi(+l,+l),null,!0))}else{for(var y=0;y<e.visibleLabels.length;y++)o=c.radius*I(e.visibleLabels[y].value,e),p=this.renderRadarGrid(o,"",c),l=(h=he(c.element.id+"_MajorGridLine_"+t+"_"+y))?h.getAttribute("d"):null,r=new i.PathOption(c.element.id+"_MajorGridLine_"+t+"_"+y,"transparent",e.majorGridLines.width,e.majorGridLines.color||c.themeStyle.majorGridLine,null,null,p),be(c.enableCanvas,this.element,c.renderer.drawPath(r),c.redraw,!0,"x","y",null,l,!0);o!==c.radius&&(p=this.renderRadarGrid(c.radius,"",c),l=(h=he(c.element.id+"_MajorGridLine_"+t+"_"+e.visibleLabels.length))?h.getAttribute("d"):null,r=new i.PathOption(c.element.id+"_MajorGridLine_"+t+"_"+e.visibleLabels.length,"transparent",e.majorGridLines.width,e.majorGridLines.color||c.themeStyle.majorGridLine,null,null,p),be(c.enableCanvas,this.element,c.renderer.drawPath(r),c.redraw,!0,"x","y",null,l,!0))}if(e.majorTickLines.width>0){n=B(F(e.visibleLabels[0].value,e),this.startAngle);for(var m=0;m<e.visibleLabels.length;m++)o=c.radius*I(e.visibleLabels[m].value,e),d="M "+(a=this.centerX+o*n.x)+" "+(s=this.centerY+o*n.y)+" L "+(a+e.majorTickLines.height*Math.cos(u*Math.PI/180)*("Inside"===e.tickPosition?1:-1))+" "+(s+e.majorTickLines.height*Math.sin(u*Math.PI/180)*("Inside"===e.tickPosition?1:-1)),this.renderTickLine(e,t,d,"",m)}},t.prototype.renderRadarGrid=function(e,t,i){for(var r,o,n,a,s,l,h=0,c=i.primaryXAxis.visibleLabels.length;h<c;h++)r=B(F(i.primaryXAxis.visibleLabels[h].value,i.primaryXAxis),this.startAngle),o=h+1<c?B(F(i.primaryXAxis.visibleLabels[h+1].value,i.primaryXAxis),this.startAngle):B(F(i.primaryXAxis.visibleLabels[0].value,i.primaryXAxis),this.startAngle),n=this.centerX+e*r.x,a=this.centerY+e*r.y,s=this.centerX+e*o.x,l=this.centerY+e*o.y,t=t.concat((h?"L ":"M ")+" "+n+" "+a+" L "+s+" "+l+" ");return t},t.prototype.drawXAxisGridLine=function(e,t){for(var i,r,o,n,a,s=this.chart,l="",h="",c="",d="",p=this.centerX,u=this.centerY,g=e.visibleLabels.length,y=0;y<g;y++)i=e.visibleLabels[y].value,r=B(F(e.visibleLabels[y].value,e),this.startAngle),l="M "+p+" "+u+" L "+(o=this.centerX+s.radius*r.x)+" "+(n=this.centerY+s.radius*r.y),h="M "+o+" "+n+" L "+(o+e.majorTickLines.height*r.x*("Inside"===e.tickPosition?-1:1))+" "+(n+e.majorTickLines.height*r.y*("Inside"===e.tickPosition?-1:1)),e.minorTicksPerInterval>0&&(e.minorGridLines.width>0||e.minorTickLines.width>0)&&"Category"!==e.valueType&&"Radar"!==s.visibleSeries[0].type&&(c=(a=this.drawAxisMinorLine(e,i,c,d))[0],d=a[1]),this.renderTickLine(e,t,h,d,y),this.renderGridLine(e,t,l,c,y)},t.prototype.drawAxisMinorLine=function(e,t,i,r){for(var o,n,a,s=t,l=e.visibleRange,h=[],c=0;c<e.minorTicksPerInterval;c++)if(s+=("DateTime"===e.valueType?e.dateTimeInterval:e.visibleRange.interval)/(e.minorTicksPerInterval+1),b(s,l)){a=B(F(s,e),this.startAngle),o=this.centerX+this.chart.radius*a.x,n=this.centerY+this.chart.radius*a.y;var d=o+e.minorTickLines.height*a.x*("Inside"===e.tickPosition?-1:1),p=n+e.minorTickLines.height*a.y*("Inside"===e.tickPosition?-1:1);i=i.concat("M "+this.centerX+" "+this.centerY+"L "+o+" "+n),r=r.concat("M "+o+" "+n+"L "+d+" "+p)}return h.push(i),h.push(r),h},t.prototype.drawXAxisLabels=function(e,t){this.visibleAxisLabelRect=[];var r;this.chart.legendModule&&(r=this.chart.legendModule.legendBounds);var o,n,a,s,l,h,c,d=this.chart,p=0,u=0,g=d.renderer.createGroup({id:d.element.id+"AxisLabels"+t}),y="Inside"===e.labelPosition,m="",v=[],f=[];f[0]=!0;var b=e.labelIntersectAction,x="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0,w=d.radius+e.majorTickLines.height;w=y?-w:w;for(var S=0,C=e.visibleLabels.length;S<C;S++){if(c=!1,n=B(F(e.visibleLabels[S].value+x,e),this.startAngle),isNaN(n.x)||isNaN(n.y)||(p=this.centerX+(w+e.majorTickLines.height+5)*n.x,u=this.centerY+(w+e.majorTickLines.height+5)*n.y,m=parseFloat(p.toFixed(1))===parseFloat(this.centerX.toFixed(1))?"middle":p<this.centerX&&!y||p>this.centerX&&y?"end":"start"),h=e.visibleLabels[S],a=h.text,e.enableTrim||"Trim"===b)for(var P=e.visibleLabels[S].originalText,L=void 0,R=void 0,M=e.labelPosition,A=d.availableSize.width,k=P.length,T=k-1;T>=0;--T)if(L=P.substring(0,T)+"...",R=i.measureText(L,e.labelStyle).width,p===A/2?p-R/2>=0&&p+R/2<=A:"Outside"===M&&(p>=A/2&&p+R<=A||p<=A/2&&p-R>=0)||"Inside"===M&&(p+R<=A/2||p-R>=A/2)){a=T===k-1?P:L,h.size.width=i.measureText(a,e.labelStyle).width,h.text=a;break}if(v[S]=this.getLabelRegion(p,u,h,m),0===S?s=p:S===e.visibleLabels.length-1&&"Category"!==e.valueType&&(l=i.measureText(a,e.labelStyle).height,a=(l+=p)>s?"":a),0!==S&&"Hide"===b)for(var _=S;_>=0;_--){if(_=0===_?0:_===S?_-1:_,f[_]&&Le(v[S],v[_])){c=!0,f[S]=!1;break}f[S]=!0}if(!c&&r&&(c=Le(v[S],r))){var O=this.getAvailableSpaceToTrim(r,v[S]);O>0&&(a=ze(O,e.visibleLabels[S].originalText,e.labelStyle),c=!1)}o=new i.TextOption(d.element.id+t+"_AxisLabel_"+S,p,u,m,a,"","central"),c||(this.visibleAxisLabelRect.push(v[S]),Ve(d.renderer,o,h.labelStyle,h.labelStyle.color||d.themeStyle.axisLabel,g,!1,d.redraw,!0,!0,null,null,null,null,d.enableCanvas))}this.element.appendChild(g)},t.prototype.getAvailableSpaceToTrim=function(e,t){var i=e.x,r=i+e.width,o=t.x,n=o+t.width,a=0;return o>i&&o<r&&n>r?a=n-r:o>i&&o<r&&n<r?a=0:n>i&&n<r&&o<i?a=i-o:n>i&&n>r&&o<i&&(a=i-o),a},t.prototype.getLabelRegion=function(e,t,r,o){return"middle"===o?e-=r.size.width/2:"end"===o?e-=r.size.width:e=e,t-=r.size.height/2,new i.Rect(e,t,r.size.width,r.size.height)},t.prototype.renderTickLine=function(e,t,r,o,n){var a,s,l,h=this.chart;e.majorTickLines.width>0&&(s=(l=he(h.element.id+"_MajorTickLine_"+t+"_"+n))?l.getAttribute("d"):null,a=new i.PathOption(h.element.id+"_MajorTickLine_"+t+"_"+n,"transparent",e.majorTickLines.width,e.majorTickLines.color||h.themeStyle.majorTickLine,null,null,r),l=h.renderer.drawPath(a),this.setPointerEventNone(l),be(h.enableCanvas,h.yAxisElements,l,h.redraw,!0,"x","y",null,s)),e.minorTickLines.width>0&&(s=(l=he(h.element.id+"_MinorTickLine_"+t+"_"+n))?l.getAttribute("d"):null,a=new i.PathOption(h.element.id+"_MinorTickLine_"+t+"_"+n,"transparent",e.minorTickLines.width,e.minorTickLines.color||h.themeStyle.minorTickLine,null,null,o),l=h.renderer.drawPath(a),this.setPointerEventNone(l),be(h.enableCanvas,h.yAxisElements,l,h.redraw,!0,"x","y",null,s))},t.prototype.renderGridLine=function(e,t,r,o,n){var a,s,l,h=this.chart;e.majorGridLines.width>0&&(s=(l=he(h.element.id+"_MajorGridLine_"+t+"_"+n))?l.getAttribute("d"):null,a=new i.PathOption(h.element.id+"_MajorGridLine_"+t+"_"+n,"transparent",e.majorGridLines.width,e.majorGridLines.color||h.themeStyle.majorGridLine,null,e.majorGridLines.dashArray,r),be(h.enableCanvas,this.element,h.renderer.drawPath(a),h.redraw,!0,"x","y",null,s)),e.minorGridLines.width>0&&(s=(l=he(h.element.id+"_MinorGridLine_"+t+"_"+n))?l.getAttribute("d"):null,a=new i.PathOption(h.element.id+"_MinorGridLine_"+t+"_"+n,"transparent",e.minorGridLines.width,e.minorGridLines.color||h.themeStyle.minorGridLine,null,e.minorGridLines.dashArray,o),be(h.enableCanvas,this.element,h.renderer.drawPath(a),h.redraw,!0,"x","y",null,s))},t.prototype.setPointerEventNone=function(e){e&&e.setAttribute("style","pointer-events:none")},t}(Fr),Jr=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Kr=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Jr(r,e),r.prototype.render=function(e,i,r,o){for(var n=G(e.drawType),a=r.minimum,s=r.maximum,l=0,h=e.points;l<h.length;l++){var c=h[l];c.visible=c.visible&&!(!t.isNullOrUndefined(a)&&c.yValue<a||!t.isNullOrUndefined(s)&&c.yValue>s)}e.points.length&&(e.drawType.indexOf("Column")>-1?this.columnDrawTypeRender(e,i,r):e.chart[n+"SeriesModule"].render(e,i,r,o))},r.prototype.columnDrawTypeRender=function(e,t,r){var o,n,a,s,l,h,c,d,p,u,g,y,m,f,b,x,w,C,P,L,R=t.actualRange.min,M=e.clipRect.width/2+e.clipRect.x,A=e.clipRect.height/2+e.clipRect.y,k="RangeColumn"===e.drawType,T="Polar"===e.type,_="Logarithmic"===r.valueType,O="StackingColumn"===e.drawType,E="",z=0,D=(e.points[1]?e.points[1].xValue:2*e.points[0].xValue)-e.points[0].xValue,B="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?0:t.isInversed?-D/2:D/2,F="DateTime"===t.valueType?t.dateTimeInterval:1;this.getSeriesPosition(e);var N=t.isInversed?e.rectCount-1-e.position:e.position;do{z+=F,R+=F}while(R<=t.actualRange.max-("Category"===t.valueType?0:1));for(var V=0,j=e.points;V<j.length;V++){var H=j[V];H.symbolLocations=[],H.regions=[],H.visible&&S(e.points[H.index-1],H,e.points[H.index+1],e)&&(l=(t.isInversed?t.visibleRange.max-H.xValue:H.xValue-t.visibleRange.min)+(D/e.rectCount*N-B)+z/360*t.startAngle,l/=z,a=2*Math.PI*(l+t.startAngle),s=2*Math.PI*(l+t.startAngle+D/e.rectCount/z),0===a&&0===s?(s=2*Math.PI,L="1"):L="0",c=a,d=s,a=a-.5*Math.PI+e.columnSpacing/2,s=s-.5*Math.PI-1e-6-e.columnSpacing/2,O||k?(m=k?H.low:e.stackedValues.startValues[H.index],f=k?H.high:e.stackedValues.endValues[H.index],f=(f=_?v(0===f?1:f,r.logBase):f)>r.actualRange.max?r.actualRange.max:f):(m=r.visibleRange.min,f=H.yValue>r.actualRange.max?r.actualRange.max:H.yValue),p=M+(h=m===f?0:e.chart.radius*I(f,r))*Math.cos(a),u=M+h*Math.cos(s),g=A+h*Math.sin(a),y=A+h*Math.sin(s),x=M+(b=e.chart.radius*I(0===m&&0!==r.visibleRange.min?r.visibleRange.min:m,r))*Math.cos(a),w=A+b*Math.sin(a),C=M+b*Math.cos(s),P=A+b*Math.sin(s),E=T?"M "+p+" "+g+" A "+h+" "+h+" 0 "+L+" 1 "+u+" "+y+" L "+C+" "+P+" A "+b+" "+b+" 1 0 0 "+x+" "+w+" Z":"M "+p+" "+g+" L "+u+" "+y+" L "+C+" "+P+" L "+x+" "+w+" Z",H.regionData=new Ei(c,d,b,h,l),n=this.triggerEvent(e.chart,e,H),o=new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Point_"+H.index,n.fill,n.border.width,n.border.color,e.opacity,e.dashArray,E),n.cancel||(this.appendLinePath(o,e,""),T?(H.symbolLocations.push({x:M+h*Math.cos(a+(s-a)/2),y:A+h*Math.sin(a+(s-a)/2)}),k&&H.symbolLocations.push({x:M+b*Math.cos(a+(s-a)/2),y:A+b*Math.sin(a+(s-a)/2)})):(H.symbolLocations.push({x:(p+u)/2,y:(g+y)/2}),k&&H.symbolLocations.push({x:(C+x)/2,y:(P+w)/2}))))}this.renderMarker(e),e.isRectSeries=!0},r.prototype.triggerEvent=function(e,t,i){var r={cancel:!1,name:"pointRender",series:t,point:i,fill:t.setPointColor(i,t.interior),border:t.setBorderColor(i,{width:t.border.width,color:t.border.color})};return e.trigger("pointRender",r),i.color=r.fill,r},r.prototype.getSeriesPosition=function(e){for(var t=[],i=[],r={rectCount:0,position:null},o=0,n=e.chart.visibleSeries;o<n.length;o++){var a=n[o];!a.visible||"Polar"!==a.type&&"Radar"!==a.type||-1===a.drawType.indexOf("Column")||t.push(a)}for(l=0;l<t.length;l++){var s=t[l];-1!==s.drawType.indexOf("Stacking")?s.stackingGroup?void 0===i[s.stackingGroup]?(s.position=r.rectCount,i[s.stackingGroup]=r.rectCount++):s.position=i[s.stackingGroup]:null===r.position?(s.position=r.rectCount,r.position=r.rectCount++):s.position=r.position:s.position=r.rectCount++}for(var l=0;l<t.length;l++)t[l].rectCount=r.rectCount},r.prototype.doAnimation=function(e){var t=e.animation.duration,i=e.animation.delay,r=e.seriesElement.childNodes,o=1;if("Scatter"===e.drawType)for(var n=0,a=e.points;n<a.length;n++){var s=a[n];s.symbolLocations.length&&r[o]&&(Q(r[o],i,t,e,s.index,s.symbolLocations[0],!1),o++)}else for(o=1;o<r.length;o++)this.doPolarRadarAnimation(r[o],i,t,e)},r.prototype.doPolarRadarAnimation=function(e,i,r,o){var n=o.clipRect.width/2+o.clipRect.x,a=o.clipRect.height/2+o.clipRect.y,s=0;e.style.visibility="hidden",new t.Animation({}).animate(e,{duration:r,delay:i,progress:function(t){t.timeStamp>t.delay&&(t.element.style.visibility="visible",s=(t.timeStamp-t.delay)/t.duration,e.setAttribute("transform","translate("+n+" "+a+") scale("+s+") translate("+-n+" "+-a+")"))},end:function(){e.style.visibility="visible",e.removeAttribute("transform"),o.chart.trigger("animationComplete",{series:o.chart.isBlazor?{}:o})}})},r.prototype.getPolarIsInversedPath=function(e,t){var i,r,o,n=this.chart.radius,a=t,s=e.isInversed?"1 1 ":"1 0 ";return i=B(F(e.visibleLabels[0].value,e),this.startAngle),r=this.centerX+n*i.x,o=this.centerY+n*i.y,a+="L "+r+" "+o+" A "+n+" "+n+" 0 "+s+r+" "+(this.centerY+n)+" A "+n+" "+n+" 0 "+s+r+" "+o+" "},r.prototype.getModuleName=function(){return"PolarSeries"},r.prototype.destroy=function(){},r}($r),eo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),to=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return eo(i,e),i.prototype.render=function(e,i,r,o){for(var n=G(e.drawType),a=r.minimum,s=r.maximum,l=0,h=e.points;l<h.length;l++){var c=h[l];c.visible=c.visible&&!(!t.isNullOrUndefined(a)&&c.yValue<a||!t.isNullOrUndefined(s)&&c.yValue>s)}e.points.length&&(-1===e.drawType.indexOf("Column")?e.chart[n+"SeriesModule"].render(e,i,r,o):this.columnDrawTypeRender(e,i,r))},i.prototype.getRadarIsInversedPath=function(e,t){var i,r,o=this.chart.radius,n=e.visibleLabels.length,a=t;r=B(F(e.visibleLabels[0].value,e),this.startAngle),i=this.centerY+o*r.y,a+=" L "+(this.centerX+o*r.x)+" "+i+" ";for(var s=n-1;s>=0;s--)r=B(F(e.visibleLabels[s].value,e),this.startAngle),i=this.centerY+o*r.y,a+="L "+(this.centerX+o*r.x)+" "+i+" ";return a},i.prototype.getModuleName=function(){return"RadarSeries"},i.prototype.destroy=function(){},i}(Kr),io=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ro=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return io(t,e),t.prototype.render=function(e){for(var t,i,r=this.getSideBySideInfo(e),o=e.stackedValues,n=0,a=e.points;n<a.length;n++){var s=a[n];s.symbolLocations=[],s.regions=[],s.visible&&S(e.points[s.index-1],s,e.points[s.index+1],e)&&(t=this.getRectangle(s.xValue+r.start,o.endValues[s.index],s.xValue+r.end,o.startValues[s.index],e),(i=this.triggerEvent(e,s,e.interior,{width:e.border.width,color:e.border.color})).cancel||(this.drawRectangle(e,s,t,i),this.updateSymbolLocation(s,t,e)))}this.renderMarker(e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StackingBarSeries"},t.prototype.doAnimation=function(e){this.animate(e)},t}(jr),oo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),no=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return oo(t,e),t.prototype.render=function(e){for(var t,i=this.getSideBySideInfo(e),r=Math.max(e.border.width,1),o=0,n=e.points;o<n.length;o++){var a=n[o],s="",l=void 0,h=void 0;a.regions=[],a.symbolLocations=[],a.visible&&S(e.points[a.index-1],a,e.points[a.index+1],e)&&(h=this.getRectangle(a.xValue+i.median,Math.max(a.high,a.low),a.xValue+i.median,Math.min(a.high,a.low),e),e.chart.requireInvertedAxis?(h.y-=r/2,h.height=r):(h.x-=r/2,h.width=r),l=this.getRectangle(a.xValue+i.start,Math.max(a.open,a.close),a.xValue+i.end,Math.min(a.open,a.close),e),s=this.getPathString(h,l,e),(t=this.triggerPointRenderEvent(e,a)).cancel||(this.drawCandle(e,a,l,t,s),this.updateSymbolLocation(a,h,e),this.updateSymbolLocation(a,l,e)))}},t.prototype.triggerPointRenderEvent=function(e,t){var i=this.getCandleColor(t,e),r={color:e.border.color,width:Math.max(e.border.width,1)};return this.triggerEvent(e,t,i,r)},t.prototype.getCandleColor=function(e,t){var i=t.points[e.index-1];return!1===t.enableSolidCandles?i&&i.close>e.close?t.bullFillColor:t.bearFillColor:e.open>e.close?t.bullFillColor:t.bearFillColor},t.prototype.getPathString=function(e,t,i){var r="",o=i.chart.requireInvertedAxis?e.y+e.height/2:e.x+e.width/2;return r+=i.chart.requireInvertedAxis?"M "+e.x+" "+o+" L "+t.x+" "+o:"M "+o+" "+e.y+" L "+o+" "+t.y,r=r.concat(" M "+t.x+" "+t.y+" L "+(t.x+t.width)+" "+t.y+" L "+(t.x+t.width)+" "+(t.y+t.height)+" L "+t.x+" "+(t.y+t.height)+" Z"),r+=i.chart.requireInvertedAxis?" M "+(t.x+t.width)+" "+o+" L "+(e.x+e.width)+" "+o:" M "+o+" "+(t.y+t.height)+" L "+o+" "+(e.y+e.height)},t.prototype.drawCandle=function(e,t,r,o,n){if((e.chart.requireInvertedAxis?r.height:r.width)<=0)return null;var a=e.enableSolidCandles?o.fill:t.open>t.close?o.fill:"transparent";o.border.color=o.fill;var s=new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index,a,o.border.width,o.border.color,e.opacity,e.dashArray,n),l=he(s.id),h=l?l.getAttribute("d"):null,c=e.chart.renderer.drawPath(s,new Int32Array([e.clipRect.x,e.clipRect.y]));c.setAttribute("aria-label",t.x.toString()+":"+t.high.toString()+":"+t.low.toString()+":"+t.close.toString()+":"+t.open.toString()),e.chart.enableCanvas||e.seriesElement.appendChild(c),J(l,n,e.chart.redraw,h)},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.getModuleName=function(){return"CandleSeries"},t.prototype.destroy=function(){},t}(jr),ao=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),so=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ao(t,e),t.prototype.render=function(e){e.isRectSeries=!0;for(var t,i,r=this.getSideBySideInfo(e),o=e.stackedValues,n=g(e),a=0,s=n;a<s.length;a++){var l=s[a];l.symbolLocations=[],l.regions=[],l.visible&&S(n[l.index-1],l,n[l.index+1],e)&&(t=this.getRectangle(l.xValue+r.start,o.endValues[l.index],l.xValue+r.end,o.startValues[l.index],e),(i=this.triggerEvent(e,l,e.interior,{width:e.border.width,color:e.border.color})).cancel||(this.drawRectangle(e,l,t,i),this.updateSymbolLocation(l,t,e)))}this.renderMarker(e)},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StackingColumnSeries"},t}(jr),lo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ho=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return lo(t,e),t.prototype.render=function(e,t,r,o){var n,a,s,l="",h="M",c=null,d=this.enableComplexProperty(e);n="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?.5:0;for(var p=0,u=d;p<u.length;p++){var g=u[p];g.symbolLocations=[],g.regions=[],g.visible&&S(d[g.index-1],g,d[g.index+1],e)?(null!=c?(s=ve(g.xValue,g.yValue,t,r,o),a=ve(c.xValue,c.yValue,t,r,o),l=l.concat(h+" "+a.x+" "+a.y+" L "+s.x+" "+a.y+" L "+s.x+" "+s.y+" "),h="L"):(a=ve(g.xValue-n,g.yValue,t,r,o),l=l.concat(h+" "+a.x+" "+a.y+" "),h="L"),this.storePointLocation(g,e,o,ve),c=g):(c="Drop"===e.emptyPointSettings.mode?c:null,h="Drop"===e.emptyPointSettings.mode?h:"M")}d.length>0&&(a=ve(d[d.length-1].xValue+n,d[d.length-1].yValue,t,r,o),l=l.concat(h+" "+a.x+" "+a.y+" "));var y=new i.PathOption(e.chart.element.id+"_Series_"+e.index,"transparent",e.width,e.interior,e.opacity,e.dashArray,l);this.appendLinePath(y,e,""),this.renderMarker(e)},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StepLineSeries"},t}(Fr),co=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),po=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return co(t,e),t.prototype.render=function(e,t,r,o){var n,a,s,l,h,c=null,d="",p=this.enableComplexProperty(e),u=p.length,g=Math.max(e.yAxis.visibleRange.min,0),y=null;h="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?.5:0;for(var m=0;m<u;m++)l=(s=p[m]).xValue,s.symbolLocations=[],s.regions=[],s.visible&&S(p[m-1],s,p[m+1],e)&&(null===c&&(c=new Vi(l,0),d+="M "+(n=ve(l-h,g,t,r,o)).x+" "+n.y+" ",d+="L "+(n=ve(l-h,s.yValue,t,r,o)).x+" "+n.y+" "),null!=y?(n=ve(s.xValue,s.yValue,t,r,o),a=ve(y.xValue,y.yValue,t,r,o),d+="L "+n.x+" "+a.y+" L "+n.x+" "+n.y+" "):"Gap"===e.emptyPointSettings.mode&&(d+="L "+(n=ve(s.xValue,s.yValue,t,r,o)).x+" "+n.y+" "),this.storePointLocation(s,e,o,ve),y=s),p[m+1]&&!p[m+1].visible&&"Drop"!==e.emptyPointSettings.mode&&(d+="L "+(n=ve(l+h,g,t,r,o)).x+" "+n.y,c=null,y=null);u>1&&""!==d?(d+="L "+(a=ve((c={x:p[u-1].xValue+h,y:p[u-1].yValue}).x,c.y,t,r,o)).x+" "+a.y+" ",d+="L "+(a=ve((c={x:p[u-1].xValue+h,y:g}).x,c.y,t,r,o)).x+" "+a.y+" "):d="";var v=new i.PathOption(e.chart.element.id+"_Series_"+e.index,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,d);this.appendLinePath(v,e,""),this.renderMarker(e)},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StepAreaSeries"},t}(Fr),uo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),go=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return uo(t,e),t.prototype.render=function(e,t,r,o){var n,a,s="PolarRadar"===e.chart.chartAreaType,l=s?z:ve,h="",c=this.enableComplexProperty(e),d=c.length,p=e.stackedValues,u=s?Math.max(e.yAxis.visibleRange.min,p.endValues[0]):Math.max(e.yAxis.visibleRange.min,p.startValues[0]),g=0;d>0&&(n=l(c[0].xValue,u,t,r,o,e),h=h.concat("M "+n.x+" "+n.y+" "));for(var y=e.chart&&"PolarRadar"===e.chart.chartAreaType,m=0;m<d;m++)if(c[m].symbolLocations=[],c[m].regions=[],c[m].visible&&S(c[m-1],c[m],c[m+1],e))n=l(c[m].xValue,p.endValues[m],t,r,o,e),h=h.concat("L "+n.x+" "+n.y+" "),c[m].symbolLocations.push(l(c[m].xValue,p.endValues[m],t,r,o,e)),c[m].regions.push(new i.Rect(c[m].symbolLocations[0].x-e.marker.width,c[m].symbolLocations[0].y-e.marker.height,2*e.marker.width,2*e.marker.height));else if(!y&&"Drop"!==e.emptyPointSettings.mode){for(b=m-1;b>=g;b--)a=l(c[b].xValue,p.startValues[b],t,r,o,e),h=h.concat("L "+a.x+" "+a.y+" ");c[m+1]&&c[m+1].visible&&(!y||y&&this.withinYRange(c[m+1],r))&&(n=l(c[m+1].xValue,p.startValues[m+1],t,r,o,e),h=h.concat("M "+n.x+" "+n.y+" ")),g=m+1}if("PolarRadar"===e.chart.chartAreaType&&c.length>1){var v=this.getFirstLastVisiblePoint(e.points),f=this.chart;h+="L "+(a=l((n={x:v.first.xValue,y:p.endValues[v.first.index]}).x,n.y,t,r,o,e)).x+" "+a.y+" ",1===this.chart.visible&&(t.isInversed||r.isInversed)&&(this.chart.enableAnimation=!1,h="Polar"===e.type?f.polarSeriesModule.getPolarIsInversedPath(t,h):f.radarSeriesModule.getRadarIsInversedPath(t,h))}if(!y||y&&e.index!==this.getFirstSeriesIndex(e.chart.visibleSeries))for(var b=d-1;b>=g;b--)if(!y||c[b].visible){var x=this.getPreviousSeries(e);"Drop"===x.emptyPointSettings.mode&&x.points[b].isEmpty||(a=l(c[b].xValue,p.startValues[b],t,r,o,e),p.startValues[b]===p.endValues[b]&&(a.y=Math.floor(a.y)),h=h.concat((b===d-1&&s?"M":"L")+" "+a.x+" "+a.y+" "))}var w=new i.PathOption(e.chart.element.id+"_Series_"+e.index,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,h);this.appendLinePath(w,e,""),this.renderMarker(e)},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StackingAreaSeries"},t.prototype.getPreviousSeries=function(e){for(var t=e.chart.visibleSeries,i=0,r=t.length;i<r;i++)if(e.index===t[i].index&&0!==i)return t[i-1];return t[0]},t.prototype.getFirstSeriesIndex=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];if(r.visible)return r.index}return 0},t}(Fr),yo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yo(t,e),t.prototype.render=function(e,t,r,o){var n,a,s,l,h,c,d,p,u,g,y=null,m="",v=e.stackedValues,f=this.enableComplexProperty(e),b=Math.max(e.yAxis.visibleRange.min,v.startValues[0]),x=f.length,w=null,C=0;p="Category"===t.valueType&&"BetweenTicks"===t.labelPlacement?.5:0;for(var P=0;P<x;P++)if(l=f[P],d=l.xValue,l.symbolLocations=[],l.regions=[],g=l.index,l.visible&&S(f[P-1],l,f[P+1],e)&&(null===y&&(y=new Vi(d,0),m+="M "+(n=ve(d-p,b,t,r,o)).x+" "+n.y+" ",m+="L "+(n=ve(d-p,v.endValues[g],t,r,o)).x+" "+n.y+" "),null!=w?(n=ve(l.xValue,v.endValues[g],t,r,o),a=ve(w.xValue,v.endValues[w.index],t,r,o),m+="L "+n.x+" "+a.y+" L "+n.x+" "+n.y+" "):"Gap"===e.emptyPointSettings.mode&&(m+="L "+(n=ve(l.xValue,v.endValues[g],t,r,o)).x+" "+n.y+" "),f[P].symbolLocations.push(ve(f[P].xValue,v.endValues[g],t,r,o)),f[P].regions.push(new i.Rect(f[P].symbolLocations[0].x-e.marker.width,f[P].symbolLocations[0].y-e.marker.height,2*e.marker.width,2*e.marker.height)),w=l),f[P+1]&&!f[P+1].visible&&"Drop"!==e.emptyPointSettings.mode){for(var L=void 0,R=P;R>=C;R--)g=f[R].index,L=0===R?0:f[R-1].index,0!==R&&(v.startValues[g]<v.startValues[L]||v.startValues[g]>v.startValues[L])?(n=ve(f[g].xValue,v.startValues[g],t,r,o),m=m.concat("L "+n.x+" "+n.y+" "),n=ve(f[g].xValue,v.startValues[L],t,r,o)):n=ve(f[g].xValue,v.startValues[g],t,r,o),m=m.concat("L "+n.x+" "+n.y+" ");C=P+1,y=null,w=null}if(""!==m){x>1&&(g=f[x-1].index,m+="L "+(a=ve((y={x:f[x-1].xValue+p,y:v.endValues[g]}).x,y.y,t,r,o)).x+" "+a.y+" ",m+="L "+(a=ve((y={x:f[x-1].xValue+p,y:v.startValues[g]}).x,y.y,t,r,o)).x+" "+a.y+" ");for(R=x-1;R>=C;R--){var M=void 0;f[R].visible&&(g=f[R].index,h=ve(f[R].xValue,v.startValues[g],t,r,o),m=m.concat("L "+h.x+" "+h.y+" ")),0===R||f[R-1].visible||(M=this.getNextVisiblePointIndex(f,R)),0!==R&&(u=M||R-1,g=M?f[M].index:f[R-1].index,c=ve(f[u].xValue,v.startValues[g],t,r,o),m=m.concat("L "+h.x+" "+c.y+" "))}s=new i.PathOption(e.chart.element.id+"_Series_"+e.index,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,m),this.appendLinePath(s,e,""),this.renderMarker(e)}},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StackingStepAreaSeries"},t.prototype.getNextVisiblePointIndex=function(e,t){var i;for(i=t-1;i>=0;i--)if(e[i].visible)return i;return 0},t}(Fr),vo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return vo(t,e),t.prototype.render=function(e,t,r,o){for(var n,a,s="PolarRadar"===e.chart.chartAreaType?z:ve,l="",h=this.enableComplexProperty(e),c=h.length,d=e.stackedValues,p=0;p<c;p++)h[p].regions=[],h[p].symbolLocations=[],h[p].visible&&S(h[p-1],h[p],h[p+1],e)?(n=s(h[p].xValue,d.endValues[p],t,r,o,e),l=l.concat((p?"L":"M")+" "+n.x+" "+n.y+" "),h[p].symbolLocations.push(s(h[p].xValue,d.endValues[p],t,r,o,e)),h[p].regions.push(new i.Rect(h[p].symbolLocations[0].x-e.marker.width,h[p].symbolLocations[0].y-e.marker.height,2*e.marker.width,2*e.marker.height))):"Drop"!==e.emptyPointSettings.mode&&h[p+1]&&h[p+1].visible&&(n=s(h[p+1].xValue,d.endValues[p+1],t,r,o,e),l=l.concat("M "+n.x+" "+n.y+" "));"PolarRadar"===e.chart.chartAreaType&&h.length>1&&(l+="L "+(a=s((n={y:d.endValues[0],x:e.points[0].xValue}).x,n.y,t,r,o,e)).x+" "+a.y+" ");var u=new i.PathOption(e.chart.element.id+"_Series_"+e.index,"none",e.width,e.interior,e.opacity,e.dashArray,l);this.appendLinePath(u,e,""),this.renderMarker(e)},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StackingLineSeries"},t}(Fr),bo=function(){function e(){}return e.prototype.render=function(e,t,i,r){e.isRectSeries=!1;for(var o,n,a=e.marker,s=this.enableComplexProperty(e),l="PolarRadar"===e.chart.chartAreaType?z:ve,h=e.chart.redraw,c=0,d=s;c<d.length;c++){var p=d[c];n=h&&p.symbolLocations?p.symbolLocations[0]:null,p.symbolLocations=[],p.regions=[],p.visible&&S(s[p.index-1],p,s[p.index+1],e)&&(o={cancel:!1,name:"pointRender",series:e,point:p,fill:e.setPointColor(p,e.interior),border:e.setBorderColor(p,{width:e.border.width,color:e.border.color}),height:a.height,width:a.width,shape:a.shape},e.chart.trigger("pointRender",o),o.cancel?p.marker={visible:!0}:(p.symbolLocations.push(l(p.xValue,p.yValue,t,i,r,e)),p.color=o.fill,this.refresh(e,p,o,n)))}},e.prototype.enableComplexProperty=function(e){for(var i=[],r=[],o=e.yAxis.visibleRange,n=e.xAxis.visibleRange,a=e.clipRect,s=e.points,l=Math.abs(o.delta/a.height),h=Math.abs(n.delta/a.width),c=s[0]&&s[0].y>l?0:l,d=s[0]&&s[0].x>h?0:h,p=0,u=0,g=0,y=s;g<y.length;g++){var m=y[g];m.symbolLocations=[],p=m.yValue?m.yValue:o.min,u=m.xValue?m.xValue:n.min,(Math.abs(c-p)>=l||Math.abs(d-u)>=h)&&(r.push(m),c=p,d=u)}for(var v,f=0;f<r.length;f++)v=r[f],t.isNullOrUndefined(v.x)||""===v.x||i.push(v);return i},e.prototype.refresh=function(e,t,r,o){var n,a,s=e.chart,l=e.marker,h=r.point.marker.imageUrl||l.imageUrl,c=new i.PathOption(s.element.id+"_Series_"+e.index+"_Point_"+t.index,r.fill,r.border.width,r.border.color,e.opacity,null);s.redraw&&he(c.id)&&(n="Circle"===r.shape?"c":"",a=he(c.id).getAttribute("d")),be(!1,e.seriesElement,ne(t.symbolLocations[0],r.shape,new i.Size(r.width,r.height),h,c,t.x.toString()+":"+t.yValue.toString(),e.chart.svgRenderer,e.clipRect),s.redraw,!0,n+"x",n+"y",o,a),t.regions.push(new i.Rect(t.symbolLocations[0].x-l.width,t.symbolLocations[0].y-l.height,2*l.width,2*l.height)),t.marker={border:r.border,fill:r.fill,height:r.height,visible:!0,width:r.width,shape:r.shape,imageUrl:h}},e.prototype.doAnimation=function(e){for(var t=e.animation.duration,i=e.animation.delay,r=e.seriesElement.childNodes,o=1,n=0,a=e.points;n<a.length;n++){var s=a[n];s.symbolLocations.length&&r[o]&&(Q(r[o],i,t,e,s.index,s.symbolLocations[0],!1),o++)}},e.prototype.getModuleName=function(){return"ScatterSeries"},e.prototype.destroy=function(){},e}(),xo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return xo(t,e),t.prototype.render=function(e){for(var t,i,r=this.getSideBySideInfo(e),o=0,n=e.points;o<n.length;o++){var a=n[o];a.symbolLocations=[],a.regions=[],a.visible&&S(e.points[a.index-1],a,e.points[a.index+1],e)&&(t=this.getRectangle(a.xValue+r.start,a.high,a.xValue+r.end,a.low,e),(i=this.triggerEvent(e,a,e.interior,{width:e.border.width,color:e.border.color})).cancel||(this.updateSymbolLocation(a,t,e),this.drawRectangle(e,a,t,i)))}this.renderMarker(e)},t.prototype.getModuleName=function(){return"RangeColumnSeries"},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.destroy=function(){},t}(jr),So=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Co=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return So(t,e),t.prototype.render=function(e){for(var t,r,o,n,a=this.getSideBySideInfo(e),s=Math.max(e.yAxis.visibleRange.min,0),l=0,h="",c=0,d=null,p=e.chart.requireInvertedAxis,u=0,g=e.chart.redraw,y=0,m=e.points;y<m.length;y++){var v=m[y];if(v.symbolLocations=[],v.regions=[],v.visible&&S(e.points[v.index-1],v,e.points[v.index+1],e)){var f=this.isIntermediateSum(e,v.index),b=this.isSumIndex(e,v.index);c+=f||!0===b?0:v.yValue,o=!0===f?u:null===l||b?s:l,t=this.getRectangle(v.xValue+a.start,c,v.xValue+a.end,o,e),r=this.triggerPointRenderEvent(e,v),f&&(u=c),l=c,r.cancel||(this.updateSymbolLocation(v,t,e),this.drawRectangle(e,v,t,r));var x=v.regions[0];if(null!==d){var w=p?d.x:d.y,C=p?x.x:x.y,P=void 0,L=void 0,R=x.y,M=x.x,A=e.points[v.index-1];0===v.yValue?(P=p?d.x+d.width:d.y+d.height,L=p?v.symbolLocations[0].x:v.symbolLocations[0].y):(P=p?0===A.yValue?A.symbolLocations[0].x:d.x+d.width:0===A.yValue?A.symbolLocations[0].y:d.y+d.height,L=p?x.x+x.width:x.y+x.height),Math.round(w)===Math.round(C)||Math.round(P)===Math.round(C)?(n=p?0===x.x&&0===d.x?L:x.x:x.y,n=0===v.yValue?p?v.symbolLocations[0].x:v.symbolLocations[0].y:n):n=L,p?(0===A.yValue&&(d.y=d.y+d.height/2+t.height/2-d.height),0===v.yValue&&(R=x.y+x.height/2-t.height/2),h=h.concat("M "+n+" "+(d.y+d.height)+" L "+n+" "+R+" ")):(0===A.yValue&&(d.x=d.x+d.width/2-t.width/2,M=x.x+x.width/2+t.width/2-x.width),h=h.concat("M "+d.x+" "+n+" L "+(M+x.width)+" "+n+" "))}d=v.regions[0]}}var k=new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Connector_","none",e.connector.width,e.connector.color,e.opacity,e.connector.dashArray,h);g&&he(k.id)&&(h=he(k.id).getAttribute("d"));var T=Fe(g,k.id,k,e.chart.renderer)||e.chart.renderer.drawPath(k,new Int32Array([e.clipRect.x,e.clipRect.y]));T.style.visibility=e.chart.enableCanvas?null:e.animation.enable&&e.chart.animateSeries?"hidden":"visible",be(e.chart.enableCanvas,e.seriesElement,T,g,!0,null,null,null,h),this.renderMarker(e)},t.prototype.isIntermediateSum=function(e,t){return void 0!==e.intermediateSumIndexes&&-1!==e.intermediateSumIndexes.indexOf(t)},t.prototype.isSumIndex=function(e,t){return void 0!==e.sumIndexes&&-1!==e.sumIndexes.indexOf(t)},t.prototype.triggerPointRenderEvent=function(e,t){var i,r=this.isIntermediateSum(e,t.index),o=this.isSumIndex(e,t.index);return i=r||o?e.summaryFillColor:t.y<0?e.negativeFillColor:e.interior,this.triggerEvent(e,t,i,{color:e.border.color,width:e.border.width})},t.prototype.processInternalData=function(e,t){var i,r=e,o=t.intermediateSumIndexes,n=t.sumIndexes;if(void 0!==o&&o.length>0)for(var a=0;a<o.length;a++)for(l=0;l<r.length;l++)l===o[a]&&(i=0===a?P(r,-1,o[a],null,t):P(r,o[a-1],o[a],null,t),r[l][t.yName]=i);if(void 0!==n&&n.length>0)for(var s=0;s<n.length;s++)for(var l=0;l<r.length;l++)l===n[s]&&(i=void 0!==o?P(r,o[s]-1,n[s],n,t):P(r,-1,n[s],null,t),r[l][t.yName]=i);return r},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.getModuleName=function(){return"WaterfallSeries"},t.prototype.destroy=function(){},t}(jr),Po=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Lo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Po(t,e),t.prototype.render=function(e){for(var t,i,r=this.getSideBySideInfo(e),o=0,n=e.points;o<n.length;o++){var a=n[o];a.symbolLocations=[],a.regions=[],a.visible&&S(e.points[a.index-1],a,e.points[a.index+1],e)&&(t=this.getRectangle(a.xValue+r.median,a.high,a.xValue+r.median,a.low,e),(i=this.triggerPointRenderEvent(e,a)).cancel||(e.chart.requireInvertedAxis?(t.height=i.border.width,t.y=t.y-t.height/2):(t.width=i.border.width,t.x=t.x-t.width/2),i.border.width=0,this.updateSymbolLocation(a,t,e),this.drawRectangle(e,a,t,i)))}},t.prototype.triggerPointRenderEvent=function(t,i){var r={color:t.fill,width:Math.max(t.border.width,2)};return e.prototype.triggerEvent.call(this,t,i,t.interior,r)},t.prototype.getModuleName=function(){return"HiloSeries"},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.destroy=function(){},t}(jr),Ro=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ro(t,e),t.prototype.render=function(e){for(var t,i,r,o,n=this.getSideBySideInfo(e),a=Math.max(e.border.width,2),s=0,l=e.points;s<l.length;s++){var h=l[s];if(h.symbolLocations=[],h.regions=[],h.visible&&S(e.points[h.index-1],h,e.points[h.index+1],e)){if(t=this.getRectangle(h.xValue+n.start,Math.max(h.high,h.low),h.xValue+n.end,Math.min(h.high,h.low),e),h.regions.push(this.getRectangle(h.xValue+n.median,Math.max(h.high,h.low),h.xValue+n.median,Math.min(h.high,h.low),e)),this.updateTickRegion(!e.chart.requireInvertedAxis,h.regions[0],a),h.regions.push(this.getRectangle(h.xValue+n.start,Math.max(h.open,h.close),h.xValue+n.median,Math.max(h.open,h.close),e)),h.regions.push(this.getRectangle(h.xValue+n.median,Math.min(h.open,h.close),h.xValue+n.end,Math.min(h.open,h.close),e)),!(o=this.triggerPointRenderEvent(e,h)).cancel){this.updateSymbolLocation(h,h.regions[0],e),i=h.open>h.close?1:2,r=h.open>h.close?2:1;var c={x:h.regions[i].x,y:h.regions[i].y},d={x:h.regions[r].x,y:h.regions[r].y};this.drawHiloOpenClosePath(e,h,c,d,t,o)}this.updateTickRegion(e.chart.requireInvertedAxis,h.regions[1],a),this.updateTickRegion(e.chart.requireInvertedAxis,h.regions[2],a)}}},t.prototype.updateTickRegion=function(e,t,i){e?(t.x-=i/2,t.width=i):(t.y-=i/2,t.height=i)},t.prototype.triggerPointRenderEvent=function(e,t){var i=t.open<=t.close?e.bearFillColor:e.bullFillColor,r={color:e.border.color,width:Math.max(e.border.width,1)};return this.triggerEvent(e,t,i,r)},t.prototype.drawHiloOpenClosePath=function(e,t,r,o,n,a){var s;e.chart.requireInvertedAxis?(s="M "+n.x+" "+(n.y+n.height/2)+" L "+(n.x+n.width)+" "+(n.y+n.height/2)+" ",s+="M "+r.x+" "+(n.y+n.height/2)+" L "+r.x+" "+(n.y+n.height)+" ",s+="M "+o.x+" "+(n.y+n.height/2)+" L "+o.x+" "+n.y+" "):(s="M "+(n.x+n.width/2)+" "+(n.y+n.height)+" L "+(n.x+n.width/2)+" "+n.y+" ",s+="M "+n.x+" "+r.y+" L "+(n.x+n.width/2)+" "+r.y+" ",s+="M "+(n.x+n.width/2)+" "+o.y+" L "+(n.x+n.width)+" "+o.y+" ");var l=new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index,a.fill,a.border.width,a.fill,e.opacity,e.dashArray,s);J(he(l.id),s,e.chart.redraw);var h=e.chart.renderer.drawPath(l,new Int32Array([e.clipRect.x,e.clipRect.y]));h.setAttribute("aria-label",t.x.toString()+":"+t.high.toString()+":"+t.low.toString()+":"+t.close.toString()+":"+t.open.toString()),e.chart.enableCanvas||e.seriesElement.appendChild(h)},t.prototype.getModuleName=function(){return"HiloOpenCloseSeries"},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.destroy=function(){},t}(jr),Ao=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ko=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ao(t,e),t.prototype.render=function(e,t,r,o){for(var n,a="",s="M",l=void 0,h=this.enableComplexProperty(e),c=0,d=h.length;c<d;c++){(n=h[c]).symbolLocations=[],n.regions=[];var p=Math.min(n.low,n.high),u=Math.max(n.low,n.high);if(r.isInversed){var g=p;p=u,u=g}var y=ve(n.xValue,p,t,r,o),m=ve(n.xValue,u,t,r,o);n.symbolLocations.push(m),n.symbolLocations.push(y);var v=new i.Rect(Math.min(y.x,m.x),Math.min(y.y,m.y),Math.max(Math.abs(m.x-y.x),e.marker.width),Math.max(Math.abs(m.y-y.y),e.marker.width));o?v.y-=e.marker.width/2:v.x-=e.marker.width/2,n.regions.push(v),n.visible&&S(h[n.index-1],n,h[n.index+1],e)?(a=a.concat(s+" "+y.x+" "+y.y+" "),l=!1,(c+1<h.length&&!h[c+1].visible||c===h.length-1)&&(s="M",a=(a=this.closeRangeAreaPath(h,n,e,a,c)).concat(" Z"),l=!0),s="L"):(!1===l&&0!==c&&(a=this.closeRangeAreaPath(h,n,e,a,c),l=!0),s="M",n.symbolLocations=[])}var f="Indicator"===e.category?e.chart.element.id+"_Indicator_"+e.index+"_"+e.name:e.chart.element.id+"_Series_"+e.index,b=new i.PathOption(f,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,a);this.appendLinePath(b,e,""),this.renderMarker(e)},t.prototype.closeRangeAreaPath=function(e,t,i,r,o){for(var n=o;n>=0&&(e[n].visible&&e[n].symbolLocations[0]);n--)r+="L "+(t=e[n]).symbolLocations[0].x+" "+t.symbolLocations[0].y+" ";return r},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.getModuleName=function(){return"RangeAreaSeries"},t.prototype.destroy=function(){},t}(Fr),To=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_o=function(e){function i(t){var i=e.call(this,t)||this;return i.splinePoints=[],i.lowSplinePoints=[],i}return To(i,e),i.prototype.findSplinePoint=function(e){var t,i,r,o=[],n=[],a=0;o=this.filterEmptyPoints(e);for(var s=0;s<o.length;s++)null!==(r=o[s]).x&&""!==r.x&&(r.index=a,a++,n.push(r));var l=!1;if(this.splinePoints=this.findSplineCoefficients(n,e,l),"SplineRangeArea"===e.type&&(l=!l,this.lowSplinePoints=this.findSplineCoefficients(n,e,l)),n.length>1){e.drawPoints=[],e.lowDrawPoints=[];for(var h=0,c=n;h<c.length;h++){var d=c[h];if(0!==d.index){var p=this.getPreviousIndex(n,d.index-1,e);"SplineRangeArea"===e.type&&(n[p].yValue=n[p].high>n[p].low?n[p].high:n[p].low,d.yValue=d.high>d.low?d.high:d.low),t=this.getControlPoints(n[p],d,this.splinePoints[p],this.splinePoints[d.index],e),e.drawPoints.push(t),"SplineRangeArea"===e.type&&(n[p].yValue=n[p].low<n[p].high?n[p].low:n[p].high,d.yValue=d.low<d.high?d.low:d.high,i=this.getControlPoints(n[p],d,this.lowSplinePoints[p],this.lowSplinePoints[d.index],e),e.lowDrawPoints.push(i));var u=e.yMax-e.yMin;d.yValue&&t.controlPoint1.y&&t.controlPoint2.y&&u>1&&(e.yMin=Math.min(e.yMin,d.yValue,t.controlPoint1.y,t.controlPoint2.y),e.yMax=Math.ceil(Math.max(e.yMax,d.yValue,t.controlPoint1.y,t.controlPoint2.y)),e.yMin="Logarithmic"!==e.yAxis.valueType?Math.floor(e.yMin):e.yMin)}}"PolarRadar"===e.chart.chartAreaType&&e.isClosed&&(t=this.getControlPoints({xValue:n[n.length-1].xValue,yValue:n[n.length-1].yValue},{xValue:n[n.length-1].xValue+1,yValue:n[0].yValue},this.splinePoints[0],this.splinePoints[n[n.length-1].index],e),e.drawPoints.push(t))}},i.prototype.getPreviousIndex=function(e,i,r){if("Drop"!==r.emptyPointSettings.mode)return i;for(;t.isNullOrUndefined(e[i])&&i>-1;)i-=1;return i},i.prototype.getNextIndex=function(e,i,r){if("Drop"!==r.emptyPointSettings.mode)return i;for(;t.isNullOrUndefined(e[i])&&i<e.length;)i+=1;return i},i.prototype.filterEmptyPoints=function(e,i){if("Drop"!==e.emptyPointSettings.mode&&this.isPointInRange(e.points))return i||e.points;for(var r=i||t.extend([],e.points,null,!0),o=0;o<r.length;o++)r[o].index=o,r[o].isEmpty&&(r[o].symbolLocations=[],r[o].regions=[],r.splice(o,1),o--);return r},i.prototype.isPointInRange=function(e){for(var t=0,i=e;t<i.length;t++)if(!i[t].isPointInRange)return!1;return!0},i.prototype.findSplineCoefficients=function(e,t,i){var r=[],o=[],n=t.cardinalSplineTension?t.cardinalSplineTension:.5;switch(n=n<0?0:n>1?1:n,t.splineType){case"Monotonic":r=this.monotonicSplineCoefficients(e,t,i);break;case"Cardinal":r=this.cardinalSplineCofficients(e,t,i);break;default:"Clamped"===t.splineType?r=this.clampedSplineCofficients(e,t,i):(r[0]=o[0]=0,r[e.length-1]=0),r=this.naturalSplineCoefficients(e,t,i)}return r},i.prototype.monotonicSplineCoefficients=function(e,t,i){for(var r,o,n=e.length,a=[],s=[],l=[],h=[],c=0;c<n-1;c++)"SplineRangeArea"===t.type&&(i||(e[c+1].yValue=e[c+1].high>e[c+1].low?e[c+1].high:e[c+1].low,e[c].yValue=e[c].high>e[c].low?e[c].high:e[c].low),i&&(e[c+1].yValue=e[c+1].low<e[c+1].high?e[c+1].low:e[c+1].high,e[c].yValue=e[c].low<e[c].high?e[c].low:e[c].high)),s[c]=e[c+1].xValue-e[c].xValue,l[c]=e[c+1].yValue-e[c].yValue,h[c]=l[c]/s[c];o=h.length,a[0]=h[0],a[n-1]=h[o-1];for(var d=0;d<s.length;d++)o>d+1&&(h[d]*h[d+1]<=0?a[d+1]=0:(r=s[d]+s[d+1],a[d+1]=3*r/((r+s[d+1])/h[d]+(r+s[d])/h[d+1])));return a},i.prototype.cardinalSplineCofficients=function(e,t,i){var r=e.length,o=[],n=t.cardinalSplineTension?t.cardinalSplineTension:.5;n=n<0?0:n>1?1:n;for(var a=0;a<r;a++)o[a]=0===a?r>2?n*(e[a+2].xValue-e[a].xValue):0:a===r-1?r>2?n*(e[r-1].xValue-e[r-3].xValue):0:n*(e[a+1].xValue-e[a-1].xValue);return o},i.prototype.clampedSplineCofficients=function(e,t,i){for(var r=e.length,o=[],n=[],a=0;a<r-1;a++)"SplineRangeArea"===t.type&&(i||(e[1].yValue=e[1].high>e[1].low?e[1].high:e[1].low,e[0].yValue=e[0].high>e[0].low?e[0].high:e[0].low,e[e.length-1].yValue=e[e.length-1].high>e[e.length-1].low?e[e.length-1].high:e[e.length-1].low,e[e.length-2].yValue=e[e.length-2].high>e[e.length-2].low?e[e.length-2].high:e[e.length-2].low),i&&(e[1].yValue=e[1].low<e[1].high?e[1].low:e[1].high,e[0].yValue=e[0].low<e[0].high?e[0].low:e[0].high,e[e.length-1].yValue=e[e.length-1].low<e[e.length-1].high?e[e.length-1].low:e[e.length-1].high,e[e.length-2].yValue=e[e.length-2].low<e[e.length-2].high?e[e.length-2].low:e[e.length-2].high)),o[0]=3*(e[1].yValue-e[0].yValue)/(e[1].xValue-e[0].xValue)-3,n[0]=.5,o[e.length-1]=3*(e[e.length-1].yValue-e[e.length-2].yValue)/(e[e.length-1].xValue-e[e.length-2].xValue),o[0]=n[0]=Math.abs(o[0])===1/0?0:o[0],o[e.length-1]=n[e.length-1]=Math.abs(o[e.length-1])===1/0?0:o[e.length-1];return o},i.prototype.naturalSplineCoefficients=function(e,t,i){var r,o,n,a,s,l=e.length,h=[],c=[];h[0]=c[0]=0,h[e.length-1]=0;for(var d=1;d<l-1;d++)if("SplineRangeArea"===t.type&&(i||(e[d+1].yValue=e[d+1].low>e[d+1].high?e[d+1].low:e[d+1].high,e[d].yValue=e[d].low>e[d].high?e[d].low:e[d].high,e[d-1].yValue=e[d-1].low>e[d-1].high?e[d-1].low:e[d-1].high),i&&(e[d+1].yValue=e[d+1].high<e[d+1].low?e[d+1].high:e[d+1].low,e[d].yValue=e[d].high<e[d].low?e[d].high:e[d].low,e[d-1].yValue=e[d-1].high<e[d-1].low?e[d-1].high:e[d-1].low)),n=e[d].xValue-e[d-1].xValue,a=e[d+1].xValue-e[d-1].xValue,s=e[d+1].xValue-e[d].xValue,r=e[d+1].yValue-e[d].yValue||null,o=e[d].yValue-e[d-1].yValue||null,0===n||0===a||0===s)h[d]=0,c[d]=0;else{var p=1/(n*h[d-1]+2*a);h[d]=-p*s,c[d]=p*(6*(r/s-o/n)-n*c[d-1])}for(var u=l-2;u>=0;u--)h[u]=h[u]*h[u+1]+c[u];return h},i.prototype.getControlPoints=function(e,t,i,r,o){var n,a,s,l=i,h=r,c=e.xValue,d=e.yValue,p=t.xValue,u=t.yValue;switch(o.splineType){case"Cardinal":"DateTime"===o.xAxis.valueType&&(l=i/this.dateTimeInterval(o),h=r/this.dateTimeInterval(o)),n=new Vi(c+i/3,d+l/3),a=new Vi(p-r/3,u-h/3),s=new Wi(n,a);break;case"Monotonic":var g=(p-c)/3;n=new Vi(c+g,d+i*g),a=new Vi(p-g,u-r*g),s=new Wi(n,a);break;default:var y=p-c,m=1/3*(d+2*u-1/3*(y*=y)*(.5*i+r));n=new Vi((2*c+p)*(1/3),1/3*(2*d+u-1/3*y*(i+.5*r))),a=new Vi((c+2*p)*(1/3),m),s=new Wi(n,a)}return s},i.prototype.dateTimeInterval=function(e){var t=e.xAxis.actualIntervalType;return"Years"===t?31536e6:"Months"===t?2592e6:"Days"===t?864e5:"Hours"===t?36e5:"Minutes"===t?6e4:"Seconds"===t?1e3:2592e6},i.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},i}(Fr),Oo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Eo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Oo(t,e),t.prototype.render=function(e,t,r,o){var n,a,s,l,h,c,d="",p=void 0,u=null,g=[],y=[],m=0;g=this.filterEmptyPoints(e);for(w=0;w<g.length;w++)null!==(n=g[w]).x&&""!==n.x&&(n.index=m,m++,y.push(n));for(var v,f,b=this.enableComplexProperty(e),x=b.length,w=0;w<x;w++){(n=b[w]).regions=[],n.symbolLocations=[],f=this.getNextIndex(y,n.index-1,e),v=this.getPreviousIndex(y,n.index-1,e);var C=Math.min(n.low,n.high),P=Math.max(n.low,n.high);if(r.isInversed){var L=C;C=P,P=L}var R=ve(n.xValue,C,t,r,o),M=ve(n.xValue,P,t,r,o);n.symbolLocations.push(M),n.symbolLocations.push(R);var A=new i.Rect(Math.min(R.x,M.x),Math.min(R.y,M.y),Math.max(Math.abs(M.x-R.x),e.marker.width),Math.max(Math.abs(M.y-R.y),e.marker.width));o?A.y-=e.marker.width/2:A.x-=e.marker.width/2,n.regions.push(A),n.visible&&S(b[v],n,b[f],e)?(u?(h=e.drawPoints[v].controlPoint1,c=e.drawPoints[v].controlPoint2,a=ve(n.xValue,n.high>n.low?n.high:n.low,t,r,o),s=ve(h.x,h.y,t,r,o),l=ve(c.x,c.y,t,r,o),d=d.concat("C "+s.x+" "+s.y+" "+l.x+" "+l.y+" "+a.x+" "+a.y+" ")):(d=r.isInversed?d.concat("M "+M.x+" "+M.y+" L "+R.x+" "+R.y+" "):d.concat("M "+R.x+" "+R.y+" L "+M.x+" "+M.y+" "),p=!1),(w+1<b.length&&!b[w+1].visible||w===b.length-1)&&(d=(d=this.closeSplineRangeAreaPath(b,n,e,d,w,t,r,o)).concat(" Z"),p=!0),u=n):(!1===p&&0!==w&&(d=this.closeSplineRangeAreaPath(b,n,e,d,w,t,r,o),p=!0),u=null,n.symbolLocations=[])}var k="Indicator"===e.category?e.chart.element.id+"_Indicator_"+e.index+"_"+e.name:e.chart.element.id+"_Series_"+e.index,T=new i.PathOption(k,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,d);this.appendLinePath(T,e,""),this.renderMarker(e)},t.prototype.closeSplineRangeAreaPath=function(e,t,i,r,o,n,a,s){for(var l,h,c,d,p,u=null,g=o;g>0&&e[g].visible;g--){t=e[g];var y=Math.min(t.low,t.high),m=Math.max(t.low,t.high);if(a.isInversed){var v=y;y=m,m=v}var f=ve(t.xValue,y,n,a,s),b=ve(t.xValue,m,n,a,s);u?(d=i.lowDrawPoints[g].controlPoint1,p=i.lowDrawPoints[g].controlPoint2,l=ve(t.xValue,t.low<t.high?t.low:t.high,n,a,s),h=ve(d.x,d.y,n,a,s),c=ve(p.x,p.y,n,a,s),r=r.concat("C "+c.x+" "+c.y+" "+h.x+" "+h.y+" "+l.x+" "+l.y+" ")):r=a.isInversed?r.concat("L "+b.x+" "+b.y+" "):r.concat("L "+f.x+" "+f.y+" "),u=t}return r},t.prototype.doAnimation=function(e){var t=e.animation;this.doLinearAnimation(e,t)},t.prototype.getModuleName=function(){return"SplineRangeAreaSeries"},t.prototype.destroy=function(){},t}(_o),Io=function(){function e(){}return e.prototype.render=function(e,t,r,o){var n,a,s,l,h,c,d=e.marker,p=e.points,u=Math.max(e.chart.initialClipRect.height,e.chart.initialClipRect.width),g=u/100,y=e.maxRadius*g,m=e.minRadius*g,v=null,f=e.chart.redraw;if(null===e.maxRadius||null===e.minRadius){for(var b=0,x=e.chart.visibleSeries;b<x.length;b++){var w=x[b];"Bubble"!==w.type||!0!==w.visible||null!==w.maxRadius&&null!==w.minRadius||(v=w.sizeMax>v?w.sizeMax:v)}m=y=1,l=u/5/2*y}else v=e.sizeMax,l=y-m;for(var C=0,P=p;C<P.length;C++){var L=P[C];L.symbolLocations=[],L.regions=[],L.visible&&S(p[L.index-1],L,p[L.index+1],e)&&(s=(s=null===e.maxRadius||null===e.minRadius?l*Math.abs(+L.size/v):m+l*Math.abs(+L.size/v))||m,a={cancel:!1,name:"pointRender",series:e,point:L,fill:e.setPointColor(L,e.interior),border:e.setBorderColor(L,{width:e.border.width,color:e.border.color}),height:2*s,width:2*s},e.chart.trigger("pointRender",a),a.cancel?L.marker={visible:!1}:(L.symbolLocations.push(ve(L.xValue,L.yValue,t,r,o)),L.color=a.fill,n=new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Point_"+L.index,a.fill,a.border.width,a.border.color,e.opacity,null),h=ne(L.symbolLocations[0],"Circle",new i.Size(a.width,a.height),d.imageUrl,n,L.x.toString()+":"+L.yValue.toString(),e.chart.svgRenderer,e.clipRect),be(!1,e.seriesElement,h,f),L.regions.push(new i.Rect(L.symbolLocations[0].x-s,L.symbolLocations[0].y-s,2*s,2*s)),L.marker={border:a.border,fill:a.fill,height:a.height,visible:!0,shape:"Circle",width:a.width},c=f?L.symbolLocations[0]:null,f&&Ne(h,300,c,L.symbolLocations[0],"cx","cy")))}},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"BubbleSeries"},e.prototype.doAnimation=function(e){for(var t=e.animation.duration,i=e.animation.delay,r=e.seriesElement.childNodes,o=1,n=0,a=e.points;n<a.length;n++){var s=a[n];s.symbolLocations.length&&(Q(r[o],i,t,e,s.index,s.symbolLocations[0],!1),o++)}},e}(),zo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Do=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return zo(t,e),t.prototype.render=function(e,t,r,o){var n=null,a="",s="M",l=[],h="TrendLine"===e.category?e.points:this.enableComplexProperty(e);l=this.filterEmptyPoints(e,h);for(var c,d="PolarRadar"===e.chart.chartAreaType?z:ve,p=0,u=l;p<u.length;p++){var g=u[p];c=this.getPreviousIndex(l,g.index-1,e),g.symbolLocations=[],g.regions=[],g.visible&&S(l[c],g,l[this.getNextIndex(l,g.index-1,e)],e)?(null!==n&&(a=this.getSplineDirection(e.drawPoints[c],n,g,t,r,o,e,s,d,a),s="L"),n=g,this.storePointLocation(g,e,o,d)):(s="M",n=null,g.symbolLocations=[])}if(l.length>0&&e.drawPoints.length>0&&"PolarRadar"===e.chart.chartAreaType&&e.isClosed){var y=this.getFirstLastVisiblePoint(l);a=this.getSplineDirection(e.drawPoints[e.drawPoints.length-1],y.last,{xValue:y.first.xValue,yValue:y.first.yValue},t,r,o,e,s,d,a),s="L"}var m="TrendLine"===e.category?e.chart.element.id+"_Series_"+e.sourceIndex+"_TrendLine_"+e.index:e.chart.element.id+"_Series_"+e.index,v=new i.PathOption(m,"transparent",e.width,e.interior,e.opacity,e.dashArray,a);this.appendLinePath(v,e,""),this.renderMarker(e)},t.prototype.getSplineDirection=function(e,t,i,r,o,n,a,s,l,h){var c=e.controlPoint1,d=e.controlPoint2,p=l(t.xValue,t.yValue,r,o,n,a),u=l(i.xValue,i.yValue,r,o,n,a),g=l(c.x,c.y,r,o,n,a),y=l(d.x,d.y,r,o,n,a);return h.concat(s+" "+p.x+" "+p.y+" C "+g.x+" "+g.y+" "+y.x+" "+y.y+" "+u.x+" "+u.y+" ")},t.prototype.getModuleName=function(){return"SplineSeries"},t.prototype.destroy=function(){},t}(_o),Bo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Bo(t,e),t.prototype.render=function(t){e.prototype.render.call(this,t),t.showNormalDistribution&&this.renderNormalDistribution(t)},t.prototype.calculateBinInterval=function(e,t){for(var i=C(e)/e.length,r=0,o=0,n=e;o<n.length;o++){var a=n[o];r+=(a-i)*(a-i)}t.histogramValues.mean=i,t.histogramValues.sDValue=Math.round(Math.sqrt(r/e.length-1)),t.histogramValues.binWidth=t.binInterval||Math.round(3.5*t.histogramValues.sDValue/Math.pow(e.length,1/3))||1},t.prototype.processInternalData=function(e,t){for(var i,r=[],o=[],n=Object.keys(e),a=0;a<n.length;a++){var s=n[a];o.push(e[s][t.yName])}t.histogramValues={yValues:o};var l=Math.min.apply(Math,t.histogramValues.yValues),h=Math.max.apply(Math,t.histogramValues.yValues);this.calculateBinInterval(t.histogramValues.yValues,t);for(var c,d=t.histogramValues.binWidth,p=0;p<e.length;)c=o.filter(function(e){return e>=l&&e<l+d}).length,l+d===h&&(c+=o.filter(function(e){return e>=h}).length),r.push((i={x:l+d/2},i[t.yName]=c,i)),l+=d,p+=c;return r},t.prototype.calculateBinValues=function(e){var t,i,r=e.histogramValues.yValues.length,o=e.histogramValues.binWidth,n=e.histogramValues.mean,a=e.histogramValues.sDValue,s=e.xAxis.minimum?parseInt(e.xAxis.minimum.toString()):e.xMin,l=((e.xAxis.maximum?parseInt(e.xAxis.maximum.toString()):e.xMax)-s)/499;if(e.points.length)for(var h=0;h<500;h++)t=s+h*l,i=Math.exp(-(t-n)*(t-n)/(2*a*a))/(a*Math.sqrt(2*Math.PI))*o*r,e.yMin=e.yMin>i?i:e.yMin,e.yMax=e.yMax<i?i:e.yMax},t.prototype.renderNormalDistribution=function(e){var t,r,o=e.xAxis.actualRange.min,n=e.xAxis.actualRange.max,a="",s="M",l=e.histogramValues.yValues.length,h=e.histogramValues.binWidth,c=e.histogramValues.mean,d=e.histogramValues.sDValue,p=(n-o)/499;if(e.points.length)for(var u=0;u<500;u++)a+=s+" "+(r=ve(t=o+u*p,Math.exp(-(t-c)*(t-c)/(2*d*d))/(d*Math.sqrt(2*Math.PI))*h*l,e.xAxis,e.yAxis,e.chart.requireInvertedAxis)).x+" "+r.y+" ",s="L";var g=e.chart.renderer.drawPath(new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_NDLine","transparent",2,e.chart.themeStyle.errorBar,e.opacity,e.dashArray,a),new Int32Array([e.clipRect.x,e.clipRect.y]));g.style.visibility=e.chart.enableCanvas?null:e.animation.enable&&e.chart.animateSeries?"hidden":"visible",e.chart.enableCanvas||e.seriesElement.appendChild(g)},t.prototype.doAnimation=function(t){e.prototype.doAnimation.call(this,t),t.showNormalDistribution&&oe(t.seriesElement.lastElementChild,t.animation.duration,500,"FadeIn")},t.prototype.getModuleName=function(){return"HistogramSeries"},t.prototype.destroy=function(){},t}(Xr),No=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return No(t,e),t.prototype.render=function(e,t,r,o){var n,a,s,l,h,c,d=null,p="",u=null,g=null,y=[],m=[],v=0;y=this.filterEmptyPoints(e);for(C=0;C<y.length;C++)null!==(c=y[C]).x&&""!==c.x&&(c.index=v,v++,m.push(c));for(var f,b=m.length,x="PolarRadar"===e.chart.chartAreaType?z:ve,w="PolarRadar"===e.chart.chartAreaType?e.points[0].yValue:Math.max(e.yAxis.visibleRange.min,0),C=0;C<b;C++)(c=m[C]).symbolLocations=[],c.regions=[],f=this.getPreviousIndex(m,c.index-1,e),c.visible&&S(m[f],c,m[this.getNextIndex(m,c.index-1,e)],e)?(d?(l=e.drawPoints[f].controlPoint1,h=e.drawPoints[f].controlPoint2,n=x(c.xValue,c.yValue,t,r,o,e),a=x(l.x,l.y,t,r,o,e),s=x(h.x,h.y,t,r,o,e),p=p.concat("C "+a.x+" "+a.y+" "+s.x+" "+s.y+" "+n.x+" "+n.y+" ")):(p+="M "+(u=x(c.xValue,w,t,r,o,e)).x+" "+u.y+" ",p+="L "+(g=x(c.xValue,c.yValue,t,r,o,e)).x+" "+g.y+" "),this.storePointLocation(c,e,o,x),d=c):(d=null,c.symbolLocations=[]),(C+1<b&&!m[C+1].visible||C===b-1)&&n&&u&&(u=x(c.xValue,w,t,r,o,e),p=p.concat("L "+u.x+" "+u.y));this.appendLinePath(new i.PathOption(e.chart.element.id+"_Series_"+e.index,e.interior,e.border.width,e.border.color,e.opacity,e.dashArray,p),e,""),this.renderMarker(e)},t.prototype.getModuleName=function(){return"SplineAreaSeries"},t.prototype.destroy=function(){},t}(_o),jo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ho=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jo(t,e),t.prototype.initSeriesCollection=function(e,t){e.targetSeries=[];var i=new nr(e,"targetSeries",{},!0);this.setSeriesProperties(i,e,e.type,e.fill,e.width,t)},t.prototype.setSeriesProperties=function(e,t,i,r,o,n){e.name=i.length<=4?i.toLocaleUpperCase():i,e.xName="x",e.yName="y",e.fill=r||"#606eff",e.dashArray=t.dashArray,e.width=o,e.xAxisName=t.xAxisName,e.animation=t.animation,e.yAxisName=t.yAxisName,e.clipRectElement=t.clipRectElement,e.points=[],e.enableTooltip=!0,e.interior=e.fill,e.category="Indicator",e.index=t.index,e.chart=n,e.xMin=1/0,e.xMax=-1/0,e.yMin=1/0,e.yMax=-1/0,e.xData=[],e.yData=[],e.marker.visible=!1,t.targetSeries.push(e)},t.prototype.createIndicatorElements=function(e,t,r){(t.seriesName||t.dataSource)&&Y(t.targetSeries[0]);var o=new i.Rect(0,0,0,0);(t.seriesName||t.dataSource)&&(o=t.targetSeries[0].clipRect);var n=new Di(e.element.id+"_ChartIndicatorClipRect_"+r,"transparent",{width:1,color:"Gray"},1,{x:0,y:0,width:o.width,height:o.height}),a=K(e.redraw,n,e.renderer);t.indicatorElement=e.renderer.createGroup({id:e.element.id+"IndicatorGroup"+r,transform:"translate("+o.x+","+o.y+")","clip-path":"url(#"+e.element.id+"_ChartIndicatorClipRect_"+r+")"}),t.indicatorElement.appendChild(a);for(var s=0,l=t.targetSeries;s<l.length;s++){var h=l[s];h.clipRectElement=a;var c=h.chart.renderer.createGroup({id:h.chart.element.id+"_Indicator_"+t.index+"_"+h.name+"_Group"});t.indicatorElement.appendChild(c),h.seriesElement=c}e.indicatorElements.appendChild(t.indicatorElement)},t.prototype.getDataPoint=function(e,t,i,r,o,n){void 0===n&&(n=null);var a=new Ki;return a.x=e,a.y=t,a.xValue=i.xValue,a.color=r.fill,a.index=o,a.yValue=t,a.visible=!0,r.xMin=Math.min(r.xMin,a.xValue),r.yMin=Math.min(r.yMin,a.yValue),r.xMax=Math.max(r.xMax,a.xValue),r.yMax=Math.max(r.yMax,a.yValue),r.xData.push(a.xValue),n&&"Macd"===n.type&&"Column"===r.type&&(a.y>=0?a.color=n.macdPositiveColor:a.color=n.macdNegativeColor),a},t.prototype.getRangePoint=function(e,t,i,r,o,n){var a=new Ki;return a.x=e,a.high=t,a.low=i,a.xValue=r.xValue,a.color=o.fill,a.index=n,a.visible=!0,o.xData.push(a.xValue),a},t.prototype.setSeriesRange=function(e,t,i){void 0===i&&(i=null),i?i.points=e:t.targetSeries[0].points=e},t}(Fr),Xo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Xo(t,e),t.prototype.initDataSource=function(e,t){var i=[],r=e.points;if(r&&r.length){var o=r,n=G(e.field),a=e.targetSeries[0];if(o&&o.length&&o.length>=e.period){for(var s=0,l=0,h=0;h<e.period;h++)l+=o[h][n];s=l/e.period,i.push(this.getDataPoint(o[e.period-1].x,s,o[e.period-1],a,i.length));for(var c=e.period;c<o.length;)l-=o[c-e.period][n],s=(l+=o[c][n])/e.period,i.push(this.getDataPoint(o[c].x,s,o[c],a,i.length)),c++}this.setSeriesRange(i,e)}},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"SmaIndicator"},t}(Ho),Go=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Go(t,e),t.prototype.initDataSource=function(e,t){var i=G(e.field),r=[],o=e.targetSeries[0],n=e.points;if(n&&n.length&&n.length>=e.period){for(var a=0,s=0,l=2/(e.period+1),h=0;h<e.period;h++)a+=n[h][i];s=a/e.period,r.push(this.getDataPoint(n[e.period-1].x,s,n[e.period-1],o,r.length));for(var c=e.period;c<n.length;){var d=r[c-e.period][o.yName],p=(n[c][i]-d)*l+d;r.push(this.getDataPoint(n[c].x,p,n[c],o,r.length)),c++}}this.setSeriesRange(r,e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"EmaIndicator"},t}(Ho),Uo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Uo(t,e),t.prototype.initDataSource=function(e,t){var i=[],r=G(e.field),o=e.points;if(o&&o.length&&o.length>=e.period){var n=e.targetSeries[0],a=e.points;if(a.length&&a.length>=e.period){for(var s=0,l=[],h=0,c=a.length,d=e.period;c>=d;){s=0;for(u=h=a.length-c;u<h+d;u++)s+=a[u][r];s/=d,l.push(s),c--}for(var p=0;p<d-1;p++){s=0;for(u=0;u<p+1;u++)s+=a[u][r];s/=p+1,l.splice(p,0,s)}for(h=e.period;h<=l.length;){s=0;for(var u=h-e.period;u<h;u++)s+=l[u];s/=e.period,i.push(this.getDataPoint(a[h-1].x,s,a[h-1],n,i.length)),h++}}}this.setSeriesRange(i,e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"TmaIndicator"},t}(Ho),qo=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return qo(t,e),t.prototype.initDataSource=function(e){var t=[],i=e.points;i.length>0&&i.length>e.period&&(t=this.calculateADPoints(e,i)),this.setSeriesRange(t,e)},t.prototype.calculateADPoints=function(e,t){var i=[],r=0,o=0,n=0,a=0,s=0,l=e.targetSeries[0];for(o=0;o<t.length;o++)n=Number(t[o].high),a=Number(t[o].low),r+=((s=Number(t[o].close))-a-(n-s))/(n-a)*Number(t[o].volume),i[o]=this.getDataPoint(t[o].x,r,t[o],l,i.length);return i},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"AccumulationDistributionIndicator"},t}(Ho),$o=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jo=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return $o(t,e),t.prototype.initDataSource=function(e,t){var i=e.points;i.length>0&&i.length>e.period&&this.calculateATRPoints(e,i)},t.prototype.calculateATRPoints=function(e,t){for(var i=0,r=0,o=0,n=0,a=0,s=[],l=[],h=e.period,c=0,d=e.targetSeries[0],p=0;p<t.length;p++)r=Number(t[p].high)-Number(t[p].low),p>0&&(o=Math.abs(Number(t[p].high)-Number(t[p-1].close)),n=Math.abs(Number(t[p].low)-Number(t[p-1].close))),c+=a=Math.max(r,o,n),p>=h?(i=(Number(l[p-1].y)*(h-1)+a)/h,s.push(this.getDataPoint(t[p].x,i,t[p],d,s.length))):(i=c/h,p===h-1&&s.push(this.getDataPoint(t[p].x,i,t[p],d,s.length))),l[p]={x:t[p].x,y:i};this.setSeriesRange(s,e)},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"AtrIndicator"},t}(Ho),Ko=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),en=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ko(t,e),t.prototype.initSeriesCollection=function(t,i){e.prototype.initSeriesCollection.call(this,t,i);var r=new nr(t,"targetSeries",{},!0);e.prototype.setSeriesProperties.call(this,r,t,"UpperLine",t.upperLine.color,t.upperLine.width,i)},t.prototype.initDataSource=function(e,t){var i=[],r=[],o=e.points;if(o&&o.length){var n=e.targetSeries[1],a=e.targetSeries[0],s=e.period;if(o.length>=e.period)for(var l=0;l<o.length;l++)i.push(this.getDataPoint(o[l].x,100,o[l],n,i.length)),l<s||r.push(this.getDataPoint(o[l].x,Number(o[l].close)/Number(o[l-s].close)*100,o[l],a,r.length));this.setSeriesRange(r,e,e.targetSeries[0]),this.setSeriesRange(i,e,e.targetSeries[1])}},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"MomentumIndicator"},t}(Ho),tn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tn(t,e),t.prototype.initSeriesCollection=function(t,i){if(e.prototype.initSeriesCollection.call(this,t,i),t.showZones){var r=new nr(t,"targetSeries",{},!0);e.prototype.setSeriesProperties.call(this,r,t,"LowerLine",t.lowerLine.color,t.lowerLine.width,i);var o=new nr(t,"targetSeries",{},!0);e.prototype.setSeriesProperties.call(this,o,t,"UpperLine",t.upperLine.color,t.upperLine.width,i)}},t.prototype.initDataSource=function(e,t){var i=[],r=[],o=[],n=e.targetSeries[0],a=e.points;if(a.length&&a.length>=e.period){if(e.showZones)for(c=0;c<a.length;c++)o.push(this.getDataPoint(a[c].x,e.overBought,a[c],e.targetSeries[1],o.length)),r.push(this.getDataPoint(a[c].x,e.overSold,a[c],e.targetSeries[2],r.length));for(var s=Number(a[0].close),l=0,h=0,c=1;c<=e.period;c++){var d=Number(a[c].close);d>s?l+=d-s:h+=s-d,s=d}l/=e.period,h/=e.period,i.push(this.getDataPoint(a[e.period].x,100-100/(1+l/h),a[e.period],n,i.length));for(var p=e.period+1;p<a.length;p++){var u=Number(a[p].close);u>s?(l=(l*(e.period-1)+(u-s))/e.period,h=h*(e.period-1)/e.period):u<s&&(h=(h*(e.period-1)+(s-u))/e.period,l=l*(e.period-1)/e.period),s=u,i.push(this.getDataPoint(a[p].x,100-100/(1+l/h),a[p],n,i.length))}}this.setSeriesRange(i,e,e.targetSeries[0]),e.showZones&&(this.setSeriesRange(o,e,e.targetSeries[1]),this.setSeriesRange(r,e,e.targetSeries[2]))},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"RsiIndicator"},t}(Ho),on=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return on(t,e),t.prototype.initSeriesCollection=function(t,i){e.prototype.initSeriesCollection.call(this,t,i);var r=new nr(t,"targetSeries",{},!0);if(this.setSeriesProperties(r,t,"PeriodLine",t.periodLine.color,t.periodLine.width,i),t.showZones){var o=new nr(t,"targetSeries",{},!0);this.setSeriesProperties(o,t,"UpperLine",t.upperLine.color,t.upperLine.width,i);var n=new nr(t,"targetSeries",{},!0);this.setSeriesProperties(n,t,"LowerLine",t.lowerLine.color,t.lowerLine.width,i)}},t.prototype.initDataSource=function(e,t){var i=[],r=[],o=[],n=[],a=[],s=e.points;if(s.length&&s.length>=e.period){if(e.showZones)for(var l=0;l<s.length;l++)r.push(this.getDataPoint(s[l].x,e.overBought,s[l],e.targetSeries[2],r.length)),o.push(this.getDataPoint(s[l].x,e.overSold,s[l],e.targetSeries[3],o.length));a=this.calculatePeriod(e.period,e.kPeriod,s,e.targetSeries[1]),n=this.smaCalculation(e.period,e.kPeriod,a,e.targetSeries[1]),i=this.smaCalculation(e.period+e.kPeriod-1,e.dPeriod,a,e.targetSeries[0])}this.setSeriesRange(i,e,e.targetSeries[0]),this.setSeriesRange(n,e,e.targetSeries[1]),e.showZones&&(this.setSeriesRange(r,e,e.targetSeries[2]),this.setSeriesRange(o,e,e.targetSeries[3]))},t.prototype.smaCalculation=function(e,t,i,r){var o=[];if(i.length>=e+t){for(var n=e+(t-1),a=[],s=[],l=0;l<i.length;l++){var h=Number(i[l].y);a.push(h)}for(var c=a.length;c>=n;){for(var d=0,l=e-1;l<e+t-1;l++)d+=a[l];d/=t,s.push(d.toFixed(2)),a.splice(0,1),c=a.length}for(var p=n-1,l=0;l<i.length;l++)l<p||(o.push(this.getDataPoint(i[l].x,Number(s[l-p]),i[l],r,o.length)),i[l].y=Number(s[l-p]))}return o},t.prototype.calculatePeriod=function(e,t,i,r){for(var o=[],n=[],a=[],s=[],l=0;l<i.length;l++)o[l]=i[l].low,n[l]=i[l].high,a[l]=i[l].close;if(i.length>e){for(var h=[],c=[],d=0;d<e-1;++d)c.push(0),h.push(0),s.push(this.getDataPoint(i[d].x,i[d].close,i[d],r,s.length));for(d=e-1;d<i.length;++d){for(var p=Number.MAX_VALUE,u=Number.MIN_VALUE,l=0;l<e;++l)p=Math.min(p,o[d-l]),u=Math.max(u,n[d-l]);c.push(u),h.push(p)}for(d=e-1;d<i.length;++d){var g=0,y=0;g+=a[d]-h[d],y+=c[d]-h[d],s.push(this.getDataPoint(i[d].x,g/y*100,i[d],r,s.length))}}return s},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"StochasticIndicator"},t}(Ho),an=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return an(t,e),t.prototype.initSeriesCollection=function(e,t){e.targetSeries=[];var i=new nr(e,"targetSeries",{},!0);i.type="RangeArea","transparent"!==e.bandColor&&"none"!==e.bandColor&&this.setSeriesProperties(i,e,"BollingerBand",e.bandColor,0,t);var r=new nr(e,"targetSeries",{},!0);this.setSeriesProperties(r,e,"BollingerBand",e.fill,e.width,t);var o=new nr(e,"targetSeries",{},!0);this.setSeriesProperties(o,e,"UpperLine",e.upperLine.color,e.upperLine.width,t);var n=new nr(e,"targetSeries",{},!0);this.setSeriesProperties(n,e,"LowerLine",e.lowerLine.color,e.lowerLine.width,t)},t.prototype.initDataSource=function(e,t){var i="transparent"!==e.bandColor&&"none"!==e.bandColor,r=i?1:0,o=[],n=[],a=[],s=[],l=e.targetSeries[r+1],h=e.targetSeries[r+2],c=e.targetSeries[r],d=i?e.targetSeries[0]:null,p=e.points;if(p.length&&p.length>=e.period){for(var u=0,g=0,y=e.standardDeviation,m=p.length,v=Math.round(e.period),f=[],b=[],x=[],w=0;w<v;w++)u+=Number(p[w].close);for(var S=u/e.period,C=0;C<m;C++){var P=Number(p[C].close);if(C>=v-1&&C<m){C-e.period>=0?(S=(u+=P-Number(p[C-v].close))/e.period,f[C]=S,b[C]=Math.pow(P-S,2),g+=b[C]-b[C-v]):(f[C]=S,b[C]=Math.pow(P-S,2),g+=b[C]);var L=Math.sqrt(g/e.period),R=f[C]-y*L,M=f[C]+y*L;if(C+1===v)for(var A=0;A<v-1;A++)x[A]={X:p[A].x,mb:f[C],lb:R,ub:M,visible:!0};x[C]={X:p[C].x,mb:f[C],lb:R,ub:M,visible:!0}}else C<e.period-1&&(f[C]=S,b[C]=Math.pow(P-S,2),g+=b[C])}for(var k=-1,T=-1,_=0;_<m;_++)if(_>=v-1){n.push(this.getDataPoint(p[_].x,x[_].ub,p[_],l,n.length)),a.push(this.getDataPoint(p[_].x,x[_].lb,p[_],h,a.length)),o.push(this.getDataPoint(p[_].x,x[_].mb,p[_],c,o.length)),i&&s.push(this.getRangePoint(p[_].x,n[++k].y,a[++T].y,p[_],d,s.length))}}i&&this.setSeriesRange(s,e,e.targetSeries[0]),this.setSeriesRange(o,e,e.targetSeries[r]),this.setSeriesRange(n,e,e.targetSeries[r+1]),this.setSeriesRange(a,e,e.targetSeries[r+2])},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"BollingerBandsIndicator"},t}(Ho),ln=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ln(t,e),t.prototype.initSeriesCollection=function(t,i){if(e.prototype.initSeriesCollection.call(this,t,i),"Line"===t.macdType||"Both"===t.macdType){var r=new nr(t,"targetSeries",{},!0);this.setSeriesProperties(r,t,"MacdLine",t.macdLine.color,t.macdLine.width,i)}if("Histogram"===t.macdType||"Both"===t.macdType){var o=new nr(t,"targetSeries",{},!0);o.type="Column",this.setSeriesProperties(o,t,"Histogram",t.macdPositiveColor,t.width,i)}},t.prototype.initDataSource=function(e,t){var i,r,o=[],n=e.fastPeriod,a=e.slowPeriod,s=e.period,l=n+s,h=[],c=[],d=e.points,p=e.targetSeries[0];if("Histogram"===e.macdType?i=e.targetSeries[1]:(r=e.targetSeries[1],"Both"===e.macdType&&(i=e.targetSeries[2])),d&&l<d.length&&a<=n&&a>0&&l-2>=0){var u=this.calculateEMAValues(a,d,"close"),g=this.calculateEMAValues(n,d,"close"),y=this.getMACDVales(e,u,g);h=this.getMACDPoints(e,y,d,r||p);var m=this.calculateEMAValues(s,h,"y");o=this.getSignalPoints(e,m,d,p),i&&(c=this.getHistogramPoints(e,y,m,d,i))}this.setSeriesRange(o,e,e.targetSeries[0]),i&&this.setSeriesRange(c,e,i),r&&this.setSeriesRange(h,e,r)},t.prototype.calculateEMAValues=function(e,t,i){for(var r=0,o=0,n=[],a=2/(e+1),s=0;s<e;s++)r+=Number(t[s][i]);o=r/e,n.push(o);for(var l=o,h=e;h<t.length;h++)l=(Number(t[h][i])-l)*a+l,n.push(l);return n},t.prototype.getMACDPoints=function(e,t,i,r){for(var o=[],n=e.fastPeriod-1,a=0;n<i.length;)o.push(this.getDataPoint(i[n].x,t[a],i[n],r,o.length)),n++,a++;return o},t.prototype.getSignalPoints=function(e,t,i,r){for(var o=e.fastPeriod+e.period-2,n=0,a=[];o<i.length;)a.push(this.getDataPoint(i[o].x,t[n],i[o],r,a.length)),o++,n++;return a},t.prototype.getMACDVales=function(e,t,i){for(var r=[],o=e.fastPeriod-e.slowPeriod,n=0;n<i.length;n++)r.push(t[n+o]-i[n]);return r},t.prototype.getHistogramPoints=function(e,t,i,r,o){for(var n=e.fastPeriod+e.period-2,a=0,s=[];n<r.length;)s.push(this.getDataPoint(r[n].x,t[a+(e.period-1)]-i[a],r[n],o,s.length,e)),n++,a++;return s},t.prototype.destroy=function(){},t.prototype.getModuleName=function(){return"MacdIndicator"},t}(Ho),cn=function(){function e(){}return e.prototype.initSeriesCollection=function(e,t){var i=new nr(e,"targetSeries",{},!0);"Linear"===e.type||"MovingAverage"===e.type?i.type="Line":i.type="Spline",this.setSeriesProperties(i,e,e.type,e.fill,e.width,t)},e.prototype.setSeriesProperties=function(e,t,i,r,o,n){e.name=t.name,e.xName="x",e.yName="y",e.fill=r||"blue",e.width=o,e.dashArray=t.dashArray,e.clipRectElement=t.clipRectElement,e.points=[],e.enableTooltip=t.enableTooltip,e.index=t.index,e.sourceIndex=t.sourceIndex,e.interior=e.fill,e.animation=t.animation,e.legendShape="HorizontalLine",e.marker=t.marker,e.category="TrendLine",e.chart=n,e.xMin=1/0,e.xMax=-1/0,e.yMin=1/0,e.yMax=-1/0,e.xData=[],e.yData=[],t.targetSeries=e,n.isBlazor&&(t.targetSeries.border={},t.targetSeries.connector={})},e.prototype.createTrendLineElements=function(e,t,i,r,o){t.trendLineElement=r,t.targetSeries.clipRectElement=o,t.targetSeries.seriesElement=r,e.trendLineElements&&e.trendLineElements.appendChild(t.trendLineElement)},e.prototype.getDataPoint=function(e,t,i,r){var o=new Ki;return o.x="DateTime"===i.xAxis.valueType?new Date(Number(e)):e,o.y=t,o.xValue=Number(e),o.color=i.fill,o.index=r,o.yValue=Number(t),o.visible=!0,i.xMin=Math.min(i.xMin,o.xValue),i.yMin=Math.min(i.yMin,o.yValue),i.xMax=Math.max(i.xMax,o.xValue),i.yMax=Math.max(i.yMax,o.yValue),i.xData.push(o.xValue),o},e.prototype.findSlopeIntercept=function(e,t,i,r){for(var o=0,n=0,a=0,s=0,l=0,h=0,c=0;l<r.length;)isNaN(t[l])&&(t[l]=(t[l-1]+t[l+1])/2),o+=e[l],n+=t[l],a+=e[l]*t[l],s+=e[l]*e[l],l++;var d=i.type;if(!i.intercept||"Linear"!==d&&"Exponential"!==d)h=(r.length*a-o*n)/(r.length*s-o*o),h="Linear"===d?h:Math.abs(h),c="Exponential"===d||"Power"===d?Math.exp((n-h*o)/r.length):(n-h*o)/r.length;else switch(c=i.intercept,d){case"Linear":h=(a-i.intercept*o)/s;break;case"Exponential":h=(a-Math.log(Math.abs(i.intercept))*o)/s}return{slope:h,intercept:c}},e.prototype.initDataSource=function(e){var t=e.points;if(t&&t.length){var i=e.targetSeries;switch(e.type){case"Linear":this.setLinearRange(t,e,i);break;case"Exponential":this.setExponentialRange(t,e,i);break;case"MovingAverage":this.setMovingAverageRange(t,e,i);break;case"Polynomial":this.setPolynomialRange(t,e,i);break;case"Power":this.setPowerRange(t,e,i);break;case"Logarithmic":this.setLogarithmicRange(t,e,i)}"Linear"!==e.type&&"MovingAverage"!==e.type&&i.chart.splineSeriesModule.findSplinePoint(i)}},e.prototype.setExponentialRange=function(e,t,i){for(var r=[],o=[],n=0;n<e.length;){var a=e[n],s=a.yValue?Math.log(a.yValue):0;r.push(a.xValue),o.push(s),n++}var l=this.findSlopeIntercept(r,o,t,e);i.points=this.getExponentialPoints(t,e,r,o,i,l)},e.prototype.setLogarithmicRange=function(e,t,i){for(var r=[],o=[],n=[],a=0;a<e.length;){var s=e[a],l=s.xValue?Math.log(s.xValue):0;n.push(s.xValue),r.push(l),o.push(s.yValue),a++}var h=this.findSlopeIntercept(r,o,t,e);i.points=this.getLogarithmicPoints(t,e,n,o,i,h)},e.prototype.setPolynomialRange=function(e,t,i){for(var r=[],o=[],n=0;n<e.length;){var a=e[n];r.push(a.xValue),o.push(a.yValue),n++}i.points=this.getPolynomialPoints(t,e,r,o,i)},e.prototype.setPowerRange=function(e,t,i){for(var r=[],o=[],n=[],a=0;a<e.length;){var s=e[a],l=s.xValue?Math.log(s.xValue):0,h=s.yValue?Math.log(s.yValue):0;n.push(s.xValue),r.push(l),o.push(h),a++}var c=this.findSlopeIntercept(r,o,t,e);i.points=this.getPowerPoints(t,e,n,o,i,c)},e.prototype.setLinearRange=function(e,t,i){for(var r=[],o=[],n=0;n<e.length;){var a=e[n];r.push(a.xValue),o.push(a.yValue),n++}var s=this.findSlopeIntercept(r,o,t,e);i.points=this.getLinearPoints(t,e,r,o,i,s)},e.prototype.setMovingAverageRange=function(e,t,i){for(var r=[],o=[],n=[],a=0;a<e.length;){var s=e[a];n.push(s.xValue),r.push(a+1),o.push(s.yValue),a++}i.points=this.getMovingAveragePoints(t,e,n,o,i)},e.prototype.getLogarithmicPoints=function(e,t,i,r,o,n){var a=Math.round(t.length/2),s=[],l=i[0]-e.backwardForecast,h=l?Math.log(l):0,c=n.intercept+n.slope*h,d=i[a-1],p=d?Math.log(d):0,u=n.intercept+n.slope*p,g=i[i.length-1]+e.forwardForecast,y=g?Math.log(g):0,m=n.intercept+n.slope*y;return s.push(this.getDataPoint(l,c,o,s.length)),s.push(this.getDataPoint(d,u,o,s.length)),s.push(this.getDataPoint(g,m,o,s.length)),s},e.prototype.getPowerPoints=function(e,t,i,r,o,n){var a=Math.round(t.length/2),s=[],l=i[0]-e.backwardForecast;l=l>-1?l:0;var h=n.intercept*Math.pow(l,n.slope),c=i[a-1],d=n.intercept*Math.pow(c,n.slope),p=i[i.length-1]+e.forwardForecast,u=n.intercept*Math.pow(p,n.slope);return s.push(this.getDataPoint(l,h,o,s.length)),s.push(this.getDataPoint(c,d,o,s.length)),s.push(this.getDataPoint(p,u,o,s.length)),s},e.prototype.getPolynomialPoints=function(e,t,i,r,o){var n=t.length<=e.polynomialOrder?t.length:e.polynomialOrder;n=Math.max(2,n),n=Math.min(6,n),e.polynomialOrder=n,e.polynomialSlopes=[],e.polynomialSlopes.length=e.polynomialOrder+1;for(var a=0;a<i.length;){for(var s=i[a],l=r[a],h=0;h<=e.polynomialOrder;)e.polynomialSlopes[h]||(e.polynomialSlopes[h]=0),e.polynomialSlopes[h]+=Math.pow(s,h)*l,++h;a++}var c=[];c.length=1+2*e.polynomialOrder;var d=[];d.length=e.polynomialOrder+1;for(var p=0;p<e.polynomialOrder+1;)d[p]=[],d[p].length=3,p++;for(var u=0;u<i.length;){for(var g=i[u],y=1,m=0;m<c.length;)c[m]||(c[m]=0),c[m]+=y,y*=g,++m;++u}for(var v=0;v<=e.polynomialOrder;){for(var f=0;f<=e.polynomialOrder;)d[v][f]=c[v+f],++f;++v}return this.gaussJordanElimination(d,e.polynomialSlopes)||(e.polynomialSlopes=null),this.getPoints(e,t,i,o)},e.prototype.getMovingAveragePoints=function(e,t,i,r,o){var n=[],a=e.period>=t.length?t.length-1:e.period;a=Math.max(2,a);for(var s,l,h,c,d=0;d<t.length-1;){s=h=c=0;for(var p=d;h<a;p++)h++,r[p]||c++,s+=r[p];(s=a-c<=0?null:s/(a-c))&&!isNaN(s)&&(l=i[a-1+d],n.push(this.getDataPoint(l,s,o,n.length))),d++}return n},e.prototype.getLinearPoints=function(e,t,i,r,o,n){var a=[],s=i.indexOf(Math.max.apply(null,i)),l=i[i.indexOf(Math.min.apply(null,i))]-e.backwardForecast,h=n.slope*l+n.intercept,c=i[s]+e.forwardForecast,d=n.slope*c+n.intercept;return a.push(this.getDataPoint(l,h,o,a.length)),a.push(this.getDataPoint(c,d,o,a.length)),a},e.prototype.getExponentialPoints=function(e,t,i,r,o,n){var a=Math.round(t.length/2),s=[],l=i[0]-e.backwardForecast,h=n.intercept*Math.exp(n.slope*l),c=i[a-1],d=n.intercept*Math.exp(n.slope*c),p=i[i.length-1]+e.forwardForecast,u=n.intercept*Math.exp(n.slope*p);return s.push(this.getDataPoint(l,h,o,s.length)),s.push(this.getDataPoint(c,d,o,s.length)),s.push(this.getDataPoint(p,u,o,s.length)),s},e.prototype.getPoints=function(e,t,i,r){var o,n,a=e.polynomialSlopes,s=[],l=1,h=1;for(t.sort(function(e,t){return e.xValue-t.xValue}),i.sort(function(e,t){return e-t});h<=a.length;)1===h?(o=i[0]-e.backwardForecast,n=this.getPolynomialYValue(a,o),s.push(this.getDataPoint(o,n,r,s.length))):h===a.length?(o=i[t.length-1]+e.forwardForecast,n=this.getPolynomialYValue(a,o),s.push(this.getDataPoint(o,n,r,s.length))):(l+=(t.length+e.forwardForecast)/a.length,o=i[parseInt(l.toString(),10)-1],n=this.getPolynomialYValue(a,o),s.push(this.getDataPoint(o,n,r,s.length))),h++;return s},e.prototype.getPolynomialYValue=function(e,t){for(var i=0,r=0;r<e.length;)i+=e[r]*Math.pow(t,r),r++;return i},e.prototype.gaussJordanElimination=function(e,t){var i=e.length,r=[],o=[],n=[];r.length=i,o.length=i,n.length=i;for(var a=0;a<i;)n[a]=0,++a;for(var s=0;s<i;){for(var l=0,h=0,c=0,d=0;d<i;){if(1!==n[d])for(f=0;f<i;)0===n[f]&&Math.abs(e[d][f])>=l&&(l=Math.abs(e[d][f]),h=d,c=f),++f;++d}if(++n[c],h!==c){for(var p=0;p<i;){v=e[h][p];e[h][p]=e[c][p],e[c][p]=v,++p}var u=t[h];t[h]=t[c],t[c]=u}if(o[s]=h,r[s]=c,0===e[c][c])return!1;var g=1/e[c][c];e[c][c]=1;for(var y=0;y<i;)e[c][y]*=g,++y;t[c]*=g;for(var m=0;m<i;){if(m!==c){var v=e[m][c];e[m][c]=0;for(var f=0;f<i;)e[m][f]-=e[c][f]*v,++f;t[m]-=t[c]*v}++m}++s}for(var b=i-1;b>=0;){if(o[b]!==r[b])for(var x=0;x<i;){var w=e[x][o[b]];e[x][o[b]]=e[x][r[b]],e[x][r[b]]=w,++x}--b}return!0},e.prototype.getTrendLineElements=function(e,t){Y(e);var i=e.clipRect,r=t.renderer.drawClipPath(new Di(t.element.id+"_ChartTrendlineClipRect_"+e.index,"transparent",{width:1,color:"Gray"},1,{x:0,y:0,width:i.width,height:i.height})),o=t.renderer.createGroup({id:t.element.id+"TrendlineSeriesGroup"+e.index,transform:"translate("+i.x+","+i.y+")","clip-path":"url(#"+t.element.id+"_ChartTrendlineClipRect_"+e.index+")"});o&&o.appendChild(r);for(var n=0,a=e.trendlines;n<a.length;n++){var s=a[n];this.createTrendLineElements(t,s,s.index,o,r)}},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"TrendLine"},e}(),dn=function(){function e(e){this.arrowLocation=new Vi(0,0),this.rx=2,this.ry=2,this.chart=e,this.elementID=this.chart.element.id,this.svgRenderer=new i.SvgRenderer(this.chart.element.id),this.addEventListener()}return e.prototype.addEventListener=function(){if(!this.chart.isDestroyed){var e=t.Browser.isPointer?"pointerleave":"mouseleave";this.chart.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(t.Browser.touchEndEvent,this.mouseUpHandler,this),this.chart.on(e,this.mouseLeaveHandler,this),this.chart.on("tapHold",this.longPress,this)}},e.prototype.mouseUpHandler=function(){this.chart.startMove&&this.removeCrosshair(2e3)},e.prototype.mouseLeaveHandler=function(){this.removeCrosshair(1e3)},e.prototype.mouseMoveHandler=function(e){var i=this.chart;"touchmove"===e.type&&(t.Browser.isIos||t.Browser.isIos7)&&i.startMove&&e.preventDefault&&e.preventDefault(),i.disableTrackTooltip||(j(i.mouseX,i.mouseY,i.chartAxisLayoutPanel.seriesClipRect)?!i.startMove&&i.isTouch||this.crosshair():this.removeCrosshair(1e3))},e.prototype.longPress=function(){var e=this.chart;return j(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)&&this.crosshair(),!1},e.prototype.crosshair=function(){var e,r,o=this.chart,n="",a="",s=document.getElementById(this.elementID+"_crosshair_axis"),l=o.crosshair,h=document.getElementById(this.elementID+"_tooltip"),c=o.chartAxisLayoutPanel.seriesClipRect,d=o.enableCanvas?document.getElementById(this.elementID+"_Secondary_Element"):document.getElementById(this.elementID+"_UserInteraction"),p=document.getElementById(this.elementID+"_Crosshair");if(o.enableCanvas&&(p||(p=t.createElement("div",{id:this.elementID+"_Crosshair",styles:"position: absolute; pointer-events: none"}),d.appendChild(p))),this.stopAnimation(),o.tooltip.enable&&!j(o.tooltipModule.valueX,o.tooltipModule.valueY,c))return null;if(o.stockChart&&o.stockChart.onPanning)return this.removeCrosshair(1e3),null;if(this.valueX=o.tooltip.enable?o.tooltipModule.valueX:o.mouseX,this.valueY=o.tooltip.enable?o.tooltipModule.valueY:o.mouseY,o.enableCanvas||d.setAttribute("opacity","1"),"Both"!==l.lineType&&"Horizontal"!==l.lineType||(n+="M "+c.x+" "+this.valueY+" L "+(c.x+c.width)+" "+this.valueY),"Both"!==l.lineType&&"Vertical"!==l.lineType||(a+="M "+this.valueX+" "+c.y+" L "+this.valueX+" "+(c.y+c.height)),o.enableCanvas){s||(s=this.svgRenderer.createGroup({id:this.elementID+"_crosshair_axis"}));var u=o.tooltip.enable?o.element.id+"_tooltip_svg":o.element.id+"_svg";r=this.svgRenderer.createSvg({id:u,width:o.availableSize.width,height:o.availableSize.height}),o.tooltip.enable&&((h=h||o.tooltipModule.createElement()).appendChild(r),d.appendChild(h)),e=new i.PathOption(this.elementID+"_HorizontalLine","none",l.line.width,l.line.color||o.themeStyle.crosshairLine,1,l.dashArray,n),this.drawCrosshairLine(e,p,c.x,this.valueY,c.width,0,n),e.d=a,e.id=this.elementID+"_VerticalLine",this.drawCrosshairLine(e,p,this.valueX,c.y,0,c.height,a),this.renderAxisTooltip(o,c,s),r.appendChild(s),o.tooltip.enable||p.appendChild(r)}else 0===d.childNodes.length?(s=o.renderer.createGroup({id:this.elementID+"_crosshair_axis"}),e=new i.PathOption(this.elementID+"_HorizontalLine","none",l.line.width,l.line.color||o.themeStyle.crosshairLine,1,l.dashArray,n),this.renderCrosshairLine(e,d),e.d=a,e.id=this.elementID+"_VerticalLine",this.renderCrosshairLine(e,d),d.appendChild(s),this.renderAxisTooltip(o,c,d.lastChild)):(document.getElementById(this.elementID+"_HorizontalLine").setAttribute("d",n),document.getElementById(this.elementID+"_VerticalLine").setAttribute("d",a),this.renderAxisTooltip(o,c,d.lastChild))},e.prototype.renderCrosshairLine=function(e,t){var i=this.chart.renderer.drawPath(e);t.appendChild(i)},e.prototype.drawCrosshairLine=function(e,i,r,o,n,a,s){if(!document.getElementById(e.id)&&s){var l=t.createElement("div",{id:e.id});i.appendChild(l)}if(document.getElementById(e.id)){var h="top:"+o.toString()+"px;left:"+r.toString()+"px;width:"+n+"px;height:"+a+"px;fill:"+e.stroke+";border: 0.5px solid black;position: absolute",c=document.getElementById(e.id),d=document.getElementById(this.elementID+"_crosshair_axis");c.setAttribute("style",h),i.style.opacity="1",d&&(d.style.opacity="1")}},e.prototype.renderAxisTooltip=function(e,t,r){for(var o,n,a,s,l,h,c,d,p=0,u=e.axisCollections.length;p<u;p++)if(o=e.axisCollections[p],d=o.placeNextToAxisLine?o.updatedRect:o.rect,o.crosshairTooltip.enable)if(this.valueX<=d.x+d.width&&d.x<=this.valueX||this.valueY<=d.y+d.height&&d.y<=this.valueY){if(s=document.getElementById(this.elementID+"_axis_tooltip_"+p),l=document.getElementById(this.elementID+"_axis_tooltip_text_"+p),!(n=this.getAxisText(o)))continue;a=this.tooltipLocation(n,o,t,d),null===s&&(s=e.enableCanvas?this.svgRenderer.drawPath({id:this.elementID+"_axis_tooltip_"+p,fill:o.crosshairTooltip.fill||e.themeStyle.crosshairFill}):e.renderer.drawPath({id:this.elementID+"_axis_tooltip_"+p,fill:o.crosshairTooltip.fill||e.themeStyle.crosshairFill},null),r.appendChild(s),h=new i.TextOption(this.elementID+"_axis_tooltip_text_"+p,0,0,"start",n),l=Ve(e.enableCanvas?this.svgRenderer:e.renderer,h,o.crosshairTooltip.textStyle,o.crosshairTooltip.textStyle.color||e.themeStyle.crosshairLabel,r,null,null,null,null,null,null,null,null,e.enableCanvas)),c=i.findDirection(this.rx,this.ry,a,this.arrowLocation,10,this.isTop,this.isBottom,this.isLeft,this.valueX,this.valueY),s.setAttribute("d",c),l.textContent=n,l.setAttribute("x",(a.x+5).toString()),l.setAttribute("y",(a.y+5+3*this.elementSize.height/4).toString())}else m(this.elementID+"_axis_tooltip_"+p),m(this.elementID+"_axis_tooltip_text_"+p)},e.prototype.getAxisText=function(e){var t;this.isBottom=!1,this.isTop=!1,this.isLeft=!1,this.isRight=!1;var i="Category"===e.valueType&&"BetweenTicks"===e.labelPlacement?.5:0;return"Horizontal"===e.orientation?(t=H(Math.abs(this.valueX-e.rect.x),e.rect.width,e)+i,this.isBottom=!e.opposedPosition,this.isTop=e.opposedPosition):(t=X(Math.abs(this.valueY-e.rect.y),e.rect.height,e)+i,this.isRight=e.opposedPosition,this.isLeft=!e.opposedPosition),"DateTime"===e.valueType?e.format(new Date(t)):"Category"===e.valueType?e.labels[Math.floor(t)]:"DateTimeCategory"===e.valueType?this.chart.dateTimeCategoryModule.getIndexedAxisLabel(e.labels[Math.floor(t)],e.format):"Logarithmic"===e.valueType?t=e.format(Math.pow(e.logBase,t)):e.labelFormat&&null!==e.labelFormat.match("{value}")?e.labelFormat.replace("{value}",e.format(t)):e.format(t)},e.prototype.tooltipLocation=function(e,t,r,o){var n,a=r.x,s=r.y,l="Inside"===t.labelPosition,h=t.scrollbarSettings.enable||t.zoomingScrollBar&&t.zoomingScrollBar.svgObject?t.scrollBarHeight:0;if(this.elementSize=i.measureText(e,t.crosshairTooltip.textStyle),"Horizontal"===t.orientation){var c=l?o.y-this.elementSize.height-20:o.y+h,d=l?o.y-this.elementSize.height-10:o.y+10;this.arrowLocation=new Vi(this.valueX,c),n=new i.Rect(this.valueX-this.elementSize.width/2-5,d+(l?0:h),this.elementSize.width+10,this.elementSize.height+10),t.opposedPosition&&(n.y=l?o.y:o.y-(this.elementSize.height+10+10)-h),n.x<a&&(n.x=a),n.x+n.width>a+r.width&&(n.x-=n.x+n.width-(a+r.width)),this.arrowLocation.x+5>n.x+n.width-this.rx&&(this.arrowLocation.x=n.x+n.width-this.rx-5),this.arrowLocation.x-5<n.x+this.rx&&(this.arrowLocation.x=n.x+this.rx+5)}else{h*=t.opposedPosition?1:-1,this.arrowLocation=new Vi(o.x,this.valueY);var p=l?o.x-h:o.x-this.elementSize.width-20;n=new i.Rect(p+h,this.valueY-this.elementSize.height/2-5,this.elementSize.width+10,this.elementSize.height+10),t.opposedPosition?(n.x=l?o.x-this.elementSize.width-10:o.x+10+h,n.x+n.width>this.chart.availableSize.width&&(this.arrowLocation.x-=n.x+n.width-this.chart.availableSize.width,n.x-=n.x+n.width-this.chart.availableSize.width)):n.x<0&&(this.arrowLocation.x-=n.x,n.x=0),n.y<s&&(n.y=s),n.y+n.height>=s+r.height&&(n.y-=n.y+n.height-(s+r.height)),this.arrowLocation.y+5>n.y+n.height-this.ry&&(this.arrowLocation.y=n.y+n.height-this.ry-5),this.arrowLocation.y-5<n.y+this.ry&&(this.arrowLocation.y=n.y+this.ry+5)}return n},e.prototype.stopAnimation=function(){Ce(this.crosshairInterval)},e.prototype.progressAnimation=function(){Ce(this.crosshairInterval)},e.prototype.removeCrosshair=function(e){var i=this.chart,r=i.enableCanvas?document.getElementById(this.elementID+"_Crosshair"):document.getElementById(this.elementID+"_UserInteraction"),o=i.enableCanvas?document.getElementById(this.elementID+"_crosshair_axis"):null;this.stopAnimation(),r&&"0"!==r.getAttribute("opacity")&&(this.crosshairInterval=+setTimeout(function(){new t.Animation({}).animate(r,{duration:200,progress:function(e){r.style.animation="",i.enableCanvas?(r.style.opacity=(1-e.timeStamp/e.duration).toString(),o.style.opacity=(1-e.timeStamp/e.duration).toString()):r.setAttribute("opacity",(1-e.timeStamp/e.duration).toString())},end:function(){i.enableCanvas?(r.style.opacity="0",o.style.opacity="0"):r.setAttribute("opacity","0"),i.startMove=!1,i.tooltipModule&&(i.tooltipModule.valueX=null,i.tooltipModule.valueY=null)}})},e))},e.prototype.getModuleName=function(){return"Crosshair"},e.prototype.destroy=function(){},e}(),pn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),un=function(e){function r(t){var i=e.call(this,t)||this;return i.element=i.chart.element,i.textStyle=t.tooltip.textStyle,i.control=t,i}return pn(r,e),r.prototype.getElement=function(e){return document.getElementById(e)},r.prototype.getTooltipElement=function(e){this.inverted=this.chart.requireInvertedAxis,this.header=null===this.control.tooltip.header?this.control.tooltip.shared?"<b>${point.x}</b>":"<b>${series.name}</b>":this.control.tooltip.header,this.formattedText=[];var t=document.getElementById(this.chart.element.id+"_tooltip"),i=this.chart.element.id.indexOf("stockChart")>-1;return!e&&!t||i?this.createElement():null},r.prototype.createElement=function(){var e=document.createElement("div");return e.id=this.element.id+"_tooltip",e.className="ejSVGTooltip",e.setAttribute("style","pointer-events:none; position:absolute;z-index: 1"),e},r.prototype.pushData=function(e,t,i,r){return!!e.series.enableTooltip&&(this.currentPoints.push(e),this.stopAnimation(),i&&!document.getElementById(i.id)&&(this.chart.stockChart?document.getElementById(this.chart.stockChart.element.id+"_Secondary_Element").appendChild(i):document.getElementById(this.element.id+"_Secondary_Element").appendChild(i)),!0)},r.prototype.removeHighlight=function(){for(var e,t=0,i=this.previousPoints.length;t<i;t++)(e=this.previousPoints[t]).series.isRectSeries?e.series.visible&&this.highlightPoint(e.series,e.point.index,!1):e.series.marker.visible||"Scatter"===e.series.type||"Bubble"===e.series.type||(this.previousPoints.shift(),i-=1)},r.prototype.highlightPoint=function(e,t,i){var r=this.getElement(this.element.id+"_Series_"+e.index+"_Point_"+t),o=this.control.accumulationSelectionModule,n=!!(o&&o.selectedDataIndexes.length>0);r&&(!n||n&&r.getAttribute("class")&&-1===r.getAttribute("class").indexOf("_ej2_chart_selection_series_")?r.setAttribute("opacity",(i?e.opacity/2:e.opacity).toString()):r.setAttribute("opacity",e.opacity.toString()))},r.prototype.highlightPoints=function(){for(var e=0,t=this.currentPoints;e<t.length;e++){var i=t[e];i.series.isRectSeries&&"Series"===i.series.category&&this.highlightPoint(i.series,i.point.index,!0)}},r.prototype.createTooltip=function(e,t,r,o,n,a,s,l,h,c,d){void 0===h&&(h=null),void 0===c&&(c=null);var p=this.currentPoints[0].series,u=e.tooltipModule||e.accumulationTooltipModule;if(u){var g=p.isRectSeries&&"Waterfall"!==p.type&&n&&n.y<0,y=this.chart.requireInvertedAxis&&p.isRectSeries,m=null;if(this.text.length<=1){var v=void 0,f=void 0;if(e.tooltip.template&&"chart"===e.getModuleName()&&"#"!==e.tooltip.template[0]&&"string"==typeof e.tooltip.template){var b=document.createElement("div");b.id="testing_template",b.className="ejSVGTooltip",b.setAttribute("style","pointer-events:none; position:absolute;z-index: 1"),document.getElementById(this.chart.element.id+"_Secondary_Element").appendChild(b);var x=e.tooltip.template.replaceAll("${x}",n.x).replaceAll("${y}",n.y);b.innerHTML=x,v=new i.Size(b.firstElementChild.offsetWidth,b.firstElementChild.offsetHeight),f=new i.Size(0,0),b.remove()}else v=i.measureText(this.text[0],e.tooltip.textStyle),f=""!==this.header&&"<b></b>"!==this.header?i.measureText(this.header,this.textStyle):new i.Size(0,0);v.width=Math.max(v.width,f.width)+(a.length>0?47:0);var w=32+(f.height>0?20:0);v.height=v.height+f.height+w,m=this.getCurrentPosition(g,y),g="Left"===(m=this.getPositionBySize(v,new i.Rect(0,0,l.width,l.height),r,m))||"Bottom"===m,y="Left"===m||"Right"===m}t?this.svgTooltip=new i.Tooltip({opacity:e.tooltip.opacity,header:this.headerText,content:this.text,fill:e.tooltip.fill,border:e.tooltip.border,enableAnimation:e.tooltip.enableAnimation,location:r,shared:e.tooltip.shared,shapes:a,clipBounds:"PolarRadar"===this.chart.chartAreaType?new Vi(0,0):o,areaBounds:l,palette:this.findPalette(),template:d||e.tooltip.template,data:c,theme:e.theme,offset:s,textStyle:e.tooltip.textStyle,isNegative:g,inverted:y,arrowPadding:this.text.length>1||this.chart.stockChart?0:12,availableSize:e.availableSize,duration:this.chart.tooltip.duration,isCanvas:this.chart.enableCanvas,isTextWrap:e.tooltip.enableTextWrap&&"chart"===e.getModuleName(),blazorTemplate:{name:"Template",parent:this.chart.tooltip},controlInstance:this.chart,tooltipPlacement:m,tooltipRender:function(){u.removeHighlight(),u.highlightPoints(),u.updatePreviousPoint(h)},animationComplete:function(e){e.tooltip.fadeOuted&&u.fadeOut(u.previousPoints)}},"#"+this.element.id+"_tooltip"):this.svgTooltip&&(this.svgTooltip.location=r,this.svgTooltip.content=this.text,this.svgTooltip.header=this.headerText,this.svgTooltip.offset=s,this.svgTooltip.palette=this.findPalette(),this.svgTooltip.shapes=a,this.svgTooltip.data=c,this.svgTooltip.template=e.tooltip.template,this.svgTooltip.textStyle=e.tooltip.textStyle,this.svgTooltip.isNegative=g,this.svgTooltip.inverted=y,this.svgTooltip.clipBounds="PolarRadar"===this.chart.chartAreaType?new Vi(0,0):o,this.svgTooltip.arrowPadding=this.text.length>1||this.chart.stockChart?0:12,this.svgTooltip.tooltipPlacement=m,this.svgTooltip.dataBind()),this.chart.isReact&&this.chart.renderReactTemplates()}},r.prototype.getPositionBySize=function(e,t,r,o){var n=this.isTooltipFitPosition("Top",new i.Rect(0,0,t.width,t.height),r,e),a=this.isTooltipFitPosition("Bottom",new i.Rect(0,0,t.width,t.height),r,e),s=this.isTooltipFitPosition("Right",new i.Rect(0,0,t.width,t.height),r,e),l=this.isTooltipFitPosition("Left",new i.Rect(0,0,t.width,t.height),r,e);if(!(n||a||s||l)){var h=[r.x-t.x,t.x+t.width-r.x,r.y-t.y,t.y+t.height-r.y],c=h.indexOf(Math.max.apply(this,h));return o=0===c?"Left":1===c?"Right":2===c?"Top":"Bottom"}return"Top"===o?n?"Top":a?"Bottom":s?"Right":"Left":"Bottom"===o?a?"Bottom":n?"Top":s?"Right":"Left":"Right"===o?s?"Right":l?"Left":n?"Top":"Bottom":l?"Left":s?"Right":n?"Top":"Bottom"},r.prototype.isTooltipFitPosition=function(e,t,i,r){var o=new Vi(0,0),n=new Vi(0,0);switch(e){case"Top":o.x=i.x-r.width/2,o.y=i.y-r.height,n.x=i.x+r.width/2,n.y=i.y;break;case"Bottom":o.x=i.x-r.width/2,o.y=i.y,n.x=i.x+r.width/2,n.y=i.y+r.height;break;case"Right":o.x=i.x,o.y=i.y-r.height/2,n.x=i.x+r.width,n.y=i.y+r.height/2;break;case"Left":o.x=i.x-r.width,o.y=i.y-r.height/2,n.x=i.x,n.y=i.y+r.height/2}return j(o.x,o.y,t)&&j(n.x,n.y,t)},r.prototype.getCurrentPosition=function(e,t){return t?e?"Left":"Right":e?"Bottom":"Top"},r.prototype.findPalette=function(){for(var e=[],t=0,i=this.currentPoints;t<i.length;t++){var r=i[t];e.push(this.findColor(r,r.series))}return e},r.prototype.findColor=function(e,t){return!t.isRectSeries||"Candle"!==t.type&&"Hilo"!==t.type&&"HiloOpenClose"!==t.type?(e.point.color&&"#ffffff"!==e.point.color?e.point.color:e.point.interior)||t.marker.fill||t.interior:e.point.color},r.prototype.updatePreviousPoint=function(e){e&&(this.currentPoints=this.currentPoints.concat(e)),this.previousPoints=t.extend([],this.currentPoints,null,!0)},r.prototype.fadeOut=function(e){var t=this.chart.enableCanvas?this.getElement(this.element.id+"_tooltip_group"):this.getElement(this.element.id+"_tooltip_svg");t&&parseInt(t.getAttribute("opacity"),10)>0||(this.valueX=null,this.valueY=null,this.currentPoints=[],this.removeHighlight(),this.removeHighlightedMarker(e),this.svgTooltip=null,this.control.trigger("animationComplete",{}))},r.prototype.removeHighlightedMarker=function(e){if(this.chart.markerRender){for(var t=0,i=e;t<i.length;t++){var r=i[t];m(this.element.id+"_Series_"+r.series.index+"_Point_"+r.point.index+"_Trackball")}this.chart.markerRender.removeHighlightedMarker()}this.previousPoints=[]},r.prototype.removeText=function(){this.textElements=[];var e=this.getElement(this.element.id+"_tooltip_group");if(e&&e.childNodes.length>0)for(;e.lastChild&&1!==e.childNodes.length;)e.removeChild(e.lastChild)},r.prototype.stopAnimation=function(){Ce(this.toolTipInterval)},r.prototype.removeTooltip=function(e){var t=this,i=this.getElement(this.element.id+"_tooltip"),r=i?this.getElement(i.id+"parent_template"):null,o=r&&"<div></div>"!==r.innerHTML;this.stopAnimation(),this.chart.isReact&&o&&this.chart.clearTemplate([r.id],[0]),i&&this.previousPoints.length>0&&(this.toolTipInterval=+setTimeout(function(){t.svgTooltip&&t.svgTooltip.fadeOut()},e))},r}(Zi),gn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yn=function(e){function r(t){var i=e.call(this,t)||this;return i.addEventListener(),i}return gn(r,e),r.prototype.addEventListener=function(){if(!this.chart.isDestroyed){var e=t.Browser.isPointer?"pointerleave":"mouseleave";this.chart.on(e,this.mouseLeaveHandler,this),this.chart.on("tapHold",this.longPress,this),this.chart.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(t.Browser.touchEndEvent,this.mouseUpHandler,this)}},r.prototype.mouseUpHandler=function(){var e=this.control;e.isTouch&&!this.isSelected(e)&&(j(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)&&e.tooltip.shared||!e.tooltip.shared)&&(e.crosshair.enable?e.startMove&&this.removeTooltip(2e3):(this.tooltip(),this.removeTooltip(2e3)))},r.prototype.mouseLeaveHandler=function(){this.removeTooltip(this.chart.tooltip.fadeOutDuration)},r.prototype.mouseMoveHandler=function(){var e=this.chart;e.disableTrackTooltip||this.isSelected(e)||(e.tooltip.shared||e.isTouch&&!e.startMove||this.tooltip(),j(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)?!e.tooltip.shared||e.isTouch&&!e.startMove||this.tooltip():e.tooltip.shared&&this.removeTooltip(this.chart.tooltip.fadeOutDuration))},r.prototype.longPress=function(){var e=this.chart;return e.crosshair.enable&&j(e.mouseX,e.mouseY,e.chartAxisLayoutPanel.seriesClipRect)&&this.tooltip(),!1},r.prototype.tooltip=function(){if(this.chart.stockChart&&this.chart.stockChart.onPanning)return this.removeTooltip(1e3),null;var e=this.chart.enableCanvas?this.element.id+"_tooltip_group":this.element.id+"_tooltip_svg",t=this.getElement(e),i=this.chart.stockChart&&t&&t.firstChild.childNodes.length>1,r=t&&parseInt(t.getAttribute("opacity"),10)>0&&!i,o=this.getTooltipElement(r);this.chart.enableCanvas&&o&&(document.getElementById(this.chart.element.id+"_Secondary_Element").appendChild(o),o.appendChild(document.getElementById(this.chart.element.id+"_tooltip_svg"))),this.chart.tooltip.shared?this.renderGroupedTooltip(this.chart,!r,o):this.renderSeriesTooltip(this.chart,!r,o)},r.prototype.findHeader=function(e){return""===this.header?"":(this.header=this.parseTemplate(e.point,e.series,this.header,e.series.xAxis,e.series.yAxis),""!==this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim()?this.header:"")},r.prototype.findShapes=function(){if(!this.chart.tooltip.enableMarker)return[];for(var e=[],t=0,i=this.currentPoints;t<i.length;t++){var r=i[t];e.push(r.point.marker.shape||r.series.marker.shape)}return e},r.prototype.renderSeriesTooltip=function(e,t,i){var r=this.getData();if(r.lierIndex=this.lierIndex,this.currentPoints=[],this.findData(r,this.previousPoints[0])){if((!e.dataEditingModule||!e.dataEditingModule.isPointDragging)&&this.previousPoints[0]&&r.point.index===this.previousPoints[0].point.index&&r.series.index===this.previousPoints[0].series.index)return null;this.pushData(r,t,i,!0)&&this.triggerTooltipRender(r,t,this.getTooltipText(r),this.findHeader(r))}else if(!r.point&&this.isRemove)this.removeTooltip(this.chart.tooltip.fadeOutDuration),this.isRemove=!1;else for(var o=this.mergeXvalues(this.chart.visibleSeries),n=0,a=e.visibleSeries;n<a.length;n++){var s=a[n];s.visible&&"TrendLine"!==s.category&&(r=this.getClosestX(e,s,o)||r)}r&&r.point&&this.findMouseValue(r,e)},r.prototype.triggerTooltipRender=function(e,i,r,o){var n=this,a={cancel:!1,name:"tooltipRender",text:r,headerText:o,template:void 0,series:this.chart.isBlazor?{}:e.series,textStyle:this.textStyle,point:e.point,data:{pointX:e.point.x,pointY:e.point.y,seriesIndex:e.series.index,seriesName:e.series.name,pointIndex:e.point.index,pointText:e.point.text}},s=function(r){r.cancel?(n.removeHighlight(),t.remove(n.getElement(n.element.id+"_tooltip"))):("BoxAndWhisker"===e.series.type&&(n.removeText(),i=!0),n.headerText=r.headerText,n.formattedText=n.formattedText.concat(r.text),n.text=n.formattedText,n.createTooltip(n.chart,i,n.getSymbolLocation(e),e.series.clipRect,e.point,n.findShapes(),n.findMarkerHeight(n.currentPoints[0]),n.chart.chartAxisLayoutPanel.seriesClipRect,null,n.getTemplateText(e),n.chart.tooltip.template?r.template:"")),n.isRemove=!0};s.bind(this,e),this.chart.trigger("tooltipRender",a,s)},r.prototype.findMarkerHeight=function(e){if(!this.chart.tooltip.enableMarker)return 0;var t=e.series;return(t.marker.visible||this.chart.tooltip.shared&&(!t.isRectSeries||t.marker.visible)||"Scatter"===t.type||"Scatter"===t.drawType)&&"Candle"!==t.type&&"Hilo"!==t.type&&"HiloOpenClose"!==t.type?(t.marker.height+2)/2+2*t.marker.border.width:0},r.prototype.findData=function(e,t){return e.point&&(!t||t.point!==e.point||t&&t.lierIndex>3&&t.lierIndex!==this.lierIndex||t.point===e.point)},r.prototype.getSymbolLocation=function(e){var t;if("BoxAndWhisker"!==e.series.type){if(!e.point.symbolLocations[0])return null;t=new Vi(e.point.symbolLocations[0].x,e.point.symbolLocations[0].y)}switch(e.series.type){case"BoxAndWhisker":return this.getBoxLocation(e);case"Waterfall":return this.getWaterfallRegion(e,t);case"RangeArea":case"SplineRangeArea":return this.getRangeArea(e,t);default:return t}},r.prototype.getRangeArea=function(e,t){return e.point.regions[0]&&(this.inverted?t.x=e.point.regions[0].x+e.point.regions[0].width/2:t.y=e.point.regions[0].y+e.point.regions[0].height/2),t},r.prototype.getWaterfallRegion=function(e,t){return this.inverted?t.x=e.point.y<0?t.x+e.point.regions[0].width:t.x:t.y=e.point.y<0?t.y-e.point.regions[0].height:t.y,t},r.prototype.getTooltipText=function(e){var t=e.series;return this.parseTemplate(e.point,t,this.getFormat(this.chart,t),t.xAxis,t.yAxis)},r.prototype.getTemplateText=function(e){if(this.chart.tooltip.template){var i=t.extend({},e.point);return i.x=this.formatPointValue(e.point,e.series.xAxis,"x",!0,!1),"XY"===e.series.seriesType?i.y=this.formatPointValue(e.point,e.series.yAxis,"y",!1,!0):(i.low=this.formatPointValue(e.point,e.series.yAxis,"low",!1,!0),i.high=this.formatPointValue(e.point,e.series.yAxis,"high",!1,!0)),i}return e.point},r.prototype.findMouseValue=function(e,t){t.requireInvertedAxis?(this.valueY=(1-I(e.point.xValue,e.series.xAxis))*e.series.xAxis.rect.height+e.series.xAxis.rect.y,this.valueX=t.mouseX):("PolarRadar"===t.chartAreaType?this.valueX=F(e.point.xValue,e.series.xAxis)*e.series.xAxis.rect.width+e.series.xAxis.rect.x:this.valueX="TrendLine"===e.series.category&&t.tooltip.shared?this.valueX:I(e.point.xValue,e.series.xAxis)*e.series.xAxis.rect.width+e.series.xAxis.rect.x,this.valueY=t.mouseY)},r.prototype.renderGroupedTooltip=function(e,t,r){var o,n,a="PolarRadar"===e.chartAreaType?this.getData():null;this.stopAnimation(),this.removeHighlight(),this.currentPoints=[];var s=[];t&&(e.stockChart?r&&!i.getElement(r.id)&&document.getElementById(e.stockChart.element.id+"_Secondary_Element").appendChild(r):r&&document.getElementById(this.element.id+"_Secondary_Element").appendChild(r)),this.removeText();for(var l={text:[],cancel:!1,name:"sharedTooltipRender",data:[],headerText:"",textStyle:this.textStyle},h=this.mergeXvalues(this.chart.visibleSeries),c=0,d=e.visibleSeries;c<d.length;c++){var p=d[c];p.enableTooltip&&p.visible&&("Cartesian"===e.chartAreaType&&p.visible?o=this.getClosestX(e,p,h):"PolarRadar"===e.chartAreaType&&p.visible&&null!==a.point&&(o=new Yi(p.points[a.point.index],p)),o&&(e.isBlazor?(l.data.push({pointX:o.point.x,pointY:o.point.y,seriesIndex:o.series.index,seriesName:o.series.name,pointIndex:o.point.index,pointText:o.point.text}),l.headerText=this.findHeader(o),this.currentPoints.push(o),l.text.push(this.getTooltipText(o)),n="TrendLine"===o.series.category&&e.tooltip.shared?n:o):this.triggerSharedTooltip(o,t,this.getTooltipText(o),this.findHeader(o),s)))}e.isBlazor&&o&&this.triggerBlazorSharedTooltip(l,n,s,e,t),this.currentPoints.length>0?this.createTooltip(e,t,this.findSharedLocation(),1===this.currentPoints.length?this.currentPoints[0].series.clipRect:null,null,this.findShapes(),this.findMarkerHeight(this.currentPoints[0]),e.chartAxisLayoutPanel.seriesClipRect,s,this.chart.tooltip.template?this.getTemplateText(o):null,this.chart.tooltip.template?l.template:""):this.getElement(this.element.id+"_tooltip_path")&&this.getElement(this.element.id+"_tooltip_path").setAttribute("d","")},r.prototype.triggerBlazorSharedTooltip=function(e,t,i,r,o){var n=this,a={cancel:!1,name:"sharedTooltipRender",text:e.text,headerText:e.headerText,textStyle:e.textStyle,data:e.data},s=function(e){e.cancel?i.push(t):(n.text=e.text,n.headerText=e.headerText,n.findMouseValue(t,n.chart),t=null,n.createTooltip(r,o,n.findSharedLocation(),null,null,n.findShapes(),n.findMarkerHeight(n.currentPoints[0]),r.chartAxisLayoutPanel.seriesClipRect,i))};s.bind(this,t,i),this.chart.trigger("sharedTooltipRender",a,s)},r.prototype.triggerSharedTooltip=function(e,t,i,r,o){var n=this,a={cancel:!1,name:"tooltipRender",text:i,headerText:r,point:e.point,series:this.chart.isBlazor?{}:e.series,textStyle:this.textStyle,data:{pointX:e.point.x,pointY:e.point.y,seriesIndex:e.series.index,seriesName:e.series.name,pointIndex:e.point.index,pointText:e.point.text}},s=function(i){i.cancel?o.push(e):("BoxAndWhisker"===e.series.type&&(n.removeText(),t=!0),n.formattedText=n.formattedText.concat(i.text),n.text=n.formattedText,n.headerText=i.headerText,n.findMouseValue(e,n.chart),n.currentPoints.push(e),e=null)};s.bind(this,e,o),this.chart.trigger("tooltipRender",a,s),a.template&&(this.chart.tooltip.template=a.template)},r.prototype.findSharedLocation=function(){var e=this.chart.stockChart;if(e){1===this.text.length&&this.text.push("");var t=e.enablePeriodSelector?e.toolbarHeight:0,i=document.getElementById(e.element.id+"_ChartTitle"),r=""!==e.title?i.getBoundingClientRect().height+10:0;return new Vi(this.chart.chartAxisLayoutPanel.seriesClipRect.x+5,this.chart.chartAxisLayoutPanel.seriesClipRect.y+t+5+r)}return this.currentPoints.length>1?new Vi(this.valueX,this.valueY):this.getSymbolLocation(this.currentPoints[0])},r.prototype.getBoxLocation=function(e){return this.lierIndex>3?e.point.symbolLocations[this.lierIndex-4]:{x:e.point.regions[0].x+e.point.regions[0].width/2,y:e.point.regions[0].y+e.point.regions[0].height/2}},r.prototype.parseTemplate=function(e,t,i,r,o){for(var n,a,s=0,l=Object.keys(e);s<l.length;s++){d=l[s];n=new RegExp("${point."+d+"}","gm"),i=i.replace(n.source,this.formatPointValue(e,"${point.x}"===n.source?r:o,d,"${point.x}"===n.source,"${point.high}"===n.source||"${point.open}"===n.source||"${point.close}"===n.source||"${point.low}"===n.source||"${point.y}"===n.source||"${point.minimum}"===n.source||"${point.maximum}"===n.source||"${point.outliers}"===n.source||"${point.upperQuartile}"===n.source||"${point.lowerQuartile}"===n.source||"${point.median}"===n.source))}for(var h=0,c=Object.keys(Object.getPrototypeOf(t));h<c.length;h++){var d=c[h];n=new RegExp("${series."+d+"}","gm"),a=t[d],i=i.replace(n.source,a)}return i},r.prototype.formatPointValue=function(e,i,r,o,n){var a,s,l;return"Category"!==i.valueType&&o?a=(s=i.labelFormat&&null!==i.labelFormat.match("{value}"))?i.labelFormat.replace("{value}",i.format(e[r])):i.format(e[r]):n&&!t.isNullOrUndefined(e[r])?(s=i.labelFormat&&null!==i.labelFormat.match("{value}"),l="outliers"===r?i.format(e[r][this.lierIndex-4]):i.format(e[r]),a=s?i.labelFormat.replace("{value}",l):l):a=e[r],a},r.prototype.getFormat=function(e,t){if(t.tooltipFormat)return"XY"===t.seriesType&&"Indicator"===t.category?this.getIndicatorTooltipFormat(t,e,e.tooltip.format):t.tooltipFormat;if(!t.tooltipFormat&&e.tooltip.format)return"XY"===t.seriesType&&"Indicator"===t.category?this.getIndicatorTooltipFormat(t,e,e.tooltip.format):e.tooltip.format;var i="Histogram"===t.type?"${point.minimum}-${point.maximum}":"${point.x}",r=e.tooltip.shared?"${series.name}":i;switch(t.seriesType){case"XY":return"Indicator"===t.category&&this.getIndicatorTooltipFormat(t,e,e.tooltip.format),r+" : "+("Bubble"===t.type?"<b>${point.y}</b> Size : <b>${point.size}</b>":"<b>${point.y}</b>");case"HighLow":return r+"<br/>High : <b>${point.high}</b><br/>Low : <b>${point.low}</b>";case"HighLowOpenClose":return r+"<br/>High : <b>${point.high}</b><br/>Low : <b>${point.low}</b><br/>Open : <b>${point.open}</b><br/>Close : <b>${point.close}</b>";case"BoxPlot":return r+"<br/>"+(this.lierIndex>3?"Outliers : <b>${point.outliers}</b>":"Maximum : <b>${point.maximum}</b><br/>Q3 : <b>${point.upperQuartile}</b><br/>Median : <b>${point.median}</b><br/>Q1 : <b>${point.lowerQuartile}</b><br/>Minimum : <b>${point.minimum}</b>");default:return""}},r.prototype.getIndicatorTooltipFormat=function(e,t,i){return"XY"===e.seriesType?e.name+" : <b>${point.y}</b>":i},r.prototype.removeHighlightedMarker=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];m(this.element.id+"_Series_"+r.series.index+"_Point_"+r.point.index+"_Trackball")}this.chart.markerRender&&this.chart.markerRender.removeHighlightedMarker(),this.previousPoints=[]},r.prototype.getModuleName=function(){return"Tooltip"},r.prototype.destroy=function(){},r}(un),mn=function(){function e(e){this.iconRectOverFill="transparent",this.iconRectSelectionFill="transparent",this.zoomCompleteEvtCollection=[],this.chart=e,this.elementId=e.element.id,this.chart.svgRenderer=new i.SvgRenderer(this.elementId),this.selectionColor="Bootstrap4"===e.theme?"#FFFFFF":"Tailwind"===e.theme?"#374151":"TailwindDark"===e.theme?"#F3F4F6":"#ff4081",this.fillColor="Bootstrap4"===e.theme?"#495057":"Tailwind"===e.theme?"#6B7280":"TailwindDark"===e.theme?"#D1D5DB":"#737373",this.iconRectOverFill="Bootstrap4"===e.theme?"#5A6268":this.iconRectOverFill,this.iconRectSelectionFill="Bootstrap4"===e.theme?"#5B6269":this.iconRectSelectionFill,this.iconRect="Bootstrap4"===e.theme?new i.Rect(-5,-5,26,26):new i.Rect(0,0,16,16)}return e.prototype.createPanButton=function(e,t){var r=this.chart.svgRenderer,o=this.chart.zoomModule.isPanning?this.selectionColor:this.fillColor,n="M5,3h2.3L7.275,5.875h1.4L8.65,3H11L8,0L5,3z M3,11V8.7l2.875,0.025v-1.4L3,7.35V5L0,8L3,";n+="11z M11,13H8.7l0.025-2.875h-1.4L7.35,13H5l3,3L11,13z M13,5v2.3l-2.875-0.025v1.4L13,8.65V11l3-3L13,5z",e.id=this.elementId+"_Zooming_Pan",e.setAttribute("aria-label",this.chart.getLocalizedLabel("Pan")),this.panElements=e,e.appendChild(r.drawRectangle(new Di(this.elementId+"_Zooming_Pan_1","transparent",{},1,this.iconRect))),e.appendChild(r.drawPath(new i.PathOption(this.elementId+"_Zooming_Pan_2",o,null,null,1,null,n))),t.appendChild(e),this.wireEvents(e,this.pan)},e.prototype.createZoomButton=function(e,t){var r=this.chart.svgRenderer,o=this.chart.zoomModule.isPanning?this.fillColor:this.selectionColor,n=this.chart.zoomModule.isPanning?"transparent":this.iconRectSelectionFill,a="M0.001,14.629L1.372,16l4.571-4.571v-0.685l0.228-0.274c1.051,0.868,2.423,1.417,3.885,1.417c3.291,0,";a+="5.943-2.651,5.943-5.943S13.395,0,10.103,0S4.16,2.651,4.16,5.943c0,1.508,0.503,2.834,1.417,3.885l-0.274,0.228H4.571",a+="L0.001,14.629L0.001,14.629z M5.943,5.943c0-2.285,1.828-4.114,4.114-4.114s4.114,1.828,4.114,",e.id=this.elementId+"_Zooming_Zoom",e.setAttribute("aria-label",this.chart.getLocalizedLabel("Zoom")),this.zoomElements=e,this.selectedID=this.chart.zoomModule.isPanning?this.chart.element.id+"_Zooming_Pan_1":this.elementId+"_Zooming_Zoom_1",e.appendChild(r.drawRectangle(new Di(this.elementId+"_Zooming_Zoom_1",n,{},1,this.iconRect))),e.appendChild(r.drawPath(new i.PathOption(this.elementId+"_Zooming_Zoom_3",o,null,null,1,null,a+"4.114s-1.828,4.114-4.114,4.114S5.943,8.229,5.943,5.943z"))),t.appendChild(e),this.wireEvents(e,this.zoom)},e.prototype.createZoomInButton=function(e,t,r){var o=this.chart.svgRenderer,n=this.fillColor,a="M10.103,0C6.812,0,4.16,2.651,4.16,5.943c0,1.509,0.503,2.834,1.417,3.885l-0.274,0.229H4.571L0,";a+="14.628l0,0L1.372,16l4.571-4.572v-0.685l0.228-0.275c1.052,0.868,2.423,1.417,3.885,1.417c3.291,0,5.943-2.651,",a+="5.943-5.943C16,2.651,13.395,0,10.103,0z M10.058,10.058c-2.286,0-4.114-1.828-4.114-4.114c0-2.286,1.828-4.114,",e.id=this.elementId+"_Zooming_ZoomIn",e.setAttribute("aria-label",this.chart.getLocalizedLabel("ZoomIn"));e.appendChild(o.drawRectangle(new Di(this.elementId+"_Zooming_ZoomIn_1","transparent",{},1,this.iconRect))),e.appendChild(o.drawPath(new i.PathOption(this.elementId+"_Zooming_ZoomIn_2",n,null,null,1,null,a+"4.114-4.114c2.286,0,4.114,1.828,4.114,4.114C14.172,8.229,12.344,10.058,10.058,10.058z"))),e.appendChild(o.drawPolygon(new Ni(this.elementId+"_Zooming_ZoomIn_3","12.749,5.466 10.749,5.466 10.749,3.466 9.749,3.466 9.749,5.466 7.749,5.466 7.749,6.466 9.749,6.466 9.749,8.466 10.749,8.466 10.749,6.466 12.749,6.466",n))),this.zoomInElements=e,this.elementOpacity=r.zoomModule.isPanning?"0.2":"1",e.setAttribute("opacity",this.elementOpacity),t.appendChild(e),this.wireEvents(e,this.zoomIn)},e.prototype.createZoomOutButton=function(e,t,r){var o=this.chart.svgRenderer,n=this.fillColor,a="M0,14.622L1.378,16l4.533-4.533v-0.711l0.266-0.266c1.022,0.889,2.4,1.422,3.866,";a+="1.422c3.289,0,5.955-2.666,5.955-5.955S13.333,0,10.044,0S4.089,2.667,4.134,5.911c0,1.466,0.533,2.844,",a+="1.422,3.866l-0.266,0.266H4.578L0,14.622L0,14.622z M5.911,5.911c0-2.311,1.822-4.133,4.133-4.133s4.133,1.822,4.133,",e.id=this.elementId+"_Zooming_ZoomOut",e.setAttribute("aria-label",this.chart.getLocalizedLabel("ZoomOut")),e.appendChild(o.drawRectangle(new Di(this.elementId+"_Zooming_ZoomOut_1","transparent",{},1,this.iconRect))),e.appendChild(o.drawPath(new i.PathOption(this.elementId+"_Zooming_ZoomOut_2",n,null,null,1,null,a+"4.133s-1.866,4.133-4.133,4.133S5.911,8.222,5.911,5.911z M12.567,6.466h-5v-1h5V6.466z"))),this.zoomOutElements=e,this.elementOpacity=r.zoomModule.isPanning?"0.2":"1",e.setAttribute("opacity",this.elementOpacity),t.appendChild(e),this.wireEvents(e,this.zoomOut)},e.prototype.createResetButton=function(e,t,r,o){var n,a=this.chart.svgRenderer,s=this.fillColor,l="M12.364,8h-2.182l2.909,3.25L16,8h-2.182c0-3.575-2.618-6.5-5.818-6.5c-1.128,0-2.218,0.366-3.091,";l+="1.016l1.055,1.178C6.581,3.328,7.272,3.125,8,3.125C10.4,3.125,12.363,5.319,12.364,8L12.364,8z M11.091,",l+="13.484l-1.055-1.178C9.419,12.672,8.728,12.875,8,12.875c-2.4,0-4.364-2.194-4.364-4.875h2.182L2.909,4.75L0,8h2.182c0,",e.id=this.elementId+"_Zooming_Reset",e.setAttribute("aria-label",this.chart.getLocalizedLabel("Reset")),o?(n=i.measureText(this.chart.getLocalizedLabel("ResetZoom"),{size:"12px"}),e.appendChild(a.drawRectangle(new Di(this.elementId+"_Zooming_Reset_1","transparent",{},1,new i.Rect(0,0,n.width,n.height)))),Ve(r.renderer,new i.TextOption(this.elementId+"_Zooming_Reset_2",0+n.width/2,0+3*n.height/4,"middle",this.chart.getLocalizedLabel("ResetZoom"),"rotate(0,0,0)","auto"),{size:"12px"},"black",e,null,null,null,null,null,null,null,null,r.enableCanvas)):(e.appendChild(a.drawRectangle(new Di(this.elementId+"_Zooming_Reset_1","transparent",{},1,this.iconRect))),e.appendChild(a.drawPath(new i.PathOption(this.elementId+"_Zooming_Reset_2",s,null,null,1,null,l+"3.575,2.618,6.5,5.818,6.5C9.128,14.5,10.219,14.134,11.091,13.484L11.091,13.484z")))),t.appendChild(e),this.wireEvents(e,this.reset)},e.prototype.wireEvents=function(e,i){t.EventHandler.add(e,"mousedown touchstart",i,this),t.EventHandler.add(e,"mouseover",this.showTooltip,this),t.EventHandler.add(e,"mouseout",this.removeTooltip,this)},e.prototype.showTooltip=function(e){var t=e.currentTarget.id.split("_Zooming_")[1],r=e.pageX-(i.measureText(t,{size:"10px"}).width+5),o=he(e.currentTarget.id+"_1"),n=he(e.currentTarget.id+"_2"),a=he(e.currentTarget.id+"_3");o&&(this.hoveredID=o.id,o.setAttribute("fill",this.iconRectOverFill)),n&&n.setAttribute("fill",this.selectionColor),a&&a.setAttribute("fill",this.selectionColor),this.chart.isTouch||N("EJ2_Chart_ZoomTip",this.chart.getLocalizedLabel(t),e.pageY+10,r,"10px")},e.prototype.removeTooltip=function(){if(he(this.hoveredID)){var e=this.chart.zoomModule.isPanning?this.hoveredID.indexOf("_Pan_")>-1?this.iconRectSelectionFill:"transparent":this.hoveredID.indexOf("_Zoom_")>-1?this.iconRectSelectionFill:"transparent";he(this.hoveredID).setAttribute("fill",e)}var t=this.hoveredID?he(this.hoveredID.replace("_1","_2")):null,i=this.hoveredID?he(this.hoveredID.replace("_1","_3")):null;if(t){r=this.chart.zoomModule.isPanning?this.hoveredID.indexOf("_Pan_")>-1?this.selectionColor:this.fillColor:this.hoveredID.indexOf("_Zoom_")>-1?this.selectionColor:this.fillColor;t.setAttribute("fill",r)}if(i){var r=this.chart.zoomModule.isPanning?this.fillColor:this.hoveredID.indexOf("_Zoom_")>-1?this.selectionColor:this.fillColor;i.setAttribute("fill",r)}m("EJ2_Chart_ZoomTip")},e.prototype.reset=function(){var e=this,i=this.chart;i.zoomModule.isDevice||t.remove(i.zoomModule.toolkitElements);var r;this.removeTooltip(),i.svgObject.setAttribute("cursor","auto");var o,n=[];this.zoomCompleteEvtCollection=[];for(var a=0,s=i.axisCollections;a<s.length;a++){var l=s[a];r={cancel:!1,name:"zoomComplete",axis:l,previousZoomFactor:l.zoomFactor,previousZoomPosition:l.zoomPosition,currentZoomFactor:1,currentZoomPosition:0,previousVisibleRange:l.visibleRange,currentVisibleRange:null},l.zoomFactor=1,l.zoomPosition=0,l.zoomingScrollBar&&(l.zoomingScrollBar.isScrollUI=!1),r.cancel||(l.zoomFactor=r.currentZoomFactor,l.zoomPosition=r.currentZoomPosition,this.zoomCompleteEvtCollection.push(r)),n.push({zoomFactor:l.zoomFactor,zoomPosition:l.zoomFactor,axisName:l.name,axisRange:l.visibleRange})}return o={cancel:!1,axisCollection:n,name:hi},!o.cancel&&this.chart.isBlazor?(this.chart.trigger(hi,o,function(){e.setDefferedZoom(i)}),!1):this.setDefferedZoom(i)},e.prototype.setDefferedZoom=function(e){return e.disableTrackTooltip=!1,e.zoomModule.isZoomed=e.zoomModule.isPanning=e.isChartDrag=e.delayRedraw=!1,e.zoomModule.touchMoveList=e.zoomModule.touchStartList=[],e.zoomModule.pinchTarget=null,e.removeSvg(),e.enableAutoIntervalOnBothAxis&&e.processData(!1),e.refreshAxis(),e.refreshBound(),this.elementOpacity="1",!1},e.prototype.zoomIn=function(e){return this.zoomInOutCalculation(1,this.chart,this.chart.axisCollections,this.chart.zoomSettings.mode),!1},e.prototype.zoomOut=function(e){return this.zoomInOutCalculation(-1,this.chart,this.chart.axisCollections,this.chart.zoomSettings.mode),!1},e.prototype.zoom=function(e){this.chart.zoomModule.isPanning=!1;this.chart.zoomModule;return this.elementOpacity="1",this.chart.svgObject.setAttribute("cursor","auto"),this.zoomInElements.setAttribute("opacity",this.elementOpacity),this.zoomOutElements.setAttribute("opacity",this.elementOpacity),this.applySelection(this.zoomElements.childNodes,this.selectionColor),this.applySelection(this.panElements.childNodes,"#737373"),he(this.selectedID)&&he(this.selectedID).setAttribute("fill","transparent"),this.selectedID=this.chart.element.id+"_Zooming_Zoom_1",he(this.selectedID).setAttribute("fill",this.iconRectSelectionFill),!1},e.prototype.pan=function(){return this.chart.zoomModule.isPanning=!0,this.chart.svgObject.setAttribute("cursor","pointer"),this.elementOpacity="0.2",this.zoomInElements?this.zoomInElements.setAttribute("opacity",this.elementOpacity):null,this.zoomOutElements?this.zoomOutElements.setAttribute("opacity",this.elementOpacity):null,this.panElements?this.applySelection(this.panElements.childNodes,this.selectionColor):null,this.zoomElements?this.applySelection(this.zoomElements.childNodes,"#737373"):null,he(this.selectedID)&&he(this.selectedID).setAttribute("fill","transparent"),this.selectedID=this.chart.element.id+"_Zooming_Pan_1",he(this.selectedID).setAttribute("fill",this.iconRectSelectionFill),!1},e.prototype.zoomInOutCalculation=function(e,t,i,r){if(!t.zoomModule.isPanning&&"0.2"!==this.elementOpacity){var o=void 0,n=void 0,a=void 0;t.disableTrackTooltip=!0,t.delayRedraw=!0;var s=void 0;this.zoomCompleteEvtCollection=[];for(var l=0,h=i;l<h.length;l++){var c=h[l];s={cancel:!1,name:"zoomComplete",axis:c,previousZoomFactor:c.zoomFactor,previousZoomPosition:c.zoomPosition,currentZoomFactor:c.zoomFactor,currentZoomPosition:c.zoomPosition,previousVisibleRange:c.visibleRange,currentVisibleRange:null},("Horizontal"===c.orientation&&"Y"!==r||"Vertical"===c.orientation&&"X"!==r)&&(o=1===(a=Math.max(Math.max(1/le(c.zoomFactor,0,1),1)+.25*e,1))?1:le(1/a,0,1),n=1===a?0:c.zoomPosition+.5*(c.zoomFactor-o),c.zoomPosition===n&&c.zoomFactor===o||(o=n+o>1?1-n:o),s.currentZoomFactor=o,s.currentZoomPosition=n,s.cancel||(c.zoomFactor=s.currentZoomFactor,c.zoomPosition=s.currentZoomPosition,this.zoomCompleteEvtCollection.push(s)))}}},e.prototype.applySelection=function(e,t){for(var i=1,r=e.length;i<r;i++)e[i].setAttribute("fill",t)},e}(),vn=function(){function e(e){this.zoomCompleteEvtCollection=[],this.chart=e,this.isPointer=t.Browser.isPointer,this.browserName=t.Browser.info.name,this.wheelEvent="mozilla"===this.browserName?this.isPointer?"mousewheel":"DOMMouseScroll":"mousewheel",this.cancelEvent=this.isPointer?"pointerleave":"mouseleave",this.addEventListener(),this.isDevice=t.Browser.isDevice;var r=e.zoomSettings;this.toolkit=new mn(e),this.zooming=r,this.elementId=e.element.id,this.zoomingRect=new i.Rect(0,0,0,0),this.zoomAxes=[],this.zoomkitOpacity=.3,this.isIOS=t.Browser.isIos||t.Browser.isIos7,this.isZoomed=this.performedUI=this.zooming.enablePan&&this.zooming.enableSelectionZooming,r.enableScrollbar&&(e.scrollElement=t.createElement("div",{id:e.element.id+"_scrollElement"}))}return e.prototype.renderZooming=function(e,t,i){this.calculateZoomAxesRange(t),!this.zooming.enableSelectionZooming||i&&(!t.isDoubleTap||1!==this.touchStartList.length)||this.isPanning&&!t.isDoubleTap?this.isPanning&&t.isChartDrag&&(!i||i&&1===this.touchStartList.length)&&(this.pinchTarget=i?e.target:null,this.doPan(t,t.axisCollections)):(this.isPanning=!!this.isDevice||this.isPanning,this.performedUI=!0,this.drawZoomingRectangle(t))},e.prototype.drawZoomingRectangle=function(e){var t=e.chartAxisLayoutPanel.seriesClipRect,i=new Vi(e.previousMouseMoveX,e.previousMouseMoveY),r=new Vi(e.mouseX,e.mouseY),o=this.zoomingRect=se(i,r,t);o.width>0&&o.height>0&&(this.isZoomed=!0,e.disableTrackTooltip=!0,e.svgObject.setAttribute("cursor","crosshair"),"X"===this.zooming.mode?(o.height=t.height,o.y=t.y):"Y"===this.zooming.mode&&(o.width=t.width,o.x=t.x),(e.enableCanvas?document.getElementById(this.elementId+"_tooltip_svg"):e.svgObject).appendChild(e.svgRenderer.drawRectangle(new Di(this.elementId+"_ZoomArea",e.themeStyle.selectionRectFill,{color:e.themeStyle.selectionRectStroke,width:1},1,o,0,0,"","3"))))},e.prototype.doPan=function(e,t){var i=this;if(e.startMove&&e.crosshair.enable)return null;var r,o;this.isZoomed=!0,this.offset=e.delayRedraw?this.offset:e.chartAxisLayoutPanel.seriesClipRect,e.delayRedraw=!0,this.zoomCompleteEvtCollection=[],e.disableTrackTooltip=!0;for(var n,a=[],s=0,l=t;s<l.length;s++){var h=l[s];n={cancel:!1,name:"zoomComplete",axis:h,previousZoomFactor:h.zoomFactor,previousZoomPosition:h.zoomPosition,currentZoomFactor:h.zoomFactor,currentZoomPosition:h.zoomPosition,previousVisibleRange:h.visibleRange,currentVisibleRange:null},r=Math.max(1/le(h.zoomFactor,0,1),1),"Horizontal"===h.orientation?(o=(e.previousMouseMoveX-e.mouseX)/h.rect.width/r,n.currentZoomPosition=le(h.zoomPosition+o,0,1-h.zoomFactor)):(o=(e.previousMouseMoveY-e.mouseY)/h.rect.height/r,n.currentZoomPosition=le(h.zoomPosition-o,0,1-h.zoomFactor)),n.cancel||(h.zoomFactor=n.currentZoomFactor,h.zoomPosition=n.currentZoomPosition,this.zoomCompleteEvtCollection.push(n)),a.push({zoomFactor:h.zoomFactor,zoomPosition:h.zoomFactor,axisName:h.name,axisRange:h.visibleRange})}var c={cancel:!1,axisCollection:a,name:hi};!c.cancel&&this.chart.isBlazor?this.chart.trigger(hi,c,function(){i.performDefferedZoom(e)}):(this.performDefferedZoom(e),this.redrawOnZooming(e,!1))},e.prototype.performDefferedZoom=function(e){var t,i;if(this.zooming.enableDeferredZooming){switch(t=e.mouseX-e.mouseDownX,i=e.mouseY-e.mouseDownY,this.zooming.mode){case"X":i=0;break;case"Y":t=0}this.setTransform(t,i,null,null,e,!1),this.refreshAxis(e.chartAxisLayoutPanel,e,e.axisCollections),e.enableCanvas&&this.performZoomRedraw(e)}else this.performZoomRedraw(e);e.previousMouseMoveX=e.mouseX,e.previousMouseMoveY=e.mouseY},e.prototype.performZoomRedraw=function(e){var t=this.zoomingRect;e.animateSeries=!1,this.isZoomed&&(t.width>0&&t.height>0?(this.performedUI=!0,e.svgObject.setAttribute("cursor","auto"),this.doZoom(e,e.axisCollections,e.chartAxisLayoutPanel.seriesClipRect),e.isDoubleTap=!1):e.disableTrackTooltip&&(e.disableTrackTooltip=!1,e.delayRedraw=!1,e.enableCanvas?e.createChartSvg():e.removeSvg(),e.refreshAxis(),e.refreshBound()))},e.prototype.refreshAxis=function(e,t,r){var o=t.zoomSettings.mode;e.measureAxis(new i.Rect(t.initialClipRect.x,t.initialClipRect.y,t.initialClipRect.width,t.initialClipRect.height)),r.map(function(t,i){"Horizontal"===t.orientation&&"Y"!==o&&e.drawXAxisLabels(t,i,null,t.placeNextToAxisLine?t.updatedRect:t.rect),"Vertical"===t.orientation&&"X"!==o&&e.drawYAxisLabels(t,i,null,t.placeNextToAxisLine?t.updatedRect:t.rect)})},e.prototype.doZoom=function(e,t,r){var o,n=this,a=this.zoomingRect,s=this.zooming.mode;this.isPanning=e.zoomSettings.enablePan||this.isPanning;var l=[];this.zoomCompleteEvtCollection=[];for(var h=0,c=t;h<c.length;h++){var d=c[h];o={cancel:!1,name:"zoomComplete",axis:d,previousZoomFactor:d.zoomFactor,previousZoomPosition:d.zoomPosition,currentZoomFactor:d.zoomFactor,currentZoomPosition:d.zoomPosition,previousVisibleRange:d.visibleRange,currentVisibleRange:null},"Horizontal"===d.orientation?"Y"!==s&&(o.currentZoomPosition+=Math.abs((a.x-r.x)/r.width)*d.zoomFactor,o.currentZoomFactor*=a.width/r.width):"X"!==s&&(o.currentZoomPosition+=(1-Math.abs((a.height+(a.y-r.y))/r.height))*d.zoomFactor,o.currentZoomFactor*=a.height/r.height),o.cancel||(d.zoomFactor=o.currentZoomFactor,d.zoomPosition=o.currentZoomPosition,this.zoomCompleteEvtCollection.push(o)),l.push({zoomFactor:d.zoomFactor,zoomPosition:d.zoomFactor,axisName:d.name,axisRange:d.visibleRange})}var p={cancel:!1,axisCollection:l,name:hi};!p.cancel&&this.chart.isBlazor?this.chart.trigger(hi,p,function(){n.zoomingRect=new i.Rect(0,0,0,0),n.performZoomRedraw(e)}):(this.zoomingRect=new i.Rect(0,0,0,0),this.redrawOnZooming(e))},e.prototype.redrawOnZooming=function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!1);var r=i?this.toolkit.zoomCompleteEvtCollection:this.zoomCompleteEvtCollection;t&&this.performZoomRedraw(e);for(var o,n=0;n<r.length;n++)r[n].cancel||(o={cancel:!1,name:"zoomComplete",axis:e.axisCollections[n],previousZoomFactor:r[n].previousZoomFactor,previousZoomPosition:r[n].previousZoomPosition,currentZoomFactor:e.axisCollections[n].zoomFactor,currentZoomPosition:e.axisCollections[n].zoomPosition,currentVisibleRange:e.axisCollections[n].visibleRange,previousVisibleRange:r[n].previousVisibleRange},e.trigger("zoomComplete",o))},e.prototype.performMouseWheelZooming=function(e,t,i,r,o){var n,a,s,l=this,h="mozilla"!==this.browserName||this.isPointer?e.wheelDelta>0?1:-1:-e.detail/3>0?1:-1,c=this.zooming.mode,d=.5;this.isZoomed=!0,this.calculateZoomAxesRange(r),r.disableTrackTooltip=!0,this.performedUI=!0,this.isPanning=r.zoomSettings.enablePan||this.isPanning,this.zoomCompleteEvtCollection=[];for(var p,u=[],g=0,y=o;g<y.length;g++){var m=y[g];p={cancel:!1,name:"zoomComplete",axis:m,previousZoomFactor:m.zoomFactor,previousZoomPosition:m.zoomPosition,currentZoomFactor:m.zoomFactor,currentZoomPosition:m.zoomPosition,currentVisibleRange:null,previousVisibleRange:m.visibleRange},("Vertical"===m.orientation&&"X"!==c||"Horizontal"===m.orientation&&"Y"!==c)&&((n=Math.max(Math.max(1/le(m.zoomFactor,0,1),1)+.25*h,1))>=1&&(d=(d="Horizontal"===m.orientation?t/m.rect.width:1-i/m.rect.height)>1?1:d<0?0:d,a=1===n?1:le((h>0?.9:1.1)/n,0,1),s=1===n?0:m.zoomPosition+(m.zoomFactor-a)*d,m.zoomPosition===s&&m.zoomFactor===a||(a=s+a>1?1-s:a),p.currentZoomFactor=a,p.currentZoomPosition=s),p.cancel||(m.zoomFactor=p.currentZoomFactor,m.zoomPosition=p.currentZoomPosition,this.zoomCompleteEvtCollection.push(p))),u.push({zoomFactor:m.zoomFactor,zoomPosition:m.zoomFactor,axisName:m.name,axisRange:m.visibleRange})}var v={cancel:!1,axisCollection:u,name:hi};!v.cancel&&this.chart.isBlazor?this.chart.trigger(hi,v,function(){l.performZoomRedraw(r)}):this.redrawOnZooming(r)},e.prototype.performPinchZooming=function(e,t){if(this.zoomingRect.width>0&&this.zoomingRect.height>0||t.startMove&&t.crosshair.enable)return!1;this.calculateZoomAxesRange(t),this.isZoomed=!0,this.isPanning=!0,this.performedUI=!0,this.offset=t.delayRedraw?this.offset:t.chartAxisLayoutPanel.seriesClipRect,t.delayRedraw=!0,t.disableTrackTooltip=!0;var r=t.element.getBoundingClientRect(),o=this.touchStartList,n=this.touchMoveList,a=o[0].pageX-r.left,s=o[0].pageY-r.top,l=n[0].pageX-r.left,h=n[0].pageY-r.top,c=o[1].pageX-r.left,d=o[1].pageY-r.top,p=n[1].pageX-r.left,u=n[1].pageY-r.top,g=Math.abs(l-p)/Math.abs(a-c),y=Math.abs(h-u)/Math.abs(s-d),m=(this.offset.x-l)/g+a,v=(this.offset.y-h)/y+s,f=new i.Rect(m,v,this.offset.width/g,this.offset.height/y),b=l-g*a,x=h-y*s;if(!isNaN(g-g)&&!isNaN(y-y))switch(this.zooming.mode){case"XY":this.setTransform(b,x,g,y,t,!0);break;case"X":this.setTransform(b,0,g,1,t,!0);break;case"Y":this.setTransform(0,x,1,y,t,!0)}return this.calculatePinchZoomFactor(t,f),this.refreshAxis(t.chartAxisLayoutPanel,t,t.axisCollections),this.redrawOnZooming(t,!1),!0},e.prototype.calculatePinchZoomFactor=function(e,t){var i,r,o,n,a,s,l,h,c,d=this.zooming.mode,p=[];this.zoomCompleteEvtCollection=[];for(var u=0;u<e.axisCollections.length;u++){var g=e.axisCollections[u];("Horizontal"===g.orientation&&"Y"!==d||"Vertical"===g.orientation&&"X"!==d)&&(h=g.zoomFactor,c=g.zoomPosition,l={cancel:!1,name:"zoomComplete",axis:g,previousZoomFactor:g.zoomFactor,previousZoomPosition:g.zoomPosition,currentZoomFactor:h,currentZoomPosition:c,previousVisibleRange:g.visibleRange,currentVisibleRange:null},"Horizontal"===g.orientation?(o=(a=t.x-this.offset.x)/(s=g.rect.width/this.zoomAxes[u].delta)+this.zoomAxes[u].min,n=(a=t.x+t.width-this.offset.x)/s+this.zoomAxes[u].min):(a=t.y-this.offset.y,s=g.rect.height/this.zoomAxes[u].delta,o=(-1*a+g.rect.height)/s+this.zoomAxes[u].min,n=(-1*(a=t.y+t.height-this.offset.y)+g.rect.height)/s+this.zoomAxes[u].min),i=Math.min(o,n),r=Math.max(o,n),c=(i-this.zoomAxes[u].actualMin)/this.zoomAxes[u].actualDelta,h=(r-i)/this.zoomAxes[u].actualDelta,l.currentZoomPosition=c<0?0:c,l.currentZoomFactor=h>1?1:h,l.cancel||(g.zoomFactor=l.currentZoomFactor,g.zoomPosition=l.currentZoomPosition,this.zoomCompleteEvtCollection.push(l)),p.push({zoomFactor:g.zoomFactor,zoomPosition:g.zoomFactor,axisName:g.name,axisRange:g.visibleRange}))}var y={cancel:!1,axisCollection:p,name:hi};!y.cancel&&this.chart.isBlazor&&this.chart.trigger(hi,y)},e.prototype.setTransform=function(e,t,i,r,o,n){o.enableCanvas||o.seriesElements.setAttribute("clip-path","url(#"+this.elementId+"_ChartAreaClipRect_)"),o.indicatorElements&&o.indicatorElements.setAttribute("clip-path","url(#"+this.elementId+"_ChartAreaClipRect_)");var a,s,l,h;if(null!==e&&null!==t)for(var c=0,d=o.visibleSeries;c<d.length;c++){var p=d[c];s=o.requireInvertedAxis?p.yAxis.rect.x:p.xAxis.rect.x,l=o.requireInvertedAxis?p.xAxis.rect.y:p.yAxis.rect.y,a="translate("+(e+(n?i*s:s))+","+(t+(n?r*l:l))+")",a=i||r?a+" scale("+i+" "+r+")":a,p.visible&&("Indicator"===p.category?p.seriesElement.parentNode.setAttribute("transform",a):o.enableCanvas||p.seriesElement.setAttribute("transform",a),h=he(o.element.id+"_Series_"+p.index+"_DataLabelCollections"),p.errorBarElement&&p.errorBarElement.setAttribute("transform",a),p.symbolElement&&p.symbolElement.setAttribute("transform",a),p.textElement&&(p.textElement.setAttribute("visibility","hidden"),p.shapeElement.setAttribute("visibility","hidden")),h&&(h.style.visibility="hidden"))}},e.prototype.calculateZoomAxesRange=function(e){for(var t,i,r=0;r<e.axisCollections.length;r++){var o=e.axisCollections[r];i=o.visibleRange,this.zoomAxes[r]?e.delayRedraw||(this.zoomAxes[r].min=i.min,this.zoomAxes[r].delta=i.delta):(t={actualMin:o.actualRange.min,actualDelta:o.actualRange.delta,min:i.min,delta:i.delta},this.zoomAxes[r]=t)}},e.prototype.showZoomingToolkit=function(e){var r,o=this.zooming.toolbarItems,n=e.chartAxisLayoutPanel.seriesClipRect,a=e.svgRenderer,s=this.isDevice?1:o.length,l=this.isDevice?i.measureText("Reset Zoom",{size:"12px"}).width:16,h=this.isDevice?i.measureText("Reset Zoom",{size:"12px"}).height:22,c=s*l+5*(s+1)+5*(s-1),d=n.x+n.width-c-5,p=n.y+5,u=5,g=this.toolkit,y='<filter id="chart_shadow" height="130%"><feGaussianBlur in="SourceAlpha" stdDeviation="5"/>';if(y+='<feOffset dx="-3" dy="4" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="1"/>',y+='</feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge></filter>',0===s||he(this.elementId+"_Zooming_KitCollection"))return!1;var m=a.createDefs();o=this.isDevice?["Reset"]:o,m.innerHTML=y,this.toolkitElements=a.createGroup({id:this.elementId+"_Zooming_KitCollection",transform:"translate("+d+","+p+")"}),this.toolkitElements.appendChild(m);var v="Tailwind"===this.chart.theme?"#F3F4F6":"TailwindDark"===this.chart.theme?"#374151":"#fafafa";this.toolkitElements.appendChild(a.drawRectangle(new Di(this.elementId+"_Zooming_Rect",v,{color:"transparent",width:1},1,new i.Rect(0,0,c,h+10),0,0)));var f=a.drawRectangle(new Di(this.elementId+"_Zooming_Rect",v,{color:"transparent",width:1},.1,new i.Rect(0,0,c,h+10),0,0));"Tailwind"===this.chart.theme||"TailwindDark"===this.chart.theme?f.setAttribute("box-shadow","0px 1px 2px rgba(0, 0, 0, 0.06), 0px 1px 3px rgba(0, 0, 0, 0.1)"):f.setAttribute("filter","url(#chart_shadow)"),this.toolkitElements.appendChild(f);for(var b,x=!1,w=1;w<=s;w++){switch(b=o[w-1],r=a.createGroup({transform:"translate("+u+","+(this.isDevice?5:8)+")"}),b){case"Pan":g.createPanButton(r,this.toolkitElements),x=!0;break;case"Zoom":g.createZoomButton(r,this.toolkitElements);break;case"ZoomIn":g.createZoomInButton(r,this.toolkitElements,e);break;case"ZoomOut":g.createZoomOutButton(r,this.toolkitElements,e);break;case"Reset":g.createResetButton(r,this.toolkitElements,e,this.isDevice)}u+=l+10}if(this.toolkitElements.setAttribute("opacity",this.isDevice?"1":""+this.zoomkitOpacity),this.toolkitElements.setAttribute("cursor","auto"),e.enableCanvas){var S=document.createElement("div");S.id=e.element.id+"_zoom",S.setAttribute("style","position:absolute; z-index:1");var C=e.availableSize.height/2,P=e.svgRenderer.createSvg({id:e.element.id+"_zoomkit_svg",width:e.availableSize.width,height:C});P.setAttribute("style","position:absolute"),P.appendChild(this.toolkitElements),S.appendChild(P),document.getElementById(this.elementId+"_Secondary_Element").appendChild(S)}else e.svgObject.appendChild(this.toolkitElements);return this.isDevice||(t.EventHandler.add(this.toolkitElements,"mousemove touchstart",this.zoomToolkitMove,this),t.EventHandler.add(this.toolkitElements,"mouseleave touchend",this.zoomToolkitLeave,this),this.isPanning&&x&&g.pan()),!0},e.prototype.applyZoomToolkit=function(e,t){this.isAxisZoomed(t)?(this.showZoomingToolkit(e),this.isZoomed=!0):(this.toolkit.removeTooltip(),this.isPanning=!1,this.isZoomed=!1,e.svgObject.setAttribute("cursor","auto"))},e.prototype.isAxisZoomed=function(e){for(var t=!1,i=0,r=e;i<r.length;i++){var o=r[i];t=t||1!==o.zoomFactor||0!==o.zoomPosition}return t},e.prototype.zoomToolkitMove=function(){var e=this.toolkitElements;return this.zoomkitOpacity=1,e.setAttribute("opacity",""+this.zoomkitOpacity),!1},e.prototype.zoomToolkitLeave=function(){var e=this.toolkitElements;return this.zoomkitOpacity=.3,e.setAttribute("opacity",""+this.zoomkitOpacity),!1},e.prototype.addEventListener=function(){this.chart.isDestroyed||(t.EventHandler.add(this.chart.element,this.wheelEvent,this.chartMouseWheel,this),this.chart.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.chart.on(t.Browser.touchStartEvent,this.mouseDownHandler,this),this.chart.on(t.Browser.touchEndEvent,this.mouseUpHandler,this),this.chart.on(this.cancelEvent,this.mouseCancelHandler,this))},e.prototype.removeEventListener=function(){this.chart.isDestroyed||(t.EventHandler.remove(this.chart.element,this.wheelEvent,this.chartMouseWheel),this.chart.off(t.Browser.touchMoveEvent,this.mouseMoveHandler),this.chart.off(t.Browser.touchStartEvent,this.mouseDownHandler),this.chart.off(t.Browser.touchEndEvent,this.mouseUpHandler),this.chart.off(this.cancelEvent,this.mouseCancelHandler))},e.prototype.chartMouseWheel=function(e){var t=this.chart,i=t.element.getBoundingClientRect(),r=he(t.svgId).getBoundingClientRect(),o=e.clientX-i.left-Math.max(r.left-i.left,0),n=e.clientY-i.top-Math.max(r.top-i.top,0);return this.zooming.enableMouseWheelZooming&&j(o,n,t.chartAxisLayoutPanel.seriesClipRect)&&(e.preventDefault(),this.performMouseWheelZooming(e,o,n,t,t.axisCollections)),!1},e.prototype.mouseMoveHandler=function(e){var t=this.chart,i=null;"touchmove"===e.type&&(e.preventDefault&&this.isIOS&&(this.isPanning||t.isDoubleTap||this.zooming.enablePinchZooming&&this.touchStartList.length>1)&&e.preventDefault(),i=e.touches),t.isChartDrag&&(t.isTouch&&(this.touchMoveList=this.addTouchPointer(this.touchMoveList,e,i),this.zooming.enablePinchZooming&&this.touchMoveList.length>1&&this.touchStartList.length>1&&this.performPinchZooming(e,t)),this.renderZooming(e,t,t.isTouch))},e.prototype.mouseDownHandler=function(e){var t,i=this.chart,r=null;"touchstart"===e.type?(r=e.touches,t=e.target):t=e.target,-1===t.id.indexOf(i.element.id+"_Zooming_")&&j(i.previousMouseMoveX,i.previousMouseMoveY,i.chartAxisLayoutPanel.seriesClipRect)&&(i.isChartDrag=!0),i.isTouch&&(this.touchStartList=this.addTouchPointer(this.touchStartList,e,r))},e.prototype.mouseUpHandler=function(e){var t=this.chart,i=-1===e.target.id.indexOf(t.element.id+"_ZoomOut_")||-1===e.target.id.indexOf(t.element.id+"_ZoomIn_");(t.isChartDrag||i)&&this.redrawOnZooming(t,!0,!0),t.isTouch&&(t.isDoubleTap&&j(t.mouseX,t.mouseY,t.chartAxisLayoutPanel.seriesClipRect)&&1===this.touchStartList.length&&this.isZoomed&&this.toolkit.reset(),this.touchStartList=[],t.isDoubleTap=!1)},e.prototype.mouseCancelHandler=function(){this.isZoomed&&this.performZoomRedraw(this.chart),this.pinchTarget=null,this.touchStartList=[],this.touchMoveList=[]},e.prototype.addTouchPointer=function(e,t,i){if(i){e=[];for(var r=0,o=i.length;r<o;r++)e.push({pageX:i[r].clientX,pageY:i[r].clientY,pointerId:null})}else if(0===(e=e||[]).length)e.push({pageX:t.clientX,pageY:t.clientY,pointerId:t.pointerId});else for(var r=0,n=e.length;r<n;r++)e[r].pointerId===t.pointerId?e[r]={pageX:t.clientX,pageY:t.clientY,pointerId:t.pointerId}:e.push({pageX:t.clientX,pageY:t.clientY,pointerId:t.pointerId});return e},e.prototype.getModuleName=function(){return"Zoom"},e.prototype.destroy=function(){this.removeEventListener()},e}(),fn=function(){function e(e){this.control=e}return e.prototype.seriesStyles=function(){var e,i,r=document.getElementById(this.styleId),o="{}",n=this.control.selectionPattern,a=this.control.highlightPattern;if(t.isNullOrUndefined(r)||"None"!==n||"None"!==a){(r=document.createElement("style")).setAttribute("id",this.styleId);for(var s=0,l=this.control.visibleSeries;s<l.length;s++){var h=l[s],c=this.control.visibleSeries[h.index]||this.control.visibleSeries[h.index];if(!(t.isNullOrUndefined(n)&&t.isNullOrUndefined(a)||"None"===n&&"None"===a)){var d=this.styleId.indexOf("highlight")>0?a:n;if("Pie"===c.type||"Funnel"===c.type||"Pyramid"===c.type)for(var p=0;p<c.points.length;p++)i=c.opacity,o="{ fill:"+this.pattern(this.control,c.points[p].color,h.index,d,i)+"}";else c.type&&(i=c.opacity,o="{ fill:"+this.pattern(this.control,c.interior,h.index,d,i)+"}")}e=h.selectionStyle||this.styleId+"_series_"+h.index+",."+this.styleId+"_series_"+h.index+"> *",o=o.indexOf("None")>-1?"{}":o,r.innerHTML+=h.selectionStyle?"":"."+e+o}r.innerHTML+="."+this.unselected+" { opacity:0.3;} ",document.body.appendChild(r)}},e.prototype.pattern=function(e,t,i,r,o){var n=e.svgObject,a=[],s={id:e.element.id+"_"+r+"_Selection_"+i,patternUnits:"userSpaceOnUse"};switch(r){case"Dots":s.height=s.width=6,s.width=6,a[0]={x:0,y:0,width:7,height:7,transform:"translate(0,0)",fill:"#ffffff",opacity:o,name:"rect"},a[1]={cx:3,cy:3,r:2,"stroke-width":1,fill:t,name:"circle"};break;case"Pacman":s.height="18.384",s.width="17.917",a[0]={name:"rect",x:0,y:0,width:17.917,height:18.384,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M9.081,9.194l5.806-3.08c-0.812-1.496-2.403-3.052-4.291-3.052H8.835C6.138,3.063,3,6.151,3,8.723v1.679 c0,2.572,3.138,5.661,5.835,5.661h1.761c2.085,0,3.835-1.76,4.535-3.514L9.081,9.194z","stroke-width":1,stroke:t,fill:t};break;case"Chessboard":s.height=s.width=10,a[0]={x:0,y:0,width:10,height:10,fill:"#ffffff",opacity:o,name:"rect"},a[1]={x:0,y:0,width:5,height:5,fill:t,opacity:o,name:"rect"},a[2]={x:5,y:5,width:5,height:5,fill:t,opacity:o,name:"rect"};break;case"Crosshatch":s.height=s.width="8",a[0]={x:0,y:0,width:8,height:8,transform:"translate(0,0)",fill:"#ffffff",opacity:o,name:"rect"},a[1]={d:"M0 0L8 8ZM8 0L0 8Z","stroke-width":1,stroke:t,name:"path"};break;case"DiagonalForward":s.height=s.width=6,a[0]={x:0,y:0,width:6,height:6,transform:"translate(0,0)",fill:"#ffffff",opacity:o,name:"rect"},a[1]={d:"M 3 -3 L 9 3 M 6 6 L 0 0 M 3 9 L -3 3","stroke-width":2,stroke:t,name:"path"};break;case"DiagonalBackward":s.height=s.width=6,a[0]={x:0,y:0,width:6,height:6,transform:"translate(0,0)",fill:"#ffffff",opacity:o,name:"rect"},a[1]={d:"M 3 -3 L -3 3 M 0 6 L 6 0 M 9 3 L 3 9","stroke-width":2,stroke:t,name:"path"};break;case"Grid":s.height=s.width=6,a[0]={name:"rect",x:0,y:0,width:6,height:6,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M1 3.5L11 3.5 M0 3.5L11 3.5 M0 7.5L11 7.5 M0 11.5L11 11.5 M5.5 0L5.5 12 M11.5 0L11.5 12Z","stroke-width":1,stroke:t};break;case"Turquoise":s.height=s.width=17,a[0]={name:"rect",x:0,y:0,width:17,height:17,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M0.5739999999999998,2.643a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[2]={name:"path",d:"M11.805,2.643a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[3]={name:"path",d:"M6.19,2.643a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[4]={name:"path",d:"M11.805,8.217a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[5]={name:"path",d:"M6.19,8.217a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[6]={name:"path",d:"M11.805,13.899a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t},a[7]={name:"path",d:"M6.19,13.899a2.123,2.111 0 1,0 4.246,0a2.123,2.111 0 1,0 -4.246,0","stroke-width":1,"stroke-miterlimit":10,stroke:t,fill:t};break;case"Star":s.height=s.width=21,a[0]={name:"rect",x:0,y:0,width:21,height:21,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M15.913,18.59L10.762 12.842 5.613 18.75 8.291 11.422 0.325 9.91 8.154 8.33 5.337 0.91 10.488 6.658 15.637 0.75 12.959 8.078 20.925 9.59 13.096 11.17 z","stroke-width":1,stroke:t,fill:t};break;case"Triangle":s.height=s.width=10,a[0]={name:"rect",x:0,y:0,width:10,height:10,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M4.987,0L7.48 4.847 9.974 9.694 4.987 9.694 0 9.694 2.493 4.847 z","stroke-width":1,stroke:t,fill:t};break;case"Circle":s.height=s.width=9,a[0]={name:"rect",x:0,y:0,width:9,height:9,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"circle",cx:5.125,cy:3.875,r:3.625,"stroke-width":1,fill:t};break;case"Tile":s.height=s.width=18,a[0]={name:"rect",x:0,y:0,width:18,height:18,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M0,9L0 0 9 0 z","stroke-width":1,stroke:t,fill:t},a[2]={name:"path",d:"M9,9L9 0 18 0 z","stroke-width":1,stroke:t,fill:t},a[3]={name:"path",d:"M0,18L0 9 9 9 z","stroke-width":1,stroke:t,fill:t},a[4]={name:"path",d:"M9,18L9 9 18 9 z","stroke-width":1,stroke:t,fill:t};break;case"HorizontalDash":s.height=s.width=12,a[0]={name:"rect",x:0,y:0,width:12,height:12,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M0,1.5 L10 1.5 M0,5.5 L10 5.5 M0,9.5 L10 9.5 z","stroke-width":1,stroke:t,fill:t};break;case"VerticalDash":s.height=s.width=12,a[0]={name:"rect",x:0,y:0,width:12,height:12,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M1.5,0 L1.5 10 M5.5,0 L5.5 10 M9.5,0 L9.5 10 z","stroke-width":1,stroke:t,fill:t};break;case"Rectangle":s.height=s.width=12,a[0]={name:"rect",width:12,height:12,fill:"#ffffff",opacity:o},a[1]={name:"rect",x:1,y:2,width:4,height:9,fill:t,opacity:o},a[2]={name:"rect",x:7,y:2,width:4,height:9,fill:t,opacity:o};break;case"Box":s.height=s.width=10,a[0]={name:"rect",width:13,height:13,fill:"#ffffff",opacity:o},a[1]={name:"rect",x:1.5,y:1.5,width:10,height:9,fill:t,opacity:o};break;case"HorizontalStripe":s.height=12,s.width=10,a[0]={name:"rect",x:0,y:0,width:10,height:12,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M0,0.5 L10 0.5 M0,4.5 L10 4.5 M0,8.5 L10 8.5 z","stroke-width":1,stroke:t,fill:t};break;case"VerticalStripe":s.height=10,s.width=12,a[0]={name:"rect",x:0,y:0,width:12,height:10,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"path",d:"M0.5,0 L0.5 10 M4.5,0 L4.5 10 M8.5,0 L8.5 10 z","stroke-width":1,stroke:t,fill:t};break;case"Bubble":s.height=s.width=20,a[0]={name:"rect",x:0,y:0,width:20,height:20,transform:"translate(0,0)",fill:"#ffffff",opacity:o},a[1]={name:"circle",cx:5.217,cy:11.325,r:3.429,"stroke-width":1,fill:"#D0A6D1"},a[2]={name:"circle",cx:13.328,cy:6.24,r:4.884,"stroke-width":1,fill:t},a[3]={name:"circle",cx:13.277,cy:14.66,r:3.018,"stroke-width":1,fill:"#D0A6D1"}}var l=e.svgRenderer||e.renderer,h=l.createPattern(s,"pattern");return this.loadPattern(e,a,h,l),n.appendChild(h),"url(#"+e.element.id+"_"+r+"_Selection_"+i+")"},e.prototype.loadPattern=function(e,t,i,r){var o;for(o=0;o<t.length;o++){var n=r.createPattern(t[o],t[o].name);i.appendChild(n)}},e.prototype.concatIndexes=function(e,t){return e.concat(t)},e.prototype.checkVisibility=function(e){if(!e)return!1;for(var t=!1,i=[],r=0,o=e;r<o.length;r++){s=o[r];-1===i.indexOf(s.series)&&i.push(s.series)}for(var n=0,a=i;n<a.length;n++){var s=a[n];if(this.control.series[s].visible){t=!0;break}}return t},e.prototype.addSvgClass=function(e,t){var i=e.getAttribute("class")||"";-1===(i+=""!==i?" ":"").indexOf(t)&&e.setAttribute("class",i+t)},e.prototype.removeSvgClass=function(e,t){var i=e.getAttribute("class")||"";i.indexOf(t)>-1&&e.setAttribute("class",i.replace(t,""))},e.prototype.getChildren=function(e){for(var t=[],i=0;i<e.childNodes.length;i++)"defs"!==e.childNodes[i].tagName&&t.push(e.childNodes[i]);return t},e}(),bn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xn=function(e){function r(t){var i=e.call(this,t)||this;i.isdrawRect=!0,i.multiDataIndexes=[],i.pathIndex=0,i.seriesIndex=0,i.count=-1,i.dragRectArray=[],i.filterArray=[],i.totalSelectedPoints=[],i.chart=t,i.renderer=t.renderer;var r=t.selectionMode;return i.isMultiDrag=t.isMultiSelect&&r.indexOf("Drag")>-1,i.addEventListener(),i}return bn(r,e),r.prototype.addEventListener=function(){if(!(this.chart.isDestroyed||this.chart.stockChart&&this.chart.stockChart.onPanning)){var e=t.Browser.isPointer?"pointerleave":"mouseleave";this.chart.on(t.Browser.touchMoveEvent,this.mouseMove,this),this.chart.on(e,this.completeSelection,this),this.chart.on("click",this.calculateSelectedElements,this),this.chart.on(t.Browser.touchStartEvent,this.mousedown,this),this.chart.on(t.Browser.touchEndEvent,this.completeSelection,this)}},r.prototype.mousedown=function(e){var t=this.chart;t.isPointMouseDown||"None"===t.selectionMode||t.isChartDrag||(t.isDoubleTap||!t.isTouch||this.rectPoints)&&this.dragStart(t,t.chartAxisLayoutPanel.seriesClipRect,t.mouseDownX,t.mouseDownY,e)},r.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(t.Browser.touchMoveEvent,this.mouseMove),this.chart.off("pointerleave",this.completeSelection),this.chart.off("click",this.calculateSelectedElements),this.chart.off(t.Browser.touchStartEvent,this.mousedown),this.chart.off(t.Browser.touchEndEvent,this.completeSelection))},r.prototype.initPrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_selection",this.unselected=e.element.id+"_ej2_deselected",this.closeIconId=e.element.id+"_ej2_drag_close",this.draggedRectGroup=e.element.id+"_ej2_drag_group",this.multiRectGroup=e.element.id+"_ej2_drag_multi_group",this.draggedRect=e.element.id+"_ej2_drag_rect",this.lassoPath=e.element.id+"_ej2_drag_path",this.selectedDataIndexes=[],this.rectPoints=null,this.isSeriesMode="Series"===e.selectionMode},r.prototype.invokeSelection=function(e){this.initPrivateVariables(e),this.series=t.extend({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.selectionMode,e.selectionMode.indexOf("Drag")>-1||this.selectDataIndex(e,this.concatIndexes(e.selectedDataIndexes,this.selectedDataIndexes))},r.prototype.generateStyle=function(e){return e?(this.styleId.indexOf("selection")>1&&"None"!==this.chart.selectionMode&&(this.unselected=e.unSelectedStyle||this.unselected),this.styleId.indexOf("highlight")>0&&"None"!==this.chart.highlightMode&&(this.unselected=e.nonHighlightStyle||this.unselected),e.selectionStyle||this.styleId+"_series_"+e.index):"undefined"},r.prototype.selectDataIndex=function(e,t){for(var i=0,r=t;i<r.length;i++){var o=r[i];this.performSelection(o,e,this.getElementByIndex(e,o)[0])}},r.prototype.getElementByIndex=function(e,t,i){void 0===i&&(i="");var r=e.element.id+"_Series_"+t.series+"_Point_"+t.point,o=e.series[t.series];return r=!o.isRectSeries&&"Scatter"!==o.type&&"Bubble"!==o.type&&o.marker.visible?r+"_Symbol"+i:r,[he(r),"RangeArea"!==o.type&&"SplineRangeArea"!==o.type||!o.marker.visible?null:he(r+"1")]},r.prototype.getClusterElements=function(e,t){for(var i,r,o=[],n=0,a=e.visibleSeries;n<a.length;n++){var s=a[n];s.visible&&(t=new Jt(s.index,t.point),o.push(this.getElementByIndex(e,t)[0]),i=this.generateStyle(e.visibleSeries[t.series]),r=document.querySelectorAll("."+i),this.findTrackballElements(r,i),!e.isMultiSelect&&r.length>0&&r[0].id!==o[o.length-1].id&&this.removeSelection(e,t.series,r,i,!0))}return o},r.prototype.findTrackballElements=function(e,i){for(var r,o,n=0;n<e.length;n++)if(!t.isNullOrUndefined(e[n])&&(r=t.isNullOrUndefined(e[n].parentNode)?[]:[].slice.call(e[0].parentNode.querySelectorAll("."+i))).length>0){o=[];for(var a=0;a<r.length;a++)r[a].id.indexOf("Trackball")>-1&&o.push(r[a]);this.removeStyles(o)}},r.prototype.findElements=function(e,t,i,r){return void 0===r&&(r=""),this.isSeriesMode?this.getSeriesElements(t):"Cluster"===this.currentMode?this.getClusterElements(e,i):this.getElementByIndex(e,i,r)},r.prototype.isAlreadySelected=function(e){var t=e.target;if("click"===e.type?(this.currentMode=this.chart.selectionMode,this.styleId=this.chart.element.id+"_ej2_chart_selection"):"mousemove"===e.type&&(this.currentMode=this.chart.highlightMode,this.highlightDataIndexes=[],this.styleId=this.chart.element.id+"_ej2_chart_highlight"),"None"!==this.chart.highlightMode&&"None"===this.chart.selectionMode&&"click"===e.type)return!1;if("None"!==this.chart.highlightMode&&this.previousSelectedEle&&this.previousSelectedEle[0]){var i=t.parentNode.id,r=void 0;t.parentNode&&(r=i.indexOf("SeriesGroup")>0||i.indexOf("SymbolGroup")>0);for(var o=0;o<this.previousSelectedEle.length;o++)this.previousSelectedEle[o].hasAttribute("class")&&(this.previousSelectedEle[o].getAttribute("class").indexOf("highlight")>-1&&(r||"click"===e.type)?(this.previousSelectedEle[o].removeAttribute("class"),this.addOrRemoveIndex(this.highlightDataIndexes,this.indexFinder(this.previousSelectedEle[o].id))):!r&&this.previousSelectedEle[o].getAttribute("class").indexOf("highlight")>-1&&this.performSelection(this.indexFinder(this.previousSelectedEle[o].id),this.chart,this.previousSelectedEle[o]))}return!0},r.prototype.calculateSelectedElements=function(e){if(!t.isNullOrUndefined(e.target)){var i=e.target;if(("None"!==this.chart.selectionMode||"None"!==this.chart.highlightMode)&&-1!==i.id.indexOf(this.chart.element.id+"_")){if("mousemove"===e.type){if(i.hasAttribute("class")&&(i.getAttribute("class").indexOf("highlight")>-1||i.getAttribute("class").indexOf("selection")>-1))return;if(!t.isNullOrUndefined(i.parentNode)&&i.parentNode.hasAttribute("class")&&(i.parentNode.getAttribute("class").indexOf("highlight")>0||i.parentNode.getAttribute("class").indexOf("selection")>0))return}if(this.isAlreadySelected(e),i.id.indexOf("_Series_")>-1){var r=void 0;if(i.id.indexOf("_Trackball_1")>-1)r=he(i.id.split("_Trackball_")[0]+"_Symbol"),r=t.isNullOrUndefined(r)?he(i.id.split("_Trackball_")[0]):r;else if(i.id.indexOf("_Trackball_0")>-1)return null;this.performSelection(this.indexFinder(i.id),this.chart,r||i)}}}},r.prototype.performSelection=function(e,t,i){if(this.isSeriesMode="Series"===this.currentMode,"BoxAndWhisker"===t.series[e.series].type&&i&&i.id===t.element.id+"_Series_"+e.series+"_Point_"+e.point+"_BoxPath"&&(i=i.parentNode),"Area"===t.series[e.series].type&&("Point"===this.currentMode||"Cluster"===this.currentMode)&&i&&i.id===this.chart.element.id+"_Series_"+e.series){var r=this.generateStyle(t.series[e.series]),o=document.querySelectorAll("."+r);this.findTrackballElements(o,r),this.blurEffect(t.element.id,t.visibleSeries)}switch(this.currentMode){case"Series":this.selection(t,e,this.getSeriesElements(t.series[e.series])),this.selectionComplete(t,e,this.currentMode),this.blurEffect(t.element.id,t.visibleSeries);break;case"Point":!isNaN(e.point)&&i&&(this.selection(t,e,[i]),this.selectionComplete(t,e,this.currentMode),this.blurEffect(t.element.id,t.visibleSeries));break;case"Cluster":isNaN(e.point)||(this.clusterSelection(t,e),this.selectionComplete(t,e,this.currentMode),this.blurEffect(t.element.id,t.visibleSeries))}},r.prototype.selectionComplete=function(e,t,i){var r,o,n,a,s,l=[];if("Cluster"===i){for(var h=0,c=e.visibleSeries;h<c.length;h++)if((p=c[h]).visible)for(d=0;d<this.selectedDataIndexes.length;d++)o=e.isMultiSelect?this.selectedDataIndexes[d].point:t.point,n=p.index,r=p.points,isNaN(o)||(p.type,a=r[o].yValue,s=r[o].xValue,"Category"===e.primaryXAxis.valueType?s=r[o].x.toLocaleString():"DateTime"===e.primaryXAxis.valueType&&(s=new Date(r[o].xValue)),"Indicator"!==p.category&&l.push({x:s,y:a,seriesIndex:n,pointIndex:o}),"RangeArea"!==p.type&&"SplineRangeArea"!==p.type||l.push({x:s,y:r[o].regions[0].y,seriesIndex:n,pointIndex:o}))}else if("Series"===i)if(e.isMultiSelect)for(d=0;d<this.selectedDataIndexes.length;d++)n=this.selectedDataIndexes[d].series,l.push({seriesIndex:n});else n=this.selectedDataIndexes.length>0?this.selectedDataIndexes[0].series:0,l.push({seriesIndex:n});else if("Point"===i)for(var d=0;d<this.selectedDataIndexes.length;d++){o=this.selectedDataIndexes[d].point,n=this.selectedDataIndexes[d].series;var p=e.series[n];r=p.points,isNaN(o)||(s=r[o].xValue,p.type,a=r[o].yValue,"Category"===e.primaryXAxis.valueType?s=r[o].x.toLocaleString():"DateTime"===e.primaryXAxis.valueType&&(s=new Date(r[o].xValue)),l.push({x:s,y:a,seriesIndex:n,pointIndex:o}))}var u={name:"selectionComplete",selectedDataValues:l,cancel:!1};e.trigger("selectionComplete",u)},r.prototype.selection=function(e,i,r){if("Lasso"!==this.currentMode&&(e.isMultiSelect||-1!==this.currentMode.indexOf("Drag")||-1!==this.styleId.indexOf("highlight")||"None"===e.selectionMode||this.removeMultiSelectElements(e,this.selectedDataIndexes,i,e.series)),!t.isNullOrUndefined(r[0])){var o=void 0,n=r[0]&&(r[0].getAttribute("class")||""),a=r[0].parentNode&&(r[0].parentNode.getAttribute("class")||"");""!==n&&"Cluster"!==this.currentMode&&this.findTrackballElements(r,n),r[0]&&n.indexOf(this.getSelectionClass(r[0].id))>-1?this.removeStyles(r):r[0].parentNode&&a.indexOf(this.getSelectionClass(r[0].id))>-1?this.removeStyles([r[0].parentNode]):(this.previousSelectedEle="None"!==e.highlightMode?r:[],this.applyStyles(r),o=!0),this.styleId.indexOf("highlight")>0&&"None"!==e.highlightMode?this.addOrRemoveIndex(this.highlightDataIndexes,i,o):this.addOrRemoveIndex(this.selectedDataIndexes,i,o)}},r.prototype.clusterSelection=function(e,t){this.selection(e,t,this.getClusterElements(e,new Jt(t.series,t.point)))},r.prototype.removeMultiSelectElements=function(e,t,i,r){for(var o,n=0;n<t.length;n++)o=r[t[n].series],(this.isSeriesMode&&!this.toEquals(t[n],i,this.isSeriesMode)||"Cluster"===this.currentMode&&!this.toEquals(t[n],i,!1)||!this.isSeriesMode&&this.toEquals(t[n],i,!0)&&!this.toEquals(t[n],i,!1))&&(this.removeStyles(this.findElements(e,o,t[n])),t.splice(n,1),n--)},r.prototype.blurEffect=function(e,i,r){void 0===r&&(r=!1);for(var o=this.checkVisibility(this.highlightDataIndexes)||this.checkVisibility(this.selectedDataIndexes),n=0,a=i;n<a.length;n++){var s=a[n];s.visible&&(this.checkSelectionElements(he(e+"SeriesGroup"+s.index),this.generateStyle(s),o,r,s.index),t.isNullOrUndefined(he(e+"SymbolGroup"+s.index))||this.checkSelectionElements(he(e+"SymbolGroup"+s.index),this.generateStyle(s),o,r,s.index))}},r.prototype.checkSelectionElements=function(e,t,i,r,o){var n=this.isSeriesMode?[e]:e.childNodes;"None"!==this.chart.selectionMode&&"None"!==this.chart.highlightMode&&(n=e.children);for(var a,s,l,h=e,c=0;c<n.length;c++)a=n[c].getAttribute("class")||"",s=n[c].parentNode.getAttribute("class")||"","None"!==this.chart.selectionMode&&"None"!==this.chart.highlightMode&&(t=a.indexOf("selection")>0||a.indexOf("highlight")>0?a:t,t=s.indexOf("selection")>0||s.indexOf("highlight")>0?s:t),-1===a.indexOf(t)&&-1===s.indexOf(t)&&i?this.addSvgClass(n[c],this.unselected):(h=n[c],this.removeSvgClass(n[c],this.unselected),this.removeSvgClass(n[c].parentNode,this.unselected)),n[c].id.indexOf("Trackball")>0&&h.classList[0]===t&&(this.removeSvgClass(n[c],this.unselected),this.removeSvgClass(n[c].parentNode,this.unselected),this.addSvgClass(n[c],t));if(e.id.indexOf("Symbol")>-1&&e.querySelectorAll("."+t)[0]&&e.querySelectorAll("."+t)[0].getAttribute("class")===t){var d=he(this.control.element.id+"_Series_"+e.id[e.id.length-1]);(d&&d.hasAttribute("class")?d.getAttribute("class"):"").indexOf(this.unselected)>-1&&this.removeSvgClass(d,this.unselected)}this.control.legendModule&&this.control.legendSettings.visible&&(l=he(this.control.element.id+"_chart_legend_shape_"+o))&&(l.hasAttribute("class")&&this.removeSvgClass(l,l.getAttribute("class")),a=h.getAttribute("class")||"",s=h.parentNode.getAttribute("class")||"",-1===a.indexOf(t)&&-1===s.indexOf(t)&&i?(this.addSvgClass(l,this.unselected),this.removeSvgClass(l,t)):(this.removeSvgClass(l,this.unselected),""===a&&""===s||"EJ2-Trackball"===a.trim()?this.removeSvgClass(l,t):this.addSvgClass(l,t)),r&&s.indexOf(t)>-1&&this.addSvgClass(l,t))},r.prototype.applyStyles=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r&&(this.removeSvgClass(r.parentNode,this.unselected),this.removeSvgClass(r,this.unselected),this.addSvgClass(r,this.getSelectionClass(r.id)))}},r.prototype.getSelectionClass=function(e){return this.generateStyle(this.control.series[this.indexFinder(e).series])},r.prototype.removeStyles=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r&&this.removeSvgClass(r,this.getSelectionClass(r.id))}},r.prototype.addOrRemoveIndex=function(e,t,i){for(var r=0;r<e.length;r++)this.toEquals(e[r],t,this.isSeriesMode)&&(e.splice(r,1),r--);i&&e.push(t)},r.prototype.toEquals=function(e,t,i){return(e.series===t.series||"Cluster"===this.currentMode&&!i)&&(i||e.point===t.point)},r.prototype.redrawSelection=function(e,i,r){this.isSeriesMode="Series"===i,t.isNullOrUndefined(i)||(-1!==i.indexOf("Drag")||"Lasso"===i||r?e.isRedrawSelection=!1:e.isRedrawSelection=!0);var o=t.extend([],this.selectedDataIndexes,null,!0),n=t.extend([],this.highlightDataIndexes,null,!0);this.styleId.indexOf("highlight")>0&&n.length>0?(this.removeSelectedElements(e,this.highlightDataIndexes,e.series),o=n):this.removeSelectedElements(e,this.selectedDataIndexes,e.series),this.blurEffect(e.element.id,e.visibleSeries),this.selectDataIndex(e,o)},r.prototype.legendSelection=function(e,i,r){var o=r.target;if("mousemove"===r.type){if(r.target.id.indexOf("text")>1&&(o=he(r.target.id.replace("text","shape"))),o.hasAttribute("class")&&(o.getAttribute("class").indexOf("highlight")>-1||o.getAttribute("class").indexOf("selection")>-1))return;this.currentMode=this.chart.highlightMode}if(this.isAlreadySelected(r)){var n=this.generateStyle(e.visibleSeries[i]),a=document.querySelectorAll("."+n);this.isSeriesMode="Series"===this.currentMode;if(a.length>0)this.removeSelection(e,i,a,n,!0);else{for(var s=0,l=e.visibleSeries;s<l.length;s++){var h=l[s];h.index===i||e.isMultiSelect||(n=this.generateStyle(e.visibleSeries[h.index]),a=document.querySelectorAll("."+n),this.removeSelection(e,i,a,n,!0))}for(var c=this.getSeriesElements(e.visibleSeries[i]),d=0,p=c;d<p.length;d++){var u=p[d];if(t.isNullOrUndefined(u))return;this.checkSelectionElements(u,n,!1,!0,i)}this.isSeriesMode=!0,this.selection(e,new Jt(i,NaN),c),this.isSeriesMode="Series"===e.selectionMode,this.blurEffect(e.element.id,e.visibleSeries,!0)}}},r.prototype.removeSelection=function(e,t,i,r,o){if(i.length>0){for(var n=[],a=0;a<i.length;a++)n.push(i[a]);this.removeStyles(n),this.isSeriesMode=!0,this.addOrRemoveIndex(this.selectedDataIndexes,new Jt(t,NaN));for(var s=0,l=e.visibleSeries;s<l.length;s++){var h=l[s];if(r=this.generateStyle(h),document.querySelectorAll("."+r).length>0){for(var c=0,d=n;c<d.length;c++){var p=d[c];this.checkSelectionElements(p,r,!0,!0,t)}o=!1;break}}o&&(this.isSeriesMode="Series"===e.selectionMode,this.blurEffect(e.element.id,e.visibleSeries))}},r.prototype.getSeriesElements=function(e){var t=[e.seriesElement];return e.marker.visible&&"Scatter"!==e.type&&"Bubble"!==e.type&&!e.isRectSeries&&t.push(e.symbolElement),t},r.prototype.indexFinder=function(e){var t=["NaN","NaN"];return e.indexOf("SeriesGroup")>-1?(t=e.split("SeriesGroup"))[0]=t[1]:e.indexOf("SymbolGroup")>-1?(t=e.split("SymbolGroup"))[0]=t[1]:e.indexOf("_Point_")>-1?t=e.split("_Series_")[1].split("_Point_"):e.indexOf("_Series_")>-1?t[0]=e.split("_Series_")[1]:e.indexOf("_chart_legend_shape_")>-1&&((t=e.split("_chart_legend_shape_"))[0]=t[1]),new Jt(parseInt(t[0],10),parseInt(t[1],10))},r.prototype.calculateDragSelectedElements=function(e,t,r){this.removeSelectedElements(e,this.selectedDataIndexes,e.series);var o="Lasso"===e.selectionMode,n=new i.Rect(t.x,t.y,t.width,t.height),a=new Vi(e.chartAxisLayoutPanel.seriesClipRect.x,e.chartAxisLayoutPanel.seriesClipRect.y);this.removeOffset(n,a);var s,l,h=[],c=[];this.isSeriesMode=!1;var d=e.allowMultiSelection&&(this.rectGrabbing||this.resizing);if(this.rectPoints=this.dragRectArray[d?this.targetIndex:this.count]=new i.Rect(t.x,t.y,t.width,t.height),t.width&&t.height&&!r){var p=new i.Rect(t.x,t.y,t.width,t.height);this.removeOffset(p,a),this.filterArray[d?this.targetIndex:this.count]=p}for(var u=this,g=0,y=e.visibleSeries;g<y.length;g++)!function(t){if(t.visible){s=t.points,h=[];var i,r;!e.isTransposed&&-1===t.type.indexOf("Bar")||e.isTransposed&&-1!==t.type.indexOf("Bar")?(i=t.xAxis.rect.x-a.x,r=t.yAxis.rect.y-a.y):(i=t.xAxis.rect.y-a.y,r=t.yAxis.rect.x-a.x);for(var o=0;o<s.length;o++){var d=(t.type,s[o].yValue),p=void 0,g=s[o].xValue;"Category"===e.primaryXAxis.valueType?g=s[o].x.toLocaleString():"DateTime"===e.primaryXAxis.valueType&&(g=new Date(s[o].xValue)),(p="BoxAndWhisker"===t.type?s[o].regions.some(function(e){return j(e.x+i,e.y+r,n)}):"Lasso"===e.selectionMode?s[o].isSelect:e.allowMultiSelection?u.isPointSelect(s[o],i,r,u.filterArray):s[o].symbolLocations.some(function(e){return e&&j(e.x+i,e.y+r,n)}))&&"Indicator"!==t.category&&(l=new Jt(t.index,s[o].index),u.selection(e,l,u.findElements(e,t,l)),h.push({x:g,y:d})),!p||"RangeArea"!==t.type&&"SplineRangeArea"!==t.type||h.push({x:g,y:s[o].regions[0].y})}c.push(h)}}(y[g]);this.blurEffect(e.element.id,e.visibleSeries);var m=o?e.mouseDownX:t.x+t.width,v=o?e.mouseDownY:t.y;r||this.createCloseButton(m,v);var f={name:"dragComplete",selectedDataValues:c,cancel:!1};e.trigger("dragComplete",f)},r.prototype.removeOffset=function(e,t){e.x-=t.x,e.y-=t.y},r.prototype.isPointSelect=function(e,t,i,r){for(var o=e.symbolLocations[0],n=0,a=r;n<a.length;n++){var s=a[n];if(s&&o&&j(o.x+t,o.y+i,s))return!0}return!1},r.prototype.drawDraggingRect=function(e,r,o){var n=e.chartAxisLayoutPanel.seriesClipRect,a=e.chartArea.border.width,s=e.themeStyle.selectionRectFill,l=e.themeStyle.selectionRectStroke,h="Lasso"===e.selectionMode;switch(this.isdrawRect&&(n.x=n.x-a/2,n.y=n.y-a/2,n.width=n.width+a,n.height=n.height+a,this.isdrawRect=!1),e.selectionMode){case"DragX":r.y=n.y,r.height=n.height;break;case"DragY":r.x=n.x,r.width=n.width}if((r.width<5||r.height<5)&&!h)return null;var c=e.selectionMode.indexOf("Drag")>-1||"Lasso"===e.selectionMode;if(e.allowMultiSelection&&c){var d=void 0,p=void 0,u=he(this.multiRectGroup);if(u||(u=e.svgRenderer.createGroup({id:this.multiRectGroup}),e.svgObject.appendChild(u)),this.rectGrabbing||this.resizing){var g=void 0;(g=he(this.draggedRect+this.targetIndex)).nextSibling&&t.remove(g.nextSibling),this.setAttributes(g,r)}else if(!he(this.draggedRectGroup+this.count)){p=e.svgRenderer.createGroup({id:this.draggedRectGroup+this.count});y=document.getElementById(e.element.id+"_series_svg");e.enableCanvas?y.appendChild(p):u.appendChild(p)}"Lasso"!==e.selectionMode?(d=e.svgRenderer.drawRectangle(new Di(this.draggedRect+this.count,s,{color:l,width:1},1,r))).setAttribute("style","cursor:move;"):d=e.svgRenderer.drawPath(new i.PathOption(this.lassoPath+this.count,s,3,l,1,"",this.path)),p||this.rectGrabbing||this.resizing?this.rectGrabbing||this.resizing||p.appendChild(d):he(this.draggedRectGroup+this.count).appendChild(d)}else{d=he(h?this.lassoPath:this.draggedRect);if(this.closeIcon&&m(this.closeIconId),d)h?d.setAttribute("d",this.path):this.setAttributes(d,r);else{var p=e.svgRenderer.createGroup({id:this.draggedRectGroup}),y=document.getElementById(e.element.id+"_series_svg");e.enableCanvas?y.appendChild(p):e.svgObject.appendChild(p),d="Lasso"!==e.selectionMode?e.svgRenderer.drawRectangle(new Di(this.draggedRect,s,{color:l,width:1},1,r)):e.svgRenderer.drawPath(new i.PathOption(this.lassoPath,s,3,l,1,"",this.path)),p.appendChild(d)}}},r.prototype.getIndex=function(e){var t;for(t=e.length-1;t>0;t--){var i=Number(e[t]);if(isNaN(i))break}return+e.substr(t+1,e.length-1)},r.prototype.createCloseButton=function(e,t){var i=this.chart.allowMultiSelection,r=this.chart.themeStyle.selectionCircleStroke,o=this.rectGrabbing||this.resizing,n=this.chart.svgRenderer.createGroup({id:this.closeIconId+(i?o?this.targetIndex:this.count:""),style:"cursor:pointer; visibility: visible;"});n.appendChild(this.chart.svgRenderer.drawCircle(new Fi(this.closeIconId+"_circle"+(i?o?this.targetIndex:this.count:""),"#FFFFFF",{color:r,width:1},1,e,t,10)));var a="M "+(e-4)+" "+(t-4)+" L "+(e+4)+" "+(t+4)+" M "+(e-4)+" "+(t+4)+" L "+(e+4)+" "+(t-4);n.appendChild(this.chart.svgRenderer.drawPath({id:this.closeIconId+"_cross"+(i?o?this.targetIndex:this.count:""),d:a,stroke:r,"stroke-width":2,fill:r})),this.closeIcon=n;var s=he(this.draggedRectGroup+(i?o?this.targetIndex:this.count:""));s&&s.appendChild(n)},r.prototype.removeDraggedElements=function(e,r){if(r.target.id.indexOf(this.closeIconId)>-1&&-1===r.type.indexOf("move")){var o=!0;if(e.allowMultiSelection){var n=this.getIndex(r.target.id),a=he(this.multiRectGroup);if(t.remove(he(this.draggedRectGroup+n)),this.dragRectArray[n]=null,this.filterArray[n]=null,this.totalSelectedPoints[n]=null,a&&0===a.childElementCount&&(m(a),this.dragRectArray=[],this.filterArray=[],this.totalSelectedPoints=[]),"Lasso"===this.currentMode){if(null!=this.multiDataIndexes[n])for(h=0;h<this.multiDataIndexes[n].length;h++)this.multiDataIndexes[n][h].isSelect=!1;this.multiDataIndexes[n]=null;for(var s=0;s<this.multiDataIndexes.length;s++)if(null!=this.multiDataIndexes[s]){o=!1;for(var l=0;l<this.multiDataIndexes[s].length;l++)this.multiDataIndexes[s][l].isSelect=!0}this.calculateDragSelectedElements(e,this.dragRect,!0)}else if(this.filterArray.length)for(var h=0;h<this.filterArray.length;h++)this.filterArray[h]&&(o=!1,this.calculateDragSelectedElements(e,this.filterArray[h],!0));else this.calculateDragSelectedElements(e,new i.Rect(0,0,0,0),!0)}else t.remove(he(this.draggedRectGroup)),this.removeSelectedElements(e,this.selectedDataIndexes,e.series);this.blurEffect(e.element.id,e.visibleSeries),this.changeCursorStyle(!1,e.svgObject,"auto"),e.allowMultiSelection&&!o||(this.rectPoints=null)}},r.prototype.resizingSelectionRect=function(e,t,r,o){var n;if(e.allowMultiSelection&&o.id.indexOf("_ej2_drag_rect")>-1||this.dragRectArray[this.targetIndex]){o.id.indexOf("_ej2_drag_rect")>-1&&(this.targetIndex=this.getIndex(o.id));var a=this.dragRectArray[this.targetIndex];n=new i.Rect(a.x,a.y,a.width,a.height)}if(e.allowMultiSelection||(n=new i.Rect(this.rectPoints.x,this.rectPoints.y,this.rectPoints.width,this.rectPoints.height)),n){var s=this.findResizeMode(e.svgObject,n,t);this.resizing&&(n=xe(n.x,n.y,n.x+n.width,n.y+n.height,e.chartAxisLayoutPanel.seriesClipRect),this.drawDraggingRect(e,n),this.dragRect=n),r&&(this.resizing=s)}},r.prototype.findResizeMode=function(e,t,r){var o="se-resize",n=!1;if(this.resizing){var a=t.x,s=t.y,l=r.x-a,h=r.y-s;switch(this.resizeMode){case 0:h=Math.abs(t.height+t.y-r.y),t.y=Math.min(t.height+t.y,r.y),t.height=h;break;case 1:l=Math.abs(t.width+t.x-r.x),t.x=Math.min(t.width+t.x,r.x),t.width=l;break;case 2:t.height=Math.abs(h),t.y=Math.min(r.y,s);break;case 3:t.width=Math.abs(l),t.x=Math.min(r.x,a);break;case 4:t.width=Math.abs(l),t.height=Math.abs(h),t.x=Math.min(r.x,a),t.y=Math.min(r.y,s)}}else for(var c=[new i.Rect(t.x,t.y,t.width-5,5),new i.Rect(t.x,t.y,5,t.height),new i.Rect(t.x,t.y+t.height-5,t.width-5,5),new i.Rect(t.x+t.width-5,t.y+5,5,t.height-15),new i.Rect(t.x+t.width-10,t.y+t.height-10,10,10)],d=0;d<c.length;d++)if(j(r.x,r.y,c[d])){o=4===d?o:d%2==0?"ns-resize":"ew-resize",n=!0,this.resizeMode=d;break}return"Lasso"!==this.currentMode&&this.changeCursorStyle(n,he(this.chart.allowMultiSelection?this.draggedRect+this.targetIndex:this.draggedRect),o),this.changeCursorStyle(n,e,o),n},r.prototype.changeCursorStyle=function(e,t,i){i=e?i:this.control.svgObject===t?"auto":"move",t&&t.setAttribute("style","cursor:"+i+";")},r.prototype.removeSelectedElements=function(e,t,i){t=e.isRedrawSelection?t:t.splice(0,t.length);for(var r,o=0,n=i;o<n.length;o++){var a=n[o];r=this.getSeriesElements(a),this.removeStyles(r);for(var s=0,l=r;s<l.length;s++){var h=l[s];this.removeStyles(this.getChildren(h))}}},r.prototype.setAttributes=function(e,t){for(var i=0,r=Object.keys(t);i<r.length;i++){var o=r[i];e.setAttribute(o,t[o])}},r.prototype.draggedRectMoved=function(e,t,r,o){var n;if((this.resizing||this.rectGrabbing)&&e.allowMultiSelection){var a=this.dragRectArray[this.targetIndex];n=new i.Rect(a.x,a.y,a.width,a.height)}else n=new i.Rect(this.rectPoints.x,this.rectPoints.y,this.rectPoints.width,this.rectPoints.height);n.x-=t.x-e.mouseX,n.y-=t.y-e.mouseY,n=xe(n.x,n.y,n.x+n.width,n.height+n.y,e.chartAxisLayoutPanel.seriesClipRect),r?this.drawDraggingRect(e,n,o):this.calculateDragSelectedElements(e,n)},r.prototype.completeSelection=function(e){var t=this.chart;"None"!==t.selectionMode&&(this.currentMode=t.selectionMode,(this.dragging||this.resizing)&&this.dragRect.width>5&&this.dragRect.height>5?this.calculateDragSelectedElements(t,this.dragRect):!t.allowMultiSelection&&this.rectGrabbing&&this.rectPoints.width&&this.rectPoints.height?this.draggedRectMoved(t,this.dragRect):this.rectGrabbing&&this.dragRectArray[this.targetIndex].width&&this.dragRectArray[this.targetIndex].height&&this.draggedRectMoved(t,this.dragRect),"Lasso"===t.selectionMode&&this.dragging&&this.path&&-1!==this.path.indexOf("L")&&(t.allowMultiSelection?he(this.lassoPath+this.count)&&(he(this.lassoPath+this.count).setAttribute("d",this.path+"Z"),this.pointChecking(he(this.lassoPath+this.count))):(he(this.lassoPath).setAttribute("d",this.path+"Z"),this.pointChecking(he(this.lassoPath))),(this.dragging||this.resizing)&&this.calculateDragSelectedElements(t,this.dragRect)),this.dragging=!1,this.rectGrabbing=!1,this.resizing=!1,this.removeDraggedElements(t,e))},r.prototype.getDragRect=function(e,t){return xe(e.mouseDownX,e.mouseDownY,e.mouseX,e.mouseY,t)},r.prototype.dragStart=function(e,t,r,o,n){var a=e.selectionMode;this.currentMode=e.selectionMode,this.dragging=(a.indexOf("Drag")>-1||"Lasso"===a)&&(e.isDoubleTap||!e.isTouch)&&"PolarRadar"!==e.chartAreaType;var s=n.target;if(this.path=void 0,this.dragging&&(this.count=he(this.multiRectGroup)?this.count+1:0,this.dragRect=new i.Rect(e.mouseDownX,e.mouseDownY,0,0),(e.mouseDownX<t.x||e.mouseDownX>t.x+t.width||e.mouseDownY<t.y||e.mouseDownY>t.y+t.height)&&(this.dragging=!1)),"Lasso"===a)for(var l=0,h=e.visibleSeries;l<h.length;l++){var c=h[l];if(c.visible)for(var d=0,p=c.points;d<p.length;d++){var u=p[d];e.allowMultiSelection||(u.isSelect=!1)}}if("Lasso"!==a&&(this.rectPoints&&!e.allowMultiSelection&&(this.dragRect=new i.Rect(e.mouseDownX,e.mouseDownY,0,0),this.resizingSelectionRect(e,new Vi(r,o),!0),this.rectGrabbing=j(r,o,this.rectPoints)),e.allowMultiSelection)){var g=this.getIndex(s.id);this.targetIndex=this.isDragRect(s.id)?g:void 0,this.dragRectArray.length&&this.isDragRect(s.id)&&(this.resizingSelectionRect(e,new Vi(r,o),!0,s),this.rectGrabbing=j(r,o,this.dragRectArray[g]))}},r.prototype.isDragRect=function(e){return e.indexOf("_ej2_drag_rect")>-1},r.prototype.mouseMove=function(e){var i=this.chart,r=e.target;if("None"!==i.highlightMode&&!t.isNullOrUndefined(r)){if(e.target.id.indexOf("text")>1&&(r=he(e.target.id.replace("text","shape"))),r.hasAttribute("class")&&(r.getAttribute("class").indexOf("highlight")>-1||r.getAttribute("class").indexOf("selection")>-1))return;return void this.calculateSelectedElements(e)}"None"!==i.selectionMode&&("touchmove"===e.type&&(t.Browser.isIos||t.Browser.isIos7)&&this.dragging&&e.preventDefault&&e.preventDefault(),j(i.mouseX,i.mouseY,i.chartAxisLayoutPanel.seriesClipRect)?(this.rectGrabbing&&!this.resizing?this.draggedRectMoved(i,this.dragRect,!0,r):this.dragging&&!this.resizing&&("Lasso"===i.selectionMode?(this.getPath(i.mouseDownX,i.mouseDownY,i.mouseX,i.mouseY),this.drawDraggingRect(i,this.dragRect,r)):(this.dragRect=this.getDragRect(i,i.chartAxisLayoutPanel.seriesClipRect),this.drawDraggingRect(i,this.dragRect,r))),this.rectPoints&&!i.allowMultiSelection?this.resizingSelectionRect(i,new Vi(i.mouseX,i.mouseY),null,r):(i.allowMultiSelection&&!this.dragging||this.resizing)&&this.resizingSelectionRect(i,new Vi(i.mouseX,i.mouseY),null,r)):this.completeSelection(e))},r.prototype.getPath=function(e,t,i,r){this.dragging&&(this.path?this.path=this.path+" L"+i+" "+r:this.path="M "+e+" "+t)},r.prototype.pointChecking=function(e){var t,i=this,r=this.chart,o=he(r.svgId).getBoundingClientRect(),n=r.chartAxisLayoutPanel.seriesClipRect.x+Math.max(o.left,0),a=r.chartAxisLayoutPanel.seriesClipRect.y+Math.max(o.top,0);this.multiDataIndexes[this.count]=[];for(var s=0,l=r.visibleSeries;s<l.length;s++)l[s].points.filter(function(o){o.symbolLocations&&o.symbolLocations.length&&(t=document.elementFromPoint(o.symbolLocations[0].x+n,o.symbolLocations[0].y+a)),t===e?(o.isSelect=!0,i.chart.allowMultiSelection&&"Lasso"===i.currentMode&&(i.multiDataIndexes[i.count][i.seriesIndex]=o,i.seriesIndex++)):r.allowMultiSelection||(o.isSelect=!1)});this.seriesIndex=0},r.prototype.getModuleName=function(){return"Selection"},r.prototype.destroy=function(){this.removeEventListener()},r}(fn),wn=function(){function e(e){this.isPointDragging=!1,this.chart=e}return e.prototype.pointMouseDown=function(){var e=this.chart,t=new Zi(e),i=t.getData();!i.point||!t.insideRegion&&i.series.isRectSeries||(this.seriesIndex=i.series.index,this.pointIndex=i.point.index,e.series[this.seriesIndex].dragSettings.enable&&!e.zoomModule&&(e.trigger("dragStart",{series:i.series,seriesIndex:this.seriesIndex,pointIndex:this.pointIndex,point:i.point,oldValue:e.visibleSeries[this.seriesIndex].yData[this.pointIndex],newValue:e.visibleSeries[this.seriesIndex].points[this.pointIndex].yValue}),e.isPointMouseDown=!0,e.zoomSettings.enableDeferredZooming=!1))},e.prototype.pointMouseMove=function(e){var t,i=this.chart;"touchmove"===e.type&&e.preventDefault&&e.preventDefault();var r=new Zi(i),o=r.getData();o.series.dragSettings.enable&&o.point&&(r.insideRegion||!o.series.isRectSeries)?this.getCursorStyle(o):i.svgObject.setAttribute("style","cursor: null"),i.isPointMouseDown&&((t=i.series[this.seriesIndex]).type.indexOf("Spline")>-1&&i[G(t.type)+"SeriesModule"].findSplinePoint(t),this.pointDragging(this.seriesIndex,this.pointIndex))},e.prototype.getCursorStyle=function(e){var t=this.chart;"Bar"===e.series.type&&t.isTransposed?t.svgObject.setAttribute("style","cursor:ns-resize"):t.isTransposed||"Bar"===e.series.type?t.svgObject.setAttribute("style","cursor:ew-resize"):t.svgObject.setAttribute("style","cursor:ns-resize")},e.prototype.pointDragging=function(e,i){var r,o,n,a=this.chart,s=[],l=a.visibleSeries[e],h=l.dragSettings,c=l.xAxis,d=l.yAxis,p=l.isRectSeries?1:0,u=W(c,d,a.requireInvertedAxis);"Bar"===l.type?(r=a.isTransposed?u.y+u.height-a.mouseY:a.mouseX-u.x,o=a.isTransposed?u.height:u.width):(r=a.isTransposed?a.mouseX-u.x:u.y+u.height-a.mouseY,o=a.isTransposed?u.width:u.height),n=(n=d.isInversed?1-r/o:r/o)*d.visibleRange.delta+d.visibleRange.min;var g=null!==d.minimum?d.visibleRange.min+p:t.isNullOrUndefined(h.minY)?n:h.minY;if((null!==d.maximum?d.visibleRange.max+p:t.isNullOrUndefined(h.maxY)?n:h.maxY)>=n&&g<=n){l.points[i].yValue=l.points[i].y=a.dragY="Logarithmic"===d.valueType?Math.pow(d.logBase,n):parseFloat(n.toFixed(2)),l.points[i].interior=h.fill;for(var y=0;y<l.points.length;y++)s[y]=l.points[y].yValue;l.yMin=Math.min.apply(null,s),l.yMax=Math.max.apply(null,s),this.isPointDragging=!0,a.refreshBound(),a.trigger("drag",{seriesIndex:e,pointIndex:i,series:l,point:l.points[i],oldValue:a.visibleSeries[this.seriesIndex].yData[this.pointIndex],newValue:l.points[i].yValue})}},e.prototype.pointMouseUp=function(){var e=this.chart;e.isPointMouseDown&&e.series[this.seriesIndex].dragSettings.enable&&(e.trigger("dragEnd",{series:e.series[this.seriesIndex],point:e.visibleSeries[this.seriesIndex].points[this.pointIndex],seriesIndex:this.seriesIndex,pointIndex:this.pointIndex,oldValue:e.visibleSeries[this.seriesIndex].yData[this.pointIndex],newValue:e.visibleSeries[this.seriesIndex].points[this.pointIndex].yValue}),e.visibleSeries[this.seriesIndex].points[this.pointIndex].y=e.visibleSeries[this.seriesIndex].points[this.pointIndex].yValue,e.isPointMouseDown=!1,this.isPointDragging=!1,this.seriesIndex=this.pointIndex=void 0)},e.prototype.getModuleName=function(){return"DataEditing"},e.prototype.destroy=function(){},e}(),Sn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Cn=function(e){function i(t){var i=e.call(this,t)||this;return i.chart=t,i.renderer=t.renderer,i.wireEvents(),i}return Sn(i,e),i.prototype.wireEvents=function(){this.chart.isDestroyed||this.chart.stockChart&&this.chart.stockChart.onPanning||this.chart.on(t.Browser.touchMoveEvent,this.mouseMove,this)},i.prototype.unWireEvents=function(){this.chart.isDestroyed||this.chart.off(t.Browser.touchMoveEvent,this.mouseMove)},i.prototype.declarePrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_highlight",this.unselected=e.element.id+"_ej2_deselected",this.selectedDataIndexes=[],this.highlightDataIndexes=[],this.isSeriesMode="Series"===e.highlightMode},i.prototype.invokeHighlight=function(e){this.declarePrivateVariables(e),this.series=t.extend({},e.visibleSeries,null,!0),this.seriesStyles(),this.currentMode=e.highlightMode},i.prototype.getModuleName=function(){return"Highlight"},i.prototype.destroy=function(){this.unWireEvents()},i}(xn),Pn=function(){function e(e){this.errorHeight=0,this.chart=e}return e.prototype.initPrivateVariables=function(e,t){var i="",r="",o=e.chart.renderer,n=void 0===e.index?e.category:e.index;"Cartesian"===e.chart.chartAreaType&&(i="translate("+e.clipRect.x+","+e.clipRect.y+")",r="url(#"+this.chart.element.id+"_ChartSeriesClipRect_"+n+")"),t.dataLabel.visible&&(e.shapeElement=o.createGroup({id:this.chart.element.id+"ShapeGroup"+n,transform:i,"clip-path":"url(#"+this.chart.element.id+"_ChartSeriesClipRect_"+n+")"}),e.textElement=o.createGroup({id:this.chart.element.id+"TextGroup"+n,transform:i,"clip-path":r})),this.markerHeight="Scatter"===e.type||t.visible?t.height/2:0,this.commonId=this.chart.element.id+"_Series_"+n+"_Point_",this.calculateErrorHeight(e,e.marker.dataLabel.position),this.chartBackground="transparent"===this.chart.chartArea.background?this.chart.background||this.chart.themeStyle.background:this.chart.chartArea.background},e.prototype.calculateErrorHeight=function(e,t){if(!e.errorBar.visible)return null;if(e.errorBar.visible&&"PolarRadar"!==this.chart.chartAreaType){var i=e.errorBar.direction,r=this.chart.errorBarModule.positiveHeight,o=this.chart.errorBarModule.negativeHeight;this.isRectSeries(e)?("Top"!==t&&"Auto"!==t||(this.errorHeight="Both"===i||"Minus"===i?o:0),"Outer"!==t&&"Auto"!==t||(this.errorHeight="Both"===i||"Plus"===i?r:0)):("Top"!==t&&"Outer"!==t&&"Auto"!==t||("Both"!==i&&"Plus"!==i||e.chart.isTransposed?this.errorHeight=0:this.errorHeight=r),"Bottom"!==t&&"Auto"!==t||(this.errorHeight="Both"===i||"Minus"===i?o:0))}else this.errorHeight=0},e.prototype.isRectSeries=function(e){return e.isRectSeries||"RangeArea"===e.type||"SplineRangeArea"===e.type},e.prototype.render=function(e,r,o){this.initPrivateVariables(e,e.marker);var n,a,s,l,h,c,d,p,u={x:0,y:0};this.inverted=r.requireInvertedAxis,this.yAxisInversed=e.yAxis.isInversed;for(var y,m,v,f=r.redraw,b=!1,x=[],w=r.element.id+"_Series_"+(void 0===e.index?e.category:e.index)+"_DataLabelCollections",S=t.createElement("div",{id:w}),C=g(e),P=0;P<C.length;P++){if(y=C[P],!o.showZero&&(0!==y.y||0===y.y&&"Zero"===e.emptyPointSettings.mode))return null;this.margin=o.margin;var L=[],R=void 0,M=void 0,A=void 0,_=void 0,O=void 0,E=!0,I=e.clipRect,z=void 0;b=!1,d=p=o.angle,h={width:o.border.width,color:o.border.color};var D=t.extend({},t.getValue("properties",o.font),null,!0);if(y.symbolLocations.length&&y.symbolLocations[0]||"BoxAndWhisker"===e.type&&y.regions.length){R=(L=Se(y,e,r)).length;for(var B=0;B<R;B++)if(l={cancel:!1,name:"textRender",series:e,point:y,text:L[B],border:h,color:o.fill,template:o.template,font:D,location:u,textSize:i.measureText(L[B],o.font)},r.trigger("textRender",l),!l.cancel)if(this.fontBackground=l.color,this.isDataLabelShape(l),this.markerHeight="Bubble"===e.type?y.regions[0].height/2:this.markerHeight,null!==l.template)this.createDataLabelTemplate(S,e,o,y,l,B,f);else{if(c=i.measureText(l.text,o.font),n=this.calculateTextPosition(y,e,c,o,B),"PolarRadar"===r.chartAreaType)for(var F=0,N=r.chartAxisLayoutPanel.visibleAxisLabelRect;F<N.length;F++){var V=N[F];if(Le(new i.Rect(n.x,n.y,n.width,n.height),V)){E=!1;break}}var j=new i.Rect(n.x+I.x,n.y+I.y,n.width,n.height);if(o.enableRotation){var H=this.getRectanglePoints(n);if(m=n.x+n.width/2,v=n.y+n.height/2,x=k(H,m,v,d),!(b=this.isDataLabelOverlapWithChartBound(x,r,I))){this.chart.rotatedDataLabelCollections.push(x);for(var X=this.chart.rotatedDataLabelCollections.length-1,Y=X;Y>=0;Y--)if(this.chart.rotatedDataLabelCollections[X]&&this.chart.rotatedDataLabelCollections[Y-1]&&T(this.chart.rotatedDataLabelCollections[X],this.chart.rotatedDataLabelCollections[Y-1])){b=!0,this.chart.rotatedDataLabelCollections[X]=null;break}}}else b=Pe(n,r.dataLabelCollections,I);b&&"None"!==o.labelIntersectAction||!E||(r.dataLabelCollections.push(j),this.isShape&&(z=r.renderer.drawRectangle(new Di(this.commonId+y.index+"_TextShape_"+B,l.color,l.border,o.opacity,n,o.rx,o.ry),new Int32Array([I.x,I.y])),e.shapeElement&&e.shapeElement.appendChild(z)),a=Te(_e(this.fontBackground)),s=Math.round((299*a.r+587*a.g+114*a.b)/1e3),M=n.x+this.margin.left+c.width/2+u.x,A=n.y+this.margin.top+3*c.height/4+u.y,u={x:0,y:0},0!==d&&o.enableRotation?(_=m,O=v,p=d>360?d-360:d<-360?d+360:d):(p=0,_=n.x,O=n.y),Ve(r.renderer,new i.TextOption(this.commonId+y.index+"_Text_"+B,M,A,"middle",l.text,"rotate("+p+","+_+","+O+")","auto",p),l.font,l.font.color||(s>=128||"Hilo"===e.type?"black":"white"),e.textElement,!1,f,!0,!1,e.chart.duration,e.clipRect,null,null,r.enableCanvas))}}}S.childElementCount&&(r.enableCanvas?he(r.element.id+"_Secondary_Element").appendChild(S):be(r.enableCanvas,he(r.element.id+"_Secondary_Element"),S,r.redraw,!1,"x","y",null,"",!1,!1,null,r.duration))},e.prototype.getRectanglePoints=function(e){return[new Vi(e.x,e.y),new Vi(e.x+e.width,e.y),new Vi(e.x+e.width,e.y+e.height),new Vi(e.x,e.y+e.height)]},e.prototype.isDataLabelOverlapWithChartBound=function(e,t,i){for(var r=0;r<e.length;r++)if(!j(e[r].x+i.x,e[r].y+i.y,t.initialClipRect))return!0;return!1},e.prototype.createDataLabelTemplate=function(e,i,r,o,n,a,s){this.margin={left:0,right:0,bottom:0,top:0};var l=i.clipRect,h=ue(t.createElement("div",{id:this.chart.element.id+"_Series_"+(void 0===i.index?i.category:i.index)+"_DataLabel_"+o.index+(a?"_"+a:""),styles:"position: absolute;background-color:"+n.color+";"+ge(r.font)+";border:"+n.border.width+"px solid "+n.border.color+";"}),o.index,n.template,this.chart,o,i,this.chart.element.id+"_DataLabel",a);this.calculateTemplateLabelSize(e,h,o,i,r,a,l,s)},e.prototype.calculateTemplateLabelSize=function(e,t,r,o,n,a,s,l,h){var c=ye(t,l,h),d=this.calculateTextPosition(r,o,{width:c.width,height:c.height},n,a),p=!1;h&&(p=0===c.width||0===c.height),t.style.left=("PolarRadar"===this.chart.chartAreaType?0:o.clipRect.x)+d.x-0+"px",t.style.top=("PolarRadar"===this.chart.chartAreaType?0:o.clipRect.y)+d.y+0+"px";var u=Te(_e(this.fontBackground)),g=o.chart.requireInvertedAxis?o.xAxis:o.yAxis,y=o.chart.requireInvertedAxis?o.yAxis:o.xAxis;t.style.color=n.font.color||(Math.round((299*u.r+587*u.g+114*u.b)/1e3)>=128?"black":"white"),t.childElementCount&&!p&&(!Pe(d,this.chart.dataLabelCollections,s)||"None"===n.labelIntersectAction)&&("XY"!==o.seriesType||void 0===r.yValue||x(r.yValue,o.yAxis.visibleRange)||o.type.indexOf("Stacking")>-1||o.type.indexOf("100")>-1&&x(o.stackedValues.endValues[r.index],o.yAxis.visibleRange))&&x(r.xValue,o.xAxis.visibleRange)&&parseFloat(t.style.top)>=g.rect.y&&parseFloat(t.style.left)>=y.rect.x&&parseFloat(t.style.top)<=g.rect.y+g.rect.height&&parseFloat(t.style.left)<=y.rect.x+y.rect.width&&(this.chart.dataLabelCollections.push(new i.Rect(d.x+s.x,d.y+s.y,d.width,d.height)),be(this.chart.enableCanvas,e,t,l,!0,"left","top"),o.animation.enable&&this.chart.animateSeries&&!this.chart.enableCanvas?this.doDataLabelAnimation(o,t):this.chart.enableCanvas&&e.appendChild(t))},e.prototype.calculateTextPosition=function(e,t,i,r,o){var n=o>1&&"Candle"===t.type?e.regions[1]:e.regions[0];o>1&&"HiloOpenClose"===t.type&&(n=2===o?e.regions[1]:e.regions[2]);var a;a=this.getLabelLocation(e,t,i,o);var s=t.clipRect;if(this.chart.requireInvertedAxis&&this.isRectSeries(t)&&"BoxAndWhisker"!==t.type){this.locationY=a.y;l=i.width+this.borderWidth+this.margin.left+this.margin.right-5;a.x="Auto"===r.position?a.x:this.calculateAlignment(l,a.x,r.alignment,e.yValue<0),a.x=this.calculateRectPosition(a.x,n,e.yValue<0!==this.yAxisInversed,r.position,t,i,o,e)}else{this.locationX=a.x;var l=i.height+2*this.borderWidth+this.markerHeight+this.margin.bottom+this.margin.top+5;a.y="Auto"===r.position?a.y:this.calculateAlignment(l,a.y,r.alignment,!!this.isRectSeries(t)&&e.yValue<0),a.y=this.isRectSeries(t)&&"BoxAndWhisker"!==t.type?this.calculateRectPosition(a.y,n,e.yValue<0!==this.yAxisInversed,r.position,t,i,o,e):this.calculatePathPosition(a.y,r.position,t,e,i,o),this.isRectSeries(t)&&"PolarRadar"===this.chart.chartAreaType&&(a=this.calculatePolarRectPosition(a,r.position,t,e,i,o,r.alignment,l))}var h=Me(a,i,this.margin);return!0===r.enableRotation&&0!==r.angle||h.y>s.y+s.height||h.x>s.x+s.width||h.x+h.width<0||h.y+h.height<0||(h.x=h.x<0?5:h.x,h.y=h.y<0&&"None"!==r.labelIntersectAction?5:h.y,h.x-=h.x+h.width>s.x+s.width?h.x+h.width-(s.x+s.width)+5:0,h.y-=h.y+h.height>s.y+s.height?h.y+h.height-(s.y+s.height)+5:0,this.fontBackground="transparent"===this.fontBackground?this.chartBackground:this.fontBackground),h},e.prototype.calculatePolarRectPosition=function(e,t,i,r,o,n,a,s){var l,h=this.chart.availableSize.width,c="Center"===a?0:"Far"===a?1:-1,d=r.regionData.startAngle-.5*Math.PI+(r.regionData.endAngle-r.regionData.startAngle)/2;return l=0===n?r.regionData.radius<r.regionData.innerRadius?r.regionData.innerRadius:r.regionData.radius:r.regionData.radius>r.regionData.innerRadius?r.regionData.innerRadius:r.regionData.radius,this.fontBackground="transparent"===this.fontBackground?this.chartBackground:this.fontBackground,i.drawType.indexOf("Stacking")>-1?t="Outer"===t?"Top":t:i.drawType.indexOf("Range")>-1&&(t="Outer"===t||"Top"===t?t:"Auto"),"Outer"===t?l=0===n?l+10+this.markerHeight:l-10-this.markerHeight:"Middle"===t?(l=l/2+5,"StackingColumn"===i.drawType&&(l=r.regionData.innerRadius+(r.regionData.radius-r.regionData.innerRadius)/2+5-o.height/2)):"Top"===t?l=0===n?l-10-this.markerHeight:l+10+this.markerHeight:"Bottom"===t?(l=10,l+="StackingColumn"===i.drawType?r.regionData.innerRadius+this.markerHeight:0):l=0===n?l>=i.chart.radius?l-5:"StackingColumn"===i.drawType?l-10:l+10:l>=i.chart.radius?l+5:l-10,l+=s*c,e.x=i.clipRect.width/2+i.clipRect.x+l*Math.cos(d),"StackingColumn"===i.drawType?e.x=e.x<h/2?e.x+o.width/2:e.x>h/2?e.x-o.width/2:e.x:"Column"===i.drawType&&(e.x=e.x<h/2?e.x-o.width/2:e.x>h/2?e.x+o.width/2:e.x),e.y=i.clipRect.height/2+i.clipRect.y+l*Math.sin(d),e},e.prototype.getLabelLocation=function(e,t,i,r){var o=new Vi(0,0),n="Candle"===t.type&&r>1?e.regions[1]:e.regions[0];"HiloOpenClose"===t.type&&(n=2===r?e.regions[1]:e.regions[2]);var a=t.xAxis,s=t.yAxis,l=t.chart.requireInvertedAxis;if("BoxAndWhisker"===t.type){switch(this.markerHeight=0,r){case 0:o=ve(e.xValue,e.median,a,s,l);break;case 1:o=ve(e.xValue,e.maximum,a,s,l);break;case 2:o=ve(e.xValue,e.minimum,a,s,l);break;case 3:o=ve(e.xValue,e.upperQuartile,a,s,l);break;case 4:o=ve(e.xValue,e.lowerQuartile,a,s,l);break;default:o=ve(e.xValue,e.outliers[r-5],a,s,l),this.markerHeight=t.marker.height/2}l?o.y=e.regions[0].y+e.regions[0].height/2:o.x=e.regions[0].x+e.regions[0].width/2}else o=0===r||1===r?new Vi(e.symbolLocations[0].x,e.symbolLocations[0].y):2!==r&&3!==r||"Candle"!==t.type?l?{x:n.x+n.width/2,y:n.y}:{x:n.x+n.width,y:n.y+n.height/2}:new Vi(e.symbolLocations[1].x,e.symbolLocations[1].y);if(r>1&&"HiloOpenClose"===t.type)if(t.chart.requireInvertedAxis){var h=n.height;o.y=n.y+h/2+2*(2===r?1:-1)}else{var c=n.width;o.x=n.x+c/2+2*(2===r?1:-1)}return o},e.prototype.calculateRectPosition=function(e,t,i,r,o,n,a,s){if("PolarRadar"===o.chart.chartAreaType)return null;var l=this.margin,h=this.inverted?n.width:n.height,c=this.borderWidth+h/2+5;switch("StackingColumn100"===o.type||"StackingBar100"===o.type?r="Outer"===r?"Top":r:o.type.indexOf("Range")>-1?r="Outer"===r||"Top"===r?r:"Auto":"Waterfall"===o.type&&(r="Auto"===r?"Middle":r),r){case"Bottom":e=this.inverted?i?e+t.width-c-l.left:e-t.width+c+l.right:i?e-t.height+c+l.top:e+t.height-c-l.bottom;break;case"Middle":e=e=this.inverted?i?e+t.width/2:e-t.width/2:i?e-t.height/2:e+t.height/2;break;case"Auto":e=this.calculateRectActualPosition(e,t,i,o,n,a,s);break;default:c+=this.errorHeight,e=this.calculateTopAndOuterPosition(e,t,r,o,a,c,i)}var d=this.inverted?e<t.x||e>t.x+t.width:e<t.y||e>t.y+t.height;this.fontBackground=d?"transparent"===this.fontBackground?this.chartBackground:this.fontBackground:"transparent"===this.fontBackground?s.color||o.interior:this.fontBackground;var p=o.chart.series.length;if("Outer"===r&&o.type.indexOf("Stacking")>-1&&p-1>o.index)for(var u=void 0,g=void 0,y=o.index+1;y<p;y++)if(u=o.chart.series[y],g=u.points[s.index],u.type.indexOf("Stacking")>-1&&-1===u.type.indexOf("100")){this.fontBackground=g&&(g.yValue<0&&s.yValue<0||g.yValue>0&&s.yValue>0)?g?g.color:u.interior:this.fontBackground;break}return e},e.prototype.calculatePathPosition=function(e,t,i,r,o,n){switch(i.type.indexOf("Area")>-1&&"RangeArea"!==i.type&&"SplineRangeArea"!==i.type&&this.yAxisInversed&&"Auto"!==i.marker.dataLabel.position&&(t="Top"===t?"Bottom":"Bottom"===t?"Top":t),this.fontBackground="transparent"===this.fontBackground?this.chartBackground:this.fontBackground,t){case"Top":case"Outer":e=e-this.markerHeight-this.borderWidth-o.height/2-this.margin.bottom-5-this.errorHeight;break;case"Bottom":e=e+this.markerHeight+this.borderWidth+o.height/2+this.margin.top+5+this.errorHeight;break;case"Auto":e=this.calculatePathActualPosition(e,this.markerHeight,i,r,o,n)}return e},e.prototype.isDataLabelShape=function(e){this.isShape="transparent"!==e.color||e.border.width>0,this.borderWidth=e.border.width,this.isShape||(this.margin={left:0,right:0,bottom:0,top:0})},e.prototype.calculateRectActualPosition=function(e,t,i,r,o,n,a){for(var s,l,h=!0,c=0,d=this.chart.dataLabelCollections,p=-1!==r.type.indexOf("Range")||"Hilo"===r.type?2:4;h&&c<p;){var u=this.getPosition(c);r.type.indexOf("Stacking")>-1&&"Outer"===u&&(u="Top",c++),s=this.calculateRectPosition(e,t,i,u,r,o,n,a),h=this.inverted?(l=Me(new Vi(s,this.locationY),o,this.margin)).x<0||Pe(l,d,r.clipRect)||l.x+l.width>r.clipRect.width:(l=Me(new Vi(this.locationX,s),o,this.margin)).y<0||Pe(l,d,r.clipRect)||l.y>r.clipRect.height,c++}return s},e.prototype.calculateAlignment=function(e,t,i,r){switch(i){case"Far":t=this.inverted?r?t-e:t+e:r?t+e:t-e;break;case"Near":t=this.inverted?r?t+e:t-e:r?t-e:t+e;break;case"Center":t=t}return t},e.prototype.calculateTopAndOuterPosition=function(e,t,i,r,o,n,a){var s,l=this.margin;switch(r.type){case"RangeColumn":case"RangeArea":case"SplineRangeArea":case"Hilo":s=0===o&&!this.yAxisInversed||1===o&&this.yAxisInversed,e=this.updateLabelLocation(i,e,n,l,t,s);break;case"Candle":s=(0===o||2===o)&&!this.yAxisInversed||(1===o||3===o)&&this.yAxisInversed,e=this.updateLabelLocation(i,e,n,l,t,s,o>1);break;case"HiloOpenClose":o<=1?(s=0===o&&!this.yAxisInversed||1===o&&this.yAxisInversed,e=this.updateLabelLocation(i,e,n,l,t,s)):e=this.yAxisInversed?this.inverted?e-n-l.right:e+n+l.top:this.inverted?e+n+l.left:e-n-l.bottom;break;default:e=a&&"Top"===i||!a&&"Outer"===i?this.inverted?e+n+l.left+this.markerHeight:e-n-l.bottom-this.markerHeight:this.inverted?e-n-l.right-this.markerHeight:e+n+l.top+this.markerHeight}return e},e.prototype.updateLabelLocation=function(e,t,i,r,o,n,a){return void 0===a&&(a=!1),t=this.inverted?n?"Outer"!==e||a?t-i-r.right-this.markerHeight:t+i+r.left+this.markerHeight:"Outer"!==e||a?t-o.width+i+r.left+this.markerHeight:t-o.width-i-r.right-this.markerHeight:n?"Outer"!==e||a?t+i+r.top+this.markerHeight:t-i-r.bottom-this.markerHeight:"Outer"!==e||a?t+o.height-i-r.bottom-this.markerHeight:t+o.height+i+r.top+this.markerHeight},e.prototype.calculatePathActualPosition=function(e,t,i,r,o,n){var a,s,l,h,c,d=i.points,p=r.index,u=d[p].yValue,g=d.length-1>p?d[p+1]:null,y=p>0?d[p-1]:null,m=!0,v=this.chart.dataLabelCollections;if("Bubble"===i.type)a="Top";else if(i.type.indexOf("Step")>-1)a="Top",p&&(a=y&&y.visible&&u>y.yValue===this.yAxisInversed&&u!==y.yValue?"Bottom":"Top");else if("BoxAndWhisker"===i.type)1===n||3===n||n>4?a=i.yAxis.isInversed?"Bottom":"Top":2===n||4===n?a=i.yAxis.isInversed?"Top":"Bottom":(m=!1,a="Middle",s=this.calculatePathPosition(e,a,i,r,o,n));else if(0===p)a=!g||!g.visible||u>g.yValue||u<g.yValue&&this.yAxisInversed?"Top":"Bottom";else if(p===d.length-1)a=!y||!y.visible||u>y.yValue||u<y.yValue&&this.yAxisInversed?"Top":"Bottom";else if(g.visible||y&&y.visible)if(g.visible&&y){var f=(g.yValue-y.yValue)/2,b=f*p+(g.yValue-f*(p+1));a=this.yAxisInversed?b<u?"Bottom":"Top":b<u?"Top":"Bottom"}else a=g.yValue>u||y&&y.yValue>u?"Bottom":"Top";else a="Top";for(h="Bottom"===a,c=["Outer","Top","Bottom","Middle","Auto"].indexOf(a);m&&c<4;)s=this.calculatePathPosition(e,this.getPosition(c),i,r,o,n),m=(l=Me(new Vi(this.locationX,s),o,this.margin)).y<0||Pe(l,v,i.clipRect)||l.y+l.height>i.clipRect.height,c=h?c-1:c+1,h=!1;return s},e.prototype.doDataLabelAnimation=function(e,t){for(var i,r=e.shapeElement.childNodes,o=e.textElement.childNodes,n=e.animation.delay+e.animation.duration,a=e.chart.animated?e.chart.duration:200,s=t?1:o.length,l=0;l<s;l++)i=o[l],t?(t.style.visibility="hidden",oe(t,n,a,"ZoomIn")):(Q(i,n,a,e,null,new Vi(+i.getAttribute("x")+ +i.getAttribute("width")/2,+i.getAttribute("y")+ +i.getAttribute("height")/2),!0),r[l]&&Q(i=r[l],n,a,e,null,new Vi(+i.getAttribute("x")+ +i.getAttribute("width")/2,+i.getAttribute("y")+ +i.getAttribute("height")/2),!0))},e.prototype.getPosition=function(e){return["Outer","Top","Bottom","Middle","Auto"][e]},e.prototype.getModuleName=function(){return"DataLabel"},e.prototype.destroy=function(){},e}(),Ln=function(){function e(e){this.chart=e}return e.prototype.render=function(e){if("PolarRadar"===this.chart.chartAreaType)return null;this.createElement(e,this.chart),this.renderErrorBar(e)},e.prototype.renderErrorBar=function(e){for(var t,r,o=e.index,n=e.errorBar,a=e.errorBar.errorBarCap,s=["",""],l=e.chart.redraw,h=0,c=e.points;h<c.length;h++){var d=c[h];if(d.visible&&d.symbolLocations[0]){var p=0,u=0;switch(n.mode){case"Vertical":u=n.verticalError;break;case"Horizontal":p=n.horizontalError;break;case"Both":p=n.horizontalError,u=n.verticalError}s=this["calculate"+n.type+"Value"](d,e,this.chart.requireInvertedAxis,p,u),t=this.chart.element.id+"_Series__ErrorBarGroup_"+o+"_Point_"+d.index,r=this.chart.element.id+"_Series__ErrorBarCap_"+o+"_Point_"+d.index;var g=new i.PathOption(t,"",n.width,n.color||this.chart.themeStyle.errorBar,null,"",s[0]),y=he(g.id),m=y?y.getAttribute("d"):null;e.errorBarElement.appendChild(this.chart.renderer.drawPath(g)),J(y,s[0],l,m);var v=new i.PathOption(r,"",a.width,a.color||this.chart.themeStyle.errorBar,null,"",s[1]);m=(y=he(v.id))?y.getAttribute("d"):null,be(this.chart.enableCanvas,e.errorBarElement,this.chart.renderer.drawPath(v),l),J(y,s[1],l,m)}}},e.prototype.findLocation=function(e,t,i,r,o){var n=t.errorBar,a=n.direction,s=[],l=t.type.indexOf("Stacking")>-1?t.stackedValues.endValues[e.index]:"HighLow"===t.seriesType||"HighLowOpenClose"===t.seriesType?t.points[e.index].high:e.yValue,h=ve(e.xValue+("Plus"===a||"Both"===a?"Custom"!==n.type||"Horizontal"!==n.mode&&"Both"!==n.mode?r:r=n.horizontalPositiveError:0),l+("Plus"===a||"Both"===a?"Custom"!==n.type||"Vertical"!==n.mode&&"Both"!==n.mode?o:o=n.verticalPositiveError:0),t.xAxis,t.yAxis,i);if(s.push(h),t.isRectSeries){c=e.symbolLocations[0];s.push(c)}else{var c=ve(e.xValue,e.yValue,t.xAxis,t.yAxis,i);s.push(c)}var d=ve(e.xValue-("Minus"===a||"Both"===a?"Custom"!==n.type||"Horizontal"!==n.mode&&"Both"!==n.mode?r:r=n.horizontalNegativeError:0),l-("Minus"===a||"Both"===a?"Custom"!==n.type||"Vertical"!==n.mode&&"Both"!==n.mode?o:o=n.verticalNegativeError:0),t.xAxis,t.yAxis,i);return s.push(d),e.error="Vertical"===n.mode?n.verticalError:n.horizontalError,this.negativeHeight="Vertical"===n.mode||"Both"===n.mode?i?s[1].x-s[2].x:s[2].y-s[1].y:0,this.positiveHeight="Vertical"===n.mode||"Both"===n.mode?i?s[0].x-s[1].x:s[1].y-s[0].y:0,this.getErrorDirection(s[0],s[1],s[2],t,i)},e.prototype.calculateFixedValue=function(e,t,i,r,o,n,a){t.errorBar;return this.findLocation(e,t,i,r,o)},e.prototype.calculatePercentageValue=function(e,t,i,r,o,n,a){return r=r/100*e.xValue,o=o/100*e.yValue,this.findLocation(e,t,i,r,o)},e.prototype.calculateStandardDeviationValue=function(e,t,i,r,o,n,a){var s=this.meanCalculation(t,t.errorBar.mode);return r*=s.horizontalSquareRoot+s.horizontalMean,o*=s.verticalSquareRoot+s.verticalMean,this.findLocation(e,t,i,r,o)},e.prototype.calculateStandardErrorValue=function(e,t,i,r,o,n,a){var s=t.points.length,l=this.meanCalculation(t,t.errorBar.mode);return r=r*l.horizontalSquareRoot/Math.sqrt(s),o=o*l.verticalSquareRoot/Math.sqrt(s),this.findLocation(e,t,i,r,o)},e.prototype.calculateCustomValue=function(e,t,i,r,o,n,a){t.errorBar;return this.findLocation(e,t,i,r,o)},e.prototype.getHorizontalDirection=function(e,t,i,r,o,n){var a="",s="";return a+="M "+e.x+" "+t.y+" L "+i.x+" "+t.y,s+="Plus"===r||"Both"===r?"M "+e.x+" "+(t.y-n)+" L "+e.x+" "+(t.y+n):"",s+="Minus"===r||"Both"===r?"M "+i.x+" "+(t.y-n)+" L "+i.x+" "+(t.y+n):" ",[a,s]},e.prototype.getVerticalDirection=function(e,t,i,r,o,n){var a="",s="";return a+="M "+t.x+" "+e.y+" L "+t.x+" "+i.y,s+="Plus"===r||"Both"===r?"M "+(t.x-n)+" "+e.y+" L "+(t.x+n)+" "+e.y:"",s+="Minus"===r||"Both"===r?"M "+(t.x-n)+" "+i.y+" L "+(t.x+n)+" "+i.y:"",[a,s]},e.prototype.getBothDirection=function(e,t,i,r,o,n){var a="",s="",l=this.getHorizontalDirection(e,t,i,r,o,n),h=this.getVerticalDirection(e,t,i,r,o,n);return s=l[0].concat(h[0]),a=l[1].concat(h[1]),[s,a]},e.prototype.getErrorDirection=function(e,t,i,r,o){var n,a=r.errorBar.direction,s=r.errorBar.mode,l=r.errorBar.errorBarCap.length,h=s;switch(s){case"Both":h=s;break;case"Horizontal":h=o?"Vertical":s;break;case"Vertical":h=o?"Horizontal":s}switch(h){case"Horizontal":n=this.getHorizontalDirection(e,t,i,a,h,l);break;case"Vertical":n=this.getVerticalDirection(e,t,i,a,h,l);break;case"Both":n=this.getBothDirection(e,t,i,a,h,l)}return[n[0],n[1]]},e.prototype.meanCalculation=function(e,t){var i=0,r=0,o=0,n=0,a=e.points.length;switch(t){case"Vertical":o=(r=C(e.yData))/a;break;case"Horizontal":n=(i=C(e.xData))/a;break;case"Both":o=(r=C(e.yData))/a,n=(i=C(e.xData))/a}for(var s=0,l=e.points;s<l.length;s++){var h=l[s];"Vertical"===t?r+=Math.pow(h.yValue-o,2):"Horizontal"===t?i+=Math.pow(h.xValue-n,2):(r+=Math.pow(h.yValue-o,2),i+=Math.pow(h.xValue-n,2))}var c=r/(a-1),d=Math.sqrt(r/(a-1)),p=i/(a-1),u=Math.sqrt(i/(a-1));return new Oi(c,d,p,u,o,n)},e.prototype.createElement=function(e,t){var i="Cartesian"===t.chartAreaType?"translate("+e.clipRect.x+","+e.clipRect.y+")":"",r=(e.marker.height+5)/2,o=(e.marker.width+5)/2;if("Cartesian"===t.chartAreaType){var n=new Di(t.element.id+"_ChartErrorBarClipRect_"+e.index,"transparent",{width:1,color:"Gray"},1,{x:-o,y:-r,width:e.clipRect.width+2*o,height:e.clipRect.height+2*r});e.errorBarElement=t.renderer.createGroup({id:t.element.id+"ErrorBarGroup"+e.index,transform:i,"clip-path":"url(#"+t.element.id+"_ChartErrorBarClipRect_"+e.index+")"}),e.errorBarElement.appendChild(K(t.redraw,n,t.renderer))}},e.prototype.doErrorBarAnimation=function(e){var t=e.errorBarElement.childNodes;if(!t)return null;for(var i=e.animation.delay+e.animation.duration,r=1;r<t.length;){for(var o=0;o<e.points.length;o++)e.points[o].symbolLocations[0]&&(t[r].style.visibility="hidden",oe(t[r],i,350,e.chart.requireInvertedAxis?"SlideLeftIn":"SlideBottomIn",!1));r++}},e.prototype.getModuleName=function(){return"ErrorBar"},e.prototype.destroy=function(){},e}(),Rn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mn=function(e){function r(t){var i=e.call(this,t)||this;return i.library=i,i.addEventListener(),i}return Rn(r,e),r.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on(t.Browser.touchMoveEvent,this.mouseMove,this),this.chart.on("click",this.click,this),this.chart.on(t.Browser.touchEndEvent,this.mouseEnd,this))},r.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off(t.Browser.touchMoveEvent,this.mouseMove),this.chart.off("click",this.click),this.chart.off(t.Browser.touchEndEvent,this.mouseEnd))},r.prototype.mouseMove=function(e){this.chart.legendSettings.visible&&!this.chart.isTouch&&(this.move(e),this.chart.highlightModule&&"None"!==this.chart.highlightMode&&this.click(e))},r.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},r.prototype.getLegendOptions=function(e,t){this.legendCollections=[];var i,r,o=[];e.length>1&&(this.legend.mode="Series");for(var n=0,a=e;n<a.length;n++){var s=a[n];if("Series"===this.legend.mode)"Indicator"!==s.category&&(i="PolarRadar"===t.chartAreaType?s.drawType:s.type,r=s.pointColorMapping&&s.points.length>0&&s.points[0].interior?s.points[0].interior:s.interior,this.legendCollections.push(new mr(s.name,r,s.legendShape,"TrendLine"===s.category?this.chart.series[s.sourceIndex].trendlines[s.index].visible:s.visible,i,s.legendImageUrl,s.marker.shape,s.marker.visible)));else if("Point"===this.legend.mode)for(var l=this,h=0,c=s.points;h<c.length;h++)!function(e){i="PolarRadar"===t.chartAreaType?s.drawType:s.type,r=e.interior?e.interior:s.interior,0===l.legendCollections.filter(function(t){return t.text===e.x.toString()}).length&&l.legendCollections.push(new mr(e.x.toString(),r,s.legendShape,"TrendLine"===s.category?l.chart.series[s.sourceIndex].trendlines[s.index].visible:e.visible,i,"",s.marker.shape,s.marker.visible))}(u=c[h]);else if("Range"===this.legend.mode)for(var d=0,p=s.points;d<p.length;d++){var u=p[d];i="PolarRadar"===t.chartAreaType?s.drawType:s.type,r=u.interior?u.interior:s.interior;var g="Others";if(o.indexOf(r)<0&&(o.push(r),t.rangeColorSettings.length>=1&&1===t.rangeColorSettings[0].colors.length)){for(var y=0,m=t.rangeColorSettings;y<m.length;y++){var v=m[y];v.colors[0]===r&&(g=v.label)}this.legendCollections.push(new mr(g,r,s.legendShape,"TrendLine"===s.category?this.chart.series[s.sourceIndex].trendlines[s.index].visible:u.visible,i,"",s.marker.shape,s.marker.visible))}}else if(0===this.legendCollections.length&&t.rangeColorSettings.length>0){var f=t.rangeColorSettings[0].start.toString(),b=t.rangeColorSettings[t.rangeColorSettings.length-1].end.toString();this.legendCollections.push(new mr(f,s.interior,"Rectangle",!0,i,"",s.marker.shape,s.marker.visible)),this.legendCollections.push(new mr(b,s.interior,"Rectangle",!0,i,"",s.marker.shape,s.marker.visible))}}},r.prototype.getLegendBounds=function(e,t,r){this.calculateLegendTitle(r,t),this.isTitle=!!r.title;var o=r.padding,n=r.titlePosition,a=0,s=0,l=this.arrowWidth,h=this.arrowHeight,c=this.isVertical&&!r.enablePages?h:0,d=this.isTitle&&"Top"===n?this.legendTitleSize.height+this.fivePixel:0;d=this.isTitle&&this.isVertical&&"Top"!==n?this.legendTitleSize.height+this.fivePixel:d,this.isVertical?s=r.width?0:e.width/100*5:a=r.height?0:e.height/100*5,t.height+=a,t.width+=s;var p,u=r.shapeWidth,g=r.shapePadding,y=0,m=0,v=0,f=0,b=0,x=0;this.maxItemHeight=Math.max(i.measureText("MeasureText",r.textStyle).height,r.shapeHeight);for(var w=!1,S=0,C=this.legendCollections;S<C.length;S++){var P=C[S];si.test(P.text)&&(P.text=We(P.text,si)),li.test(P.text)&&(P.text=We(P.text,li)),p={fill:P.fill,text:P.text,shape:P.shape,markerShape:P.markerShape,name:"legendRender",cancel:!1},this.chart.trigger("legendRender",p),P.render=!p.cancel,P.text=p.text,P.fill=p.fill,P.shape=p.shape,P.markerShape=p.markerShape,P.textSize=i.measureText(P.text,r.textStyle),P.render&&(w=!0,m+=v=u+g+P.textSize.width+o,r.enablePages||this.isVertical||(x=this.isTitle&&"Top"!==n?this.legendTitleSize.width+this.fivePixel:0,x+=l),(t.width<o+m+x||this.isVertical)&&(y=Math.max(y,m+o+x-(this.isVertical?0:v)),0===b&&v!==m&&(b=1),m=this.isVertical?0:v,f=++b*(this.maxItemHeight+o)+o+d+c))}f=Math.max(f,this.maxItemHeight+o+o+d),this.isPaging=t.height<f,this.isPaging&&!r.enablePages&&(f=this.isVertical?f:this.maxItemHeight+o+o+("Top"===n?d:0)),this.totalPages=b,this.isPaging||this.isVertical||(m+=this.isTitle&&"Top"!==n?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0),w?this.setBounds(Math.max(m+o,y),f,r,t):this.setBounds(0,0,r,t)},r.prototype.getRenderPoint=function(e,t,i,r,o,n,a){var s=this.legend.padding,l=r.location.x+i+r.textSize.width;l+(e.textSize.width+i)>o.x+o.width+this.legend.shapeWidth/2||this.isVertical?(e.location.x=t.x,e.location.y=n===a?r.location.y:r.location.y+this.maxItemHeight+s):(e.location.x=n===a?r.location.x:l,e.location.y=r.location.y);var h=this.legendBounds.x+this.legendBounds.width-(e.location.x+i-this.legend.shapeWidth/2);e.text=ze(+h.toFixed(4),e.text,this.legend.textStyle)},r.prototype.LegendClick=function(e,t){var i=this.chart,r="Series"===i.legendSettings.mode?e:0,o=i.visibleSeries[r],n=this.legendCollections[e];if("Series"===i.legendSettings.mode){s={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:o,points:o.points,name:"legendClick",cancel:!1};this.chart.trigger("legendClick",s),o.legendShape=s.legendShape,null!==o.fill&&(i.visibleSeries[e].interior=o.fill),i.legendSettings.toggleVisibility?("TrendLine"===o.category?i.series[o.sourceIndex].trendlines[o.index].visible?i.series[o.sourceIndex].trendlines[o.index].visible=!1:i.series[o.sourceIndex].trendlines[o.index].visible=!0:(o.chart.isProtectedOnChange=!0,this.changeSeriesVisiblity(o,o.visible)),n.visible="TrendLine"===o.category?i.series[o.sourceIndex].trendlines[o.index].visible:o.visible,this.refreshLegendToggle(i,o)):i.selectionModule?i.selectionModule.legendSelection(i,e,t):i.highlightModule&&i.highlightModule.legendSelection(i,e,t),o.chart.isProtectedOnChange=!1}else if("Point"===i.legendSettings.mode){var a=o.points[e],s={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:o,points:[a],name:"legendClick",cancel:!1};this.chart.trigger("legendClick",s),i.legendSettings.toggleVisibility&&(a.visible=!a.visible,(h=this.legendCollections[e]).visible=a.visible,this.refreshLegendToggle(i,o))}else if("Range"===i.legendSettings.mode){for(var l=[],h=this.legendCollections[e],c=0,d=o.points;c<d.length;c++){a=d[c];h.fill===(a.interior||o.interior)&&l.push(a)}s={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:o,points:l,name:"legendClick",cancel:!1};if(this.chart.trigger("legendClick",s),i.legendSettings.toggleVisibility){h.visible=!h.visible;for(var p=0,u=l;p<u.length;p++)(a=u[p]).visible=!a.visible;this.refreshLegendToggle(i,o)}}},r.prototype.refreshLegendToggle=function(e,r){var o=[];if(e.selectionModule&&(o=t.extend([],e.selectionModule.selectedDataIndexes,null,!0)),e.svgObject.childNodes.length>0&&!e.enableAnimation&&!e.enableCanvas){for(;e.svgObject.lastChild;)e.svgObject.removeChild(e.svgObject.lastChild);t.remove(e.svgObject)}e.animateSeries=!1,e.redraw=e.enableAnimation,e.rotatedDataLabelCollections=[],m(i.getElement(e.element.id+"_Secondary_Element").querySelectorAll(".ejSVGTooltip")[0]),Ue(e),this.redrawSeriesElements(r,e),e.removeSvg(),e.refreshAxis(),r.refreshAxisLabel(),this.refreshSeries(e.visibleSeries),e.markerRender.removeHighlightedMarker(),e.refreshBound(),e.trigger("loaded",{chart:e}),o.length>0&&(e.selectionModule.selectedDataIndexes=o,e.selectionModule.redrawSelection(e,e.selectionMode)),e.highlightModule&&"None"!==e.highlightMode&&e.highlightModule.redrawSelection(e,e.highlightMode),e.redraw=!1},r.prototype.changeSeriesVisiblity=function(e,t){e.visible=!t,this.isSecondaryAxis(e.xAxis)&&(e.xAxis.internalVisibility=e.xAxis.series.some(function(e){return e.visible})),this.isSecondaryAxis(e.yAxis)&&(e.yAxis.internalVisibility=e.yAxis.series.some(function(e){return e.visible}))},r.prototype.isSecondaryAxis=function(e){return this.chart.axes.indexOf(e)>-1},r.prototype.redrawSeriesElements=function(e,t){if(!t.redraw)return null;m(t.element.id+"_Series_"+(void 0===e.index?e.category:e.index)+"_DataLabelCollections")},r.prototype.refreshSeries=function(e){for(var t=0,i=e;t<i.length;t++)i[t].position=void 0},r.prototype.click=function(e){var t=this;if(this.chart.legendSettings.visible){for(var i,r=this.chart.mouseX,o=this.chart.mouseY,n=[],a=e.target.id,s=0,l=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_"];s<l.length;s++){var h=l[s];if(a.indexOf(h)>-1){i=parseInt(a.split(h)[1],10),this.LegendClick(i,e);break}}a.indexOf(this.legendID+"_pageup")>-1?this.changePage(e,!0):a.indexOf(this.legendID+"_pagedown")>-1&&this.changePage(e,!1),this.chart.enableCanvas&&this.pagingRegions.length&&this.checkWithinBounds(r,o),(n=this.legendRegions.filter(function(e){return j(r,o+(t.isPaging?(t.currentPageNumber-1)*t.translatePage(null,1,2):0),e.rect)})).length&&this.chart.enableCanvas&&this.LegendClick(n[0].index,e)}},r.prototype.checkWithinBounds=function(e,t){var r=this.chart.renderer,o=this.legendBounds,n=this.chart.legendSettings.border.width,a=new i.Rect(o.x,o.y,o.width,o.height);return a.x=a.x-n/2,a.y=a.y-n/2,a.width=a.width+n,a.height=a.height+n,j(e,t,this.pagingRegions[0])?(--this.currentPageNumber>0?(this.legendRegions=[],r.clearRect(a),r.canvasClip(new Di("legendClipPath","transparent",{width:0,color:""},null,a)),this.renderLegend(this.chart,this.legend,o),r.canvasRestore()):++this.currentPageNumber,null):j(e,t,this.pagingRegions[1])?(++this.currentPageNumber>0&&this.currentPageNumber<=this.totalNoOfPages?(this.legendRegions=[],r.clearRect(a),r.canvasClip(new Di("legendClipPath","transpaent",{width:0,color:""},null,a)),this.renderLegend(this.chart,this.legend,o),r.canvasRestore()):--this.currentPageNumber,null):void 0},r.prototype.getModuleName=function(){return"Legend"},r.prototype.destroy=function(){this.removeEventListener()},r}(yr),An=function(){function e(e){this.control=e}return e.prototype.render=function(e,i){return this.isChart="chart"===this.control.getModuleName(),this.annotation=e,ue(t.createElement("div",{id:this.control.element.id+"_Annotation_"+i,styles:"position: absolute; z-index: 1"}),i,e.content,this.control)},e.prototype.setAnnotationPixelValue=function(e){var t="Chart"===this.annotation.region?new i.Rect(0,0,this.control.availableSize.width,this.control.availableSize.height):this.isChart?this.control.chartAxisLayoutPanel.seriesClipRect:this.control.series[0].accumulationBound;return e.x=("string"!=typeof this.annotation.x?"number"==typeof this.annotation.x?this.annotation.x:0:Be(this.annotation.x,t.width))+t.x,e.y=("number"==typeof this.annotation.y?this.annotation.y:Be(this.annotation.y,t.height))+t.y,!0},e.prototype.setAnnotationPointValue=function(e){var t=new Vi(0,0);if(this.isChart){for(var i=this.control,o=this.annotation,n=o.xAxisName,a=o.yAxisName,s=i.requireInvertedAxis,l=this.control.stockChart,h=void 0,c=void 0,d=void 0,p=0,u=i.axisCollections;p<u.length;p++){var g=u[p];if(n===g.name||null==n&&"primaryXAxis"===g.name)if((h=g).valueType.indexOf("Category")>-1){var y="DateTimeCategory"===h.valueType?o.x.getTime().toString():o.x;if(h.labels.indexOf(y)<0)return!1;d=h.labels.indexOf(y)}else if("DateTime"===h.valueType){var m={skeleton:"full",type:"dateTime"};d="object"==typeof this.annotation.x||"object"==typeof new Date(this.annotation.x)?Date.parse(i.intl.getDateParser(m)(i.intl.getDateFormat(m)(new Date(r.DataUtil.parse.parseJson({val:o.x}).val)))):0}else d=+o.x;else(a===g.name||null==a&&"primaryYAxis"===g.name)&&(c=g)}return!!(h&&c&&x("Logarithmic"===h.valueType?v(d,h.logBase):d,h.visibleRange)&&x("Logarithmic"===c.valueType?v(+o.y,c.logBase):+o.y,c.visibleRange))&&(t=ve(d,+o.y,h,c,s),e.x=t.x+(s?c.rect.x:h.rect.x),e.y=t.y+(s?h.rect.y:c.rect.y)+(l&&l.enablePeriodSelector?l.toolbarHeight+l.titleSize.height:0),!0)}return this.setAccumulationPointValue(e)},e.prototype.processAnnotation=function(e,i,r){var o=this.control,n=new Vi(0,0),a=this.render(e,i),s=function(){a.style.transform="translate(-50%, -50%)"};s.bind(n,this),this["setAnnotation"+e.coordinateUnits+"Value"](n)?this.setElementStyle(n,a,r):this.control.redraw&&m(a.id),t.updateBlazorTemplate((this.control.element.id+"Annotation"+i).replace(/[^a-zA-Z0-9]/g,""),"ContentTemplate",o.stockChart?o.stockChart.annotations[i]:this.control.annotations[i],void 0,s)},e.prototype.setAccumulationPointValue=function(e){for(var t,i=0,r=this.control.visibleSeries[0].points;i<r.length;i++){var o=r[i];if("object"==typeof o.x){if(Date.parse(o.x)===Date.parse(this.annotation.x)&&o.y===this.annotation.y){t=o;break}}else if(o.x==this.annotation.x&&o.y==this.annotation.y){t=o;break}}return!(!t||!t.visible)&&(e.x=t.symbolLocation.x,e.y=t.symbolLocation.y,!0)},e.prototype.setElementStyle=function(e,t,i){var r=ye(t,this.control.redraw),o={cancel:!1,name:"annotationRender",content:t,location:e};this.control.trigger("annotationRender",o),o.cancel||(o.content.style.left=this.setAlignmentValue(this.annotation.horizontalAlignment,r.width,o.location.x)+"px",o.content.style.top=this.setAlignmentValue(this.annotation.verticalAlignment,r.height,o.location.y)+"px",o.content.setAttribute("aria-label",this.annotation.description||"Annotation"),fe(o.content,i,this.control.redraw,!0,"left","top"))},e.prototype.setAlignmentValue=function(e,t,i){switch(e){case"Top":case"Near":i-=t;break;case"Bottom":case"Far":i+=0;break;case"Middle":case"Center":i-=t/2}return i},e}(),kn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tn=function(e){function i(t,i){var r=e.call(this,t)||this;return r.chart=t,r.annotations=i,r}return kn(i,e),i.prototype.renderAnnotations=function(e){var i=this;this.annotations=this.chart.annotations,this.parentElement=Fe(this.chart.redraw,this.chart.element.id+"_Annotation_Collections")||t.createElement("div",{id:this.chart.element.id+"_Annotation_Collections"}),this.annotations.map(function(e,t){i.processAnnotation(e,t,i.parentElement)}),fe(this.parentElement,e,this.chart.redraw)},i.prototype.destroy=function(){},i.prototype.getModuleName=function(){return"Annotation"},i}(An),_n=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),On=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return _n(r,e),r.prototype.render=function(e,i,r,o){for(var n,a=this.getSideBySideInfo(e),s=0,l=e.points;s<l.length;s++){var h=l[s];h.symbolLocations=[],h.regions=[];var c=void 0;h.visible&&S(e.points[h.index-1],h,e.points[h.index+1],e)&&(this.findBoxPlotValues(h.y,h,e.boxPlotMode),this.updateTipRegion(e,h,a),c=this.getRectangle(h.xValue+a.start,h.upperQuartile,h.xValue+a.end,h.lowerQuartile,e),h.regions.push(c),(n=this.triggerEvent(e,h,e.interior,{color:t.isNullOrUndefined(e.border.color)||"transparent"===e.border.color?Oe(e.interior,-.6):e.border.color,width:e.border.width?e.border.width:1})).cancel||this.renderBoxAndWhisker(e,h,n,this.getPathString(h,e,ve(h.xValue,h.median,i,r,o),ve(h.xValue+a.median,h.average,i,r,o)),a.median))}e.marker.visible&&e.chart.markerRender.render(e)},r.prototype.updateTipRegion=function(e,t,i){var r=this.getRectangle(t.xValue+i.median,t.maximum,t.xValue+i.median,t.minimum,e);this.updateTipSize(e,t,r,e.chart.requireInvertedAxis)},r.prototype.updateTipSize=function(e,t,i,r){var o=e.border.width||1;r?(i.y-=o/2,i.height=i.height||o):(i.x-=o/2,i.width=i.width||o),t.regions.push(i)},r.prototype.getPathString=function(e,t,i,r){var o=e.regions[0],n=e.regions[1],a="",s=t.chart.requireInvertedAxis?o.y+o.height/2:o.x+o.width/2,l=n.x+n.width,h=n.y+n.height,c=o.x+o.width,d=o.y+o.height;return t.chart.requireInvertedAxis?(this.updateTipSize(t,e,{x:o.x,y:n.y,width:0,height:h-n.y},!1),this.updateTipSize(t,e,{x:c,y:n.y,width:0,height:h-n.y},!0),a+="M "+o.x+" "+n.y+" L "+o.x+" "+h,a+="M "+o.x+" "+s+" L "+n.x+" "+s,a+=" M "+n.x+" "+n.y+" L "+l+" "+n.y+" L "+l+" "+h+" L "+n.x+" "+h+" Z",a+=" M "+l+" "+s+" L "+c+" "+s,a+=" M "+c+" "+n.y+" L "+c+" "+h,a+=" M "+i.x+" "+n.y+" L "+i.x+" "+h,a+=t.showMean?"M "+(r.x+5)+" "+(r.y-5)+" L "+(r.x-5)+" "+(r.y+5)+"M "+(r.x-5)+" "+(r.y-5)+" L "+(r.x+5)+" "+(r.y+5):""):(this.updateTipSize(t,e,{x:n.x,y:o.y,width:l-n.x,height:0},!0),this.updateTipSize(t,e,{x:n.x,y:d,width:l-n.x,height:0},!0),a+="M "+n.x+" "+o.y+" L "+l+" "+o.y,a+=" M "+s+" "+o.y+" L "+s+" "+n.y,a+=" M "+n.x+" "+n.y+" L "+l+" "+n.y+" L "+l+" "+h+" L "+n.x+" "+h+" Z",a+=" M "+s+" "+h+" L "+s+" "+d,a+=" M "+n.x+" "+d+" L "+l+" "+d,a+=" M "+n.x+" "+i.y+" L "+l+" "+i.y,a+=t.showMean?" M "+(r.x-5)+" "+(r.y-5)+" L "+(r.x+5)+" "+(r.y+5)+" M "+(r.x+5)+" "+(r.y-5)+" L "+(r.x-5)+" "+(r.y+5):""),a},r.prototype.renderBoxAndWhisker=function(e,t,r,o,n){var a,s,l=e.chart.element.id+"_Series_"+e.index+"_Point_"+t.index,h=e.chart.renderer.drawPath(new i.PathOption(l+"_BoxPath",r.fill,r.border.width,r.border.color,e.opacity,e.dashArray,o));h.setAttribute("aria-label",t.x.toString()+":"+t.maximum.toString()+":"+t.minimum.toString()+":"+t.lowerQuartile.toString()+":"+t.upperQuartile.toString());var c=e.chart.renderer.createGroup({id:l});c.appendChild(h);for(var d=0;d<t.outliers.length;d++)a=ve(t.xValue+n,t.outliers[d],e.xAxis,e.yAxis,e.chart.requireInvertedAxis),s=new i.Size(e.marker.width,e.marker.height),t.symbolLocations.push(a),this.updateTipSize(e,t,{x:a.x-s.width/2,y:a.y-s.height/2,width:s.width,height:s.height},!0);e.seriesElement.appendChild(c)},r.prototype.findBoxPlotValues=function(e,t,i){var r=e.length,o={average:C(e)/r,lowerQuartile:0,upperQuartile:0,maximum:0,minimum:0,median:0,outliers:[]};"Exclusive"===i?(o.lowerQuartile=this.getExclusiveQuartileValue(e,r,.25),o.upperQuartile=this.getExclusiveQuartileValue(e,r,.75),o.median=this.getExclusiveQuartileValue(e,r,.5)):"Inclusive"===i?(o.lowerQuartile=this.getInclusiveQuartileValue(e,r,.25),o.upperQuartile=this.getInclusiveQuartileValue(e,r,.75),o.median=this.getInclusiveQuartileValue(e,r,.5)):(o.median=Ee(e),this.getQuartileValues(e,r,o)),this.getMinMaxOutlier(e,r,o),t.minimum=o.minimum,t.maximum=o.maximum,t.lowerQuartile=o.lowerQuartile,t.upperQuartile=o.upperQuartile,t.median=o.median,t.outliers=o.outliers,t.average=o.average},r.prototype.getExclusiveQuartileValue=function(e,t,i){if(0===t)return 0;if(1===t)return e[0];var r=i*(t+1),o=Math.floor(Math.abs(r)),n=r-o;return 0===o?e[0]:o>t-1?e[t-1]:n*(e[o]-e[o-1])+e[o-1]},r.prototype.getInclusiveQuartileValue=function(e,t,i){if(0===t)return 0;if(1===t)return e[0];var r=i*(t-1),o=Math.floor(Math.abs(r));return(r-o)*(e[o+1]-e[o])+e[o]},r.prototype.getQuartileValues=function(e,t,i){if(1===t)return i.lowerQuartile=e[0],i.upperQuartile=e[0],null;var r=t%2==0,o=t/2,n=e.slice(0,o),a=e.slice(r?o:o+1,t);i.lowerQuartile=Ee(n),i.upperQuartile=Ee(a)},r.prototype.getMinMaxOutlier=function(e,t,i){for(var r=1.5*(i.upperQuartile-i.lowerQuartile),o=0;o<t;o++){if(!(e[o]<i.lowerQuartile-r)){i.minimum=e[o];break}i.outliers.push(e[o])}for(o=t-1;o>=0;o--){if(!(e[o]>i.upperQuartile+r)){i.maximum=e[o];break}i.outliers.push(e[o])}},r.prototype.doAnimation=function(e){this.animate(e)},r.prototype.getModuleName=function(){return"BoxAndWhiskerSeries"},r.prototype.destroy=function(){},r}(jr),En=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),In=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return En(r,e),r.prototype.render=function(e,i,r,o){var n,a,s,l,h=this,c=null,d="",p=Math.max(e.yAxis.visibleRange.min,0),u=[],g=this.sortSegments(e,e.segments);e.visiblePoints.map(function(t,y,m){t.symbolLocations=[],t.regions=[],l=!1,t.visible&&S(m[y-1],t,m[y+1],e)&&(d+=h.getAreaPathDirection(t.xValue,p,e,o,ve,c,"M"),c=c||new Vi(t.xValue,p),n=ve(t.xValue,t.yValue,i,r,o),s&&h.setPointColor(t,s,e,"X"===e.segmentAxis,g)?(l=!0,a=ve(c.x,p,i,r,o),d+="L "+n.x+" "+n.y+" ",d+="L "+n.x+" "+a.y+" ",h.generatePathOption(u,e,s,d,"_Point_"+s.index),d="M "+n.x+" "+a.y+" L "+n.x+" "+n.y+" "):(d+="L "+n.x+" "+n.y+" ",h.setPointColor(t,null,e,"X"===e.segmentAxis,g)),m[y+1]&&!m[y+1].visible&&"Drop"!==e.emptyPointSettings.mode&&(d+=h.getAreaEmptyDirection({x:t.xValue,y:p},c,e,o,ve),c=null),s=t,h.storePointLocation(t,e,o,ve))}),t.isNullOrUndefined(l)||l||(d=e.points.length>1?d+this.getAreaPathDirection(s.xValue,p,e,o,ve,null,"L"):"",this.generatePathOption(u,e,s,d,"")),this.applySegmentAxis(e,u,g),this.renderMarker(e)},r.prototype.generatePathOption=function(e,t,r,o,n){e.push(new i.PathOption(t.chart.element.id+"_Series_"+t.index+n,t.setPointColor(r,t.interior),t.border.width,t.border.color,t.opacity,t.dashArray,o))},r.prototype.destroy=function(){},r.prototype.getModuleName=function(){return"MultiColoredAreaSeries"},r.prototype.doAnimation=function(e){this.doLinearAnimation(e,e.animation)},r}(Gr),zn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Dn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return zn(t,e),t.prototype.render=function(e,t,r,o){for(var n=null,a="M",s=this.enableComplexProperty(e),l=[],h="",c=this.sortSegments(e,e.segments),d=0,p=s;d<p.length;d++){var u=p[d];u.regions=[],u.visible&&S(s[u.index-1],u,s[u.index+1],e)?(h+=this.getLineDirection(n,u,e,o,ve,a),null!=n?this.setPointColor(u,n,e,"X"===e.segmentAxis,c)?(l.push(new i.PathOption(e.chart.element.id+"_Series_"+e.index+"_Point_"+n.index,"none",e.width,e.setPointColor(n,e.interior),e.opacity,e.dashArray,h)),a="M",h=""):a="L":this.setPointColor(u,null,e,"X"===e.segmentAxis,c),n=u,this.storePointLocation(u,e,o,ve)):(n="Drop"===e.emptyPointSettings.mode?n:null,a="Drop"===e.emptyPointSettings.mode?a:"M",u.symbolLocations=[])}""!==h&&l.push(new i.PathOption(e.chart.element.id+"_Series_"+e.index,"none",e.width,e.setPointColor(s[s.length-1],e.interior),e.opacity,e.dashArray,h)),this.applySegmentAxis(e,l,c),this.renderMarker(e)},t.prototype.doAnimation=function(e){this.doLinearAnimation(e,e.animation)},t.prototype.getModuleName=function(){return"MultiColoredLineSeries"},t.prototype.destroy=function(){},t}(Gr),Bn=function(){function e(e){this.xAxisPrevHeight=[],this.xAxisMultiLabelHeight=[],this.yAxisPrevHeight=[],this.yAxisMultiLabelHeight=[],this.multiLevelLabelRectXRegion=[],this.xLabelCollection=[],this.chart=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.chart.isDestroyed||this.chart.on("click",this.click,this)},e.prototype.getMultilevelLabelsHeight=function(e){var t,r,o,n=0,a=[],s=[],l="Vertical"===e.orientation,h=l?e.rect.height:e.rect.width;e.multiLevelLabels.map(function(c,d){c.categories.map(function(n){""!==n.text&&null!==n.start&&null!==n.end&&(t=i.measureText(n.text,c.textStyle),r=l?t.width:t.height,r+=2*c.border.width+("CurlyBrace"===c.border.type?10:0),o=null!==n.maximumTextWidth?n.maximumTextWidth:I("string"==typeof n.end?Number(new Date(n.end)):n.end,e)*h-I("string"==typeof n.start?Number(new Date(n.start)):n.start,e)*h,t.width>o-10&&o>0&&"Wrap"===c.overflow&&!l&&(r*=Ge(n.text,o-10,c.textStyle).length),a[d]=a[d]?a[d]<r?r:a[d]:r)}),s[d]=n,n+=a[d]?a[d]+10:0}),e.multiLevelLabelHeight=n+(""!==e.title||this.chart.legendModule&&this.chart.legendSettings.visible?5:0),l?(this.yAxisMultiLabelHeight=a,this.yAxisPrevHeight=s):(this.xAxisMultiLabelHeight=a,this.xAxisPrevHeight=s)},e.prototype.renderXAxisMultiLevelLabels=function(e,r,o,n){var a,s,l,h,c,d,p,u,g,y,m,v=this,f=(e.labelPosition===e.tickPosition?e.majorTickLines.height:0)+e.maxLabelSize.height+10,b="",x="Outside"===e.labelPosition,w=e.isInversed,S=e.opposedPosition,C=e.scrollbarSettings.enable||x&&t.isNullOrUndefined(e.crossesAt)?e.scrollBarHeight:0,P=S&&!x||!S&&x?n.y+f-e.majorTickLines.width:n.y-f-e.multiLevelLabelHeight;this.createClipRect(n.x-e.majorTickLines.width,P+C,e.multiLevelLabelHeight+10,n.width+2*e.majorTickLines.width,this.chart.element.id+"_XAxis_Clippath_"+r,this.chart.element.id+"XAxisMultiLevelLabel"+r),e.multiLevelLabels.map(function(t,o){h=0,v.labelElement=v.chart.renderer.createGroup({id:v.chart.element.id+r+"_MultiLevelLabel"+o}),t.categories.map(function(P,L){if(b="",d="string"==typeof P.start?Number(new Date(P.start)):P.start,p="string"==typeof P.end?Number(new Date(P.end)):P.end,!(m=v.triggerMultiLabelRender(e,P.text,e.multiLevelLabels[o].textStyle,e.multiLevelLabels[o].alignment,P.customAttributes)).cancel){l=I(d,e)*n.width,c=I(p,e)*n.width,c=w?[l,l=c][0]:c,u=i.measureText(m.text,m.textStyle),g=(null===P.maximumTextWidth?c-l:P.maximumTextWidth)-10,a=l+n.x+10,s=(S&&!x||!S&&x?f+n.y+u.height/2+10+v.xAxisPrevHeight[o]:n.y-f+u.height/2-v.xAxisMultiLabelHeight[o]-v.xAxisPrevHeight[o])+C,"Center"===m.alignment?(a+=(c-l-10)/2,y="middle"):"Far"===m.alignment?(a=a+(c-l-10)-t.border.width/2,y="end"):(y="start",a+=t.border.width/2),s="CurlyBrace"===t.border.type?!S&&x||S&&!x?s+10:s-5:s;var R=new i.TextOption(v.chart.element.id+r+"_Axis_MultiLevelLabel_Level_"+o+"_Text_"+L,a,s,y,m.text);if("None"!==t.overflow&&(R.text="Wrap"===t.overflow?Ge(m.text,g,m.textStyle):ze(g,m.text,m.textStyle),R.x=R.x-5),Ve(v.chart.renderer,R,m.textStyle,m.textStyle.color||v.chart.themeStyle.axisLabel,v.labelElement,!1,v.chart.redraw,!0,null,null,null,null,null,v.chart.enableCanvas),v.chart.enableCanvas){var M=i.measureText(m.text,m.textStyle);v.multiLevelLabelRectXRegion.push(new i.Rect(R.x,R.y,M.width,M.height)),v.xLabelCollection.push(R)}t.border.width>0&&"WithoutBorder"!==t.border.type&&""!==(b=v.renderXAxisLabelBorder(o,c-l-10,e,l,f,u,R,n,m.alignment,b,x,S,h))&&(v.createBorderElement(o,r,e,b,h),h++),v.chart.enableCanvas||v.multiElements.appendChild(v.labelElement)}})}),this.chart.enableCanvas||o.appendChild(this.multiElements)},e.prototype.renderXAxisLabelBorder=function(e,t,i,r,o,n,a,s,l,h,c,d,p){var u,g,y,m,v=10,f=i.multiLevelLabels[e],b=f.categories[p].type,x=t+v,w=this.xAxisMultiLabelHeight[e]+v,S="Outside"===i.labelPosition?i.scrollBarHeight:0,C=r+s.x,P=!d&&c||d&&!c?o+s.y+this.xAxisPrevHeight[e]+S:s.y-o-this.xAxisPrevHeight[e]-S,L=b||f.border.type;switch(L){case"WithoutTopandBottomBorder":case"Rectangle":case"WithoutTopBorder":h+="M "+C+" "+P+" L "+C+" "+(P+(w=!d&&c||d&&!c?w:-w))+" M "+(C+x)+" "+P+" L "+(C+x)+" "+(P+w),h+="WithoutTopandBottomBorder"!==L?" L "+C+" "+(P+w)+" ":" ",h+="Rectangle"===L?"M "+C+" "+P+" L "+(C+x)+" "+P:" ";break;case"Brace":"Near"===l?(y=a.x,m=a.x+n.width+2):"Center"===l?(y=a.x-n.width/2-2,m=a.x+n.width/2+2):(y=a.x-n.width-2,m=a.x),h+="M "+C+" "+P+" L "+C+" "+(P+(w=!d&&c||d&&!c?w:-w)/2)+" M "+C+" "+(P+w/2)+" L "+(y-2)+" "+(P+w/2)+" M "+m+" "+(P+w/2)+" L "+(C+x)+" "+(P+w/2)+" M "+(C+x)+" "+(P+w/2)+" L "+(C+x)+" "+P;break;case"CurlyBrace":!d&&c||d&&!c?(v=10,u=15,g=5):(v=-10,u=-15,g=-5),h+="Center"===l?"M "+C+" "+P+" C "+C+" "+P+" "+(C+5)+" "+(P+v)+" "+(C+10)+" "+(P+v)+" L "+(C+x/2-5)+" "+(P+v)+" L "+(C+x/2)+" "+(P+u)+" L "+(C+x/2+5)+" "+(P+v)+" L "+(C+x-10)+" "+(P+v)+" C "+(C+x-10)+" "+(P+v)+" "+(C+x)+" "+(P+g)+" "+(C+x)+" "+P:"Near"===l?"M "+C+" "+P+" C "+C+" "+P+" "+(C+5)+" "+(P+v)+" "+(C+10)+" "+(P+v)+" L "+(C+15)+" "+(P+u)+" L "+(C+20)+" "+(P+v)+" L "+(C+x-10)+" "+(P+v)+" C "+(C+x-10)+" "+(P+v)+" "+(C+x)+" "+(P+g)+" "+(C+x)+" "+P:"M "+C+" "+P+" C "+C+" "+P+" "+(C+5)+" "+(P+v)+" "+(C+10)+" "+(P+v)+" L "+(C+x-20)+" "+(P+v)+" L "+(C+x-15)+" "+(P+u)+" L "+(C+x-10)+" "+(P+v)+" L "+(C+x-10)+" "+(P+v)+" C "+(C+x-10)+" "+(P+v)+" "+(C+x)+" "+(P+g)+" "+(C+x)+" "+P}return h},e.prototype.renderYAxisMultiLevelLabels=function(e,r,o,n){var a,s,l,h,c,d,p,u,g,y,m=this,v="Outside"===e.labelPosition,f=(e.tickPosition===e.labelPosition?e.majorTickLines.height:0)+e.maxLabelSize.width+10,b="",x=e.isInversed,w=e.opposedPosition,S=v&&t.isNullOrUndefined(e.crossesAt)?e.scrollBarHeight:0;S*=w?1:-1;var C=w&&!v||!w&&v?n.x-e.multiLevelLabelHeight-f-10:n.x+f;this.createClipRect(C+S,n.y-e.majorTickLines.width,n.height+2*e.majorTickLines.width,e.multiLevelLabelHeight+10,this.chart.element.id+"_YAxis_Clippath_"+r,this.chart.element.id+"YAxisMultiLevelLabel"+r),e.multiLevelLabels.map(function(t,o){m.labelElement=m.chart.renderer.createGroup({id:m.chart.element.id+r+"_MultiLevelLabel"+o}),p=0,t.categories.map(function(C,P){if(b="",g="string"==typeof C.end?Number(new Date(C.end)):C.end,u="string"==typeof C.start?Number(new Date(C.start)):C.start,h=I(u,e)*n.height,c=I(g,e)*n.height,c=x?[h,h=c][0]:c,!(d=m.triggerMultiLabelRender(e,C.text,t.textStyle,t.alignment,C.customAttributes)).cancel){a=i.measureText(d.text,d.textStyle),y=c-h,s=n.x-f-m.yAxisPrevHeight[o]-m.yAxisMultiLabelHeight[o]/2-5,l=n.height+n.y-h-y/2,s=w?v?n.x+f+5+m.yAxisMultiLabelHeight[o]/2+m.yAxisPrevHeight[o]+S:n.x-f-m.yAxisMultiLabelHeight[o]/2-m.yAxisPrevHeight[o]-5:v?s+S:n.x+f+5+m.yAxisMultiLabelHeight[o]/2+m.yAxisPrevHeight[o],"Center"===d.alignment?l+=a.height/4:"Far"===d.alignment?l+=y/2-a.height/2:l=l-y/2+a.height,s="CurlyBrace"===t.border.type?!w&&v||w&&!v?s-10:s+10:s;var L=new i.TextOption(m.chart.element.id+r+"_Axis_MultiLevelLabel_Level_"+o+"_Text_"+P,s,l,"middle",d.text);L.text="Trim"===t.overflow?ze(null===C.maximumTextWidth?m.yAxisMultiLabelHeight[o]:C.maximumTextWidth,d.text,d.textStyle):L.text,Ve(m.chart.renderer,L,d.textStyle,d.textStyle.color||m.chart.themeStyle.axisLabel,m.labelElement,m.chart.redraw,!0,null,null,null,null,null,null,m.chart.enableCanvas),t.border.width>0&&"WithoutBorder"!==t.border.type&&""!==(b=m.renderYAxisLabelBorder(o,y,e,c,f,h,a,L,n,d.alignment,b,v,w,p))&&(m.createBorderElement(o,r,e,b,p),p++),m.chart.enableCanvas||m.multiElements.appendChild(m.labelElement)}})}),this.chart.enableCanvas||o.appendChild(this.multiElements)},e.prototype.renderYAxisLabelBorder=function(e,i,r,o,n,a,s,l,h,c,d,p,u,g){var y,m,v=o-a,f=10,b=r.multiLevelLabels[e],x=b.categories[g].type,w=h.y+h.height-o,S=p&&t.isNullOrUndefined(r.crossesAt)?r.scrollBarHeight:0;S*=u?1:-1;var C=this.yAxisMultiLabelHeight[e]+f,P=(!u&&p||u&&!p?h.x-n-this.yAxisPrevHeight[e]:h.x+n+this.yAxisPrevHeight[e])+S,L=x||b.border.type;switch(L){case"WithoutTopandBottomBorder":case"Rectangle":case"WithoutTopBorder":d+="M "+P+" "+w+" L "+(P+(C=!u&&p||u&&!p?-C:C))+" "+w+" M "+P+" "+(w+v)+" L "+(P+C)+" "+(w+v),d+="WithoutTopandBottomBorder"!==L?" L "+(P+C)+" "+w+" ":" ",d+="Rectangle"===L?"M "+P+" "+(w+v)+"L "+P+" "+w+" ":" ";break;case"Brace":d+="M "+P+" "+w+" L "+(P-(C=!u&&p||u&&!p?C:-C)/2)+" "+w+" L "+(P-C/2)+" "+(l.y-s.height/2-4)+" M "+(P-C/2)+" "+(l.y+s.height/4+2)+" L "+(P-C/2)+" "+(w+v)+" L "+P+" "+(w+v);break;case"CurlyBrace":!u&&p||u&&!p?(f=-10,y=-15,m=-5):(f=10,y=15,m=5),d+="Center"===c?"M "+P+" "+w+" C "+P+" "+w+" "+(P+f)+" "+w+" "+(P+f)+" "+(w+10)+" L "+(P+f)+" "+(w+(v-10)/2)+" L "+(P+y)+" "+(w+(v-10)/2+5)+" L "+(P+f)+" "+(w+(v-10)/2+10)+" L "+(P+f)+" "+(w+(v-10))+" C "+(P+f)+" "+(w+(v-10))+" "+(P+m)+" "+(w+v)+" "+P+" "+(w+v):"Far"===c?"M "+P+" "+w+" C "+P+" "+w+" "+(P+f)+" "+w+" "+(P+f)+" "+(w+10)+" L "+(P+f)+" "+(w+v-20)+" L "+(P+y)+" "+(w+(v-15))+" L "+(P+f)+" "+(w+(v-10))+" L "+(P+f)+" "+(w+(v-10))+" C "+(P+f)+" "+(w+(v-10))+" "+(P+f)+" "+(w+v)+" "+P+" "+(w+v):"M "+P+" "+w+" C "+P+" "+w+" "+(P+f)+" "+w+" "+(P+f)+" "+(w+10)+" L "+(P+y)+" "+(w+15)+" L "+(P+f)+" "+(w+20)+" L "+(P+f)+" "+(w+(v-10))+" C "+(P+f)+" "+(w+(v-10))+" "+(P+m)+" "+(w+v)+" "+P+" "+(w+v)}return d},e.prototype.createClipRect=function(e,t,i,r,o,n){this.multiElements=this.chart.renderer.createGroup({id:n,"clip-path":"url(#"+o+")"}),this.chart.enableCanvas||this.multiElements.appendChild(K(this.chart.redraw,{id:o,x:e,y:t,width:r,height:i,fill:"white","stroke-width":1,stroke:"Gray"},this.chart.renderer))},e.prototype.createBorderElement=function(e,t,r,o,n){var a=o,s=this.chart.renderer.drawPath(new i.PathOption(this.chart.element.id+t+"_Axis_MultiLevelLabel_Rect_"+e+"_"+n,"Transparent",r.multiLevelLabels[e].border.width,r.multiLevelLabels[e].border.color||this.chart.themeStyle.axisLine,1,"",o));s.setAttribute("style","pointer-events: none"),be(this.chart.enableCanvas,this.labelElement,s,this.chart.redraw,!0,"x","y",null,a)},e.prototype.triggerMultiLabelRender=function(e,t,i,r,o){var n={cancel:!1,name:"axisMultiLabelRender",axis:e,text:t,textStyle:i,alignment:r,customAttributes:o};return this.chart.trigger("axisMultiLabelRender",n),n},e.prototype.MultiLevelLabelClick=function(e,t){var i=parseInt(e.substr(0,1),10),r=parseInt(e.substr(7),10),o=this.chart.axisCollections[t],n=o.multiLevelLabels[i].categories,a=n[r].text,s=n[r].start,l=n[r].end,h={axis:o,level:i,text:a,customAttributes:n[r].customAttributes,start:s,end:l,name:"multiLevelLabelClick",cancel:!1};return this.chart.trigger("multiLevelLabelClick",h),h},e.prototype.click=function(e){var t,i,r,o=e.target.id,n="_Axis_MultiLevelLabel_Level_";if(this.chart.enableCanvas)for(var a=0;a<this.multiLevelLabelRectXRegion.length;a++)j(e.x,e.y,this.multiLevelLabelRectXRegion[a],this.multiLevelLabelRectXRegion[a].width,this.multiLevelLabelRectXRegion[a].height)&&(o=this.xLabelCollection[a].id);o.indexOf(n)>-1&&(t=o.split(n)[1],i=o.split(n)[0],r=parseInt(i.charAt(i.length-1),10),this.MultiLevelLabelClick(t,r))},e.prototype.getModuleName=function(){return"MultiLevelLabel"},e.prototype.destroy=function(){},e}(),Fn=function(){function e(e){this.chartId=e.element.id+"_"}return e.prototype.renderElements=function(e,t){var i=t.createGroup({id:this.chartId+"scrollBar_"+e.axis.name,transform:"translate("+(e.isVertical&&e.axis.isInversed?e.height:e.axis.isInversed?e.width:"0")+","+(e.isVertical&&e.axis.isInversed?"0":e.axis.isInversed?e.height:e.isVertical?e.width:"0")+") rotate("+(e.isVertical&&e.axis.isInversed?"90":e.isVertical?"270":e.axis.isInversed?"180":"0")+")"}),r=t.createGroup({id:this.chartId+"scrollBar_backRect_"+e.axis.name}),o=t.createGroup({id:this.chartId+"scrollBar_thumb_"+e.axis.name,transform:"translate(0,0)"});return this.backRect(e,t,r),this.thumb(e,t,o),this.renderCircle(e,t,o),this.arrows(e,t,o),this.thumbGrip(e,t,o),i.appendChild(r),i.appendChild(o),i},e.prototype.backRect=function(e,t,r){var o=e.scrollbarThemeStyle,n=t.drawRectangle(new Di(this.chartId+"scrollBarBackRect_"+e.axis.name,o.backRect,{width:1,color:o.backRect},1,new i.Rect(0,0,e.width,e.height),0,0));r.appendChild(n)},e.prototype.arrows=function(e,t,r){var o=e.scrollbarThemeStyle,n=new i.PathOption(this.chartId+"scrollBar_leftArrow_"+e.axis.name,o.arrow,1,o.arrow,1,"","");this.leftArrowEle=t.drawPath(n),n.id=this.chartId+"scrollBar_rightArrow_"+e.axis.name,this.rightArrowEle=t.drawPath(n),this.setArrowDirection(this.thumbRectX,this.thumbRectWidth,e.height),r.appendChild(this.leftArrowEle),r.appendChild(this.rightArrowEle)},e.prototype.setArrowDirection=function(e,t,i){var r="M "+(e-4+1)+" "+i/2+" L "+(e-4+6)+" 11 L "+(e-4+6)+" 5 Z",o="M "+(e+t+4-.5)+" "+i/2+" L "+(e+t+4-6)+" 11.5 L "+(e+t+4-6)+" 4.5 Z";this.leftArrowEle.setAttribute("d",r),this.rightArrowEle.setAttribute("d",o)},e.prototype.thumb=function(e,t,r){e.startX=this.thumbRectX;var o=e.scrollbarThemeStyle;this.slider=t.drawRectangle(new Di(this.chartId+"scrollBarThumb_"+e.axis.name,o.thumb,{width:1,color:""},1,new i.Rect(this.thumbRectX,0,this.thumbRectWidth,e.height))),r.appendChild(this.slider)},e.prototype.renderCircle=function(e,t,i){var r=e.scrollbarThemeStyle,o=new Fi(this.chartId+"scrollBar_leftCircle_"+e.axis.name,r.circle,{width:1,color:r.circle},1,this.thumbRectX,e.height/2,8),n=t.createDefs(),a=t.createGroup({id:this.chartId+e.axis.name+"_thumb_shadow"});n.innerHTML='<filter x="-25.0%" y="-20.0%" width="150.0%" height="150.0%" filterUnits="objectBoundingBox"id="scrollbar_shadow"><feOffset dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset><feGaussianBlur stdDeviation="1.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur><feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix></filter>',a.innerHTML='<use fill="black" fill-opacity="1" filter="url(#scrollbar_shadow)" xlink:href="#'+this.chartId+"scrollBar_leftCircle_"+e.axis.name+'"></use><use fill="black" fill-opacity="1" filter="url(#scrollbar_shadow)" xlink:href="#'+this.chartId+"scrollBar_rightCircle_"+e.axis.name+'"></use>',this.leftCircleEle=t.drawCircle(o),o.id=this.chartId+"scrollBar_rightCircle_"+e.axis.name,o.cx=this.thumbRectX+this.thumbRectWidth,this.rightCircleEle=t.drawCircle(o),i.appendChild(n),i.appendChild(this.leftCircleEle),i.appendChild(this.rightCircleEle),i.appendChild(a)},e.prototype.thumbGrip=function(e,t,i){var r=0,o=0,n=e.scrollbarThemeStyle,a=new Fi(this.chartId+"scrollBar_gripCircle0_"+e.axis.name,n.grip,{width:1,color:n.grip},1,0,0,1);this.gripCircle=t.createGroup({id:this.chartId+"scrollBar_gripCircle_"+e.axis.name,transform:"translate("+(this.thumbRectX+this.thumbRectWidth/2+5*(e.isVertical?1:-1))+","+(e.isVertical?"10":"5")+") rotate("+(e.isVertical?"180":"0")+")"});for(var s=1;s<=6;s++)a.id=this.chartId+"scrollBar_gripCircle"+s+"_"+e.axis.name,a.cx=r,a.cy=o,this.gripCircle.appendChild(t.drawCircle(a)),r=3===s?0:r+5,o=s>=3?5:0;i.appendChild(this.gripCircle)},e}(),Nn=function(){function e(e,i){this.scrollRange={max:null,min:null,interval:null,delta:null},this.component=e,this.elements=[],this.scrollElements=new Fn(e),this.axis=i,this.mouseMoveListener=this.scrollMouseMove.bind(this),this.mouseUpListener=this.scrollMouseUp.bind(this),this.animateDuration=500,this.isPointer=t.Browser.isPointer,this.browserName=t.Browser.info.name}return e.prototype.getMouseXY=function(e){var t,i,r;e.type.indexOf("touch")>-1?(t=(r=e).changedTouches[0].clientX,i=r.changedTouches[0].clientY):(t=e.clientX,i=e.clientY);var o=he(this.component.element.id+"_scrollBar_svg"+this.axis.name).getBoundingClientRect();this.mouseX=t-Math.max(o.left,0),this.mouseY=i-Math.max(o.top,0)},e.prototype.wireEvents=function(e){t.EventHandler.add(e,t.Browser.touchStartEvent,this.scrollMouseDown,this),t.EventHandler.add(e,t.Browser.touchMoveEvent,this.scrollMouseMove,this),t.EventHandler.add(e,t.Browser.touchEndEvent,this.scrollMouseUp,this),t.EventHandler.add(e,"mousewheel",this.scrollMouseWheel,this),window.addEventListener("mousemove",this.mouseMoveListener,!1),window.addEventListener("mouseup",this.mouseUpListener,!1)},e.prototype.unWireEvents=function(e){t.EventHandler.remove(e,t.Browser.touchStartEvent,this.scrollMouseDown),t.EventHandler.remove(e,t.Browser.touchMoveEvent,this.scrollMouseMove),t.EventHandler.remove(e,t.Browser.touchEndEvent,this.scrollMouseUp),t.EventHandler.remove(e,"mousewheel",this.scrollMouseWheel),window.removeEventListener("mousemove",this.mouseMoveListener,!1),window.removeEventListener("mouseup",this.mouseUpListener,!1)},e.prototype.scrollMouseDown=function(e){var t=e.target.id,i=this.scrollElements;if(this.getMouseXY(e),this.isResizeLeft=this.isExist(t,"_leftCircle_")||this.isExist(t,"_leftArrow_"),this.isResizeRight=this.isExist(t,"_rightCircle_")||this.isExist(t,"_rightArrow_"),this.previousXY=this.isVertical&&this.axis.isInversed?this.mouseY:this.isVertical?this.width-this.mouseY:this.axis.isInversed?this.width-this.mouseX:this.mouseX,this.previousWidth=i.thumbRectWidth,this.previousRectX=i.thumbRectX,this.startZoomPosition=this.axis.zoomPosition,this.startZoomFactor=this.axis.zoomFactor,this.startRange=this.axis.visibleRange,this.scrollStarted=!0,this.component.trigger("scrollStart",this.getArgs("scrollStart")),this.isExist(t,"scrollBarThumb_")||this.isExist(t,"gripCircle"))this.isThumbDrag=!0,this.svgObject.style.cursor="-webkit-grabbing";else if(this.isExist(t,"scrollBarBackRect_")){var r=this.moveLength(this.previousXY,this.previousRectX);if(i.thumbRectX=this.isWithIn(r)?r:i.thumbRectX,this.positionThumb(i.thumbRectX,i.thumbRectWidth),this.setZoomFactorPosition(i.thumbRectX,i.thumbRectWidth,!1),this.isLazyLoad){var o=i.thumbRectX>this.previousRectX?"RightMove":"LeftMove",n=this.calculateLazyRange(i.thumbRectX,i.thumbRectWidth,o);n&&this.component.trigger("scrollEnd",n)}}""===this.component.element.style.height&&(this.isCustomHeight=!0,this.component.element.style.height=this.component.availableSize.height+"px")},e.prototype.isExist=function(e,t){return e.indexOf(t)>-1},e.prototype.isWithIn=function(e){return e-8>=0&&e+this.scrollElements.thumbRectWidth+8<=this.width},e.prototype.moveLength=function(e,t,i){void 0===i&&(i=8);var r=.1*(this.width-2*i);return r=e<t?t-(t-r>i?r:i):t+(t+this.scrollElements.thumbRectWidth+r<this.width-i?r:i)},e.prototype.setZoomFactorPosition=function(e,t,i){void 0===i&&(i=!0),this.isScrollUI=!0;var r=this.axis,o=e+t+8+1;this.zoomPosition=(e-(e-8.5<=0?8.5:0))/(this.isVertical?r.rect.height:this.width),this.zoomFactor=(t+(o>=this.width?9:0))/(this.isVertical?r.rect.height:this.width),r.zoomPosition=this.zoomPosition<0?0:this.zoomPosition>.9?1:this.zoomPosition,r.zoomFactor=i?this.zoomFactor:r.zoomFactor},e.prototype.scrollMouseMove=function(e){var t=e.target,i=this.scrollElements;this.getMouseXY(e),this.setCursor(t),this.setTheme(t);var r,o=this.isVertical&&this.axis.isInversed?this.width-this.mouseY:this.isVertical?this.mouseY:this.mouseX,n=this.axis.visibleRange,a=this.zoomPosition,s=this.zoomFactor,l=this.previousRectX-i.thumbRectX<0?"RightMove":"LeftMove";this.isLazyLoad&&(this.isThumbDrag||this.isResizeLeft||this.isResizeRight)&&(r=this.calculateLazyRange(i.thumbRectX,i.thumbRectWidth,l));var h=r?r.currentRange:null;if(this.isThumbDrag){this.component.isScrolling=this.isThumbDrag,o=this.isVertical||this.axis.isInversed?this.width-o:o;var c=i.thumbRectX+(o-this.previousXY);o>=c+i.thumbRectWidth?this.setCursor(t):this.svgObject.style.cursor="-webkit-grabbing",o>=0&&o<=c+i.thumbRectWidth&&(i.thumbRectX=this.isWithIn(c)?c:i.thumbRectX,this.positionThumb(i.thumbRectX,i.thumbRectWidth),this.previousXY=o,this.setZoomFactorPosition(c,i.thumbRectWidth,!1)),this.component.trigger("scrollChanged",this.getArgs("scrollChanged",n,a,s,h))}else(this.isResizeLeft||this.isResizeRight)&&(this.resizeThumb(),this.component.trigger("scrollChanged",this.getArgs("scrollChanged",n,a,s,h)))},e.prototype.scrollMouseWheel=function(e){var t=he(this.component.element.id+"_scrollBar_svg"+this.axis.name).getBoundingClientRect();this.mouseX=e.clientX-Math.max(t.left,0),this.mouseY=e.clientY-Math.max(t.top,0);var i,r=.5,o=this.scrollElements,n=this.axis,a="mozilla"!==this.browserName||this.isPointer?e.wheelDelta/120>0?1:-1:-e.detail/3>0?1:-1,s=Math.max(Math.max(1/le(n.zoomFactor,0,1),1)+.25*a,1),l=this.axis.visibleRange,h=this.zoomPosition,c=this.zoomFactor;s>=1&&(r=(r="Horizontal"===n.orientation?this.mouseX/n.rect.width:1-this.mouseY/n.rect.height)>1?1:r<0?0:r,this.zoomFactor=1===s?1:le(1/s,0,1),this.zoomPosition=1===s?0:n.zoomPosition+(n.zoomFactor-this.zoomFactor)*r),o.thumbRectX=this.isWithIn(this.zoomPosition*this.width)?this.zoomPosition*this.width:o.thumbRectX,this.isScrollUI=!0,this.positionThumb(o.thumbRectX,o.thumbRectWidth),this.isLazyLoad&&this.setZoomFactorPosition(o.thumbRectX,o.thumbRectWidth),n.zoomFactor=this.zoomFactor,n.zoomPosition=this.zoomPosition,this.isLazyLoad&&(i=this.calculateMouseWheelRange(o.thumbRectX,o.thumbRectWidth))&&i.currentRange.minimum!==i.previousAxisRange.minimum&&i.currentRange.maximum!==i.previousAxisRange.maximum&&(this.component.trigger("scrollEnd",i),this.isScrollEnd=!1),this.isLazyLoad||this.component.trigger("scrollChanged",this.getArgs("scrollChanged",l,h,c))},e.prototype.scrollMouseUp=function(){var e;this.startX=this.scrollElements.thumbRectX;var t=this.startX+this.scrollElements.thumbRectWidth+8+1;if(!this.isResizeLeft&&!this.isResizeRight||this.isLazyLoad||(this.axis.zoomFactor=t>=this.width-1&&this.startX-8.5<=0?1:this.zoomFactor),this.isLazyLoad){var i=this.previousRectX-this.startX;if((i>0||i<0)&&this.isThumbDrag){var r=i<0?"RightMove":"LeftMove";this.startX="RightMove"===r?this.startX+Math.abs(i)<this.width-8?this.startX:this.width-8-this.scrollElements.thumbRectWidth:this.startX+this.scrollElements.thumbRectWidth-Math.abs(i)>8?this.startX:8,(e=this.calculateLazyRange(this.startX,this.scrollElements.thumbRectWidth,r))&&(this.component.trigger("scrollEnd",e),this.scrollStarted=!1)}(this.isResizeLeft||this.isResizeRight)&&(e=this.calculateLazyRange(this.startX,this.scrollElements.thumbRectWidth))&&(this.component.trigger("scrollEnd",e),this.scrollStarted=!1)}this.isThumbDrag=!1,this.isResizeLeft=!1,this.isResizeRight=!1,this.isScrollEnd=!1,this.component.isScrolling=!1,this.scrollStarted&&!this.isLazyLoad&&(this.component.trigger("scrollEnd",this.getArgs("scrollChanged",this.startRange,this.startZoomPosition,this.startZoomFactor)),this.scrollStarted=!1),this.isCustomHeight&&(this.component.element.style.height=null)},e.prototype.calculateMouseWheelRange=function(e,t){var i,r,o,n=this.scrollRange,a=this.getStartEnd(this.previousStart,this.previousEnd,!1);e+t+8<=this.width&&(r=(e-8)/this.width,i=t/this.width);var s=n.min+r*n.delta,l=s+i*n.delta;return l&&(o={axis:this.axis,currentRange:this.getStartEnd(s,l,!0),previousAxisRange:a}),o},e.prototype.calculateLazyRange=function(e,t,i){var r,o,n,a,s,l=t,h=this.scrollRange,c=this.getStartEnd(this.previousStart,this.previousEnd,!1);return this.isResizeRight||"RightMove"===i?(r=((l=this.isResizeRight?l+16:l)+8)/this.width,o="RightMove"===i?(e+8)/this.width:this.axis.zoomPosition,a=(n="RightMove"===i?h.min+o*h.delta:this.previousStart)+r*h.delta):this.isResizeLeft||"LeftMove"===i?(o=(e-8)/this.width,r=l/this.width,n=(n=h.min+o*h.delta)>=h.min?n:h.min,a="LeftMove"===i?n+r*h.delta:this.previousEnd):this.isThumbDrag&&(o="RightMove"===i?(e+8)/this.width:(e-8)/this.width,r=this.scrollElements.thumbRectWidth/this.width,a=(n=(n=h.min+o*h.delta)>=h.min?n:h.min)+r*h.delta),a&&(s={axis:this.component.isBlazor?{}:this.axis,currentRange:this.getStartEnd(n,a,!0),previousAxisRange:c}),s},e.prototype.getStartEnd=function(e,t,i){var r=this.valueType;switch("DateTime"!==r&&"DateTimeCategory"!==r||!i?i&&(this.previousStart=Math.round(e),this.previousEnd=Math.ceil(t)):(this.previousStart=e,this.previousEnd=t),r){case"Double":case"Category":case"Logarithmic":e=Math.round(e),t=Math.ceil(t);break;case"DateTime":case"DateTimeCategory":e=new Date(e),t=new Date(t)}return{minimum:e,maximum:t}},e.prototype.render=function(e){return(this.component.zoomModule||e&&this.axis.scrollbarSettings.enable)&&this.getDefaults(),this.getTheme(),this.removeScrollSvg(),Je(this,this.component.svgRenderer),this.wireEvents(this.svgObject),this.svgObject.appendChild(this.scrollElements.renderElements(this,this.component.svgRenderer)),this.svgObject},e.prototype.getTheme=function(){this.scrollbarThemeStyle=d(this.component.theme)},e.prototype.removeScrollSvg=function(){document.getElementById(this.component.element.id+"_scrollBar_svg"+this.axis.name)&&t.remove(document.getElementById(this.component.element.id+"_scrollBar_svg"+this.axis.name))},e.prototype.setCursor=function(e){var t=e.id;this.svgObject.style.cursor=t.indexOf("scrollBarThumb_")>-1||t.indexOf("_gripCircle")>-1?"-webkit-grab":t.indexOf("Circle_")>-1||t.indexOf("Arrow_")>-1?this.isVertical?"ns-resize":"ew-resize":"auto"},e.prototype.setTheme=function(e){var t=e.id,i=t.indexOf("_leftCircle_")>-1||t.indexOf("_leftArrow_")>-1,r=t.indexOf("_rightCircle_")>-1||t.indexOf("_rightArrow_")>-1,o=this.scrollbarThemeStyle,n=this.scrollElements.leftArrowEle,a=this.scrollElements.rightArrowEle,s=this.scrollElements.leftCircleEle,l=this.scrollElements.rightCircleEle,h=this.isCurrentAxis(e,n);s.style.fill=i&&h?o.circleHover:o.circle,l.style.fill=r&&h?o.circleHover:o.circle,s.style.stroke=i&&h?o.circleHover:o.circle,l.style.stroke=r&&h?o.circleHover:o.circle,"HighContrastLight"===this.component.theme&&(n.style.fill=i&&h?o.arrowHover:o.arrow,n.style.stroke=i&&h?o.arrowHover:o.arrow,a.style.fill=r&&h?o.arrowHover:o.arrow,a.style.stroke=r&&h?o.arrowHover:o.arrow,s.style.stroke=i&&h?o.circleHover:o.circle,l.style.stroke=r&&h?o.circleHover:o.circle)},e.prototype.isCurrentAxis=function(e,t){return e.id.split("_")[2]===t.id.split("_")[2]},e.prototype.resizeThumb=function(){var e,t=this.previousRectX,i=this.isVertical&&this.axis.isInversed?this.mouseY:this.isVertical?this.width-this.mouseY:this.axis.isInversed?this.width-this.mouseX:this.mouseX,r=Math.abs(this.previousXY-i);if(this.isResizeLeft&&i>=0){var o=t+(i>this.previousXY?r:-r);e=o-8>=0?this.previousWidth+(i>this.previousXY?-r:r):this.previousWidth,o=o-8>=0?o:t,e>=40&&i<o+e&&(this.scrollElements.thumbRectX=this.previousRectX=o,this.scrollElements.thumbRectWidth=this.previousWidth=e,this.previousXY=i,this.positionThumb(o,e),this.setZoomFactorPosition(o,e))}else this.isResizeRight&&(e=i>=40+this.scrollElements.thumbRectX&&i<=this.width-8?i-this.scrollElements.thumbRectX:this.previousWidth,this.scrollElements.thumbRectWidth=this.previousWidth=e,this.previousXY=i,this.positionThumb(this.startX,e),this.setZoomFactorPosition(this.startX,e),this.isLazyLoad||this.setZoomFactorPosition(this.startX,e))},e.prototype.positionThumb=function(e,t){var i=this.scrollElements;i.slider.setAttribute("x",e.toString()),i.slider.setAttribute("width",t.toString()),i.leftCircleEle.setAttribute("cx",e.toString()),i.rightCircleEle.setAttribute("cx",(e+t).toString()),i.setArrowDirection(e,t,this.height),i.gripCircle.setAttribute("transform","translate("+(e+t/2+5*(this.isVertical?1:-1))+","+(this.isVertical?"10":"5")+") rotate("+(this.isVertical?"180":"0")+")")},e.prototype.getDefaults=function(){var e=this.axis;this.axis.scrollbarSettings.enable&&(this.isLazyLoad=!0,this.getLazyDefaults(e)),this.isVertical="Vertical"===e.orientation,this.zoomFactor=this.isLazyLoad?this.zoomFactor:e.zoomFactor,this.zoomPosition=this.isLazyLoad?this.zoomPosition:e.zoomPosition;var t=this.zoomFactor*(this.isVertical?e.rect.height:e.rect.width);t=t>40?t:40,this.scrollX=e.rect.x,this.scrollY=e.rect.y,this.width=this.isVertical?e.rect.height:e.rect.width,this.height=16;var i=this.zoomPosition*(this.isVertical?e.rect.height:this.width),r=this.width-40-8;this.scrollElements.thumbRectX=i>r?r:i<8?8:i,this.scrollElements.thumbRectWidth=t+this.scrollElements.thumbRectX<this.width-16?t:this.width-this.scrollElements.thumbRectX-8},e.prototype.getLazyDefaults=function(e){var t,i,r=e.valueType,o=e.scrollbarSettings,n=e.scrollbarSettings.range,a=e.visibleRange,s=e.scrollbarSettings.pointsLength;this.valueType=r=o.range.minimum&&o.range.maximum||!o.pointsLength?r:"Double";var l={skeleton:"full",type:"dateTime"},h=this.component.intl.getDateParser(l),c=this.component.intl.getDateFormat(l);switch(r){case"Double":case"Category":case"Logarithmic":t=n.minimum?n.minimum:s?0:a.min,i=n.maximum?n.maximum:s?s-1:a.max;break;case"DateTime":case"DateTimeCategory":t=n.minimum?Date.parse(h(c(n.minimum))):a.min,i=n.maximum?Date.parse(h(c(n.maximum))):a.max}t=Math.min(t,a.min),i=Math.max(i,a.max);var d=(a.max-a.min)/(i-t),p=(a.min-t)/(i-t);this.zoomFactor=n.minimum||n.maximum?d:this.axis.maxPointLength/e.scrollbarSettings.pointsLength,this.zoomPosition=n.minimum||n.maximum?p:e.zoomPosition,this.scrollRange.min=t,this.scrollRange.max=i,this.scrollRange.delta=i-t,this.previousStart=a.min,this.previousEnd=a.max},e.prototype.getLogRange=function(e){var t=e.scrollbarSettings.range,i=v(t.minimum,e.logBase),r=v(t.maximum,e.logBase);return i=isFinite(i)?i:t.minimum,r=isFinite(i)?r:t.maximum,{minimum:Math.floor(i/1),maximum:Math.ceil(r/1)}},e.prototype.injectTo=function(t,i){t.zoomingScrollBar=new e(i,t)},e.prototype.destroy=function(){var e=this;this.axes?this.axes.map(function(e){e.zoomingScrollBar.destroy()}):(this.elements.map(function(i){e.unWireEvents(i),t.remove(i.firstChild)}),this.elements=[])},e.prototype.getModuleName=function(){return"ScrollBar"},e.prototype.getArgs=function(e,t,i,r,o){return{axis:this.component.isBlazor?{}:this.axis,name:e,range:this.axis.visibleRange,zoomFactor:this.axis.zoomFactor,zoomPosition:this.axis.zoomPosition,previousRange:t,previousZoomFactor:r,previousZoomPosition:i,currentRange:o}},e}(),Vn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.paretoAxes=[],t}return Vn(t,e),t.prototype.initSeries=function(e,t){var i=new nr(t,"series",e.properties,!0);i.name="Pareto",i.yAxisName=e.yAxisName+"_CumulativeAxis",i.category="Pareto",e.category="Pareto",i.type="Line",i.interior=t.themeStyle.errorBar,t.visibleSeries.push(i),this.initAxis(e,i,t)},t.prototype.initAxis=function(e,t,i){if(!this.paretoAxes.some(function(e){return e.name===t.yAxisName})){var r=e.yAxisName?i.axes.filter(function(t){return t.name===e.yAxisName})[0]:i.primaryYAxis,o=new ki(i,"axis",{name:t.yAxisName,majorGridLines:{width:0},majorTickLines:r.majorTickLines,lineStyle:r.lineStyle,minimum:0,maximum:100,rowIndex:r.rowIndex,opposedPosition:!0,labelFormat:"{value}%"});this.paretoAxes.push(o)}},t.prototype.render=function(e){e.chart.columnSeriesModule.render(e)},t.prototype.performCumulativeCalculation=function(e,t){for(var i=e,r=0,o=0,n=i.length,a=0;a<n;a++)r+=i[a][t.yName];for(a=0;a<n;a++)o+=i[a][t.yName],i[a][t.yName]=Math.round(o/r*100);return i},t.prototype.doAnimation=function(e){this.animate(e)},t.prototype.getModuleName=function(){return"ParetoSeries"},t.prototype.destroy=function(){},t}(jr),Hn=function(){function e(e){this.chart=e}return e.prototype.export=function(e,t,i,r,o,n,a,s,l){var h=new xr(this.chart);r=r||[this.chart];var c={cancel:!1,name:"beforeExport",width:o,height:n};this.chart.trigger("beforeExport",c),c.cancel||h.export(e,t,i,r,o=c.width,n=c.height,a,s,l)},e.prototype.getDataUrl=function(e){return new xr(e).getDataUrl(e)},e.prototype.getModuleName=function(){return"Export"},e.prototype.destroy=function(){},e}(),Xn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yn=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Gn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xn(i,e),Yn([t.Property(null)],i.prototype,"content",void 0),Yn([t.Property("0")],i.prototype,"x",void 0),Yn([t.Property("0")],i.prototype,"y",void 0),Yn([t.Property("Pixel")],i.prototype,"coordinateUnits",void 0),Yn([t.Property("Chart")],i.prototype,"region",void 0),Yn([t.Property("Middle")],i.prototype,"verticalAlignment",void 0),Yn([t.Property("Center")],i.prototype,"horizontalAlignment",void 0),Yn([t.Property(null)],i.prototype,"description",void 0),i}(t.ChildProperty),Wn=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xn(i,e),Yn([t.Property(!1)],i.prototype,"visible",void 0),Yn([t.Property(!0)],i.prototype,"showZero",void 0),Yn([t.Property(null)],i.prototype,"name",void 0),Yn([t.Property("transparent")],i.prototype,"fill",void 0),Yn([t.Property("Inside")],i.prototype,"position",void 0),Yn([t.Property(5)],i.prototype,"rx",void 0),Yn([t.Property(5)],i.prototype,"ry",void 0),Yn([t.Property(0)],i.prototype,"angle",void 0),Yn([t.Property(!1)],i.prototype,"enableRotation",void 0),Yn([t.Complex({width:null,color:null},Yt)],i.prototype,"border",void 0),Yn([t.Complex({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},Xt)],i.prototype,"font",void 0),Yn([t.Complex({},Ht)],i.prototype,"connectorStyle",void 0),Yn([t.Property(null)],i.prototype,"template",void 0),i}(t.ChildProperty),Un=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xn(i,e),Yn([t.Property("50%")],i.prototype,"x",void 0),Yn([t.Property("50%")],i.prototype,"y",void 0),i}(t.ChildProperty),Zn=function(){function e(){this.visible=!0,this.symbolLocation=null,this.region=null,this.labelRegion=null,this.labelVisible=!0,this.regions=null,this.isExplode=!1,this.isClubbed=!1,this.isSliced=!1,this.argsData=null,this.isLabelUpdated=null,this.initialLabelRegion=null}return e}(),qn=function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.points=[],t.clubbedPoints=[],t.sumOfPoints=0,t.isRectSeries=!0,t.clipRect=new i.Rect(0,0,0,0),t.category="Series",t.rightSidePoints=[],t.leftSidePoints=[],t}return Xn(o,e),o.prototype.refreshDataManager=function(e,i){var o=this,n=this.dataSource||e.dataSource;if(!(n instanceof r.DataManager)&&t.isNullOrUndefined(this.query))return void this.dataManagerSuccess({result:n,count:n.length},e,i);this.dataModule.getData(this.dataModule.generateQuery().requiresCount()).then(function(t){return o.dataManagerSuccess(t,e)})},o.prototype.dataManagerSuccess=function(e,t,i){void 0===i&&(i=!0);var r={name:"seriesRender",series:this,data:e.result};t.allowServerDataBinding=!1,t.trigger("seriesRender",r),this.resultData=""!==e.result?e.result:[],t.isBlazor||i||this.getPoints(this.resultData,t),(++t.seriesCounts===t.visibleSeries.length&&i||window.Blazor&&!i&&1===t.seriesCounts)&&(this.getPoints(this.resultData,t),t.refreshChart())},o.prototype.getPoints=function(e,i){var r=Object.keys(e).length;if(this.sumOfPoints=0,0===r)return null;this.findSumOfPoints(e),this.points=[],this.clubbedPoints=[],this.sumOfClub=0;for(var o,n=this.palettes.length?this.palettes:h(i.theme),a=Be(this.groupTo,this.sumOfPoints),s=0;s<r;s++){(o=this.setPoints(e,s,n,i)).y;this.isClub(o,a,s)?(o.index=this.clubbedPoints.length,o.isExplode=!0,this.clubbedPoints.push(o),o.isSliced=!0):(t.isNullOrUndefined(o.y)&&(o.visible=!1),this.pushPoints(o,n))}if(this.lastGroupTo=this.groupTo,this.sumOfClub>0){var l=this.generateClubPoint();this.pushPoints(l,n);var c=this.points.length-1;this.clubbedPoints.map(function(e){e.index+=c,e.color=l.color})}this.clubbedPoints.length&&this.explode&&"Pie"===this.type&&(this.explodeAll||this.points[this.points.length-1].index===this.explodeIndex)&&(this.points.splice(this.points.length-1,1),this.points=this.points.concat(this.clubbedPoints))},o.prototype.generateClubPoint=function(){var e=new Zn;return e.isClubbed=!0,e.x="Others",e.y=this.sumOfClub,e.text=e.originalText=e.x+": "+this.sumOfClub,e.sliceRadius="80%",e},o.prototype.pushPoints=function(e,t){e.index=this.points.length,e.isExplode=this.explodeAll||e.index===this.explodeIndex,e.color=e.color||t[e.index%t.length],this.points.push(e)},o.prototype.isClub=function(e,i,r){if(!t.isNullOrUndefined(i)){if("Value"===this.groupMode&&Math.abs(e.y)<=i)return this.sumOfClub+=Math.abs(e.y),!0;if("Point"===this.groupMode&&r>=i)return this.sumOfClub+=Math.abs(e.y),!0}return!1},o.prototype.findSumOfPoints=function(e){for(var i=Object.keys(e).length,r=0;r<i;r++)t.isNullOrUndefined(e[r])||t.isNullOrUndefined(e[r][this.yName])||isNaN(e[r][this.yName])||(this.sumOfPoints+=Math.abs(e[r][this.yName]))},o.prototype.setPoints=function(e,i,r,o){var n=new Zn;return n.x=t.getValue(this.xName,e[i]),n.y=t.getValue(this.yName,e[i]),n.percentage=+(n.y/this.sumOfPoints*100).toFixed(2),n.legendImageUrl=t.getValue(this.legendImageUrl,e[i]),n.color=t.getValue(this.pointColorMapping,e[i]),n.text=n.originalText=t.getValue(this.dataLabel.name||"",e[i]),n.tooltip=t.getValue(this.tooltipMappingName||"",e[i]),n.sliceRadius=t.getValue(this.radius,e[i]),n.sliceRadius=t.isNullOrUndefined(n.sliceRadius)?"80%":n.sliceRadius,n.separatorY=o.intl.formatNumber(n.y,{useGrouping:o.useGroupingSeparator}),this.setAccEmptyPoint(n,i,e,r),n},o.prototype.renderSeries=function(e,t){var i=t?he(e.element.id+"_Series_"+this.index):e.renderer.createGroup({id:e.element.id+"_Series_"+this.index});this.renderPoints(e,i,t);var r;e.accumulationDataLabelModule&&this.dataLabel.visible&&((r=e.renderer.createGroup({id:e.element.id+"_datalabel_Series_"+this.index})).style.visibility=this.animation.enable&&e.animateSeries&&"Pie"===this.type?"hidden":"visible",this.renderDataLabel(e,r,t)),"Pie"===this.type&&(this.findMaxBounds(this.labelBound,this.accumulationBound),e.pieSeriesModule.animateSeries(e,this.animation,this,i)),e.accumulationLegendModule&&(this.labelBound.x-=e.explodeDistance,this.labelBound.y-=e.explodeDistance,this.labelBound.height+=e.explodeDistance-this.labelBound.y,this.labelBound.width+=e.explodeDistance-this.labelBound.x)},o.prototype.renderPoints=function(e,t,r){for(var o,n=e.element.id+"_Series_"+this.index+"_Point_",a=0,s=this.points;a<s.length;a++){var l=s[a],h={cancel:!1,name:"pointRender",series:this,point:l,fill:l.color,border:this.isEmpty(l)?{width:this.emptyPointSettings.border.width,color:this.emptyPointSettings.border.color}:{width:this.border.width,color:this.border.color}};e.trigger("pointRender",h),l.color=h.fill,o=new i.PathOption(n+l.index,l.color,h.border.width||1,h.border.color||l.color,this.opacity,"",""),e[G(this.type)+"SeriesModule"].renderPoint(l,this,e,o,t,r)}be(!1,e.getSeriesElement(),t,r)},o.prototype.renderDataLabel=function(e,i,r){e.accumulationDataLabelModule.findAreaRect();var o=t.createElement("div",{id:e.element.id+"_Series_0_DataLabelCollections"});this.leftSidePoints=[],this.rightSidePoints=[];for(var n=[],a=[],s=0,l=this.points;s<l.length;s++){var h=l[s];h.visible&&(this.dataLabel.showZero||!this.dataLabel.showZero&&(0!==h.y||0===h.y&&"Zero"===this.emptyPointSettings.mode))&&e.accumulationDataLabelModule.renderDataLabel(h,this.dataLabel,i,this.points,this.index,o,r),h.midAngle>=90&&h.midAngle<=270?this.leftSidePoints.push(h):h.midAngle>=0&&h.midAngle<=90?a.push(h):n.push(h)}if(n.sort(function(e,t){return e.midAngle-t.midAngle}),a.sort(function(e,t){return e.midAngle-t.midAngle}),this.leftSidePoints.sort(function(e,t){return e.midAngle-t.midAngle}),this.rightSidePoints=n.concat(a),e.accumulationDataLabelModule.drawDataLabels(this,this.dataLabel,i,o,r),null!==this.dataLabel.template&&o.childElementCount){var c=e.accumulationDataLabelModule.drawDataLabels.bind(e.accumulationDataLabelModule,this,this.dataLabel,i,o,r);e.isReact&&e.renderReactTemplates(c),be(!1,he(e.element.id+"_Secondary_Element"),o,r)}be(!1,e.getSeriesElement(),i,r)},o.prototype.findMaxBounds=function(e,t){e.x=t.x<e.x?t.x:e.x,e.y=t.y<e.y?t.y:e.y,e.height=t.y+t.height>e.height?t.y+t.height:e.height,e.width=t.x+t.width>e.width?t.x+t.width:e.width},o.prototype.setAccEmptyPoint=function(e,i,r,o){if(!t.isNullOrUndefined(e.y)&&!isNaN(e.y))return null;switch(e.color=this.emptyPointSettings.fill||e.color,this.emptyPointSettings.mode){case"Zero":e.y=0,e.visible=!0;break;case"Average":var n=r[i-1]?r[i-1][this.yName]||0:0,a=r[i+1]?r[i+1][this.yName]||0:0;e.y=(Math.abs(n)+Math.abs(a))/2,this.sumOfPoints+=e.y,e.visible=!0;break;default:e.visible=!1}},o.prototype.isEmpty=function(e){return e.color===this.emptyPointSettings.fill},Yn([t.Property("")],o.prototype,"dataSource",void 0),Yn([t.Property()],o.prototype,"query",void 0),Yn([t.Property("")],o.prototype,"xName",void 0),Yn([t.Property("")],o.prototype,"name",void 0),Yn([t.Property("")],o.prototype,"tooltipMappingName",void 0),Yn([t.Property("")],o.prototype,"yName",void 0),Yn([t.Property(!0)],o.prototype,"visible",void 0),Yn([t.Complex({color:null,width:0},Yt)],o.prototype,"border",void 0),Yn([t.Complex(null,qt)],o.prototype,"animation",void 0),Yn([t.Property("SeriesType")],o.prototype,"legendShape",void 0),Yn([t.Property("")],o.prototype,"legendImageUrl",void 0),Yn([t.Property("")],o.prototype,"pointColorMapping",void 0),Yn([t.Property(null)],o.prototype,"selectionStyle",void 0),Yn([t.Property(null)],o.prototype,"groupTo",void 0),Yn([t.Property("Value")],o.prototype,"groupMode",void 0),Yn([t.Complex({},Wn)],o.prototype,"dataLabel",void 0),Yn([t.Property([])],o.prototype,"palettes",void 0),Yn([t.Property(0)],o.prototype,"startAngle",void 0),Yn([t.Property(null)],o.prototype,"endAngle",void 0),Yn([t.Property("80%")],o.prototype,"radius",void 0),Yn([t.Property("0")],o.prototype,"innerRadius",void 0),Yn([t.Property("Pie")],o.prototype,"type",void 0),Yn([t.Property(!0)],o.prototype,"enableTooltip",void 0),Yn([t.Property(!1)],o.prototype,"explode",void 0),Yn([t.Property("30%")],o.prototype,"explodeOffset",void 0),Yn([t.Property(!1)],o.prototype,"explodeAll",void 0),Yn([t.Property(null)],o.prototype,"explodeIndex",void 0),Yn([t.Complex({mode:"Drop"},Kt)],o.prototype,"emptyPointSettings",void 0),Yn([t.Property(0)],o.prototype,"gapRatio",void 0),Yn([t.Property("80%")],o.prototype,"width",void 0),Yn([t.Property("80%")],o.prototype,"height",void 0),Yn([t.Property("20%")],o.prototype,"neckWidth",void 0),Yn([t.Property("20%")],o.prototype,"neckHeight",void 0),Yn([t.Property("Linear")],o.prototype,"pyramidMode",void 0),Yn([t.Property(1)],o.prototype,"opacity",void 0),o}(t.ChildProperty),Qn=function(){function e(e){this.accumulation=e}return Object.defineProperty(e.prototype,"center",{get:function(){return this.pieCenter||("Pie"===this.accumulation.visibleSeries[0].type?this.accumulation.pieSeriesModule.pieBaseCenter:null)},set:function(e){this.pieCenter=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"radius",{get:function(){return void 0!==this.pieRadius?this.pieRadius:this.accumulation.pieSeriesModule.pieBaseRadius},set:function(e){this.pieRadius=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"labelRadius",{get:function(){return void 0!==this.pieLabelRadius?this.pieLabelRadius:this.accumulation.pieSeriesModule.pieBaseLabelRadius},set:function(e){this.pieLabelRadius=e},enumerable:!0,configurable:!0}),e.prototype.isCircular=function(){return"Pie"===this.accumulation.type},e.prototype.isVariousRadius=function(){return this.accumulation.pieSeriesModule.isRadiusMapped},e.prototype.processExplode=function(e){if(e.target.id.indexOf("_Series_")>-1||e.target.id.indexOf("_datalabel_")>-1){var t=D(e.target.id).point;if(isNaN(t)||e.target.id.indexOf("_datalabel_")>-1&&"Outside"===this.accumulation.visibleSeries[0].points[t].labelPosition)return null;this.explodePoints(t,this.accumulation),this.deExplodeAll(t,this.accumulation.enableAnimation?300:0)}},e.prototype.invokeExplode=function(){for(var e=this.accumulation.visibleSeries[0],t=this.accumulation.enableAnimation?300:0,i=0,r=e.points;i<r.length;i++){var o=r[i];o.isExplode&&this.pointExplode(o.index,o,t)}if(this.accumulation.accumulationSelectionModule&&"None"!==this.accumulation.selectionMode&&this.accumulation.accumulationSelectionModule.selectedDataIndexes.length)for(var n=0,a=this.accumulation.accumulationSelectionModule.selectedDataIndexes;n<a.length;n++){var s=a[n];this.explodePoints(s.point,this.accumulation,!0),this.deExplodeAll(s.point,t)}},e.prototype.deExplodeAll=function(e,t){for(var i=this.accumulation.element.id+"_Series_0_Point_",r=0,o=this.accumulation.visibleSeries[0].points;r<o.length;r++){var n=o[r];(e!==n.index&&!n.isSliced||n.isClubbed)&&(n.isExplode=!1,this.deExplodeSlice(n.index,i,t))}},e.prototype.explodePoints=function(e,i,r){void 0===r&&(r=!1);var o=i.visibleSeries[0],n=o.points,a=et(e,n),s=!0,l=this.accumulation.enableAnimation?300:0;if(t.isNullOrUndefined(a))return null;var h=!r&&(a.isSliced||o.clubbedPoints.length&&n[n.length-1].index===o.clubbedPoints[o.clubbedPoints.length-1].index);"Pie"===o.type&&(h||a.isClubbed)&&(s=this.clubPointExplode(e,a,o,n,i,l,h)),s&&this.pointExplode(e,a,l,r)},e.prototype.getSum=function(e){var t=0;return e.map(function(e){t+=e.visible?e.y:0}),t},e.prototype.clubPointExplode=function(e,t,i,r,o,n,a){if(void 0===a&&(a=!1),t.isClubbed)return o.animateSeries=!1,r.splice(r.length-1,1),i.clubbedPoints.map(function(e){e.visible=!0,e.isExplode=!0}),o.visibleSeries[0].points=r.concat(i.clubbedPoints),this.deExplodeAll(e,n),i.sumOfPoints=this.getSum(o.visibleSeries[0].points),o.refreshChart(),!1;if(a||t.isSliced){o.animateSeries=!1,r.splice(r.length-i.clubbedPoints.length,i.clubbedPoints.length);var s=i.generateClubPoint();if(s.index=r.length,s.color=i.clubbedPoints[0].color,r.push(s),i.sumOfPoints=this.getSum(r),this.deExplodeAll(e,n),s.isExplode=!1,o.visibleSeries[0].points=r,o.refreshChart(),this.pointExplode(s.index,r[s.index],0,!0),s.isExplode=!1,this.deExplodeSlice(s.index,o.element.id+"_Series_0_Point_",n),t.isSliced)return!1}return!0},e.prototype.pointExplode=function(e,t,i,r){var o,n=this.accumulation.element.id+"_Series_0_Point_",a=this.accumulation;o=this.isCircular()?M(t.midAngle,a.explodeDistance,this.center):{x:t.labelRegion&&t.labelRegion.x<t.region.x?-a.explodeDistance:a.explodeDistance,y:0},this.isExplode(n+e)||r?(t.isExplode=!0,this.explodeSlice(e,o,n,this.center||{x:0,y:0},i)):(t.isExplode=!1,this.deExplodeSlice(e,n,i))},e.prototype.isExplode=function(e){var t=he(e),i=t?t.getAttribute("transform"):null;return t&&("translate(0, 0)"===i||null===i||"translate(0)"===i)},e.prototype.deExplodeSlice=function(e,t,i){var r=he(t+e);r&&r.parentNode.lastChild.hasAttribute("transform")&&r.parentNode.lastChild.removeAttribute("transform");var o=r?r.getAttribute("transform"):null;if(this.accumulation.enableAnimation&&r&&o&&"translate(0, 0)"!==o&&"translate(0)"!==o){var n=/translate\((-?\d+\.?\d*),?\s*(-?\d+[.]?\d*)?\)/.exec(o);this.performAnimation(e,t,0,0,+n[1],+n[2]||0,i,!0)}else this.performAnimation(e,t,0,0,0,0,i,!0)},e.prototype.setTranslate=function(e,t,i,r){this.setElementTransform(t+e,i),this.accumulation.visibleSeries[0].dataLabel.visible&&(t=this.accumulation.element.id+"_datalabel_Series_0_",this.setElementTransform(t+"shape_"+e,i),this.setElementTransform(t+"text_"+e,i+r),this.setElementTransform(t+"connector_"+e,i))},e.prototype.setElementTransform=function(e,t){var i=he(e);i&&i.setAttribute("transform",t)},e.prototype.explodeSlice=function(e,t,i,r,o){this.performAnimation(e,i,0,0,t.x-r.x,t.y-r.y,o)},e.prototype.performAnimation=function(e,i,r,o,n,a,s,l){var h=this,c=this.accumulation,d=i.split("_"),p=parseInt(i.split("_")[d.length-3],10),u=c.visibleSeries[p].points[e];if(s<=0)return this.setTranslate(e,i,"translate("+n+", "+a+")",u.transform),null;var g,y;new t.Animation({}).animate(t.createElement("div"),{duration:s,progress:function(t){g=q(t.timeStamp,r,n,t.duration),y=q(t.timeStamp,o,a,t.duration),h.setTranslate(e,i,"translate("+(l?n-g:g)+", "+(l?a-y:y)+")",u.transform)},end:function(){h.setTranslate(e,i,"translate("+(l?r:n)+", "+(l?r:a)+")",u.transform)}})},e}(),$n=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return $n(r,e),r.prototype.initProperties=function(e,t){this.accumulation=e,this.size=Math.min(e.initialClipRect.width,e.initialClipRect.height),this.initAngles(t);var i=parseInt(t.radius,10);if(-1===t.radius.indexOf("%")&&"number"!=typeof i||isNaN(i)){var r=[];this.isRadiusMapped=!0;for(var o=0;o<Object.keys(t.points).length;o++)-1!==t.points[o].sliceRadius.indexOf("%")?r[o]=Be(t.points[o].sliceRadius,this.size/2):r[o]=parseInt(t.points[o].sliceRadius,10);var n=Math.min.apply(null,r),a=Math.max.apply(null,r);this.pieBaseRadius=this.seriesRadius=a,this.innerRadius=Be(t.innerRadius,this.seriesRadius),this.innerRadius=this.innerRadius>n?this.innerRadius/2:this.innerRadius}else this.isRadiusMapped=!1,this.pieBaseRadius=Be(t.radius,this.size/2),this.innerRadius=Be(t.innerRadius,this.pieBaseRadius),this.pieBaseLabelRadius="Inside"===t.dataLabel.position?(this.pieBaseRadius-this.innerRadius)/2+this.innerRadius:this.pieBaseRadius+Be(t.dataLabel.connectorStyle.length||"4%",this.size/2);this.radius=this.pieBaseRadius,this.labelRadius=this.pieBaseLabelRadius,e.explodeDistance=t.explode?Be(t.explodeOffset,this.pieBaseRadius):0,this.findCenter(e,t),this.center=this.pieBaseCenter,this.defaultLabelBound(t,t.dataLabel.visible,t.dataLabel.position),this.totalAngle-=.001},r.prototype.getLabelRadius=function(e,t){return"Inside"===e.dataLabel.position?(Be(t.sliceRadius,this.pieBaseRadius)-this.innerRadius)/2+this.innerRadius:Be(t.sliceRadius,this.seriesRadius)+Be(e.dataLabel.connectorStyle.length||"4%",this.size/2)},r.prototype.findCenter=function(e,t){this.accumulation=e,this.pieBaseCenter={x:Be(e.center.x,e.initialClipRect.width)+e.initialClipRect.x,y:Be(e.center.y,e.initialClipRect.height)+e.initialClipRect.y};var i=this.getSeriesBound(t),r=new Vi(i.x+i.width/2,i.y+i.height/2);this.pieBaseCenter.x+=this.pieBaseCenter.x-r.x,this.pieBaseCenter.y+=this.pieBaseCenter.y-r.y,this.accumulation.origin=this.pieBaseCenter},r.prototype.initAngles=function(e){var i=t.isNullOrUndefined(e.endAngle)?e.startAngle:e.endAngle;this.totalAngle=(i-e.startAngle)%360,this.startAngle=e.startAngle-90,this.totalAngle=this.totalAngle<=0?360+this.totalAngle:this.totalAngle,this.startAngle=(this.startAngle<0?this.startAngle+360:this.startAngle)%360},r.prototype.defaultLabelBound=function(e,t,r){var o=this.getSeriesBound(e);e.accumulationBound=o,e.labelBound=new i.Rect(o.x,o.y,o.width+o.x,o.height+o.y),t&&"Outside"===r&&(e.labelBound=new i.Rect(1/0,1/0,-1/0,-1/0))},r.prototype.getSeriesBound=function(e){var t=new i.Rect(1/0,1/0,-1/0,-1/0);this.initAngles(e);var r=this.startAngle,o=this.totalAngle,n=(this.startAngle+o)%360;n=0===n?360:n,e.findMaxBounds(t,this.getRectFromAngle(r)),e.findMaxBounds(t,this.getRectFromAngle(n)),e.findMaxBounds(t,new i.Rect(this.pieBaseCenter.x,this.pieBaseCenter.y,0,0));var a=(90*Math.floor(r/90)+90)%360,s=90*Math.floor(n/90)%360;s=0===s?360:s,(o>=90||s===a)&&(e.findMaxBounds(t,this.getRectFromAngle(a)),e.findMaxBounds(t,this.getRectFromAngle(s))),(0===r||r+o>=360)&&e.findMaxBounds(t,this.getRectFromAngle(0));for(var l=a===s?0:Math.floor(o/90),h=1;h<l;h++)((a+=90)<s||n<r||360===o)&&e.findMaxBounds(t,this.getRectFromAngle(a));return t.width-=t.x,t.height-=t.y,t},r.prototype.getRectFromAngle=function(e){var t=M(e,this.pieBaseRadius,this.pieBaseCenter);return new i.Rect(t.x,t.y,0,0)},r.prototype.getPathArc=function(e,t,i,r,o){var n=i-t,a=(n=n<0?n+360:n)<180?0:1;return o||0!==o?this.getDoughnutPath(e,M(t,r,e),M(i,r,e),r,M(t,o,e),M(i,o,e),o,a):this.getPiePath(e,M(t,r,e),M(i,r,e),r,a)},r.prototype.getPiePath=function(e,t,i,r,o){return"M "+e.x+" "+e.y+" L "+t.x+" "+t.y+" A "+r+" "+r+" 0 "+o+" 1 "+i.x+" "+i.y+" Z"},r.prototype.getDoughnutPath=function(e,t,i,r,o,n,a,s){return"M "+t.x+" "+t.y+" A "+r+" "+r+" 0 "+s+" 1 "+i.x+" "+i.y+" L "+n.x+" "+n.y+" A "+a+" "+a+" 0 "+s+",0 "+o.x+" "+o.y+" Z"},r.prototype.doAnimation=function(e,i){var r,o=this,n=i.startAngle-90,a=this.accumulation.duration?this.accumulation.duration:i.animation.duration;this.pieBaseCenter.x+=1;var s=.75*Math.max(this.accumulation.availableSize.height,this.accumulation.availableSize.width);s+=.414*s;var l=Z("Linear");new t.Animation({}).animate(e,{duration:a,delay:i.animation.delay,progress:function(t){r=l(t.timeStamp,n,o.totalAngle,t.duration),e.setAttribute("d",o.getPathArc(o.pieBaseCenter,n,r,s,0))},end:function(){o.pieBaseCenter.x-=1,e.setAttribute("d",o.getPathArc(o.pieBaseCenter,0,359.99999,s,0)),o.accumulation.trigger("animationComplete",o.accumulation.isBlazor?{}:{series:i,accumulation:o.accumulation,chart:o.accumulation}),he(o.accumulation.element.id+"_datalabel_Series_"+i.index).style.visibility=o.accumulation.isDestroyed?"hidden":"visible"}})},r}(Qn),Kn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ea=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Kn(r,e),r.prototype.renderPoint=function(e,t,i,r,o,n){var a=t.sumOfPoints;e.startAngle=this.startAngle;var s=e.visible?e.y:0,l=a?Math.abs(s)/a*this.totalAngle:null,h=Math.PI/180*(90-(360-this.startAngle)-90);this.radius=this.isRadiusMapped?Be(e.sliceRadius,this.seriesRadius):this.radius,r.d=this.getPathOption(e,l,this.startAngle%360),e.midAngle=(this.startAngle-l/2)%360,e.endAngle=this.startAngle%360,e.symbolLocation=M(e.midAngle,(this.radius+this.innerRadius)/2,this.center),n?(o.appendChild(i.renderer.drawPath(r)),this.refresh(e,l,h,i,r)):(o.appendChild(i.renderer.drawPath(r)),e.degree=l,e.start=h)},r.prototype.findSeries=function(e){var t=0===this.innerRadius?this.radius+3:this.innerRadius-3,i=0===this.innerRadius?t+2:t-2;this.toggleInnerPoint(e,t,i)},r.prototype.toggleInnerPoint=function(e,r,o){var n,a=D(e.target.id,!0),s=e.target.id.substring(0,e.target.id.indexOf("Series")-1),l=document.getElementById(this.accumulation.element.id+"PointHover_Border"),h=a.series,c=a.point,d=he(s+"_Series_"+h+"_Point_"+c);if(!isNaN(a.series)&&d){if(!(t.isNullOrUndefined(h)||isNaN(h)||t.isNullOrUndefined(c)||isNaN(c))){var p=this.accumulation.visibleSeries[0].points[c],u=d.getAttribute("class")===s+"_ej2_deselected"?this.accumulation.tooltip.enable?.5:.3:this.accumulation.tooltip.enable?.5:1,g=this.getPathArc(this.accumulation.pieSeriesModule.center,p.startAngle%360,(p.startAngle+p.degree)%360,r,o);l&&s===this.accumulation.element.id&&(l.getAttribute("d")!==g||p.isExplode)&&(l.parentNode.removeChild(l),l=null);var y=he(s+"_Series_"+h);if(!l&&(!p.isExplode||p.isExplode&&"click"!==e.type)){var m=new i.PathOption(s+"PointHover_Border",p.color,1,p.color,u,"",g);if((n=this.accumulation.renderer.drawPath(m)).removeAttribute("transform"),"None"!==this.accumulation.selectionMode&&e.target.hasAttribute("class")&&this.accumulation.accumulationSelectionModule.addSvgClass(n,e.target.getAttribute("class")),y.appendChild(n),p.isExplode&&n){var v=d.getAttribute("transform");n.setAttribute("transform",v)}}}}else l&&(this.removeBorder(l,1e3),l=null)},r.prototype.removeBorder=function(e,t){e&&setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},t)},r.prototype.refresh=function(e,i,r,o,n){var a=this,s=he(n.id),l=o.duration?o.duration:300;new t.Animation({}).animate(t.createElement("div"),{duration:l,delay:0,progress:function(t){var n=q(t.timeStamp,e.degree,i-e.degree,t.duration),l=q(t.timeStamp,e.start,r-e.start,t.duration);l=(l/(Math.PI/180)+360)%360,s.setAttribute("d",a.getPathOption(e,n,l)),e.isExplode&&o.accBaseModule.explodePoints(e.index,o,!0),s.style.visibility="visible"},end:function(){s.style.visibility=e.visible?"visible":"hidden",s.setAttribute("d",n.d),e.degree=i,e.start=r}})},r.prototype.getPathOption=function(e,t,i){if(!t)return"";var r=this.getPathArc(this.center,i%360,(i+t)%360,this.isRadiusMapped?Be(e.sliceRadius,this.seriesRadius):this.radius,this.innerRadius);return this.startAngle+=t,r},r.prototype.animateSeries=function(e,t,r,o){var n=e.element.id+"SeriesGroup"+r.index;if(r.animation.enable&&e.animateSeries){var a=e.renderer.createClipPath({id:n+"_clipPath"}),s=new i.PathOption(n+"_slice","transparent",1,"transparent",1,"",""),l=e.renderer.drawPath(s);a.appendChild(l),e.svgObject.appendChild(a),o.setAttribute("style","clip-path:url(#"+a.id+"); -webkit-clip-path:url(#"+a.id+");"),this.doAnimation(l,r)}},r.prototype.getModuleName=function(){return"PieSeries"},r.prototype.destroy=function(){},r}(Jn),ta=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ia=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ra=function(r){function o(e,t){var i=r.call(this,e,t)||this;return i.animateselected=!1,i.explodeDistance=0,i.chartid=57724,i}return ta(o,r),o.prototype.animate=function(e){this.duration=e||700,this.animateselected=!0,this.animateSeries=!1;var t=0,i=[],r=[],o=[],n=this.visibleSeries[0],a=[];if(a=n.dataSource,n.sumOfPoints=0,n.points.length<Object.keys(n.dataSource).length)this.refresh();else if(n.points.length>Object.keys(n.dataSource).length){var s=this.visibleSeries[0];s.points=s.points.filter(function(e){return e.visible=!1,r.push(e.index),i.push(e.color),a.some(function(i){var r=i;return e.x===r.x&&(e.visible=!0,o.push(e.index),e.index=t,t++),e.x===r.x})});for(var l=r.filter(function(e){return o.indexOf(e)<0}),h=r.length-l.length,c=r.length-1;c>=h;c--)m("container_Series_0_Point_"+r[c]);for(c=0;c<s.points.length;c++)s.points[c].y=s.dataSource[c].y,s.points[c].color=i[c],s.sumOfPoints+=s.dataSource[c].y;this.redraw=this.enableAnimation,this.animateSeries=!1,this.calculateBounds(),this.renderElements()}else{for(c=0;c<n.points.length;c++)n.points[c].y=n.dataSource[c][n.yName],n.points[c].color=null!=n.dataSource[c][n.pointColorMapping]?n.dataSource[c][n.pointColorMapping]:n.points[c].color,n.sumOfPoints+=n.dataSource[c][n.yName];this.redraw=this.enableAnimation,this.animateSeries=!1,this.removeSvg(),this.refreshPoints(n.points),this.renderElements()}},Object.defineProperty(o.prototype,"type",{get:function(){return this.series&&this.series.length?this.series[0].type:"Pie"},enumerable:!0,configurable:!0}),o.prototype.preRender=function(){if(this.isBlazor=window.Blazor,this.allowServerDataBinding=!1,this.unWireEvents(),this.setCulture(),this.animateSeries=!0,""===this.element.id){var e=document.getElementsByClassName("e-accumulationchart").length;this.element.id="acc_chart_"+this.chartid+"_"+e}je(this),this.wireEvents()},o.prototype.setTheme=function(){this.themeStyle=c(this.theme)},o.prototype.render=function(){var e=this;-1===this.element.className.indexOf("e-accumulationchart")&&this.element.classList.add("e-accumulationchart");var t={chart:this.isBlazor?{}:this,accumulation:this.isBlazor?{}:this,theme:this.theme,name:"load",cancel:!1};this.trigger("load",t,function(){e.theme=e.isBlazor?t.theme:e.theme,e.setTheme(),e.accBaseModule=new Qn(e),e.pieSeriesModule=new ea(e),e.calculateVisibleSeries(),e.processData(),e.renderComplete(),e.allowServerDataBinding=!0})},o.prototype.unWireEvents=function(){var e=t.Browser.isPointer,i=t.Browser.touchStartEvent,r=t.Browser.touchMoveEvent,o=t.Browser.touchEndEvent,n=e?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,r,this.accumulationMouseMove),t.EventHandler.remove(this.element,o,this.accumulationMouseEnd),t.EventHandler.remove(this.element,i,this.accumulationMouseStart),t.EventHandler.remove(this.element,"click",this.accumulationOnMouseClick),t.EventHandler.remove(this.element,"contextmenu",this.accumulationRightClick),t.EventHandler.remove(this.element,n,this.accumulationMouseLeave),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.accumulationResize)},o.prototype.wireEvents=function(){if(this.element){var e=t.Browser.isPointer,i=t.Browser.touchStartEvent,r=t.Browser.touchEndEvent,o=t.Browser.touchMoveEvent,n=e?"pointerleave":"mouseleave";t.EventHandler.add(this.element,o,this.accumulationMouseMove,this),t.EventHandler.add(this.element,r,this.accumulationMouseEnd,this),t.EventHandler.add(this.element,i,this.accumulationMouseStart,this),t.EventHandler.add(this.element,"click",this.accumulationOnMouseClick,this),t.EventHandler.add(this.element,"contextmenu",this.accumulationRightClick,this),t.EventHandler.add(this.element,n,this.accumulationMouseLeave,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.accumulationResize.bind(this)),new t.Touch(this.element),this.setStyle(this.element)}},o.prototype.setMouseXY=function(e){var t,i,r=he(this.element.id+"_svg");if(r&&this.element){var o=r.getBoundingClientRect(),n=this.element.getBoundingClientRect();if(e.type.indexOf("touch")>-1){this.isTouch=!0;var a=e;i=a.changedTouches[0].clientY,t=a.changedTouches[0].clientX}else this.isTouch="touch"===e.pointerType||"2"===e.pointerType,t=e.clientX,i=e.clientY;this.mouseY=i-n.top-Math.max(o.top-n.top,0),this.mouseX=t-n.left-Math.max(o.left-n.left,0)}},o.prototype.accumulationMouseEnd=function(e){return this.setMouseXY(e),this.trigger("chartMouseUp",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.isTouch&&(this.titleTooltip(e,this.mouseX,this.mouseY,this.isTouch),this.accumulationDataLabelModule&&this.visibleSeries[0].dataLabel.visible&&this.accumulationDataLabelModule.move(e,this.mouseX,this.mouseY,this.isTouch),this.accumulationLegendModule&&this.legendSettings.visible&&this.accumulationLegendModule.move(e)),this.notify(t.Browser.touchEndEvent,e),!1},o.prototype.accumulationMouseStart=function(e){return this.setMouseXY(e),this.trigger("chartMouseDown",{target:e.target.id,x:this.mouseX,y:this.mouseY}),!1},o.prototype.accumulationResize=function(){var e=this;this.animateSeries=!1;var t={accumulation:this.isBlazor?{}:this,previousSize:new i.Size(this.availableSize.width,this.availableSize.height),name:"resized",currentSize:new i.Size(0,0),chart:this.isBlazor?{}:this},r={name:"beforeResize",cancelResizedEvent:!1};return this.resizeTo&&clearTimeout(this.resizeTo),this.trigger("beforeResize",r),r.cancelResizedEvent||(this.resizeTo=+setTimeout(function(){if(e.isDestroyed)return void clearTimeout(e.resizeTo);je(e),t.currentSize=e.availableSize,e.trigger("resized",t),e.refreshSeries(),e.refreshChart()},500)),!1},o.prototype.print=function(e){var t=document.getElementById(this.element.id+"_Series_0").style.clipPath;document.getElementById(this.element.id+"_Series_0").style.clipPath="",new xr(this).print(e),document.getElementById(this.element.id+"_Series_0").style.clipPath=t},o.prototype.export=function(e,t){this.exportModule&&(this.exportModule.export(e,t),this.afterExport&&this.exportModule.getDataUrl(this))},o.prototype.setStyle=function(e){e.style.touchAction="element",e.style.msTouchAction="element",e.style.msContentZooming="none",e.style.msUserSelect="none",e.style.webkitUserSelect="none",e.style.position="relative",e.style.display="block"},o.prototype.setAnnotationValue=function(e,t){var i,r=this.annotations[e],o=he(this.element.id+"_Annotation_Collections");t&&(r.content=t,o?(i=this.createElement("div"),m(this.element.id+"_Annotation_"+e),this.annotationModule.processAnnotation(r,e,i),o.appendChild(i.children[0])):this.annotationModule.renderAnnotations(he(this.element.id+"_Secondary_Element")))},o.prototype.accumulationMouseMove=function(e){return!!he(this.element.id+"_svg")&&(this.setMouseXY(e),this.trigger("chartMouseMove",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.pointMove&&this.triggerPointEvent("pointMove",e.target,e),this.accumulationLegendModule&&this.legendSettings.visible&&this.accumulationLegendModule.move(e),this.accumulationDataLabelModule&&this.visibleSeries[0]&&this.visibleSeries[0].dataLabel.visible&&this.accumulationDataLabelModule.move(e,this.mouseX,this.mouseY),this.isTouch||this.titleTooltip(e,this.mouseX,this.mouseY),this.enableBorderOnMouseMove&&"Pie"===this.type&&this.pieSeriesModule&&j(this.mouseX,this.mouseY,this.initialClipRect)&&this.pieSeriesModule.findSeries(e),this.notify(t.Browser.touchMoveEvent,e),!1)},o.prototype.titleTooltip=function(e,t,i,r){var o=e.target.id,n=o===this.element.id+"_title"||o===this.element.id+"_subTitle"||o===this.element.id+"_chart_legend_title";e.target.textContent.indexOf("...")>-1&&n?f(o===this.element.id+"_title"?this.title:o===this.element.id+"_subTitle"?this.subTitle:this.legendSettings.title,t,i,this.element.offsetWidth,this.element.id+"_EJ2_Title_Tooltip",he(this.element.id+"_Secondary_Element"),r):m(this.element.id+"_EJ2_Title_Tooltip")},o.prototype.accumulationOnMouseClick=function(e){return this.setMouseXY(e),this.accumulationLegendModule&&this.legendSettings.visible&&this.accumulationLegendModule.click(e),"None"!==this.selectionMode&&this.accumulationSelectionModule&&this.accumulationSelectionModule.calculateSelectedElements(this,e),this.visibleSeries[0].explode&&this.accBaseModule.processExplode(e),this.enableBorderOnMouseMove&&this.pieSeriesModule&&"Pie"===this.type&&this.pieSeriesModule.findSeries(e),this.trigger("chartMouseClick",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.pointClick&&this.triggerPointEvent("pointClick",e.target,e),!1},o.prototype.triggerPointEvent=function(e,t,i){var r=i,o=D(t.id,!0);o.series>=0&&o.point>=0&&this.trigger(e,{series:this.isBlazor?{}:this.series[o.series],point:this.series[o.series].points[o.point],seriesIndex:o.series,pointIndex:o.point,x:this.mouseX,y:this.mouseY,pageX:r.pageX,pageY:r.pageY})},o.prototype.accumulationRightClick=function(e){return 2!==e.buttons&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},o.prototype.accumulationMouseLeave=function(e){this.setMouseXY(e),this.trigger("chartMouseLeave",{target:e.target.id,x:this.mouseX,y:this.mouseY}),this.notify(t.Browser.isPointer?"pointerleave":"mouseleave",e);var i=document.getElementById(this.element.id+"PointHover_Border");return i&&(this.pieSeriesModule.removeBorder(i,1e3),i=null),!1},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.createPieSvg=function(){this.removeSvg(),He(this)},o.prototype.removeSvg=function(){if(this.redraw)return null;if(Ue(this),m(this.element.id+"_Secondary_Element"),this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}m("EJ2_legend_tooltip"),m("EJ2_datalabel_tooltip"),m(this.element.id+"PointHover_Border")},o.prototype.createSecondaryElement=function(){var e=Fe(this.redraw,this.element.id+"_Secondary_Element")||this.createElement("div",{id:this.element.id+"_Secondary_Element",styles:"position: relative"});be(!1,this.element,e,this.redraw)},o.prototype.calculateVisibleSeries=function(){this.visibleSeries=[];for(var e=0,t=this.series.length;e<t;e++)if(this.series[e].index=e,this.series[e].type===this.type&&0===this.visibleSeries.length){this.visibleSeries.push(this.series[e]);break}},o.prototype.processData=function(e){void 0===e&&(e=!0),this.seriesCounts=0;for(var t=0,i=this.visibleSeries;t<i.length;t++){var r=i[t];r.dataModule=new ar(r.dataSource||this.dataSource,r.query),r.refreshDataManager(this,e)}},o.prototype.refreshChart=function(){this.doGrouppingProcess(),this.createPieSvg(),this.calculateBounds(),this.renderElements(),m("chartmeasuretext")},o.prototype.doGrouppingProcess=function(){var e=this.visibleSeries[0];t.isNullOrUndefined(e.resultData)||t.isNullOrUndefined(e.lastGroupTo)||e.lastGroupTo===e.groupTo||e.getPoints(e.resultData,this)},o.prototype.calculateBounds=function(){this.initialClipRect=new i.Rect(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height),this.titleCollection=[],this.subTitleCollection=[];var e=0,t=0,r=0,o=0;if(this.titleCollection=Xe(this.title,this.titleStyle,this.initialClipRect.width),e=this.title?i.measureText(this.title,this.titleStyle).height*this.titleCollection.length:e,this.subTitle){for(var n=0,a=this.titleCollection;n<a.length;n++){var s=a[n];r=(o=i.measureText(s,this.titleStyle).width)>r?o:r}this.subTitleCollection=Xe(this.subTitle,this.subTitleStyle,r),t=i.measureText(this.subTitle,this.subTitleStyle).height*this.subTitleCollection.length}R(this.initialClipRect,new i.Rect(0,t+e,this.margin.right+this.margin.left,this.margin.bottom+this.margin.top)),this.calculateLegendBounds()},o.prototype.calculateLegendBounds=function(){if(!this.accumulationLegendModule||!this.legendSettings.visible)return null;this.accumulationLegendModule.getLegendOptions(this,this.visibleSeries),this.accumulationLegendModule.calculateLegendBounds(this.initialClipRect,this.availableSize,null)},o.prototype.renderElements=function(){this.renderBorder(),this.createSecondaryElement(),this.renderSeries(),this.renderTitle(),this.renderLegend(),be(!1,this.element,this.svgObject,this.redraw),this.processSelection(),this.processExplode(),this.renderAnnotation(),this.setSecondaryElementPosition(),t.updateBlazorTemplate(this.element.id+"_DataLabel","Template",this.series[0].dataLabel),this.trigger("loaded",{accumulation:this.isBlazor?{}:this,chart:this.isBlazor?{}:this}),this.animateSeries=!1},o.prototype.setSecondaryElementPosition=function(){var e=he(this.element.id+"_Secondary_Element");if(e){var t=this.element.getBoundingClientRect(),i=he(this.element.id+"_svg").getBoundingClientRect();e.style.left=Math.max(i.left-t.left,0)+"px",e.style.top=Math.max(i.top-t.top,0)+"px"}},o.prototype.renderAnnotation=function(){this.annotationModule&&this.annotationModule.renderAnnotations(he(this.element.id+"_Secondary_Element"))},o.prototype.processExplode=function(){return this.redraw?null:this.visibleSeries[0].explode?void this.accBaseModule.invokeExplode():null},o.prototype.renderSeries=function(){this.redraw||this.svgObject.appendChild(this.renderer.createGroup({id:this.element.id+"_SeriesCollection"}));for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];i.visible&&this[G(i.type)+"SeriesModule"]&&(this[G(i.type)+"SeriesModule"].initProperties(this,i),i.renderSeries(this,this.redraw))}},o.prototype.renderBorder=function(){var e=this.border.width;be(!1,this.svgObject,this.renderer.drawRectangle(new Di(this.element.id+"_border",this.background||this.themeStyle.background,this.border,1,new i.Rect(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e))),this.redraw);var t=this.backgroundImage;if(t){var r=new Bi(this.availableSize.height-e,this.availableSize.width-e,t,0,0,this.element.id+"_background","visible","none");be(!1,this.svgObject,this.renderer.drawImage(r),this.redraw)}},o.prototype.renderLegend=function(){if(!this.accumulationLegendModule||!this.legendSettings.visible)return null;this.accumulationLegendModule.legendCollections.length&&("Pie"===this.visibleSeries[0].type&&this.accumulationLegendModule.getSmartLegendLocation(this.visibleSeries[0].labelBound,this.accumulationLegendModule.legendBounds,this.margin),this.accumulationLegendModule.renderLegend(this,this.legendSettings,this.accumulationLegendModule.legendBounds,this.redraw))},o.prototype.processSelection=function(){if(!this.accumulationSelectionModule||"None"===this.selectionMode)return null;var e=t.extend([],this.accumulationSelectionModule.selectedDataIndexes,null,!0);this.accumulationSelectionModule.invokeSelection(this),e.length>0&&(this.accumulationSelectionModule.selectedDataIndexes=e,this.accumulationSelectionModule.redrawSelection(this))},o.prototype.renderTitle=function(){var e=this.margin;if(!this.title)return null;var t=this.titleStyle.textAlignment,r="Near"===t?"start":"Far"===t?"end":"middle",o=i.measureText(this.title,this.titleStyle),n=new i.Rect(e.left,0,this.availableSize.width-e.left-e.right,0),a=new i.TextOption(this.element.id+"_title",Ye(n,this.titleStyle),this.margin.top+3*o.height/4,r,this.titleCollection,"","auto"),s=Ve(this.renderer,a,this.titleStyle,this.titleStyle.color||this.themeStyle.chartTitle,this.svgObject,!1,this.redraw);s&&s.setAttribute("aria-label",this.title),this.subTitle&&this.renderSubTitle(a)},o.prototype.renderSubTitle=function(e){for(var t=0,r=0,o=this.titleStyle.textAlignment,n=i.measureText(this.subTitle,this.subTitleStyle),a=0,s=this.titleCollection;a<s.length;a++){var l=s[a];t=(r=i.measureText(l,this.titleStyle).width)>t?r:t}var h=new i.Rect("Center"===o?e.x-t/2:"Far"===o?e.x-t:e.x,0,t,0),c=new i.TextOption(this.element.id+"_subTitle",Ye(h,this.subTitleStyle),e.y*e.text.length+3*n.height/4+10,function(e){return"Near"===e?"start":"Far"===e?"end":"middle"}(this.subTitleStyle.textAlignment),this.subTitleCollection,"","auto");Ve(this.renderer,c,this.subTitleStyle,this.subTitleStyle.color||this.themeStyle.chartTitle,this.svgObject,!1,this.redraw)},o.prototype.getSeriesElement=function(){return this.svgObject.getElementsByTagName("g")[0]},o.prototype.refreshSeries=function(){for(var e=0,t=this.visibleSeries;e<t.length;e++){var i=t[e];this.refreshPoints(i.points)}},o.prototype.refreshPoints=function(e){for(var t=0,i=e;t<i.length;t++){var r=i[t];r.labelPosition=null,r.labelRegion=null,r.labelVisible=!0}},o.prototype.getModuleName=function(){return"accumulationchart"},o.prototype.destroy=function(){this.element&&(this.unWireEvents(),r.prototype.destroy.call(this),this.element.classList.remove("e-accumulationchart"),this.removeSvg(),this.svgObject=null)},o.prototype.requiredModules=function(){var e=[];return e.push({member:this.type+"Series",args:[this]}),this.legendSettings.visible&&e.push({member:"AccumulationLegend",args:[this]}),this.findDatalabelVisibility()&&e.push({member:"AccumulationDataLabel",args:[this]}),this.tooltip.enable&&e.push({member:"AccumulationTooltip",args:[this]}),"None"!==this.selectionMode&&e.push({member:"AccumulationSelection",args:[this]}),(this.enableExport||this.allowExport)&&e.push({member:"Export",args:[this]}),this.annotations.some(function(e){return null!==e.content})&&e.push({member:"Annotation",args:[this]}),e},o.prototype.findDatalabelVisibility=function(){for(var e=0,t=this.series;e<t.length;e++)if(t[e].dataLabel.visible)return!0;return!1},o.prototype.changeVisibleSeries=function(e,t){for(var i=0,r=e;i<r.length;i++){var o=r[i];if(t===o.index)return o}return null},o.prototype.getPersistData=function(){return""},o.prototype.onPropertyChanged=function(e,i){for(var o={refreshElements:!1,refreshBounds:!1},n=0,a=Object.keys(e);n<a.length;n++)switch(a[n]){case"theme":this.animateSeries=!0;break;case"title":case"subTitle":case"height":case"width":case"margin":o.refreshBounds=!0;break;case"titleStyle":e.titleStyle&&(e.titleStyle.size||e.titleStyle.textOverflow)?o.refreshBounds=!0:o.refreshElements=!0;break;case"subTitleStyle":e.subTitleStyle&&(e.subTitleStyle.size||e.subTitleStyle.textOverflow)?o.refreshBounds=!0:o.refreshElements=!0;break;case"legendSettings":o.refreshBounds=!0,o.refreshElements=!0;break;case"dataSource":this.processData(!1),o.refreshBounds=!0;break;case"series":if(!this.animateselected){for(var s=this.series.length,l=!1,h=void 0,c=void 0,d=0;d<s;d++)h=e.series[d],this.isBlazor&&(h.startAngle||h.endAngle||h.explodeOffset||h.neckHeight||h.neckWidth||h.radius||h.innerRadius||h.groupMode||h.emptyPointSettings)&&(c=!0),e.series[d]&&(e.series[d].dataSource||e.series[d].yName||e.series[d].xName||e.series[d].dataLabel||c)&&(t.extend(this.changeVisibleSeries(this.visibleSeries,d),h,null,!0),l=!0),e.series[d]&&e.series[d].explodeIndex&&e.series[d].explodeIndex!==i.series[d].explodeIndex&&(this.accBaseModule.explodePoints(e.series[d].explodeIndex,this),this.accBaseModule.deExplodeAll(e.series[d].explodeIndex,this.enableAnimation?300:0));l&&(this.processData(!1),o.refreshBounds=!0)}this.animateselected=!1,this.redraw=!1;break;case"locale":case"currencyCode":r.prototype.refresh.call(this);break;case"background":case"border":case"annotations":case"enableSmartLabels":o.refreshElements=!0;break;case"isMultiSelect":case"selectedDataIndexes":case"selectionMode":this.accumulationSelectionModule&&(t.isNullOrUndefined(this.accumulationSelectionModule.selectedDataIndexes)?this.accumulationSelectionModule.invokeSelection(this):this.accumulationSelectionModule.redrawSelection(this))}!o.refreshBounds&&o.refreshElements?(this.createPieSvg(),this.renderElements()):o.refreshBounds&&(this.refreshSeries(),this.createPieSvg(),this.calculateBounds(),this.renderElements())},ia([t.Property(null)],o.prototype,"width",void 0),ia([t.Property(null)],o.prototype,"height",void 0),ia([t.Property(null)],o.prototype,"title",void 0),ia([t.Property(null)],o.prototype,"backgroundImage",void 0),ia([t.Complex({},Un)],o.prototype,"center",void 0),ia([t.Property("")],o.prototype,"dataSource",void 0),ia([t.Complex(e.Theme.chartTitleFont,Xt)],o.prototype,"titleStyle",void 0),ia([t.Property(null)],o.prototype,"subTitle",void 0),ia([t.Complex(e.Theme.chartSubTitleFont,Xt)],o.prototype,"subTitleStyle",void 0),ia([t.Complex({},gr)],o.prototype,"legendSettings",void 0),ia([t.Complex({},ti)],o.prototype,"tooltip",void 0),ia([t.Property("None")],o.prototype,"selectionMode",void 0),ia([t.Property("None")],o.prototype,"highLightMode",void 0),ia([t.Property("None")],o.prototype,"selectionPattern",void 0),ia([t.Property("None")],o.prototype,"highlightPattern",void 0),ia([t.Property(!0)],o.prototype,"enableBorderOnMouseMove",void 0),ia([t.Property(!1)],o.prototype,"isMultiSelect",void 0),ia([t.Property(!0)],o.prototype,"enableAnimation",void 0),ia([t.Collection([],Qt)],o.prototype,"selectedDataIndexes",void 0),ia([t.Complex({},Ut)],o.prototype,"margin",void 0),ia([t.Property(!0)],o.prototype,"enableSmartLabels",void 0),ia([t.Complex({color:"#DDDDDD",width:0},Yt)],o.prototype,"border",void 0),ia([t.Property(null)],o.prototype,"background",void 0),ia([t.Collection([{}],qn)],o.prototype,"series",void 0),ia([t.Collection([{}],Gn)],o.prototype,"annotations",void 0),ia([t.Property("Material")],o.prototype,"theme",void 0),ia([t.Property(!1)],o.prototype,"useGroupingSeparator",void 0),ia([t.Property(!0)],o.prototype,"enableExport",void 0),ia([t.Property(!1)],o.prototype,"allowExport",void 0),ia([t.Event()],o.prototype,"loaded",void 0),ia([t.Event()],o.prototype,"load",void 0),ia([t.Event()],o.prototype,"seriesRender",void 0),ia([t.Event()],o.prototype,"legendRender",void 0),ia([t.Event()],o.prototype,"textRender",void 0),ia([t.Event()],o.prototype,"tooltipRender",void 0),ia([t.Event()],o.prototype,"pointRender",void 0),ia([t.Event()],o.prototype,"annotationRender",void 0),ia([t.Event()],o.prototype,"beforePrint",void 0),ia([t.Event()],o.prototype,"chartMouseMove",void 0),ia([t.Event()],o.prototype,"chartMouseClick",void 0),ia([t.Event()],o.prototype,"pointClick",void 0),ia([t.Event()],o.prototype,"pointMove",void 0),ia([t.Event()],o.prototype,"animationComplete",void 0),ia([t.Event()],o.prototype,"chartMouseDown",void 0),ia([t.Event()],o.prototype,"chartMouseLeave",void 0),ia([t.Event()],o.prototype,"chartMouseUp",void 0),ia([t.Event()],o.prototype,"beforeResize",void 0),ia([t.Event()],o.prototype,"resized",void 0),ia([t.Event()],o.prototype,"afterExport",void 0),ia([t.Property("USD")],o.prototype,"currencyCode",void 0),o=ia([t.NotifyPropertyChanges],o)}(t.Component),oa=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),na=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return oa(t,e),t.prototype.initProperties=function(e,t){var r=e.initialClipRect;t.triangleSize=new i.Size(Be(t.width,r.width),Be(t.height,r.height)),t.neckSize=new i.Size(Be(t.neckWidth,r.width),Be(t.neckHeight,r.height)),this.defaultLabelBound(t,t.dataLabel.visible,t.dataLabel.position,e),"30%"===t.explodeOffset&&(t.explodeOffset="25px"),e.explodeDistance=Be(t.explodeOffset,r.width);var o=t.points;this.initializeSizeRatio(o,t)},t.prototype.initializeSizeRatio=function(e,t,i){void 0===i&&(i=!1);for(var r=t.sumOfPoints,o=Math.min(Math.max(t.gapRatio,0),1),n=1/(r*(1+o/(1-o))),a=o/(e.length-1),s=0,l=e.length-1;l>=0;l--){var h=i?e.length-1-l:l;if(e[h].visible){var c=n*e[h].y;e[h].yRatio=s,e[h].heightRatio=c,s+=c+a}}},t.prototype.setLabelLocation=function(e,t,r){var o=r.length-1,n="Funnel"===e.type?r.length-2:r.length-1,a=(r[0].x+r[n].x)/2,s=(r[1].x+r[n-1].x)/2;t.region=new i.Rect(a,r[0].y,s-a,r[n].y-r[0].y),t.symbolLocation={x:t.region.x+t.region.width/2,y:t.region.y+t.region.height/2},t.labelOffset={x:t.symbolLocation.x-(r[0].x+r[o].x)/2,y:t.symbolLocation.y-(r[0].y+r[o].y)/2}},t.prototype.findPath=function(e){for(var t="M",i=0;i<e.length;i++)t+=e[i].x+" "+e[i].y,i!==e.length-1&&(t+=" L");return t},t.prototype.defaultLabelBound=function(e,t,r,o){var n=(o.initialClipRect.width-e.triangleSize.width)/2,a=(o.initialClipRect.height-e.triangleSize.height)/2,s=new i.Rect(n,a,e.triangleSize.width,e.triangleSize.height);e.labelBound=new i.Rect(s.x,s.y,s.width+s.x,s.height+s.y),e.accumulationBound=s,t&&"Outside"===r&&(e.labelBound=new i.Rect(1/0,1/0,-1/0,-1/0))},t}(Qn),aa=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return aa(t,e),t.prototype.getSegmentData=function(e,t,i){var r,o,n,a,s,l,h,c,d=t.triangleSize,p=(i.initialClipRect.width-t.triangleSize.width)/2+i.initialClipRect.x,u=i.initialClipRect.y+(i.initialClipRect.height-d.height)/2,g=e.yRatio*d.height,y=g+e.heightRatio*d.height,m=t.neckSize;r=m.width+(d.width-m.width)*((d.height-m.height-g)/(d.height-m.height)),a=(o=d.width/2-r/2)+r,r=y>d.height-m.height||d.height===m.height?m.width:m.width+(d.width-m.width)*((d.height-m.height-y)/(d.height-m.height)),s=(n=d.width/2-r/2)+r,g>=d.height-m.height?(o=n=l=d.width/2-m.width/2,a=s=h=d.width/2+m.width/2):y>d.height-m.height&&(h=s=(l=n=d.width/2-r/2)+r,c=d.height-m.height);var v={x:p+0+o,y:g+=u},f={x:p+0+a,y:g},b={x:p+0+s,y:y+=u},x={x:p+0+n,y:y},w={x:p+0+s,y:y},S={x:p+0+n,y:y};(c+=u)&&(w={x:p+0+h,y:c},S={x:p+0+l,y:c});var C=[v,f,w,b,x,S];return this.setLabelLocation(t,e,C),this.findPath(C)},t.prototype.renderPoint=function(e,t,i,r,o,n){if(!e.visible)return m(r.id),null;var a=this.getSegmentData(e,t,i);e.midAngle=0,r.d=a,be(!1,o,i.renderer.drawPath(r),n),e.isExplode&&i.accBaseModule.explodePoints(e.index,i,!0)},t.prototype.getModuleName=function(){return"FunnelSeries"},t.prototype.destroy=function(){},t}(na),la=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ha=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return la(t,e),t.prototype.getSegmentData=function(e,t,i){var r=t.triangleSize,o=i.initialClipRect.y+(i.initialClipRect.height-r.height)/2,n=(i.initialClipRect.width-t.triangleSize.width)/2+i.initialClipRect.x,a=e.yRatio,s=e.yRatio+e.heightRatio,l=.5*(1-e.yRatio),h=.5*(1-s);a+=o/r.height,s+=o/r.height;var c=[{x:n+0+l*r.width,y:a*r.height},{x:n+0+(1-l)*r.width,y:a*r.height},{x:n+0+(1-h)*r.width,y:s*r.height},{x:n+0+h*r.width,y:s*r.height}];return this.setLabelLocation(t,e,c),this.findPath(c)},t.prototype.initializeSizeRatio=function(t,i){"Linear"===i.pyramidMode?e.prototype.initializeSizeRatio.call(this,t,i,!0):this.calculateSurfaceSegments(i)},t.prototype.calculateSurfaceSegments=function(e){for(var t=e.points.length,i=e.sumOfPoints,r=[],o=[],n=Math.min(0,Math.max(e.gapRatio,1))/(t-1),a=this.getSurfaceHeight(0,i),s=0,l=0;l<t;l++)e.points[l].visible&&(r[l]=s,o[l]=this.getSurfaceHeight(s,Math.abs(e.points[l].y)),s+=o[l]+n*a);for(var h=1/(s-n*a),l=0;l<t;l++)e.points[l].visible&&(e.points[l].yRatio=h*r[l],e.points[l].heightRatio=h*o[l])},t.prototype.getSurfaceHeight=function(e,t){return this.solveQuadraticEquation(1,2*e,-t)},t.prototype.solveQuadraticEquation=function(e,t,i){var r,o,n=t*t-4*e*i;if(n>=0){var a=Math.sqrt(n);return r=(-t-a)/(2*e),o=(-t+a)/(2*e),Math.max(r,o)}return 0},t.prototype.renderPoint=function(e,t,r,o,n,a){if(!e.visible)return i.removeElement(o.id),null;o.d=this.getSegmentData(e,t,r),e.midAngle=0,be(!1,n,r.renderer.drawPath(o),a),e.isExplode&&r.accBaseModule.explodePoints(e.index,r,!0)},t.prototype.getModuleName=function(){return"PyramidSeries"},t.prototype.destroy=function(){},t}(na),ca=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),da=function(e){function r(t){var r=e.call(this,t)||this;return r.library=r,r.titleRect=new i.Rect(0,t.margin.top,0,0),r}return ca(r,e),r.prototype.getLegendOptions=function(e,i){this.legendCollections=[];for(var r=0;r<1;r++){var o=i[r].type;"Pie"!==o&&"Doughnut"!==o||(o="0"!==i[r].innerRadius&&"0%"!==i[r].innerRadius?"Doughnut":"Pie");for(var n=0,a=i[r].points;n<a.length;n++){var s=a[n];t.isNullOrUndefined(s.x)||t.isNullOrUndefined(s.y)||this.legendCollections.push(new mr(s.x.toString(),s.color,i[r].legendShape,s.visible,o,s.legendImageUrl,null,null,s.index,i[r].index))}}},r.prototype.getLegendBounds=function(e,t,r){this.calculateLegendTitle(r,t),this.isTitle=!!r.title;var o=0,n=0,a=r.padding,s=r.titlePosition,l=0,h=this.arrowWidth,c=r.enablePages?0:this.arrowHeight;this.isVertical?o=r.width?0:e.width/100*5:n=r.height?0:e.height/100*5,t.width+=o,t.height+=n;var d=r.shapePadding,p=0,u=r.shapeWidth,g=0,y=0,m=[],v=0,f=0,b=0;this.maxItemHeight=Math.max(i.measureText("MeasureText",r.textStyle).height,r.shapeHeight);for(var x,w=!1,S=0,C=this.legendCollections;S<C.length;S++){var P=C[S];x={fill:P.fill,text:P.text,shape:P.shape,name:"legendRender",cancel:!1},this.chart.trigger("legendRender",x),P.render=!x.cancel,P.text=x.text.indexOf("&")>-1?this.convertHtmlEntities(x.text):x.text,P.fill=x.fill,P.shape=x.shape,P.textSize=i.measureText(P.text,r.textStyle),P.render&&""!==P.text&&(w=!0,f=u+d+P.textSize.width+a,this.isVertical?(v=++y*(this.maxItemHeight+a)+a+this.legendTitleSize.height+c,y*(this.maxItemHeight+a)+a+c>t.height&&(v=Math.max(v,y*(this.maxItemHeight+a)+a+c),g+=p,m.push(p),this.totalPages=Math.max(y,this.totalPages||1),p=0,y=1),p=Math.max(f,p)):(r.enablePages||(l=this.isTitle&&"Top"!==s?this.legendTitleSize.width+this.fivePixel:0,l+=h),g+=f,t.width<a+g+l&&(p=Math.max(p,g+a+l-f),0===y&&f!==g&&(y=1),g=f,v=++y*(this.maxItemHeight+a)+a+this.legendTitleSize.height)))}b="Top"===s?this.legendTitleSize.height:0,this.isVertical?(g+=p,this.isPaging=t.width<g+a,v=Math.max(v,(this.totalPages||1)*(this.maxItemHeight+a)+a+c),this.isPaging=this.isPaging&&this.totalPages>1,m[m.length-1]!==p&&m.push(p)):(this.isPaging=t.height<v,v=!r.enablePages&&this.isPaging?this.maxItemHeight+a+a+b:v,this.totalPages=this.totalRowCount=y,v=Math.max(v,this.maxItemHeight+a+a+b),this.isPaging||(g+=this.isTitle&&"Top"!==s?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0)),this.maxColumns=0;var L=this.isVertical?this.getMaxColumn(m,t.width,a,g+a):Math.max(g+a,p);w?this.setBounds(L,v,r,t):this.setBounds(0,0,r,t)},r.prototype.convertHtmlEntities=function(e){var t=e.replace("&","&").replace("<","<").replace(">",">").replace(""",'"').replace(" "," ").replace("¢","¢").replace("£","£").replace("¥","¥").replace("€","€").replace("©","©").replace("®","®");return t=t.replace("&","&").replace("<","<").replace(">",">").replace(""",'"').replace(" "," ").replace("¢","¢").replace("£","£").replace("¥","¥").replace("€","€").replace("©","©").replace("®","®")},r.prototype.getMaxColumn=function(e,t,i,r){var o=i;this.maxColumnWidth=Math.max.apply(null,e);for(var n=0,a=e;n<a.length;n++){a[n];if(o+=this.maxColumnWidth,this.maxColumns++,o+i>t){o-=this.maxColumnWidth,this.maxColumns--;break}}return this.isPaging=o<r&&this.totalPages>1,o===i&&(o=t),this.maxColumns=Math.max(1,this.maxColumns),this.maxWidth=o,o},r.prototype.getAvailWidth=function(e,t){return this.isVertical&&(t=this.maxWidth),t-(2*this.legend.padding+this.legend.shapeWidth+this.legend.shapePadding)},r.prototype.getRenderPoint=function(e,t,i,r,o,n,a){var s=this.legend.padding;if(this.isVertical)n===a||r.location.y+1.5*this.maxItemHeight+2*s>o.y+o.height?(e.location.x=r.location.x+(n===a?0:this.maxColumnWidth),e.location.y=t.y,this.pageXCollections.push(e.location.x-this.legend.shapeWidth/2-s),this.totalPages++):(e.location.x=r.location.x,e.location.y=r.location.y+this.maxItemHeight+s);else{var l=r.location.x+i+r.textSize.width;l+(e.textSize.width+i)>o.x+o.width+this.legend.shapeWidth/2?(e.location.y=n===a?r.location.y:r.location.y+this.maxItemHeight+s,e.location.x=t.x):(e.location.y=r.location.y,e.location.x=n===a?r.location.x:l),this.totalPages=this.totalRowCount}var h=this.getAvailWidth(e.location.x,this.legendBounds.width);e.text=ze(+h.toFixed(4),e.text,this.legend.textStyle)},r.prototype.getSmartLegendLocation=function(e,t,i){var r;switch(this.position){case"Left":r=(e.x-t.width-i.left)/2,t.x=e.x-t.width<i.left?t.x:e.x-t.width-r;break;case"Right":r=(this.chart.availableSize.width-i.right-(e.x+e.width+t.width))/2,t.x=e.x+e.width+t.width>this.chart.availableSize.width-i.right?t.x:e.x+e.width+r;break;case"Top":this.getTitleRect(this.chart),r=(e.y-t.height-(this.titleRect.y+this.titleRect.height))/2,t.y=e.y-t.height<i.top?t.y:e.y-t.height-r;break;case"Bottom":r=(this.chart.availableSize.height-i.bottom-(e.y+e.height+t.height))/2,t.y=e.y+e.height+t.height>this.chart.availableSize.height-i.bottom?t.y:e.y+e.height+r}},r.prototype.getTitleRect=function(e){if(!e.title)return null;var t=i.measureText(e.title,e.titleStyle);this.titleRect=new i.Rect(e.availableSize.width/2-t.width/2,e.margin.top,t.width,t.height)},r.prototype.legendByIndex=function(e,t){for(var i=0,r=t;i<r.length;i++){var o=r[i];if(o.pointIndex===e)return o}return null},r.prototype.click=function(e){var i=e.target.id,r=this.chart,o=[this.legendID+"_text_",this.legendID+"_shape_",this.legendID+"_shape_marker_"];if(this.chart.accumulationSelectionModule)t.extend([],this.chart.accumulationSelectionModule.selectedDataIndexes,null,!0);this.chart.animateSeries=!1;for(var n=0,a=o;n<a.length;n++){var s=a[n];if(i.indexOf(s)>-1){var l=parseInt(i.split(s)[1],10);if(this.chart.legendSettings.toggleVisibility&&!isNaN(l)){var h=this.chart.visibleSeries[0],c=et(l,h.points),d=this.legendByIndex(l,this.legendCollections);c.visible=!c.visible,d.visible=c.visible,h.sumOfPoints+=c.visible?c.y:-c.y,r.redraw=r.enableAnimation,this.sliceVisibility(l,c.visible),r.removeSvg(),Ue(r),this.chart.refreshPoints(h.points),this.chart.renderElements()}else this.chart.accumulationSelectionModule&&!isNaN(l)&&this.chart.accumulationSelectionModule.legendSelection(this.chart,0,l)}}i.indexOf(this.legendID+"_pageup")>-1?this.changePage(e,!0):i.indexOf(this.legendID+"_pagedown")>-1&&this.changePage(e,!1),r.redraw=!1},r.prototype.sliceVisibility=function(e,t){var i=this.chart.element.id+"_Series_0_Point_";this.chart.visibleSeries[0].dataLabel.visible&&(i=this.chart.element.id+"_datalabel_Series_0_",this.sliceAnimate(he(i+"g_"+e),t))},r.prototype.sliceAnimate=function(e,i){if(!e)return null;new t.Animation({}).animate(e,{duration:300,delay:0,name:i?"FadeIn":"FadeOut",end:function(e){e.element.style.visibility=i?"visible":"hidden"}})},r.prototype.getModuleName=function(){return"AccumulationLegend"},r.prototype.destroy=function(){},r}(yr),pa=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ua=function(e){function r(t){var r=e.call(this,t)||this;if(r.rightSideRenderingPoints=[],r.leftSideRenderingPoints=[],r.id=t.element.id+"_datalabel_Series_",t.title){var o=i.measureText(t.title,t.titleStyle);r.titleRect=new i.Rect(t.availableSize.width/2-o.width/2,t.margin.top,o.width,o.height)}return r}return pa(r,e),r.prototype.getDataLabelPosition=function(e,t,i,r){var o=this.isCircular()?this.isVariousRadius()?this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],e):this.accumulation.pieSeriesModule.labelRadius:this.getLabelDistance(e,t);this.getLabelRegion(e,t.position,i,o,this.marginValue),e.labelAngle=e.midAngle,e.labelPosition=t.position,this.accumulation.enableSmartLabels&&this.getSmartLabel(e,t,i,r)},r.prototype.getLabelRegion=function(e,t,r,o,n,a){void 0===a&&(a=0);var s=a||e.midAngle,l=M(s,o,this.isCircular()?this.center:this.getLabelLocation(e,t));l.y="Inside"===t?l.y-r.height/2:l.y,l.x="Inside"===t?l.x-r.width/2:l.x,e.labelRegion=new i.Rect(l.x,l.y,r.width+2*n,r.height+2*n),"Outside"===t&&(e.labelRegion.y-=e.labelRegion.height/2,s>=90&&s<=270?e.labelRegion.x-=e.labelRegion.width+10:e.labelRegion.x+=10)},r.prototype.getSmartLabel=function(e,t,r,o){var n=this.isCircular(),a=n?this.radius:this.getLabelDistance(e,t);a+=Be(n?t.connectorStyle.length||"4%":"0px",a);var s=this.findPreviousPoint(o,e.index,e.labelPosition);if("Inside"===t.position?(s&&s.labelRegion&&(Le(e.labelRegion,s.labelRegion)||this.isOverlapping(e,o))||!n&&!Re(e.region,e.labelRegion))&&(e.labelPosition="Outside",n||(a=this.getLabelDistance(e,t)),this.getLabelRegion(e,e.labelPosition,r,a,this.marginValue),(s=this.findPreviousPoint(o,e.index,e.labelPosition))&&(Le(e.labelRegion,s.labelRegion)||this.isConnectorLineOverlapping(e,s))&&this.setOuterSmartLabel(s,e,t.border.width,a,r,this.marginValue)):s&&s.labelRegion&&(Le(e.labelRegion,s.labelRegion)||this.isOverlapping(e,o)||this.isConnectorLineOverlapping(e,s))&&this.setOuterSmartLabel(s,e,t.border.width,a,r,this.marginValue),this.isOverlapping(e,o)&&("Pyramid"===this.accumulation.type||"Funnel"===this.accumulation.type)){var l=e.midAngle||0,h=n?this.radius:this.getLabelDistance(e,t),c=M(l,-h,this.isCircular()?this.center:this.getLabelLocation(e,"OutsideLeft"));e.labelRegion=new i.Rect(c.x,c.y,r.width+2*this.marginValue,r.height+2*this.marginValue),e.labelRegion.y-=e.labelRegion.height/2,e.labelRegion.x=e.labelRegion.x-10-e.labelRegion.width,s&&s.labelRegion&&(Le(e.labelRegion,s.labelRegion)||this.isOverlapping(e,o)||this.isConnectorLineOverlapping(e,s))&&this.setOuterSmartLabel(s,e,t.border.width,h,r,this.marginValue)}},r.prototype.move=function(e,t,i,r){var o=this;if(e.target.textContent.indexOf("...")>-1){var n=e.target.id.split(this.id);if(2===n.length){var a=parseInt(n[1].split("_text_")[0],10),s=parseInt(n[1].split("_text_")[1],10);if(!isNaN(a)&&!isNaN(s)){r&&m(this.accumulation.element.id+"_EJ2_Datalabel_Tooltip");var l=Ke(a,this.accumulation.visibleSeries).points[s];f(l.text||l.y.toString(),t,i,this.areaRect.width,this.accumulation.element.id+"_EJ2_Datalabel_Tooltip",he(this.accumulation.element.id+"_Secondary_Element"))}}}else m(this.accumulation.element.id+"_EJ2_Datalabel_Tooltip");r&&(clearTimeout(this.clearTooltip),this.clearTooltip=+setTimeout(function(){m(o.accumulation.element.id+"_EJ2_Datalabel_Tooltip")},1e3))},r.prototype.findPreviousPoint=function(e,t,i){for(var r=e[0],o=t-1;o>=0;o--)if((r=e[o]).visible&&r.labelVisible&&r.labelRegion&&r.labelPosition===i)return r;return null},r.prototype.isOverlapping=function(e,t){for(var i=e.index-1;i>=0;i--)if(t[i].visible&&t[i].labelVisible&&t[i].labelRegion&&e.labelRegion&&e.labelVisible&&Le(e.labelRegion,t[i].labelRegion))return!0;return!1},r.prototype.textTrimming=function(e,t,i,r){if(Le(e.labelRegion,t)){var o=e.labelRegion.width;"Right"===r?o=t.x-e.labelRegion.x:"Left"===r?(o=e.labelRegion.x-(t.x+t.width))<0&&(o+=e.labelRegion.width,e.labelRegion.x=t.x+t.width):"InsideRight"===r?o=t.x+t.width-e.labelRegion.x:"InsideLeft"===r?(o=e.labelRegion.x+e.labelRegion.width-t.x)<e.labelRegion.width&&(e.labelRegion.x=t.x):this.setPointVisibileFalse(e),e.labelVisible&&e.labelRegion&&(o<e.labelRegion.width&&(e.label=ze(o-2*this.marginValue,e.label,i),e.labelRegion.width=o),3===e.label.length&&e.label.indexOf("...")>-1&&this.setPointVisibileFalse(e))}},r.prototype.setPointVisibileFalse=function(e){e.labelVisible=!1,e.labelRegion=null},r.prototype.setPointVisibleTrue=function(e){e.labelVisible=!0},r.prototype.setOuterSmartLabel=function(e,t,i,r,o,n){if(this.isCircular()){var a=this.getOverlappedAngle(e.labelRegion,t.labelRegion,t.midAngle,2*i);for(this.getLabelRegion(t,"Outside",o,r,n,a),a>t.endAngle&&(a=t.midAngle),t.labelAngle=a;t.labelVisible&&(Le(e.labelRegion,t.labelRegion)||a<=e.labelAngle||this.isConnectorLineOverlapping(t,e))&&!(a>t.endAngle);)t.labelAngle=a,this.getLabelRegion(t,"Outside",o,r,n,a),a+=.1}else this.setSmartLabelForSegments(t,e)},r.prototype.setSmartLabelForSegments=function(e,t){var i=e.labelRegion,r="Funnel"===this.accumulation.type?t.labelRegion.y-(i.y+i.height):e.labelRegion.y-(t.labelRegion.y+t.labelRegion.height);r<0&&(e.labelRegion.y+="Funnel"===this.accumulation.type?r:-r)},r.prototype.isConnectorLineOverlapping=function(e,t){var i;!this.isCircular()&&e.labelRegion.x<e.region.x&&(i="outsideLeft");var r=this.getLabelLocation(e,i),o=new Vi(0,0);this.getEdgeOfLabel(e.labelRegion,e.labelAngle,o,0,e);var n=this.getLabelLocation(t),a=new Vi(0,0);return this.getEdgeOfLabel(t.labelRegion,t.labelAngle,a,0,e),this.isLineRectangleIntersect(r,o,e.labelRegion)||this.isLineRectangleIntersect(r,o,t.labelRegion)||this.isLineRectangleIntersect(n,a,e.labelRegion)},r.prototype.isLineRectangleIntersect=function(e,t,i){var r=[new Vi(Math.round(i.x),Math.round(i.y)),new Vi(Math.round(i.x+i.width),Math.round(i.y)),new Vi(Math.round(i.x+i.width),Math.round(i.y+i.height)),new Vi(Math.round(i.x),Math.round(i.y+i.height))];e.x=Math.round(e.x),e.y=Math.round(e.y),t.x=Math.round(t.x),t.y=Math.round(t.y);for(var o=0;o<r.length;o++)if(this.isLinesIntersect(e,t,r[o],r[(o+1)%r.length]))return!0;return!1},r.prototype.isLinesIntersect=function(e,t,i,r){var o=t.y-e.y,n=e.x-t.x,a=o*e.x+n*e.y,s=r.y-i.y,l=i.x-r.x,h=s*i.x+l*i.y,c=o*l-s*n;if(0!==c){var d=(l*a-n*h)/c,p=(o*h-s*a)/c,u=Math.min(e.x,t.x)<=d&&d<=Math.max(e.x,t.x);return u=u&&Math.min(e.y,t.y)<=p&&p<=Math.max(e.y,t.y),u=u&&Math.min(i.x,r.x)<=d&&d<=Math.max(i.x,r.x),u=u&&Math.min(i.y,r.y)<=p&&p<=Math.max(i.y,r.y)}return!1},r.prototype.getOverlappedAngle=function(e,t,i,r){var o=e.x;return i>=90&&i<=270?(t.y=e.y-(r+t.height/2),o=e.x+e.width):t.y=e.y+e.height+r,O(this.center,new Vi(o,t.y))},r.prototype.getConnectorPath=function(e,t,i,r){void 0===r&&(r=0);var o=i.connectorStyle,n=this.isCircular()?this.isVariousRadius()?this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],t):this.labelRadius:this.getLabelDistance(t,i),a=this.getConnectorStartPoint(t,o),s=this.accumulation.enableSmartLabels?t.midAngle:r||t.midAngle,l=new Vi(0,0),h=this.getEdgeOfLabel(e,s,l,o.width,t);if("Curve"===o.type){if(this.isCircular()){var c=n-(this.isVariousRadius()?Be(t.sliceRadius,this.accumulation.pieSeriesModule.seriesRadius):this.radius);return t.isLabelUpdated?l=this.getPerpendicularDistance(a,t):(l=M(s,n-c/2,this.center),"Outside"===t.labelPosition&&"Inside"===i.position&&(l=M(s,n-1.25*c,this.center))),"M "+a.x+" "+a.y+" Q "+l.x+" "+l.y+" "+h.x+" "+h.y}return this.getPolyLinePath(a,h)}return"M "+a.x+" "+a.y+" L "+l.x+" "+l.y+" L "+h.x+" "+h.y},r.prototype.getPolyLinePath=function(e,t){var i=[e,t];if(e.y===t.y)return"M "+e.x+" "+e.y+" L "+t.x+" "+t.y;for(var r="M",o=0;o<=16;o++){var n=o/16,a=this.getBezierPoint(n,i,0,2);r+=a.x+","+a.y,16!==o&&(r+=" L")}return r},r.prototype.getBezierPoint=function(e,t,i,r){if(1===r)return t[i];var o=this.getBezierPoint(e,t,i,r-1),n=this.getBezierPoint(e,t,i+1,r-1),a=(o.x,o.x),s=(o.y,o.y),l=(1-e)*a+e*(n.x,n.x),h=(1-e)*s+e*(n.y,n.y);return o.x,{x:l,y:h}},r.prototype.getEdgeOfLabel=function(e,t,i,r,o){void 0===r&&(r=1);var n=new Vi(e.x,e.y);return t>=90&&t<=270?(n.x+=e.width+r/2,n.y+=e.height/2,i.x=n.x+10,i.y=n.y):o&&o.region&&o.region.x>o.labelRegion.x?(n.x+=2*r+e.width,n.y+=e.height/2,i.x=n.x+10,i.y=n.y):(n.x-=r/2,n.y+=e.height/2,i.x=n.x-10,i.y=n.y),n},r.prototype.getLabelDistance=function(e,t){if(e.labelPosition&&t.position!==e.labelPosition||t.connectorStyle.length){var i=Be(t.connectorStyle.length||"70px",this.accumulation.initialClipRect.width);if(i<this.accumulation.initialClipRect.width)return i}var r,o=e.labelPosition||t.position,n=this.accumulation.visibleSeries[0],a=(this.accumulation.initialClipRect.width-n.triangleSize.width)/2;switch(o){case"Inside":return 0;case"Outside":return r=e.symbolLocation.x+e.labelOffset.x,this.accumulation.initialClipRect.width-r-a}},r.prototype.getLabelLocation=function(e,t){if(void 0===t&&(t="Outside"),"Pie"!==this.accumulation.type){t="OutsideLeft"===t?"OutsideLeft":e.labelPosition||t;var i={x:e.symbolLocation.x,y:e.symbolLocation.y-e.labelOffset.y};switch(t){case"Inside":i.y=e.region.y+e.region.height/2;break;case"Outside":i.x+=e.labelOffset.x;break;case"OutsideLeft":i.x-=e.labelOffset.x}return i}return M(e.midAngle,this.isVariousRadius()?Be(e.sliceRadius,this.accumulation.pieSeriesModule.seriesRadius):this.radius,this.center)},r.prototype.getConnectorStartPoint=function(e,t){var i;return!this.isCircular()&&e.region.x>e.labelRegion.x&&(i="OutsideLeft"),this.isCircular()?M(e.midAngle,(this.isVariousRadius()?Be(e.sliceRadius,this.accumulation.pieSeriesModule.seriesRadius):this.radius)-t.width,this.center):this.getLabelLocation(e,i)},r.prototype.findAreaRect=function(){this.areaRect=new i.Rect(0,0,this.accumulation.availableSize.width,this.accumulation.availableSize.height);var e=this.accumulation.margin;L(this.areaRect,new Hi(e.left,e.right,e.top,e.bottom))},r.prototype.renderDataLabel=function(e,i,r,o,n,a,s){var l=this.accumulation.element.id+"_datalabel_Series_"+n+"_",h=this.accumulation.renderer.createGroup({id:l+"g_"+e.index});e.label=e.originalText||e.y.toString();var c={width:i.border.width,color:i.border.color},d=t.extend({},t.getValue("properties",i.font),null,!0),p={cancel:!1,name:"textRender",series:this.accumulation.visibleSeries[0],point:e,text:e.label,border:c,color:i.fill,template:i.template,font:d};this.accumulation.trigger("textRender",p),e.argsData=p;var u=null!==p.template;e.labelVisible=!p.cancel,e.text=e.label=p.text,Number(e.label)&&(e.label=this.accumulation.intl.formatNumber(+e.label,{useGrouping:this.accumulation.useGroupingSeparator})),this.marginValue=p.border.width?5+p.border.width:1;var g=t.createElement("div",{id:this.accumulation.element.id+"_Series_0_DataLabel_"+e.index,styles:"position: absolute;background-color:"+p.color+";"+ge(i.font)+";border:"+p.border.width+"px solid "+p.border.color+";"});this.calculateLabelSize(u,g,e,o,p,h,l,i,s)},r.prototype.calculateLabelSize=function(e,t,r,o,n,a,s,l,h,c,d){var p=e?d?{width:c.width,height:c.height}:this.getTemplateSize(t,r,n,h,e,o,a,s,l):i.measureText(r.label,l.font);p.height+=4,p.width+=4,r.textSize=p,r.templateElement=t,this.getDataLabelPosition(r,l,p,o),r.labelRegion&&this.correctLabelRegion(r.labelRegion,r.textSize)},r.prototype.drawDataLabels=function(e,r,o,n,a){var s,l,h=e.leftSidePoints.concat(e.rightSidePoints);h.sort(function(e,t){return e.index-t.index}),"Pie"===e.type&&this.accumulation.enableSmartLabels&&this.extendedLabelsCalculation();for(var c=0,d=h;c<d.length;c++){var p=d[c];if(!t.isNullOrUndefined(p.argsData)&&!t.isNullOrUndefined(p.y)){this.finalizeDatalabels(p,h,r);var u=this.accumulation.element.id+"_datalabel_Series_0_",g=this.accumulation.renderer.createGroup({id:u+"g_"+p.index}),y=void 0,m=void 0;if(p.visible&&p.labelVisible){if(s=l=r.angle,p.argsData.template)this.setTemplateStyle(p.templateElement,p,n,r.font.color,p.color,a);else{y=new Vi(p.labelRegion.x+this.marginValue,p.labelRegion.y+3*p.textSize.height/4+this.marginValue);var v=(m=he(u+"shape_"+p.index))?new Vi(+m.getAttribute("x"),+m.getAttribute("y")):null;be(!1,g,this.accumulation.renderer.drawRectangle(new Di(u+"shape_"+p.index,p.argsData.color,p.argsData.border,1,p.labelRegion,r.rx,r.ry)),a,!0,"x","y",v,null,!1,!1,null,this.accumulation.duration);var f=p.textSize.width,b=p.textSize.height,x=void 0;x=0!==s&&r.enableRotation?"rotate("+(l="Outside"===p.labelPosition?0:p.midAngle>=90&&p.midAngle<=270?p.midAngle+180:p.midAngle)+","+(y.x+f/2)+","+(y.y-b/4)+")":"rotate("+(l=s?s>360?s-360:s<-360?s+360:s:0)+","+(y.x+f/2)+","+y.y+")",p.transform=x,Ve(this.accumulation.renderer,new i.TextOption(u+"text_"+p.index,y.x,y.y,"start",p.label,x,"auto",l),p.argsData.font,p.argsData.font.color||this.getSaturatedColor(p,p.argsData.color),g,!1,a,!0,!1,this.accumulation.duration),m=null}if(this.accumulation.accumulationLegendModule&&("Outside"===r.position||this.accumulation.enableSmartLabels)&&this.accumulation.visibleSeries[0].findMaxBounds(this.accumulation.visibleSeries[0].labelBound,p.labelRegion),"Outside"===p.labelPosition){var w=he(u+"connector_"+p.index),S=w?w.getAttribute("d"):"";be(!1,g,this.accumulation.renderer.drawPath(new i.PathOption(u+"connector_"+p.index,"transparent",r.connectorStyle.width,r.connectorStyle.color||p.color,1,r.connectorStyle.dashArray,this.getConnectorPath(t.extend({},p.labelRegion,null,!0),p,r,p.labelAngle))),a,!0,null,null,null,S,!1,!1,null,this.accumulation.duration)}be(!1,o,g,a)}}}},r.prototype.finalizeDatalabels=function(e,t,r){if((this.isOverlapping(e,t)||this.titleRect&&e.labelRegion&&Le(e.labelRegion,this.titleRect))&&this.isCircular()&&"Outside"===e.labelPosition&&this.setPointVisibileFalse(e),this.accumulation.accumulationLegendModule&&e.labelVisible&&e.labelRegion){var o=this.accumulation.accumulationLegendModule.legendBounds,n=this.accumulation.legendSettings.border.width/2;this.textTrimming(e,new i.Rect(o.x-n,o.y-n,o.width+2*n,o.height+2*n),r.font,this.accumulation.accumulationLegendModule.position)}if(e.labelVisible&&e.labelRegion){var a=this.isCircular()?e.labelRegion.x>=this.center.x?"InsideRight":"InsideLeft":e.labelRegion.x>=e.region.x?"InsideRight":"InsideLeft";this.textTrimming(e,this.areaRect,r.font,a)}e.labelVisible&&e.labelRegion&&(e.labelRegion.y+e.labelRegion.height>this.areaRect.y+this.areaRect.height||e.labelRegion.y<this.areaRect.y||e.labelRegion.x<this.areaRect.x||e.labelRegion.x+e.labelRegion.width>this.areaRect.x+this.areaRect.width)&&this.setPointVisibileFalse(e)},r.prototype.getTemplateSize=function(e,t,i,r,o,n,a,s,l){var h=ye(e=ue(e,t.index,i.template,this.accumulation,t,this.accumulation.visibleSeries[0],this.accumulation.element.id+"_DataLabel",0,i,o,n,a,s,l,r),r);return{width:h.width,height:h.height}},r.prototype.setTemplateStyle=function(e,t,i,r,o,n){if(e.style.left=t.labelRegion.x+"px",e.style.top=t.labelRegion.y+"px",e.style.color=r||this.getSaturatedColor(t,o),this.accumulation.isBlazor){var a=this.isCircular()?t.labelRegion.x>=this.center.x?"InsideRight":"InsideLeft":t.labelRegion.x>=t.region.x?"InsideRight":"InsideLeft";e.style.transform="InsideRight"===a?"translate(0%, -50%)":"translate(-100%, -50%)"}e.childElementCount&&(be(!1,i,e,n,!0,"left","top"),this.doTemplateAnimation(this.accumulation,e))},r.prototype.getSaturatedColor=function(e,t){var i,r=Te(_e(i="transparent"===(i=this.marginValue>=1?"transparent"===t?this.getLabelBackground(e):t:this.getLabelBackground(e))?window.getComputedStyle(document.body,null).backgroundColor:i));return Math.round((299*r.r+587*r.g+114*r.b)/1e3)>=128?"black":"white"},r.prototype.doTemplateAnimation=function(e,t){var i=e.visibleSeries[0],r=i.animation.delay+i.animation.duration;i.animation.enable&&e.animateSeries&&(t.style.visibility="hidden",oe(t,r,200,"ZoomIn"))},r.prototype.getLabelBackground=function(e){return"Outside"===e.labelPosition?this.accumulation.background||this.accumulation.themeStyle.background:e.color},r.prototype.correctLabelRegion=function(e,t,i){void 0===i&&(i=4),e.height-=i,e.width-=i,e.x+=i/2,e.y+=i/2,t.height-=i,t.width-=i},r.prototype.getModuleName=function(){return"AccumulationDataLabel"},r.prototype.destroy=function(){},r.prototype.extendedLabelsCalculation=function(){var e=this,t=this.accumulation.series[0];t.rightSidePoints.forEach(function(t,i,r){t.initialLabelRegion=t.labelRegion,t.isLabelUpdated=0,e.skipPoints(t,r,i)}),t.leftSidePoints.forEach(function(t,i,r){t.initialLabelRegion=t.labelRegion,t.isLabelUpdated=0,e.skipPoints(t,r,i)}),this.arrangeLeftSidePoints(t),this.isIncreaseAngle=!1,this.arrangeRightSidePoints(t)},r.prototype.arrangeRightSidePoints=function(e){var t,i,r=e.rightSidePoints.filter(function(e){return e.labelVisible&&"Outside"===e.labelPosition});this.rightSideRenderingPoints=r;var o,n,a,s=r[r.length-1];s&&s.labelAngle>90&&s.labelAngle<270&&(this.isIncreaseAngle=!0,this.changeLabelAngle(s,89));for(var l=r.length-1;l>=0;l--)if(n=r[l],a=r[l+1],this.isOverlapWithNext(n,r,l)&&n.labelVisible||!(n.labelAngle<=90||n.labelAngle>=270))if(o=s.labelAngle+10,i=!0,t?this.isIncreaseAngle=!1:o>90&&o<270&&a.isLabelUpdated&&(this.isIncreaseAngle=!0),this.isIncreaseAngle)for(h=l+1;h>0;h--)this.decreaseAngle(r[h],r[h-1],e,!0);else for(var h=l+1;h<r.length;h++)this.increaseAngle(r[h-1],r[h],e,!0);else i&&a&&!a.isLabelUpdated&&(t=!0)},r.prototype.arrangeLeftSidePoints=function(e){var t=this,i=e.leftSidePoints.filter(function(e){return e.labelVisible&&"Outside"===e.labelPosition});this.leftSideRenderingPoints=i;for(var r,o,n,a,s=0;s<i.length;s++)if(o=i[s],r=i[s-1],this.isOverlapWithPrevious(o,i,s)&&o.labelVisible||!(o.labelAngle<270))if(n=!0,a&&(this.isIncreaseAngle=!1),this.isIncreaseAngle)for(l=s;l<i.length;l++)this.increaseAngle(i[l-1],i[l],e,!1);else for(var l=s;l>0;l--)this.decreaseAngle(i[l],i[l-1],e,!1),i.filter(function(e,r){e.isLabelUpdated&&i[r].labelAngle-10<100&&(t.isIncreaseAngle=!0)});else n&&r&&r.isLabelUpdated&&(a=!0)},r.prototype.decreaseAngle=function(e,i,r,o){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))return null;var n=1;if(o)for(;Le(e.labelRegion,i.labelRegion)||!this.isVariousRadius()&&!(i.labelRegion.height+i.labelRegion.y<e.labelRegion.y);){if((a=i.midAngle-n)<0&&(a=360+a),a<=270&&a>=90){a=270,this.isIncreaseAngle=!0;break}this.changeLabelAngle(i,a),n++}else for(e.labelAngle>270&&(this.changeLabelAngle(e,270),i.labelAngle=270);Le(e.labelRegion,i.labelRegion)||!this.isVariousRadius()&&e.labelRegion.y+e.labelRegion.height>i.labelRegion.y;){var a=i.midAngle-n;if(!(a<=270&&a>=90)){a=90,this.isIncreaseAngle=!0;break}if(this.changeLabelAngle(i,a),Le(e.labelRegion,i.labelRegion)&&!r.leftSidePoints.indexOf(i)&&a-1<90&&a-1>270){this.changeLabelAngle(e,e.labelAngle+1),this.arrangeLeftSidePoints(r);break}n++}},r.prototype.increaseAngle=function(e,i,r,o){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))return null;var n=1;if(o)for(;Le(e.labelRegion,i.labelRegion)||!this.isVariousRadius()&&!(e.labelRegion.y+e.labelRegion.height<i.labelRegion.y);){if((a=i.midAngle+n)<270&&a>90){a=90,this.isIncreaseAngle=!0;break}if(this.changeLabelAngle(i,a),Le(e.labelRegion,i.labelRegion)&&a+1>90&&a+1<270&&this.rightSideRenderingPoints.indexOf(i)===this.rightSideRenderingPoints.length-1){this.changeLabelAngle(e,e.labelAngle-1),i.labelRegion=i.initialLabelRegion,this.arrangeRightSidePoints(r);break}n++}else for(;Le(e.labelRegion,i.labelRegion)||!this.isVariousRadius()&&e.labelRegion.y<i.labelRegion.y+i.labelRegion.height;){var a=i.midAngle+n;if(!(a<270&&a>90)){a=270,this.isIncreaseAngle=!1;break}this.changeLabelAngle(i,a),n++}},r.prototype.changeLabelAngle=function(e,t){var i,r=this.accumulation.series[0].dataLabel;this.isVariousRadius()&&(i=this.accumulation.pieSeriesModule.getLabelRadius(this.accumulation.visibleSeries[0],e));var o="Outside"===e.labelPosition&&this.accumulation.enableSmartLabels&&"Inside"===r.position?this.radius+Be(r.connectorStyle.length||"4%",this.accumulation.pieSeriesModule.size/2):this.isVariousRadius()?i:this.accumulation.pieSeriesModule.labelRadius+10,n=this.isVariousRadius()?i:o;this.getLabelRegion(e,"Outside",e.textSize,n,this.marginValue,t),e.isLabelUpdated=1,e.labelAngle=t},r.prototype.isOverlapWithPrevious=function(e,t,i){for(var r=0;r<i;r++)if(r!==t.indexOf(e)&&t[r].visible&&t[r].labelVisible&&t[r].labelRegion&&e.labelRegion&&e.labelVisible&&Le(e.labelRegion,t[r].labelRegion))return!0;return!1},r.prototype.isOverlapWithNext=function(e,t,i){for(var r=i;r<t.length;r++)if(r!==t.indexOf(e)&&t[r].visible&&t[r].labelVisible&&t[r].labelRegion&&e.labelRegion&&e.labelVisible&&Le(e.labelRegion,t[r].labelRegion))return!0;return!1},r.prototype.skipPoints=function(e,t,i){if(i>0&&(e.midAngle<285&&e.midAngle>255||e.midAngle<105&&e.midAngle>75)){var r=t[i-1],o=e.endAngle%360-e.startAngle%360;(s=r.endAngle%360-r.startAngle%360)<=o&&o<5&&r.labelVisible&&this.setPointVisibleTrue(e)}else if(i>1&&(e.midAngle<300&&e.midAngle>240||e.midAngle<120&&e.midAngle>60)){var n=t[i-1],a=t[i-2],o=e.endAngle%360-e.startAngle%360,s=n.endAngle%360-n.startAngle%360,l=a.endAngle%360-a.startAngle%360;o<3&&s<3&&l<3&&n.labelVisible&&e.labelVisible&&this.setPointVisibleTrue(e)}},r.prototype.getPerpendicularDistance=function(e,t){var i=10+10*Math.sin(t.midAngle*Math.PI/360);return t.midAngle>270&&t.midAngle<360?new Vi(e.x+i*Math.cos((360-t.midAngle)*Math.PI/180),e.y-i*Math.sin((360-t.midAngle)*Math.PI/180)):t.midAngle>0&&t.midAngle<90?new Vi(e.x+i*Math.cos(t.midAngle*Math.PI/180),e.y+i*Math.sin(t.midAngle*Math.PI/180)):t.midAngle>0&&t.midAngle<90?new Vi(e.x-i*Math.cos((t.midAngle-90)*Math.PI/180),e.y+i*Math.sin((t.midAngle-90)*Math.PI/180)):new Vi(e.x-i*Math.cos((t.midAngle-180)*Math.PI/180),e.y-i*Math.sin((t.midAngle-180)*Math.PI/180))},r}(Qn),ga=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ya=function(e){function i(t){var i=e.call(this,t)||this;return i.accumulation=t,i.addEventListener(),i}return ga(i,e),i.prototype.addEventListener=function(){this.accumulation.isDestroyed||(this.accumulation.on(t.Browser.isPointer?"pointerleave":"mouseleave",this.mouseLeaveHandler,this),this.accumulation.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.accumulation.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},i.prototype.mouseLeaveHandler=function(e){this.removeTooltip(this.accumulation.tooltip.fadeOutDuration)},i.prototype.mouseUpHandler=function(e){var t=this.accumulation;t.tooltip.enable&&t.isTouch&&j(t.mouseX,t.mouseY,t.initialClipRect)&&(this.tooltip(e),this.removeTooltip(2e3))},i.prototype.mouseMoveHandler=function(e){var t=this.accumulation;t.tooltip.enable&&j(t.mouseX,t.mouseY,t.initialClipRect)&&this.tooltip(e)},i.prototype.tooltip=function(e){var t=this.getElement(this.element.id+"_tooltip_svg"),i=t&&parseInt(t.getAttribute("opacity"),10)>0,r=this.getTooltipElement(i);this.renderSeriesTooltip(e,this.accumulation,!i,r)},i.prototype.renderSeriesTooltip=function(e,t,i,r){var o=this.getPieData(e,t,t.mouseX,t.mouseY);t.initialClipRect;if(this.currentPoints=[],!o.point||this.previousPoints[0]&&this.previousPoints[0].point===o.point)!o.point&&this.isRemove&&(this.removeTooltip(this.accumulation.tooltip.fadeOutDuration),this.isRemove=!1);else{if(this.previousPoints[0]&&o.point.index===this.previousPoints[0].point.index&&o.series.index===this.previousPoints[0].series.index)return null;this.pushData(o,i,r,!1)&&this.triggerTooltipRender(o,i,this.getTooltipText(o,t.tooltip),this.findHeader(o))}},i.prototype.triggerTooltipRender=function(e,i,r,o,n){var a=this;void 0===n&&(n=!0);var s={cancel:!1,name:"tooltipRender",text:r,point:e.point,textStyle:this.textStyle,series:this.accumulation.isBlazor?{}:e.series,headerText:o,data:{pointX:e.point.x,pointY:e.point.y,seriesIndex:e.series.index,pointIndex:e.point.index,pointText:e.point.text,seriesName:e.series.name}},l=function(r){r.cancel?(a.removeHighlight(),t.remove(a.getElement(a.element.id+"_tooltip"))):(a.formattedText=a.formattedText.concat(r.text),a.text=a.formattedText,a.headerText=r.headerText,a.createTooltip(a.chart,i,e.point.symbolLocation,e.series.clipRect,e.point,["Circle"],0,a.chart.initialClipRect,null,e.point,a.accumulation.tooltip.template?r.template:"")),a.isRemove=!0};l.bind(this,e),this.chart.trigger("tooltipRender",s,l)},i.prototype.getPieData=function(e,i,r,o){var n=D(e.target.id,!0);if(!isNaN(n.series)){var a=n.series,s=n.point;if(!(t.isNullOrUndefined(a)||isNaN(a)||t.isNullOrUndefined(s)||isNaN(s))){var l=this.getSeriesFromIndex(a,i.visibleSeries);if(l.enableTooltip)return new Gi(l.points[s],l)}}return new Gi(null,null)},i.prototype.getSeriesFromIndex=function(e,t){return t[0]},i.prototype.getTooltipText=function(e,t){var i=e.series,r=this.accumulation.useGroupingSeparator?"${point.x} : <b>${point.separatorY}</b>":"${point.x} : <b>${point.y}</b>";return r=t.format?t.format:r,this.parseTemplate(e.point,i,r)},i.prototype.findHeader=function(e){return""===this.header?"":(this.header=this.parseTemplate(e.point,e.series,this.header),""!==this.header.replace(/<b>/g,"").replace(/<\/b>/g,"").trim()?this.header:"")},i.prototype.parseTemplate=function(e,t,i){for(var r,o,n=0,a=Object.keys(e);n<a.length;n++){h=a[n];r=new RegExp("${point."+h+"}","gm"),i=i.replace(r.source,e[h])}for(var s=0,l=Object.keys(Object.getPrototypeOf(t));s<l.length;s++){var h=l[s];r=new RegExp("${series."+h+"}","gm"),o=t[h],i=i.replace(r.source,o)}return i},i.prototype.getModuleName=function(){return"AccumulationTooltip"},i.prototype.destroy=function(e){},i}(un),ma=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),va=function(e){function i(t){var i=e.call(this,t)||this;return i.renderer=t.renderer,i}return ma(i,e),i.prototype.initPrivateVariables=function(e){this.styleId=e.element.id+"_ej2_chart_selection",this.unselected=e.element.id+"_ej2_deselected",this.selectedDataIndexes=[],this.rectPoints=null},i.prototype.invokeSelection=function(e){this.initPrivateVariables(e),this.series=t.extend({},e.visibleSeries,null,!0),this.seriesStyles(),this.selectDataIndex(this.concatIndexes(e.selectedDataIndexes,this.selectedDataIndexes),e)},i.prototype.generateStyle=function(e){return e.selectionStyle||this.styleId+"_series_"+e.index},i.prototype.findElements=function(e,t,i){return[this.getElementByIndex(i)]},i.prototype.getElementByIndex=function(e){var t=this.control.element.id+"_Series_"+e.series+"_Point_"+e.point;return document.getElementById(t)},i.prototype.calculateSelectedElements=function(e,t){-1!==t.target.id.indexOf(e.element.id+"_")&&(t.target.id.indexOf("_Series_")>-1||t.target.id.indexOf("_datalabel_")>-1)&&this.performSelection(D(t.target.id),e,t.target)},i.prototype.performSelection=function(e,t,i){switch(i=i.id.indexOf("datalabel")>-1?t.getSeriesElement().childNodes[e.series].childNodes[e.point]:i,t.selectionMode){case"Point":isNaN(e.point)||(this.selection(t,e,[i]),this.blurEffect(t.element.id,t.visibleSeries))}},i.prototype.selection=function(e,i,r){e.isMultiSelect||this.removeMultiSelectEelments(e,this.selectedDataIndexes,i,e.series);var o=r[0]&&(r[0].getAttribute("class")||"");if(r[0]&&o.indexOf(this.getSelectionClass(r[0].id))>-1){if(this.removeStyles(r,i),this.addOrRemoveIndex(this.selectedDataIndexes,i),e.enableBorderOnMouseMove){n=document.getElementById(r[0].id.split("_")[0]+"PointHover_Border");t.isNullOrUndefined(n)||this.removeSvgClass(n,n.getAttribute("class"))}}else{if(this.applyStyles(r,i),e.enableBorderOnMouseMove){var n=document.getElementById(r[0].id.split("_")[0]+"PointHover_Border");t.isNullOrUndefined(n)||this.addSvgClass(n,r[0].getAttribute("class"))}this.addOrRemoveIndex(this.selectedDataIndexes,i,!0)}},i.prototype.redrawSelection=function(e){var i=t.extend([],this.selectedDataIndexes,null,!0);this.removeSelectedElements(e,this.selectedDataIndexes),this.blurEffect(e.element.id,e.visibleSeries),this.selectDataIndex(i,e)},i.prototype.removeSelectedElements=function(e,t){for(var i=0,r=t;i<r.length;i++){var o=r[i];this.removeStyles([this.getElementByIndex(o)],o)}},i.prototype.legendSelection=function(e,t,i){var r=e.getSeriesElement().childNodes[t].childNodes[i];this.selection(e,new Jt(t,i),[r]),this.blurEffect(e.element.id,e.visibleSeries)},i.prototype.selectDataIndex=function(e,t){for(var i,r=0,o=e;r<o.length;r++){var n=o[r];(i=this.getElementByIndex(n))&&this.performSelection(n,t,i)}},i.prototype.removeMultiSelectEelments=function(e,t,i,r){for(var o,n=0;n<t.length;n++)o=r[t[n].series],this.checkEquals(t[n],i)||(this.removeStyles(this.findElements(e,o,t[n]),t[n]),t.splice(n,1),n--)},i.prototype.blurEffect=function(e,t){for(var i=this.checkPointVisibility(this.selectedDataIndexes),r=0,o=t;r<o.length;r++){var n=o[r];n.visible&&this.checkSelectionElements(document.getElementById(e+"_SeriesCollection"),this.generateStyle(n),i)}},i.prototype.checkSelectionElements=function(e,t,i){for(var r,o,n,a=e.childNodes[0].childNodes,s=0;s<a.length;s++)o=a[s].getAttribute("class")||"",n=a[s].parentNode.getAttribute("class")||"",-1===o.indexOf(t)&&-1===n.indexOf(t)&&i?this.addSvgClass(a[s],this.unselected):this.removeSvgClass(a[s],this.unselected),this.control.accumulationLegendModule&&this.control.legendSettings.visible&&(r=document.getElementById(this.control.element.id+"_chart_legend_shape_"+s))&&(-1===o.indexOf(t)&&-1===n.indexOf(t)&&i?this.addSvgClass(r,this.unselected):this.removeSvgClass(r,this.unselected))},i.prototype.applyStyles=function(e,t){for(var i=this.control.accumulationTooltipModule,r=0,o=e;r<o.length;r++){var n=o[r],a=void 0;if(n){this.control.accumulationLegendModule&&this.control.legendSettings.visible&&(a=document.getElementById(this.control.element.id+"_chart_legend_shape_"+t.point),this.removeSvgClass(a,this.unselected),this.addSvgClass(a,this.getSelectionClass(a.id))),this.removeSvgClass(n.parentNode,this.unselected),this.removeSvgClass(n,this.unselected);var s=i&&i.previousPoints.length>0&&i.previousPoints[0].point.index!==t.point?i.svgTooltip.opacity:this.series[t.series].opacity;n.setAttribute("opacity",s.toString()),this.addSvgClass(n,this.getSelectionClass(n.id))}}},i.prototype.getSelectionClass=function(e){return this.generateStyle(this.control.series[D(e).series])},i.prototype.removeStyles=function(e,t){for(var i,r=this.control.accumulationTooltipModule,o=0,n=e;o<n.length;o++){var a=n[o];if(a){this.control.accumulationLegendModule&&this.control.legendSettings.visible&&(i=document.getElementById(this.control.element.id+"_chart_legend_shape_"+t.point),this.removeSvgClass(i,this.getSelectionClass(i.id)));var s=r&&r.previousPoints[0].point.index===t.point?r.svgTooltip.opacity:this.series[t.series].opacity;a.setAttribute("opacity",s.toString()),this.removeSvgClass(a,this.getSelectionClass(a.id))}}},i.prototype.addOrRemoveIndex=function(e,t,i){for(var r=0;r<e.length;r++)this.checkEquals(e[r],t)&&(e.splice(r,1),r--);i&&e.push(t)},i.prototype.checkEquals=function(e,t){return e.point===t.point&&e.series===t.series},i.prototype.checkPointVisibility=function(e){for(var t=!1,i=0,r=e;i<r.length;i++)if(et(r[i].point,this.control.visibleSeries[0].points).visible){t=!0;break}return t},i.prototype.getModuleName=function(){return"AccumulationSelection"},i.prototype.destroy=function(){},i}(fn),fa=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ba=function(e){function i(t){var i=e.call(this,t)||this;return i.pie=t,i}return fa(i,e),i.prototype.renderAnnotations=function(e){var i=this;this.annotations=this.pie.annotations;var r=this.pie.redraw;this.parentElement=Fe(r,this.pie.element.id+"_Annotation_Collections")||t.createElement("div",{id:this.pie.element.id+"_Annotation_Collections"}),this.annotations.map(function(e,t){i.processAnnotation(e,t,i.parentElement)}),fe(this.parentElement,e,r)},i.prototype.getModuleName=function(){return"Annotation"},i.prototype.destroy=function(){},i}(An),xa=function(){function e(e,t,i,r,o){void 0===o&&(o=!0),this.x=e,this.y=t,this.xValue=i,this.visible=o}return e}(),wa=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Sa=function(e){function o(t){var i=e.call(this)||this;return i.dataSource=t.dataSource,i.xName=t.xName,i.yName=t.yName,i.query=t.query,i.xMin=1/0,i.xMax=-1/0,i.yMin=1/0,i.yMax=-1/0,i}return wa(o,e),o.prototype.renderChart=function(e){var t,i,r=this;this.seriesLength=0,e.rangeSlider.points=[],e.series.length?e.series.map(function(o){t=o.dataSource||e.dataSource,i=o.query||e.query,o.points=[],r.processDataSource(t,i,e,o)}):this.processDataSource(e.dataSource,e.query,e)},o.prototype.processDataSource=function(e,i,o,n){var a=this;if(!(e instanceof r.DataManager)&&!t.isNullOrUndefined(e)&&t.isNullOrUndefined(i))return void this.dataManagerSuccess({result:e,count:e.length},o,n);o.dataModule=new ar(e,i),o.dataModule.getData(o.dataModule.generateQuery().requiresCount()).then(function(e){return a.dataManagerSuccess(e,o,n)})},o.prototype.dataManagerSuccess=function(e,t,i){var r=e.count?e.result:[];t.allowServerDataBinding=!1,this.processJsonData(r,t,Object.keys(r).length,i),this.seriesLength+=i?1:this.seriesLength,i&&this.seriesLength!==t.series.length||(this.processXAxis(t),this.calculateGroupingBounds(t),this.processYAxis(t),t.renderChart())},o.prototype.processJsonData=function(e,i,o,n){for(var a,s=0,l=n&&n.xName||i.xName,h=n&&n.yName||i.yName;s<o;){if(a=new xa(t.getValue(l,e[s]),t.getValue(h,e[s])),a.yValue=i.isBlazor&&t.isNullOrUndefined(a.y)?0:+a.y,"DateTime"===i.valueType){var c=i.intl.getDateParser({skeleton:"full",type:"dateTime"}),d=i.intl.getDateFormat({skeleton:"full",type:"dateTime"});a.x=new Date(r.DataUtil.parse.parseJson({val:a.x}).val),a.xValue=i.isBlazor?Date.parse(a.x.toString()):Date.parse(c(d(a.x)))}else a.xValue=i.isBlazor&&t.isNullOrUndefined(a.x)?0:+a.x;n&&n.points.push(a),this.xMin=Math.min(this.xMin,a.xValue),this.yMin=Math.min(this.yMin,a.yValue),this.xMax=Math.max(this.xMax,a.xValue),this.yMax=Math.max(this.yMax,a.yValue),i.rangeSlider.points.push(a),s++}},o.prototype.processXAxis=function(e){var t={minimum:e.minimum,maximum:e.maximum,interval:e.interval,valueType:e.valueType,isInversed:e.enableRtl,labelFormat:e.labelFormat,logBase:e.logBase,skeleton:e.skeleton,skeletonType:e.skeletonType};this.xAxis=t,this.xAxis.intervalType=e.intervalType,this.xAxis.maximumLabels=3,this.xAxis.skeleton=e.skeleton,this.xAxis.intervalDivs=[10,5,2,1],this.xAxis.rect=e.bounds,this.xAxis.visibleLabels=[],this.xAxis.orientation="Horizontal";var i=e[G(e.valueType)+"Module"];i.min=this.xMin,i.max=this.xMax,i.getActualRange(this.xAxis,e.bounds),"Double"!==this.xAxis.valueType&&"DateTime"!==this.xAxis.valueType||i.updateActualRange(this.xAxis,this.xAxis.actualRange.min,this.xAxis.actualRange.max,this.xAxis.actualRange.interval),this.xAxis.actualRange.delta=this.xAxis.actualRange.max-this.xAxis.actualRange.min,this.xAxis.visibleRange=this.xAxis.actualRange,i.calculateVisibleLabels(this.xAxis,e)},o.prototype.processYAxis=function(e){var t={majorGridLines:{width:0},rangePadding:"None",majorTickLines:{width:0},labelStyle:{size:"0"},visible:!1,valueType:"Double",minimum:null,maximum:null,interval:null};this.yAxis=t,this.yAxis.rect=e.bounds,this.yAxis.maximumLabels=3,this.yAxis.intervalDivs=[10,5,2,1],this.yAxis.orientation="Vertical",e.doubleModule.min=this.yMin,e.doubleModule.max=this.yMax,e.doubleModule.getActualRange(this.yAxis,e.bounds),e.doubleModule.updateActualRange(this.yAxis,this.yAxis.actualRange.min,this.yAxis.actualRange.max,this.yAxis.actualRange.interval),this.yAxis.actualRange.delta=this.yAxis.actualRange.max-this.yAxis.actualRange.min,this.yAxis.visibleRange=this.yAxis.actualRange},o.prototype.renderSeries=function(e){var t=this;this.chartGroup=e.renderer.createGroup({id:e.element.id+"_chart"});var i=h(e.theme);e.series.map(function(r,o){(!e.stockChart||e.stockChart.series[o].visible)&&(r.xAxis=t.xAxis,r.yAxis=t.yAxis,r.chart=e,r.index=o,r.xAxis.isInversed=e.enableRtl,r.interior=r.fill||i[o%i.length],t.createSeriesElement(e,r,o),e[G(r.type)+"SeriesModule"]?e[G(r.type)+"SeriesModule"].render(r,t.xAxis,t.yAxis,!1):e.lineSeriesModule.render(r,t.xAxis,t.yAxis,!1),t.chartGroup.appendChild(r.seriesElement),r.animation.enable&&e.animateSeries&&e[G(r.type)+"SeriesModule"]&&e[G(r.type)+"SeriesModule"].doAnimation(r))})},o.prototype.appendSeriesElements=function(e){e.svgObject.appendChild(this.chartGroup),e.series.length&&this.drawSeriesBorder(e)},o.prototype.createSeriesElement=function(e,t,r){var o=e.element.id;t.clipRect=new i.Rect(this.xAxis.rect.x,this.yAxis.rect.y,this.xAxis.rect.width,this.yAxis.rect.height),t.clipRectElement=e.renderer.drawClipPath(new Di(o+"_RangeSeriesClipRect_"+r,"transparent",{width:1,color:"Gray"},1,{x:0,y:0,width:t.clipRect.width,height:t.clipRect.height})),t.seriesElement=e.renderer.createGroup({id:o+"SeriesGroup"+r,transform:"translate("+t.clipRect.x+","+t.clipRect.y+")","clip-path":"url(#"+o+"_RangeSeriesClipRect_"+r+")"}),t.seriesElement.appendChild(t.clipRectElement)},o.prototype.calculateGroupingBounds=function(e){var t=e.margin.bottom,r=i.measureText("string",e.labelStyle).height;this.calculateDateTimeNiceInterval(this.xAxis,new i.Size(e.bounds.width,e.bounds.height),this.xMin,this.xMax,!1),!e.enableGrouping||"DateTime"!==e.valueType||"Years"===this.xAxis.actualIntervalType&&e.series.length||(e.bounds.height-="Outside"===e.labelPosition||0===e.series.length?t+r:r+2*t),e.series.length||(e.bounds.y+=e.bounds.height/4,e.bounds.height=e.bounds.height/2)},o.prototype.drawSeriesBorder=function(e){var t=e.stockChart?"M":"L",r=e.stockChart?"":"Z",o=new i.PathOption(e.element.id+"_SeriesBorder","transparent",e.navigatorBorder.width,e.navigatorBorder.color,1,"","M "+e.bounds.x+" "+e.bounds.y+" L "+(e.bounds.x+e.bounds.width)+" "+e.bounds.y+t+(e.bounds.x+e.bounds.width)+" "+(e.bounds.y+e.bounds.height)+" L "+e.bounds.x+" "+(e.bounds.y+e.bounds.height)+r),n=e.renderer.drawPath(o);e.svgObject.appendChild(n)},o}(Ar),Ca=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pa=function(e){function t(t){var i=e.call(this)||this;return i.firstLevelLabels=[],i.secondLevelLabels=[],i.rangeNavigator=t,i}return Ca(t,e),t.prototype.renderGridLines=function(){var e=0,t=this.rangeNavigator,r=t.majorGridLines,o=t.majorTickLines,n="",a="",s=t.bounds,l=t.chartSeries.xAxis,h=t.disableRangeSelector?"transparent":null;this.gridLines=t.renderer.createGroup({id:t.element.id+"_GridLines"});var c="Outside"===t.tickPosition||0===t.series.length?s.y+s.height+o.height:s.y+s.height-o.height;this.firstLevelLabels=[],l.labelStyle=t.labelStyle,l.skeleton=t.skeleton,l.skeletonType=t.skeletonType,l.isChart=!1,"DateTime"===t.valueType&&(this.calculateDateTimeNiceInterval(l,s,l.doubleRange.start,l.doubleRange.end,l.isChart),this.actualIntervalType=l.actualIntervalType,this.findAxisLabels(l)),this.firstLevelLabels=l.visibleLabels,this.lowerValues=[];for(var d=l.visibleLabels.length,p=0;p<d;p++)this.lowerValues.push(this.firstLevelLabels[p].value),(e=I(this.firstLevelLabels[p].value,l)*s.width+s.x)>=s.x&&s.x+s.width>=e&&(n=n.concat("M "+e+" "+(t.bounds.y+t.bounds.height)+" L "+e+" "+t.bounds.y+" "),a=a.concat("M "+e+" "+(s.y+s.height)+" L "+e+" "+c+" "));var u=new i.PathOption(t.element.id+"_MajorGridLine","transparent",r.width,t.series.length?h||r.color||t.themeStyle.gridLineColor:"transparent",1,r.dashArray,n);this.gridLines.appendChild(t.renderer.drawPath(u)),u=new i.PathOption(t.element.id+"_MajorTickLine","transparent",o.width,h||o.color||t.themeStyle.gridLineColor,1,r.dashArray,a),this.gridLines.appendChild(t.renderer.drawPath(u))},t.prototype.renderAxisLabels=function(){var e,t=this.rangeNavigator.chartSeries.xAxis,r=this.rangeNavigator,o=r.renderer.createGroup({id:r.element.id+"_AxisLabels"}),n=r.renderer.createGroup({id:r.element.id+"_FirstLevelAxisLabels"}),a=r.renderer.createGroup({id:r.element.id+"_SecondLevelAxisLabels"}),s=t;if(e=this.findLabelY(r,!1),this.placeAxisLabels(t,e,"_AxisLabel_",r,n),s.intervalType=s.actualIntervalType=r.groupBy||this.getSecondaryLabelType(t.actualIntervalType),s.labelFormat="",r.enableGrouping&&"DateTime"===r.valueType&&"Years"!==this.actualIntervalType){s.visibleRange.interval=1,s.visibleLabels=[],this.findAxisLabels(s),this.secondLevelLabels=s.visibleLabels,e=this.findLabelY(r,!0);var l=this.placeAxisLabels(s,e,"_SecondaryLabel_",r,a),h=new i.PathOption(r.element.id+"_SecondaryMajorLines","transparent",r.majorTickLines.width,r.majorTickLines.color||r.themeStyle.gridLineColor,1,r.majorGridLines.dashArray,l);this.gridLines.appendChild(r.renderer.drawPath(h))}r.chartSeries.xAxis.visibleLabels=r.chartSeries.xAxis.visibleLabels.concat(s.visibleLabels),o.appendChild(n),o.appendChild(a),r.svgObject.appendChild(this.gridLines),r.svgObject.appendChild(o)},t.prototype.getSecondaryLabelType=function(e){var t=["Years","Quarter","Months","Weeks","Days","Hours","Minutes","Seconds"];return"Years"===e?"Years":t[t.indexOf(e)-1]},t.prototype.findAxisLabels=function(e){e.visibleLabels=[];var t,i,r=new Date(e.visibleRange.min),o=this.rangeNavigator.interval?this.rangeNavigator.interval:1;switch(e.actualIntervalType){case"Years":r=new Date(r.getFullYear(),0,1);break;case"Quarter":r=r.getMonth()<=2?new Date(r.getFullYear(),0,1):r.getMonth()<=5?new Date(r.getFullYear(),3,1):r.getMonth()<=8?new Date(r.getFullYear(),6,1):new Date(r.getFullYear(),9,1);break;case"Months":r=new Date(r.getFullYear(),r.getMonth());break;case"Weeks":r=new Date(r.getFullYear(),r.getMonth(),r.getDate()-r.getDay());break;case"Days":r=new Date(r.getFullYear(),r.getMonth(),r.getDate());break;case"Hours":r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours());break;case"Minutes":r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes());break;case"Seconds":r=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds())}for(t=r.getTime(),this.rangeNavigator.format=this.rangeNavigator.intl.getDateFormat({format:e.labelFormat||this.blazorFormat(e),type:G(e.skeletonType),skeleton:this.getSkeleton(e,null,null,this.rangeNavigator.isBlazor)});t<=e.visibleRange.max;)i=this.dateFormats(this.rangeNavigator.format(new Date(t)),e,e.visibleLabels.length),e.visibleLabels.push(new Ti(i,t,this.rangeNavigator.labelStyle,i)),t=this.increaseDateTimeInterval(e,t,o).getTime()},t.prototype.blazorFormat=function(e){return this.rangeNavigator.isBlazor&&"Years"===e.actualIntervalType?"yyyy":""},t.prototype.dateFormats=function(e,t,i){var r=e,o=this.rangeNavigator.isBlazor,n=this.rangeNavigator.enableGrouping&&0===this.firstLevelLabels.length;switch(t.actualIntervalType){case"Quarter":e.indexOf("Jan")>-1?r=n?"Quarter1":e.replace(o?"January":"Jan","Quarter1"):e.indexOf("Apr")>-1?r=n?"Quarter2":e.replace(o?"April":"Apr","Quarter2"):e.indexOf("Jul")>-1?r=n?"Quarter3":e.replace(o?"July":"Jul","Quarter3"):e.indexOf("Oct")>-1&&(r=n?"Quarter4":e.replace(o?"October":"Oct","Quarter4"));break;case"Weeks":r="Week"+ ++i;break;default:r=e}return r},t.prototype.findLabelY=function(e,t){var r,o=e.bounds.y+e.bounds.height,n=e.majorTickLines.height,a=i.measureText("Quarter1 2011",e.labelStyle).height,s=8;return r="Outside"===e.labelPosition&&"Outside"===e.tickPosition||0===e.series.length?o+n+s+.75*a:"Inside"===e.labelPosition&&"Inside"===e.tickPosition?o-n-s:"Inside"===e.labelPosition&&"Outside"===e.tickPosition?o-s:o+s+.75*a,t&&(s=15,"Outside"===e.labelPosition||0===e.series.length?r+=s+.75*a:r="Outside"===e.tickPosition||0===e.series.length?o+n+s+.75*a:o+s+.75*a),r},t.prototype.placeAxisLabels=function(e,t,r,o,n){var a,s,l,h,c=e.visibleLabels.length,d=o.bounds,p="",u=o.disableRangeSelector?"transparent":null,g=o.enableRtl?d.x+d.width:d.x,y=e.actualIntervalType,m="DateTime"===o.valueType?c>1?e.visibleLabels[1].value-e.visibleLabels[0].value:(e.visibleRange.max-e.visibleLabels[0].value)/2:0;"DateTime"!==o.valueType||"Quarter"!==y&&"Weeks"!==y||this.findSuitableFormat(e,o);for(var v=0,f=c;v<f;v++)if(a=e.visibleLabels[v],a.size=i.measureText(a.text,e.labelStyle),"Middle"===o.secondaryLabelAlignment?l=I(a.value+m/2,e)*d.width+d.x:r.indexOf("Secondary")>-1&&(l=this.findAlignment(e,v)),h=I(a.value,e)*d.width+d.x,(0===v||v===e.visibleLabels.length-1&&o.enableRtl)&&l<d.x&&(l=d.x+a.size.width/2),(v===e.visibleLabels.length-1||0===v&&o.enableRtl)&&l+a.size.width>d.x+d.width&&(l=d.x+d.width-a.size.width/2),r.indexOf("_SecondaryLabel_")>-1&&l>=d.x&&d.x+d.width>=l&&(p=p.concat("M "+h+" "+t+" L "+h+" "+(t-a.size.height))),"Hide"!==o.labelIntersectAction||0===v||!this.isIntersect(e,l,a.size.width,g,s.size.width)){"Middle"===o.secondaryLabelAlignment&&1===e.visibleLabels.length&&(l=I(a.value,e)+(d.x+d.width/2));var b=o.labelStyle,x={size:b.size,color:u||b.color||o.themeStyle.labelFontColor,fontFamily:b.fontFamily,fontStyle:b.fontStyle||o.labelStyle.fontStyle,fontWeight:b.fontWeight||o.labelStyle.fontWeight,opacity:b.opacity||o.labelStyle.opacity,textAlignment:b.textAlignment||o.labelStyle.textAlignment,textOverflow:b.textOverflow||o.labelStyle.textOverflow},w={cancel:!1,name:"labelRender",text:a.text,value:a.value,labelStyle:x,region:new i.Rect(l,t,a.size.width,a.size.height)};o.trigger("labelRender",w),w.cancel||(o.labels.push(w),Ve(this.rangeNavigator.renderer,new i.TextOption(this.rangeNavigator.element.id+r+v,l,t,"middle",w.text),w.labelStyle,w.labelStyle.color||o.themeStyle.labelFontColor,n).style.cursor="DateTime"===e.valueType?"cursor: pointer":"cursor: default",g=l,s=a)}return p},t.prototype.isIntersect=function(e,t,i,r,o){return e.isInversed?t+i/2>r-o/2:t-i/2<r+o/2},t.prototype.findSuitableFormat=function(e,t){for(var r,o,n=e.visibleLabels,a=n.length,s=t.bounds,l="DateTime"===t.valueType?a>1?n[1].value-n[0].value:e.visibleRange.interval:0,h=0;h<a;h++)o=I(n[h].value+l/2,e)*s.width+s.x,n[h].size=i.measureText(n[h].text,e.labelStyle),0===h&&o<s.x&&(o=s.x+n[h].size.width/2),"Quarter"===e.actualIntervalType?0!==h&&(n[h].text.indexOf("Quarter")>-1&&this.isIntersect(e,o,n[h].size.width,r,n[h-1].size.width)?(n.every(function(e){return e.text=e.text.toString().replace("Quarter","QTR"),!0}),e.visibleLabels=n,this.findSuitableFormat(e,t)):this.isIntersect(e,o,n[h].size.width,r,n[h-1].size.width)&&(n.every(function(e){return e.text=e.text.toString().replace("QTR","Q"),!0}),e.visibleLabels=n)):"Weeks"===e.actualIntervalType&&0!==h&&n[h].text.indexOf("Week")>-1&&this.isIntersect(e,o,n[h].size.width,r,n[h-1].size.width)&&(n.every(function(e){return e.text=e.text.toString().replace("Week","W"),!0}),e.visibleLabels=n),r=o},t.prototype.findAlignment=function(e,t){var i=e.visibleLabels[t],r=e.visibleLabels[t+1],o=this.rangeNavigator.bounds;return"Near"===this.rangeNavigator.secondaryLabelAlignment?I(i.value,e)*o.width+o.x+i.size.width/2:I(r?r.value:e.visibleRange.max,e)*o.width+o.x-i.size.width},t}(Tr);!function(e){e.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.tooltipLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"}}(e.RangeNavigatorTheme||(e.RangeNavigatorTheme={}));var La=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ra=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Ma=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.clipRect=new i.Rect(0,0,0,0),t}return La(r,e),Ra([t.Property(null)],r.prototype,"dataSource",void 0),Ra([t.Property(null)],r.prototype,"xName",void 0),Ra([t.Property(null)],r.prototype,"yName",void 0),Ra([t.Property()],r.prototype,"query",void 0),Ra([t.Property("Line")],r.prototype,"type",void 0),Ra([t.Complex({enable:!1},qt)],r.prototype,"animation",void 0),Ra([t.Complex({color:"transparent",width:2},Yt)],r.prototype,"border",void 0),Ra([t.Property(null)],r.prototype,"fill",void 0),Ra([t.Property(1)],r.prototype,"width",void 0),Ra([t.Property(1)],r.prototype,"opacity",void 0),Ra([t.Property("0")],r.prototype,"dashArray",void 0),r}(t.ChildProperty),Aa=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return La(i,e),Ra([t.Property(null)],i.prototype,"width",void 0),Ra([t.Property(null)],i.prototype,"height",void 0),Ra([t.Complex({width:1,color:null},Yt)],i.prototype,"border",void 0),Ra([t.Property(null)],i.prototype,"fill",void 0),Ra([t.Property("Circle")],i.prototype,"type",void 0),i}(t.ChildProperty),ka=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return La(i,e),Ra([t.Complex({},Aa)],i.prototype,"thumb",void 0),Ra([t.Property(null)],i.prototype,"selectedRegionColor",void 0),Ra([t.Property(null)],i.prototype,"unselectedRegionColor",void 0),i}(t.ChildProperty),Ta=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return La(r,i),Ra([t.Property(!1)],r.prototype,"enable",void 0),Ra([t.Property(.85)],r.prototype,"opacity",void 0),Ra([t.Property(null)],r.prototype,"fill",void 0),Ra([t.Property(null)],r.prototype,"format",void 0),Ra([t.Complex(e.RangeNavigatorTheme.tooltipLabelFont,Xt)],r.prototype,"textStyle",void 0),Ra([t.Property(null)],r.prototype,"template",void 0),Ra([t.Complex({color:"#cccccc",width:.5},Yt)],r.prototype,"border",void 0),Ra([t.Property("OnDemand")],r.prototype,"displayMode",void 0),r}(t.ChildProperty),_a=function(){function e(e){this.control=e,this.points=[],this.isIOS=t.Browser.isIos||t.Browser.isIos7;var i=e.navigatorStyleSettings.thumb;this.thumbVisible=0!==e.themeStyle.thumbWidth&&0!==e.themeStyle.thumbHeight,this.elementId=e.element.id,this.thumpPadding=e.themeStyle.thumbWidth/2,this.addEventListener(),this.thumbColor=e.disableRangeSelector?"transparent":i.fill||e.themeStyle.thumbBackground}return e.prototype.render=function(e){var t=e.renderer,i=e.navigatorStyleSettings,r=e.disableRangeSelector?"transparent":null,o=t.createGroup({id:this.elementId+"_sliders",style:e.disableRangeSelector?"pointer-events:none;":""}),n=new Di(this.elementId+"_leftUnSelectedArea",r||i.unselectedRegionColor||e.themeStyle.unselectedRectColor,{width:0},1,{x:e.bounds.x,y:e.bounds.y,width:e.bounds.width/3,height:e.bounds.height});this.leftUnSelectedElement=t.drawRectangle(n),n.id=this.elementId+"_rightUnSelectedArea",this.rightUnSelectedElement=t.drawRectangle(n),n.id=this.elementId+"_SelectedArea",n.fill=r||i.selectedRegionColor||e.themeStyle.selectedRegionColor,this.selectedElement=t.drawRectangle(n),this.selectedElement.setAttribute("style","cursor: -webkit-grab"),this.leftSlider=t.createGroup({id:this.elementId+"_LeftSlider",style:"cursor: ew-resize"}),this.rightSlider=t.createGroup({id:this.elementId+"_RightSlider",style:"cursor: ew-resize"}),this.createThump(t,e.bounds,this.leftSlider,this.elementId+"_LeftSlider",o),this.createThump(t,e.bounds,this.rightSlider,this.elementId+"_RightSlider"),o.appendChild(this.leftUnSelectedElement),o.appendChild(this.rightUnSelectedElement),o.appendChild(this.selectedElement),o.appendChild(this.leftSlider),o.appendChild(this.rightSlider),e.svgObject.appendChild(o)},e.prototype.createThump=function(e,t,r,o,n){var a,s=this.control,l=s.navigatorStyleSettings.thumb,h=s.themeStyle,c=t.y+t.height/2,d=this.thumpPadding,p=s.themeStyle.thumbHeight/2-5,u=s.disableRangeSelector?"transparent":null,g=u||l.border.color||h.thumpLineColor;r.appendChild(e.drawPath(new i.PathOption(o+"_ThumpLine","transparent",l.border.width,s.series.length?g:"transparent",1,null,"M "+d+" "+t.y+" L "+d+" "+(t.y+t.height)+" "))),this.thumpY=c-s.themeStyle.thumbHeight/2,this.sliderY=t.y>this.thumpY?this.thumpY:t.y,n&&!s.disableRangeSelector&&((a=e.createDefs()).innerHTML='<rect xmlns="http://www.w3.org/2000/svg" id="'+this.control.element.id+'_shadow" x="0" y="'+this.thumpY+'" width="'+s.themeStyle.thumbWidth+'" height="'+s.themeStyle.thumbHeight+'" rx="'+("Circle"===l.type?"50%":"0%")+'"/><filter xmlns="http://www.w3.org/2000/svg" x="-25.0%" y="-20.0%" width="150.0%" height="150.0%" filterUnits="objectBoundingBox" id="ej2-range-shadow"><feOffset dx="0" dy="1" in="SourceAlpha"result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="1.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0" type="matrix" in="shadowBlurOuter1"/></filter>',n.appendChild(a)),r.innerHTML+='<use xmlns="http://www.w3.org/2000/svg" fill="black" fill-opacity="1" filter="url(#ej2-range-shadow)" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#path-1"/>',"Circle"===l.type?r.appendChild(ne({x:d,y:c},"Circle",{width:s.themeStyle.thumbWidth,height:s.themeStyle.thumbHeight},"",new i.PathOption(o+"_ThumpSymbol",u||this.thumbColor,l.border.width,g,1,null),"Thumb")):r.appendChild(e.drawRectangle(new Di(o+"_ThumpSymbol",u||this.thumbColor,{width:l.border.width,color:g},1,{x:d-s.themeStyle.thumbWidth/2,y:c-s.themeStyle.thumbHeight/2,width:s.themeStyle.thumbWidth,height:s.themeStyle.thumbHeight},2,2))),this.thumbVisible&&r.appendChild(e.drawPath(new i.PathOption(o+"_ThumpGrip","transparent",1,u||s.themeStyle.gripColor,1,null,"M "+(d+2)+" "+(c+p)+" L "+(d+2)+" "+(c-p)+" M "+d+" "+(c+p)+" L "+d+" "+(c-p)+" M "+(d-2)+" "+(c+p)+" L "+(d-2)+" "+(c-p)+" ")))},e.prototype.setSlider=function(e,t,i,r){var o=this.control,n=o.bounds.x,a=o.chartSeries.xAxis.actualRange,s=0===o.series.length;isNaN(e)&&isNaN(t)&&(e=0,t=o.bounds.width),t>=e||(e=[t,t=e][0]),e=t>=e?e:[t,t=e][0],e=Math.max(e,a.min),t=Math.min(t,a.max),this.startX=n+it(e,a,o.bounds.width,o.enableRtl),this.endX=n+it(t,a,o.bounds.width,o.enableRtl);var l=o.enableRtl?this.endX:this.startX,h=o.enableRtl?this.startX:this.endX;this.sliderWidth=Math.abs(this.endX-this.startX),this.selectedElement.setAttribute("x",l+""),this.selectedElement.setAttribute("width",this.sliderWidth+""),this.leftUnSelectedElement.setAttribute("width",l-n+""),this.rightUnSelectedElement.setAttribute("x",h+""),this.rightUnSelectedElement.setAttribute("width",o.bounds.width-(h-n)+""),this.leftSlider.setAttribute("transform","translate("+(this.startX-this.thumpPadding)+", 0)"),this.rightSlider.setAttribute("transform","translate("+(this.endX-this.thumpPadding)+", 0)");var c=this.control.svgObject.getBoundingClientRect().left-this.control.element.getBoundingClientRect().left,d=this.control.enableRtl?this.endX:this.startX,p=this.control.enableRtl?this.startX:this.endX;this.leftRect={x:s?c+n:n,y:s?0:o.bounds.y,width:s?d-n:d,height:s?this.thumpY:o.bounds.height},this.rightRect={x:s?c+p:p,y:s?0:o.bounds.y,width:o.bounds.width-(h-n),height:s?this.thumpY:o.bounds.height},this.midRect={x:s?d+c:0,y:s?0:o.bounds.y,width:s?Math.abs(this.endX-this.startX):p,height:s?this.thumpY:o.bounds.height},this.currentStart=e,this.currentEnd=t,r&&(this.control.rangeTooltipModule.renderLeftTooltip(this),this.control.rangeTooltipModule.renderRightTooltip(this)),i&&this.triggerEvent(a)},e.prototype.triggerEvent=function(e){var t=this.control.chartSeries.xAxis,i=t.valueType,r={cancel:!1,start:"DateTime"===i?new Date(this.currentStart):"Logarithmic"===i?Math.pow(t.logBase,this.currentStart):this.currentStart,end:"DateTime"===i?new Date(this.currentEnd):"Logarithmic"===i?Math.pow(t.logBase,this.currentEnd):this.currentEnd,name:"changed",selectedData:ot(this.points,this.currentStart,this.currentEnd),zoomPosition:(this.control.enableRtl?e.max-this.currentEnd:this.currentStart-e.min)/e.delta,zoomFactor:(this.currentEnd-this.currentStart)/e.delta};this.control.trigger("changed",r)},e.prototype.addEventListener=function(){this.control.isDestroyed||(this.control.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.control.on(t.Browser.touchStartEvent,this.mouseDownHandler,this),this.control.on(t.Browser.touchEndEvent,this.mouseUpHandler,this),this.control.on(t.Browser.isPointer?"pointerleave":"mouseleave",this.mouseCancelHandler,this))},e.prototype.removeEventListener=function(){this.control.isDestroyed||(this.control.off(t.Browser.touchMoveEvent,this.mouseMoveHandler),this.control.off(t.Browser.touchStartEvent,this.mouseDownHandler),this.control.off(t.Browser.touchEndEvent,this.mouseUpHandler),this.control.off(t.Browser.isPointer?"pointerleave":"mouseleave",this.mouseCancelHandler))},e.prototype.mouseMoveHandler=function(e){var t,i,r=this.control,o=r.chartSeries.xAxis.actualRange,n=r.bounds;if(this.getCurrentSlider(e.target.id),this.isDrag&&r.mouseX>=n.x){switch(this.currentSlider){case"Left":r.startValue=this.getRangeValue(Math.abs(r.mouseX-n.x));break;case"Right":r.endValue=this.getRangeValue(Math.abs(r.mouseX-n.x));break;case"Middle":t=Math.max(this.getRangeValue(Math.abs(this.startX-(this.previousMoveX-r.mouseX)-n.x)),o.min),i=Math.min(this.getRangeValue(Math.abs(this.endX-(this.previousMoveX-r.mouseX)-n.x)),o.max),Math.floor(Math.abs(it(i,o,r.bounds.width,r.enableRtl)-it(t,o,r.bounds.width,r.enableRtl)))===Math.floor(this.sliderWidth)&&(r.startValue=t,r.endValue=i)}e.preventDefault&&this.isIOS&&e.preventDefault(),this.setSlider(r.startValue,r.endValue,!r.enableDeferredUpdate,r.rangeTooltipModule&&r.tooltip.enable),this.previousMoveX=r.mouseX}},e.prototype.getRangeValue=function(e){var t=this.control,i=t.chartSeries.xAxis.actualRange;return rt(e,t.bounds.width,i,t.enableRtl)},e.prototype.mouseDownHandler=function(e){this.currentSlider=this.getCurrentSlider(e.target.id),this.selectedElement.setAttribute("style","cursor: -webkit-grabbing"),this.isDrag=!("UnSelectedArea"===this.currentSlider||!this.currentSlider),this.previousMoveX=this.control.mouseDownX},e.prototype.getCurrentSlider=function(e){var t=this.control.themeStyle.thumbHoverColor;return e.indexOf(this.elementId+"_LeftSlider")>-1?(this.leftSlider.childNodes[2].setAttribute("fill",t),"Left"):e.indexOf(this.elementId+"_RightSlider")>-1?(this.rightSlider.childNodes[2].setAttribute("fill",t),"Right"):e.indexOf(this.elementId+"_SelectedArea")>-1?"Middle":e.indexOf("UnSelectedArea")>-1?(this.leftSlider.childNodes[2].setAttribute("fill",this.thumbColor),this.rightSlider.childNodes[2].setAttribute("fill",this.thumbColor),"UnSelectedArea"):e.indexOf(this.elementId+"_AxisLabel_")>-1&&"DateTime"===this.control.valueType?(this.labelIndex=+e.substring(e.lastIndexOf("_")+1,e.length),"firstLevelLabels"):e.indexOf(this.elementId+"_SecondaryLabel")>-1&&"DateTime"===this.control.valueType?(this.labelIndex=+e.substring(e.lastIndexOf("_")+1,e.length),"secondLevelLabels"):(this.leftSlider.childNodes[2].setAttribute("fill",this.thumbColor),this.rightSlider.childNodes[2].setAttribute("fill",this.thumbColor),this.control.periodSelectorModule&&(this.control.periodSelectorModule.triggerChange=!0),null)},e.prototype.mouseUpHandler=function(){var e=this.control,t=e.chartSeries.xAxis.actualRange,i=e.enableDeferredUpdate,r=e.tooltip.enable;if(e.stockChart&&(e.stockChart.zoomChange=!1),"UnSelectedArea"===this.currentSlider){var o=void 0,n=void 0,a=void 0,s=e.enableRtl,l=e.endValue-e.startValue;e.mouseDownX<this.startX?(o=Math.max(this.getRangeValue(e.mouseDownX-this.sliderWidth/2-e.bounds.x),t.min),a=s?o:o+l,n=s?o-l:o):(o=Math.min(this.getRangeValue(e.mouseDownX+this.sliderWidth/2-e.bounds.x),t.max),n=s?o:o-l,a=s?o+l:o),this.performAnimation(n,a,e),i=!1}else if("firstLevelLabels"===this.currentSlider||"secondLevelLabels"===this.currentSlider){var h=e.rangeAxis[this.currentSlider][this.labelIndex+1];this.performAnimation(e.rangeAxis[this.currentSlider][this.labelIndex].value,h?e.allowIntervalData?h.value-1:h.value:t.max,e),i=!1}this.isDrag&&e.allowSnapping&&(this.setAllowSnapping(e,this.currentStart,this.currentEnd,i,r),i=!1),i&&this.setSlider(this.currentStart,this.currentEnd,!0,r),null!==this.currentSlider&&this.control.periodSelectorSettings.periods.length>0&&(this.control.periodSelectorModule.triggerChange=!1,this.control.periodSelectorModule.datePicker.startDate=new Date(this.currentStart),this.control.periodSelectorModule.datePicker.endDate=new Date(this.currentEnd)),this.selectedElement.setAttribute("style","cursor: -webkit-grab"),e.startValue=this.currentStart,e.endValue=this.currentEnd,this.isDrag=!1,this.labelIndex=null,this.currentSlider=null},e.prototype.setAllowSnapping=function(e,t,i,r,o){var n=e.rangeAxis.lowerValues;n.push(e.chartSeries.xAxis.actualRange.max),this.setSlider(nt(n,t),nt(n,i),r,o),e.startValue=this.currentStart,e.endValue=this.currentEnd},e.prototype.performAnimation=function(e,i,r,o){var n=this,a=this.currentStart,s=this.currentEnd,l=r.enableDeferredUpdate,h=r.tooltip.enable;new t.Animation({}).animate(t.createElement("div"),{duration:t.isNullOrUndefined(o)?this.control.animationDuration:o,progress:function(t){n.setSlider(q(t.timeStamp,0,e-a,t.duration)+a,q(t.timeStamp,0,i-s,t.duration)+s,!l,h)},end:function(){r.allowSnapping?n.setAllowSnapping(r,e,i,!0,h):n.setSlider(e,i,!0,h),n.control.startValue=n.currentStart,n.control.endValue=n.currentEnd,n.control.periodSelectorSettings.periods.length>0&&(n.control.periodSelectorModule.triggerChange=!1,n.control.periodSelectorModule.datePicker.startDate=new Date(n.currentStart),n.control.periodSelectorModule.datePicker.endDate=new Date(n.currentEnd))}})},e.prototype.mouseCancelHandler=function(){this.isDrag&&this.control.allowSnapping&&this.setAllowSnapping(this.control,this.currentStart,this.currentEnd,!1,this.control.tooltip.enable),this.isDrag=!1,this.currentSlider=null,this.control.startValue=this.currentStart,this.control.endValue=this.currentEnd},e.prototype.destroy=function(){this.removeEventListener()},e}(),Oa=function(){function e(e){this.control={},this.rootControl=e}return e.prototype.setControlValues=function(e){"rangeNavigator"===e.getModuleName()?(this.control.periods=this.rootControl.periodSelectorSettings.periods,this.control.seriesXMax=e.chartSeries.xMax,this.control.seriesXMin=e.chartSeries.xMin,this.control.rangeSlider=e.rangeSlider,this.control.rangeNavigatorControl=e,this.control.endValue=e.endValue,this.control.startValue=e.startValue):(this.control.periods=this.rootControl.periods,this.control.endValue=this.control.seriesXMax=e.seriesXMax,this.control.startValue=this.control.seriesXMin=e.seriesXMin,this.control.rangeNavigatorControl=this.rootControl.rangeNavigator,this.control.rangeNavigatorControl&&(this.control.rangeSlider=this.rootControl.rangeNavigator.rangeSlider)),this.control.element=e.element,this.control.disableRangeSelector=e.disableRangeSelector},e.prototype.appendSelector=function(e,t){void 0===t&&(t=0),this.renderSelectorElement(null,e,t),this.renderSelector()},e.prototype.renderSelectorElement=function(e,r,o){this.periodSelectorSize=e?this.periodSelectorSize:new i.Rect(o,this.rootControl.titleSize.height,r.width,r.height);var n,a;e?(n=e.themeStyle.thumbWidth,a=e.element):(n=r.thumbSize,a=r.element),he(a.id+"_Secondary_Element")&&t.remove(he(a.id+"_Secondary_Element")),this.periodSelectorDiv=t.createElement("div",{id:a.id+"_Secondary_Element",styles:"width: "+(this.periodSelectorSize.width-n)+"px;height: "+this.periodSelectorSize.height+"px;top:"+this.periodSelectorSize.y+"px;left:"+(this.periodSelectorSize.x+n/2)+"px; position: absolute"}),a.appendChild(this.periodSelectorDiv)},e.prototype.renderSelector=function(){var e=this;this.setControlValues(this.rootControl);var i=!0,r=this.control.element.id,o=t.createElement("div",{id:r+"_selector"}),s=this.control.periods,l=this.updateCustomElement(),h="text-transform: none; text-overflow: unset",c=r+"customRange";this.periodSelectorDiv.appendChild(o);for(var d=0;d<s.length;d++)l.push({align:"Left",text:s[d].text});"stockChart"===this.rootControl.getModuleName()&&(i=this.rootControl.enableCustomRange),i&&(this.calendarId=r+"_calendar",l.push({template:"<button id="+this.calendarId+"></button>",align:"Right"}));var p={selector:l,name:"RangeSelector",cancel:!1,enableCustomFormat:!0,content:"Date Range"};"stockChart"===this.rootControl.getModuleName()&&(l.push({template:t.createElement("button",{id:r+"_reset",innerHTML:"Reset",styles:h,className:"e-dropdown-btn e-btn"}),align:"Right"}),this.rootControl.exportType.indexOf("Print")>-1&&l.push({template:t.createElement("button",{id:r+"_print",innerHTML:"Print",styles:h,className:"e-dropdown-btn e-btn"}),align:"Right"}),this.rootControl.exportType.length&&l.push({template:t.createElement("button",{id:r+"_export",innerHTML:"Export",styles:h,className:"e-dropdown-btn e-btn"}),align:"Right"})),this.rootControl.trigger("selectorRender",p),this.toolbar=new n.Toolbar({items:p.selector,height:this.periodSelectorSize.height,clicked:function(t){e.buttonClick(t,e.control)},created:function(){e.nodes=e.toolbar.element.querySelectorAll(".e-toolbar-left")[0],t.isNullOrUndefined(e.selectedIndex)&&s.map(function(t,i){t.selected&&(e.control.startValue=e.changedRange(t.intervalType,e.control.endValue,t.interval).getTime(),e.selectedIndex=e.nodes.childNodes.length-s.length+i)}),e.setSelectedStyle(e.selectedIndex)}}),this.toolbar.isStringTemplate=!0,this.toolbar.appendTo(o),this.triggerChange=!0,i&&(this.datePicker=new a.DateRangePicker({min:new Date(this.control.seriesXMin),max:new Date(this.control.seriesXMax),format:"dd'/'MM'/'yyyy",placeholder:"Select a range",showClearButton:!1,startDate:new Date(this.control.startValue),endDate:new Date(this.control.endValue),created:function(){if(p.enableCustomFormat){for(var i=document.getElementsByClassName("e-date-range-wrapper"),o=void 0,n=0;n<i.length;n++)-1!==i[n].children[0].id.indexOf(r)&&(o=i[n]);o.style.display="none",o.insertAdjacentElement("afterend",t.createElement("div",{id:c,innerHTML:p.content,className:"e-btn e-dropdown-btn",styles:'font-family: "Segoe UI"; font-size: 14px; font-weight: 500; text-transform: none '})),he(c).insertAdjacentElement("afterbegin",t.createElement("span",{id:r+"dateIcon",className:"e-input-group-icon e-range-icon e-btn-icon e-icons",styles:"font-size: 16px; min-height: 0px; margin: -3px 0 0 0; outline: none; min-width: 30px"})),document.getElementById(c).onclick=function(){e.datePicker.show(he(c))}}},change:function(t){if(e.triggerChange&&(e.control.rangeSlider&&t.event?e.control.rangeSlider.performAnimation(t.startDate.getTime(),t.endDate.getTime(),e.control.rangeNavigatorControl):t.event&&e.rootControl.rangeChanged(t.startDate.getTime(),t.endDate.getTime()),e.nodes=e.toolbar.element.querySelectorAll(".e-toolbar-left")[0],!e.rootControl.resizeTo&&e.control.rangeSlider&&e.control.rangeSlider.isDrag))for(var i=0,r=e.nodes.childNodes.length;i<r;i++)e.nodes.childNodes[i].childNodes[0].classList.remove("e-active"),e.nodes.childNodes[i].childNodes[0].classList.remove("e-active")}}),this.datePicker.appendTo("#"+this.calendarId))},e.prototype.updateCustomElement=function(){var e=[],i=this.rootControl.element.id,r="text-transform: none; text-overflow: unset";return"stockChart"===this.rootControl.getModuleName()&&(this.rootControl.seriesType.length&&e.push({template:t.createElement("button",{id:i+"_seriesType",innerHTML:"Series",styles:r}),align:"Left"}),this.rootControl.indicatorType.length&&e.push({template:t.createElement("button",{id:i+"_indicatorType",innerHTML:"Indicators",styles:r}),align:"Left"}),this.rootControl.trendlineType.length&&e.push({template:t.createElement("button",{id:i+"_trendType",innerHTML:"Trendline",styles:r}),align:"Left"})),e},e.prototype.setSelectedStyle=function(e){if(this.control.disableRangeSelector||"stockChart"===this.rootControl.getModuleName()){for(var t=0,i=this.nodes.childNodes.length;t<i;t++)this.nodes.childNodes[t].childNodes[0].classList.remove("e-active"),this.nodes.childNodes[t].childNodes[0].classList.remove("e-active");this.nodes.childNodes[e].childNodes[0].classList.add("e-flat"),this.nodes.childNodes[e].childNodes[0].classList.add("e-active")}},e.prototype.buttonClick=function(e,i){var r,o,n=this,a=e.item,s=this.control.rangeSlider,l=this.control.periods,h=l.filter(function(e){return e.text===a.text});l.map(function(t,i){t.text===e.item.text&&(n.selectedIndex=n.nodes.childNodes.length-l.length+i)}),""!==e.item.text&&this.setSelectedStyle(this.selectedIndex),"all"===a.text.toLowerCase()?(r=i.seriesXMin,o=i.seriesXMax,s?s.performAnimation(r,o,this.control.rangeNavigatorControl):this.rootControl.rangeChanged(r,o)):"ytd"===a.text.toLowerCase()?s?(r=new Date(new Date(s.currentEnd).getFullYear().toString()).getTime(),o=s.currentEnd,s.performAnimation(r,o,this.control.rangeNavigatorControl)):(r=new Date(new Date(this.rootControl.currentEnd).getFullYear().toString()).getTime(),o=this.rootControl.currentEnd,this.rootControl.rangeChanged(r,o)):""!==a.text.toLowerCase()&&(s?(r=this.changedRange(h[0].intervalType,s.currentEnd,h[0].interval).getTime(),o=s.currentEnd,s.performAnimation(r,o,this.control.rangeNavigatorControl)):(r=this.changedRange(h[0].intervalType,this.rootControl.currentEnd,h[0].interval).getTime(),o=this.rootControl.currentEnd,this.rootControl.rangeChanged(r,o))),"stockChart"===this.rootControl.getModuleName()&&(this.rootControl.zoomChange=!1),he(this.calendarId+"_popup")&&!t.Browser.isDevice&&(he(this.calendarId+"_popup").querySelectorAll(".e-range-header")[0].style.display="none")},e.prototype.changedRange=function(e,t,i){var r=new Date(t);switch(e){case"Quarter":r.setMonth(r.getMonth()-3*i);break;case"Months":r.setMonth(r.getMonth()-i);break;case"Weeks":r.setDate(r.getDate()-7*i);break;case"Days":r.setDate(r.getDate()-i);break;case"Hours":r.setHours(r.getHours()-i);break;case"Minutes":r.setMinutes(r.getMinutes()-i);break;case"Seconds":r.setSeconds(r.getSeconds()-i);break;default:r.setFullYear(r.getFullYear()-i)}return r},e.prototype.getModuleName=function(){return"PeriodSelector"},e.prototype.destroy=function(){},e}(),Ea=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ia=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},za=function(r){function o(e,t){var i=r.call(this,e,t)||this;return i.animateSeries=!0,i.chartid=57725,i}return Ea(o,r),o.prototype.preRender=function(){if(this.isBlazor=window.Blazor,this.unWireEvents(),this.setCulture(),this.allowServerDataBinding=!1,""===this.element.id){var e=document.getElementsByClassName("e-rangenavigator").length;this.element.id="rangenavigator_"+this.chartid+"_"+e}this.wireEvents()},o.prototype.initPrivateVariables=function(){this.doubleModule=new ni,this.labels=[],this.rangeSlider=new _a(this),this.chartSeries=new Sa(this),this.lineSeriesModule=new Vr,this.rangeAxis=new Pa(this)},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.setSliderValue=function(){var e="DateTime"===this.valueType,t=this.chartSeries.xAxis.actualRange;this.startValue=this.startValue?this.startValue:this.value[0]?e?new Date(this.value[0].toString()).getTime():+this.value[0]:t.min,this.endValue=this.endValue?this.endValue:this.value[1]?e?new Date(this.value[1].toString()).getTime():+this.value[1]:t.max},o.prototype.render=function(){var e=this,t={name:"load",rangeNavigator:this.isBlazor?{}:this,theme:this.theme};this.trigger("load",t,function(){e.theme=e.isBlazor?t.theme:e.theme,e.setTheme(),e.initPrivateVariables(),e.createRangeSvg(),e.calculateBounds(),e.chartSeries.renderChart(e),m("chartmeasuretext"),e.renderComplete(),e.allowServerDataBinding=!0})},o.prototype.setTheme=function(){this.themeStyle=at(this.theme,this)},o.prototype.createRangeSvg=function(){this.removeSvg(),He(this),this.renderChartBackground()},o.prototype.calculateBounds=function(){var e=this.enableGrouping?15:8,t=this.navigatorStyleSettings.thumb,r=i.measureText("tempString",this.labelStyle).height,o=this.margin,n=!this.series.length,a=!this.disableRangeSelector&&n&&this.tooltip.enable?35:0;this.isBlazor&&!this.periodSelectorModule&&this.periodSelectorSettings.periods.length&&!this.stockChart&&(this.periodSelectorModule=new Oa(this));var s=this.periodSelectorModule;this.periodSelectorModule&&this.periodSelectorSettings.periods.length>0&&(s.periodSelectorSize={x:0,y:0,height:0,width:0},s.periodSelectorSize.width=this.availableSize.width,s.periodSelectorSize.height=this.periodSelectorSettings.height,s.periodSelectorSize.y="Bottom"===this.periodSelectorSettings.position?this.availableSize.height-s.periodSelectorSize.height:0);var l="Top"===this.periodSelectorSettings.position&&s?s.periodSelectorSize.y+s.periodSelectorSize.height:0,h=0,c=0;this.stockChart&&this.stockChart.stockLegendModule&&this.stockChart.legendSettings.visible&&("Left"===this.stockChart.legendSettings.position?h+=this.stockChart.stockLegendModule.legendBounds.width:"Top"===this.stockChart.legendSettings.position&&(c+=this.stockChart.stockLegendModule.legendBounds.height)),this.bounds=new i.Rect(this.themeStyle.thumbWidth/2+t.border.width+o.left+h,o.top+a+l+c,this.availableSize.width-this.themeStyle.thumbWidth-2*t.border.width-o.left-o.right,this.availableSize.height-o.top-o.bottom-a-(s?s.periodSelectorSize.height:0));var d=("Outside"===this.labelPosition||n?r+e:0)+("Outside"===this.tickPosition||n?this.majorTickLines.height:0);if(this.bounds.height-=d,n){var p=this.enableGrouping?this.bounds.height-(r+e):this.bounds.height;this.bounds.y+=this.themeStyle.thumbHeight>p?(this.themeStyle.thumbHeight-p)/2:0}this.disableRangeSelector&&(this.bounds.y=0,this.bounds.height=this.periodSelectorSettings.periods.length>0?this.periodSelectorSettings.height:0)},o.prototype.renderChart=function(){this.chartSeries.renderSeries(this),this.rangeAxis.renderGridLines(),this.rangeAxis.renderAxisLabels(),this.chartSeries.appendSeriesElements(this),this.createSecondaryElement(),this.setSliderValue(),this.renderPeriodSelector(),this.renderSlider(),this.stockChart||this.element.appendChild(this.svgObject),this.trigger("loaded",{rangeNavigator:this.isBlazor?{}:this}),this.rangeSlider.setSlider(this.startValue,this.endValue,!1,this.tooltip.enable&&"Always"===this.tooltip.displayMode)},o.prototype.renderPeriodSelector=function(){this.periodSelectorModule&&(this.periodSelectorModule.renderSelectorElement(this),this.periodSelectorModule.renderSelector())},o.prototype.createSecondaryElement=function(){if(this.tooltip.enable){var e=this.createElement("div");e.id=this.element.id+"_Secondary_Element",e.setAttribute("style","position: relative"),this.element.appendChild(e)}},o.prototype.renderSlider=function(){this.rangeSlider.render(this),this.rangeSlider.setSlider(this.startValue,this.endValue,!0,this.tooltip.enable&&"Always"===this.tooltip.displayMode)},o.prototype.removeSvg=function(){he(this.element.id+"_Secondary_Element")&&(t.remove(he(this.element.id+"_Secondary_Element")),this.isReact&&this.clearTemplate());if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);this.svgObject.hasChildNodes()||!this.svgObject.parentNode||this.stockChart||t.remove(this.svgObject)}},o.prototype.unWireEvents=function(){var e=t.Browser.touchStartEvent,i=t.Browser.touchMoveEvent,r=t.Browser.touchEndEvent,o=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,e,this.rangeOnMouseDown),t.EventHandler.remove(this.element,i,this.mouseMove),t.EventHandler.remove(this.element,r,this.mouseEnd),t.EventHandler.remove(this.element,"click",this.rangeOnMouseClick),t.EventHandler.remove(this.element,o,this.mouseLeave),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.rangeResize)},o.prototype.wireEvents=function(){var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.rangeOnMouseDown,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMove,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEnd,this),t.EventHandler.add(this.element,"click",this.rangeOnMouseClick,this),t.EventHandler.add(this.element,e,this.mouseLeave,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.rangeResize.bind(this));var i=this.element;i.style.touchAction="none",i.style.msTouchAction="none",i.style.msContentZooming="none",i.style.msUserSelect="none",i.style.webkitUserSelect="none",i.style.position="relative",i.style.display="block"},o.prototype.rangeResize=function(){var e=this;if(!document.getElementById(this.element.id))return!1;this.animateSeries=!1,this.removeAllTooltip(),this.resizeTo&&clearTimeout(this.resizeTo);var t={rangeNavigator:this,name:"resized",currentSize:new i.Size(0,0),previousSize:new i.Size(this.availableSize.width,this.availableSize.height)};return this.resizeTo=+setTimeout(function(){if(e.isDestroyed)return void clearTimeout(e.resizeTo);e.createRangeSvg(),t.currentSize=e.availableSize,e.trigger("resized",t),e.calculateBounds(),e.chartSeries.processXAxis(e),e.chartSeries.calculateGroupingBounds(e),e.chartSeries.processYAxis(e),e.renderChart()},500),!1},o.prototype.removeAllTooltip=function(){this.tooltip.enable&&"Always"===this.tooltip.displayMode&&(he(this.element.id+"_leftTooltip")&&t.remove(he(this.element.id+"_leftTooltip")),he(this.element.id+"_rightTooltip")&&t.remove(he(this.element.id+"_rightTooltip")))},o.prototype.mouseMove=function(e){return he(this.stockChart?this.element.id:this.element.id+"_svg")&&(this.mouseX=this.setMouseX(e),this.notify(t.Browser.touchMoveEvent,e)),!1},o.prototype.mouseLeave=function(e){var i=this.rangeSlider;if(i.isDrag){var r=i.control.tooltip.enable;i.control.allowSnapping&&(i.isDrag=!1,i.setAllowSnapping(i.control,i.currentStart,i.currentEnd,!1,r)),i.triggerEvent(this.chartSeries.xAxis.actualRange)}var o=t.Browser.isPointer?"pointerleave":"mouseleave";return this.mouseX=this.setMouseX(e),this.notify(o,e),!1},o.prototype.rangeOnMouseClick=function(e){return this.notify("click",e),!1},o.prototype.print=function(e){new xr(this).print(e)},o.prototype.export=function(e,t,i,r,o,n,a){r=r||[this],new xr(this).export(e,t,i,r,o,n,a)},o.prototype.renderChartBackground=function(){if(!this.stockChart){var e=new Di(this.element.id+"_ChartBorder",this.background||this.themeStyle.background,{width:0,color:"transparent"},1,new i.Rect(0,0,this.availableSize.width,this.availableSize.height));this.svgObject.appendChild(this.renderer.drawRectangle(e))}},o.prototype.rangeOnMouseDown=function(e){return this.mouseDownX=this.setMouseX(e),this.notify(t.Browser.touchStartEvent,e),!1},o.prototype.mouseEnd=function(e){return this.mouseX=this.setMouseX(e),this.notify(t.Browser.touchEndEvent,e),!1},o.prototype.setMouseX=function(e){var t=e.type.indexOf("touch")>-1?e.changedTouches[0].clientX:e.clientX,i=this.element.getBoundingClientRect(),r=this.stockChart?he(this.element.id).getBoundingClientRect():he(this.element.id+"_svg").getBoundingClientRect();return t-i.left-Math.max(r.left-i.left,0)},o.prototype.getPersistData=function(){var e=["loaded"];return this.addOnPersist(e)},o.prototype.onPropertyChanged=function(e,t){var i=!1,o=!1,n=!1;this.animateSeries=!1;for(var a=0,s=Object.keys(e);a<s.length;a++)switch(s[a]){case"width":case"height":case"navigatorBorder":case"enableGrouping":case"labelPosition":case"tickPosition":case"labelStyle":o=!0;break;case"enableRtl":case"xName":case"yName":case"query":case"minimum":case"maximum":case"interval":case"intervalType":case"logBase":case"valueType":case"majorGridLines":case"minorGridLines":case"navigatorStyleSettings":case"labelFormat":case"skeleton":case"skeletonType":case"secondaryLabelAlignment":case"background":i=!0;break;case"dataSource":case"series":i=!0,o=!0;break;case"theme":this.animateSeries=!0;break;case"locale":r.prototype.refresh.call(this);break;case"value":this.startValue=null,this.endValue=null,n=!0}!o&&i&&(this.removeSvg(),this.chartSeries.xMin=1/0,this.chartSeries.xMax=-1/0,this.chartSeries.renderChart(this)),o&&i&&(this.removeSvg(),this.chartSeries.xMin=this.chartSeries.yMin=1/0,this.chartSeries.xMax=this.chartSeries.yMax=-1/0,this.calculateBounds(),this.chartSeries.renderChart(this)),o&&!i&&(this.removeSvg(),this.calculateBounds(),this.chartSeries.renderChart(this)),o||i||!n||(this.setSliderValue(),this.rangeSlider.setSlider(this.startValue,this.endValue,!0,this.tooltip.enable&&"Always"===this.tooltip.displayMode))},o.prototype.requiredModules=function(){var e=this,t=[];return this.series.map(function(i){t.push({member:i.type+"Series",args:[e]})}),this.periodSelectorSettings.periods.length>0&&t.push({member:"PeriodSelector",args:[this]}),"Double"!==this.valueType&&t.push({member:this.valueType,args:[this]}),this.tooltip.enable&&t.push({member:"RangeTooltip",args:[this]}),t},o.prototype.getModuleName=function(){return"rangeNavigator"},o.prototype.destroy=function(){this.unWireEvents(),this.isReact&&this.clearTemplate(),this.rangeSlider.destroy(),r.prototype.destroy.call(this),this.element.innerHTML="",this.element.classList.remove("e-rangenavigator")},Ia([t.Property(null)],o.prototype,"width",void 0),Ia([t.Property(null)],o.prototype,"height",void 0),Ia([t.Property(null)],o.prototype,"dataSource",void 0),Ia([t.Property(null)],o.prototype,"xName",void 0),Ia([t.Property(null)],o.prototype,"yName",void 0),Ia([t.Property()],o.prototype,"query",void 0),Ia([t.Collection([],Ma)],o.prototype,"series",void 0),Ia([t.Complex({},Ta)],o.prototype,"tooltip",void 0),Ia([t.Property(null)],o.prototype,"minimum",void 0),Ia([t.Property(null)],o.prototype,"maximum",void 0),Ia([t.Property(null)],o.prototype,"interval",void 0),Ia([t.Property("Auto")],o.prototype,"intervalType",void 0),Ia([t.Property("Hide")],o.prototype,"labelIntersectAction",void 0),Ia([t.Property(10)],o.prototype,"logBase",void 0),Ia([t.Property("Double")],o.prototype,"valueType",void 0),Ia([t.Property("Outside")],o.prototype,"labelPosition",void 0),Ia([t.Property(500)],o.prototype,"animationDuration",void 0),Ia([t.Property(!1)],o.prototype,"enableGrouping",void 0),Ia([t.Property(!1)],o.prototype,"enableDeferredUpdate",void 0),Ia([t.Property(!1)],o.prototype,"disableRangeSelector",void 0),Ia([t.Property(!1)],o.prototype,"allowSnapping",void 0),Ia([t.Property(!1)],o.prototype,"allowIntervalData",void 0),Ia([t.Property(!1)],o.prototype,"useGroupingSeparator",void 0),Ia([t.Property()],o.prototype,"groupBy",void 0),Ia([t.Property("Outside")],o.prototype,"tickPosition",void 0),Ia([t.Complex(e.RangeNavigatorTheme.axisLabelFont,Xt)],o.prototype,"labelStyle",void 0),Ia([t.Complex({},Ci)],o.prototype,"majorGridLines",void 0),Ia([t.Complex({},Ri)],o.prototype,"majorTickLines",void 0),Ia([t.Complex({},ka)],o.prototype,"navigatorStyleSettings",void 0),Ia([t.Complex({},ri)],o.prototype,"periodSelectorSettings",void 0),Ia([t.Complex({color:"#DDDDDD",width:1},Yt)],o.prototype,"navigatorBorder",void 0),Ia([t.Property("Material")],o.prototype,"theme",void 0),Ia([t.Property([])],o.prototype,"value",void 0),Ia([t.Property(null)],o.prototype,"background",void 0),Ia([t.Property("")],o.prototype,"labelFormat",void 0),Ia([t.Property("")],o.prototype,"skeleton",void 0),Ia([t.Property("DateTime")],o.prototype,"skeletonType",void 0),Ia([t.Property("Middle")],o.prototype,"secondaryLabelAlignment",void 0),Ia([t.Complex({top:5,bottom:5,right:5,left:5},Ut)],o.prototype,"margin",void 0),Ia([t.Event()],o.prototype,"load",void 0),Ia([t.Event()],o.prototype,"loaded",void 0),Ia([t.Event()],o.prototype,"resized",void 0),Ia([t.Event()],o.prototype,"labelRender",void 0),Ia([t.Event()],o.prototype,"changed",void 0),Ia([t.Event()],o.prototype,"tooltipRender",void 0),Ia([t.Event()],o.prototype,"selectorRender",void 0),Ia([t.Event()],o.prototype,"beforePrint",void 0),o=Ia([t.NotifyPropertyChanges],o)}(t.Component),Da=function(){function e(e){this.stockChart=e}return e.prototype.initializeChart=function(e){var i=this,r=this.stockChart;if(r.isProtectedOnChange=!0,r.chartObject){for(var o=document.getElementById(r.chartObject.id);o.firstChild;)o.removeChild(o.firstChild);he(r.chartObject+"_tooltip")&&t.remove(he(r.chartObject+"_tooltip"))}else r.chartObject=r.renderer.createGroup({id:r.element.id+"_stockChart_chart"}),r.mainObject.appendChild(r.chartObject);if(this.cartesianChartSize=this.calculateChartSize(),r.chart=new Rr({chartArea:r.chartArea,margin:this.findMargin(r),primaryXAxis:this.copyObject(r.primaryXAxis),primaryYAxis:this.copyObject(r.primaryYAxis),rows:r.rows,indicators:r.indicators,axes:r.axes,tooltipRender:function(e){i.stockChart.trigger("tooltipRender",e)},axisLabelRender:function(e){i.stockChart.trigger("axisLabelRender",e)},seriesRender:function(t){t.data&&i.stockChart.startValue&&i.stockChart.endValue&&(t.data=t.data.filter(function(e){return new Date(Date.parse(e[t.series.xName])).getTime()>=i.stockChart.startValue&&new Date(Date.parse(e[t.series.xName])).getTime()<=i.stockChart.endValue})),t.data=e||t.data,i.stockChart.trigger("seriesRender",t)},onZooming:function(e){i.stockChart.trigger(hi,e)},pointClick:function(e){i.stockChart.trigger("pointClick",e)},pointMove:function(e){i.stockChart.trigger("pointMove",e)},dataSource:r.dataSource,series:this.findSeriesCollection(r.series),zoomSettings:this.copyObject(r.zoomSettings),tooltip:r.tooltip,crosshair:r.crosshair,height:this.cartesianChartSize.height.toString(),selectedDataIndexes:r.selectedDataIndexes,selectionMode:r.selectionMode,isMultiSelect:r.isMultiSelect,annotations:r.annotations,theme:r.theme,legendSettings:{visible:!1},zoomComplete:function(e){if("DateTime"===e.axis.valueType&&r.rangeNavigator){i.stockChart.zoomChange=!0;var t=i.calculateUpdatedRange(e.currentZoomFactor,e.currentZoomPosition,e.axis);r.rangeSelector.sliderChange(t.start,t.end)}}}),0!==r.indicators.length){if(r.isSelect)for(var n=0;n<r.indicators.length;n++)r.chart.indicators[n].animation.enable=!1,r.chart.indicators[n].dataSource=t.extend([],r.chart.series[0].dataSource,null,!0);r.isSelect=!0}r.chart.stockChart=r,r.chart.appendTo(r.chartObject),r.isProtectedOnChange=!1},e.prototype.findMargin=function(e){var t={};return t.top=e.stockLegendModule&&e.legendSettings.visible&&"Top"===e.legendSettings.position?e.margin.top:2*e.margin.top,t.left=e.margin.left,t.right=e.margin.right,t.bottom=e.margin.bottom,t},e.prototype.findSeriesCollection=function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]),t[i].high=e[i].high,t[i].low=e[i].low,t[i].open=e[i].open,t[i].close=e[i].close,t[i].xName=e[i].xName,t[i].volume=e[i].volume,t[i].animation=e[i].animation,e[i].localData&&(t[i].dataSource=e[i].localData),t[i].yName=""===e[i].yName?e[i].close:e[i].yName;return t},e.prototype.calculateChartSize=function(){var e=this.stockChart;return new i.Size(e.availableSize.width,e.enablePeriodSelector&&e.enableSelector?e.availableSize.height-e.toolbarHeight-80:e.enableSelector&&!e.enablePeriodSelector?e.availableSize.height-80:e.enablePeriodSelector&&!e.enableSelector?e.availableSize.height-e.toolbarHeight:e.availableSize.height)},e.prototype.calculateUpdatedRange=function(e,t,i){var r,o,n=i.actualRange;return o=(r=n.min+t*n.delta)+e*n.delta,{start:r,end:o}},e.prototype.cartesianChartRefresh=function(e,t){e.cartesianChart.initializeChart(t)},e.prototype.copyObject=function(e){return t.extend({},e,{},!0)},e}(),Ba=function(){function e(e){this.stockChart=e}return e.prototype.initializeRangeNavigator=function(){var e=this,i=this.stockChart;if(i.selectorObject){for(var r=document.getElementById(i.selectorObject.id);r.firstChild;)r.removeChild(r.firstChild);he(i.selectorObject.id+"_leftTooltip")&&t.remove(he(i.selectorObject.id+"_leftTooltip")),he(i.selectorObject.id+"_rightTooltip")&&t.remove(he(i.selectorObject.id+"_rightTooltip"))}else i.selectorObject=i.renderer.createGroup({id:i.element.id+"_stockChart_rangeSelector",transform:"translate(0,"+i.cartesianChart.cartesianChartSize.height+")"}),i.mainObject.appendChild(i.selectorObject);i.rangeNavigator=new za({locale:"en",valueType:i.primaryXAxis.valueType,theme:this.stockChart.theme,series:this.findSeriesCollection(i.series),height:this.calculateChartSize().height.toString(),value:[new Date(i.startValue),new Date(i.endValue)],margin:this.findMargin(),tooltip:{enable:i.tooltip.enable,displayMode:"Always"},dataSource:i.dataSource,changed:function(t){var r={name:"rangeChange",end:t.end,selectedData:t.selectedData,start:t.start,zoomFactor:t.zoomFactor,zoomPosition:t.zoomPosition,data:void 0};e.stockChart.trigger("rangeChange",r),e.stockChart.startValue=t.start,e.stockChart.endValue=t.end,e.stockChart.zoomChange||e.stockChart.cartesianChart.cartesianChartRefresh(e.stockChart,r.data),i.periodSelector&&i.periodSelector.datePicker&&(i.periodSelector.datePicker.startDate=new Date(t.start),i.periodSelector.datePicker.endDate=new Date(t.end),i.periodSelector.datePicker.dataBind())}}),i.rangeNavigator.stockChart=i,i.rangeNavigator.appendTo(i.selectorObject)},e.prototype.findMargin=function(){var e={};return e.top=5,e.left=0,e.right=0,e.bottom=0,e},e.prototype.findSeriesCollection=function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]),t[i].xName=e[i].xName,t[i].yName=""===e[i].yName?e[i].close:e[i].yName;return t},e.prototype.calculateChartSize=function(){var e=this.stockChart;return new i.Size(e.availableSize.width,e.enableSelector?80:0)},e.prototype.sliderChange=function(e,t){this.stockChart.rangeNavigator.rangeSlider.performAnimation(e,t,this.stockChart.rangeNavigator,0)},e}(),Fa=function(){function e(e){this.selectedSeries="",this.selectedIndicator="",this.selectedTrendLine="",this.indicators=[],this.secondayIndicators=[],this.stockChart=e,this.selectedSeries=this.stockChart.series[0].type}return e.prototype.initializePeriodSelector=function(){var e=this.stockChart.tempPeriods;this.stockChart.periods=e,this.stockChart.periodSelector.rootControl=this.stockChart;var t=this.stockChart.chart.chartAxisLayoutPanel.seriesClipRect,i=he(this.stockChart.element.id+"_Secondary_Element"),r=this.stockChart.toolbarHeight;this.stockChart.periodSelector.appendSelector({thumbSize:0,element:i,width:t.width,height:r},t.x),this.initializeSeriesSelector(),this.initializeIndicatorSelector(),this.initializeTrendlineSelector(),this.exportButton(),this.printButton(),this.resetButton()},e.prototype.getDropDownItems=function(e){var t=[];if(e===this.stockChart.seriesType){for(o=0;o<e.length;o++)t.push({text:" "+e[o].toString()});for(o=0;o<this.stockChart.series.length;o++)for(var i=0;i<t.length;i++){var r=t[i].text.replace(" ","");(r="OHLC"===r?"HiloOpenClose":r)===this.stockChart.series[o].type&&(t[i].text=t[i].text.replace(" ","✔ "))}}else if(e===this.stockChart.exportType)for(o=0;o<e.length;o++)t.push({text:e[o].toString()});else for(var o=0;o<e.length;o++)"Print"!==e[o].toString()&&t.push({text:" "+e[o].toString()});return t},e.prototype.addedSeries=function(e){for(var t=this.stockChart.series,i=0;i<t.length;i++)if("volume"!==t[i].yName){t[i].type=e.indexOf("Candle")>-1?"Candle":e.indexOf("OHLC")>-1?"HiloOpenClose":e,t[i].enableSolidCandles="Candle"===e;for(var r=0;r<t[i].trendlines.length;r++){var o=t[i].trendlines[r];o.animation.enable=!1,o.enableTooltip=!1}}},e.prototype.initializeSeriesSelector=function(){var e=this;new s.DropDownButton({items:this.getDropDownItems(this.stockChart.seriesType),select:function(t){e.selectedSeries=t.item.text;var i=e.tickMark(t);if(e.addedSeries(i),e.stockChart.cartesianChart.initializeChart(),e.stockChart.stockLegendModule&&e.stockChart.stockLegendModule.legendCollections.length&&e.stockChart.legendSettings.visible){var r=e.stockChart.stockLegendModule.legendBounds;e.stockChart.stockLegendModule.renderLegend(e.stockChart,e.stockChart.legendSettings,r)}}}).appendTo("#"+this.stockChart.element.id+"_seriesType")},e.prototype.resetButton=function(){var e=this;this.stockChart.isProtectedOnChange=!0,(new l.Button).appendTo("#"+this.stockChart.element.id+"_reset"),document.getElementById(this.stockChart.element.id+"_reset").onclick=function(){for(var t=e.indicators.length;t;)e.stockChart.indicators.pop(),t--;e.indicators=[],e.secondayIndicators=[],e.stockChart.isSingleAxis?e.stockChart.rows=[{}]:(e.stockChart.rows.length>2&&e.stockChart.rows.splice(2,e.stockChart.rows.length-1),e.stockChart.axes.length>2&&(e.stockChart.axes.splice(1,e.stockChart.axes.length-1),e.stockChart.axes[0].rowIndex=1));for(var i=0;i<e.stockChart.series.length;i++)"volume"!==e.stockChart.series[i].yName&&(e.stockChart.series[i].type=e.stockChart.tempSeriesType[i],0!==e.stockChart.series[i].trendlines.length&&(e.stockChart.series[i].trendlines[0].width=0));e.stockChart.indicatorElements=null,e.stockChart.resizeTo=null,e.stockChart.zoomChange=!1,e.stockChart.refresh(),e.stockChart.isProtectedOnChange=!0}},e.prototype.initializeTrendlineSelector=function(){var e=this;this.trendlineDropDown=new s.DropDownButton({items:this.stockChart.resizeTo?this.trendlineDropDown.items:this.getDropDownItems(this.stockChart.trendlineType),select:function(t){var i=e.tickMark(t),r=i=(i=i.split(" ")[0].toLocaleLowerCase()+(i.split(" ")[1]?i.split(" ")[1]:"")).substr(0,1).toUpperCase()+i.substr(1);if(e.selectedTrendLine=""===e.selectedTrendLine?r:e.selectedTrendLine+","+r,e.trendline!==r){e.trendline=r;for(var o=0;o<e.stockChart.series.length;o++)if("volume"!==e.stockChart.series[o].yName)if(0===e.stockChart.series[0].trendlines.length){var n=void 0;e.stockChart.trendlinetriggered&&(n=[{type:r,width:1,enableTooltip:!1}],e.stockChart.trendlinetriggered=!1),e.stockChart.series[0].trendlines=n}else e.stockChart.series[0].trendlines[0].width=1,e.stockChart.series[0].trendlines[0].type=r,e.stockChart.series[0].trendlines[0].animation.enable=!!e.stockChart.trendlinetriggered;e.stockChart.cartesianChart.initializeChart()}else t.item.text=" "+t.item.text.replace("✔ ",""),e.stockChart.series[0].trendlines[0].width=0,e.trendline=null,e.stockChart.cartesianChart.initializeChart()}}),this.trendlineDropDown.appendTo("#"+this.stockChart.element.id+"_trendType")},e.prototype.initializeIndicatorSelector=function(){var e=this;this.indicatorDropDown=new s.DropDownButton({items:this.stockChart.resizeTo?this.indicatorDropDown.items:this.getDropDownItems(this.stockChart.indicatorType),select:function(t){for(var i=0;i<e.stockChart.series.length;i++)0!==e.stockChart.series[i].trendlines.length&&(e.stockChart.series[i].trendlines[0].animation.enable=!1);t.item.text=t.item.text.indexOf("✔ ")>=0?t.item.text.substr(t.item.text.indexOf(";")+1):t.item.text;var r=t.item.text.replace(" ",""),o=r=(r=r.split(" ")[0].toLocaleLowerCase()+(r.split(" ")[1]?r.split(" ")[1]:"")).substr(0,1).toUpperCase()+r.substr(1);if(e.selectedIndicator=-1===e.selectedIndicator.indexOf(o)?e.selectedIndicator+" "+o:e.selectedIndicator.replace(o,""),"Tma"===o||"BollingerBands"===o||"Sma"===o||"Ema"===o)if(-1===e.indicators.indexOf(o)){t.item.text="✔ "+t.item.text.replace(" ","");var n=e.getIndicator(o,e.stockChart.series[0].yAxisName);e.indicators.push(o),e.stockChart.indicators=e.stockChart.indicators.concat(n),e.stockChart.cartesianChart.initializeChart()}else{t.item.text=" "+t.item.text;for(var a=0;a<e.stockChart.indicators.length;a++)e.stockChart.indicators[a].type===o&&e.stockChart.indicators.splice(a,1);e.indicators.splice(e.indicators.indexOf(o),1),e.stockChart.cartesianChart.initializeChart()}else e.createIndicatorAxes(o,t)}}),this.indicatorDropDown.appendTo("#"+this.stockChart.element.id+"_indicatorType")},e.prototype.getIndicator=function(e,t){var i=this.stockChart.series[0];return[{type:e,period:3,yAxisName:t,dataSource:i.localData,xName:i.xName,open:i.open,close:i.close,high:i.high,low:i.low,volume:i.volume,fill:"Sma"===e?"#32CD32":"#6063ff",animation:{enable:!1},upperLine:{color:"#FFE200",width:1},periodLine:{width:2},lowerLine:{color:"#FAA512",width:1},fastPeriod:8,slowPeriod:5,macdType:"Both",width:1,macdPositiveColor:"#6EC992",macdNegativeColor:"#FF817F",bandColor:"rgba(245, 203, 35, 0.12)"}]},e.prototype.createIndicatorAxes=function(e,t){if(-1===this.indicators.indexOf(e)){t.item.text="✔ "+t.item.text.replace(" ",""),this.indicators.push(e);var i=this.stockChart.rows.length;this.stockChart.rows[this.stockChart.rows.length-1].height="15%";var r=[{height:100-15*i+"px"}];if(1===this.stockChart.rows.length&&(this.stockChart.isSingleAxis=!0),this.stockChart.rows=this.stockChart.rows.concat(r),this.stockChart.isSingleAxis)for(a=0;a<this.stockChart.axes.length;a++)this.stockChart.axes[a].rowIndex+=1;else this.stockChart.axes[0].rowIndex+=1;var o=[{plotOffset:10,opposedPosition:!0,rowIndex:this.stockChart.isSingleAxis?0:this.stockChart.axes.length,desiredIntervals:1,labelFormat:"n2",majorGridLines:this.stockChart.primaryYAxis.majorGridLines,lineStyle:this.stockChart.primaryYAxis.lineStyle,labelPosition:this.stockChart.primaryYAxis.labelPosition,majorTickLines:this.stockChart.primaryYAxis.majorTickLines,rangePadding:"None",name:e.toString()}];this.stockChart.axes=this.stockChart.axes.concat(o),this.stockChart.primaryYAxis.rowIndex=this.stockChart.isSingleAxis?i+1:0;var n=this.getIndicator(e,e.toString());this.stockChart.indicators=this.stockChart.indicators.concat(n),this.stockChart.cartesianChart.initializeChart()}else{t.item.text=" "+t.item.text;for(var a=0;a<this.stockChart.indicators.length;a++)this.stockChart.indicators[a].type===e&&this.stockChart.indicators.splice(a,1);this.indicators.splice(this.indicators.indexOf(e),1);for(var s=0,l=0;l<this.stockChart.axes.length;l++)this.stockChart.axes[l].name===e&&(s=this.stockChart.axes[l].rowIndex,this.stockChart.rows.splice(l,1),this.stockChart.axes.splice(l,1));for(l=0;l<this.stockChart.axes.length;l++)0!==this.stockChart.axes[l].rowIndex&&this.stockChart.axes[l].rowIndex>s&&(this.stockChart.axes[l].rowIndex=this.stockChart.axes[l].rowIndex-1);this.stockChart.cartesianChart.initializeChart()}},e.prototype.tickMark=function(e){for(var t,i=e.item.parentObj.items,r=0;r<i.length;r++)i[r].text=i[r].text.indexOf("✔ ")>=0?i[r].text.substr(i[r].text.indexOf(";")+1):i[r].text,i[r].text.indexOf(" ")>=0||(i[r].text=" "+i[r].text);return e.item.text.indexOf(" ")>=0?(t=e.item.text.replace(" ",""),e.item.text=e.item.text.replace(" ","✔ ")):t=e.item.text.replace("✔ ",""),t},e.prototype.printButton=function(){var e=this;this.stockChart.exportType.indexOf("Print")>-1&&((new l.Button).appendTo("#"+this.stockChart.element.id+"_print"),document.getElementById(this.stockChart.element.id+"_print").onclick=function(){e.stockChart.chart.print(e.stockChart.element.id)})},e.prototype.exportButton=function(){var e=this;new s.DropDownButton({items:this.getDropDownItems(this.stockChart.exportType),select:function(i){var r,o=i.item.text,n=e.stockChart,a=n.element.id+"_stockChart_",s=n.svgObject.getBoundingClientRect();n.chart.exportModule&&(e.stockChart.svgObject.insertAdjacentElement("afterbegin",e.addExportSettings()),r=n.svgObject.firstElementChild.getBoundingClientRect(),e.stockChart.svgObject.setAttribute("height",(s.height+r.height).toString()),he(a+"chart").style.transform="translateY("+r.height+"px)",n.enableSelector&&he(a+"rangeSelector").setAttribute("transform","translate(0,"+(n.cartesianChart.cartesianChartSize.height+r.height)+")"),n.chart.exportModule.export(o,"StockChart",null,[n],null,n.svgObject.clientHeight),t.remove(he(e.stockChart.element.id+"_additionalExport")),he(a+"chart").style.transform="translateY(0px)",n.enableSelector&&he(a+"rangeSelector").setAttribute("transform","translate(0,"+n.cartesianChart.cartesianChartSize.height+")"),e.stockChart.svgObject.setAttribute("height",s.height.toString()))}}).appendTo("#"+this.stockChart.element.id+"_export")},e.prototype.calculateAutoPeriods=function(){var e=[];return(e=this.findRange(this.stockChart.seriesXMin,this.stockChart.seriesXMax)).push({text:"YTD",selected:!0},{text:"All"}),e},e.prototype.findRange=function(e,t){var i=[];return(t-e)/3154e7>=1?i.push({text:"1M",interval:1,intervalType:"Months"},{text:"3M",interval:3,intervalType:"Months"},{text:"6M",interval:6,intervalType:"Months"},{text:"1Y",interval:1,intervalType:"Years"}):(t-e)/1577e7>=1?i.push({text:"1M",interval:1,intervalType:"Months"},{text:"3M",interval:3,intervalType:"Months"},{text:"6M",interval:6,intervalType:"Months"}):(t-e)/2628e6>=1?i.push({text:"1D",interval:1,intervalType:"Days"},{text:"3W",interval:3,intervalType:"Weeks"},{text:"1M",interval:1,intervalType:"Months"}):(t-e)/864e5>=1&&i.push({text:"1H",interval:1,intervalType:"Hours"},{text:"12H",interval:12,intervalType:"Hours"},{text:"1D",interval:1,intervalType:"Days"}),i},e.prototype.addExportSettings=function(){var e=this.stockChart.renderer.createGroup({id:this.stockChart.element.id+"_additionalExport",width:this.stockChart.availableSize.width}),t=i.measureText(this.stockChart.title,this.stockChart.titleStyle).height,r=new i.TextOption(e.id+"_Title",Ye(new i.Rect(0,0,this.stockChart.availableSize.width,0),this.stockChart.titleStyle),0,"middle",this.stockChart.title,"","text-before-edge");Ve(this.stockChart.renderer,r,this.stockChart.titleStyle,this.stockChart.titleStyle.color,e);var o={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},n=i.measureText("Series: "+this.selectedSeries,o).width/2,a=t;return this.textElementSpan(new i.TextOption(e.id+"_Series",n,a,"start",["Series : ",this.selectedSeries],"","text-before-edge"),o,"black",e),n+=i.measureText("Series: "+this.selectedSeries+" Z",o).width,""!==this.selectedIndicator&&(this.textElementSpan(new i.TextOption(e.id+"_Indicator",n,a,"start",["Indicator :",this.selectedIndicator],"","text-before-edge"),o,"black",e),n+=i.measureText("Indicator: "+this.selectedIndicator+" Z",o).width),""!==this.selectedTrendLine&&this.textElementSpan(new i.TextOption(e.id+"_TrendLine",n,a,"start",["Trendline :",this.selectedTrendLine],"","text-before-edge"),o,"black",e),e},e.prototype.textElementSpan=function(e,t,r,o,n,a,s,l,h){void 0===n&&(n=!1),void 0===l&&(l=!1);var c,d=new i.SvgRenderer(""),p={};p={id:e.id,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight,"text-anchor":e.anchor,x:e.x,y:e.y,fill:r,"font-size":t.size,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine};var u="string"==typeof e.text?e.text:n?e.text[e.text.length-1]:e.text[0],g=d.createText(p,u);if("string"!=typeof e.text&&e.text.length>1)for(var y=1,m=e.text.length;y<m;y++)e.text[y]=" "+e.text[y],c=d.createTSpan({x:e.x+i.measureText(u,t).width+5,id:e.id,y:e.y,opacity:.5},e.text[y]),g.appendChild(c);return be(!1,o,g,a,s,"x","y",null,null,l,!1,null,h),g},e}(),Na=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Va=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ja=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("")],i.prototype,"color",void 0),Va([t.Property("16px")],i.prototype,"size",void 0),Va([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),Va([t.Property("Normal")],i.prototype,"fontStyle",void 0),Va([t.Property("Normal")],i.prototype,"fontWeight",void 0),Va([t.Property(1)],i.prototype,"opacity",void 0),Va([t.Property("Trim")],i.prototype,"textOverflow",void 0),Va([t.Property("Center")],i.prototype,"textAlignment",void 0),i}(t.ChildProperty),Ha=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("")],i.prototype,"color",void 0),Va([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),Xa=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Complex({},Ha)],i.prototype,"border",void 0),Va([t.Property("transparent")],i.prototype,"background",void 0),Va([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Ya=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property(10)],i.prototype,"left",void 0),Va([t.Property(10)],i.prototype,"right",void 0),Va([t.Property(10)],i.prototype,"top",void 0),Va([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),Ga=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return Na(r,i),Va([t.Property(!1)],r.prototype,"startFromAxis",void 0),Va([t.Property(!0)],r.prototype,"visible",void 0),Va([t.Property(null)],r.prototype,"start",void 0),Va([t.Property("#808080")],r.prototype,"color",void 0),Va([t.Property(null)],r.prototype,"end",void 0),Va([t.Property(null)],r.prototype,"size",void 0),Va([t.Property("Auto")],r.prototype,"sizeType",void 0),Va([t.Property(null)],r.prototype,"dashArray",void 0),Va([t.Property(!1)],r.prototype,"isRepeat",void 0),Va([t.Property(null)],r.prototype,"repeatEvery",void 0),Va([t.Property(!1)],r.prototype,"isSegmented",void 0),Va([t.Property(null)],r.prototype,"repeatUntil",void 0),Va([t.Property(null)],r.prototype,"segmentStart",void 0),Va([t.Property(null)],r.prototype,"segmentAxisName",void 0),Va([t.Property(null)],r.prototype,"segmentEnd",void 0),Va([t.Property(1)],r.prototype,"opacity",void 0),Va([t.Property("")],r.prototype,"text",void 0),Va([t.Complex({color:"transparent",width:1},Ha)],r.prototype,"border",void 0),Va([t.Property(null)],r.prototype,"rotation",void 0),Va([t.Property("Behind")],r.prototype,"zIndex",void 0),Va([t.Property("Middle")],r.prototype,"horizontalAlignment",void 0),Va([t.Property("Middle")],r.prototype,"verticalAlignment",void 0),Va([t.Complex(e.Theme.stripLineLabelFont,ja)],r.prototype,"textStyle",void 0),r}(t.ChildProperty),Wa=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property(0)],i.prototype,"delay",void 0),Va([t.Property(!1)],i.prototype,"enable",void 0),Va([t.Property(1e3)],i.prototype,"duration",void 0),i}(t.ChildProperty),Ua=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property(null)],i.prototype,"fill",void 0),Va([t.Property("Gap")],i.prototype,"mode",void 0),Va([t.Complex({color:"transparent",width:0},Ha)],i.prototype,"border",void 0),i}(t.ChildProperty),Za=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("Line")],i.prototype,"type",void 0),Va([t.Property(null)],i.prototype,"length",void 0),Va([t.Property(null)],i.prototype,"color",void 0),Va([t.Property("")],i.prototype,"dashArray",void 0),Va([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),qa=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.localData=void 0,t}return Na(i,e),Va([t.Property("date")],i.prototype,"xName",void 0),Va([t.Property("close")],i.prototype,"yName",void 0),Va([t.Property("open")],i.prototype,"open",void 0),Va([t.Property("close")],i.prototype,"close",void 0),Va([t.Property("high")],i.prototype,"high",void 0),Va([t.Property("low")],i.prototype,"low",void 0),Va([t.Property("volume")],i.prototype,"volume",void 0),Va([t.Property("")],i.prototype,"pointColorMapping",void 0),Va([t.Property("SeriesType")],i.prototype,"legendShape",void 0),Va([t.Property("")],i.prototype,"legendImageUrl",void 0),Va([t.Complex(null,Wa)],i.prototype,"animation",void 0),Va([t.Property(null)],i.prototype,"xAxisName",void 0),Va([t.Property(null)],i.prototype,"yAxisName",void 0),Va([t.Property(null)],i.prototype,"fill",void 0),Va([t.Property("0")],i.prototype,"dashArray",void 0),Va([t.Property(1)],i.prototype,"width",void 0),Va([t.Property("")],i.prototype,"name",void 0),Va([t.Property("")],i.prototype,"dataSource",void 0),Va([t.Property()],i.prototype,"query",void 0),Va([t.Property("#e74c3d")],i.prototype,"bullFillColor",void 0),Va([t.Property("#2ecd71")],i.prototype,"bearFillColor",void 0),Va([t.Property(!1)],i.prototype,"enableSolidCandles",void 0),Va([t.Property(!0)],i.prototype,"visible",void 0),Va([t.Complex({color:"transparent",width:0},Ha)],i.prototype,"border",void 0),Va([t.Property(1)],i.prototype,"opacity",void 0),Va([t.Property("Candle")],i.prototype,"type",void 0),Va([t.Complex(null,Ji)],i.prototype,"marker",void 0),Va([t.Collection([],er)],i.prototype,"trendlines",void 0),Va([t.Property(!0)],i.prototype,"enableTooltip",void 0),Va([t.Property("")],i.prototype,"tooltipMappingName",void 0),Va([t.Property(null)],i.prototype,"selectionStyle",void 0),Va([t.Property(.5)],i.prototype,"cardinalSplineTension",void 0),Va([t.Complex(null,$t)],i.prototype,"cornerRadius",void 0),Va([t.Complex(null,Ua)],i.prototype,"emptyPointSettings",void 0),Va([t.Property(null)],i.prototype,"columnWidth",void 0),Va([t.Property(0)],i.prototype,"columnSpacing",void 0),i}(t.ChildProperty),Qa=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("Sma")],i.prototype,"type",void 0),Va([t.Property(14)],i.prototype,"period",void 0),Va([t.Property(3)],i.prototype,"dPeriod",void 0),Va([t.Property(14)],i.prototype,"kPeriod",void 0),Va([t.Property(80)],i.prototype,"overBought",void 0),Va([t.Property(20)],i.prototype,"overSold",void 0),Va([t.Property("Close")],i.prototype,"field",void 0),Va([t.Property(2)],i.prototype,"standardDeviation",void 0),Va([t.Property(12)],i.prototype,"slowPeriod",void 0),Va([t.Property(!0)],i.prototype,"showZones",void 0),Va([t.Property(26)],i.prototype,"fastPeriod",void 0),Va([t.Complex({color:"#ff9933",width:2},Za)],i.prototype,"macdLine",void 0),Va([t.Property("Both")],i.prototype,"macdType",void 0),Va([t.Property("#e74c3d")],i.prototype,"macdNegativeColor",void 0),Va([t.Property("#2ecd71")],i.prototype,"macdPositiveColor",void 0),Va([t.Property("rgba(211,211,211,0.25)")],i.prototype,"bandColor",void 0),Va([t.Complex({color:"#ffb735",width:1},Za)],i.prototype,"upperLine",void 0),Va([t.Property("")],i.prototype,"seriesName",void 0),Va([t.Complex({color:"#f2ec2f",width:1},Za)],i.prototype,"periodLine",void 0),Va([t.Complex({color:"#f2ec2f",width:1},Za)],i.prototype,"lowerLine",void 0),Va([t.Property("")],i.prototype,"high",void 0),Va([t.Property("")],i.prototype,"open",void 0),Va([t.Property("")],i.prototype,"low",void 0),Va([t.Property("")],i.prototype,"xName",void 0),Va([t.Property("")],i.prototype,"close",void 0),Va([t.Property("")],i.prototype,"pointColorMapping",void 0),Va([t.Property("")],i.prototype,"volume",void 0),Va([t.Property(null)],i.prototype,"xAxisName",void 0),Va([t.Property(null)],i.prototype,"yAxisName",void 0),Va([t.Complex(null,Wa)],i.prototype,"animation",void 0),Va([t.Property(null)],i.prototype,"fill",void 0),Va([t.Property("0")],i.prototype,"dashArray",void 0),Va([t.Property(1)],i.prototype,"width",void 0),Va([t.Property()],i.prototype,"query",void 0),Va([t.Property("")],i.prototype,"dataSource",void 0),i}(t.ChildProperty),$a=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return Na(r,i),Va([t.Complex({},Ai)],r.prototype,"crosshairTooltip",void 0),Va([t.Complex(e.Theme.axisLabelFont,ja)],r.prototype,"labelStyle",void 0),Va([t.Property("")],r.prototype,"title",void 0),Va([t.Complex(e.Theme.axisTitleFont,ja)],r.prototype,"titleStyle",void 0),Va([t.Property("")],r.prototype,"labelFormat",void 0),Va([t.Property("DateTime")],r.prototype,"skeletonType",void 0),Va([t.Property("")],r.prototype,"skeleton",void 0),Va([t.Property(0)],r.prototype,"plotOffset",void 0),Va([t.Property(10)],r.prototype,"logBase",void 0),Va([t.Property(0)],r.prototype,"rowIndex",void 0),Va([t.Property(1)],r.prototype,"span",void 0),Va([t.Property(3)],r.prototype,"maximumLabels",void 0),Va([t.Property(null)],r.prototype,"desiredIntervals",void 0),Va([t.Property(1)],r.prototype,"zoomFactor",void 0),Va([t.Property(0)],r.prototype,"zoomPosition",void 0),Va([t.Property(!1)],r.prototype,"opposedPosition",void 0),Va([t.Property(!0)],r.prototype,"enableAutoIntervalOnZooming",void 0),Va([t.Property("Double")],r.prototype,"valueType",void 0),Va([t.Property("Auto")],r.prototype,"rangePadding",void 0),Va([t.Property("None")],r.prototype,"edgeLabelPlacement",void 0),Va([t.Property("BetweenTicks")],r.prototype,"labelPlacement",void 0),Va([t.Property("Auto")],r.prototype,"intervalType",void 0),Va([t.Property("Outside")],r.prototype,"tickPosition",void 0),Va([t.Property("")],r.prototype,"name",void 0),Va([t.Property("Outside")],r.prototype,"labelPosition",void 0),Va([t.Property(!0)],r.prototype,"visible",void 0),Va([t.Property(0)],r.prototype,"labelRotation",void 0),Va([t.Property(0)],r.prototype,"minorTicksPerInterval",void 0),Va([t.Property(null)],r.prototype,"crossesAt",void 0),Va([t.Property(null)],r.prototype,"crossesInAxis",void 0),Va([t.Property(!0)],r.prototype,"placeNextToAxisLine",void 0),Va([t.Property(null)],r.prototype,"minimum",void 0),Va([t.Property(null)],r.prototype,"interval",void 0),Va([t.Property(null)],r.prototype,"maximum",void 0),Va([t.Property(34)],r.prototype,"maximumLabelWidth",void 0),Va([t.Complex({},Ri)],r.prototype,"majorTickLines",void 0),Va([t.Property(!1)],r.prototype,"enableTrim",void 0),Va([t.Complex({},Mi)],r.prototype,"minorTickLines",void 0),Va([t.Complex({},Pi)],r.prototype,"minorGridLines",void 0),Va([t.Complex({},Ci)],r.prototype,"majorGridLines",void 0),Va([t.Complex({},Li)],r.prototype,"lineStyle",void 0),Va([t.Property(!1)],r.prototype,"isInversed",void 0),Va([t.Property("Trim")],r.prototype,"labelIntersectAction",void 0),Va([t.Property(100)],r.prototype,"coefficient",void 0),Va([t.Property(0)],r.prototype,"startAngle",void 0),Va([t.Property(2)],r.prototype,"tabIndex",void 0),Va([t.Collection([],Ga)],r.prototype,"stripLines",void 0),Va([t.Property(null)],r.prototype,"description",void 0),r}(t.ChildProperty),Ja=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("100%")],i.prototype,"height",void 0),Va([t.Complex({},Ha)],i.prototype,"border",void 0),i}(t.ChildProperty),Ka=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property(2)],i.prototype,"period",void 0),Va([t.Property("")],i.prototype,"name",void 0),Va([t.Property("Linear")],i.prototype,"type",void 0),Va([t.Property(2)],i.prototype,"polynomialOrder",void 0),Va([t.Property(0)],i.prototype,"forwardForecast",void 0),Va([t.Property(0)],i.prototype,"backwardForecast",void 0),Va([t.Complex({},Wa)],i.prototype,"animation",void 0),Va([t.Property(!0)],i.prototype,"enableTooltip",void 0),Va([t.Complex({},Ji)],i.prototype,"marker",void 0),Va([t.Property(null)],i.prototype,"intercept",void 0),Va([t.Property("")],i.prototype,"fill",void 0),Va([t.Property("SeriesType")],i.prototype,"legendShape",void 0),Va([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),es=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property("0")],i.prototype,"y",void 0),Va([t.Property("0")],i.prototype,"x",void 0),Va([t.Property(null)],i.prototype,"content",void 0),Va([t.Property("Chart")],i.prototype,"region",void 0),Va([t.Property("Center")],i.prototype,"horizontalAlignment",void 0),Va([t.Property("Pixel")],i.prototype,"coordinateUnits",void 0),Va([t.Property("Middle")],i.prototype,"verticalAlignment",void 0),Va([t.Property(null)],i.prototype,"yAxisName",void 0),Va([t.Property(null)],i.prototype,"description",void 0),Va([t.Property(null)],i.prototype,"xAxisName",void 0),i}(t.ChildProperty),ts=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Na(i,e),Va([t.Property(0)],i.prototype,"point",void 0),Va([t.Property(0)],i.prototype,"series",void 0),i}(t.ChildProperty),is=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return Na(r,i),Va([t.Property("Circle")],r.prototype,"type",void 0),Va([t.Property("")],r.prototype,"text",void 0),Va([t.Property("")],r.prototype,"description",void 0),Va([t.Property()],r.prototype,"date",void 0),Va([t.Complex({color:"black",width:1},Ha)],r.prototype,"border",void 0),Va([t.Property("transparent")],r.prototype,"background",void 0),Va([t.Property(!0)],r.prototype,"showOnSeries",void 0),Va([t.Property("close")],r.prototype,"placeAt",void 0),Va([t.Complex(e.Theme.stockEventFont,ja)],r.prototype,"textStyle",void 0),Va([t.Property([])],r.prototype,"seriesIndexes",void 0),r}(t.ChildProperty),rs=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),os=function(e){function o(t){var i=e.call(this,t.chart)||this;return i.symbolLocations=[],i.stockChart=t,i.chartId=i.stockChart.element.id,i}return rs(o,e),o.prototype.renderStockEvents=function(){var e,t,r,o=this.stockChart,n=o.renderer.createGroup({id:this.chartId+"_StockEvents"});this.symbolLocations=st(o.series.length,o.stockEvents.length,new Vi(0,0));for(var a=0;a<o.stockEvents.length;a++){e=this.stockChart.stockEvents[a];for(var s=0,l=o.chart.series;s<l.length;s++){var h=l[s],c={name:"stockEventRender",stockChart:o,text:e.text,type:e.type,cancel:!1,series:h};if(o.trigger("stockEventRender",c),e.text=c.text,e.type=c.type,r=i.measureText(e.text+"W",e.textStyle),!c.cancel&&(t=o.renderer.createGroup({id:this.chartId+"_Series_"+h.index+"_StockEvents_"+a}),x(this.stockChart.isBlazor?Date.parse(e.date.toString()):this.dateParse(e.date).getTime(),h.xAxis.visibleRange)))if(e.seriesIndexes.length>0)for(var d=0;d<e.seriesIndexes.length;d++)e.seriesIndexes[d]===h.index&&n.appendChild(this.creatEventGroup(t,h,e,a,r));else n.appendChild(this.creatEventGroup(t,h,e,a,r))}}return n},o.prototype.creatEventGroup=function(e,t,i,r,o){var n=this.findClosePoint(t,i);return i.showOnSeries||(n.y=t.yAxis.rect.y+t.yAxis.rect.height),this.symbolLocations[t.index][r]=n,this.createStockElements(e,i,t,r,n,o),e},o.prototype.findClosePoint=function(e,t){for(var i,r,o,n=this.stockChart.isBlazor?Date.parse(t.date.toString()):this.dateParse(t.date).getTime(),a=this.getClosest(e,n),s=0;s<e.points.length;s++)a===(r=e.points[s]).xValue&&r.visible?i=new Yi(r,e):0!==s&&s!==e.points.length&&a>e.points[s-1].xValue&&a<e.points[s+1].xValue&&(i=new Yi(r,e));var l=e.xAxis.rect.x+I(i.point.xValue,e.xAxis)*e.xAxis.rect.width;return o=I(i.point[t.placeAt],e.yAxis)*e.yAxis.rect.height,o=-1*o+(e.yAxis.rect.y+e.yAxis.rect.height),new Vi(l,o)},o.prototype.createStockElements=function(e,t,r,o,n,a){var s,l,h=new i.Size(a.width>20?a.width:20,a.height>20?a.height:20),c=n.x,d=n.y,p=this.chartId+"_Series_"+r.index+"_StockEvents_"+o,u=t.border;switch(t.type){case"Flag":case"Circle":case"Square":e.appendChild(ne(new Vi(c,d),"Circle",new i.Size(2,2),"",new i.PathOption(p+"_Circle","transparent",u.width,u.color),this.dateParse(t.date).toISOString())),e.appendChild(ne(new Vi(c,d-5),"VerticalLine",new i.Size(9,9),"",new i.PathOption(p+"_Path",u.color,u.width,u.color),this.dateParse(t.date).toISOString())),e.appendChild(ne(new Vi("Flag"!==t.type?c:c+h.width/2,d-h.height),t.type,h,"",new i.PathOption(p+"_Shape",t.background,u.width,u.color),this.dateParse(t.date).toISOString())),Ve(this.stockChart.renderer,new i.TextOption(p+"_Text","Flag"!==t.type?n.x:n.x+h.width/2,n.y-h.height,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e);break;case"ArrowUp":case"ArrowDown":case"ArrowRight":case"ArrowLeft":s="M "+c+" "+d+" "+this.findArrowpaths(t.type),l=new i.PathOption(p+"_Shape",t.background,u.width,u.color,1,"",s),e.appendChild(this.stockChart.renderer.drawPath(l));break;case"Triangle":case"InvertedTriangle":h.height=3*a.height,h.width=a.width+1.5*a.width,e.appendChild(ne(new Vi(n.x,n.y),t.type,new i.Size(20,20),"",new i.PathOption(p+"_Shape",t.background,u.width,u.color),this.dateParse(t.date).toISOString())),Ve(this.stockChart.renderer,new i.TextOption(p+"_Text",n.x,n.y,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e);break;case"Text":a.height+=8,s="M "+c+" "+d+" L "+(c-5)+" "+(d-5)+" L "+(c-a.width/2)+" "+(d-5)+" L "+(c-a.width/2)+" "+(d-a.height)+" L "+(c+a.width/2)+" "+(d-a.height)+" L "+(c+a.width/2)+" "+(d-5)+" L "+(c+5)+" "+(d-5)+" Z",l=new i.PathOption(p+"_Shape",t.background,u.width,u.color,1,"",s),e.appendChild(this.stockChart.renderer.drawPath(l)),Ve(this.stockChart.renderer,new i.TextOption(p+"_Text",c,d-a.height/2,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e);break;default:s="M "+c+" "+d+" L "+(c-a.width/2)+" "+(d-a.height/3)+" L "+(c-a.width/2)+" "+(d-a.height)+" L "+(c+a.width/2)+" "+(d-a.height)+" L "+(c+a.width/2)+" "+(d-a.height/3)+" Z",l=new i.PathOption(p+"_Shape",t.background,u.width,u.color,1,"",s),e.appendChild(this.stockChart.renderer.drawPath(l)),Ve(this.stockChart.renderer,new i.TextOption(p+"_Text",c,d-a.height/2,"middle",t.text,"","middle"),t.textStyle,t.textStyle.color,e)}},o.prototype.renderStockEventTooltip=function(e){var r=parseInt(e.split("_StockEvents_")[0].split(this.chartId+"_Series_")[1],10),o=parseInt(e.split("_StockEvents_")[1].replace(/\D+/g,""),10),n=this.symbolLocations[r][o],a=new Vi(n.x,n.y+this.stockChart.toolbarHeight+this.stockChart.titleSize.height);this.applyHighLights(o,r);var s=this.getElement(this.chartId+"_StockEvents_Tooltip_svg");if(s&&parseInt(s.getAttribute("opacity"),10)>0)this.stockEventTooltip.content=[this.stockChart.stockEvents[o].description],this.stockEventTooltip.location=a,this.stockEventTooltip.dataBind();else{he(this.chartId+"_StockEvents_Tooltip_svg")&&t.remove(he(this.chartId+"_StockEvents_Tooltip"));var l=t.createElement("div",{id:this.chartId+"_StockEvents_Tooltip",className:"ejSVGTooltip",attrs:{style:"pointer-events:none; position:absolute;z-index: 1"}});he(this.chartId+"_Secondary_Element").appendChild(l),this.stockEventTooltip=new i.Tooltip({opacity:1,header:"",content:[this.stockChart.stockEvents[o].description],enableAnimation:!0,location:a,theme:this.stockChart.theme,inverted:!0,areaBounds:this.stockChart.chart.chartAxisLayoutPanel.seriesClipRect}),this.stockEventTooltip.areaBounds.y+=this.stockChart.toolbarHeight+this.stockChart.titleSize.height,this.stockEventTooltip.appendTo("#"+l.id)}},o.prototype.removeStockEventTooltip=function(e){var t=this,i=this.getElement(this.chartId+"_StockEvents_Tooltip");this.stopAnimation(),i&&this.stockEventTooltip&&(this.toolTipInterval=+setTimeout(function(){t.stockEventTooltip.fadeOut(),t.removeHighLights()},e))},o.prototype.findArrowpaths=function(e){var t="";switch(e){case"ArrowUp":t="l -10 10 l 5 0 l 0 10 l 10 0 l 0 -10 l 5 0 z";break;case"ArrowDown":t="l -10 -10 l 5 0 l 0 -10 l 10 0 l 0 10 l 5 0 z";break;case"ArrowLeft":t="l -10 -10 l 0 5 l -10 0 l 0 10 l 10 0 l 0 5 z";break;case"ArrowRight":t="l 10 -10 l 0 5 l 10 0 l 0 10 l -10 0 l 0 5 z"}return t},o.prototype.applyHighLights=function(e,t){this.pointIndex===e&&this.seriesIndex===t||this.removeHighLights(),this.pointIndex=e,this.seriesIndex=t;var i=this.chartId+"_Series_"+t+"_StockEvents_"+e;this.setOpacity(i+"_Shape",.5),this.setOpacity(i+"_Text",.5)},o.prototype.removeHighLights=function(){var e=this.chartId+"_Series_"+this.seriesIndex+"_StockEvents_"+this.pointIndex;this.setOpacity(e+"_Shape",1),this.setOpacity(e+"_Text",1)},o.prototype.setOpacity=function(e,t){he(e)&&he(e).setAttribute("opacity",t.toString())},o.prototype.dateParse=function(e){var t=this.chart.intl.getDateParser({skeleton:"full",type:"dateTime"}),i=this.chart.intl.getDateFormat({skeleton:"full",type:"dateTime"});return new Date(Date.parse(t(i(new Date(r.DataUtil.parse.parseJson({val:e}).val)))))},o}(un),ns=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),as=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ss=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ns(r,i),as([t.Property(!1)],r.prototype,"visible",void 0),as([t.Property(null)],r.prototype,"height",void 0),as([t.Property(null)],r.prototype,"width",void 0),as([t.Complex({x:0,y:0},ur)],r.prototype,"location",void 0),as([t.Property("Auto")],r.prototype,"position",void 0),as([t.Property("Series")],r.prototype,"mode",void 0),as([t.Property(8)],r.prototype,"padding",void 0),as([t.Property("Center")],r.prototype,"alignment",void 0),as([t.Complex(e.Theme.legendLabelFont,ja)],r.prototype,"textStyle",void 0),as([t.Property(10)],r.prototype,"shapeHeight",void 0),as([t.Property(10)],r.prototype,"shapeWidth",void 0),as([t.Complex({},Ha)],r.prototype,"border",void 0),as([t.Complex({left:0,right:0,top:0,bottom:0},Ya)],r.prototype,"margin",void 0),as([t.Complex({left:0,right:0,top:0,bottom:0},Zt)],r.prototype,"containerPadding",void 0),as([t.Property(5)],r.prototype,"shapePadding",void 0),as([t.Property("transparent")],r.prototype,"background",void 0),as([t.Property(1)],r.prototype,"opacity",void 0),as([t.Property(!0)],r.prototype,"toggleVisibility",void 0),as([t.Property(null)],r.prototype,"description",void 0),as([t.Property(3)],r.prototype,"tabIndex",void 0),as([t.Property(null)],r.prototype,"title",void 0),as([t.Complex(e.Theme.legendTitleFont,ja)],r.prototype,"titleStyle",void 0),as([t.Property("Top")],r.prototype,"titlePosition",void 0),as([t.Property(100)],r.prototype,"maximumTitleWidth",void 0),as([t.Property(!0)],r.prototype,"enablePages",void 0),as([t.Property(!1)],r.prototype,"isInversed",void 0),r}(t.ChildProperty),ls=function(e){function r(t){var i=e.call(this,t)||this;return i.library=i,i.addEventListener(),i}return ns(r,e),r.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on("click",this.click,this),this.chart.on(t.Browser.touchEndEvent,this.mouseEnd,this),this.chart.on(t.Browser.touchMoveEvent,this.mouseMove,this))},r.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off("click",this.click),this.chart.off(t.Browser.touchEndEvent,this.mouseEnd),this.chart.off(t.Browser.touchMoveEvent,this.mouseMove))},r.prototype.mouseMove=function(e){this.chart.legendSettings.visible&&!this.chart.isTouch&&this.move(e)},r.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},r.prototype.getLegendOptions=function(e,t){this.legendCollections=[];var i,r;e.length>1&&(this.legend.mode="Series");for(var o=0,n=e;o<n.length;o++){var a=n[o];"Series"===this.legend.mode&&"Indicator"!==a.category&&(i=a.type,r=a.pointColorMapping&&a.points.length>0&&a.points[0].interior?a.points[0].interior:a.interior,this.legendCollections.push(new mr(a.name,r,a.legendShape,"TrendLine"===a.category?this.chart.series[a.sourceIndex].trendlines[a.index].visible:a.visible,i,a.legendImageUrl,a.marker.shape,a.marker.visible)))}},r.prototype.getLegendBounds=function(e,t,r){this.calculateLegendTitle(r,t);var o=r.padding;this.isTitle=!!r.title;var n=r.titlePosition,a=0,s=0,l=this.arrowHeight,h=this.arrowWidth,c=this.isVertical&&!r.enablePages?l:0,d=this.isTitle&&"Top"===n?this.fivePixel+this.legendTitleSize.height:0;d=this.isTitle&&this.isVertical&&"Top"!==n?this.fivePixel+this.legendTitleSize.height:d,this.isVertical?a=r.width?0:e.width/100*5:s=r.height?0:e.height/100*5,t.height+=s,t.width+=a;var p,u=r.shapePadding,g=r.shapeWidth,y=0,m=0,v=0,f=0,b=0,x=0;this.maxItemHeight=Math.max(i.measureText("MeasureText",r.textStyle).height,r.shapeHeight);for(var w=!1,S=0,C=this.legendCollections;S<C.length;S++){var P=C[S];li.test(P.text)&&(P.text=We(P.text,li)),si.test(P.text)&&(P.text=We(P.text,si)),p={fill:P.fill,text:P.text,shape:P.shape,markerShape:P.markerShape,name:"legendRender",cancel:!1},this.chart.trigger("legendRender",p),P.text=p.text,P.render=!p.cancel,P.shape=p.shape,P.fill=p.fill,P.markerShape=p.markerShape,P.textSize=i.measureText(P.text,r.textStyle),P.render&&(w=!0,m+=v=u+g+P.textSize.width+o,r.enablePages||this.isVertical||(x=this.isTitle&&"Top"!==n?this.legendTitleSize.width+this.fivePixel:0,x+=h),(t.width<o+m+x||this.isVertical)&&(y=Math.max(y,m+o+x-(this.isVertical?0:v)),0===b&&v!==m&&(b=1),m=this.isVertical?0:v,f=++b*(this.maxItemHeight+o)+o+d+c))}f=Math.max(f,this.maxItemHeight+o+o+d),this.isPaging=t.height<f,this.isPaging&&!r.enablePages&&(f=this.isVertical?f:this.maxItemHeight+o+o+("Top"===n?d:0)),this.totalPages=b,this.isPaging||this.isVertical||(m+=this.isTitle&&"Top"!==n?this.fivePixel+this.legendTitleSize.width+this.fivePixel:0),w?this.setBounds(Math.max(m+o,y),f,r,t):this.setBounds(0,0,r,t)},r.prototype.getRenderPoint=function(e,t,i,r,o,n,a){var s=r.location.x+i+r.textSize.width,l=this.legend.padding;s+(e.textSize.width+i)>o.x+o.width+this.legend.shapeWidth/2||this.isVertical?(e.location.x=t.x,e.location.y=n===a?r.location.y:r.location.y+this.maxItemHeight+l):(e.location.x=n===a?r.location.x:s,e.location.y=r.location.y);var h=this.legendBounds.width+this.legendBounds.x-(e.location.x+i-this.legend.shapeWidth/2);e.text=ze(+h.toFixed(4),e.text,this.legend.textStyle)},r.prototype.legendClick=function(e,t){var i=this.chart,r="Series"===i.legendSettings.mode?e:0,o=i.visibleSeries[r],n=this.legendCollections[e],a={legendText:n.text,legendShape:n.shape,chart:i.isBlazor?{}:i,series:o,name:"legendClick",cancel:!1};this.chart.trigger("legendClick",a),o.legendShape=a.legendShape,null!==o.fill&&(i.visibleSeries[e].interior=o.fill),i.legendSettings.toggleVisibility&&(this.changeSeriesVisiblity(o,o.visible),n.visible="TrendLine"===o.category?i.series[o.sourceIndex].trendlines[o.index].visible:o.visible,this.refreshLegendToggle(i,o))},r.prototype.refreshLegendToggle=function(e,t){var i=e.stockLegendModule.legendBounds;e.stockLegendModule.renderLegend(e,e.legendSettings,i),e.cartesianChart.cartesianChartRefresh(e)},r.prototype.changeSeriesVisiblity=function(e,t){e.visible=!t,this.SecondaryAxis(e.yAxis)&&(e.yAxis.internalVisibility=e.yAxis.series.some(function(e){return e.visible})),this.SecondaryAxis(e.xAxis)&&(e.xAxis.internalVisibility=e.xAxis.series.some(function(e){return e.visible}))},r.prototype.SecondaryAxis=function(e){return this.chart.axes.indexOf(e)>-1},r.prototype.click=function(e){var t=this;if(this.chart.legendSettings.visible){for(var i,r=this.chart.mouseY,o=this.chart.mouseX,n=[this.legendID+"_text_",this.legendID+"_shape_marker_",this.legendID+"_shape_"],a=e.target.id,s=0,l=n;s<l.length;s++){var h=l[s];if(a.indexOf(h)>-1){i=parseInt(a.split(h)[1],10),this.legendClick(i,e);break}}a.indexOf(this.legendID+"_pagedown")>-1?this.changePage(e,!1):a.indexOf(this.legendID+"_pageup")>-1&&this.changePage(e,!0),this.legendRegions.filter(function(e){return j(o,r+(t.isPaging?(t.currentPageNumber-1)*t.translatePage(null,1,2):0),e.rect)})}},r.prototype.getModuleName=function(){return"StockLegend"},r.prototype.destroy=function(){this.removeEventListener()},r}(yr),hs=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cs=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},ds=function(e){function o(i,r){var o=e.call(this,i,r)||this;return o.isSingleAxis=!1,o.chartid=57723,o.tempSeriesType=[],o.zoomChange=!1,o.allowPan=!1,o.onPanning=!1,o.trendlinetriggered=!0,o.initialRender=!0,o.rangeFound=!1,o.tempPeriods=[],o.toolbarHeight=o.enablePeriodSelector?t.Browser.isDevice?56:42:0,o}return hs(o,e),o.prototype.onPropertyChanged=function(e,t){for(var i=0,r=Object.keys(e);i<r.length;i++)switch(r[i]){case"series":this.render()}},o.prototype.rangeChanged=function(e,t){var i=document.getElementById(this.chartObject.id);if(i)for(;i.firstChild;)i.removeChild(i.firstChild);this.startValue=e,this.endValue=t,this.cartesianChart.initializeChart(),this.periodSelector.datePicker.startDate=new Date(e),this.periodSelector.datePicker.endDate=new Date(t),this.periodSelector.datePicker.dataBind()},o.prototype.preRender=function(){this.isBlazor=window.Blazor,this.unWireEvents(),this.initPrivateVariable(),this.allowServerDataBinding=!1,this.isProtectedOnChange=!0,this.setCulture(),this.wireEvents()},o.prototype.unWireEvents=function(){var e=t.Browser.touchStartEvent,i=t.Browser.touchMoveEvent,r=t.Browser.touchEndEvent,o=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,e,this.stockChartOnMouseDown),t.EventHandler.remove(this.element,i,this.stockChartOnMouseMove),t.EventHandler.remove(this.element,r,this.stockChartMouseEnd),t.EventHandler.remove(this.element,"click",this.stockChartOnMouseClick),t.EventHandler.remove(this.element,"contextmenu",this.stockChartRightClick),t.EventHandler.remove(this.element,o,this.stockChartOnMouseLeave),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.stockChartResize)},o.prototype.wireEvents=function(){var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.stockChartOnMouseDown,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.stockChartOnMouseMove,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.stockChartMouseEnd,this),t.EventHandler.add(this.element,"click",this.stockChartOnMouseClick,this),t.EventHandler.add(this.element,"contextmenu",this.stockChartRightClick,this),t.EventHandler.add(this.element,e,this.stockChartOnMouseLeave,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.stockChartResize.bind(this)),this.setStyle(this.element)},o.prototype.initPrivateVariable=function(){if(""===this.element.id){var e=document.getElementsByClassName("e-stockChart").length;this.element.id="stockChart_"+this.chartid+"_"+e}this.seriesXMax=null,this.seriesXMin=null,this.startValue=null,this.endValue=null,this.currentEnd=null},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.storeDataSource=function(){for(var e=0;e<this.series.length;e++){var t=this.series[e];this.tempSeriesType.push(t.type),t.localData=void 0}0===this.series.length&&this.series.push({}),this.initialRender=!0,this.rangeFound=!1,this.resizeTo=null,this.startValue=null,this.endValue=null},o.prototype.render=function(){var e=this,t={name:"load",stockChart:this.isBlazor?{}:this,theme:this.theme};this.trigger("load",t,function(){e.theme=e.isBlazor?t.theme:e.theme,e.themeStyle=c(e.theme),e.storeDataSource(),e.drawSVG(),e.renderTitle(),e.renderLegend(),e.chartModuleInjection(),e.chartRender(),e.dataSource instanceof r.DataManager&&e.series[0].dataSource instanceof r.DataManager||(e.stockChartDataManagerSuccess(),e.initialRender=!1),e.renderComplete(),e.allowServerDataBinding=!0,e.isProtectedOnChange=!1})},o.prototype.stockChartDataManagerSuccess=function(){this.findRange(),this.renderRangeSelector(),this.renderPeriodSelector(),this.trigger("loaded",{stockChart:this.isBlazor?{}:this})},o.prototype.setStyle=function(e){var t=this.zoomSettings,i=t.enableSelectionZooming||t.enablePinchZooming||"None"!==this.selectionMode||this.crosshair.enable;e.style.msTouchAction=i?"none":"element",e.style.touchAction=i?"none":"element",e.style.msUserSelect="none",e.style.msContentZooming="none",e.style.position="relative",e.style.display="block",e.style.webkitUserSelect="none"},o.prototype.drawSVG=function(){this.removeSvg(),je(this),this.renderer=new i.SvgRenderer(this.element.id),this.renderBorder(),this.createSecondaryElements(),this.calculateVisibleSeries(),this.calculateLegendBounds(),this.mainObject=this.renderer.createSvg({id:this.element.id+"_stockChart_svg",width:this.availableSize.width,height:this.availableSize.height-(this.enablePeriodSelector?this.toolbarHeight:0)-this.titleSize.height}),this.svgObject=this.mainObject,this.element.appendChild(this.mainObject)},o.prototype.calculateVisibleSeries=function(){this.visibleSeries=[];for(var e,t=h(this.theme),i=t.length,r=this.series.sort(function(e,t){return e.zOrder-t.zOrder}),o=0,n=r.length;o<n;o++)(e=r[o]).category="Series",e.index=o,e.interior=e.fill||t[o%i],this.visibleSeries.push(e),r[o]=e},o.prototype.createSecondaryElements=function(){var e=Fe(!1,this.element.id+"_Secondary_Element")||this.createElement("div");e.id=this.element.id+"_Secondary_Element",this.title?(this.titleSize=i.measureText(this.title,this.titleStyle),this.titleSize.height+=15):this.titleSize={height:null,width:null};var t=(this.enablePeriodSelector?this.toolbarHeight:0)+this.titleSize.height;e.setAttribute("style","position: relative; height:"+t+"px"),be(!1,this.element,e,!1)},o.prototype.requiredModules=function(){var e=[];return this.legendSettings.visible&&e.push({member:"StockLegend",args:[this]}),e},o.prototype.findCurrentData=function(e,t){var i,r=this;return e&&this.startValue&&this.endValue&&(i=e.filter(function(e){return new Date(Date.parse(e[t])).getTime()>=r.startValue&&new Date(Date.parse(e[t])).getTime()<=r.endValue})),i},o.prototype.renderPeriodSelector=function(){this.enablePeriodSelector&&(this.toolbarSelector.initializePeriodSelector(),this.periodSelector.toolbar.refreshOverflow(),this.enableSelector||this.cartesianChart.cartesianChartRefresh(this))},o.prototype.chartRender=function(){this.cartesianChart=new Da(this),this.cartesianChart.initializeChart()},o.prototype.renderRangeSelector=function(){this.enableSelector&&(this.rangeSelector=new Ba(this),this.rangeSelector.initializeRangeNavigator())},o.prototype.getModuleName=function(){return"stockChart"},o.prototype.getPersistData=function(){return""},o.prototype.removeSvg=function(){document.getElementById(this.element.id+"_Secondary_Element")&&t.remove(document.getElementById(this.element.id+"_Secondary_Element"));if(this.mainObject){for(;this.mainObject.childNodes.length>0;)this.mainObject.removeChild(this.mainObject.firstChild);!this.mainObject.hasChildNodes()&&this.mainObject.parentNode&&(t.remove(this.mainObject),this.mainObject=null,this.selectorObject=null,this.chartObject=null)}},o.prototype.chartModuleInjection=function(){for(var e,t=0,i=this.getInjectedModules();t<i.length;t++){var r=i[t];-1===(e=r.prototype.getModuleName().toLowerCase()).indexOf("rangetooltip")?Rr.Inject(r):za.Inject(r),"datetime"!==e&&"areaseries"!==e&&"steplineseries"!==e||za.Inject(r)}},o.prototype.findRange=function(){var e=this;this.seriesXMin=1/0,this.seriesXMax=-1/0;for(var t=0,i=this.chart.series;t<i.length;t++){var r=i[t];r.visible&&(this.seriesXMin=Math.min(this.seriesXMin,r.xMin),this.seriesXMax=Math.max(this.seriesXMax,r.xMax))}this.endValue=this.currentEnd=this.seriesXMax,this.enablePeriodSelector?(this.toolbarSelector=new Fa(this),this.periodSelector=new Oa(this),this.tempPeriods=this.periods.length?this.periods:this.toolbarSelector.calculateAutoPeriods(),this.tempPeriods.map(function(t){t.selected&&"ytd"===t.text.toLowerCase()?e.startValue=new Date(new Date(e.currentEnd).getFullYear().toString()).getTime():t.selected&&"all"===t.text.toLowerCase()?e.startValue=e.seriesXMin:t.selected&&(e.startValue=e.periodSelector.changedRange(t.intervalType,e.endValue,t.interval).getTime())})):this.startValue=this.seriesXMin,this.rangeFound=!0},o.prototype.stockChartResize=function(){var e=this;return!!document.getElementById(this.element.id)&&(this.animateSeries=!1,this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){je(e),e.renderBorder(),e.calculateLegendBounds(),e.renderTitle(),e.renderLegend(),e.cartesianChart.cartesianChartRefresh(e),e.mainObject.setAttribute("width",e.availableSize.width.toString()),e.enablePeriodSelector&&e.renderPeriodSelector()},500),!1)},o.prototype.stockChartOnMouseDown=function(e){var i,r,o,n,a=this.chart.element.getBoundingClientRect(),s=e.target;if(this.trigger("stockChartMouseDown",{target:s.id,x:this.mouseX,y:this.mouseY}),"touchstart"===e.type?(this.isTouch=!0,i=(n=e).changedTouches[0].clientX,o=n.target,r=n.changedTouches[0].clientY):(this.isTouch="touch"===e.pointerType,i=e.clientX,r=e.clientY,o=e.target),o.id.indexOf(this.element.id+"_stockChart_chart")>-1){var l=he(this.element.id+"_stockChart_chart").getBoundingClientRect();this.mouseDownY=this.previousMouseMoveY=r-a.top-Math.max(l.top-a.top,0),this.mouseDownX=this.previousMouseMoveX=i-a.left-Math.max(l.left-a.left,0),this.setMouseXY(this.mouseDownX,this.mouseDownY),this.referenceXAxis=this.chart.primaryXAxis,he(this.element.id+"_stockChart_chart").setAttribute("cursor","pointer"),this.mouseDownXPoint=rt(this.mouseX-this.referenceXAxis.rect.x,this.referenceXAxis.rect.width,this.referenceXAxis.visibleRange,this.referenceXAxis.isInversed),this.allowPan=!0,this.notify(t.Browser.touchStartEvent,e)}return!1},o.prototype.stockChartMouseEnd=function(e){var t,i,r;return"touchend"===e.type?(i=(r=e).changedTouches[0].clientX,t=r.changedTouches[0].clientY,this.isTouch=!0):(t=e.clientY,i=e.clientX,this.isTouch="touch"===e.pointerType||"2"===e.pointerType),he(this.element.id+"_stockChart_chart").setAttribute("cursor","auto"),this.onPanning=!1,this.setMouseXY(i,t),this.stockChartOnMouseUp(e),!1},o.prototype.stockChartOnMouseUp=function(e){var i=e.target;return this.trigger("stockChartMouseUp",{target:i.id,x:this.mouseX,y:this.mouseY}),this.isChartDrag=!1,this.allowPan=!1,this.isTouch&&(this.threshold=(new Date).getTime()+300),this.notify(t.Browser.touchEndEvent,e),this.stockEvent&&this.stockEvent.removeStockEventTooltip(0),!1},o.prototype.setMouseXY=function(e,t){var i=he(this.element.id+"_stockChart_chart");if(this.element&&i){var r=this.element.getBoundingClientRect(),o=i.getBoundingClientRect();this.mouseX=e-r.left-Math.max(o.left-r.left,0),this.mouseY=t-r.top-Math.max(o.top-r.top,0)}},o.prototype.stockChartOnMouseMove=function(e){var t,i,r;return"touchmove"===e.type?(this.isTouch=!0,r=(i=e).changedTouches[0].clientY,t=i.changedTouches[0].clientX):(this.isTouch="touch"===e.pointerType||"2"===e.pointerType||this.isTouch,t=e.clientX,r=e.clientY),this.trigger("stockChartMouseMove",{target:e.target.id,x:this.mouseX,y:this.mouseY}),he(this.element.id+"_stockChart_chart")&&(this.setMouseXY(t,r),this.chartOnMouseMove(e)),!1},o.prototype.chartOnMouseMove=function(e){if(this.allowPan&&this.mouseDownXPoint&&this.mouseX!==this.previousMouseMoveX&&this.zoomSettings.enablePan){this.onPanning=!0,he(this.element.id+"_stockChart_chart").setAttribute("cursor","pointer"),this.mouseUpXPoint=rt(this.mouseX-this.referenceXAxis.rect.x,this.referenceXAxis.rect.width,this.referenceXAxis.visibleRange,this.referenceXAxis.isInversed);var i=Math.abs(this.mouseUpXPoint-this.mouseDownXPoint);this.mouseDownXPoint<this.mouseUpXPoint?this.seriesXMin<=this.referenceXAxis.visibleRange.min-i&&(this.startValue=this.referenceXAxis.visibleRange.min-i,this.endValue=this.referenceXAxis.visibleRange.max-i,this.cartesianChart.cartesianChartRefresh(this),this.rangeSelector.sliderChange(this.referenceXAxis.visibleRange.min-i,this.referenceXAxis.visibleRange.max-i)):this.seriesXMax>=this.referenceXAxis.visibleRange.max+i&&(this.startValue=this.referenceXAxis.visibleRange.min+i,this.endValue=this.referenceXAxis.visibleRange.max+i,this.cartesianChart.cartesianChartRefresh(this),this.rangeSelector.sliderChange(this.referenceXAxis.visibleRange.min+i,this.referenceXAxis.visibleRange.max+i))}if(this.notify(t.Browser.touchMoveEvent,e),""===e.target.id){var r=void 0;(this.chart.tooltip.enable||this.crosshair.enable)&&(r=document.getElementById(this.element.id+"_stockChart_chart_tooltip"))&&t.remove(r),he(this.element.id+"_StockEvents_Tooltip")&&this.stockEvent.removeStockEventTooltip(0)}return-1!==e.target.id.indexOf("StockEvents")?(clearInterval(this.stockEvent.toolTipInterval),this.stockEvent.renderStockEventTooltip(e.target.id)):this.stockEvent&&this.stockEvent.removeStockEventTooltip(1e3),this.isTouch=!1,!1},o.prototype.stockChartOnMouseClick=function(e){var t=e.target;return this.trigger("stockChartMouseClick",{target:t.id,x:this.mouseX,y:this.mouseY}),this.notify("click",e),!1},o.prototype.stockChartRightClick=function(e){return!this.crosshair.enable||2!==e.buttons&&0!==e.which&&"touch"!==e.pointerType||(e.preventDefault(),e.stopPropagation(),!1)},o.prototype.stockChartOnMouseLeave=function(e){var t,i,r;return"touchleave"===e.type?(this.isTouch=!0,i=(t=e).changedTouches[0].clientX,r=t.changedTouches[0].clientY):(i=e.clientX,r=e.clientY,this.isTouch="touch"===e.pointerType||"2"===e.pointerType),this.setMouseXY(i,r),this.allowPan=!1,this.stockChartOnMouseLeaveEvent(e),!1},o.prototype.stockChartOnMouseLeaveEvent=function(e){var i=t.Browser.isPointer?"pointerleave":"mouseleave";return this.isChartDrag=!1,this.notify(i,e),this.stockEvent&&this.stockEvent.removeStockEventTooltip(1e3),!1},o.prototype.destroy=function(){},o.prototype.renderBorder=function(){if(this.border.width){var e=this.createElement("div");e.id=this.element.id+"_stock_border",e.style.width=this.availableSize.width+"px",e.style.height=this.availableSize.height+"px",e.style.position="absolute",e.style.border=this.border.width+"px solid "+this.border.color,e.style.pointerEvents="none",be(!1,he(this.element.id),e)}},o.prototype.renderTitle=function(){var e;if(this.title){be(!1,he(this.element.id+"_Secondary_Element"),this.renderer.createSvg({id:this.element.id+"_stockChart_Title",width:this.availableSize.width,height:this.titleSize.height,fill:this.background||this.themeStyle.background}),!1);var t=this.titleStyle.textAlignment,r="Near"===t?"start":"Far"===t?"end":"middle";e=new i.Rect(0,0,this.availableSize.width,0);var o=new i.TextOption(this.element.id+"_ChartTitle",Ye(e,this.titleStyle),this.titleSize.height-10,r,this.title,"","auto");Ve(this.renderer,o,this.titleStyle,this.titleStyle.color||this.findTitleColor(),he(this.element.id+"_stockChart_Title"),!1,!1),this.availableSize.height-=this.titleSize.height+5}},o.prototype.calculateLegendBounds=function(){this.stockLegendModule&&this.legendSettings.visible&&this.stockLegendModule.getLegendOptions(this.visibleSeries,this);var e=this.titleSize.height,t=this.border.width,r=this.availableSize.width-this.border.width-t,o=.5*this.chartArea.border.width+this.border.width,n=this.availableSize.height-o-this.border.width-(this.enablePeriodSelector?this.toolbarHeight:0)-e;this.initialClipRect=new i.Rect(t,o,r,n),this.tempAvailableSize=new i.Size(this.availableSize.width,this.availableSize.height-(this.enablePeriodSelector?this.toolbarHeight:0)-e),this.stockLegendModule&&this.legendSettings.visible&&this.stockLegendModule.calculateLegendBounds(this.initialClipRect,this.tempAvailableSize,null)},o.prototype.renderLegend=function(){if(this.stockLegendModule&&this.stockLegendModule.legendCollections.length&&this.legendSettings.visible){this.stockLegendModule.calTotalPage=!0;var e=this.stockLegendModule.legendBounds;this.stockLegendModule.renderLegend(this,this.legendSettings,e),"Auto"===this.legendSettings.position||"Bottom"===this.legendSettings.position||"Top"===this.legendSettings.position?this.availableSize.height-=this.stockLegendModule.legendBounds.height:"Left"!==this.legendSettings.position&&"Right"!==this.legendSettings.position||(this.availableSize.width-=this.stockLegendModule.legendBounds.width)}},o.prototype.findTitleColor=function(){return this.theme.toLocaleLowerCase().indexOf("highcontrast")>-1||this.theme.indexOf("Dark")>-1?"#ffffff":"#424242"},o.prototype.calculateStockEvents=function(){this.stockEvents.length&&(this.stockEvent=new os(this),be(!1,this.chartObject,this.stockEvent.renderStockEvents()))},cs([t.Property(null)],o.prototype,"width",void 0),cs([t.Property(null)],o.prototype,"height",void 0),cs([t.Property("")],o.prototype,"dataSource",void 0),cs([t.Complex({},Ya)],o.prototype,"margin",void 0),cs([t.Complex({color:"#DDDDDD",width:1},Ha)],o.prototype,"border",void 0),cs([t.Property(null)],o.prototype,"background",void 0),cs([t.Property("Material")],o.prototype,"theme",void 0),cs([t.Complex({name:"primaryXAxis",valueType:"DateTime"},$a)],o.prototype,"primaryXAxis",void 0),cs([t.Complex({border:{color:null,width:.5},background:"transparent"},Xa)],o.prototype,"chartArea",void 0),cs([t.Complex({name:"primaryYAxis",opposedPosition:!0,labelPosition:"Inside"},$a)],o.prototype,"primaryYAxis",void 0),cs([t.Collection([{}],Ja)],o.prototype,"rows",void 0),cs([t.Collection([{opposedPosition:!0}],$a)],o.prototype,"axes",void 0),cs([t.Collection([],qa)],o.prototype,"series",void 0),cs([t.Collection([],is)],o.prototype,"stockEvents",void 0),cs([t.Property(!1)],o.prototype,"isTransposed",void 0),cs([t.Property("")],o.prototype,"title",void 0),cs([t.Complex({size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},ja)],o.prototype,"titleStyle",void 0),cs([t.Collection([],Qa)],o.prototype,"indicators",void 0),cs([t.Complex({shared:!0,enableMarker:!1},ti)],o.prototype,"tooltip",void 0),cs([t.Complex({dashArray:"5"},Pr)],o.prototype,"crosshair",void 0),cs([t.Complex({},ss)],o.prototype,"legendSettings",void 0),cs([t.Complex({},Lr)],o.prototype,"zoomSettings",void 0),cs([t.Property(!0)],o.prototype,"enablePeriodSelector",void 0),cs([t.Property(!0)],o.prototype,"enableCustomRange",void 0),cs([t.Property(!1)],o.prototype,"isSelect",void 0),cs([t.Property(!0)],o.prototype,"enableSelector",void 0),cs([t.Collection([],ii)],o.prototype,"periods",void 0),cs([t.Collection([{}],es)],o.prototype,"annotations",void 0),cs([t.Event()],o.prototype,"selectorRender",void 0),cs([t.Event()],o.prototype,"stockChartMouseMove",void 0),cs([t.Event()],o.prototype,"stockChartMouseLeave",void 0),cs([t.Event()],o.prototype,"stockChartMouseDown",void 0),cs([t.Event()],o.prototype,"stockChartMouseUp",void 0),cs([t.Event()],o.prototype,"stockChartMouseClick",void 0),cs([t.Event()],o.prototype,"pointClick",void 0),cs([t.Event()],o.prototype,"pointMove",void 0),cs([t.Event()],o.prototype,"onZooming",void 0),cs([t.Event()],o.prototype,"legendRender",void 0),cs([t.Event()],o.prototype,"legendClick",void 0),cs([t.Property("None")],o.prototype,"selectionMode",void 0),cs([t.Property(!1)],o.prototype,"isMultiSelect",void 0),cs([t.Event()],o.prototype,"load",void 0),cs([t.Event()],o.prototype,"loaded",void 0),cs([t.Event()],o.prototype,"rangeChange",void 0),cs([t.Event()],o.prototype,"axisLabelRender",void 0),cs([t.Event()],o.prototype,"tooltipRender",void 0),cs([t.Event()],o.prototype,"seriesRender",void 0),cs([t.Event()],o.prototype,"stockEventRender",void 0),cs([t.Collection([],ts)],o.prototype,"selectedDataIndexes",void 0),cs([t.Property(["Line","Hilo","OHLC","Hollow Candle","Spline","Candle"])],o.prototype,"seriesType",void 0),cs([t.Property(["EMA","TMA","SMA","Momentum","ATR","Accumulation Distribution","Bollinger Bands","MACD","Stochastic","RSI"])],o.prototype,"indicatorType",void 0),cs([t.Property(["PNG","JPEG","SVG","PDF","Print"])],o.prototype,"exportType",void 0),cs([t.Property(["Linear","Exponential","Polynomial","Logarithmic","Moving Average"])],o.prototype,"trendlineType",void 0),o=cs([t.NotifyPropertyChanges],o)}(t.Component),ps=function(){function e(e){this.control=e,this.elementId=e.element.id}return e.prototype.renderLeftTooltip=function(e){this.fadeOutTooltip();var t=this.getTooltipContent(e.currentStart),i=this.getContentSize(t),r=this.control.enableRtl?e.rightRect:e.leftRect;i>r.width&&(r=e.midRect),this.leftTooltip=this.renderTooltip(r,this.createElement("_leftTooltip"),e.startX,t)},e.prototype.getContentSize=function(e){var r=this.control.tooltip.textStyle;return this.control.tooltip.template?ue(t.createElement("div",{id:"measureElement",styles:"position: absolute;"}),0,this.control.tooltip.template,this.control).getBoundingClientRect().width:i.measureText(e[0],r).width+20},e.prototype.renderRightTooltip=function(e){this.fadeOutTooltip();var t=this.getTooltipContent(e.currentEnd),i=this.getContentSize(t),r=this.control.enableRtl?e.leftRect:e.rightRect;i>r.width&&((r=e.midRect).x=this.control.series.length?0:r.x),this.rightTooltip=this.renderTooltip(r,this.createElement("_rightTooltip"),e.endX,t)},e.prototype.createElement=function(e){if(he(this.elementId+e))return he(this.elementId+e);var t=document.createElement("div");if(t.id=this.elementId+e,t.className="ejSVGTooltip",t.setAttribute("style","pointer-events:none; position:absolute;z-index: 1"),this.control.stockChart){var i=this.control.stockChart;he(i.element.id+"_Secondary_Element").appendChild(t),t.style.transform="translateY("+(i.availableSize.height-i.toolbarHeight-80+i.toolbarHeight+i.titleSize.height)+"px)"}else he(this.elementId+"_Secondary_Element").appendChild(t);return t},e.prototype.renderTooltip=function(e,t,r,o){var n=this.control,a=n.tooltip,s={cancel:!1,name:"tooltipRender",text:o,textStyle:a.textStyle};this.control.trigger("tooltipRender",s);var l=n.svgObject.getBoundingClientRect().left-n.element.getBoundingClientRect().left;return s.cancel?null:new i.Tooltip({location:{x:r,y:n.rangeSlider.sliderY},content:s.text,marginX:2,enableShadow:!1,marginY:2,arrowPadding:8,rx:0,ry:0,inverted:n.series.length>0,areaBounds:e,fill:a.fill?a.fill:this.control.themeStyle.tooltipBackground,theme:this.control.theme,clipBounds:{x:l},border:a.border,opacity:a.opacity,template:a.template,textStyle:s.textStyle,availableSize:n.availableSize,data:{start:this.getTooltipContent(this.control.startValue)[0],end:this.getTooltipContent(this.control.endValue)[0],value:o[0]}},t)},e.prototype.getTooltipContent=function(e){var t,i=this.control,r=i.tooltip,o=i.chartSeries.xAxis,n=r.format||o.labelFormat,a=null!==n.match("{value}"),s=o.valueType;return"DateTime"===s?t=i.intl.getDateFormat({format:n||"MM/dd/yyyy",type:G(i.skeletonType),skeleton:i.dateTimeModule.getSkeleton(o,null,null,i.isBlazor)})(new Date(e)):(o.format=i.intl.getNumberFormat({format:a?"":n,useGrouping:i.useGroupingSeparator}),t=i.doubleModule.formatValue(o,a,n,"Logarithmic"===s?Math.pow(o.logBase,e):e)),[t]},e.prototype.fadeOutTooltip=function(){var e=this;"OnDemand"===this.control.tooltip.displayMode&&(Ce(this.toolTipInterval),this.rightTooltip&&(this.toolTipInterval=+setTimeout(function(){e.leftTooltip.fadeOut(),e.rightTooltip.fadeOut()},1e3)))},e.prototype.getModuleName=function(){return"RangeTooltip"},e.prototype.destroy=function(){},e}(),us=function(){function e(e){this.bulletChart=e,this.isVertical="Vertical"===e.orientation,this.isLabelsInside="Inside"===e.labelPosition,this.isHorizontal="Horizontal"===e.orientation,this.isLeft="Left"===e.titlePosition,this.isRight="Right"===e.titlePosition,this.isTop="Top"===e.titlePosition,this.majorTickSize=e.majorTickLines.height,this.location=10,this.labelOffset=15,this.labelSize=parseFloat(e.labelStyle.size),this.isLabelBelow=!this.bulletChart.opposedPosition}return e.prototype.renderMajorTickLines=function(e,t){"Horizontal"===this.bulletChart.orientation?this.renderXMajorTickLines(e,t):this.renderYMajorTickLines(e,t)},e.prototype.renderMinorTickLines=function(e,t){"Horizontal"===this.bulletChart.orientation?this.renderXMinorTickLines(e,t):this.renderYMinorTickLines(e,t)},e.prototype.renderAxisLabels=function(e,t){"Horizontal"===this.bulletChart.orientation?this.renderXAxisLabels(e,t):this.renderYAxisLabels(e,t)},e.prototype.renderXMajorTickLines=function(e,t){for(var i,r,o=this.bulletChart,n=o.renderer.createGroup({id:o.svgObject.id+"_majorTickGroup"}),a=o.minimum,s=o.maximum,l=o.interval,h=o.enableRtl,c=o.initialClipRect.y+(o.opposedPosition?0:o.initialClipRect.height),d=c+(o.opposedPosition?"Inside"!==o.tickPosition?-this.majorTickSize:this.majorTickSize:"Inside"!==o.tickPosition?this.majorTickSize:-this.majorTickSize),p=o.majorTickLines,u=p.color||o.themeStyle.majorTickLineColor,g=o.initialClipRect.x+(o.enableRtl?o.initialClipRect.width:0),y=o.initialClipRect.x+p.width/2+(h?o.initialClipRect.width:0),m=a;m<=s;m+=l){(r=o.enableRtl?m===a:m===s)&&(y-=p.width/2),r=o.enableRtl?m===a:m===s,o.majorTickLines.useRangeColor&&(u=this.bindingRangeStrokes(y-(r?this.bulletChart.majorTickLines.width/2:0),g,this.bulletChart.orientation,o.enableRtl)),i=this.majorTicks(y,y,c,d,u,m);var v=o.renderer.drawLine(i);y+=h?-e:e,n.appendChild(v),t.appendChild(n)}},e.prototype.renderYMajorTickLines=function(e,t){for(var i,r,o=this.bulletChart,n=o.renderer.createGroup({id:o.svgObject.id+"_majorTickGroup"}),a=o.minimum,s=o.maximum,l=o.interval,h=o.enableRtl,c=o.initialClipRect,d=c.x+(o.opposedPosition?c.width:0),p=d-(o.opposedPosition?"Inside"!==o.tickPosition?-this.majorTickSize:this.majorTickSize:"Inside"!==o.tickPosition?this.majorTickSize:-this.majorTickSize),u=o.majorTickLines,g=u.color||o.themeStyle.majorTickLineColor,y=c.y+(o.enableRtl?0:c.height),m=c.y+u.width/2+(h?0:c.height),v=a;v<=s;v+=l){(i=o.enableRtl?v===s:v===a)&&(m-=u.width/2),i=o.enableRtl?v===a:v===s,o.majorTickLines.useRangeColor&&(g=this.bindingRangeStrokes(m-(i?this.bulletChart.majorTickLines.width/2:0),y,this.bulletChart.orientation,o.enableRtl)),r=this.majorTicks(d,p,m,m,g,v);var f=o.renderer.drawLine(r);m+=h?e:-e,n.appendChild(f),t.appendChild(n)}},e.prototype.majorTicks=function(e,t,i,r,o,n){return{id:this.bulletChart.svgObject.id+"_MajorTickLine_"+n,x1:e,y1:i,x2:t,y2:r,"stroke-width":this.bulletChart.majorTickLines.width,stroke:this.bulletChart.majorTickLines.useRangeColor&&o?o:this.bulletChart.majorTickLines.color||o}},e.prototype.bindingRangeStrokes=function(e,t,i,r){return"Vertical"===i&&!r||r&&"Horizontal"===i?this.backwardStrokeBinding(e,t):this.forwardStrokeBinding(e,t)},e.prototype.renderXMinorTickLines=function(e,t){for(var i,r,o,n,a=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_minorTickGroup"}),s=this.bulletChart,l=s.maximum,h=s.minimum,c=s.interval,d=s.minorTickLines.height,p=this.bulletChart.minorTicksPerInterval,u=s.initialClipRect.x,g=s.initialClipRect.y+(s.opposedPosition?0:s.initialClipRect.height),y=g+(s.opposedPosition?"Inside"!==s.tickPosition?-d:d:"Inside"!==s.tickPosition?d:-d),m=s.minorTickLines.color||s.themeStyle.minorTickLineColor,v=s.initialClipRect.x+(s.enableRtl?s.initialClipRect.width:0),f=h;f<l;f+=c){i=e/p;for(var b=1;b<=p;b++)r=u+i-i/(p+1),s.minorTickLines.useRangeColor&&(m=this.bindingRangeStrokes(r,v,this.bulletChart.orientation,s.enableRtl)),o=this.minorXTicks(r,r,g,y,m,f.toString()+b.toString()),n=this.bulletChart.renderer.drawLine(o),a.appendChild(n),t.appendChild(a),i=e/p*(b+1);u+=e}},e.prototype.renderYMinorTickLines=function(e,t){for(var i,r,o,n,a=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_minorTickGroup"}),s=this.bulletChart,l=s.maximum,h=s.minimum,c=s.interval,d=s.minorTickLines.height,p=this.bulletChart.minorTicksPerInterval,u=s.initialClipRect.y+(s.enableRtl?0:s.initialClipRect.height),g=s.initialClipRect.x+(s.opposedPosition?s.initialClipRect.width:0),y=g-(s.opposedPosition?"Inside"!==s.tickPosition?-d:d:"Inside"!==s.tickPosition?d:-d),m=s.minorTickLines.color||s.themeStyle.minorTickLineColor,v=s.initialClipRect.y+(s.enableRtl?0:s.initialClipRect.height),f=h;f<l;f+=c){i=e/p;for(var b=1;b<=p;b++)r=this.bulletChart.enableRtl?u+i-i/(p+1):u-i+i/(p+1),s.minorTickLines.useRangeColor&&(m=this.bindingRangeStrokes(r,v,this.bulletChart.orientation,s.enableRtl)),o=this.minorXTicks(g,y,r,r,m,f.toString()+b.toString()),n=this.bulletChart.renderer.drawLine(o),a.appendChild(n),t.appendChild(a),i=e/p*(b+1);u-=this.bulletChart.enableRtl?-e:e}},e.prototype.minorXTicks=function(e,t,i,r,o,n){return{id:this.bulletChart.svgObject.id+"_MajorTickLine_"+n,x1:e,x2:t,y1:i,y2:r,"stroke-width":this.bulletChart.minorTickLines.width,stroke:this.bulletChart.minorTickLines.useRangeColor&&o?o:this.bulletChart.minorTickLines.color||o}},e.prototype.forwardStrokeBinding=function(e,t){for(var i=this.bulletChart,r=t,o=0;o<=i.rangeCollection.length-1;o++)if(r+=o?i.rangeCollection[o-1]:0,e>=r&&e<r+i.rangeCollection[o])return i.ranges[o].color;return null},e.prototype.backwardStrokeBinding=function(e,t){for(var i=this.bulletChart,r=t,o=0;o<=i.rangeCollection.length-1;o++)if(r-=o?i.rangeCollection[o-1]:0,Math.round(e)>=Math.round(r-i.rangeCollection[o])&&e<=r)return i.ranges[o].color;return null},e.prototype.renderXAxisLabels=function(e,t){var r,o,n=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_axisLabelGroup"}),a=this.bulletChart,s=this.bulletChart.locale,l=a.enableRtl,h=(a.tickPosition===a.labelPosition?a.majorTickLines.height:0)+10,c=a.initialClipRect.y+(a.opposedPosition?"Inside"===a.labelPosition?h:-h:a.initialClipRect.height+("Inside"===a.labelPosition?-h:h)),d=a.initialClipRect.x+(l?a.initialClipRect.width:0),p=a.minimum,u=a.maximum,g=a.interval,y=s&&this.bulletChart.enableGroupSeparator,m=this.getFormat(this.bulletChart),v=a.labelStyle.color||a.themeStyle.labelFontColor,f=null!==m.match("{value}");this.format=this.bulletChart.intl.getNumberFormat({format:f?"":m,useGrouping:this.bulletChart.enableGroupSeparator});var b=a.initialClipRect.x+(a.enableRtl?a.initialClipRect.width:0);c+=i.measureText(this.formatValue(this,f,m,this.bulletChart.maximum),a.labelStyle).height/3;for(var x=p;x<=u;x+=g){o=a.enableRtl?x===p:x===u,a.labelStyle.useRangeColor&&(v=this.bindingRangeStrokes(d-(o?this.bulletChart.majorTickLines.width/2:0),b,this.bulletChart.orientation,a.enableRtl)),r=y?x.toLocaleString(s):this.formatValue(this,f,m,x);var w=this.labelXOptions(d,c,r,x),S=i.textElement(w,this.bulletChart.labelStyle,v,t);n.appendChild(S),d+=l?-e:e}t.appendChild(n)},e.prototype.labelXOptions=function(e,t,i,r){return{id:this.bulletChart.svgObject.id+"_AxisLabel_"+r,anchor:"middle",text:i,transform:"",x:e,y:t,baseLine:"",labelRotation:0}},e.prototype.renderYAxisLabels=function(e,t){var r,o,n=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_axisLabelGroup"}),a=this.bulletChart,s=a.locale,l=a.enableRtl,h=(a.tickPosition===a.labelPosition?a.majorTickLines.height:0)+10,c=a.initialClipRect.y+(l?0:a.initialClipRect.height),d=a.initialClipRect.x+(a.opposedPosition?a.initialClipRect.width+("Inside"===a.labelPosition?-(h+10):h):"Inside"===a.labelPosition?h+10:-h),p=a.minimum,u=a.maximum,g=a.interval,y=s&&this.bulletChart.enableGroupSeparator,m=a.labelStyle.color||a.themeStyle.labelFontColor,v=this.getFormat(this.bulletChart),f=null!==v.match("{value}");this.format=this.bulletChart.intl.getNumberFormat({format:f?"":v,useGrouping:this.bulletChart.enableGroupSeparator});var b=a.initialClipRect.y+(a.enableRtl?0:a.initialClipRect.height),x=i.measureText(this.formatValue(this,f,v,this.bulletChart.maximum),a.labelStyle).width/2,w=i.measureText(this.formatValue(this,f,v,this.bulletChart.maximum),a.labelStyle).height/3;c+=w;for(var S=p;S<=u;S+=g){o=a.enableRtl?S===u:S===p,a.labelStyle.useRangeColor&&(m=this.bindingRangeStrokes(c-w-(o?this.bulletChart.majorTickLines.width/2:0),b,this.bulletChart.orientation,a.enableRtl)),r=y?S.toLocaleString(s):this.formatValue(this,f,v,S);var C=this.labelXOptions(d-(this.bulletChart.opposedPosition?-x:x),c,r,S),P=i.textElement(C,this.bulletChart.labelStyle,m,t);n.appendChild(P),c+=l?e:-e}t.appendChild(n)},e.prototype.getFormat=function(e){return e.labelFormat?e.labelFormat:""},e.prototype.formatValue=function(e,t,i,r){return t?i.replace("{value}",e.format(r)):e.format(r)},e}();!function(e){e.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto-Regular"},e.tooltipLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.legendLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.dataLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.titleFont={size:"15px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto-Regular"},e.subTitleFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto-Regular"}}(e.BulletChartTheme||(e.BulletChartTheme={}));var gs,ys=function(){function e(e){this.comparative=[],this.dataSource=e.dataSource,this.isVertical="Vertical"===e.orientation,this.isTicksInside="Inside"===e.tickPosition,this.isLabelsInside="Inside"===e.labelPosition,this.isHorizontal="Horizontal"===e.orientation,this.isLeft="Left"===e.titlePosition,this.isRight="Right"===e.titlePosition,this.isTop="Top"===e.titlePosition,this.location=10,this.featureBarBounds=[],this.majorTickSize=e.majorTickLines.height,this.labelOffset=15,this.labelSize=12,this.bulletChart=e,this.isLabelBelow=!this.bulletChart.opposedPosition,this.scaleOrientation=this.bulletChart.orientation,this.rangeColor=[]}return e.prototype.drawScaleGroup=function(e){var t=this.bulletChart.renderer.createGroup({id:this.bulletChart.svgObject.id+"_rangeGroup"}),r=this.bulletChart.maximum,o=this.bulletChart.ranges;this.scaleSettingsGroup=e;var n,a=this.bulletChart,s=a.enableRtl,l=a.initialClipRect,h=l.x+(s&&"Horizontal"===a.orientation?l.width:0),c=l.y+(s||"Vertical"!==a.orientation?0:l.height),d=0;a.rangeCollection=[];for(var p=0,u="Horizontal"===a.orientation?l.width:l.height,g="Horizontal"===a.orientation?l.height:l.width,y=0;y<o.length;y++){d=u*((o[y].end-p)/r),"Horizontal"===a.orientation?h-=s?d:0:c-=s?0:d,n=new Di(a.svgObject.id+"_range_"+y,o[y].color||this.bulletChart.themeStyle.rangeStrokes[y].color,{width:1},o[y].opacity,new i.Rect(h,c,"Horizontal"===a.orientation?d:g,"Horizontal"===a.orientation?g:d));var m=a.renderer.drawRectangle(n);t.appendChild(m),e.appendChild(t),"Horizontal"===a.orientation?h+=s?0:d:c+=s?d:0,a.rangeCollection.push(d),p=o[y].end}return this.bulletChart.rangeCollection},e.prototype.sortRangeCollection=function(e,t){return e-t},e.prototype.renderFeatureBar=function(e){0!==e&&this.renderCommonFeatureBar(e,this.isHorizontal)},e.prototype.renderCommonFeatureBar=function(e,r){for(var o,n,a,s,l=this.bulletChart,h=r?l.initialClipRect.y+l.initialClipRect.height:l.initialClipRect.x,c=l.renderer.createGroup({id:l.svgObject.id+"_featureGroup"}),d=(r?l.initialClipRect.height:l.initialClipRect.width)/e,p=0;p<e;p++){if(a=l.dataSource[p],o=a[l.categoryField],n=r?h-d*p-(d+l.valueHeight)/2:h+d*p+d/2-l.valueHeight/2,s=this.calculateFeatureMeasureBounds(a[l.valueField],o,r),a&&"Dot"===l.type){var u=a[l.valueField];s.pointX=r?s.pointX+(u>0&&!l.enableRtl||u<0&&l.enableRtl?s.width:0)-3:s.pointX+(u>0&&l.enableRtl||u<0&&!l.enableRtl?s.width:0)-3,s.width=6}if(s){var g=r?this.featureBar(s.pointX,n,s.width,p):this.verticalFeatureBar(n,s.pointX,s.width,p);if(c.appendChild(g),this.feature=g,this.scaleSettingsGroup.appendChild(c),this.featureBarBounds[p]={x:s.pointX,y:n,width:s.width,height:l.valueHeight},!t.isNullOrUndefined(o)){var y=i.measureText(o,l.categoryLabelStyle),m=r?y.width:y.height,v=l.initialClipRect,f=void 0,b=void 0;r?(f=l.enableRtl?v.x+v.width+5+m/2:v.x-5-m/2,b=this.drawcategory(f,n,o)):(f=l.enableRtl?v.y-5-m/2:v.y+v.height+5+m/2,b=this.drawcategory(n+l.valueHeight/2,f,o)),i.textElement(b,l.categoryLabelStyle,l.categoryLabelStyle.color||l.themeStyle.categoryFontColor,this.scaleSettingsGroup)}}l.animation.enable&&this.doValueBarAnimation()}},e.prototype.featureBar=function(e,t,r,o){var n=new Di(this.bulletChart.svgObject.id+"_FeatureMeasure_"+o,this.bulletChart.valueFill,this.bulletChart.valueBorder,1,new i.Rect(e,t,r,this.bulletChart.valueHeight)),a=this.bulletChart.renderer.drawRectangle(n);return a.setAttribute("class",this.bulletChart.svgObject.id+"_FeatureMeasure"),a.id=this.bulletChart.svgObject.id+"_FeatureMeasure_"+o,a},e.prototype.verticalFeatureBar=function(e,t,r,o){var n=new Di(this.bulletChart.svgObject.id+"_FeatureMeasure_"+o,this.bulletChart.valueFill,this.bulletChart.valueBorder,1,new i.Rect(e,t,this.bulletChart.valueHeight,r)),a=this.bulletChart.renderer.drawRectangle(n);return a.setAttribute("class",this.bulletChart.svgObject.id+"_FeatureMeasure"),a.id=this.bulletChart.svgObject.id+"_FeatureMeasure_"+o,a},e.prototype.drawcategory=function(e,t,i){return{id:"",anchor:"middle",x:e,y:t+this.bulletChart.valueHeight,transform:"",text:i,baseLine:"",labelRotation:0}},e.prototype.renderComparativeSymbol=function(e){0!==e&&this.renderCommonComparativeSymbol(e,this.isHorizontal)},e.prototype.renderCommonComparativeSymbol=function(e,t){for(var i,r,o,n,a,s,l=this.bulletChart,h=l.initialClipRect,c=t?h.width:h.height,d=t?h.y+h.height:h.x,p=l.renderer.createGroup({id:l.svgObject.id+"_comparativeGroup"}),u=l.minimum,g=l.maximum,y=g-u,m=l.targetWidth,v=t?h.x-m/2:h.y+h.height,f=[],b=l.targetTypes,x="Rect",w=b.length,S=(t?h.height:h.width)/e,C=0;C<e;C++){i=l.dataSource[C][l.targetField],f=f.concat(i);for(var P=0;P<f.length;P++)x=b[P%w],f[P]>=u&&f[P]<=g&&(r=(a=t?d-S*C-S/2:d+S*C+S/2)-1.5*m,o=a+1.5*m,a=c/(y/(y-(g-f[P]))),n=t?v+(l.enableRtl?c-a:a):v-(l.enableRtl?c-a:a),s=this.getTargetElement(x,t,n,r,o,f[P],C),this.comparative.push(s),p.appendChild(s),r=0,o=0),this.scaleSettingsGroup.appendChild(p);f=[],l.animation.enable&&this.doTargetBarAnimation(0)}},e.prototype.getTargetElement=function(e,t,r,o,n,a,s){var l,h,c=this.bulletChart,d="Cross"===e?c.targetWidth-1:1,p="Circle"===e?c.targetWidth-1:c.targetWidth,u=t?r+p/2:o+(n-o)/2,g=t?o+(n-o)/2:r,y=c.svgObject.id+"_ComparativeMeasure_"+s,m=c.svgObject.id+"_ComparativeMeasure";if("Rect"===e)l=t?this.compareMeasure(r,o,n,s,a):this.compareVMeasure(o,n,r,s),h=c.renderer.drawLine(l);else if("Circle"===e)l=new Fi(y,c.targetColor,{width:1,color:c.targetColor||"black"},1,u,g,p),h=c.renderer.drawCircle(l);else{var v="M "+(u-p)+" "+(g-p)+" L "+(u+p)+" "+(g+p)+" M "+(u-p)+" "+(g+p)+" L "+(u+p)+" "+(g-p);l=new i.PathOption(y,"transparent",d,c.targetColor,1,"",v),h=c.renderer.drawPath(l)}return h.setAttribute("class",m),h},e.prototype.compareMeasure=function(e,t,i,r,o){var n=this.bulletChart;return{class:n.svgObject.id+"_ComparativeMeasure",id:n.svgObject.id+"_ComparativeMeasure_"+r,x1:o===n.maximum?e-n.targetWidth/2:o===n.minimum?e+n.targetWidth/2:e,y1:t,x2:o===n.maximum?e-n.targetWidth/2:o===n.minimum?e+n.targetWidth/2:e,y2:i,"stroke-width":n.targetWidth,stroke:n.targetColor||"black"}},e.prototype.compareVMeasure=function(e,t,i,r){var o=this.bulletChart;return{class:o.svgObject.id+"_ComparativeMeasure",id:o.svgObject.id+"_ComparativeMeasure_"+r,x1:e,y1:i,x2:t,y2:i,"stroke-width":o.targetWidth,stroke:o.targetColor||"black"}},e.prototype.calculateFeatureMeasureBounds=function(e,r,o){var n=this.bulletChart,a=n.minimum;if((e=e<a&&a<=0?a:e)>=a){var s=void 0,l=void 0,h=void 0,c=o?n.initialClipRect.x:n.initialClipRect.y,d=o?n.initialClipRect.width:n.initialClipRect.height,p=n.maximum-n.minimum,u=n.maximum-e,g=(n.enableRtl?"backward":"forward")+this.scaleOrientation.toLowerCase();r=t.isNullOrUndefined(r)?"":r;var y=i.measureText(r.toString(),n.labelStyle).width;switch(g){case"forwardhorizontal":case"backwardvertical":s=c+(a>0?0:d/p*Math.abs(a)),h=d/(p/(a>0?p-u:e)),e<0&&(s-=h=Math.abs(h)),h=s+h<c+d?h:c+d-s,l=c-("forwardhorizontal"===g?y/2+5:this.labelOffset);break;default:s=c+(d-d/(p/(p-u))),h=a>0?d/(p/(p-u)):d/(p/e),e<0&&(s-=h=Math.abs(h)),s<c&&(h=s+h-c,s=c),l=c+d+("backwardhorizontal"===g?y/2+5:5)}return{pointX:s,width:h,lastPointX:l}}return null},e.prototype.doValueBarAnimation=function(){var e=this.feature;if(!e)return null;var i,r,o,n,a,s=this.bulletChart.animation,l=this.bulletChart.animateSeries?this.bulletChart.animation.duration:s.duration,h=Z("Linear"),c=this.bulletChart.dataSource<0,d=e.getBoundingClientRect().height,p=e.getBoundingClientRect().width;"Horizontal"===this.bulletChart.orientation&&e&&(r=parseInt(e.getAttribute("height"),10),i=parseInt(e.getAttribute("x"),10),n=c?r:r+d,o=i),e.style.visibility="hidden",new t.Animation({}).animate(e,{duration:l,delay:s.delay,progress:function(t){t.timeStamp>=t.delay&&(e.style.visibility="visible",p=p||1,a=h(t.timeStamp-t.delay,0,p,t.duration),e.setAttribute("transform","translate("+o+" "+n+") scale("+a/p+", 1) translate("+-o+" "+-n+")"))},end:function(){e.setAttribute("transform","translate(0,0)"),e.style.visibility="visible"}})},e.prototype.doTargetBarAnimation=function(e){var t,i,r=this.comparative[e];if(!r)return null;"Horizontal"===this.bulletChart.orientation&&r&&(i=parseFloat(r.getAttribute("y1"))+parseFloat(r.getAttribute("y2")),t=parseFloat(r.getAttribute("x1"))),r.style.visibility="hidden",this.animateRect(r,t,i,e+1)},e.prototype.animateRect=function(e,i,r,o){var n,a=this,s=Z("Linear"),l=this.bulletChart.animation,h=this.comparative.length,c=this.bulletChart.animateSeries?this.bulletChart.animation.duration:l.duration;new t.Animation({}).animate(e,{duration:c,delay:l.delay,progress:function(t){t.timeStamp>=t.delay&&(e.style.visibility="visible",n=s(t.timeStamp-t.delay,0,1,t.duration),e.setAttribute("transform","translate("+i+" "+r/2+") scale(1,"+n+") translate("+-i+" "+-r/2+")"))},end:function(){e.setAttribute("transform","translate(0,0)"),o<h&&a.doTargetBarAnimation(o+1)}})},e}(),ms=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vs=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},fs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ms(i,e),vs([t.Property(null)],i.prototype,"end",void 0),vs([t.Property(1)],i.prototype,"opacity",void 0),vs([t.Property(null)],i.prototype,"color",void 0),vs([t.Property(null)],i.prototype,"index",void 0),vs([t.Property(null)],i.prototype,"name",void 0),vs([t.Property("Rectangle")],i.prototype,"shape",void 0),vs([t.Property("")],i.prototype,"legendImageUrl",void 0),i}(t.ChildProperty),bs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ms(i,e),vs([t.Property(12)],i.prototype,"height",void 0),vs([t.Property(1)],i.prototype,"width",void 0),vs([t.Property(null)],i.prototype,"color",void 0),vs([t.Property(!1)],i.prototype,"useRangeColor",void 0),i}(t.ChildProperty),xs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ms(i,e),vs([t.Property(8)],i.prototype,"height",void 0),vs([t.Property(1)],i.prototype,"width",void 0),vs([t.Property(null)],i.prototype,"color",void 0),vs([t.Property(!1)],i.prototype,"useRangeColor",void 0),i}(t.ChildProperty),ws=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ms(i,e),vs([t.Property("Normal")],i.prototype,"fontStyle",void 0),vs([t.Property("16px")],i.prototype,"size",void 0),vs([t.Property("")],i.prototype,"color",void 0),vs([t.Property("Normal")],i.prototype,"fontWeight",void 0),vs([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),vs([t.Property("Center")],i.prototype,"textAlignment",void 0),vs([t.Property("None")],i.prototype,"textOverflow",void 0),vs([t.Property(1)],i.prototype,"opacity",void 0),vs([t.Property(!0)],i.prototype,"enableTrim",void 0),vs([t.Property(null)],i.prototype,"maximumTitleWidth",void 0),vs([t.Property(!1)],i.prototype,"useRangeColor",void 0),i}(t.ChildProperty),Ss=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ms(r,i),vs([t.Property(!1)],r.prototype,"enable",void 0),vs([t.Property(null)],r.prototype,"fill",void 0),vs([t.Complex(e.BulletChartTheme.tooltipLabelFont,ws)],r.prototype,"textStyle",void 0),vs([t.Complex({color:"#cccccc",width:.5},Yt)],r.prototype,"border",void 0),vs([t.Property(null)],r.prototype,"template",void 0),r}(t.ChildProperty),Cs=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ms(r,i),vs([t.Property(!1)],r.prototype,"enable",void 0),vs([t.Complex(e.BulletChartTheme.dataLabelFont,ws)],r.prototype,"labelStyle",void 0),r}(t.ChildProperty),Ps=function(i){function r(){return null!==i&&i.apply(this,arguments)||this}return ms(r,i),vs([t.Property(!1)],r.prototype,"visible",void 0),vs([t.Complex({x:0,y:0},ur)],r.prototype,"location",void 0),vs([t.Property(8)],r.prototype,"padding",void 0),vs([t.Property("Center")],r.prototype,"alignment",void 0),vs([t.Property(10)],r.prototype,"shapeHeight",void 0),vs([t.Property(10)],r.prototype,"shapeWidth",void 0),vs([t.Complex(e.BulletChartTheme.legendLabelFont,ws)],r.prototype,"textStyle",void 0),vs([t.Property("Auto")],r.prototype,"position",void 0),vs([t.Complex({left:0,right:0,top:0,bottom:0},Ut)],r.prototype,"margin",void 0),vs([t.Complex({},Yt)],r.prototype,"border",void 0),vs([t.Property(5)],r.prototype,"shapePadding",void 0),vs([t.Property("transparent")],r.prototype,"background",void 0),vs([t.Property(1)],r.prototype,"opacity",void 0),vs([t.Property(3)],r.prototype,"tabIndex",void 0),r}(t.ChildProperty),Ls=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rs=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Ms=function(r){function o(e,t){var o=r.call(this,e,t)||this;return o.bulletid=57726,o.animateSeries=!0,o.padding=5,o.leftSize=0,o.rightSize=0,o.topSize=0,o.bottomSize=0,o.maxLabelSize=new i.Size(0,0),o.maxTitleSize=new i.Size(0,0),o.intervalDivs=[10,5,2,1],o}return Ls(o,r),o.prototype.preRender=function(){this.isBlazor=window.Blazor,this.allowServerDataBinding=!1,this.unWireEvents(),this.initPrivateValues(),this.setCulture(),this.wireEvents()},o.prototype.initPrivateValues=function(){if(this.delayRedraw=!1,this.scale=new ys(this),this.bulletAxis=new us(this),""===this.element.id){var e=document.getElementsByClassName("e-BulletChart").length;this.element.id="BulletChart_"+this.bulletid+"_"+e}},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.render=function(){var e=this,t={bulletChart:this.isBlazor?{}:this,theme:this.theme,name:"load"};this.trigger("load",t,function(){e.theme=e.isBlazor?t.theme:e.theme,e.setTheme(),e.createSvg(e),e.findRange(),e.bulletChartLegendModule&&e.legendSettings.visible&&(e.calculateVisibleElements(),e.bulletChartLegendModule.getLegendOptions(e.visibleRanges)),e.calculatePosition(),e.renderBulletElements();e.trigger("loaded",{bulletChart:window.Blazor?{}:e}),e.allowServerDataBinding=!0,e.renderComplete()})},o.prototype.setTheme=function(){this.themeStyle=lt(this.theme)},o.prototype.findRange=function(){if(this.minimum||(this.minimum=0),!this.maximum){this.maximum=0;for(e=0;e<this.ranges.length;e++)this.maximum=this.maximum>this.ranges[e].end?this.maximum:this.ranges[e].end}if(null===this.maximum)if(t.isNullOrUndefined(this.dataSource))this.maximum=10;else for(var e=0;e<Object.keys(this.dataSource).length;e++)this.dataSource[e][this.targetField]>this.dataSource[e][this.valueField]?this.maximum=this.maximum>this.dataSource[e][this.targetField]?this.maximum+this.interval:this.dataSource[e][this.targetField]+this.interval:this.maximum=this.maximum>this.dataSource[e][this.valueField]?this.maximum+this.interval:this.dataSource[e][this.valueField]+this.interval;this.interval||(this.interval=this.calculateNumericNiceInterval(this.maximum-this.minimum))},o.prototype.getActualDesiredIntervalsCount=function(e){var t="Horizontal"===this.orientation?e.width:e.height,i=3*("Horizontal"===this.orientation?.533:1);return i=Math.max(t*(i/100),1)},o.prototype.calculateNumericNiceInterval=function(e){for(var t=this.getActualDesiredIntervalsCount(this.availableSize),i=e/t,r=Math.pow(10,Math.floor(v(i,10))),o=0,n=this.intervalDivs;o<n.length;o++){var a=r*n[o];if(t<e/a)break;i=a}return i},o.prototype.setSecondaryElementPosition=function(){var e=he(this.element.id+"_Secondary_Element");if(e){var t=this.element.getBoundingClientRect(),i=he(this.element.id+"_svg").getBoundingClientRect();e.style.left=Math.max(i.left-t.left,0)+"px",e.style.top=Math.max(i.top-t.top,0)+"px",e.style.position="relative"}},o.prototype.createSvg=function(e){this.removeSvg(),e.renderer=new i.SvgRenderer(e.element.id),this.calculateAvailableSize(this),e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height}),this.renderChartBackground()},o.prototype.renderChartBackground=function(){var e=new Di(this.element.id+"_ChartBorder",this.themeStyle.background,{width:this.border.width||0,color:this.border.color||"transparent"},1,new i.Rect(0,0,this.availableSize.width,this.availableSize.height));this.svgObject.appendChild(this.renderer.drawRectangle(e))},o.prototype.renderBulletElements=function(){var e=this.renderer.createGroup({id:this.svgObject.id+"_scaleGroup"});this.svgObject.appendChild(e),this.renderBulletChartTitle(),this.rangeCollection=this.scale.drawScaleGroup(e);var t=("Horizontal"===this.orientation?this.initialClipRect.width:this.initialClipRect.height)/((this.maximum-this.minimum)/this.interval);this.bulletAxis.renderMajorTickLines(t,e),this.bulletAxis.renderMinorTickLines(t,e),this.bulletAxis.renderAxisLabels(t,e),this.bulletChartRect.x="Left"===this.titlePosition||"Right"===this.titlePosition||"Vertical"===this.orientation?this.bulletChartRect.x:0;var i=this.element.id;if("g"!==this.element.tagName){var r=Fe(this.redraw,i+"_Secondary_Element")||this.createElement("div");r.id=i+"_Secondary_Element",be(!1,this.element,r,this.redraw)}this.tooltip.enable&&be(!1,this.svgObject,this.renderer.createGroup({id:i+"_UserInteraction",style:"pointer-events:none;"}),this.redraw),this.bindData(),this.renderDataLabel(),this.renderBulletLegend(),this.element.appendChild(this.svgObject),this.setSecondaryElementPosition()},o.prototype.renderBulletLegend=function(){if(this.bulletChartLegendModule&&this.bulletChartLegendModule.legendCollections.length){this.bulletChartLegendModule.calTotalPage=!0;var e=this.bulletChartLegendModule.legendBounds;this.bulletChartLegendModule.renderLegend(this,this.legendSettings,e)}},o.prototype.bulletResize=function(){var e=this;this.animateSeries=!1;var t={chart:this,name:"resized",currentSize:new i.Size(0,0),previousSize:new i.Size(this.availableSize.width,this.availableSize.height)};return this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){if(e.isDestroyed)return void clearTimeout(e.resizeTo);e.createSvg(e),t.currentSize=e.availableSize,e.trigger("resized",t),e.calculatePosition(),e.renderBulletElements()},500),!1},o.prototype.bindData=function(){null!=this.dataSource&&(this.dataCount=this.dataSource.length,this.drawMeasures(this.dataCount))},o.prototype.drawMeasures=function(e){this.scale.renderFeatureBar(e),this.scale.renderComparativeSymbol(e)},o.prototype.calculatePosition=function(){var e=this.margin,t=0,r=0,o=new i.Size(0,0);this.titleCollections=[],this.subTitleCollections=[];var n=0,a=0,s=5;if(this.title){this.titleCollections=Xe(this.title,this.titleStyle,this.titleStyle.maximumTitleWidth),t=i.measureText(this.title,this.titleStyle).height*this.titleCollections.length+5;for(var l=0,h=this.titleCollections;l<h.length;l++){var c=h[l];n=(o=i.measureText(c,this.titleStyle)).width>n?o.width:n,a=o.height>a?o.height:a}if(s+=a,this.subTitleCollections=Xe(this.subtitle,this.subtitleStyle,this.titleStyle.maximumTitleWidth),this.subtitle){for(var d=0,p=this.subTitleCollections;d<p.length;d++){var u=p[d];n=(o=i.measureText(u,this.subtitleStyle)).width>n?o.width:n,a=o.height>a?o.height:a}r=i.measureText(this.subtitle,this.subtitleStyle).height*this.subTitleCollections.length+5,s+=a}}this.maxTitleSize=new i.Size(n,"Vertical"===this.orientation?s:a),this.maxLabelSize=this.getMaxLabelWidth(),this.initialClipRect=this.getBulletBounds("Vertical"===this.orientation?s:n,t,r,e),this.bulletChartRect=new i.Rect(this.initialClipRect.x,this.initialClipRect.y,this.initialClipRect.width,this.initialClipRect.height),this.bulletChartLegendModule&&this.bulletChartLegendModule.calculateLegendBounds(this.initialClipRect,this.availableSize,this.maxLabelSize)},o.prototype.getBulletBounds=function(e,t,r,o){var n=new i.Rect(0,0,0,0),a=this.enableRtl,s=this.labelPosition===this.tickPosition?5:0,l="Inside"===this.tickPosition?0:this.majorTickLines.height,h="Inside"===this.labelPosition?0:5+("Outside"===this.tickPosition?0:i.measureText(this.maximum.toString(),this.labelStyle).height),c=0,d=0,p=0,u=0,g=0,y=0,m=0,v=0,f=e,b=this.bulletAxis.getFormat(this),x=null!==b.match("{value}");this.bulletAxis.format=this.intl.getNumberFormat({format:x?"":b,useGrouping:this.enableGroupSeparator});var w,S=i.measureText(this.bulletAxis.formatValue(this.bulletAxis,x,b,this.maximum),this.labelStyle).width;switch("Horizontal"===this.orientation?(w=this.maxLabelSize.width,c=this.opposedPosition?l+h+s:0,d=this.opposedPosition?0:l+h+s,m=w&&!a?w:0,m+=f&&"Left"===this.titlePosition?15:0,v=w&&a?w:0,v+=f&&"Right"===this.titlePosition?5:0):(w=this.maxLabelSize.height,u=this.opposedPosition?l+s:0,u+=this.opposedPosition&&"Inside"!==this.labelPosition?S:0,p=this.opposedPosition?0:l+s,p+=this.opposedPosition||"Inside"===this.labelPosition?0:S,g=w&&a?w+5:0,y=w&&!a?w+5:0),this.titlePosition){case"Left":n.x=o.left+f+m+p,n.width=this.availableSize.width-o.right-n.x-v-u,n.y=o.top+c+g,n.height=this.availableSize.height-n.y-o.bottom-d-y;break;case"Right":n.x=o.left+m+p,n.width=this.availableSize.width-u-o.right-n.x-(f+5)-v,n.y=o.top+c+g,n.height=this.availableSize.height-n.y-o.bottom-d-y;break;case"Top":n.x=o.left+p+m,n.width=this.availableSize.width-o.right-n.x-v-u,n.y=o.top+(t+r)+c+g,n.height=this.availableSize.height-n.y-o.bottom-d-y;break;case"Bottom":n.x=o.left+p+m,n.y=o.top+c+g,n.width=this.availableSize.width-o.right-n.x-v-u,n.height=this.availableSize.height-n.y-y-o.bottom-d-(t+r)}return n},o.prototype.getMaxLabelWidth=function(){if(this.maxLabelSize=new i.Size(0,0),!this.categoryField)return this.maxLabelSize;for(var e,t=0,r=Object.keys(this.dataSource).length;t<r;t++)(e=i.measureText(this.dataSource[t][this.categoryField]||"",this.categoryLabelStyle)).width>this.maxLabelSize.width&&(this.maxLabelSize.width=e.width),e.height>this.maxLabelSize.height&&(this.maxLabelSize.height=e.height);return this.maxLabelSize},o.prototype.calculateVisibleElements=function(){var e,t=this.ranges;this.visibleRanges=[];for(var i=0,r=t.length;i<r;i++)(e=t[i]).index=i,e.color=e.color,this.visibleRanges.push(e),t[i]=e},o.prototype.renderBulletChartTitle=function(){var e=this.margin,t=0,r=0,o="middle",n="",a=this.titleStyle.textAlignment,s=i.measureText(this.title,this.titleStyle),l=this.subtitle?i.measureText(this.subtitle,this.subtitleStyle):new i.Size(0,0);if(this.title){if("Horizontal"===this.orientation)switch(this.titlePosition){case"Top":t=this.findHorizontalAlignment(e),o="Far"===a?"end":"Near"===a?"start":"middle",r=e.top+s.height/2+5;break;case"Bottom":t=this.findHorizontalAlignment(e),o="Far"===a?"end":"Near"===a?"start":"middle",r=this.availableSize.height-e.bottom-s.height/3+10-(l.height?l.height+5:0);break;case"Left":o="end",t=e.left+this.maxTitleSize.width,r=this.margin.top+this.availableSize.height/2-s.height/3-(l.height?l.height:0);break;case"Right":o="start",t=this.availableSize.width-e.right-this.maxTitleSize.width+5,r=this.margin.top+this.availableSize.height/2-s.height/3-(l.height?l.height:0)}else{switch(this.titlePosition){case"Top":t=this.availableSize.width/2+10,r=this.margin.top+s.height/2+5;break;case"Bottom":t=this.availableSize.width/2,r=this.availableSize.height-this.margin.bottom-s.height/3+10-(l.height?l.height+5:0);break;case"Left":r=this.findVerticalAlignment(e),o="Far"===a?"start":"Near"===a?"end":"middle",t=e.left;break;case"Right":t=this.availableSize.width-e.right-s.height/3,o="Far"===a?"start":"Near"===a?"end":"middle",r=this.findVerticalAlignment(e)}n="Left"===this.titlePosition?"rotate(-90,"+t+","+r+")":"Right"===this.titlePosition?"rotate(90,"+t+","+r+")":""}var h=new i.TextOption(this.element.id+"_BulletChartTitle",t,r,o,this.titleCollections,n,"auto"),c=Ve(this.renderer,h,this.titleStyle,this.titleStyle.color||this.themeStyle.titleFontColor,this.svgObject);c&&(c.setAttribute("aria-label",this.title),c.setAttribute("tabindex",this.tabIndex.toString())),this.subtitle&&this.renderBulletChartSubTitle(t,r,o)}},o.prototype.renderDataLabel=function(){var e,t,r,o=0,n=0,a=this.enableRtl,s=this.labelFormat?this.labelFormat:"",l=null!==s.match("{value}");if(this.dataLabel.enable)for(var h=0,c=Object.keys(this.dataSource).length;h<c;h++){t=this.dataSource[h],r=this.scale.featureBarBounds[h];var d=t[this.valueField].toString();this.format=this.intl.getNumberFormat({format:l?"":s,useGrouping:this.enableGroupSeparator}),d=l?s.replace("{value}",this.format(d)):d;var p=i.measureText(d,this.dataLabel.labelStyle),u=p.width,g=p.height;"Horizontal"===this.orientation?(e="Rect"===this.type?"end":a?"end":"start",o=r.x+(a?"Rect"===this.type?u+10:-10:r.width)+("Rect"===this.type?-5:5),n=r.y+r.height/2):(e="middle",o=r.y+r.height/2,n=r.x+(a?r.width+("Rect"===this.type?-g:g):0)+("Rect"===this.type?10:-10));var y=new i.TextOption(this.element.id+"_DataLabel_"+h,o,n,e,d,"","middle");Ve(this.renderer,y,this.dataLabel.labelStyle,this.dataLabel.labelStyle.color||this.themeStyle.dataLabelFontColor,this.svgObject)}},o.prototype.findHorizontalAlignment=function(e){var t=0;switch(this.titleStyle.textAlignment){case"Center":t=(this.availableSize.width-e.left-e.right)/2;break;case"Near":t=e.left;break;case"Far":t=this.availableSize.width-e.right}return t},o.prototype.findVerticalAlignment=function(e){var t=0;switch(this.titleStyle.textAlignment){case"Center":t=(this.availableSize.height-e.top-e.bottom)/2;break;case"Near":t=e.top;break;case"Far":t=this.availableSize.height-e.bottom}return t},o.prototype.renderBulletChartSubTitle=function(e,t,r){var o=this.margin,n="",a=i.measureText(this.subtitle,this.subtitleStyle);if("Horizontal"===this.orientation)switch(this.titlePosition){case"Top":t=t+a.height+2.5;break;case"Bottom":t=this.availableSize.height-o.bottom-a.height/3+5;break;case"Left":case"Right":t=t+a.height+2.5}else{switch(this.titlePosition){case"Top":t=t+a.height+2.5;break;case"Bottom":t=this.availableSize.height-o.bottom-a.height/3+5;break;case"Left":e+=a.height+2.5;break;case"Right":e-=a.height+2.5}n="Left"===this.titlePosition?"rotate(-90,"+e+","+t+")":"Right"===this.titlePosition?"rotate(90,"+e+","+t+")":""}var s=new i.TextOption(this.element.id+"_BulletChartSubTitle",e,t,r,this.subTitleCollections,n,"auto"),l=Ve(this.renderer,s,this.subtitleStyle,this.subtitleStyle.color||this.themeStyle.subTitleFontColor,this.svgObject);l&&(l.setAttribute("aria-label",this.title),l.setAttribute("tabindex",this.tabIndex.toString()))},o.prototype.calculateAvailableSize=function(e){var t=this.element.clientWidth||this.element.offsetWidth||200,r="Vertical"===this.orientation?450:"Left"===this.titlePosition||"Right"===this.titlePosition?83:126,o=this.element.clientHeight||r;e.availableSize=new i.Size(Be(e.width,t)||t,Be(e.height,o)||o)},o.prototype.removeSvg=function(){var e=document.getElementById(this.element.id+"_svg");e&&t.remove(e)},o.prototype.getPersistData=function(){var e=["loaded"];return this.addOnPersist(e)},o.prototype.unWireEvents=function(){var e=t.Browser.touchStartEvent,i=t.Browser.touchMoveEvent,r=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,e,this.bulletMouseDown),t.EventHandler.remove(this.element,i,this.bulletMouseMove),t.EventHandler.remove(this.element,r,this.bulletMouseLeave),t.EventHandler.remove(this.element,"click",this.bulletChartOnMouseClick),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound)},o.prototype.wireEvents=function(){var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.bulletMouseMove,this),t.EventHandler.add(this.element,e,this.bulletMouseLeave,this),t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.bulletMouseDown,this),t.EventHandler.add(this.element,"click",this.bulletChartOnMouseClick,this),this.resizeBound=this.bulletResize.bind(this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeBound),this.setStyle(this.element)},o.prototype.setStyle=function(e){e.style.position="relative",e.style.display="block"},o.prototype.bulletMouseMove=function(e){var i=e.clientX,r=e.clientY;this.setPointMouseXY(i,r);var o=e.target.id,n=e.target.className.baseVal;if(!(n===this.svgObject.id+"_FeatureMeasure"&&(this.svgObject.id,0)||t.isNullOrUndefined(this.dataSource)))for(var a=0;a<Object.keys(this.dataSource).length;a++)document.getElementById(this.svgObject.id+"_FeatureMeasure_"+a).setAttribute("opacity","1"),document.getElementById(this.svgObject.id+"_ComparativeMeasure_"+a).setAttribute("opacity","1");if(!this.isTouchEvent(e)){var s="tooltipDiv"+this.element.id,l=document.getElementById(s);l&&(this.isReact&&this.clearTemplate(),t.remove(l)),this.bulletTooltipModule&&(this.bulletTooltipModule._elementTooltip(e,n,o,this.mouseX),this.bulletTooltipModule._displayTooltip(e,n,o,this.mouseX,this.mouseY))}},o.prototype.setPointMouseXY=function(e,t){var i=he(this.svgObject.id).getBoundingClientRect(),r=this.element.getBoundingClientRect();this.mouseX=e-r.left-Math.max(i.left-r.left,0),this.mouseY=t-r.top-Math.max(i.top-r.top,0)},o.prototype.bulletMouseLeave=function(e){if(!this.isTouchEvent(e)){var i=document.getElementById(".tooltipDiv"+this.element.id);i&&(this.isReact&&this.clearTemplate(),t.remove(i))}},o.prototype.isTouchEvent=function(e){return"touch"===e.pointerType||e.type.indexOf("touch")>-1},o.prototype.bulletMouseDown=function(e){if(this.isTouchEvent(e)){this.isReact&&this.clearTemplate(),t.remove(document.getElementById("tooltipDiv"+this.element.id));var i=e.target.id,r=e.target.className.baseVal;this.bulletTooltipModule&&(this.bulletTooltipModule._elementTooltip(e,r,i,this.mouseX),this.bulletTooltipModule._displayTooltip(e,r,i,this.mouseX,this.mouseY))}},o.prototype.bulletChartOnMouseClick=function(e){var t=e.target;return this.trigger("bulletChartMouseClick",{target:t.id,x:this.mouseX,y:this.mouseY}),this.notify("click",e),!1},o.prototype.print=function(e){new xr(this).print(e)},o.prototype.export=function(e,t,i,r,o,n,a){r=r||[this],new xr(this).export(e,t,i,r,o,n,a)},o.prototype.onPropertyChanged=function(e,t){var i=!1,o=!1;if(this.animateSeries=!1,!this.delayRedraw){for(var n=0,a=Object.keys(e);n<a.length;n++)switch(a[n]){case"height":case"width":this.createSvg(this),o=!0;break;case"subtitle":case"title":o=!0;break;case"tickPosition":case"labelPosition":case"titlePosition":i=!0;break;case"minimum":case"maximum":case"interval":o=!0;break;case"majorTickLines":case"minorTickLines":case"type":case"ranges":case"valueFill":case"targetColor":o=!0;break;case"titleStyle":e.titleStyle?o=!0:i=!0;break;case"subtitleStyle":e.subtitleStyle&&(e.subtitleStyle.size||e.subtitleStyle.textOverflow)?o=!0:i=!0;break;case"border":case"opposedPosition":i=!0;break;case"dataSource":this.bindData(),o=!0;break;case"theme":this.animateSeries=!0;break;case"locale":case"currencyCode":r.prototype.refresh.call(this)}if(!o&&i){this.removeSvg(),this.renderBulletElements();s="Blazor";this.trigger("loaded",{bulletChart:window[s]?{}:this})}if(o){this.render();var s="Blazor";this.trigger("loaded",{bulletChart:window[s]?{}:this}),this.redraw=!1}}},o.prototype.requiredModules=function(){for(var e,t=[],i=0;i<this.ranges.length;i++)null!==this.ranges[i].name&&(e=!0);return this.isLegend=this.legendSettings.visible&&(e||!!this.isLegend||""!==this.targetField||""!==this.valueField),this.tooltip.enable&&t.push({member:"BulletTooltip",args:[this]}),this.isLegend&&t.push({member:"BulletChartLegend",args:[this]}),t},o.prototype.getModuleName=function(){return"bulletChart"},o.prototype.destroy=function(){this.unWireEvents(),r.prototype.destroy.call(this),this.removeSvg(),this.svgObject=null,this.element.classList.remove("e-BulletChart"),this.element.innerHTML=""},Rs([t.Property(null)],o.prototype,"width",void 0),Rs([t.Property(null)],o.prototype,"height",void 0),Rs([t.Property(null)],o.prototype,"locale",void 0),Rs([t.Complex({},bs)],o.prototype,"majorTickLines",void 0),Rs([t.Complex({},xs)],o.prototype,"minorTickLines",void 0),Rs([t.Property(null)],o.prototype,"minimum",void 0),Rs([t.Property(null)],o.prototype,"maximum",void 0),Rs([t.Property(null)],o.prototype,"interval",void 0),Rs([t.Property(4)],o.prototype,"minorTicksPerInterval",void 0),Rs([t.Complex(e.BulletChartTheme.axisLabelFont,ws)],o.prototype,"labelStyle",void 0),Rs([t.Complex(e.BulletChartTheme.axisLabelFont,ws)],o.prototype,"categoryLabelStyle",void 0),Rs([t.Property("")],o.prototype,"labelFormat",void 0),Rs([t.Property("")],o.prototype,"title",void 0),Rs([t.Complex(e.BulletChartTheme.titleFont,ws)],o.prototype,"titleStyle",void 0),Rs([t.Property("")],o.prototype,"subtitle",void 0),Rs([t.Complex(e.BulletChartTheme.subTitleFont,ws)],o.prototype,"subtitleStyle",void 0),Rs([t.Property("Horizontal")],o.prototype,"orientation",void 0),Rs([t.Complex({color:"#DDDDDD",width:0},Yt)],o.prototype,"border",void 0),Rs([t.Complex({},Ss)],o.prototype,"tooltip",void 0),Rs([t.Collection([{end:null,opacity:1,color:""},{end:null,opacity:1,color:""},{end:null,opacity:1,color:""}],fs)],o.prototype,"ranges",void 0),Rs([t.Property("Outside")],o.prototype,"labelPosition",void 0),Rs([t.Property("Outside")],o.prototype,"tickPosition",void 0),Rs([t.Property("Top")],o.prototype,"titlePosition",void 0),Rs([t.Property(!1)],o.prototype,"opposedPosition",void 0),Rs([t.Property("Material")],o.prototype,"theme",void 0),Rs([t.Complex({},qt)],o.prototype,"animation",void 0),Rs([t.Complex({},Cs)],o.prototype,"dataLabel",void 0),Rs([t.Complex({},Ps)],o.prototype,"legendSettings",void 0),Rs([t.Property(!1)],o.prototype,"enableGroupSeparator",void 0),Rs([t.Complex({top:15,bottom:10,left:15,right:15},Ut)],o.prototype,"margin",void 0),Rs([t.Property(5)],o.prototype,"targetWidth",void 0),Rs([t.Property("#191919")],o.prototype,"targetColor",void 0),Rs([t.Property(6)],o.prototype,"valueHeight",void 0),Rs([t.Property(null)],o.prototype,"valueFill",void 0),Rs([t.Complex({color:"transparent",width:0},Yt)],o.prototype,"valueBorder",void 0),Rs([t.Property(null)],o.prototype,"dataSource",void 0),Rs([t.Property(null)],o.prototype,"query",void 0),Rs([t.Property(null)],o.prototype,"categoryField",void 0),Rs([t.Property("Rect")],o.prototype,"type",void 0),Rs([t.Property("")],o.prototype,"valueField",void 0),Rs([t.Property("")],o.prototype,"targetField",void 0),Rs([t.Property(["Rect","Cross","Circle"])],o.prototype,"targetTypes",void 0),Rs([t.Property(1)],o.prototype,"tabIndex",void 0),Rs([t.Event()],o.prototype,"tooltipRender",void 0),Rs([t.Event()],o.prototype,"load",void 0),Rs([t.Event()],o.prototype,"loaded",void 0),Rs([t.Event()],o.prototype,"bulletChartMouseClick",void 0),Rs([t.Event()],o.prototype,"legendRender",void 0),Rs([t.Event()],o.prototype,"beforePrint",void 0),o=Rs([t.NotifyPropertyChanges],o)}(t.Component),As=function(){function i(e){this.control=e,this.elementId=e.element.id,this.bulletAxis=new us(this.control)}return i.prototype._elementTooltip=function(t,i,r,o){var n=this.control.createElement("div");n.id="tooltip",n.className="tooltipDiv";var a=t.target,s=o+20,l=t.clientY,h="",c=this.control.tooltip.textStyle.fontStyle?this.control.tooltip.textStyle.fontStyle:e.BulletChartTheme.tooltipLabelFont.fontStyle,d=this.control.tooltip.fill?this.control.tooltip.fill:this.control.themeStyle.tooltipFill,p="left:"+s+"px;top:"+l+'px;display: block; position: absolute; "z-index": "13000",cursor: default;font-family: Segoe UI;color:'+(e.BulletChartTheme.tooltipLabelFont.color||this.control.themeStyle.tooltipBoldLabel)+"; font-size: 13px; background-color:"+d+"; border: 1px solid #707070;font-style:"+c+";";n.setAttribute("style",p),i===this.control.svgObject.id+"_Caption"?h=a.textContent===this.control.title?"":this.control.title:i===this.control.svgObject.id+"_SubTitle"&&(h=a.textContent===this.control.subtitle?"":this.control.subtitle),""!==h&&(n.innerHTML=" "+h+" ",document.body.insertAdjacentElement("afterbegin",n))},i.prototype._displayTooltip=function(i,r,o,n,a){if("undefined"!==r&&this.control.tooltip.enable&&(r===this.control.svgObject.id+"_FeatureMeasure"||r===this.control.svgObject.id+"_ComparativeMeasure")){var s=void 0,l=void 0,h=void 0,c=void 0,d=[],p=void 0,u=void 0,g=this.bulletAxis.getFormat(this.control),y=null!==g.match("{value}");h=o.substring(o.lastIndexOf("_")+1);var m=[];this.bulletAxis.format=this.bulletAxis.bulletChart.intl.getNumberFormat({format:y?"":g,useGrouping:this.bulletAxis.bulletChart.enableGroupSeparator}),c=this.control.dataSource[h][this.control.valueField],d=d.concat(this.control.dataSource[h][this.control.targetField]),p=this.control.dataSource[h][this.control.categoryField];var v=c?c.toString():"",f=d?d.toString():"",b=p?p.toString():"";v=this.bulletAxis.formatValue(this.bulletAxis,y,g,+c);for(L=0;L<d.length;L++)m=m.concat(this.bulletAxis.formatValue(this.bulletAxis,y,g,+d[L]));s={value:v,target:m,category:b=this.bulletAxis.formatValue(this.bulletAxis,y,g,+p)},l={value:v,target:f,category:b};var x="position: absolute; z-index: 13000; display: block;";0===document.getElementsByClassName("tooltipDiv"+this.control.element.id).length&&((u=this.control.createElement("div")).id="tooltipDiv"+this.control.element.id,u.setAttribute("style",x),document.getElementById(this.control.element.id+"_Secondary_Element").appendChild(u));var w={value:s.value,target:s.target,name:"tooltipRender"};if(""!==this.control.tooltip.template&&null!=this.control.tooltip.template){this.updateTemplateFn();for(var S=this.control.createElement("div",{id:this.control.element.id+"parent_template"}),C=this.templateFn(l,this.control,"template",S.id+"_blazorTemplate","",null,S);C&&C.length>0;)t.isBlazor()||1===C.length?(S.appendChild(C[0]),C=null):S.appendChild(C[0]);w.template=S.innerHTML,this.control.trigger("tooltipRender",w),S.innerHTML=w.template,u.appendChild(S)}else{for(var P="Value : "+w.value,L=0;L<w.target.length;L++)P+="<br/> Target"+(0===L?"":"_"+L)+" : "+w.target[L];w.text=P,this.control.trigger("tooltipRender",w),u.innerHTML=w.text,u.style.font=this.control.tooltip.textStyle.fontStyle?this.control.tooltip.textStyle.fontStyle:e.BulletChartTheme.tooltipLabelFont.fontStyle,u.style.color=e.BulletChartTheme.tooltipLabelFont.color||this.control.themeStyle.tooltipBoldLabel,u.style.fontSize=e.BulletChartTheme.titleFont.size}var R=this.control.tooltip.fill?this.control.tooltip.fill:this.control.themeStyle.tooltipFill,M=this.control.tooltip.border.width?this.control.tooltip.border.width:1,A=this.control.tooltip.border.color?this.control.tooltip.border.color:"Black",k=n,T=a;if(k=k+Be(u.getAttribute("width"),this.control.containerWidth)<window.innerWidth?k:Be(u.getAttribute("width"),this.control.containerWidth),T=T+Be(u.getAttribute("height"),this.control.containerHeight)<window.innerHeight?T:Be(u.getAttribute("height"),this.control.containerHeight),void 0!==k&&null!==k||(k=n),void 0!==T&&null!==T||(T=i.clientY),""!==this.control.tooltip.template&&null!=this.control.tooltip.template)u.setAttribute("style","position: absolute;left:"+(k+20)+"px;top:"+(T+20)+"px;"),t.isBlazor()&&t.updateBlazorTemplate(this.control.element.id+"parent_template_blazorTemplate","Template",this.control.tooltip);else{var _=x+"left:"+(k+20)+"px;top:"+(T+20)+"px;-webkit-border-radius: 5px 5px 5px 5px; -moz-border-radius: 5px 5px 5px 5px;-o-border-radius: 5px 5px 5px 5px;border-radius: 5px 5px 5px 5px;background-color:"+R+";color:"+u.style.color+"; border:"+M+"px Solid "+A+";padding-bottom: 7px;font-style:"+e.BulletChartTheme.tooltipLabelFont.fontStyle+"; padding-left: 10px; font-family: Segoe UI; padding-right: 10px; padding-top: 7px";u.setAttribute("style",_),r!==this.control.svgObject.id+"_FeatureMeasure"&&r!==this.control.svgObject.id+"_ComparativeMeasure"||document.getElementById(o).setAttribute("opacity","0.6")}this.control.isReact&&this.control.renderReactTemplates()}},i.prototype.updateTemplateFn=function(){if(this.control.tooltip.template)try{document.querySelectorAll(this.control.tooltip.template).length&&(this.templateFn=t.compile(document.querySelector(this.control.tooltip.template).innerHTML.trim()))}catch(e){this.templateFn=t.compile(this.control.tooltip.template)}},i.prototype.getModuleName=function(){return"BulletTooltip"},i.prototype.destroy=function(){},i}(),ks=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ts=function(e){function r(t){var i=e.call(this,t)||this;return i.library=i,i.addEventListener(),i}return ks(r,e),r.prototype.addEventListener=function(){this.chart.isDestroyed||(this.chart.on("click",this.click,this),this.chart.on(t.Browser.touchEndEvent,this.mouseEnd,this),this.chart.on(t.Browser.touchMoveEvent,this.bulletMouseMove,this))},r.prototype.removeEventListener=function(){this.chart.isDestroyed||(this.chart.off("click",this.click),this.chart.off(t.Browser.touchEndEvent,this.mouseEnd),this.chart.off(t.Browser.touchMoveEvent,this.bulletMouseMove))},r.prototype.bulletMouseMove=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},r.prototype.mouseEnd=function(e){this.chart.legendSettings.visible&&this.chart.isTouch&&this.move(e)},r.prototype.getLegendOptions=function(e){this.legendCollections=[];for(var i,r=0,o=this.chart,n=0,a=e;n<a.length;n++){var s=a[n];null!==s.name&&(i=s.color?s.color:o.themeStyle.rangeStrokes[s.index].color,this.legendCollections.push(new mr(s.name,i,s.shape,this.chart.legendSettings.visible,null,s.legendImageUrl,null,!1,s.index,null)),r++)}if(null!==o.dataSource&&""!==o.valueField){i=o.valueFill||"black";l="Vertical"===o.orientation?"TargetRect":"ActualRect";this.legendCollections.push(new mr("Actual",i,l,this.chart.legendSettings.visible,null,"",null,!1,r++,null))}if(null!==o.dataSource&&""!==o.targetField){i=o.targetColor||"black";for(var l="Vertical"===o.orientation?"ActualRect":"TargetRect",h=0;h<Object.keys(o.dataSource).length;h++)if(t.isNullOrUndefined(o.dataSource[h][o.targetField].length)||1===o.dataSource[h][o.targetField].length)for(;0===h;){this.legendCollections.push(new mr("Target",i,l,this.chart.legendSettings.visible,null,"",null,!1,r++,null));break}else for(var c=o.targetTypes,d=[],p=c.length;0===h;){for(var u=0;u<p;u++)d[u]=c[u%p],d[u]="Rect"===d[u]?"Vertical"===o.orientation?"ActualRect":"TargetRect":d[u],d[u]="Cross"===d[u]?"Multiply":d[u],this.legendCollections.push(new mr("Target_"+u,i,d[u],this.chart.legendSettings.visible,null,"",null,!1,r++,null));break}}},r.prototype.getLegendBounds=function(e,t,r){var o=0,n=r.padding,a=0;this.isVertical?o=r.width?0:e.width/100*5:a=r.height?0:e.height/100*5,t.height+=a,t.width+=o;var s,l=0,h=0,c=0,d=0,p=0,u=r.shapeWidth,g=r.shapePadding;this.maxItemHeight=Math.max(i.measureText("MeasureText",r.textStyle).height,r.shapeHeight);for(var y=!1,m=0,v=this.legendCollections;m<v.length;m++){var f=v[m];s={fill:f.fill,text:f.text,shape:f.shape,name:"legendRender",cancel:!1},this.chart.trigger("legendRender",s),f.render=!s.cancel,f.text=s.text,f.fill=s.fill,f.shape=s.shape,f.textSize=i.measureText(f.text,r.textStyle),f.render&&""!==f.text&&(y=!0,h+=d=u+g+f.textSize.width+n,(t.width<n+h||this.isVertical)&&(l=Math.max(l,h+n-(this.isVertical?0:d)),0===c&&d!==h&&(c=1),h=this.isVertical?0:d,p=++c*(this.maxItemHeight+n)+n))}p=Math.max(p,this.maxItemHeight+n+n),this.isPaging=t.height<p,this.totalPages=c,y?this.setBounds(Math.max(h+n,l),p,r,t):this.setBounds(0,0,r,t)},r.prototype.getRenderPoint=function(e,t,i,r,o,n,a){var s=r.location.x+i+r.textSize.width,l=this.legend.padding;s+(e.textSize.width+i)>o.x+o.width+this.legend.shapeWidth/2||this.isVertical?(e.location.x=t.x,e.location.y=n===a?r.location.y:r.location.y+this.maxItemHeight+l):(e.location.x=n===a?r.location.x:s,e.location.y=r.location.y);var h=this.legendBounds.x+this.legendBounds.width-(e.location.x+i-this.legend.shapeWidth/2);e.text=ze(+h.toFixed(4),e.text,this.legend.textStyle)},r.prototype.click=function(e){var t=e.target.id;t.indexOf(this.legendID+"_pagedown")>-1?this.changePage(e,!1):t.indexOf(this.legendID+"_pageup")>-1&&this.changePage(e,!0)},r.prototype.getModuleName=function(){return"BulletChartLegend"},r.prototype.destroy=function(){this.removeEventListener()},r}(yr),_s=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Os=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Es=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _s(i,e),Os([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),Os([t.Property("Normal")],i.prototype,"fontStyle",void 0),Os([t.Property("Regular")],i.prototype,"fontWeight",void 0),Os([t.Property("")],i.prototype,"color",void 0),Os([t.Property("12px")],i.prototype,"size",void 0),Os([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Is=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _s(i,e),Os([t.Property(10)],i.prototype,"top",void 0),Os([t.Property(10)],i.prototype,"bottom",void 0),Os([t.Property(10)],i.prototype,"right",void 0),Os([t.Property(10)],i.prototype,"left",void 0),i}(t.ChildProperty),zs=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _s(i,e),Os([t.Property(0)],i.prototype,"width",void 0),Os([t.Property(1)],i.prototype,"opacity",void 0),Os([t.Property("transparent")],i.prototype,"color",void 0),i}(t.ChildProperty),Ds=function(){function e(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}return e}(),Bs=function(){function e(){}return e}(),Fs=function(){function e(){}return e}(),Ns=function(){function e(){}return e}(),Vs=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _s(t,e),t}(Bs),js=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _s(t,e),t}(Vs),Hs=function(){function e(){}return e}(),Xs=function(){function e(){}return e}(),Ys=function(){function e(){}return e}(),Gs=function(){function e(){}return e}(),Ws=function(){function e(e,t,i,r,o){this.id=e,this.fill=t,this.borderColor=i,this.borderWidth=r,this.opacity=o}return e}(),Us=function(){function e(){}return e}(),Zs=function(){function e(){this.counterclockwise=0,this.clockwise=1}return e}(),qs=function(){function e(){}return e}(),Qs=function(){function e(){}return e}(),$s=function(){function e(e,t){this.width=e,this.height=t}return e}(),Js=function(){function e(){}return e}(),Ks=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),el=function(){function e(e,t,i,r,o,n,a){this.id=e,this.opacity=o,this.fill=t,this.stroke=r,this["stroke-width"]=i,this["stroke-dasharray"]=n,this.d=a}return e}(),tl=function(e){function t(t,i,r,o,n){var a=e.call(this,t,i,r.width,r.color,o)||this;return a.y=n.y,a.x=n.x,a.height=n.height,a.width=n.width,a}return Ks(t,e),t}(el),il=function(e){function t(t,i,r,o,n,a,s,l){var h=e.call(this,t,i,r.width,r.color,o)||this;return h.cy=a,h.cx=n,h.r=s,h["stroke-dasharray"]=l,h}return Ks(t,e),t}(el),rl=function(){function e(e,t,i,r,o){this.id=e,this.x=t,this.y=i,this.anchor=r,this.text=o}return e}();!function(e){e.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},e.smithchartTitleFont={size:"15px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},e.smithchartSubtitleFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},e.dataLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},e.legendLabelFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"}}(gs||(gs={}));var ol=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nl=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},al=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(!0)],i.prototype,"visible",void 0),nl([t.Property("")],i.prototype,"text",void 0),nl([t.Property("")],i.prototype,"description",void 0),nl([t.Property("Center")],i.prototype,"textAlignment",void 0),nl([t.Complex(gs.legendLabelFont,Es)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),sl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(0)],i.prototype,"x",void 0),nl([t.Property(0)],i.prototype,"y",void 0),i}(t.ChildProperty),ll=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(1)],i.prototype,"width",void 0),nl([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),hl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(10)],i.prototype,"width",void 0),nl([t.Property(10)],i.prototype,"height",void 0),nl([t.Complex({},ll)],i.prototype,"border",void 0),i}(t.ChildProperty),cl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(1)],i.prototype,"width",void 0),nl([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),dl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ol(i,e),nl([t.Property(!1)],i.prototype,"visible",void 0),nl([t.Property("bottom")],i.prototype,"position",void 0),nl([t.Property("Center")],i.prototype,"alignment",void 0),nl([t.Property(null)],i.prototype,"width",void 0),nl([t.Property(null)],i.prototype,"height",void 0),nl([t.Property("circle")],i.prototype,"shape",void 0),nl([t.Property(null)],i.prototype,"rowCount",void 0),nl([t.Property(null)],i.prototype,"columnCount",void 0),nl([t.Property(8)],i.prototype,"itemPadding",void 0),nl([t.Property(5)],i.prototype,"shapePadding",void 0),nl([t.Property("")],i.prototype,"description",void 0),nl([t.Property(!0)],i.prototype,"toggleVisibility",void 0),nl([t.Complex({},al)],i.prototype,"title",void 0),nl([t.Complex({},sl)],i.prototype,"location",void 0),nl([t.Complex({},hl)],i.prototype,"itemStyle",void 0),nl([t.Complex({},cl)],i.prototype,"border",void 0),nl([t.Complex(gs.legendLabelFont,Es)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),pl=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ul=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},gl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return pl(i,e),ul([t.Property(1)],i.prototype,"width",void 0),ul([t.Property("")],i.prototype,"dashArray",void 0),ul([t.Property(!0)],i.prototype,"visible",void 0),ul([t.Property(null)],i.prototype,"color",void 0),ul([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),yl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return pl(i,e),ul([t.Property(1)],i.prototype,"width",void 0),ul([t.Property("")],i.prototype,"dashArray",void 0),ul([t.Property(!1)],i.prototype,"visible",void 0),ul([t.Property(null)],i.prototype,"color",void 0),ul([t.Property(8)],i.prototype,"count",void 0),i}(t.ChildProperty),ml=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return pl(i,e),ul([t.Property(!0)],i.prototype,"visible",void 0),ul([t.Property(1)],i.prototype,"width",void 0),ul([t.Property(null)],i.prototype,"color",void 0),ul([t.Property("")],i.prototype,"dashArray",void 0),i}(t.ChildProperty),vl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return pl(i,e),ul([t.Property(!0)],i.prototype,"visible",void 0),ul([t.Property("Outside")],i.prototype,"labelPosition",void 0),ul([t.Property("Hide")],i.prototype,"labelIntersectAction",void 0),ul([t.Complex({},gl)],i.prototype,"majorGridLines",void 0),ul([t.Complex({},yl)],i.prototype,"minorGridLines",void 0),ul([t.Complex({},ml)],i.prototype,"axisLine",void 0),ul([t.Complex(gs.axisLabelFont,Es)],i.prototype,"labelStyle",void 0),i}(t.ChildProperty),fl=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bl=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},xl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return fl(i,e),bl([t.Property(!0)],i.prototype,"visible",void 0),bl([t.Property("")],i.prototype,"text",void 0),bl([t.Property("")],i.prototype,"description",void 0),bl([t.Property("Far")],i.prototype,"textAlignment",void 0),bl([t.Property(!0)],i.prototype,"enableTrim",void 0),bl([t.Property(null)],i.prototype,"maximumWidth",void 0),bl([t.Complex(gs.smithchartSubtitleFont,Es)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),wl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return fl(i,e),bl([t.Property(!0)],i.prototype,"visible",void 0),bl([t.Property("")],i.prototype,"text",void 0),bl([t.Property("")],i.prototype,"description",void 0),bl([t.Property("Center")],i.prototype,"textAlignment",void 0),bl([t.Property(!0)],i.prototype,"enableTrim",void 0),bl([t.Property(null)],i.prototype,"maximumWidth",void 0),bl([t.Complex({},xl)],i.prototype,"subtitle",void 0),bl([t.Complex(gs.smithchartTitleFont,Es)],i.prototype,"font",void 0),bl([t.Complex(gs.smithchartTitleFont,Es)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Sl=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Cl=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Pl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(1)],i.prototype,"width",void 0),Cl([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),Ll=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(!1)],i.prototype,"visible",void 0),Cl([t.Property(null)],i.prototype,"fill",void 0),Cl([t.Property(.95)],i.prototype,"opacity",void 0),Cl([t.Property("")],i.prototype,"template",void 0),Cl([t.Complex({},Pl)],i.prototype,"border",void 0),i}(t.ChildProperty),Rl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(3)],i.prototype,"width",void 0),Cl([t.Property("white")],i.prototype,"color",void 0),i}(t.ChildProperty),Ml=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(.1)],i.prototype,"width",void 0),Cl([t.Property("white")],i.prototype,"color",void 0),i}(t.ChildProperty),Al=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(1)],i.prototype,"width",void 0),Cl([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),kl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(!1)],i.prototype,"visible",void 0),Cl([t.Property("")],i.prototype,"template",void 0),Cl([t.Property(null)],i.prototype,"fill",void 0),Cl([t.Property(1)],i.prototype,"opacity",void 0),Cl([t.Complex({},Ml)],i.prototype,"border",void 0),Cl([t.Complex({},Al)],i.prototype,"connectorLine",void 0),Cl([t.Complex(gs.dataLabelFont,Es)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Tl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property(!1)],i.prototype,"visible",void 0),Cl([t.Property("circle")],i.prototype,"shape",void 0),Cl([t.Property(6)],i.prototype,"width",void 0),Cl([t.Property(6)],i.prototype,"height",void 0),Cl([t.Property("")],i.prototype,"imageUrl",void 0),Cl([t.Property("")],i.prototype,"fill",void 0),Cl([t.Property(1)],i.prototype,"opacity",void 0),Cl([t.Complex({},Rl)],i.prototype,"border",void 0),Cl([t.Complex({},kl)],i.prototype,"dataLabel",void 0),i}(t.ChildProperty),_l=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Sl(i,e),Cl([t.Property("visible")],i.prototype,"visibility",void 0),Cl([t.Property([])],i.prototype,"points",void 0),Cl([t.Property("")],i.prototype,"resistance",void 0),Cl([t.Property("")],i.prototype,"reactance",void 0),Cl([t.Property("")],i.prototype,"tooltipMappingName",void 0),Cl([t.Property(null)],i.prototype,"dataSource",void 0),Cl([t.Property("")],i.prototype,"name",void 0),Cl([t.Property(null)],i.prototype,"fill",void 0),Cl([t.Property(!1)],i.prototype,"enableAnimation",void 0),Cl([t.Property("2000ms")],i.prototype,"animationDuration",void 0),Cl([t.Property(!1)],i.prototype,"enableSmartLabels",void 0),Cl([t.Property(1)],i.prototype,"width",void 0),Cl([t.Property(1)],i.prototype,"opacity",void 0),Cl([t.Complex({},Tl)],i.prototype,"marker",void 0),Cl([t.Complex({},Ll)],i.prototype,"tooltip",void 0),i}(t.ChildProperty),Ol=function(){function e(){}return e.prototype.calculateAreaBounds=function(e,t,i){var r=e.margin,o=e.border,n=this.getLegendSpace(e,i),a=n.leftLegendWidth+r.left+o.width,s=n.rightLegendWidth+r.left+r.right+2*o.width,l=e.availableSize.width-(a+s);return{x:a,y:r.top+2*e.elementSpacing+n.modelTitleHeight+n.modelsubTitleHeight+n.topLegendHeight+o.width,width:l,height:e.availableSize.height-(n.modelTitleHeight+2*e.elementSpacing+n.modelsubTitleHeight+r.top+n.topLegendHeight+n.bottomLegendHeight)}},e.prototype.getLegendSpace=function(e,t){var i,r=e.title,o=e.legendSettings,n=o.position.toLowerCase(),a=0,s=0,l=e.font,h=0,c=o.border.width,d=0,p=0,u=0,g=0,y=0;return o.visible&&(i=t.width+5+e.elementSpacing+2*c,d="left"===n?i:0,p="right"===n?i:0,y=o.title.visible?ft(o.title.text,l).height:0,u="top"===n?e.elementSpacing+t.height+y:0,g="bottom"===n?e.elementSpacing+t.height+y:0),a=ft(r.subtitle.text,l).height,""!==r.text&&r.visible,h=0,s=""!==r.subtitle.text&&r.subtitle.visible?a:0,{leftLegendWidth:d,rightLegendWidth:p,topLegendHeight:u,bottomLegendHeight:g,modelTitleHeight:h,modelsubTitleHeight:s}},e}(),El=function(){function e(){this.radialLabels=[-50,-20,-10,-5,-4,-3,-2,-1.5,-1,-.8,-.6,-.4,-.2,0,.2,.4,.6,.8,1,1.5,2,3,4,5,10,20,50],this.radialLabelCollections=[],this.horizontalLabelCollections=[],this.labelCollections=[],this.direction=new Zs}return e.prototype.renderArea=function(e,t){this.calculateChartArea(e,t),this.calculateCircleMargin(e,t),this.calculateXAxisRange(e),this.calculateRAxisRange(e),this.measureHorizontalAxis(e),this.measureRadialAxis(e),e.horizontalAxis.visible&&this.updateHAxis(e),e.radialAxis.visible&&this.updateRAxis(e),e.horizontalAxis.visible&&this.drawHAxisLabels(e),e.radialAxis.visible&&this.drawRAxisLabels(e)},e.prototype.updateHAxis=function(e){var t=e.horizontalAxis.majorGridLines,i=e.horizontalAxis.minorGridLines,r=e.horizontalAxis.axisLine;t.visible&&this.updateHMajorGridLines(e),i.visible&&this.updateHMinorGridLines(e),r.visible&&this.updateHAxisLine(e)},e.prototype.updateRAxis=function(e){var t=e.radialAxis.majorGridLines,i=e.radialAxis.minorGridLines,r=e.radialAxis.axisLine;t.visible&&this.updateRMajorGridLines(e),i.visible&&this.updateRMinorGridLines(e),r.visible&&this.updateRAxisLine(e)},e.prototype.measureHorizontalAxis=function(e){var t=e.horizontalAxis.minorGridLines;this.measureHMajorGridLines(e),t.visible&&this.measureHMinorGridLines(e)},e.prototype.measureRadialAxis=function(e){var t=e.radialAxis.minorGridLines;this.measureRMajorGridLines(e),t.visible&&this.measureRMinorGridLines(e)},e.prototype.calculateChartArea=function(e,t){var i=e.availableSize.width,r=e.availableSize.height;i=t.width,r=t.height;var o=Math.min(i,r),n=Math.min(i,r),a=t.x+(t.width/2-o/2),s=t.y+((r-n)/2>0?(r-n)/2:0);e.chartArea={x:a,y:s,width:o,height:n}},e.prototype.calculateCircleMargin=function(e,t){var i=0,r=e.chartArea.width,o=e.radius;i=this.maximumLabelLength(e);var n="Outside"===e.radialAxis.labelPosition?i+10:10,a=(r-2*n>0?r-2*n:0)/2,s=o>1?1:o<.1?.1:o;this.areaRadius=a*s,this.circleLeftX=e.chartArea.x+n+a*(1-s),this.circleTopY=e.chartArea.y+n+a*(1-s),this.circleCenterX=this.circleLeftX+this.areaRadius,this.circleCenterY=t.y+t.height/2},e.prototype.maximumLabelLength=function(e){for(var t,i=0,r=e.horizontalAxis.labelStyle,o=0;o<this.radialLabels.length;o++)i<(t=ft(this.radialLabels[o].toString(),r)).width&&(i=t.width);return i},e.prototype.calculateAxisLabels=function(){for(var e=0,t=0,i=[],r=2*this.areaRadius,o=0;o<2;o+=.1){var n=!1,a=!1,s=r*(1/((o=Math.round(10*o)/10)+1))/2*2;0!==e&&1!==o?(o<1&&(n=this.isOverlap(1,r,s,30)),o>1&&(a=this.isOverlap(2,r,s,30)),n||a||e-s>=30&&(i[t]=o,t++,e=s)):(e=s,i[t]=o,t++)}for(var l=[2,3,4,5,10,20,50],h=0;h<l.length;h++)i[t]=l[h],t++;return i},e.prototype.isOverlap=function(e,t,i,r){return i-t*(1/(e+1))/2*2<r},e.prototype.calculateXAxisRange=function(e){for(var t,i,r,o=2*this.areaRadius,n=this.calculateAxisLabels(),a=this.circleCenterY,s=this.circleLeftX,l=this.circleLeftX,h=0;h<n.length;h++)i=o*(1/((t=n[h])+1))/2,"Impedance"===e.renderType&&(l=s+o-2*i),r=l+i,this.horizontalLabelCollections.push({centerX:r,centerY:a,radius:i,value:t,region:null})},e.prototype.calculateRAxisRange=function(e){var t,i,r,o=2*this.areaRadius,n=new Ys;"Impedance"===e.renderType?(n.x=this.circleLeftX+o,n.y=this.circleTopY+this.areaRadius):(n.x=this.circleLeftX,n.y=this.circleTopY+this.areaRadius);for(var a=0;a<this.radialLabels.length;a++)r=this.radialLabels[a],i=Math.abs(1/r*o/2),t="Impedance"===e.renderType?r>0?n.y-i:n.y+i:r<0?n.y-i:n.y+i,this.radialLabelCollections.push({centerX:n.x,centerY:t,radius:i,value:r})},e.prototype.measureHMajorGridLines=function(e){var t,i,r,o,n,a=[];this.majorHGridArcPoints=[];for(var s=0;s<this.horizontalLabelCollections.length;s++){var l=new Vs;l=this.horizontalLabelCollections[s],a=this.calculateHMajorArcStartEndPoints(l.value),"Impedance"===e.renderType?(r=a[0],o=a[1]):(r=a[1],o=a[0]),n={width:l.radius,height:l.radius},0!==l.value&&50!==l.value?(t=this.intersectingCirclePoints(r[0].centerX,r[0].centerY,r[0].radius,l.centerX,l.centerY,l.radius,e.renderType),i=this.intersectingCirclePoints(o[0].centerX,o[0].centerY,o[0].radius,l.centerX,l.centerY,l.radius,e.renderType),this.majorHGridArcPoints.push({startPoint:t,endPoint:i,rotationAngle:2*Math.PI,sweepDirection:"Impedance"===e.renderType?this.direction.counterclockwise:this.direction.clockwise,isLargeArc:!0,size:n})):(t={x:l.centerX+l.radius,y:l.centerY},i={x:l.centerX+l.radius,y:l.centerY-.05},this.majorHGridArcPoints.push({startPoint:t,endPoint:i,rotationAngle:2*Math.PI,sweepDirection:this.direction.clockwise,isLargeArc:!0,size:n}))}},e.prototype.measureRMajorGridLines=function(e){var t,i,r,o,n,a,s,l,h,c=[];this.majorRGridArcPoints=[],this.labelCollections=[];for(var d=gt(),p=0;p<this.radialLabelCollections.length;p++)(t=this.radialLabelCollections[p]).radius<=d||(i=t.value,r=(c=this.calculateMajorArcStartEndPoints(t,Math.abs(i),e))[0],o=c[1],n=this.circleXYRadianValue(this.circleCenterX,this.circleCenterY,o.x,o.y)*(180/Math.PI),0!==i?(a={x:r.x,y:r.y},s={x:o.x,y:o.y},l={width:t.radius,height:t.radius},h=i>0?this.direction.clockwise:this.direction.counterclockwise,this.majorRGridArcPoints.push({startPoint:a,endPoint:s,size:l,rotationAngle:2*Math.PI,isLargeArc:!1,sweepDirection:h}),this.labelCollections.push({centerX:o.x,centerY:o.y,angle:n,value:i,radius:this.areaRadius,region:null})):(a={x:this.circleLeftX,y:this.circleCenterY},s={x:this.circleCenterX+this.areaRadius,y:this.circleCenterY},this.majorRGridArcPoints.push({startPoint:a,endPoint:s,size:null,rotationAngle:null,isLargeArc:null,sweepDirection:null}),this.labelCollections.push({centerX:"Impedance"===e.renderType?this.circleCenterX-this.areaRadius:this.circleCenterX+this.areaRadius,centerY:this.circleCenterY,angle:"Impedance"===e.renderType?180:360,value:i,radius:this.areaRadius,region:null})))},e.prototype.circleXYRadianValue=function(e,t,i,r){var o;return o=Math.atan2(r-t,i-e),o=o<0?o+360*Math.PI/180:o},e.prototype.calculateMajorArcStartEndPoints=function(e,t,i){var r=[],o=[],n=this.circleCenterX,a=this.circleCenterY;return t>=10?r[0]="Impedance"===i.renderType?{x:n+this.areaRadius,y:a}:{x:n-this.areaRadius,y:a}:o=t>=3?this.horizontalLabelCollections.filter(function(e){return 10===e.value}):t>=1?this.horizontalLabelCollections.filter(function(e){return 5===e.value}):this.horizontalLabelCollections.filter(function(e){return 3===e.value}),o.length>0&&(r[0]=this.intersectingCirclePoints(e.centerX,e.centerY,e.radius,o[0].centerX,o[0].centerY,o[0].radius,i.renderType)),r[1]=this.intersectingCirclePoints(e.centerX,e.centerY,e.radius,n,a,this.areaRadius,i.renderType),r},e.prototype.calculateHMajorArcStartEndPoints=function(e){var t,i,r=[];return e<=.3?(t=2,i=-2):e<=1?(t=3,i=-3):e<=2?(t=5,i=-5):e<=5?(t=10,i=-10):(t=50,i=-50),r[0]=this.radialLabelCollections.filter(function(e){return e.value===t}),r[1]=this.radialLabelCollections.filter(function(e){return e.value===i}),r},e.prototype.calculateMinorArcStartEndPoints=function(e){var t,i,r=[];return e<=.1?(t=1,i=-1):e<=.2?(t=.8,i=-.8):e<=.3?(t=.4,i=-.4):e<=.6?(t=1,i=-1):e<=1?(t=1.5,i=-1.5):e<=1.5?(t=2,i=-2):e<=2?(t=1,i=-1):e<=5?(t=3,i=-3):(t=10,i=-10),r[0]=this.radialLabelCollections.filter(function(e){return e.value===t}),r[1]=this.radialLabelCollections.filter(function(e){return e.value===i}),r},e.prototype.intersectingCirclePoints=function(e,t,i,r,o,n,a){var s={x:0,y:0},l=e-r,h=t-o,c=Math.sqrt(l*l+h*h),d=c*c,p=(i*i-n*n)/(2*d),u=i*i-n*n,g=Math.sqrt(2*(i*i+n*n)/d-u*u/(d*d)-1),y=(e+r)/2+p*(r-e),m=g*(o-t)/2,v=y+m,f=y-m,b=(t+o)/2+p*(o-t),x=g*(e-r)/2,w=b+x,S=b-x;return"Impedance"===a?f<v?(s.x=f,s.y=S):(s.x=v,s.y=w):v>f?(s.x=v,s.y=w):(s.x=f,s.y=S),{x:s.x,y:s.y}},e.prototype.updateHMajorGridLines=function(e){var t=e.horizontalAxis.majorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_horizontalAxisMajorGridLines"}),r=this.calculateGridLinesPath(this.majorHGridArcPoints),o=new el(e.element.id+"_horizontalAxisMajorGridLines","none",t.width,t.color?t.color:e.themeStyle.majorGridLine,t.opacity,t.dashArray,r),n=e.renderer.drawPath(o);i.appendChild(n),e.svgObject.appendChild(i)},e.prototype.updateRMajorGridLines=function(e){var t=e.radialAxis.majorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_radialAxisMajorGridLines"}),r=this.calculateGridLinesPath(this.majorRGridArcPoints),o=new el(e.element.id+"_radialAxisMajorGridLines","none",t.width,t.color?t.color:e.themeStyle.majorGridLine,t.opacity,t.dashArray,r),n=e.renderer.drawPath(o);i.appendChild(n),e.svgObject.appendChild(i)},e.prototype.updateHAxisLine=function(e){var t=this.areaRadius,i=e.horizontalAxis.axisLine,r=e.renderer.createGroup({id:e.element.id+"_svg_hAxisLine"}),o={x:this.circleCenterX+t,y:this.circleCenterY},n={x:this.circleCenterX+t,y:this.circleCenterY-.05},a={width:t,height:t},s=this.direction.clockwise,l=2*Math.PI,h="M"+o.x+" "+o.y+" A "+a.width+" "+a.height+" "+l+" 1 "+s+" "+n.x+" "+n.y,c=new el(e.element.id+"_horizontalAxisLine","none",i.width,i.color?i.color:e.themeStyle.axisLine,1,i.dashArray,h),d=e.renderer.drawPath(c);r.appendChild(d),e.svgObject.appendChild(r)},e.prototype.updateRAxisLine=function(e){var t=this.areaRadius,i=e.radialAxis.axisLine,r={x:this.circleCenterX-t,y:this.circleCenterY},o={x:this.circleCenterX+t,y:this.circleCenterY},n={width:0,height:0},a=this.direction.counterclockwise,s="M "+r.x+" "+r.y+" A "+n.width+" "+n.height+" 0 0 "+a+" "+o.x+" "+o.y,l=new el(e.element.id+"_radialAxisLine","none",i.width,i.color?i.color:e.themeStyle.axisLine,1,i.dashArray,s),h=e.renderer.createGroup({id:e.element.id+"_svg_rAxisLine"}),c=e.renderer.drawPath(l);h.appendChild(c),e.svgObject.appendChild(h)},e.prototype.drawHAxisLabels=function(e){var t=e.horizontalAxis;e.radialAxis.labelStyle.fontFamily=e.themeStyle.fontFamily||e.radialAxis.labelStyle.fontFamily;for(var i,r,o,n,a,s,l,h,c,d,p,u,g,y=e.horizontalAxis.labelStyle,m=e.renderer.createGroup({id:e.element.id+"_HAxisLabels"}),v=this,f=0;f<this.horizontalLabelCollections.length;f++)!function(f){if(i=v.horizontalLabelCollections[f],r=v.horizontalLabelCollections[f].value.toString(),0!==i.value){if(o="Impedance"===e.renderType?i.centerX-i.radius:i.centerX+i.radius,n=i.centerY,a=ft(r,y),o="Impedance"===e.renderType?o-a.width:o,"Outside"===t.labelPosition?n-=a.height/4:n+=a.height,v.horizontalLabelCollections[f].region=v.calculateRegion(r,a,o,n),"Hide"===t.labelIntersectAction){s=v.horizontalLabelCollections[f],l=s.region.bounds,h=l.width,c=l.x;for(var b=1;b<f;b++)d=v.horizontalLabelCollections[b],p=d.region.bounds,u=p.width,g=p.x,"Impedance"===e.renderType&&g+u>c&&(r=""),"Admittance"===e.renderType&&g<c+h&&(r="")}var x={text:r.toString(),x:o,y:n,name:"axisLabelRender",cancel:!1},w=function(t){if(!t.cancel){var i=new rl(e.element.id+"_HLabel_"+f,x.x,x.y,"none",x.text),r=y.color?y.color:e.themeStyle.axisLabel;y.fontFamily=y.fontFamily||e.themeStyle.labelFontFamily;var o=Ct(i,y,r,m);m.appendChild(o)}};w.bind(v),e.trigger("axisLabelRender",x,w)}}(f);e.svgObject.appendChild(m)},e.prototype.drawRAxisLabels=function(e){e.radialAxis.labelStyle.fontFamily=e.themeStyle.fontFamily||e.radialAxis.labelStyle.fontFamily;for(var t,i,r,o,n,a,s,l,h,c,d,p,u,g,y,m,v,f=e.radialAxis.labelStyle,b=new js,x=e.radialAxis,w=e.renderer.createGroup({id:e.element.id+"_RAxisLabels"}),S=this,C=0;C<this.labelCollections.length;C++)!function(C){if(b=S.labelCollections[C],t=b.value.toString(),i=ft(t,f),r=Math.round(100*b.angle)/100,"Outside"===x.labelPosition?(o=S.circlePointPosition(S.circleCenterX,S.circleCenterY,b.angle,S.areaRadius+2),n=S.setLabelsOutsidePosition(r,o.x,o.y,i)):(o=S.circlePointPosition(S.circleCenterX,S.circleCenterY,b.angle,S.areaRadius-2),n=S.setLabelsInsidePosition(r,o.x,o.y,i)),S.labelCollections[C].region=S.calculateRegion(t,i,n.x,n.y),"Hide"===x.labelIntersectAction){c=S.labelCollections[C],d=c.region.bounds,l=d.width,h=d.height,a=d.x,s=d.y;for(var P=0;P<C;P++)m=S.labelCollections[P],v=m.region.bounds,g=v.width,y=v.height,p=v.x,u=v.y,p<=a+l&&a<=p+g&&u<=s+h&&s<=u+y&&(t=" ")}var L={text:t.toString(),x:n.x,y:n.y,name:"axisLabelRender",cancel:!1},R=function(t){if(!t.cancel){var i=new rl(e.element.id+"_RLabel_"+C,L.x,L.y,"none",L.text),r=f.color?f.color:e.themeStyle.axisLabel;f.fontFamily=e.themeStyle.labelFontFamily?e.themeStyle.labelFontFamily:f.fontFamily;var o=Ct(i,f,r,w);w.appendChild(o)}};R.bind(S),e.trigger("axisLabelRender",L,R)}(C);e.svgObject.appendChild(w)},e.prototype.calculateRegion=function(e,t,i,r){new Ns;return{bounds:{x:i,y:r,width:t.width,height:t.height},labelText:e}},e.prototype.updateHMinorGridLines=function(e){var t=e.horizontalAxis.minorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_horizontalAxisMinorGridLines"}),r=this.calculateGridLinesPath(this.minorHGridArcPoints),o=new el(e.element.id+"_horizontalAxisMinorGridLines","none",t.width,t.color?t.color:e.themeStyle.minorGridLine,t.opacity,t.dashArray,r),n=e.renderer.drawPath(o);i.appendChild(n),e.svgObject.appendChild(i)},e.prototype.updateRMinorGridLines=function(e){var t=e.radialAxis.minorGridLines,i=e.renderer.createGroup({id:e.element.id+"_svg_radialAxisMinorGridLines"}),r=this.calculateGridLinesPath(this.minorGridArcPoints),o=new el(e.element.id+"_radialAxisMinorGridLines","none",t.width,t.color?t.color:e.themeStyle.minorGridLine,t.opacity,t.dashArray,r),n=e.renderer.drawPath(o);i.appendChild(n),e.svgObject.appendChild(i)},e.prototype.calculateGridLinesPath=function(e){for(var t,i,r,o,n=new Js,a="",s=0;s<e.length;s++)t=(n=e[s]).startPoint.x,i=n.startPoint.y,r=n.endPoint.x,o=n.endPoint.y,a=a+"M "+t+" "+i+" A "+(n.size?n.size.width:0)+" "+(n.size?n.size.height:0)+" "+(n.rotationAngle?n.rotationAngle:0)+" "+(n.isLargeArc?1:0)+" "+(n.sweepDirection?n.sweepDirection:0)+" "+r+" "+o+" ";return a.toString()},e.prototype.measureHMinorGridLines=function(e){var t,i,r,o,n,a,s,l,h,c,d,p,u,g=[],y=e.horizontalAxis.minorGridLines.count;this.minorHGridArcPoints=[];for(var m=2*this.areaRadius,v=0;v<this.horizontalLabelCollections.length-3;v++){l=this.horizontalLabelCollections[v],h=this.horizontalLabelCollections[v+1],p=(c=2*(l.radius-h.radius))/(d=Math.floor(y/100*c));for(var f=0;f<d;f++)u=h.radius+f*p/2,s=("Impedance"===e.renderType?this.circleLeftX+m-2*u:this.circleLeftX)+u,r=h.value>5,g=this.calculateMinorArcStartEndPoints(h.value),"Impedance"===e.renderType?(t=g[0],i=g[1]):(t=g[1],i=g[0]),o=this.intersectingCirclePoints(t[0].centerX,t[0].centerY,t[0].radius,s,l.centerY,u,e.renderType),n=this.intersectingCirclePoints(i[0].centerX,i[0].centerY,i[0].radius,s,l.centerY,u,e.renderType),a={width:u,height:u},this.minorHGridArcPoints.push({startPoint:o,endPoint:n,rotationAngle:2*Math.PI,sweepDirection:"Impedance"===e.renderType?this.direction.counterclockwise:this.direction.clockwise,isLargeArc:r,size:a})}},e.prototype.measureRMinorGridLines=function(e){var t,i,r,o,n,a,s,l,h,c,d,p=e.radialAxis.minorGridLines.count,u=Math.PI*(2*this.areaRadius),g=t="Impedance"===e.renderType?this.circleCenterX+this.areaRadius:this.circleCenterX-this.areaRadius,y=this.circleCenterY;this.minorGridArcPoints=[];for(var m={x:g,y:y},v=2;v<this.labelCollections.length-3;v++){n=this.labelCollections[v],a=this.labelCollections[v+1],"Impedance"===e.renderType?(i=360===a.angle?0:a.angle,r=Math.abs(i-n.angle)):(i=360===n.angle?0:n.angle,r=Math.abs(i-a.angle)),l=u/360*r,c=r/(h=Math.floor(p/100*l)),d=a.value>0?a.value:n.value,o=this.minorGridLineArcIntersectCircle(Math.abs(d));for(var f=1;f<h;f++){var b=c*f+(360===n.angle?i:n.angle),x=this.circlePointPosition(this.circleCenterX,this.circleCenterY,b,this.areaRadius),w=this.arcRadius(m,x,b),S=b>180?this.circleCenterY-w:this.circleCenterY+w,C=this.intersectingCirclePoints(t,S,w,o[0].centerX,o[0].centerY,o[0].radius,e.renderType),P={x:C.x,y:C.y},L={x:x.x,y:x.y};s={width:w,height:w};var R=n.value>=0?this.direction.clockwise:this.direction.counterclockwise;this.minorGridArcPoints.push({startPoint:P,endPoint:L,rotationAngle:2*Math.PI,sweepDirection:R,isLargeArc:!1,size:s})}}},e.prototype.minorGridLineArcIntersectCircle=function(e){var t;return t=e>=3?20:e>=1.5?10:e>=.6?3:2,this.horizontalLabelCollections.filter(function(e){return e.value===t})},e.prototype.circlePointPosition=function(e,t,i,r){var o=i*(Math.PI/180);return{x:e+r*Math.cos(o),y:t+r*Math.sin(o)}},e.prototype.setLabelsInsidePosition=function(e,t,i,r){var o=t,n=i;return 0===e||360===e?(o-=r.width,n-=r.height/2):90===e?(o-=r.width,n+=r.height/8):180===e?n+=r.height:270===e?n+=r.height/2:e>0&&e<=20?o-=r.width:e>20&&e<=60?(o-=r.width+r.width/2,n+=r.height/2):e>60&&e<90?(o-=r.width+r.width/4,n+=r.height/4):e>90&&e<=135?(o-=r.width/2,n+=r.height/16):e>135&&e<=150?(o+=r.width/2,n+=r.height/2):e>150&&e<180?(o+=r.width/2,n+=r.height):e>180&&e<=210?(o+=r.width/6,n+=r.height/6):e>210&&e<240?n+=r.height/4:e>225&&e<270?n+=r.height/3:e>270&&e<=300?(o-=r.width+r.width/4,n+=r.height/4):e>300&&e<=330?(o-=r.width+r.width/3,n+=r.height/4):e>330&&e<=340?(o-=r.width+r.width/2,n+=r.height/4):e>340&&(o-=r.width,n+=r.height/8),{x:o,y:n}},e.prototype.setLabelsOutsidePosition=function(e,t,i,r){var o=t,n=i;return 90===e?(o-=r.width/2,n+=r.height):180===e?(o-=r.width+5,n-=r.height/4):270===e?(o-=r.width/2,n-=r.height/4):360===e?(o+=5,n-=r.height/2):e>0&&e<=30?(o+=r.width/4,n+=r.height/8):e>30&&e<=60?(o+=r.width/2,n+=r.height/4):e>60&&e<=90?(o-=r.width/2,n+=r.height):e>90&&e<=135?(o-=r.width,n+=r.height):e>135&&e<=180?(o-=r.width+r.width/4,n+=r.height/4):e>180&&e<=210?(o-=r.width+r.width/4,n-=r.height/4):e>210&&e<=270?(o-=r.width,n-=r.height/4):e>270&&e<=340?n-=r.height/4:e>340&&(n+=r.height/4,o+=r.width/6),{x:o,y:n}},e.prototype.arcRadius=function(e,t,i){var r=i>180?90*Math.PI/180:270*Math.PI/180,o=(t.x-e.x)/2,n=(t.y-e.y)/2,a=(n-o*((Math.cos(r)*n-Math.sin(r)*o)/(Math.cos(r)*o+Math.sin(r)*n)))/Math.sin(r),s=e.y+Math.sin(r)*a;return Math.abs(e.y-s)},e}(),Il=function(){function e(){}return e.prototype.drawMarker=function(e,t,i,r){if(e.series[t].marker.visible){var o=e.series[t].marker,n=e.series[t].points.length-1,a=o.width,s=o.height,l=o.shape,h=e.renderer.createGroup({id:e.element.id+"_svg_series"+t+"_Marker"});i.appendChild(h);for(var c=o.border.width,d=o.border.color,p=o.opacity,u=o.fill?o.fill:e.series[t].fill||e.seriesColors[t%e.seriesColors.length],g=0;g<n+1;g++){var y=r[g].point,m=g,v=new Ws(e.element.id+"_Series"+t+"_Points"+m+"_Marker"+m,u,d,c,p);h.appendChild(this.drawSymbol(l,o.imageUrl,y,new $s(a,s),v,e))}}},e.prototype.drawSymbol=function(e,t,i,r,o,n){var a,s,l,h,c=e.toLowerCase(),d={color:o.borderColor,width:o.borderWidth},p=o.opacity,u=i.x,g=i.y,y=Math.sqrt(r.height*r.height+r.width*r.width)/2;switch(c){case"circle":s=new il(o.id,o.fill,d,p,i.x,i.y,y,null),a=n.renderer.drawCircle(s);break;case"rectangle":h="M "+(u+-r.width/2)+" "+(g+-r.height/2)+" L "+(u+r.width/2)+" "+(g+-r.height/2)+" L "+(u+r.width/2)+" "+(g+r.height/2)+" L "+(u+-r.width/2)+" "+(g+r.height/2)+" L "+(u+-r.width/2)+" "+(g+-r.height/2)+"z",l=new el(o.id,o.fill,d.width,d.color,p,"",h),a=n.renderer.drawPath(l);break;case"triangle":h="M "+(u+-r.width/2)+" "+(g+r.height/2)+" L "+u+" "+(g+-r.height/2)+" L "+(u+r.width/2)+" "+(g+r.height/2)+" L "+(u+-r.width/2)+" "+(g+r.height/2)+"z",l=new el(o.id,o.fill,d.width,d.color,p,"",h),a=n.renderer.drawPath(l);break;case"diamond":h="M "+(u+-r.width/2)+" "+g+" L "+u+" "+(g+-r.height/2)+" L "+(u+r.width/2)+" "+g+" L "+u+" "+(g+r.height/2)+" L "+(u+-r.width/2)+" "+g+"z",l=new el(o.id,o.fill,d.width,d.color,p,"",h),a=n.renderer.drawPath(l);break;case"pentagon":for(var m=0;m<=5;m++){var v=y*Math.cos(Math.PI/180*(72*m)),f=y*Math.sin(Math.PI/180*(72*m));h=0===m?"M "+(u+v)+" "+(g+f)+" ":h.concat("L "+(u+v)+" "+(g+f)+" ")}h=h.concat("Z"),l=new el(o.id,o.fill,d.width,d.color,p,"",h),a=n.renderer.drawPath(l)}return a},e}(),zl=function(){function e(){this.textOptions=[],this.labelOptions=[],this.allPoints=[]}return e.prototype.drawDataLabel=function(e,t,i,r,o){this.textOptions=[],this.allPoints=[];for(var n,a,s,l,h,c=e.margin,d=e.series[t].marker,p=d.dataLabel,u=p.textStyle,g=r.length,y=0;y<g;y++){h=ft(l=e.series[t].points[y].reactance.toString(),u);var m=(a=r[y].point).x-h.width/2,v=a.y-(h.height+d.height+c.top),f=h.width+c.left/2+c.right/2,b=h.height+c.top/2+c.bottom/2;n=y,s=new Us,s={textX:m+c.left/2,textY:v+b/2+c.top/2,x:m,y:v},this.textOptions[y]={id:e.element.id+"_Series"+t+"_Points"+n+"_dataLabel_displayText"+y,x:s.textX,y:s.textY,fill:"black",text:l,font:u,xPosition:m,yPosition:v,width:f,height:b,location:a,labelOptions:s,visible:!0,connectorFlag:null}}var x=new Qs;x.textOptions=this.textOptions,this.labelOptions.push(x),this.drawDatalabelSymbol(e,t,p,i,o,r)},e.prototype.calculateSmartLabels=function(e,t){for(var i=e.textOptions.length,r=0;r<i;r++)this.allPoints[this.allPoints.length]=e.textOptions[r],this.connectorFlag=!1,this.compareDataLabels(r,e,0,t),this.labelOptions[t].textOptions[r]=e.textOptions[r],this.labelOptions[t].textOptions[r].connectorFlag=this.connectorFlag},e.prototype.compareDataLabels=function(e,t,i,r){for(var o,n,a=this.allPoints.length,s=0;s<a;s++)if(n=this.allPoints[s],o=this.allPoints[a-1],this.isCollide(n,o))switch(this.connectorFlag=!0,i){case 0:this.resetValues(o),this.prevLabel=n,o.xPosition=this.prevLabel.xPosition+(this.prevLabel.width/2+o.width/2+10),o.x=o.xPosition+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 1:this.resetValues(o),o.xPosition=this.prevLabel.xPosition+this.prevLabel.width/2+o.width/2+10,o.x=o.xPosition+5,o.yPosition=o.location.y+o.height/2+5,o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 2:this.resetValues(o),o.yPosition=o.location.y+o.height/2+5,o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 3:this.resetValues(o),o.xPosition=this.prevLabel.xPosition-this.prevLabel.width/2-o.width/2-10,o.x=o.xPosition+5,o.yPosition=o.height/2+o.location.y+5,o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 4:this.resetValues(o),o.xPosition=this.prevLabel.xPosition-this.prevLabel.width/2-o.width/2-10,o.x=o.xPosition+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 5:this.resetValues(o),o.xPosition=this.prevLabel.xPosition-this.prevLabel.width/2-o.width/2-10,o.x=o.xPosition+5,o.yPosition=this.prevLabel.yPosition-o.height-10,o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 6:this.resetValues(o),o.yPosition=this.prevLabel.yPosition-(o.height+10),o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 7:this.resetValues(o),o.xPosition=this.prevLabel.xPosition+this.prevLabel.width/2+o.width/2+10,o.x=o.xPosition+5,o.yPosition=this.prevLabel.yPosition-o.height-10,o.y=o.yPosition+o.height/2+5,i+=1,this.compareDataLabels(e,t,i,r);break;case 8:i=0,this.compareDataLabels(e,t,i,r)}},e.prototype.isCollide=function(e,t){var i=!1;return e!==t&&(i=!(e.y+e.height<t.y||e.y>t.y+t.height||e.x+e.width/2<t.x-t.width/2||e.x-e.width/2>t.x+t.width/2)),i},e.prototype.resetValues=function(e){e.xPosition=e.labelOptions.x,e.yPosition=e.labelOptions.y,e.x=e.labelOptions.textX,e.y=e.labelOptions.textY},e.prototype.drawConnectorLines=function(e,t,i,r,o){var n,a=r.location;n=a.y>r.y?r.y:r.y-r.height/2;var s="M "+a.x+" "+a.y+" L "+r.x+" "+n,l=e.series[t].marker.dataLabel.connectorLine,h=l.color?l.color:e.series[t].fill||e.seriesColors[t%e.seriesColors.length],c=new el(e.element.id+"_dataLabelConnectorLine_series"+t+"_point"+i,"none",l.width,h,1,"none",s),d=e.renderer.drawPath(c);o.appendChild(d)},e.prototype.drawDatalabelSymbol=function(e,i,r,o,n,a){for(var s=0;s<e.series[i].points.length;s++)if(r.template){var l=t.createElement("div",{id:e.element.id+"_seriesIndex_"+i+"_Label_Template_Group",className:"template",styles:"position: absolute;"});document.getElementById(e.element.id+"_Secondary_Element").appendChild(l);var h=r.template+"_seriesIndex"+i+"_pointIndex"+s+e.element.id,c={point:e.series[i].points[s].reactance},d=ut(pt(r.template)(e),h,c);l.appendChild(d),d.style.left=a[s].point.x-d.offsetWidth/2+"px",d.style.top=a[s].point.y-d.offsetHeight-e.series[i].marker.height/2+"px";var p="_seriesIndex"+i+"_pointIndex"+s+e.element.id;t.updateBlazorTemplate(p+"Template","Template");var u=parseInt(d.style.left,10),g=parseInt(d.style.top,10),y=d.offsetWidth,m=d.offsetHeight,v=a[s].point,f={textX:u,textY:g,x:u,y:g};this.labelOptions[i].textOptions[s]={id:h,x:u,y:g,fill:"black",text:"",font:r.textStyle,xPosition:u,yPosition:g,width:y,height:m,location:v,labelOptions:f,visible:!0,connectorFlag:null}}},e}(),Dl=function(){function e(){this.xValues=[],this.yValues=[],this.pointsRegion=[],this.lineSegments=[],this.location=[],this.dataLabel=new zl}return e.prototype.processData=function(e){var t=e.dataSource,i=e.resistance,r=e.reactance,o=e.tooltipMappingName;e.points=[];for(var n=0;n<t.length;n++)e.points.push({resistance:t[n][i],reactance:t[n][r],tooltip:t[n][o]})},e.prototype.draw=function(e,t,i){for(var r,o,n,a,s=e.renderer.createGroup({id:e.element.id+"_svg_seriesCollections"}),l=e.series,h=l.length,c=t.areaRadius,d=0;d<h;d++){var p=d;l[d].dataSource&&l[d].resistance&&l[d].reactance&&this.processData(l[d]),this.pointsRegion[d]=[],this.location[d]=[];for(M=0;M<l[d].points.length;M++)this.xValues[M]=l[d].points[M].resistance,this.yValues[M]=l[d].points[M].reactance;for(var u=t.circleCenterX,g=t.circleCenterY,y=2*t.areaRadius,m=g,v={x:u+("Impedance"===e.renderType?c:-c),y:g}.x,f=0;f<l[d].points.length;f++){var b=this.xValues[f],x=y*(1/(b+1))/2,w=this.yValues[f],S=Math.abs(1/w*y/2);"Impedance"===e.renderType?(o=w>0?g-S:g+S,r=t.circleLeftX+y-x):(o=w<0?g-S:g+S,r=t.circleLeftX+x),n=t.intersectingCirclePoints(v,o,S,r,m,x,e.renderType);var C=gt();Math.abs(w)<C&&(n.x="Impedance"===e.renderType?r-x:r+x,n.y=g),this.pointsRegion[d][f]=new Xs,this.pointsRegion[d][f]={point:n,x:b,y:w},this.location[d][f]={x:n.x,y:n.y}}for(A=0;A<l[d].points.length-1;A++)a=A+1,this.lineSegments[A]=new Hs,this.lineSegments[A]={x1:this.xValues[A],y1:this.yValues[A],x2:this.xValues[a],y2:this.yValues[a]};e.svgObject.appendChild(s),this.drawSeries(e,p,s,i)}for(M=0;M<e.series.length;M++)if(e.series[M].enableSmartLabels&&e.series[M].marker.dataLabel.visible){var P=e.renderer.createGroup({id:e.element.id+"_svg_series"+M+"_Datalabel_connectorLines"});(k=document.getElementById(e.element.id+"_svg_seriesCollection"+M))&&k.appendChild(P),this.dataLabel.calculateSmartLabels(this.dataLabel.labelOptions[M],M);for(f=0;f<e.series[M].points.length;f++){var L=this.dataLabel.labelOptions[M].textOptions[f];(L.xPosition+L.width>e.chartArea.x+e.chartArea.width||L.xPosition<e.chartArea.x||L.yPosition<e.chartArea.y||L.yPosition+L.height>e.chartArea.y+e.chartArea.height)&&(this.dataLabel.labelOptions[M].textOptions[f].connectorFlag=!1,this.dataLabel.labelOptions[M].textOptions[f].visible=!1),L.connectorFlag&&this.dataLabel.drawConnectorLines(e,M,f,L,P)}}for(var R=this,M=0;M<e.series.length;M++)!function(t){var i=e.series[t].marker.dataLabel;if(e.series[t].marker.dataLabel.visible){var r=document.getElementById(e.element.id+"_svg_seriesCollection"+t),o=e.renderer.createGroup({id:e.element.id+"_svg_series"+t+"_Datalabel"});r&&r.appendChild(o);for(var n=0;n<e.series[t].points.length;n++)!function(r){var n=R.dataLabel.labelOptions[t].textOptions[r];if(!i.template&&n.visible){var a=new qs;a=R.dataLabel.labelOptions[t].textOptions[r];var s=i.textStyle,l=a.xPosition,h=a.yPosition,c=e.element.id+"_Series"+t+"_Points"+r+"_dataLabel_symbol"+r,d=i.fill?i.fill:e.series[t].fill||e.seriesColors[t%e.seriesColors.length],p=e.series[t].marker.dataLabel.border,u=new tl(c,d,p,a.opacity,new Ds(l,h,a.width,a.height)),g=e.renderer.drawRectangle(u);o.appendChild(g);var y={text:a.text,x:a.x,y:a.y,seriesIndex:t,pointIndex:r,name:"textRender",cancel:!1},m=function(t){if(!t.cancel){var i=new rl(a.id,t.x,t.y,"start",t.text),r=s.color?s.color:e.themeStyle.dataLabel,n=Ct(i,s,r,o);o.appendChild(n)}};m.bind(R),e.trigger("textRender",y,m)}else if(i.template){var v=document.getElementById(i.template+"_seriesIndex"+t+"_pointIndex"+r+e.element.id);v.style.left=R.dataLabel.labelOptions[t].textOptions[r].xPosition+"px",v.style.top=R.dataLabel.labelOptions[t].textOptions[r].yPosition+"px"}}(n)}}(M);for(var A=0;A<e.series.length;A++)if(e.series[A].enableAnimation&&e.animateSeries){e.series[A].marker.dataLabel.template&&this.animateDataLabelTemplate(A,e);var k=document.getElementById(e.element.id+"_svg_seriesCollection"+A);this.performAnimation(e,k,A)}},e.prototype.drawSeries=function(e,t,i,r){var o=this,n=e.renderer.createGroup({id:e.element.id+"_svg_seriesCollection"+t,"clip-path":"url(#"+e.element.id+"_ChartSeriesClipRect_"+t+")"});n.setAttribute("visibility",e.series[t].visibility),i.appendChild(n);for(var a,s,l="",h=(e.series[t].marker,e.series[t].points.length-1),c=0;c<h;c++){var d=this.pointsRegion[t][c].point,p=this.pointsRegion[t][c+1].point;l=l+"M "+d.x+" "+d.y+" L "+p.x+" "+p.y+" "}a=l.toString();var u=e.series[t].fill||e.seriesColors[t%e.seriesColors.length],g={text:e.series[t].name,fill:u,name:"seriesRender",cancel:!1},y=function(i){if(!i.cancel){var l=new el(e.element.id+"_series"+t+"_points","none",e.series[t].width,g.fill,e.series[t].opacity,"none",a);o.clipRectElement=e.renderer.drawClipPath(new tl(e.element.id+"_ChartSeriesClipRect_"+t,"transparent",{width:1,color:"Gray"},1,{x:r.x,y:r.y,width:e.availableSize.width,height:e.availableSize.height})),n.appendChild(o.clipRectElement);var h=e.renderer.createGroup({id:e.element.id+"_svg"+t});s=e.renderer.drawPath(l),h.appendChild(s),n.appendChild(h)}};y.bind(this),e.trigger("seriesRender",g,y),(new Il).drawMarker(e,t,n,this.pointsRegion[t]),this.dataLabel.drawDataLabel(e,t,n,this.pointsRegion[t],r)},e.prototype.animateDataLabelTemplate=function(e,t){for(var i=t.series[e].points.length,r=parseFloat(t.series[e].animationDuration),o=0;o<i;o++){var n=document.getElementById(t.series[e].marker.dataLabel.template+"_seriesIndex"+e+"_pointIndex"+o+t.element.id);n.style.visibility="hidden",mt(t,n,0,r,"FadeIn")}},e.prototype.performAnimation=function(e,i,r){var o,n=new t.Animation({}),a=(document.getElementById("container_svg_seriesCollections"),i.childNodes[0].childNodes[0].childNodes[0]),s=St("Linear"),l=St("Reverse"),h=+a.getAttribute("width"),c=+a.getAttribute("x");n.animate(a,{duration:parseFloat(e.series[r].animationDuration),progress:function(t){"Impedance"===e.renderType?(o=s(t.timeStamp-t.delay,0,h,t.duration),a.setAttribute("width",o.toString())):(o=l(t.timeStamp-t.delay,h,0,t.duration),a.setAttribute("x",o.toString()))},end:function(t){"Impedance"===e.renderType?a.setAttribute("width",h.toString()):a.setAttribute("x",c.toString());var i={cancel:!1,name:"animationComplete",smithchart:e.isBlazor?null:e};e.trigger("animationComplete",i)}})},e.prototype.getLocation=function(e,t){var i,r;return i=this.location[e][t].x,r=this.location[e][t].y,{x:i,y:r}},e}(),Bl=function(){function e(e){this.control=e}return e.prototype.print=function(e){this.smithchartPrint=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.smithchartPrint.moveTo(0,0),this.smithchartPrint.resizeTo(screen.availWidth,screen.availHeight);var i={cancel:!1,htmlContent:this.getHTMLContent(e),name:"beforePrint"};this.control.trigger("beforePrint",i),i.cancel||t.print(i.htmlContent,this.smithchartPrint)},e.prototype.getHTMLContent=function(e){var i=t.createElement("div");return e?e instanceof Array?e.forEach(function(e){i.appendChild(ct(e).cloneNode(!0))}):e instanceof Element?i.appendChild(e.cloneNode(!0)):i.appendChild(ct(e).cloneNode(!0)):i.appendChild(this.control.element.cloneNode(!0)),i},e.prototype.export=function(e,i,r){var n=this,a=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:this.control.availableSize.width.toString(),height:this.control.availableSize.height.toString()}}),s=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1);r=t.isNullOrUndefined(r)?o.PdfPageOrientation.Landscape:r;var l='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+this.control.svgObject.outerHTML+"</svg>",h=window.URL.createObjectURL(new Blob("SVG"===e?[l]:[(new XMLSerializer).serializeToString(this.control.svgObject)],{type:"image/svg+xml"}));if("SVG"===e)this.triggerDownload(i,e,h,s);else{var c=new Image,d=a.getContext("2d");c.onload=function(){if(d.drawImage(c,0,0),window.URL.revokeObjectURL(h),"PDF"===e){var t=new o.PdfDocument,l=a.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=r,l=l.slice(l.indexOf(",")+1),t.pages.add().graphics.drawImage(new o.PdfBitmap(l),0,0,n.control.availableSize.width-60,n.control.availableSize.height),s&&(t.save(i+".pdf"),t.destroy())}else n.triggerDownload(i,e,a.toDataURL("image/png").replace("image/png","image/octet-stream"),s)},c.src=h}},e.prototype.triggerDownload=function(e,i,r,o){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(o?"click":"move",{view:window,bubbles:!1,cancelable:!0}))},e}(),Fl=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Nl=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Vl=function(e){function i(t,i){return e.call(this,t,i)||this}return Fl(i,e),i.prototype.getModuleName=function(){return"smithchart"},i.prototype.getPersistData=function(){return""},i.prototype.createChartSvg=function(){this.removeSvg(),ht(this)},i.prototype.renderTitle=function(e,i,r){var o,n=this,a=e.font?e.font:e.textStyle,s=ft(e.text,a),l=e.textAlignment,h=e.text,c=t.isNullOrUndefined(e.maximumWidth)?Math.abs(this.margin.left+this.margin.right-this.availableSize.width):e.maximumWidth,d=s.width>c;o=s.width>this.availableSize.width?this.margin.left+this.border.width:"Center"===l?this.availableSize.width/2-s.width/2:"Near"===l?this.margin.left+this.elementSpacing+this.border.width:this.availableSize.width-s.width-(this.margin.right+this.elementSpacing+this.border.width);var p=this.margin.top+s.height/2+this.elementSpacing;e.enableTrim&&d&&(h=dt(c,e.text,a),s=ft(h,a)),r=this.renderer.createGroup({id:this.element.id+"_Title_Group"});var u,g={text:h,x:o,y:p,name:"titleRender",cancel:!1},y=function(t){if(!t.cancel){u=new rl(n.element.id+"_Smithchart_"+i,t.x,t.y,"start",t.text),a.fontFamily=n.themeStyle.fontFamily||e.textStyle.fontFamily,a.size=n.themeStyle.fontSize||e.textStyle.size,Ct(u,a,n.themeStyle.chartTitle,r).setAttribute("aria-label",e.description||t.text);var o={x:t.x,y:t.y,textSize:s};n.svgObject.appendChild(r),""!==e.subtitle.text&&e.subtitle.visible&&n.renderSubtitle(e,i,s,n.availableSize,o,r)}};y.bind(this),this.trigger("titleRender",g,y)},i.prototype.renderSubtitle=function(e,i,r,o,n,a){var s=this,l=e.subtitle.textStyle,h=e.subtitle,c=ft(h.text,l),d=h.text,p=t.isNullOrUndefined(h.maximumWidth)?.75*this.bounds.width:h.maximumWidth;h.enableTrim&&c.width>p&&(d=dt(p,h.text,l));var u="Far"===e.subtitle.textAlignment?n.x+n.textSize.width:"Near"===e.subtitle.textAlignment?n.x:n.x+n.textSize.width/2,g=n.y+2*this.elementSpacing,y="Far"===e.subtitle.textAlignment?"end":"Near"===e.subtitle.textAlignment?"start":"middle",m={text:d,x:u,y:g,name:"subtitleRender",cancel:!1},v=function(e){if(!e.cancel){var t=Ct(new rl(s.element.id+"_Smithchart_"+i,e.x,e.y,y,e.text),l,s.themeStyle.chartTitle,a);t.setAttribute("aria-label",h.description||e.text),a.appendChild(t)}};v.bind(this),this.trigger("subtitleRender",m,v)},i.prototype.renderBorder=function(){var e=this.border;this.background=this.background?this.background:this.themeStyle.background;var t=new tl(this.element.id+"_SmithchartBorder",this.background,e,1,new Ds(e.width/2,e.width/2,this.availableSize.width-e.width,this.availableSize.height-e.width));this.svgObject.appendChild(this.renderer.drawRectangle(t))},i.prototype.onPropertyChanged=function(e,t){for(var i=!1,r=0,o=Object.keys(e);r<o.length;r++)switch(o[r]){case"background":case"border":case"series":case"legendSettings":case"radius":i=!0;break;case"size":this.createChartSvg(),i=!0;break;case"theme":case"renderType":this.animateSeries=!0,i=!0}i&&this.render()},i.prototype.preRender=function(){this.isBlazor=t.isBlazor(),this.allowServerDataBinding=!1,this.trigger("load",{smithchart:this.isBlazor?null:this}),this.unWireEVents(),this.initPrivateVariable(),this.wireEVents()},i.prototype.initPrivateVariable=function(){this.animateSeries=!0},i.prototype.setTheme=function(){this.themeStyle=Lt(this.theme),this.seriesColors=Pt(this.theme)},i.prototype.render=function(){this.createChartSvg(),this.element.appendChild(this.svgObject),this.setTheme(),this.createSecondaryElement(),this.renderBorder(),this.smithchartLegendModule&&this.legendSettings.visible&&(this.legendBounds=this.smithchartLegendModule.renderLegend(this)),this.legendBounds=this.legendBounds?this.legendBounds:{x:0,y:0,width:0,height:0};var e=new Ol;this.bounds=e.calculateAreaBounds(this,this.title,this.legendBounds),""!==this.title.text&&this.title.visible&&this.renderTitle(this.title,"title",null);var t=new El;t.renderArea(this,this.bounds),this.seriesrender=new Dl,this.seriesrender.draw(this,t,this.bounds),this.renderComplete(),this.allowServerDataBinding=!0,this.trigger("loaded",{smithchart:this.isBlazor?null:this})},i.prototype.createSecondaryElement=function(){if(t.isNullOrUndefined(document.getElementById(this.element.id+"_Secondary_Element"))){var e=t.createElement("div",{id:this.element.id+"_Secondary_Element",styles:"z-index:1;"});this.element.appendChild(e);var i=this.element.getBoundingClientRect(),r=document.getElementById(this.element.id+"_svg");if(r){var o=r.getBoundingClientRect();e.style.left=Math.max(o.left-i.left,0)+"px",e.style.top=Math.max(o.top-i.top,0)+"px"}}else bt(this.element.id+"_Secondary_Element")},i.prototype.destroy=function(){this.element&&(this.unWireEVents(),e.prototype.destroy.call(this),this.element.classList.remove("e-smithchart"),this.removeSvg(),this.svgObject=null)},i.prototype.wireEVents=function(){t.EventHandler.add(this.element,"click",this.smithchartOnClick,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMove,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEnd,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.smithchartOnResize.bind(this))},i.prototype.mouseMove=function(e){"touchmove"===e.type?this.isTouch=!0:this.isTouch="touch"===e.pointerType||"2"===e.pointerType||this.isTouch,this.tooltipRenderModule&&!this.isTouch&&this.tooltipRenderModule.smithchartMouseMove(this,e)},i.prototype.mouseEnd=function(e){if("touchend"===e.type?this.isTouch=!0:this.isTouch="touch"===e.pointerType||"2"===e.pointerType,this.tooltipRenderModule&&this.isTouch){var t=this.tooltipRenderModule.smithchartMouseMove(this,e);t&&(this.fadeoutTo=+setTimeout(function(){t.fadeOut()},2e3))}},i.prototype.smithchartOnClick=function(e){var t=e.target.id,i=document.getElementById(t).parentElement;if("containerlegendItem_Group"===document.getElementById(i.id).parentElement.id&&this.legendSettings.toggleVisibility){for(var r=i.childNodes[1],o=i.childNodes[0],n=r.textContent,a=void 0,s=void 0,l=0;l<this.smithchartLegendModule.legendSeries.length;l++)n===this.smithchartLegendModule.legendSeries[l].text&&(a=this.smithchartLegendModule.legendSeries[l].seriesIndex,s=this.smithchartLegendModule.legendSeries[l].fill);var h=document.getElementById(this.element.id+"_svg_seriesCollection"+a);"visible"===h.getAttribute("visibility")?(o.setAttribute("fill","gray"),h.setAttribute("visibility","hidden"),this.series[a].visibility="hidden"):(o.setAttribute("fill",s),h.setAttribute("visibility","visible"),this.series[a].visibility="visible")}},i.prototype.unWireEVents=function(){t.EventHandler.remove(this.element,"click",this.smithchartOnClick),t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.mouseMove),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.mouseEnd),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.smithchartOnResize)},i.prototype.print=function(e){new Bl(this).print(e)},i.prototype.export=function(e,t,i){new Bl(this).export(e,t,i)},i.prototype.smithchartOnResize=function(){var e=this;return this.animateSeries=!1,this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){e.render()},500),!1},i.prototype.requiredModules=function(){var e=[];this.legendSettings.visible&&e.push({member:"SmithchartLegend",args:[this]});for(var t=0;t<this.series.length;t++)if(this.series[t].tooltip.visible){e.push({member:"TooltipRender",args:[this]});break}return e},i.prototype.removeSvg=function(){bt(this.element.id+"_Secondary_Element");if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}},Nl([t.Property("Impedance")],i.prototype,"renderType",void 0),Nl([t.Property("")],i.prototype,"width",void 0),Nl([t.Property("")],i.prototype,"height",void 0),Nl([t.Property("Material")],i.prototype,"theme",void 0),Nl([t.Complex({},Is)],i.prototype,"margin",void 0),Nl([t.Complex({},Es)],i.prototype,"font",void 0),Nl([t.Complex({},zs)],i.prototype,"border",void 0),Nl([t.Complex({},wl)],i.prototype,"title",void 0),Nl([t.Collection([{}],_l)],i.prototype,"series",void 0),Nl([t.Complex({},dl)],i.prototype,"legendSettings",void 0),Nl([t.Complex({},vl)],i.prototype,"horizontalAxis",void 0),Nl([t.Complex({},vl)],i.prototype,"radialAxis",void 0),Nl([t.Property(null)],i.prototype,"background",void 0),Nl([t.Property(10)],i.prototype,"elementSpacing",void 0),Nl([t.Property(1)],i.prototype,"radius",void 0),Nl([t.Event()],i.prototype,"beforePrint",void 0),Nl([t.Event()],i.prototype,"animationComplete",void 0),Nl([t.Event()],i.prototype,"load",void 0),Nl([t.Event()],i.prototype,"loaded",void 0),Nl([t.Event()],i.prototype,"legendRender",void 0),Nl([t.Event()],i.prototype,"titleRender",void 0),Nl([t.Event()],i.prototype,"subtitleRender",void 0),Nl([t.Event()],i.prototype,"textRender",void 0),Nl([t.Event()],i.prototype,"axisLabelRender",void 0),Nl([t.Event()],i.prototype,"seriesRender",void 0),Nl([t.Event()],i.prototype,"tooltipRender",void 0),i=Nl([t.NotifyPropertyChanges],i)}(t.Component),jl=function(){function e(){}return e.prototype.smithchartMouseMove=function(e,t){var i,r,o;"touchend"===t.type||"touchmove"===t.type?(r=(i=t).changedTouches[0].clientX,o=i.changedTouches[0].clientY,this.tooltipElement=void 0):(o=t.clientY,r=t.clientX),this.setMouseXY(e,r,o);for(var n=0;n<e.series.length;n++){var a=e.series[n],s=n,l=new Gs;if((l=this.closestPointXY(e,this.mouseX,this.mouseY,a,s)).location&&a.tooltip.visible&&"visible"===a.visibility){this.createTooltip(e,t,l.index,s,a);break}this.tooltipElement&&(this.tooltipElement.enable&&!a.tooltip.template&&(this.tooltipElement.enable=!1),this.tooltipElement.fadeOut())}return this.tooltipElement},e.prototype.setMouseXY=function(e,t,i){var r=document.getElementById(e.element.id+"_svg");if(e.element&&r){var o=e.element.getBoundingClientRect(),n=r.getBoundingClientRect();this.mouseX=t-o.left-Math.max(n.left-o.left,0),this.mouseY=i-o.top-Math.max(n.top-o.top,0)}},e.prototype.createTooltip=function(e,r,o,n,a){var s=this,l=a.points[o],h=[l.resistance+" : <b>"+l.reactance+"</b>"],c={cancel:!1,name:"tooltipRender",text:(l.tooltip?[l.tooltip]:null)||h,headerText:"<b>"+a.name+"</b>",template:a.tooltip.template,point:l},d=function(r){var o=e.series[n].marker.height/2,h=document.getElementById(e.element.id+"_smithchart_tooltip_div");t.isNullOrUndefined(h)&&(h=t.createElement("div",{id:e.element.id+"_smithchart_tooltip_div",styles:"pointer-events: none; position: absolute;z-index:1;"}),document.getElementById(e.element.id+"_Secondary_Element").appendChild(h)),s.tooltipElement=new i.Tooltip({enable:!0,header:r.headerText,content:r.text,border:a.tooltip.border,fill:a.tooltip.fill||e.themeStyle.tooltipFill,opacity:a.tooltip.opacity,data:l,template:r.template,location:{x:s.locationX+e.element.offsetLeft,y:s.locationY-o+e.element.offsetTop},shared:!1,areaBounds:new Ds(e.bounds.x,e.bounds.y,e.bounds.width,e.bounds.height),palette:[a.fill||e.seriesColors[n%e.seriesColors.length]],shapes:["Circle"],availableSize:e.availableSize,theme:e.theme,blazorTemplate:{name:"TooltipTemplate",parent:e.series[n].tooltip}}),s.tooltipElement.opacity=e.themeStyle.tooltipFillOpacity||s.tooltipElement.opacity,s.tooltipElement.textStyle.fontFamily=e.themeStyle.fontFamily||"Roboto, Segoe UI, Noto, Sans-serif",s.tooltipElement.textStyle.opacity=e.themeStyle.tooltipTextOpacity||s.tooltipElement.textStyle.opacity,s.tooltipElement.textStyle.color=e.themeStyle.tooltipBoldLabel||s.tooltipElement.textStyle.color,s.tooltipElement.appendTo(h)};d.bind(this,e),e.trigger("tooltipRender",c,d)},e.prototype.closestPointXY=function(e,t,i,r,o){for(var n,a,s,l=0;l<r.points.length;l++){a=e.seriesrender.getLocation(o,l),this.locationX=a.x,this.locationY=a.y,n=l;var h=t-a.x,c=i-a.y;if(Math.abs(Math.sqrt(h*h+c*c))<r.marker.width){s=a,n=l;break}}return{location:s,index:n}},e.prototype.getModuleName=function(){return"TooltipRender"},e.prototype.destroy=function(){},e}(),Hl=function(){function e(){this.legendSeries=[]}return e.prototype.renderLegend=function(e){return this.calculateLegendBounds(e),this._drawLegend(e),this.legendActualBounds},e.prototype.calculateLegendBounds=function(e){this.legendSeries=[];var t,i,r=e.legendSettings,o=r.height,n=r.width,a=r.itemPadding>0?r.itemPadding:0,s=r.position.toLowerCase(),l=r.title.textStyle,h=0,c=0,d=0,p=e.availableSize.width-(4*e.elementSpacing-2*r.border.width+2*e.border.width),u=r.rowCount,g=r.columnCount,y=ft(e.legendSettings.title.text,l),m=0,v=0,f=0,b=0,x=0,w=e.series.length;if(e.legendSettings.visible&&0!==w){"bottom"===s||"top"===s||"custom"===s?(u&&g&&u<=g?u=w/g:null==u&&null!=g?u=w/g:null==u&&null==g&&(u=1),u&&(t=Math.ceil(w/u))):(u&&g&&u<=g?g=w/u:null!=u&&null==g?g=w/u:null==u&&null==g&&(g=1),g&&(t=g));for(var S=0;S<w;S++){this.legendSeries.push({text:e.series[S].name?e.series[S].name:"series"+S,seriesIndex:S,shape:e.legendSettings.shape,fill:e.series[S].fill||e.seriesColors[S%e.seriesColors.length],bounds:null});var C=this._getLegendSize(e,this.legendSeries[S]);h=Math.max(C.width,h),c=Math.max(C.height,c),this.legendSeries[S].bounds={width:h,height:c},x+=1,f=f+h+a,b=Math.max(c,b),"top"!==s&&"bottom"!==s&&"custom"!==s||f>p&&(f-=C.width+a,m=Math.max(m,f),f=C.width+a,v=v+b+a),x!==t&&S!==w-1||(m=Math.max(m,f),d=v=v+b+a,x=0,b=0,f=0)}i={x:0,y:0,width:y.width>m-a?y.width+20+a:m+20-2*e.border.width,height:d+e.elementSpacing}}this.legendActualBounds=i,null!=n&&(this.legendActualBounds.width=n),null!=o&&(this.legendActualBounds.height=o)},e.prototype._getLegendSize=function(e,t){var i=e.legendSettings,r=i.itemStyle.width,o=i.itemStyle.height,n=ft(t.text,i.textStyle);return{width:r+n.width+i.shapePadding,height:Math.max(o,n.height)}},e.prototype._drawLegend=function(e){var t,i,r=e.legendSettings,o=r.position.toLowerCase(),n=r.alignment,a=this.legendActualBounds,s=0,l=e.title.font?e.title.font:e.title.textStyle,h=ft(e.title.text,l).height,c=ft(e.title.subtitle.text,e.title.subtitle.textStyle).height,d=e.elementSpacing,p=h+c+d+e.margin.top,u=r.itemPadding>0?r.itemPadding:0,g=e.availableSize.width,y=e.availableSize.height,m=r.border.width,v=0,f=ft(r.title.text,r.title.textStyle).height,b=e.border.width,x=g-2*b,w=y-2*b;if(a.height+=f,"custom"!==o){switch(o){case"bottom":a.y=w-(a.height+m+d);break;case"top":a.y=b+p;break;case"right":a.x=x-a.width-2*d;break;case"left":a.x=b+2*d}if("left"===o||"right"===o)switch(n){case"Center":a.y=w/2-(a.height+2*m)/2+d/2;break;case"Near":a.y=b+2*d+p;break;case"Far":a.y=w-(a.height+m)-2*d}else switch(n){case"Center":a.x=x/2-(a.width+2*m)/2+d/2;break;case"Near":a.x=b+2*d;break;case"Far":a.x=x-(a.width+m)-2*d}}else a.y=r.location.y<w?r.location.y:0,a.x=r.location.x<x?r.location.x:0;if("bottom"===o||"top"===o)for(var S=0;S<this.legendSeries.length;S++)if((v+=this.legendSeries[S].bounds.width+u)>x){a.x=x/2-(a.width+2*m)/2+d/2;break}var C=e.renderer.createGroup({id:e.element.id+"_legend_group"});e.svgObject.appendChild(C),this.legendItemGroup=e.renderer.createGroup({id:e.element.id+"legendItem_Group"});var P=t=d,L=i=d;""!==r.title.text&&r.title.visible&&(C.appendChild(this.drawLegendTitle(e,r,a,C)),L=i=d+f);for(var R=0;R<this.legendSeries.length;R++)!(r.rowCount<r.columnCount||r.rowCount===r.columnCount)||"top"!==o&&"bottom"!==o&&"custom"!==o?(L+this.legendSeries[R].bounds.height+u+f+b>a.height+i&&(L=i,P+=s+u),this.legendGroup=this.drawLegendItem(e,r,this.legendSeries[R],R,P,L,a),C.appendChild(this.legendGroup),L+=this.legendSeries[R].bounds.height+u,s=Math.max(s,this.legendSeries[R].bounds.width)):(P+this.legendSeries[R].bounds.width>a.width+t&&(P=d,L+=this.legendSeries[R].bounds.height+u),this.legendGroup=this.drawLegendItem(e,r,this.legendSeries[R],R,P,L,a),C.appendChild(this.legendGroup),P+=this.legendSeries[R].bounds.width+u);C.setAttribute("transform","translate("+a.x.toString()+","+a.y.toString()+")"),this.drawLegendBorder(C,e,r,a)},e.prototype.drawLegendBorder=function(e,t,i,r){var o=new tl(t.element.id+"_svg_legendRect","none",i.border,1,new Ds(0,0,r.width,r.height));e.appendChild(t.renderer.drawRectangle(o))},e.prototype.drawLegendTitle=function(e,t,i,r){var o=e.elementSpacing,n=ft(t.title.text,t.title.textStyle),a=n.width,s=n.height,l=t.title.textAlignment,h=0,c=i.width,d=o+s/2;switch(l){case"Far":h=c-a-h;break;case"Center":h=c/2-a/2}h<0&&(h=0,c=a),c<a+h&&(c=a+h);var p=Ct(new rl(e.element.id+"_LegendTitleText",h,d,"start",t.title.text),t.title.textStyle,e.themeStyle.legendLabel,r);return p.setAttribute("aria-label",t.title.description||t.title.text),p},e.prototype.drawLegendItem=function(e,t,i,r,o,n,a){var s,l,h=this,c=t.itemStyle;t.itemPadding;Math.sqrt(c.width*c.width+c.height*c.height),l=ft(i.text,t.textStyle).height,s={x:o+c.width/2,y:n+(l>c.height?l:c.height)/2};var d=e.renderer.createGroup({id:e.element.id+"_svg_Legend"+r.toString()});d.style.cursor=t.toggleVisibility?"pointer":"default";var p={text:i.text,fill:i.fill,shape:i.shape,name:"legendRender",cancel:!1},u=function(o){if(!o.cancel){var n=h.drawLegendShape(e,i,s.x,s.y,r,t,o);d.appendChild(n);var a=new rl(e.element.id+"_LegendItemText"+r.toString(),s.x+c.width/2+t.shapePadding,s.y+l/4,"start",o.text);t.textStyle.fontFamily=e.themeStyle.fontFamily||t.textStyle.fontFamily,t.textStyle.size=e.themeStyle.fontSize||t.textStyle.size;var p=Ct(a,t.textStyle,e.themeStyle.legendLabel,d);p.setAttribute("aria-label",t.description||"Click to show or hide the "+a.text+" series"),d.appendChild(p),h.legendItemGroup.appendChild(d)}};return u.bind(this),e.trigger("legendRender",p,u),this.legendItemGroup},e.prototype.drawLegendShape=function(e,t,i,r,o,n,a){var s,l,h,c,d=n.itemStyle,p=d.width,u=d.height,g=i+-p/2,y={color:d.border.color,width:d.border.width},m="visible"===e.series[o].visibility?a.fill:"grey",v=a.shape.toLowerCase(),f=Math.sqrt(u*u+p*p)/2;switch(v){case"circle":l=new il(e.element.id+"_svg_LegendItemShape"+o.toString(),m,y,1,i,r,f,null),s=e.renderer.drawCircle(l);break;case"rectangle":c="M "+g+" "+(r+-u/2)+" L "+(p/2+i)+" "+(r+-u/2)+" L "+(i+p/2)+" "+(r+u/2)+" L "+g+" "+(r+u/2)+" L "+g+" "+(r+-u/2)+" z",h=new el(e.element.id+"_svg_LegendItemShape"+o.toString(),m,y.width,y.color,1,"",c),s=e.renderer.drawPath(h);break;case"diamond":c="M "+g+" "+r+" L "+i+" "+(r+-u/2)+" L "+(p/2+i)+" "+r+" L "+i+" "+(r+u/2)+" L "+g+" "+r+" z",h=new el(e.element.id+"_svg_LegendItemShape"+o.toString(),m,y.width,y.color,1,"",c),s=e.renderer.drawPath(h);break;case"pentagon":for(var b=0;b<=5;b++){var x=f*Math.cos(Math.PI/180*(72*b)),w=f*Math.sin(Math.PI/180*(72*b));c=0===b?"M "+(x+i)+" "+(r+w)+" ":c.concat("L "+(i+x)+" "+(r+w)+" ")}c=c.concat("Z"),h=new el(e.element.id+"_svg_LegendItemShape"+o.toString(),m,y.width,y.color,1,"",c),s=e.renderer.drawPath(h);break;case"triangle":c="M "+g+" "+(u/2+r)+" L "+i+" "+(r+-u/2)+" L "+(i+p/2)+" "+(r+u/2)+" L "+g+" "+(r+u/2)+" Z",h=new el(e.element.id+"_svg_LegendItemShape"+o.toString(),m,y.width,y.color,1,"",c),s=e.renderer.drawPath(h)}return s},e.prototype.getModuleName=function(){return"SmithchartLegend"},e.prototype.destroy=function(e){},e}(),Xl=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yl=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},Gl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property("")],i.prototype,"color",void 0),Yl([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),Wl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(null)],i.prototype,"size",void 0),Yl([t.Property(null)],i.prototype,"color",void 0),Yl([t.Property("Roboto, Segoe UI, Noto, Sans-serif")],i.prototype,"fontFamily",void 0),Yl([t.Property(null)],i.prototype,"fontWeight",void 0),Yl([t.Property(null)],i.prototype,"fontStyle",void 0),Yl([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Ul=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(!1)],i.prototype,"visible",void 0),Yl([t.Property(null)],i.prototype,"color",void 0),Yl([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),Zl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(!1)],i.prototype,"visible",void 0),Yl([t.Property("")],i.prototype,"fill",void 0),Yl([t.Property("")],i.prototype,"template",void 0),Yl([t.Property("")],i.prototype,"format",void 0),Yl([t.Complex({color:"#cccccc",width:.5},Gl)],i.prototype,"border",void 0),Yl([t.Complex({size:"13px",fontWeight:"Normal",fontStyle:"Normal",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},Wl)],i.prototype,"textStyle",void 0),Yl([t.Complex({},Ul)],i.prototype,"trackLineSettings",void 0),i}(t.ChildProperty),ql=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property("transparent")],i.prototype,"background",void 0),Yl([t.Complex({},Gl)],i.prototype,"border",void 0),i}(t.ChildProperty),Ql=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(!1)],i.prototype,"visible",void 0),Yl([t.Property(null)],i.prototype,"color",void 0),Yl([t.Property("")],i.prototype,"dashArray",void 0),Yl([t.Property(1)],i.prototype,"width",void 0),Yl([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),$l=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(null)],i.prototype,"startRange",void 0),Yl([t.Property(null)],i.prototype,"endRange",void 0),Yl([t.Property(null)],i.prototype,"color",void 0),Yl([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Jl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(null)],i.prototype,"minX",void 0),Yl([t.Property(null)],i.prototype,"maxX",void 0),Yl([t.Property(null)],i.prototype,"minY",void 0),Yl([t.Property(null)],i.prototype,"maxY",void 0),Yl([t.Property(0)],i.prototype,"value",void 0),Yl([t.Complex({},Ql)],i.prototype,"lineSettings",void 0),i}(t.ChildProperty),Kl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(5)],i.prototype,"left",void 0),Yl([t.Property(5)],i.prototype,"right",void 0),Yl([t.Property(5)],i.prototype,"bottom",void 0),Yl([t.Property(5)],i.prototype,"top",void 0),i}(t.ChildProperty),eh=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property([])],i.prototype,"visible",void 0),Yl([t.Property(1)],i.prototype,"opacity",void 0),Yl([t.Property(5)],i.prototype,"size",void 0),Yl([t.Property("#00bdae")],i.prototype,"fill",void 0),Yl([t.Complex({width:1},Gl)],i.prototype,"border",void 0),i}(t.ChildProperty),th=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property(0)],i.prototype,"x",void 0),Yl([t.Property(0)],i.prototype,"y",void 0),i}(t.ChildProperty),ih=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Xl(i,e),Yl([t.Property([])],i.prototype,"visible",void 0),Yl([t.Property(1)],i.prototype,"opacity",void 0),Yl([t.Property("transparent")],i.prototype,"fill",void 0),Yl([t.Property("")],i.prototype,"format",void 0),Yl([t.Complex({color:"transparent",width:0},Gl)],i.prototype,"border",void 0),Yl([t.Complex({size:"14px",fontWeight:"Medium",fontStyle:"Medium",fontFamily:"Roboto, Segoe UI, Noto, Sans-serif"},Wl)],i.prototype,"textStyle",void 0),Yl([t.Complex({},th)],i.prototype,"offset",void 0),Yl([t.Property("None")],i.prototype,"edgeLabelMode",void 0),i}(t.ChildProperty),rh=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oh=function(){function e(e,t){this.width=e,this.height=t}return e}(),nh=function(){function e(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}return e}(),ah=function(){function e(e,t,i,r,o,n,a){this.id=e,this.fill=t,this.opacity=o,this["stroke-width"]=i,this.stroke=r,this.d=a,this["stroke-dasharray"]=n}return e}(),sh=function(e){function t(t,i,r,o,n,a,s,l,h){void 0===a&&(a=0),void 0===s&&(s=0),void 0===l&&(l=0),void 0===h&&(h=0);var c=e.call(this,t,i,r.width,r.color,o)||this;return c.rect=n,c.topLeft=a,c.topRight=s,c.bottomLeft=l,c.bottomRight=h,c}return rh(t,e),t}(ah),lh=function(e){function t(t,i,r,o,n,a,s,l){var h=e.call(this,t,i,r.width,r.color,o)||this;return h.cy=a,h.cx=n,h.r=s,h["stroke-dasharray"]=l,h}return rh(t,e),t}(ah),hh=function(){function e(e,t,i,r,o,n,a){void 0===a&&(a=""),this.transform="",this.baseLine="auto",this.id=e,this.x=t,this.y=i,this.anchor=r,this.text=o,this.transform=a,this.baseLine=n}return e}(),ch=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(i[r[o]]=e[r[o]]);return i},dh=function(){function e(e){this.sparkline=e}return e.prototype.processData=function(){var e=this.sparkline.dataSource;!t.isNullOrUndefined(e)&&e.length&&(isNaN(this.sparkline.dataSource[0])&&"Numeric"!==this.sparkline.valueType?this["process"+this.sparkline.valueType]():(e=this.sparkline.enableRtl?e.reverse():e,this.sparkline.sparklineData=e),this.axisCalculation())},e.prototype.processDataManager=function(){var e,t,i=this;this.sparkline.dataSource instanceof r.DataManager?(e=this.sparkline.dataSource,t=this.sparkline.query instanceof r.Query?this.sparkline.query:new r.Query,e.executeQuery(t).then(function(e){i.sparkline.setProperties({dataSource:e.result},!0),i.sparkline.sparklineData=i.sparkline.dataSource,i.sparkline.processSparklineData()})):this.sparkline.processSparklineData()},e.prototype.processCategory=function(e,t,i){var r=this;void 0===e&&(e=this.sparkline.dataSource),void 0===t&&(t=this.sparkline.xName),void 0===i&&(i=this.sparkline.yName);var o=[],n=[];e.forEach(function(e){-1===n.indexOf(e[t])&&n.push(e[t]);var a={};a[r.sparkline.xName]=n.indexOf(e[t]),a[r.sparkline.yName]=e[i],o.push(a)}),this.sparkline.sparklineData=o},e.prototype.processDateTime=function(e,t,i){void 0===e&&(e=this.sparkline.dataSource),void 0===t&&(t=this.sparkline.xName),void 0===i&&(i=this.sparkline.yName);var r=[];e.forEach(function(e){var o={};o[t]=e[t].getTime(),o[i]=e[i],r.push(o)}),this.sparkline.sparklineData=r},e.prototype.renderSeries=function(){var e=this,t=this.sparkline;this.clipId=t.element.id+"_sparkline_clip_path",this.drawAxis();var i={name:"seriesRendering",cancel:!1,lineWidth:t.lineWidth,border:t.border,fill:t.fill,sparkline:this.sparkline.isBlazor?null:t},r=function(i){if(e.visiblePoints&&!i.cancel){if("Pie"!==t.type&&"WinLoss"!==t.type&&t.rangeBandSettings.length){for(var r=e.sparkline.renderer.createGroup({id:e.sparkline.element.id+"_sparkline_rangeband_g"}),o=0;o<t.rangeBandSettings.length;o++)(t.axisSettings.minY<=t.rangeBandSettings[o].startRange||t.axisSettings.maxY>=t.rangeBandSettings[o].endRange)&&e.rangeBand(t.rangeBandSettings[o],r,o);e.sparkline.svgObject.appendChild(r)}e["render"+t.type](e.visiblePoints,i),e.renderMarker(e.visiblePoints),e.renderLabel(e.visiblePoints)}};r.bind(this),t.trigger("seriesRendering",i,r)},e.prototype.rangeBand=function(e,t,i){var r=this.sparkline,o=r.availableSize.height-2*r.padding.top,n=r.availableSize.width-2*r.padding.left,a=e.startRange,s=e.endRange,l=o-o/this.unitY*(a-this.min)+r.padding.top,h=o-o/this.unitY*(s-this.min)+r.padding.top,c=e.color||this.sparkline.sparkTheme.rangeBandColor;h>o+r.padding.top?h=o+r.padding.top:h<0+r.padding.top&&(h=0+r.padding.top),l>o+r.padding.top?l=o+r.padding.top:l<0+r.padding.top&&(l=0+r.padding.top);var d="M "+r.padding.left+" "+l+" L "+(n+r.padding.left)+" "+l+" L "+(n+r.padding.left)+" "+h+" L "+r.padding.left+" "+h+" Z ",p={id:r.element.id+"_rangeBand_"+i,fill:c,opacity:e.opacity,stroke:"transparent","stroke-width":r.lineWidth,d:d,"stroke-dasharray":""};It(this.sparkline,p,t)},e.prototype.renderLine=function(e,t){var i=this.sparkline,r=this.sparkline.renderer.createGroup({id:i.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"}),o=this.sparkline.fill;o="#00bdae"===this.sparkline.fill&&"Bootstrap4"===this.sparkline.theme?this.sparkline.sparkTheme.axisLineColor:o;for(var n=new ah(i.element.id+"_sparkline_line","transparent",t.lineWidth,o,i.opacity),a="",s=0,l=e.length;s<l;s++)0===s&&(a="M "+e[0].x+" "+e[s].y+" "),a+="L "+e[s].x+" "+e[s].y+" ";n.d=a,It(this.sparkline,n,r),this.sparkline.svgObject.appendChild(r)},e.prototype.renderPie=function(e,i){var r,o,n,a,s=this.sparkline,l=s.availableSize.height-(s.padding.top+s.padding.bottom),h=s.availableSize.width-(s.padding.left+s.padding.right),c=l<=h?l/2:h/2,d=s.availableSize.width/2,p=s.availableSize.height/2,u=0,g=i.border.color,y=s.opacity,m=i.border.width,v=s.palette.length?s.palette:["#00bdae","#404041","#357cd2","#e56590","#f8b883","#70ad47","#dd8abd","#7f84e8","#7bb4eb","#ea7a57"],f=this.sparkline.renderer.createGroup({id:s.element.id+"_sparkline_g"}),b=t.extend([],[],e);if(s.highPointColor||s.lowPointColor){var x=b.map(function(e){return e.yVal});n=Math.min.apply(null,x),a=Math.max.apply(null,x)}this.negativePointIndexes=[];for(var w=0,S=90,C=void 0,P=void 0;w<e.length;w++){C=(S+=u)+(u=e[w].degree),r=(S-90)*Math.PI/180,o=(C-90)*Math.PI/180,e[w].stAng=r,e[w].endAng=o,P=u<180?"0":"1";var L=e[w].coordinates={sX:d+c*Math.cos(r),sY:p+c*Math.sin(r),eX:d+c*Math.cos(o),eY:p+c*Math.sin(o)},R="M "+d+" "+p+" L "+L.eX+" "+L.eY+" A "+c+" "+c+" 0 "+P+",0 "+L.sX+" "+L.sY+" Z",M={id:s.element.id+"_sparkline_pie_"+w,opacity:y,fill:v[w%v.length],stroke:g,"stroke-width":m,d:R,"stroke-dasharray":""};this.getPieSpecialPoint(e[w],s,M,w,a,n,e.length);var A=this.triggerPointRender("pointRendering",w,M.fill,{color:g,width:m});M.fill=A.fill,M.stroke=A.border.color,M["stroke-width"]=A.border.width,A.cancel||It(this.sparkline,M,f).setAttribute("aria-label",s.dataSource[w][s.xName]+" : "+e[w].yVal);var k=o-r,T={x:d+c/2*Math.cos(r+k/2),y:p+c/2*Math.sin(r+k/2)};e[w].location.x=T.x,e[w].location.y=T.y}this.sparkline.svgObject.appendChild(f)},e.prototype.getPieSpecialPoint=function(e,t,i,r,o,n,a){e.yVal<0&&t.negativePointColor&&(i.fill=t.negativePointColor,this.negativePointIndexes.push(r)),0===r&&t.startPointColor?(i.fill=t.startPointColor,this.startPointIndex=r):r===a-1&&t.endPointColor&&(i.fill=t.endPointColor,this.endPointIndex=r),e.yVal===o&&t.highPointColor?(i.fill=t.highPointColor,this.highPointIndex=r):e.yVal===n&&t.lowPointColor&&(i.fill=t.lowPointColor,this.lowPointIndex=r)},e.prototype.renderArea=function(e,t){for(var i=this.sparkline,r=this.sparkline.renderer.createGroup({id:i.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"}),o=new ah(i.element.id+"_sparkline_area",t.fill,0,"transparent",i.opacity),n="",a="",s=0,l=e.length;s<l;s++)0!==s?a+="L "+e[s].x+" "+e[s].y+" ":(n="M "+e[s].x+" "+this.axisHeight+" ",a="M "+e[s].x+" "+e[s].y+" "),n+="L "+e[s].x+" "+e[s].y+" ",s===l-1&&(n+="L "+e[s].x+" "+this.axisHeight+" Z");o.d=n,It(this.sparkline,o,r),o=new ah(i.element.id+"_sparkline_area_str","transparent",t.border.width,t.border.color,i.opacity,"",a),It(this.sparkline,o,r),this.sparkline.svgObject.appendChild(r)},e.prototype.renderColumn=function(e,i){var r,o,n=this,a=this.sparkline,s=t.extend([],[],e),l=this.sparkline.renderer.createGroup({id:a.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"});if(this.sparkline.highPointColor||this.sparkline.lowPointColor){var h=s.map(function(e){return e.markerPosition});o=Math.min.apply(null,h),r=Math.max.apply(null,h)}var c,d=a.element.id+"_sparkline_column_",p=new sh(d,"",i.border,a.opacity,null),u=a.palette.length,g=e.length;this.negativePointIndexes=[];for(var y=this,m=0;m<g;m++)!function(t){c=e[t],p.id=d+t,p.fill=u?a.palette[t%u]:i.fill,p.rect=new nh(c.x,c.y,c.width,c.height),y.getSpecialPoint(!0,c,a,p,t,o,r,g),c.location.y=c.markerPosition<=y.axisHeight?c.y:c.y+c.height,c.location.x=c.x+c.width/2,p.stroke=i.border.color?i.border.color:p.fill;var s={name:"pointRendering",cancel:!1,pointIndex:t,fill:p.fill,border:{color:p.stroke,width:i.border.width}};if(y.sparkline.isBlazor){var h=ch(s,[]);s=h}y.sparkline.trigger("pointRendering",s,function(){if(c=e[t],p.id=d+t,p.rect=new nh(c.x,c.y,c.width,c.height),n.getSpecialPoint(!0,c,a,p,t,o,r,g),p.fill=s.fill,p.stroke=s.border.color,c.location.y=c.markerPosition<=n.axisHeight?c.y:c.y+c.height,p["stroke-width"]=s.border.width,c.location.x=c.x+c.width/2,!s.cancel){var i=Et(a,p,l);i.setAttribute("aria-label",a.dataSource[t][a.xName]+" : "+e[t].yVal),l.appendChild(i)}})}(m);this.sparkline.svgObject.appendChild(l)},e.prototype.renderWinLoss=function(e,t){for(var i,r=this.sparkline,o=this.sparkline.renderer.createGroup({id:r.element.id+"_sparkline_g","clip-path":"url(#"+this.clipId+")"}),n=r.element.id+"_sparkline_winloss_",a=new sh(n,"",t.border,r.opacity,null),s=e.length,l=r.palette.length,h=0;h<s;h++){i=e[h],a.id=n+h,a.fill=l?r.palette[h%l]:i.yVal===this.axisValue?this.sparkline.tiePointColor||"#a216f3":i.yVal>this.axisValue?t.fill:r.negativePointColor||"#e20f07",a.stroke=t.border.color?t.border.color:a.fill,a.rect=new nh(i.x,i.y,i.width,i.height),i.location.x=i.x+i.width/2,i.location.y=i.yVal>=this.axisValue?i.y:i.y+i.height;var c=this.triggerPointRender("pointRendering",h,a.fill,{color:a.stroke,width:t.border.width});a.fill=c.fill,a.stroke=c.border.color,a["stroke-width"]=c.border.width,c.cancel||Et(r,a,o).setAttribute("aria-label",r.dataSource[h][r.xName]+" : "+e[h].yVal)}this.sparkline.svgObject.appendChild(o)},e.prototype.renderMarker=function(e){var i=this.sparkline,r=i.markerSettings;if("Pie"!==i.type&&"WinLoss"!==i.type&&r.visible.length){var o,n,a,s=t.extend([],[],e),l=this.sparkline.renderer.createGroup({id:i.element.id+"_sparkline_marker_g","clip-path":"url(#"+this.clipId+")"}),h=i.element.id+"_sparkline_marker_",c=new lh("",r.fill,r.border,r.opacity,0,0,r.size/2,""),d=r.visible.join();if(d.toLowerCase().indexOf("high")>-1||d.toLowerCase().indexOf("low")>-1){var p=s.map(function(e){return e.markerPosition});n=Math.min.apply(null,p),a=Math.max.apply(null,p)}this.negativePointIndexes=[];for(var u=this,g=0,y=e.length;g<y;g++)!function(t,s){o=e[t],c.id=h+t,c.cx=o.location.x,c.cy=o.location.y,c.fill=r.fill;var p=d.toLowerCase().indexOf("all")>-1;p=u.getSpecialPoint(p,o,i,c,t,n,a,s,d.toLowerCase()),c.stroke=r.border.color||c.fill;var g={name:"markerRendering",cancel:!1,border:{color:c.stroke,width:r.border.width},fill:c.fill,pointIndex:t,sparkline:u.sparkline.isBlazor?null:u.sparkline,x:c.cx,y:c.cy,size:r.size};if(u.sparkline.isBlazor){var y=ch(g,[]);g=y}u.sparkline.trigger("markerRendering",g,function(){if(p&&!g.cancel){c.id=h+t,c.cx=g.x,c.cy=g.y,c.fill=g.fill,c.stroke=g.border.color,c["stroke-width"]=g.border.width,c.r=g.size/2;var r=_t(i,c,l);r.setAttribute("aria-label",i.dataSource[t][i.xName]+" : "+e[t].yVal),l.appendChild(r)}})}(g,y);this.sparkline.svgObject.appendChild(l)}},e.prototype.getSpecialPoint=function(e,t,i,r,o,n,a,s,l){return void 0===l&&(l=""),t.markerPosition>this.axisHeight&&(r.fill=i.negativePointColor||r.fill,this.negativePointIndexes.push(o),e=e||l.indexOf("negative")>-1),0===o?(r.fill=i.startPointColor||r.fill,this.startPointIndex=o,e=e||l.indexOf("start")>-1):o===s-1&&(r.fill=i.endPointColor||r.fill,this.endPointIndex=o,e=e||l.indexOf("end")>-1),t.markerPosition===n?(r.fill=i.highPointColor||r.fill,this.highPointIndex=o,e=e||l.indexOf("high")>-1):t.markerPosition===a&&(r.fill=i.lowPointColor||r.fill,this.lowPointIndex=o,e=e||l.indexOf("low")>-1),l.indexOf("none")>-1&&(e=!1),e},e.prototype.renderLabel=function(e){var i=this,r=this.sparkline,o=r.dataLabelSettings,n=o.textStyle.color||r.sparkTheme.dataLabelColor;if("WinLoss"!==r.type&&o.visible.length){var a,s,l,h=t.extend([],[],e),c=r.element.id+"_sparkline_label_",d=this.sparkline.renderer.createGroup({id:r.element.id+"_sparkline_label_g",style:"pointer-events: none;"}),p=c+"text_",u=c+"rect_",g=new hh("",0,0,"middle","","middle"),y=o.textStyle,m=h.map(function(e){return e.markerPosition}),v=Math.min.apply(null,m),f=Math.max.apply(null,m),b="transparent"!==o.fill||o.border.width?2:0,x=zt("sparkline_measure_text",y),w=new sh("",o.fill,o.border,o.opacity,null);y.fontFamily=r.sparkTheme.labelFontFamily||y.fontFamily;for(var S=this,C=0,P=e.length;C<P;C++)!function(t,h){s=e[t],g.id=p+t,g.x=s.location.x+o.offset.x,g.y=("Pie"===r.type?s.location.y:s.markerPosition>S.axisHeight?s.location.y+x.height/2+1+2+b:s.location.y-x.height/2-1-b)+o.offset.y,g.text=""!==o.format?S.formatter(o.format,S.sparkline.dataSource[t]):s.yVal.toString();var m={name:"dataLabelRendering",cancel:!1,border:o.border,fill:o.fill,pointIndex:t,sparkline:S.sparkline.isBlazor?null:S.sparkline,x:g.x,y:g.y,text:g.text,color:n};if(S.sparkline.isBlazor){var C=ch(m,[]);m=C}S.sparkline.trigger("dataLabelRendering",m,function(){x=zt(m.text,y),g.text=m.text;var e=o.visible.join().toLowerCase().indexOf("all")>-1;e=i.getLabelVisible(e,s,t,o,h,v,f),l=i.arrangeLabelPosition(o.edgeLabelMode,e,m.x,t,h,x,b),e&&!m.cancel&&l.render&&(w.id=u+t,w.fill=m.fill,w.stroke=m.border.color,w["stroke-width"]=m.border.width,g.y=m.y,g.x=l.x,w.rect=new nh(g.x-(x.width/2+b),g.y-b-x.height/1.75,x.width+2*b,x.height+2*b),a=i.sparkline.renderer.createGroup({id:c+"g"+t}),Et(r,w,a),Dt(g,y,m.color,a),d.appendChild(a))})}(C,P);this.sparkline.svgObject.appendChild(d)}},e.prototype.arrangeLabelPosition=function(e,t,i,r,o,n,a){return"None"===e?{x:i,render:t}:(0===r&&i-n.width/2-a<=0?"Hide"===e?t=!1:i=this.sparkline.padding.left+a+n.width/2:r===o-1&&i+n.width/2+a>=this.sparkline.availableSize.width&&("Hide"===e?t=!1:i-=n.width/2+a),{x:i,render:t})},e.prototype.getLabelVisible=function(e,t,i,r,o,n,a){var s=r.visible.join().toLowerCase();return t.markerPosition>this.axisHeight&&(e=e||s.indexOf("negative")>-1),0===i?e=e||s.indexOf("start")>-1:i===o-1&&(e=e||s.indexOf("end")>-1),t.markerPosition===n?e=e||s.indexOf("high")>-1:t.markerPosition===a&&(e=e||s.indexOf("low")>-1),r.visible.join().toLowerCase().indexOf("none")>-1&&(e=!1),e},e.prototype.formatter=function(e,i){if(t.isNullOrUndefined(e))return null;for(var r=0,o=Object.keys(i);r<o.length;r++){var n=o[r];e=e.split("${"+n+"}").join(i[n])}return e},e.prototype.axisCalculation=function(){this.findRanges(this.sparkline.sparklineData)},e.prototype.getInterval=function(e,i){var r=1,o=e[0][i],n=t.isNullOrUndefined(e[1])?void 0:e[1][i];if(!t.isNullOrUndefined(o)&&!t.isNullOrUndefined(n)){var a=[];t.extend([],e).forEach(function(e){t.isNullOrUndefined(e[i])||a.push(e)}),a.sort(function(e,r){return t.isNullOrUndefined(e[i])||t.isNullOrUndefined(r[i])?0:e[i]-r[i]}),r=(a=this.sparkline.enableRtl?a.reverse():a)[1][i]-a[0][i]}return r},e.prototype.getPaddingInterval=function(e,t,i,r){for(var o=this.sparkline.availableSize.height,n=1*e.length,a=r/(n=Math.max(o*(n/100),1)),s=0,l=this.sparkline.intervalDivs;s<l.length;s++){var h=1*l[s];if(n<r/h)break;a=h}return a},e.prototype.findRanges=function(e){var i,r,o,n,a,s=this.sparkline,l=e.length,h=0,c=Array.isArray(e)&&"object"!=typeof e[0];if(c)if("Pie"===s.type)for(_=0;_<l;_++)h+=Math.abs(e[_]);else i=Math.max.apply(null,e),r=Math.min.apply(null,e),o=0,n=l-1;else if("Pie"===s.type)for(_=0;_<l;_++)h+=Math.abs(e[_][s.yName]);else{if(t.isNullOrUndefined(e[0][s.xName])){var d=e.map(function(e){return e[s.yName]});i=Math.max.apply(null,d),r=Math.min.apply(null,d)}else i=(a=(a=t.extend([],e)).sort(function(e,t){return e[s.yName]-t[s.yName]}))[a.length-1][s.yName],r=a[0][s.yName];t.isNullOrUndefined(e[0][s.xName])?(o=0,n=l-1):(a=a.sort(function(e,t){return e[s.xName]-t[s.xName]}),n=(a=this.sparkline.enableRtl?a.reverse():a)[a.length-1][s.xName],o=a[0][s.xName])}var p,u,g,y,m,v=0,f=s.padding,b=s.axisSettings,x=b.value;if("Pie"!==s.type){this.maxLength=l,u=s.availableSize.height-(f.bottom+f.top),g=s.availableSize.width-(f.left+f.right),n=t.isNullOrUndefined(b.maxX)?n:b.maxX,o=t.isNullOrUndefined(b.minX)?o:b.minX,i=t.isNullOrUndefined(b.maxY)?i:b.maxY,r=t.isNullOrUndefined(b.minY)?r:b.minY;var w=b.lineSettings.color||this.sparkline.sparkTheme.axisLineColor,S={name:"axisRendering",cancel:!1,sparkline:this.sparkline.isBlazor?null:s,maxX:n,minX:o,maxY:i,minY:r,value:b.value,lineColor:w,lineWidth:b.lineSettings.width};if(s.trigger("axisRendering",S),S.cancel)return void(this.visiblePoints=[]);n=S.maxX,o=S.minX,i=S.maxY,r=S.minY,x=this.axisValue=S.value,this.axisColor=S.lineColor,this.axisWidth=S.lineWidth}var C=n-o,P=i-r;C=0===C?1:C,P=0===P?1:P,this.unitX=C,this.unitY=P,this.min=r,v=0,y=u-u/P*-r,y=r<0&&i<=0?0:r<0&&i>0?y:u,x>=r&&x<=i&&(y=u-Math.round(u*((x-r)/this.unitY))),this.axisHeight=y+f.top;for(var L,R,M=[],A=i-r,k=this.getInterval(e,s.xName),T=this.getPaddingInterval(e,s.xName,s.valueType,A),_=0;_<l;_++)if(t.isNullOrUndefined(e[_][s.xName])&&t.isNullOrUndefined(e[_][s.yName])&&0!==e[_][s.yName]&&c?(L=_,R=e[_]):t.isNullOrUndefined(e[_][s.xName])?(L=_,R=e[_][s.yName]):(L=e[_][s.xName],R=e[_][s.yName]),!t.isNullOrUndefined(L)&&!t.isNullOrUndefined(R)){if("Line"===s.type||"Area"===s.type)p=r!==i&&1!==l?u-Math.round(u*((R-r)/this.unitY)):f.top,m={x:o!==n?Math.round(g*((L-o)/this.unitX)):g/2,y:p,markerPosition:p};else if("Column"===s.type||"WinLoss"===s.type){var O=g/((n-o)/k+1);if(O-=1,v=(L-o)/k*(O+1)+.5,"WinLoss"===s.type){m={x:v,y:p=R>x?u/4:R<x?.5*u:.5*u-u/40,height:R!==x?u/4:u/20,width:O,markerPosition:p>y?y+Math.abs(p-y):p}}else{0===_&&"None"!==s.rangePadding&&(r-="Additional"===s.rangePadding?T+f.top:T,P=(i+="Additional"===s.rangePadding?T+f.top:T)-r,C=0===(C=n-o)?1:C,P=0===P?1:P,this.unitX=C,this.unitY=P,this.min=r);var E=u/this.unitY*(R-r),I=R===r&&R>x?1!==l&&1!==this.unitY?u/this.unitY*(r/2):1|E:R===i&&R<x&&1!==l&&1!==this.unitY?u/this.unitY*(-i/2):E;m={x:v,y:(p=Math.abs(u-I))>y?y:p,height:Math.abs(p-y),width:O,markerPosition:p>y?y+Math.abs(p-y):p}}}else"Pie"===s.type&&(m={percent:Math.abs(R)/h*100,degree:Math.abs(R)/h*360});"Pie"!==s.type&&(m.x+=f.left,m.y+=f.top),"WinLoss"!==s.type&&(m.markerPosition+=f.top),m.location={x:m.x,y:m.y},m.xVal=L,m.yVal=R,M.push(m)}M.sort(function(e,t){return e.x-t.x}),this.visiblePoints=M},e.prototype.drawAxis=function(){var e=this.sparkline,t=this.axisHeight;if("WinLoss"!==e.type&&"Pie"!==e.type&&e.axisSettings.lineSettings.visible){var i={id:e.element.id+"_Sparkline_XAxis",x1:e.padding.left,y1:t,x2:e.availableSize.width-e.padding.right,y2:t,stroke:this.axisColor,opacity:e.axisSettings.lineSettings.opacity,"stroke-dasharray":e.axisSettings.lineSettings.dashArray,"stroke-width":this.axisWidth,"clip-path":"url(#"+this.clipId+")"};e.svgObject.appendChild(e.renderer.drawLine(i))}},e.prototype.triggerPointRender=function(e,t,i,r){var o={name:e,cancel:!1,border:r,fill:i,sparkline:this.sparkline.isBlazor?null:this.sparkline,pointIndex:t};return this.sparkline.trigger(e,o),o},e}(),ph=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uh=function(e,t,i,r){var o,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(n<3?o(a):n>3?o(t,i,a):o(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},gh=function(e){function i(i,r){var o=e.call(this,i,r)||this;return o.isDevice=t.Browser.isDevice,o.intervalDivs=[10,5,2,1],o}return ph(i,e),i.prototype.preRender=function(){this.isBlazor=t.isBlazor(),this.allowServerDataBinding=!1,this.unWireEvents(),this.trigger("load",{sparkline:this.isBlazor?null:this}),this.sparkTheme=Rt(this.theme),this.sparklineRenderer=new dh(this),this.createSVG(),this.wireEvents(),this.setCulture()},i.prototype.render=function(){this.sparklineRenderer.processDataManager(),this.renderComplete(),this.allowServerDataBinding=!0},i.prototype.processSparklineData=function(){this.sparklineRenderer.processData(),this.renderSparkline(),this.element.appendChild(this.svgObject),this.setSecondaryElementPosition(),this.trigger("loaded",{sparkline:this.isBlazor?null:this})},i.prototype.renderSparkline=function(){this.renderBorder(),this.createDiv(),this.sparklineRenderer.renderSeries()},i.prototype.createDiv=function(){var e=document.createElement("div");e.id=this.element.id+"_Secondary_Element",e.setAttribute("style","position: relative"),this.element.appendChild(e),this.element.style.display="block",this.element.style.position="relative"},i.prototype.setSecondaryElementPosition=function(){var e=Ft(this.element.id+"_Secondary_Element");if(e){var t=this.element.getBoundingClientRect(),i=Ft(this.element.id+"_svg").getBoundingClientRect();e.style.left=Math.max(i.left-t.left,0)+"px",e.style.top=Math.max(i.top-t.top,0)+"px"}},i.prototype.renderBorder=function(){var e,t=this.containerArea.border.width;(t>0||"transparent"!==this.containerArea.background)&&(e=new sh(this.element.id+"_SparklineBorder",this.sparkTheme.background,this.containerArea.border,1,new nh(t/2,t/2,this.availableSize.width-t,this.availableSize.height-t)),this.svgObject.appendChild(Et(this,e)));var i=this.padding;this.markerSettings.visible.length&&(i.left=0,i.right=0,i.bottom=0,i.top=0),e=new sh(this.element.id+"_sparkline_clip_rect","transparent",{color:"transparent",width:0},1,new nh(i.left,i.top,this.availableSize.width-(i.left+i.right),this.availableSize.height-(i.top+i.bottom)));var r=this.renderer.createClipPath({id:this.element.id+"_sparkline_clip_path"});Et(this,e,r),this.svgObject.appendChild(r)},i.prototype.createSVG=function(){this.removeSvg(),kt(this)},i.prototype.removeSvg=function(){if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}Bt(this.element.id+"_Secondary_Element"),this.sparklineTooltipModule&&this.sparklineTooltipModule.removeTooltipElements()},i.prototype.setCulture=function(){this.intl=new t.Internationalization,this.localeObject=new t.L10n(this.getModuleName(),this.defaultLocalConstants,this.locale)},i.prototype.requiredModules=function(){var e=[];return(this.tooltipSettings.visible||this.tooltipSettings.trackLineSettings.visible)&&e.push({member:"SparklineTooltip",args:[this]}),e},i.prototype.unWireEvents=function(){t.Browser.touchMoveEvent;var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.sparklineMove),t.EventHandler.remove(this.element,e,this.sparklineMouseLeave),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.sparklineMouseEnd),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.sparklineResize)},i.prototype.wireEvents=function(){var e=t.Browser.isPointer?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.sparklineMove,this),t.EventHandler.add(this.element,"click",this.sparklineClick,this),t.EventHandler.add(this.element,e,this.sparklineMouseLeave,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.sparklineMouseEnd,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.sparklineResize.bind(this)),new t.Touch(this.element)},i.prototype.sparklineResize=function(e){var t=this,i={name:"resize",previousSize:this.availableSize,sparkline:this.isBlazor?null:this,currentSize:new oh(0,0)};return this.resizeTo&&clearTimeout(this.resizeTo),this.resizeTo=+setTimeout(function(){if(t.isDestroyed)return void clearTimeout(t.resizeTo);t.unWireEvents(),t.createSVG(),t.refreshing=!0,t.wireEvents(),i.currentSize=t.availableSize,t.trigger("resize",i),t.render()},500),!1},i.prototype.sparklineMove=function(e){this.setSparklineMouseXY(e),this.notify(t.Browser.touchMoveEvent,e);var i={name:"sparklineMouseMove",cancel:!1,sparkline:this.isBlazor?null:this,event:e};this.trigger(i.name,i);var r=this.isPointRegion(e);if(r.isPointRegion){var o={name:"pointRegionMouseMove",cancel:!1,event:e,sparkline:this.isBlazor?null:this,pointIndex:r.pointIndex};this.trigger(o.name,o)}return!1},i.prototype.sparklineClick=function(e){this.setSparklineMouseXY(e);var t={name:"sparklineMouseClick",cancel:!1,sparkline:this.isBlazor?null:this,event:e};this.trigger(t.name,t);var i=this.isPointRegion(e);if(i.isPointRegion){var r={name:"pointRegionMouseClick",cancel:!1,event:e,sparkline:this.isBlazor?null:this,pointIndex:i.pointIndex};this.trigger(r.name,r)}return!1},i.prototype.isPointRegion=function(e){var i=this,r=this.element.id+"_",o=e.target.id.replace(r,"").split("_");if(o[1]===this.type.toLowerCase()){var n=parseInt(o[2],10);return!t.isNullOrUndefined(n)&&!isNaN(n)||"Line"!==this.type&&"Area"!==this.type||this.sparklineRenderer.visiblePoints.forEach(function(e,t){if(Nt(i.mouseX,i.mouseY,new nh(e.x-5,e.y-5,10,10)))return void(n=t)}),{isPointRegion:!0,pointIndex:n}}return{isPointRegion:!1,pointIndex:null}},i.prototype.sparklineMouseEnd=function(e){return this.setSparklineMouseXY(e),this.notify(t.Browser.touchEndEvent,e),!1},i.prototype.sparklineMouseLeave=function(e){return this.setSparklineMouseXY(e),this.notify(t.Browser.isPointer?"pointerleave":"mouseleave",e),!1},i.prototype.setSparklineMouseXY=function(e){var t,i;if(e.type.indexOf("touch")>-1){this.isTouch=!0;var r=e;i=r.changedTouches[0].clientX,t=r.changedTouches[0].clientY}else this.isTouch="touch"===e.pointerType||"2"===e.pointerType,t=e.clientY,i=e.clientX;var o=this.element.getBoundingClientRect(),n=Ft(this.element.id+"_svg").getBoundingClientRect();this.mouseY=t-o.top-Math.max(n.top-o.top,0),this.mouseX=i-o.left-Math.max(n.left-o.left,0)},i.prototype.onPropertyChanged=function(e,t){for(var i=!1,r=!1,o=0,n=Object.keys(e);o<n.length;o++)switch(n[o]){case"xName":case"yName":case"axisSettings":case"rangeBandSettings":case"type":case"valueType":case"enableRtl":r=!0;break;case"dataSource":if(this.isBlazor){this.sparklineRenderer.processDataManager(),this.createSVG();break}r=!0;break;case"border":case"markerSettings":case"dataLabelSettings":case"tooltipSettings":case"startPointColor":case"highPointColor":case"lowPointColor":case"endPointColor":case"negativePointColor":case"theme":i=!0}r?(this.createSVG(),this.sparklineRenderer.processData(),this.refreshSparkline()):i&&(this.createSVG(),this.refreshSparkline())},i.prototype.refreshSparkline=function(){this.renderSparkline(),this.element.appendChild(this.svgObject),this.setSecondaryElementPosition()},i.prototype.getModuleName=function(){return"sparkline"},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.getPersistData=function(){return""},uh([t.Property(null)],i.prototype,"width",void 0),uh([t.Property(null)],i.prototype,"height",void 0),uh([t.Complex({},Gl)],i.prototype,"border",void 0),uh([t.Property("Line")],i.prototype,"type",void 0),uh([t.Property("None")],i.prototype,"rangePadding",void 0),uh([t.Property(null)],i.prototype,"dataSource",void 0),uh([t.Property(null)],i.prototype,"query",void 0),uh([t.Property("Numeric")],i.prototype,"valueType",void 0),uh([t.Property(null)],i.prototype,"xName",void 0),uh([t.Property(null)],i.prototype,"yName",void 0),uh([t.Property("#00bdae")],i.prototype,"fill",void 0),uh([t.Property("")],i.prototype,"highPointColor",void 0),uh([t.Property("")],i.prototype,"lowPointColor",void 0),uh([t.Property("")],i.prototype,"startPointColor",void 0),uh([t.Property("")],i.prototype,"endPointColor",void 0),uh([t.Property("")],i.prototype,"negativePointColor",void 0),uh([t.Property("")],i.prototype,"tiePointColor",void 0),uh([t.Property([])],i.prototype,"palette",void 0),uh([t.Property(1)],i.prototype,"lineWidth",void 0),uh([t.Property(1)],i.prototype,"opacity",void 0),uh([t.Property(null)],i.prototype,"format",void 0),uh([t.Property(!1)],i.prototype,"useGroupingSeparator",void 0),uh([t.Complex({},Zl)],i.prototype,"tooltipSettings",void 0),uh([t.Complex({},ql)],i.prototype,"containerArea",void 0),uh([t.Collection([],$l)],i.prototype,"rangeBandSettings",void 0),uh([t.Complex({},Jl)],i.prototype,"axisSettings",void 0),uh([t.Complex({},eh)],i.prototype,"markerSettings",void 0),uh([t.Complex({},ih)],i.prototype,"dataLabelSettings",void 0),uh([t.Complex({},Kl)],i.prototype,"padding",void 0),uh([t.Property("Material")],i.prototype,"theme",void 0),uh([t.Event()],i.prototype,"loaded",void 0),uh([t.Event()],i.prototype,"load",void 0),uh([t.Event()],i.prototype,"tooltipInitialize",void 0),uh([t.Event()],i.prototype,"seriesRendering",void 0),uh([t.Event()],i.prototype,"axisRendering",void 0),uh([t.Event()],i.prototype,"pointRendering",void 0),uh([t.Event()],i.prototype,"pointRegionMouseMove",void 0),uh([t.Event()],i.prototype,"pointRegionMouseClick",void 0),uh([t.Event()],i.prototype,"sparklineMouseMove",void 0),uh([t.Event()],i.prototype,"sparklineMouseClick",void 0),uh([t.Event()],i.prototype,"dataLabelRendering",void 0),uh([t.Event()],i.prototype,"markerRendering",void 0),uh([t.Event()],i.prototype,"resize",void 0),i=uh([t.NotifyPropertyChanges],i)}(t.Component),yh=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(i[r[o]]=e[r[o]]);return i},mh=function(){function e(e){this.sparkline=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.sparkline.isDestroyed||(this.sparkline.on(t.Browser.isPointer?"pointerleave":"mouseleave",this.mouseLeaveHandler,this),this.sparkline.on(t.Browser.touchMoveEvent,this.mouseMoveHandler,this),this.sparkline.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.mouseLeaveHandler=function(){this.removeTooltipElements()},e.prototype.mouseUpHandler=function(e){this.sparkline.isTouch&&(this.processTooltip(e),this.fadeOut())},e.prototype.fadeOut=function(){clearTimeout(this.clearTooltip),this.clearTooltip=+setTimeout(this.removeTooltipElements.bind(this),5e3)},e.prototype.removeTooltipElements=function(){this.removeTooltip(),this.removeTracker()},e.prototype.mouseMoveHandler=function(e){this.processTooltip(e)},e.prototype.processTooltip=function(e){var i,r=this.sparkline,o=r.sparklineRenderer.visiblePoints,n=r.mouseX,a=r.mouseY;if("Pie"!==r.type)for(var s=t.extend([],[],o).map(function(e){return e.location.x}),l=1/0,h=0,c=void 0,d=s.length;h<d;h++)l>(c=Math.abs(n-s[h]))&&(l=c,i=h);else{var p=e.target.id;i=parseInt(p.split("_pie_")[1],10)}if(isNaN(i)||!Nt(n,a,new nh(0,0,r.availableSize.width,r.availableSize.height)))return this.removeTracker(),void this.removeTooltip();this.pointIndex!==i&&(this.pointIndex=i,this.renderTrackerLine(o[i]),this.renderTooltip(o[i]))},e.prototype.renderTrackerLine=function(e){var i=this.sparkline,r=(i.theme.toLowerCase(),i.tooltipSettings.trackLineSettings),o=i.sparkTheme.trackerLineColor?i.sparkTheme.trackerLineColor:r.color;if(r.visible&&"Pie"!==i.type){var n=Ft(i.element.id+"_sparkline_tracker_g");t.isNullOrUndefined(n)&&(n=i.renderer.createGroup({id:i.element.id+"_sparkline_tracker_g"}),i.svgObject.appendChild(n));var a=Ft(i.element.id+"_sparkline_tracker"),s="M "+e.location.x+" "+i.padding.top+" L "+e.location.x+" "+(i.availableSize.height-i.padding.bottom);if(t.isNullOrUndefined(a)){var l=new ah(i.element.id+"_sparkline_tracker","transparent",r.width,o,1);l.d=s,It(i,l,n)}else a.setAttribute("d",s),a.setAttribute("stroke-width",r.width.toString()),a.setAttribute("stroke",o)}},e.prototype.renderTooltip=function(e){var i=this,r=this.sparkline,o=r.tooltipSettings;if(o.visible){var n=Ft(r.element.id+"_sparkline_tooltip_div");t.isNullOrUndefined(n)&&(n=t.createElement("div",{id:r.element.id+"_sparkline_tooltip_div",styles:"pointer-events: none; position: absolute;z-index:1;"}),Ft(r.element.id+"_Secondary_Element").appendChild(n));var a=e.xVal.toString();"Category"===r.valueType?a=r.dataSource[e.xVal][r.xName]:"DateTime"===r.valueType&&(a=new Date(e.xVal).toDateString());var s=this.getFormat(r.tooltipSettings.format,r,a,this.formatValue(e.yVal,r).toString()),l={x:e.location.x,y:e.location.y};l="Pie"===r.type?{x:e.location.x,y:e.location.y}:l;var h=o.textStyle.color||r.sparkTheme.tooltipFontColor,c=""===o.fill?r.sparkTheme.tooltipFill:o.fill,d={name:"tooltipInitialize",cancel:!1,text:s,textStyle:{size:o.textStyle.size,opacity:r.sparkTheme.tooltipTextOpacity||o.textStyle.opacity,fontWeight:o.textStyle.fontWeight,fontStyle:o.textStyle.fontStyle,fontFamily:r.sparkTheme.fontFamily||o.textStyle.fontFamily,color:h}};if(r.isBlazor){var p=yh(d,[]);d=p}r.trigger("tooltipInitialize",d,function(){i.addTooltip(d,r,c,o,l,n)})}},e.prototype.addTooltip=function(e,r,o,n,a,s,l){var h;if(t.isNullOrUndefined(e))l.cancel,h=l;else{var c=e.cancel;yh(e,["cancel"]);c,h=e}if(!e.cancel){var d=new i.Tooltip({content:h.text,border:n.border,template:n.template,data:r.dataSource[this.pointIndex],fill:o,textStyle:h.textStyle,enableAnimation:!1,location:{x:a.x,y:a.y},shared:!1,availableSize:this.sparkline.availableSize,areaBounds:new nh(0,0,r.availableSize.width,r.availableSize.height),theme:r.theme,blazorTemplate:{name:"TooltipTemplate",parent:r.tooltipSettings}});d.opacity=r.sparkTheme.tooltipFillOpacity||d.opacity,d.appendTo(s)}},e.prototype.getFormat=function(e,i,r,o){if(t.isNullOrUndefined(e)||""===e)return[o];var n=e;return n=n.split("${"+i.xName+"}").join(r).split("${"+i.yName+"}").join(o),[n]},e.prototype.formatValue=function(e,t){return t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(e):e},e.prototype.removeTracker=function(){var e=this.sparkline.element.querySelector("#"+this.sparkline.element.id+"_sparkline_tracker_g");return e?t.remove(e):null},e.prototype.removeTooltip=function(){this.pointIndex=null;var e=this.sparkline.element.querySelector("#"+this.sparkline.element.id+"_sparkline_tooltip_div");return e?t.remove(e):null},e.prototype.getModuleName=function(){return"SparklineTooltip"},e.prototype.destroy=function(e){},e}();return Rr.Inject(Vr,bo,Xr,Do,Vo,Br,Ur,Nn,ho,po,so,fo,go,mo,qr,ro,wo,Io,yn,dn,Or,Tr,Ir,Mn,vn,Pn,xn,Tn,Lo,Mo,Co,ko,Eo,no,Kr,to,Yo,Zo,Wo,Qo,hn,Jo,rn,en,nn,sn,On,Fo,Ln,cn,Dr,Dn,In,Bn,jn,Hn,wn,Cn),ra.Inject(ea,sa,ha,ya,da,va,ua,ba,Hn),za.Inject(ps,Oa,Ur,ho,Tr,Ir,Hn),gh.Inject(mh),Vl.Inject(Hl,jl),ds.Inject(Vr,Xr,Do,Vo,Br,Ur,yn,dn,Tr,vn,Pn,xn,Tn,Lo,Mo,no,Yo,Zo,Wo,Qo,hn,Jo,rn,en,nn,sn,cn,ps,Hn,ls),Ms.Inject(As,Ts),e.RangeColorSetting=Cr,e.CrosshairSettings=Pr,e.ZoomSettings=Lr,e.Chart=Rr,e.Row=wi,e.Column=Si,e.MajorGridLines=Ci,e.MinorGridLines=Pi,e.AxisLine=Li,e.MajorTickLines=Ri,e.MinorTickLines=Mi,e.CrosshairTooltip=Ai,e.Axis=ki,e.VisibleLabels=Ti,e.Double=ni,e.DateTime=Tr,e.Category=Or,e.Logarithmic=Ir,e.DateTimeCategory=Dr,e.NiceInterval=Ar,e.StripLine=Br,e.Connector=Ht,e.Font=Xt,e.Border=Yt,e.Offset=Gt,e.ChartArea=Wt,e.Margin=Ut,e.ContainerPadding=Zt,e.Animation=qt,e.Indexes=Qt,e.CornerRadius=$t,e.Index=Jt,e.EmptyPointSettings=Kt,e.DragSettings=ei,e.TooltipSettings=ti,e.Periods=ii,e.PeriodSelectorSettings=ri,e.LineSeries=Vr,e.ColumnSeries=Xr,e.AreaSeries=Ur,e.BarSeries=qr,e.PolarSeries=Kr,e.RadarSeries=to,e.StackingBarSeries=ro,e.CandleSeries=no,e.StackingColumnSeries=so,e.StepLineSeries=ho,e.StepAreaSeries=po,e.StackingAreaSeries=go,e.StackingStepAreaSeries=mo,e.StackingLineSeries=fo,e.ScatterSeries=bo,e.RangeColumnSeries=wo,e.WaterfallSeries=Co,e.HiloSeries=Lo,e.HiloOpenCloseSeries=Mo,e.RangeAreaSeries=ko,e.SplineRangeAreaSeries=Eo,e.BubbleSeries=Io,e.SplineSeries=Do,e.HistogramSeries=Fo,e.SplineAreaSeries=Vo,e.TechnicalIndicator=br,e.SmaIndicator=Yo,e.EmaIndicator=Wo,e.TmaIndicator=Zo,e.AccumulationDistributionIndicator=Qo,e.AtrIndicator=Jo,e.MomentumIndicator=en,e.RsiIndicator=rn,e.StochasticIndicator=nn,e.BollingerBands=sn,e.MacdIndicator=hn,e.Trendlines=cn,e.sort=p,e.isBreakLabel=u,e.getVisiblePoints=g,e.rotateTextSize=y,e.removeElement=m,e.logBase=v,e.showTooltip=f,e.inside=b,e.withIn=x,e.logWithIn=w,e.withInRange=S,e.sum=C,e.subArraySum=P,e.subtractThickness=L,e.subtractRect=R,e.degreeToLocation=M,e.degreeToRadian=A,e.getRotatedRectangleCoordinates=k,e.isRotatedRectIntersect=T,e.getAngle=O,e.subArray=E,e.valueToCoefficient=I,e.TransformToVisible=z,e.indexFinder=D,e.CoefficientToVector=B,e.valueToPolarCoefficient=F,e.Mean=Oi,e.PolarArc=Ei,e.createTooltip=N,e.createZoomingLabels=V,e.withInBounds=j,e.getValueXByPoint=H,e.getValueYByPoint=X,e.findClipRect=Y,e.firstToLowerCase=G,e.getTransform=W,e.getMinPointsDelta=U,e.getAnimationFunction=Z,e.linear=q,e.markerAnimate=Q,e.animateRectElement=$,e.pathAnimation=J,e.appendClipElement=K,e.triggerLabelRender=ee,e.setRange=te,e.isZoomSet=ie,e.getActualDesiredIntervalsCount=re,e.templateAnimate=oe,e.drawSymbol=ne,e.calculateShapes=ae,e.getRectLocation=se,e.minMax=le,e.getElement=he,e.getTemplateFunction=ce,e.accReactTemplate=de,e.chartReactTemplate=pe,e.createTemplate=ue,e.getFontStyle=ge,e.measureElementRect=ye,e.findlElement=me,e.getPoint=ve,e.appendElement=fe,e.appendChildElement=be,e.getDraggedRectLocation=xe,e.checkBounds=we,e.getLabelText=Se,e.stopTimer=Ce,e.isCollide=Pe,e.isOverlap=Le,e.containsRect=Re,e.calculateRect=Me,e.convertToHexCode=Ae,e.componentToHex=ke,e.convertHexToColor=Te,e.colorNameToHex=_e,e.getSaturationColor=Oe,e.getMedian=Ee,e.calculateLegendShapes=Ie,e.textTrim=ze,e.lineBreakLabelTrim=De,e.stringToNumber=Be,e.redrawElement=Fe,e.animateRedrawElement=Ne,e.textElement=Ve,e.calculateSize=je,e.createSvg=He,e.getTitle=Xe,e.titlePositionX=Ye,e.textWrap=Ge,e.getUnicodeText=We,e.blazorTemplatesReset=Ue,e.CustomizeOption=Ii,e.StackValues=zi,e.RectOption=Di,e.ImageOption=Bi,e.CircleOption=Fi,e.PolygonOption=Ni,e.ChartLocation=Vi,e.LabelLocation=ji,e.Thickness=Hi,e.ColorValue=Xi,e.PointData=Yi,e.AccPointData=Gi,e.ControlPoints=Wi,e.getColorByValue=Ze,e.getGradientColor=qe,e.getPercentageColor=Qe,e.getPercentage=$e,e.Crosshair=dn,e.Tooltip=yn,e.Zoom=vn,e.Selection=xn,e.DataEditing=wn,e.Highlight=Cn,e.DataLabel=Pn,e.ErrorBar=Ln,e.DataLabelSettings=$i,e.MarkerSettings=Ji,e.Points=Ki,e.Trendline=er,e.ErrorBarCapSettings=tr,e.ChartSegment=ir,e.ErrorBarSettings=rr,e.SeriesBase=or,e.Series=nr,e.Legend=Mn,e.ChartAnnotation=Tn,e.ChartAnnotationSettings=pi,e.LabelBorder=ui,e.MultiLevelCategories=gi,e.StripLineSettings=yi,e.MultiLevelLabels=mi,e.ScrollbarSettingsRange=vi,e.ScrollbarSettings=fi,e.BoxAndWhiskerSeries=On,e.MultiColoredAreaSeries=In,e.MultiColoredLineSeries=Dn,e.MultiColoredSeries=Gr,e.MultiLevelLabel=Bn,e.ScrollBar=Nn,e.ParetoSeries=jn,e.Export=Hn,e.AccumulationChart=ra,e.AccumulationAnnotationSettings=Gn,e.AccumulationDataLabelSettings=Wn,e.PieCenter=Un,e.AccPoints=Zn,e.AccumulationSeries=qn,e.getSeriesFromIndex=Ke,e.pointByIndex=et,e.PieSeries=ea,e.FunnelSeries=sa,e.PyramidSeries=ha,e.AccumulationLegend=da,e.AccumulationDataLabel=ua,e.AccumulationTooltip=ya,e.AccumulationSelection=va,e.AccumulationAnnotation=ba,e.StockChart=ds,e.StockChartFont=ja,e.StockChartBorder=Ha,e.StockChartArea=Xa,e.StockMargin=Ya,e.StockChartStripLineSettings=Ga,e.StockEmptyPointSettings=Ua,e.StockChartConnector=Za,e.StockSeries=qa,e.StockChartIndicator=Qa,e.StockChartAxis=$a,e.StockChartRow=Ja,e.StockChartTrendline=Ka,e.StockChartAnnotationSettings=es,e.StockChartIndexes=ts,e.StockEventsSettings=is,e.StockChartLegendSettings=ss,e.StockLegend=ls,e.loaded="loaded",e.legendClick="legendClick",e.load="load",e.animationComplete="animationComplete",e.legendRender="legendRender",e.textRender="textRender",e.pointRender="pointRender",e.sharedTooltipRender="sharedTooltipRender",e.seriesRender="seriesRender",e.axisLabelRender=ai,e.axisLabelClick="axisLabelClick",e.axisRangeCalculated="axisRangeCalculated",e.axisMultiLabelRender="axisMultiLabelRender",e.tooltipRender="tooltipRender",e.chartMouseMove="chartMouseMove",e.chartMouseClick="chartMouseClick",e.pointClick="pointClick",e.pointDoubleClick="pointDoubleClick",e.pointMove="pointMove",e.chartMouseLeave="chartMouseLeave",e.chartMouseDown="chartMouseDown",e.chartMouseUp="chartMouseUp",e.zoomComplete="zoomComplete",e.dragComplete="dragComplete",e.selectionComplete="selectionComplete",e.resized="resized",e.beforeResize="beforeResize",e.beforePrint="beforePrint",e.annotationRender="annotationRender",e.scrollStart="scrollStart",e.scrollEnd="scrollEnd",e.scrollChanged="scrollChanged",e.stockEventRender="stockEventRender",e.multiLevelLabelClick="multiLevelLabelClick",e.dragStart="dragStart",e.drag="drag",e.dragEnd="dragEnd",e.regSub=si,e.regSup=li,e.beforeExport="beforeExport",e.afterExport="afterExport",e.bulletChartMouseClick="bulletChartMouseClick",e.onZooming=hi,e.getSeriesColor=h,e.getThemeColor=c,e.getScrollbarThemeColor=d,e.PeriodSelector=Oa,e.RangeNavigator=za,e.rangeValueToCoefficient=tt,e.getXLocation=it,e.getRangeValueXByPoint=rt,e.getExactData=ot,e.getNearestValue=nt,e.DataPoint=xa,e.getRangeThemeColor=at,e.RangeNavigatorAxis=Pa,e.RangeSeries=Sa,e.RangeSlider=_a,e.RangeNavigatorSeries=Ma,e.ThumbSettings=Aa,e.StyleSettings=ka,e.RangeTooltipSettings=Ta,e.RangeTooltip=ps,e.BulletChart=Ms,e.Range=fs,e.MajorTickLinesSettings=bs,e.MinorTickLinesSettings=xs,e.BulletLabelStyle=ws,e.BulletTooltipSettings=Ss,e.BulletDataLabel=Cs,e.BulletChartLegendSettings=Ps,e.getBulletThemeColor=lt,e.BulletTooltip=As,e.BulletChartLegend=Ts,e.Smithchart=Vl,e.SmithchartMajorGridLines=gl,e.SmithchartMinorGridLines=yl,e.SmithchartAxisLine=ml,e.SmithchartAxis=vl,e.LegendTitle=al,e.LegendLocation=sl,e.LegendItemStyleBorder=ll,e.LegendItemStyle=hl,e.LegendBorder=cl,e.SmithchartLegendSettings=dl,e.SeriesTooltipBorder=Pl,e.SeriesTooltip=Ll,e.SeriesMarkerBorder=Rl,e.SeriesMarkerDataLabelBorder=Ml,e.SeriesMarkerDataLabelConnectorLine=Al,e.SeriesMarkerDataLabel=kl,e.SeriesMarker=Tl,e.SmithchartSeries=_l,e.TooltipRender=jl,e.Subtitle=xl,e.Title=wl,e.SmithchartFont=Es,e.SmithchartMargin=Is,e.SmithchartBorder=zs,e.SmithchartRect=Ds,e.LabelCollection=Bs,e.LegendSeries=Fs,e.LabelRegion=Ns,e.HorizontalLabelCollection=Vs,e.RadialLabelCollections=js,e.LineSegment=Hs,e.PointRegion=Xs,e.Point=Ys,e.ClosestPoint=Gs,e.MarkerOptions=Ws,e.SmithchartLabelPosition=Us,e.Direction=Zs,e.DataLabelTextOptions=qs,e.LabelOption=Qs,e.SmithchartSize=$s,e.GridArcPoints=Js,e.smithchartBeforePrint="beforePrint",e.SmithchartLegend=Hl,e.Sparkline=gh,e.SparklineTooltip=mh,e.SparklineBorder=Gl,e.SparklineFont=Wl,e.TrackLineSettings=Ul,e.SparklineTooltipSettings=Zl,e.ContainerArea=ql,e.LineSettings=Ql,e.RangeBandSettings=$l,e.AxisSettings=Jl,e.Padding=Kl,e.SparklineMarkerSettings=eh,e.LabelOffset=th,e.SparklineDataLabelSettings=ih,e}({},ej.base,ej.svgbase,ej.data,ej.pdfexport,ej.navigations,ej.calendars,ej.splitbuttons,ej.buttons),this.ejs=ej;
- /*!
- * filename: ej2-office-chart.min.js
- * version : 19.2.44
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.officechart=function(e,t,r,a){"use strict";t.Chart.Inject(t.AreaSeries,t.StackingAreaSeries,t.BarSeries,t.PieSeries,t.StackingBarSeries,t.PolarSeries,t.ScatterSeries,t.BubbleSeries,t.RadarSeries,t.DateTime,t.ColumnSeries,t.StackingColumnSeries,t.LineSeries,t.StackingLineSeries,t.ErrorBar,t.Trendlines,t.SplineSeries,t.DataLabel,t.Category,t.Legend,t.Tooltip,t.Export),t.AccumulationChart.Inject(t.AccumulationLegend,t.PieSeries,t.AccumulationTooltip,t.AccumulationDataLabel);var i=function(){function e(){}return e.prototype.chartRender=function(e){this.chartType=e.chartType,this.isPieType="Pie"===this.chartType||"Doughnut"===this.chartType;var r=this.chartData(e,this.chartType),a={enableAnimation:!1,width:e.width*(96/72)+"px",height:e.height*(96/72)+"px"};this.isPieType?this.chart=new t.AccumulationChart(a):(this.chart=new t.Chart(a),this.chart.primaryXAxis=this.chartPrimaryXAxis(e.chartPrimaryCategoryAxis,this.chartType),this.chart.primaryYAxis=this.chartPrimaryYAxis(e.chartPrimaryValueAxis)),this.chart.series=this.chartSeries(e.chartSeries,r,this.chartType);for(var i=0;i<this.chart.series.length;i++)this.chart.series[i].animation.enable=!1;this.chart.title=e.chartTitle,this.chart.legendSettings=this.parseChartLegend(e.chartLegend)},e.prototype.convertChartToImage=function(e,t,r){var i=this;return new Promise(function(n,s){var o=0,c=0,h=i.getControlsValue([e],t,r);o=o||h.width,c=c||h.height;var p=a.createElement("canvas"),l=Math.max(1,window.devicePixelRatio||1);p.width=o*l,p.height=c*l,p.style.width=o+"px",p.style.height=c+"px";var u=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(h.svg)],{type:"image/svg+xml"})),d=new Image,m=p.getContext("2d");m.scale(l,l),d.onload=function(){m.drawImage(d,0,0),window.URL.revokeObjectURL(u);var e=p.toDataURL("image/png");n(e)},d.onerror=function(){s("Invalid data")},d.src=u})},e.prototype.getControlsValue=function(e,t,a){var i=0,n=0,s="",o=new r.SvgRenderer("").createSvg({id:"Image_Export",width:200,height:200});return e.map(function(e){if(e){var r=e.svgObject.cloneNode(!0),a=e.renderer.createGroup({style:"transform: translateY("+n+"px)"});a.appendChild(r),i=Math.max(e.availableSize.width,t),n+=e.availableSize.height,s+=e.svgObject.outerHTML,o.appendChild(a)}}),o.setAttribute("width",i+""),o.setAttribute("height",n+""),{width:i,height:n,svg:o}},e.prototype.officeChartType=function(e){var t="";switch(e){case"Area_Stacked":t="StackingArea";break;case"Area":t="Area";break;case"Area_Stacked_100":t="StackingArea100";break;case"Bar_Clustered":t="Bar";break;case"Bar_Stacked":t="StackingBar";break;case"Bar_Stacked_100":t="StackingBar100";break;case"Column_Clustered":t="Column";break;case"Column_Stacked":t="StackingColumn";break;case"Column_Stacked_100":t="StackingColumn100";break;case"Scatter_Markers":t="Scatter";break;case"Bubble":t="Bubble";break;case"Doughnut":case"Pie":t="Pie";break;case"Line_Stacked_100":case"Line_Markers_Stacked_100":t="StackingLine100";break;case"Line":case"Line_Markers":t="Line";break;case"Line_Stacked":case"Line_Markers_Stacked":t="StackingLine"}return t},e.prototype.chartSeries=function(e,t,r){for(var a=[],i=0;i<e.length;i++){var n=e[i],s=this.writeChartSeries(n,t,r,i);a.push(s)}return a},e.prototype.writeChartSeries=function(e,t,r,a){var i,n=this.officeChartType(r),s={};s.type=n,s.dataSource=t,s.name=e.seriesName,s.xName="x",s.yName="y"+a,"Bubble"===r&&(s.size="size"+a);var o=e.dataPoints[0];if(this.isPieType?(s.pointColorMapping="color","Doughnut"===r&&(s.innerRadius="75%",s.radius="70%")):(i=this.chartFormat(o,n),s.fill=i),"Line_Markers"!==r&&"Line_Markers_Stacked"!==r&&"Line_Markers_Stacked_100"!==r||(s.marker={visible:!0}),e.hasOwnProperty("dataLabel"))if(this.isPieType)s.dataLabel=this.parseDataLabels(e.dataLabel);else{var c={};c.dataLabel=this.parseDataLabels(e.dataLabel),s.marker=c}if(e.hasOwnProperty("errorBar")){var h=e.errorBar;s.errorBar=this.parseErrorBars(h)}if(e.hasOwnProperty("trendLines"))for(var p=e.trendLines,l=[],u=0;u<p.length;u++){var d=p[u],m={};m=this.parseTrendLines(d,i),l.push(m),s.trendlines=l}return s},e.prototype.parseDataLabels=function(e){var t={};return t.visible=!0,this.isPieType?"BestFit"===e.position||"Inside"===e.position?t.position="Inside":t.position="Outside":t.position=this.dataLabelPosition(e.position),t},e.prototype.parseErrorBars=function(e){var t={};return t.visible=!0,t.type=e.type,t.direction=e.direction,"Cap"===e.endStyle?t.errorBarCap={width:1}:t.errorBarCap={width:0},t},e.prototype.parseTrendLines=function(e,t){var r={};return r.type=e.type,r.name=e.name,r.forwardForecast=e.forward,r.backwardForecast=e.backward,"NaN"===e.intercept?r.intercept=0:r.intercept=e.intercept,r.fill=t,r},e.prototype.dataLabelPosition=function(e){var t="Auto";switch(e){case"Outside":t="Outer";break;case"Center":t="Middle";break;case"Inside":t="Top";break;case"OutsideBase":t="Bottom"}return t},e.prototype.chartFormat=function(e,t){var r=e;return"Line"===t||"StackingLine"===t||"StackingLine100"===t?r.line.rgb:r.fill.rgb},e.prototype.chartPrimaryXAxis=function(e,t){var r={};e.chartTitle&&(r.title=e.chartTitle);var a=this.chartCategoryType(e.categoryType);return r.valueType=a,"DateTime"===a&&(r.intervalType="Days",r.labelFormat="M/d/yyyy",r.edgeLabelPlacement="Shift"),"Scatter_Markers"!==t&&"Bubble"!==t||this.checkAndSetAxisValue(r,e),e.hasMajorGridLines&&(r.majorGridLines={width:1}),e.hasMinorGridLines&&(r.minorTicksPerInterval=4),r},e.prototype.chartCategoryType=function(e){var t="";switch(e){case"Time":t="DateTime";break;case"Automatic":t="Category"}return t},e.prototype.chartPrimaryYAxis=function(e){var t={};return e.chartTitle&&(t.title=e.chartTitle),this.checkAndSetAxisValue(t,e),e.hasMajorGridLines&&(t.majorGridLines={width:1}),e.hasMinorGridLines&&(t.minorTicksPerInterval=4),t},e.prototype.checkAndSetAxisValue=function(e,t){0!==t.minimumValue&&(e.minimum=t.minimumValue),0!==t.maximumValue&&(e.maximum=t.maximumValue),0!==t.majorUnit&&(e.interval=t.majorUnit)},e.prototype.chartData=function(e,t){for(var r=e.chartCategory,a=[],i=0;i<r.length;i++){var n=r[i],s=this.chartPlotData(n,e,t,i);a.push(s)}return a},e.prototype.chartPlotData=function(e,t,r,a){var i={},n=t.chartSeries;if("m/d/yyyy"===t.chartPrimaryCategoryAxis.numberFormat){var s=e.categoryXName.split("/"),o=Number(s[0]),c=Number(s[1]),h=Number(s[2]);i.x=new Date(h,o-1,c)}else i.x=e.categoryXName;for(var p=0;p<n.length;p++){var l=e.chartData[p];if(i["y"+p]=l.yValue,"Bubble"===r&&(i["size"+p]=l.size),"Pie"===t.chartType||"Doughnut"===t.chartType){var u=n[p].dataPoints[a];i.color=this.chartFormat(u,r)}}return i},e.prototype.parseChartLegend=function(e){var t={},r=e.position;return"Corner"===r&&(r="right"),r?(t.visible=!0,t.position=r.charAt(0).toUpperCase()+r.slice(1)):t.visible=!1,t},e.prototype.destroy=function(){this.chart&&this.chart.destroy(),this.chart=void 0},e}();return e.ChartComponent=i,e}({},ej.charts,ej.svgbase,ej.base),this.ejs=ej;
- /*!
- * filename: ej2-calendars.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.calendars=function(e,t,i,s,a,n){"use strict";var r=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),l=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},o="e-other-month",h="e-calendar",u="e-disabled",d="e-overlay",p="e-selected",c="e-focused-date",m=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return r(i,e),l([t.Property("day")],i.prototype,"day",void 0),l([t.Property("month")],i.prototype,"month",void 0),l([t.Property("year")],i.prototype,"year",void 0),l([t.Property("hour")],i.prototype,"hour",void 0),l([t.Property("minute")],i.prototype,"minute",void 0),l([t.Property("second")],i.prototype,"second",void 0),l([t.Property("day of the week")],i.prototype,"dayOfTheWeek",void 0),i}(t.ChildProperty),v=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.effect="",s.isPopupClicked=!1,s.isDateSelected=!0,s.isTodayClicked=!1,s.preventChange=!1,s.isAngular=!1,s}return r(i,e),i.prototype.render=function(){this.rangeValidation(this.min,this.max),this.calendarEleCopy=this.element.cloneNode(!0),"Islamic"===this.calendarMode&&(+this.min.setSeconds(0)==+new Date(1900,0,1,0,0,0)&&(this.min=new Date(1944,2,18)),+this.max==+new Date(2099,11,31)&&(this.max=new Date(2069,10,16))),this.globalize=new t.Internationalization(this.locale),(t.isNullOrUndefined(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.todayDisabled=!1,this.todayDate=new Date((new Date).setHours(0,0,0,0)),"calendar"===this.getModuleName()?(this.element.classList.add(h),this.enableRtl&&this.element.classList.add("e-rtl"),t.Browser.isDevice&&this.element.classList.add("e-device"),t.attributes(this.element,{"data-role":"calendar"}),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.setAttribute("tabindex",this.tabIndex)):(this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(h),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),t.Browser.isDevice&&this.calendarElement.classList.add("e-device"),t.attributes(this.calendarElement,{role:"calendar"})),this.createHeader(),this.createContent(),this.wireEvents()},i.prototype.rangeValidation=function(e,i){t.isNullOrUndefined(e)&&this.setProperties({min:new Date(1900,0,1)},!0),t.isNullOrUndefined(i)&&this.setProperties({max:new Date(2099,11,31)},!0)},i.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",altUpArrow:"alt+uparrow",spacebar:"space",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"},this.defaultKeyConfigs},i.prototype.validateDate=function(e){this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.currentDate=this.currentDate?this.currentDate:new Date((new Date).setHours(0,0,0,0)),!t.isNullOrUndefined(e)&&this.min<=this.max&&e>=this.min&&e<=this.max&&(this.currentDate=new Date(this.checkValue(e)))},i.prototype.setOverlayIndex=function(e,i,s,a){if(a&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(e)){var n=parseInt(i.style.zIndex,10)?parseInt(i.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},i.prototype.minMaxUpdate=function(e){+this.min<=+this.max?t.removeClass([this.element],d):(this.setProperties({min:this.min},!0),t.addClass([this.element],d)),this.min=t.isNullOrUndefined(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=t.isNullOrUndefined(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,+this.min<=+this.max&&e&&+e<=+this.max&&+e>=+this.min?this.currentDate=new Date(this.checkValue(e)):+this.min<=+this.max&&!e&&+this.currentDate>+this.max?this.currentDate=new Date(this.checkValue(this.max)):+this.currentDate<+this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},i.prototype.createHeader=function(){var e={"aria-disabled":"false","aria-label":"previous month"},i={"aria-disabled":"false","aria-label":"next month"},s={"aria-atomic":"true","aria-live":"assertive","aria-label":"title"};this.headerElement=this.createElement("div",{className:"e-header"});var a=this.createElement("div",{className:"e-icon-container"});this.previousIcon=this.createElement("button",{className:"e-prev",attrs:{type:"button"}}),t.rippleEffect(this.previousIcon,{duration:400,selector:".e-prev",isCenterRipple:!0}),t.attributes(this.previousIcon,e),this.nextIcon=this.createElement("button",{className:"e-next",attrs:{type:"button"}}),t.rippleEffect(this.nextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),t.attributes(this.nextIcon,i),this.headerTitleElement=this.createElement("div",{className:"e-day e-title"}),t.attributes(this.headerTitleElement,s),this.headerElement.appendChild(this.headerTitleElement),this.previousIcon.appendChild(this.createElement("span",{className:"e-date-icon-prev e-icons"})),this.nextIcon.appendChild(this.createElement("span",{className:"e-date-icon-next e-icons"})),a.appendChild(this.previousIcon),a.appendChild(this.nextIcon),this.headerElement.appendChild(a),"calendar"===this.getModuleName()?this.element.appendChild(this.headerElement):this.calendarElement.appendChild(this.headerElement),this.adjustLongHeaderSize()},i.prototype.createContent=function(){this.contentElement=this.createElement("div",{className:"e-content"}),this.table=this.createElement("table",{attrs:{tabIndex:"0",role:"grid","aria-activedescendant":""}}),"calendar"===this.getModuleName()?this.element.appendChild(this.contentElement):this.calendarElement.appendChild(this.contentElement),this.contentElement.appendChild(this.table),this.createContentHeader(),this.createContentBody(),this.showTodayButton&&this.createContentFooter()},i.prototype.getCultureValues=function(){var e,i=[],s=(t.isBlazor()?"days.":"days.stand-alone.")+this.dayHeaderFormat.toLowerCase();e="en"===this.locale||"en-US"===this.locale?t.getValue(s,t.getDefaultDateObject()):this.getCultureObjects(t.cldrData,""+this.locale);for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];i.push(t.getValue(r,e))}return i},i.prototype.toCapitalize=function(e){return!t.isNullOrUndefined(e)&&e.length?e[0].toUpperCase()+e.slice(1):e},i.prototype.createContentHeader=function(){"calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content .e-week-header")[0])||t.detach(this.element.querySelectorAll(".e-content .e-week-header")[0]):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0])||t.detach(this.calendarElement.querySelectorAll(".e-content .e-week-header")[0]);var e="";(this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:0},!0),this.tableHeadElement=this.createElement("thead",{className:"e-week-header"}),this.weekNumber&&(e+='<th class="e-week-number"></th>',"calendar"===this.getModuleName()?t.addClass([this.element],"e-week-number"):t.addClass([this.calendarElement],"e-week-number"));for(var i=this.shiftArray(this.getCultureValues().length>0&&this.getCultureValues(),this.firstDayOfWeek),s=0;s<=6;s++)e+='<th class="">'+this.toCapitalize(i[s])+"</th>";e="<tr>"+e+"</tr>",this.tableHeadElement.innerHTML=e,this.table.appendChild(this.tableHeadElement)},i.prototype.createContentBody=function(){switch("calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content tbody")[0])||t.detach(this.element.querySelectorAll(".e-content tbody")[0]):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content tbody")[0])||t.detach(this.calendarElement.querySelectorAll(".e-content tbody")[0]),this.start){case"Year":this.renderYears();break;case"Decade":this.renderDecades();break;default:this.renderMonths()}},i.prototype.updateFooter=function(){this.todayElement.textContent=this.l10.getConstant("today"),this.todayElement.setAttribute("aria-label",this.l10.getConstant("today"))},i.prototype.createContentFooter=function(){if(this.showTodayButton){var e=new Date(+this.min),i=new Date(+this.max),s={today:"Today"};this.globalize=new t.Internationalization(this.locale),this.l10=new t.L10n(this.getModuleName(),s,this.locale),this.todayElement=this.createElement("button",{attrs:{role:"button"}}),t.rippleEffect(this.todayElement),this.updateFooter(),t.addClass([this.todayElement],["e-btn","e-today","e-flat","e-primary","e-css"]),+new Date(e.setHours(0,0,0,0))<=+this.todayDate&&+this.todayDate<=+new Date(i.setHours(0,0,0,0))&&!this.todayDisabled||t.addClass([this.todayElement],u),this.footer=this.createElement("div",{className:"e-footer-container"}),this.footer.appendChild(this.todayElement),"calendar"===this.getModuleName()&&this.element.appendChild(this.footer),"datepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),"datetimepicker"===this.getModuleName()&&this.calendarElement.appendChild(this.footer),this.todayElement.classList.contains(u)||t.EventHandler.add(this.todayElement,"click",this.todayButtonClick,this)}},i.prototype.wireEvents=function(e,i,s,a){t.isBlazor()&&i?(this.element=document.getElementById(e),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,s),this.blazorRef=i,this.serverModuleName=a):(t.EventHandler.add(this.headerTitleElement,"click",this.navigateTitle,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs)),"calendar"===this.getModuleName()?this.keyboardModule=new t.KeyboardEvents(this.element,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs}):this.keyboardModule=new t.KeyboardEvents(this.calendarElement,{eventName:"keydown",keyAction:this.keyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},i.prototype.dateWireEvents=function(e,i,s,a){this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,s),this.blazorRef=i,this.serverModuleName=a},i.prototype.todayButtonClick=function(e,t,i){this.showTodayButton&&(this.currentView()===this.depth?this.effect="":this.effect="e-zoomin",this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.navigateTo(this.depth,new Date(this.checkValue(t)),i):this.navigateTo("Month",new Date(this.checkValue(t)),i))},i.prototype.resetCalendar=function(){this.calendarElement&&t.detach(this.calendarElement),this.tableBodyElement&&t.detach(this.tableBodyElement),this.table&&t.detach(this.table),this.tableHeadElement&&t.detach(this.tableHeadElement),this.nextIcon&&t.detach(this.nextIcon),this.previousIcon&&t.detach(this.previousIcon),this.footer&&t.detach(this.footer),this.todayElement=null,this.renderDayCellArgs=null,this.calendarElement=this.tableBodyElement=this.footer=this.tableHeadElement=this.nextIcon=this.previousIcon=this.table=null},i.prototype.checkDeviceMode=function(e){t.Browser.isDevice&&t.isBlazor()&&e&&e.invokeMethodAsync("OnDevice",!0)},i.prototype.keyActionHandle=function(e,i,s){t.isBlazor()&&this.blazorRef&&(e.preventDefault(),this.tableBodyElement||(this.element=t.closest(e.target,".e-calendar"),this.tableBodyElement=this.element.querySelector("tbody")),s=!1);var a,n=this.tableBodyElement.querySelector("tr td.e-focused-date");if(a=s?t.isNullOrUndefined(n)||+i!==parseInt(n.getAttribute("id").split("_")[0],10)?this.tableBodyElement.querySelector("tr td.e-selected"):n:this.tableBodyElement.querySelector("tr td.e-selected"),t.isBlazor()&&this.blazorRef){this.tableBodyElement.focus();var r=e.target,l={Action:e.action,Key:e.key,Events:e,SelectDate:a?a.id:null,FocusedDate:n?n.id:null,classList:a?a.classList.toString():n?n.classList.toString():"e-cell",Id:n?n.id:a?a.id:null,TargetClassList:r.classList.toString()};this.blazorRef.invokeMethodAsync("OnCalendarKeyboardEvent",l),r.classList.contains("e-today")&&(r.blur(),this.tableBodyElement.focus()),"sf.calendars.Calendar"===this.serverModuleName&&(this.tableBodyElement=null)}else{var o=this.getViewNumber(this.currentView()),h=this.getViewNumber(this.depth),d=o===h&&this.getViewNumber(this.start)>=h;switch(this.effect="",e.action){case"moveLeft":this.keyboardNavigate(-1,o,e,this.max,this.min),e.preventDefault();break;case"moveRight":this.keyboardNavigate(1,o,e,this.max,this.min),e.preventDefault();break;case"moveUp":0===o?this.keyboardNavigate(-7,o,e,this.max,this.min):this.keyboardNavigate(-4,o,e,this.max,this.min),e.preventDefault();break;case"moveDown":0===o?this.keyboardNavigate(7,o,e,this.max,this.min):this.keyboardNavigate(4,o,e,this.max,this.min),e.preventDefault();break;case"select":if(e.target===this.todayElement)this.todayButtonClick(e,i);else{var p=t.isNullOrUndefined(n)?a:n;if(!t.isNullOrUndefined(p)&&!p.classList.contains(u))if(d){var c=new Date(parseInt(""+p.id,0));this.selectDate(e,c,p)}else this.contentClick(null,--o,p,i)}break;case"controlUp":this.title(),e.preventDefault();break;case"controlDown":t.isNullOrUndefined(n)&&(t.isNullOrUndefined(a)||d)||this.contentClick(null,--o,n||a,i),e.preventDefault();break;case"home":this.currentDate=this.firstDay(this.currentDate),t.detach(this.tableBodyElement),0===o?this.renderMonths(e):1===o?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"end":this.currentDate=this.lastDay(this.currentDate,o),t.detach(this.tableBodyElement),0===o?this.renderMonths(e):1===o?this.renderYears(e):this.renderDecades(e),e.preventDefault();break;case"pageUp":this.addMonths(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"pageDown":this.addMonths(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageUp":this.addYears(this.currentDate,-1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"shiftPageDown":this.addYears(this.currentDate,1),this.navigateTo("Month",this.currentDate),e.preventDefault();break;case"controlHome":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),0,1)),e.preventDefault();break;case"controlEnd":this.navigateTo("Month",new Date(this.currentDate.getFullYear(),11,31)),e.preventDefault()}"calendar"===this.getModuleName()&&this.table.focus()}},i.prototype.keyboardNavigate=function(e,i,s,a,n){var r=new Date(this.checkValue(this.currentDate));switch(i){case 2:this.addYears(this.currentDate,e),this.isMonthYearRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderDecades(s)):this.currentDate=r;break;case 1:this.addMonths(this.currentDate,e),this.calendarMode,this.isMonthYearRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderYears(s)):this.currentDate=r;break;case 0:this.addDay(this.currentDate,e,s,a,n),this.isMinMaxRange(this.currentDate)?(t.detach(this.tableBodyElement),this.renderMonths(s)):this.currentDate=r}},i.prototype.preRender=function(e){var t=this;this.navigatePreviousHandler=this.navigatePrevious.bind(this),this.navigateNextHandler=this.navigateNext.bind(this),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.navigateHandler=function(e){t.triggerNavigate(e)}},i.prototype.minMaxDate=function(e){var t=new Date(new Date(+e).setHours(0,0,0,0)),i=new Date(new Date(+this.min).setHours(0,0,0,0)),s=new Date(new Date(+this.max).setHours(0,0,0,0));return+t!=+i&&+t!=+s||(+e<+this.min&&(e=new Date(+this.min)),+e>+this.max&&(e=new Date(+this.max))),e},i.prototype.renderMonths=function(e,t,i){var s,a=this.weekNumber?8:7;s="Gregorian"===this.calendarMode?this.renderDays(this.currentDate,t,null,null,i):this.islamicModule.islamicRenderDays(this.currentDate,t),this.createContentHeader(),"Gregorian"===this.calendarMode?this.renderTemplate(s,a,"e-month",e,t):this.islamicModule.islamicRenderTemplate(s,a,"e-month",e,t)},i.prototype.renderDays=function(e,i,s,a,n){var r,l=[],h=n?new Date(+e):this.getDate(new Date,this.timezone),c=new Date(this.checkValue(e)),m=c.getMonth();this.titleUpdate(e,"days");var v=c;for(c=new Date(v.getFullYear(),v.getMonth(),0,v.getHours(),v.getMinutes(),v.getSeconds(),v.getMilliseconds());c.getDay()!==this.firstDayOfWeek;)this.setStartDate(c,-864e5);for(var f=0;f<42;++f){var y=this.createElement("td",{className:"e-cell"}),g=this.createElement("span");if(f%7==0&&this.weekNumber){var b="FirstDay"===this.weekRule?6:"FirstFourDayWeek"===this.weekRule?3:0,D=new Date(c.getFullYear(),c.getMonth(),c.getDate()+b);g.textContent=""+this.getWeek(D),y.appendChild(g),t.addClass([y],"e-week-number"),l.push(y)}r=new Date(+c),c=this.minMaxDate(c);var E={type:"dateTime",skeleton:t.isBlazor()?"D":"full"},C=this.globalize.parseDate(this.globalize.formatDate(c,E),E),k=this.dayCell(c),M=this.globalize.formatDate(c,{type:"date",skeleton:t.isBlazor()?"D":"full"}),w=this.createElement("span");w.textContent=this.globalize.formatDate(c,{format:"d",type:"date",skeleton:t.isBlazor()?"d":"yMd"});var V=this.min>c||this.max<c;V?(t.addClass([k],u),t.addClass([k],d)):w.setAttribute("title",""+M),m!==c.getMonth()&&t.addClass([k],o),0!==c.getDay()&&6!==c.getDay()||t.addClass([k],"e-weekend"),k.appendChild(w),this.renderDayCellArgs={date:c,isDisabled:!1,element:k,isOutOfRange:V};var O=this.renderDayCellArgs;if(this.renderDayCellEvent(O),O.isDisabled){var N=new Date(this.checkValue(i)),I=new Date(this.checkValue(O.date));if(s){if(!t.isNullOrUndefined(a)&&a.length>0)for(var S=0;S<a.length;S++)(H=+new Date(this.globalize.formatDate(O.date,{type:"date",skeleton:t.isBlazor()?"d":"yMd"})))===(B=+new Date(this.globalize.formatDate(a[S],{type:"date",skeleton:t.isBlazor()?"d":"yMd"})))&&(a.splice(S,1),S=-1)}else N&&+N==+I&&this.setProperties({value:null},!0)}this.renderDayCellArgs.isDisabled&&!k.classList.contains(p)&&(t.addClass([k],u),t.addClass([k],d),+this.renderDayCellArgs.date==+this.todayDate&&(this.todayDisabled=!0));var A=k.classList.contains(o),x=k.classList.contains(u);if(x||t.EventHandler.add(k,"click",this.clickHandler,this),!s||t.isNullOrUndefined(a)||x)!x&&this.getDateVal(c,i)&&t.addClass([k],p);else{for(var T=0;T<a.length;T++){var P="Gregorian"===this.calendarMode?"gregorian":"islamic",U={format:this.getFromatStringValue(),type:"date",skeleton:"short",calendar:P},H=this.globalize.formatDate(c,U),B=this.globalize.formatDate(a[T],U);H===B&&this.getDateVal(c,a[T])||this.getDateVal(c,i)?t.addClass([k],p):this.updateFocus(A,x,c,k,e)}a.length<=0&&this.updateFocus(A,x,c,k,e)}this.updateFocus(A,x,c,k,e),C.getFullYear()===h.getFullYear()&&C.getMonth()===h.getMonth()&&C.getDate()===h.getDate()&&t.addClass([k],"e-today"),l.push(this.renderDayCellArgs.element),c=new Date(+r),this.addDay(c,1,null,this.max,this.min)}return l},i.prototype.updateFocus=function(e,i,s,a,n){n.getDate()!==s.getDate()||e||i?(n>=this.max&&parseInt(a.id,0)===+this.max&&!e&&!i&&t.addClass([a],c),n<=this.min&&parseInt(a.id,0)===+this.min&&!e&&!i&&t.addClass([a],c)):t.addClass([a],c)},i.prototype.renderYears=function(e,i){this.removeTableHeadElement();var s=[],a=t.isNullOrUndefined(i),n=new Date(this.checkValue(this.currentDate)),r=n.getMonth(),l=n.getFullYear(),o=n,h=o.getFullYear(),d=new Date(this.checkValue(this.min)).getFullYear(),m=new Date(this.checkValue(this.min)).getMonth(),v=new Date(this.checkValue(this.max)).getFullYear(),f=new Date(this.checkValue(this.max)).getMonth();o.setMonth(0),this.titleUpdate(this.currentDate,"months"),o.setDate(1);for(var y=0;y<12;++y){var g=this.dayCell(o),b=this.createElement("span"),D=i&&i.getMonth()===o.getMonth(),E=i&&i.getFullYear()===l&&D;b.textContent=this.toCapitalize(this.globalize.formatDate(o,{format:t.isBlazor()?"MMM":null,type:"dateTime",skeleton:"MMM"})),this.min&&(h<d||y<m&&h===d)||this.max&&(h>v||y>f&&h>=v)?t.addClass([g],u):!a&&E?t.addClass([g],p):o.getMonth()===r&&this.currentDate.getMonth()===r&&t.addClass([g],c),o.setDate(1),o.setMonth(o.getMonth()+1),g.classList.contains(u)||t.EventHandler.add(g,"click",this.clickHandler,this),g.appendChild(b),s.push(g)}this.renderTemplate(s,4,"e-year",e,i)},i.prototype.renderDecades=function(e,i){this.removeTableHeadElement();var s=[],a=new Date(this.checkValue(this.currentDate));a.setMonth(0),a.setDate(1);var n=a.getFullYear(),r=new Date(a.setFullYear(n-n%10)),l=new Date(a.setFullYear(n-n%10+9)),o=r.getFullYear(),h=l.getFullYear(),d=this.globalize.formatDate(r,{format:t.isBlazor()?"yyyy":null,type:"dateTime",skeleton:"y"}),m=this.globalize.formatDate(l,{format:t.isBlazor()?"yyyy":null,type:"dateTime",skeleton:"y"});this.headerTitleElement.textContent=d+" - "+m;for(var v=new Date(n-n%10-1,0,1).getFullYear(),f=0;f<12;++f){var y=v+f;a.setFullYear(y);var g=this.dayCell(a);t.attributes(g,{role:"gridcell"});var b=this.createElement("span");b.textContent=this.globalize.formatDate(a,{format:t.isBlazor()?"yyyy":null,type:"dateTime",skeleton:"y"}),y<o||y>h?(t.addClass([g],"e-other-year"),t.isNullOrUndefined(i)||a.getFullYear()!==i.getFullYear()||t.addClass([g],p),(y<new Date(this.checkValue(this.min)).getFullYear()||y>new Date(this.checkValue(this.max)).getFullYear())&&t.addClass([g],u)):y<new Date(this.checkValue(this.min)).getFullYear()||y>new Date(this.checkValue(this.max)).getFullYear()?t.addClass([g],u):t.isNullOrUndefined(i)||a.getFullYear()!==i.getFullYear()?a.getFullYear()!==this.currentDate.getFullYear()||g.classList.contains(u)||t.addClass([g],c):t.addClass([g],p),g.classList.contains(u)||t.EventHandler.add(g,"click",this.clickHandler,this),g.appendChild(b),s.push(g)}this.renderTemplate(s,4,"e-decade",e,i)},i.prototype.dayCell=function(e){var i="Gregorian"===this.calendarMode?"gregorian":"islamic",s={skeleton:t.isBlazor()?"F":"full",type:"dateTime",calendar:i},a=this.globalize.parseDate(this.globalize.formatDate(e,s),s).valueOf(),n={className:"e-cell",attrs:{id:""+t.getUniqueID(""+a),"aria-selected":"false",role:"gridcell"}};return this.createElement("td",n)},i.prototype.firstDay=function(e){var t="Decade"!==this.currentView()?this.tableBodyElement.querySelectorAll("td:not(."+o):this.tableBodyElement.querySelectorAll("td:not(.e-other-year");if(t.length)for(var i=0;i<t.length;i++)if(!t[i].classList.contains(u)){e=new Date(parseInt(t[i].id,0));break}return e},i.prototype.lastDay=function(e,t){var i=new Date(e.getFullYear(),e.getMonth()+1,0);if(2!==t){var s=Math.abs(i.getTimezoneOffset()-this.firstDay(e).getTimezoneOffset());return s&&i.setHours(this.firstDay(e).getHours()+s/60),this.findLastDay(i)}return this.findLastDay(this.firstDay(i))},i.prototype.checkDateValue=function(e){return!t.isNullOrUndefined(e)&&e instanceof Date&&!isNaN(+e)?e:null},i.prototype.findLastDay=function(e){var t="Decade"===this.currentView()?this.tableBodyElement.querySelectorAll("td:not(.e-other-year"):this.tableBodyElement.querySelectorAll("td:not(."+o);if(t.length)for(var i=t.length-1;i>=0;i--)if(!t[i].classList.contains(u)){e=new Date(parseInt(t[i].id,0));break}return e},i.prototype.removeTableHeadElement=function(){"calendar"===this.getModuleName()?t.isNullOrUndefined(this.element.querySelectorAll(".e-content table thead")[0])||t.detach(this.tableHeadElement):t.isNullOrUndefined(this.calendarElement.querySelectorAll(".e-content table thead")[0])||t.detach(this.tableHeadElement)},i.prototype.renderTemplate=function(e,i,s,a,n){var r,l=this.getViewNumber(this.currentView());this.tableBodyElement=this.createElement("tbody"),this.table.appendChild(this.tableBodyElement),t.removeClass([this.contentElement,this.headerElement],["e-month","e-decade","e-year"]),t.addClass([this.contentElement,this.headerElement],[s]);for(var h=i,u=0,d=0;d<e.length/i;++d){for(r=this.createElement("tr",{attrs:{role:"row"}}),u=0+u;u<h;u++)e[u].classList.contains("e-week-number")||t.isNullOrUndefined(e[u].children[0])||(t.addClass([e[u].children[0]],["e-day"]),t.rippleEffect(e[u].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[u]),this.weekNumber&&7===u&&e[7].classList.contains(o)&&t.addClass([r],"e-month-hide"),!this.weekNumber&&6===u&&e[6].classList.contains(o)&&t.addClass([r],"e-month-hide"),this.weekNumber?41===u&&e[41].classList.contains(o)&&t.addClass([r],"e-month-hide"):35===u&&e[35].classList.contains(o)&&t.addClass([r],"e-month-hide");h+=i,u+=0,this.tableBodyElement.appendChild(r)}this.table.querySelector("tbody").className=this.effect,"Gregorian"===this.calendarMode?this.iconHandler():this.islamicModule.islamicIconHandler(),(l!==this.getViewNumber(this.currentView())||0===l&&l!==this.getViewNumber(this.currentView()))&&this.navigateHandler(a),this.setAriaActiveDescendant()},i.prototype.clickHandler=function(e,t){this.clickEventEmitter(e);var i=e.currentTarget,s=this.getViewNumber(this.currentView());i.classList.contains(o)?this.contentClick(e,0,null,t):s===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?this.contentClick(e,1,null,t):2===s?this.contentClick(e,1,null,t):i.classList.contains(o)||0!==s?this.contentClick(e,0,i,t):this.selectDate(e,this.getIdValue(e,null),null),"calendar"===this.getModuleName()&&this.table.focus()},i.prototype.clickEventEmitter=function(e){e.preventDefault()},i.prototype.contentClick=function(e,i,s,a){var n=this.getViewNumber(this.currentView()),r=this.getIdValue(e,s);switch(i){case 0:n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth)?(t.detach(this.tableBodyElement),this.currentDate=r,this.effect="e-zoomin",this.renderMonths(e)):("Gregorian"===this.calendarMode?(this.currentDate.setMonth(r.getMonth()),r.getMonth()>0&&this.currentDate.getMonth()!==r.getMonth()&&this.currentDate.setDate(0),this.currentDate.setFullYear(r.getFullYear())):this.currentDate=r,this.effect="e-zoomin",t.detach(this.tableBodyElement),this.renderMonths(e));break;case 1:if(n===this.getViewNumber(this.depth)&&this.getViewNumber(this.start)>=this.getViewNumber(this.depth))this.selectDate(e,r,null);else{if("Gregorian"===this.calendarMode)this.currentDate.setFullYear(r.getFullYear());else{var l=this.islamicModule.getIslamicDate(r);this.currentDate=this.islamicModule.toGregorian(l.year,l.month,1)}this.effect="e-zoomin",t.detach(this.tableBodyElement),this.renderYears(e)}}},i.prototype.switchView=function(e,i,s,a){switch(e){case 0:t.detach(this.tableBodyElement),this.renderMonths(i,null,a),s&&!t.isNullOrUndefined(this.tableBodyElement.querySelectorAll("."+c)[0])&&this.tableBodyElement.querySelectorAll("."+c)[0].classList.remove(c);break;case 1:t.detach(this.tableBodyElement),this.renderYears(i);break;case 2:t.detach(this.tableBodyElement),this.renderDecades(i)}},i.prototype.getModuleName=function(){return"calendar"},i.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),e},i.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},i.prototype.onPropertyChanged=function(e,i,s,a){this.effect="";for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(l){case"enableRtl":e.enableRtl?"calendar"===this.getModuleName()?this.element.classList.add("e-rtl"):this.calendarElement.classList.add("e-rtl"):"calendar"===this.getModuleName()?this.element.classList.remove("e-rtl"):this.calendarElement.classList.remove("e-rtl");break;case"dayHeaderFormat":this.getCultureValues(),"datepicker"!==this.getModuleName()?this.createContentHeader():this.calendarElement&&this.createContentHeader(),this.adjustLongHeaderSize();break;case"min":case"max":this.rangeValidation(this.min,this.max),"min"===l?this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0):this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.setProperties({start:this.currentView()},!0),this.tableBodyElement&&t.detach(this.tableBodyElement),this.minMaxUpdate(),s&&this.validateValues(s,a),"datepicker"!==this.getModuleName()?this.createContentBody():this.calendarElement&&this.createContentBody(),(this.todayDate<this.min||this.max<this.todayDate)&&this.footer&&this.todayElement?(t.detach(this.todayElement),t.detach(this.footer),this.todayElement=this.footer=null,this.createContentFooter()):this.footer&&this.todayElement&&this.todayElement.classList.contains("e-disabled")&&(t.removeClass([this.todayElement],u),t.detach(this.todayElement),t.detach(this.footer),this.todayElement=this.footer=null,this.createContentFooter());break;case"start":case"depth":case"weekNumber":case"firstDayOfWeek":case"weekRule":this.checkView(),"datepicker"!==this.getModuleName()?(this.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody());break;case"locale":this.globalize=new t.Internationalization(this.locale),"datepicker"!==this.getModuleName()?(this.createContentHeader(),this.createContentBody()):this.calendarElement&&(this.createContentHeader(),this.createContentBody()),this.l10.setLocale(this.locale),this.updateFooter();break;case"showTodayButton":e.showTodayButton?this.createContentFooter():t.isNullOrUndefined(this.todayElement)||t.isNullOrUndefined(this.footer)||(t.detach(this.todayElement),t.detach(this.footer),this.todayElement=this.footer=void 0),this.setProperties({showTodayButton:e.showTodayButton},!0)}}},i.prototype.validateValues=function(e,i){if(e&&!t.isNullOrUndefined(i)&&i.length>0){for(var s=this.copyValues(i),a=0;a<s.length;a++){var n=s[a],r="Gregorian"===this.calendarMode?"gregorian":"islamic",l=void 0;l="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{type:"date",skeleton:t.isBlazor()?"d":"yMd"}):this.globalize.formatDate(n,{type:"dateTime",skeleton:"full",calendar:"islamic"});var o={type:"date",skeleton:t.isBlazor()?"d":"yMd",calendar:r},h=this.globalize.formatDate(this.min,o),u={type:"date",skeleton:t.isBlazor()?"d":"yMd",calendar:r},d=this.globalize.formatDate(this.max,u);(+new Date(l)<+new Date(h)||+new Date(l)>+new Date(d))&&(s.splice(a,1),a=-1)}this.setProperties({values:s},!0)}},i.prototype.setValueUpdate=function(){t.isNullOrUndefined(this.tableBodyElement)||(t.detach(this.tableBodyElement),this.setProperties({start:this.currentView()},!0),this.createContentBody())},i.prototype.copyValues=function(e){var i=[];if(!t.isNullOrUndefined(e)&&e.length>0)for(var s=0;s<e.length;s++)i.push(new Date(+e[s]));return i},i.prototype.titleUpdate=function(e,i){var s,a,n=new t.Internationalization(this.locale),r="Gregorian"===this.calendarMode?"gregorian":"islamic";switch("Gregorian"===this.calendarMode?(s=n.formatDate(e,{type:"dateTime",skeleton:t.isBlazor()?"y":"yMMMM",calendar:r}),a=n.formatDate(e,{format:t.isBlazor()?"yyyy":null,type:"dateTime",skeleton:"y",calendar:r})):(s=n.formatDate(e,{type:"dateTime",format:"MMMM y",calendar:r}),a=n.formatDate(e,{type:"dateTime",format:"y",calendar:r})),i){case"days":this.headerTitleElement.textContent=this.toCapitalize(s);break;case"months":this.headerTitleElement.textContent=a}},i.prototype.setActiveDescendant=function(){var e,i,s=this.tableBodyElement.querySelector("tr td.e-focused-date"),a=this.tableBodyElement.querySelector("tr td.e-selected"),n="Gregorian"===this.calendarMode?"gregorian":"islamic",r=this.currentView();return i="Month"===r?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:t.isBlazor()?"D":"full",calendar:n}):"Year"===r?"islamic"!==n?this.globalize.formatDate(this.currentDate,{type:"date",skeleton:t.isBlazor()?"y":"yMMMM",calendar:n}):this.globalize.formatDate(this.currentDate,{type:"date",skeleton:"GyMMM",calendar:n}):this.globalize.formatDate(this.currentDate,{format:t.isBlazor()?"yyyy":null,type:"date",skeleton:"y",calendar:n}),(a||s)&&(t.isNullOrUndefined(a)||a.setAttribute("aria-selected","true"),(s||a).setAttribute("aria-label",i),e=(s||a).getAttribute("id")),e},i.prototype.iconHandler=function(){switch(new Date(this.checkValue(this.currentDate)).setDate(1),this.currentView()){case"Month":this.previousIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareMonth(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Year":this.previousIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareYear(new Date(this.checkValue(this.currentDate)),this.max)>-1);break;case"Decade":this.previousIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.min)<1),this.nextIconHandler(this.compareDecade(new Date(this.checkValue(this.currentDate)),this.max)>-1)}},i.prototype.destroy=function(){"calendar"===this.getModuleName()&&this.element?t.removeClass([this.element],[h]):this.calendarElement&&this.element&&t.removeClass([this.element],[h]),"calendar"===this.getModuleName()&&this.element&&(t.EventHandler.remove(this.headerTitleElement,"click",this.navigateTitle),this.todayElement&&t.EventHandler.remove(this.todayElement,"click",this.todayButtonClick),this.previousIconHandler(!0),this.nextIconHandler(!0),this.keyboardModule.destroy(),this.element.removeAttribute("data-role"),t.isNullOrUndefined(this.calendarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.element&&(this.element.innerHTML=""),e.prototype.destroy.call(this)},i.prototype.title=function(e){var t=this.getViewNumber(this.currentView());this.effect="e-zoomin",this.switchView(++t,e)},i.prototype.getViewNumber=function(e){return"Month"===e?0:"Year"===e?1:2},i.prototype.navigateTitle=function(e){e.preventDefault(),this.title(e),"calendar"===this.getModuleName()&&this.table.focus()},i.prototype.previous=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,-1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,-1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,-10),this.switchView(e)}},i.prototype.navigatePrevious=function(e){e.preventDefault(),"Gregorian"===this.calendarMode?this.previous():this.islamicModule.islamicPrevious(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},i.prototype.next=function(){this.effect="";var e=this.getViewNumber(this.currentView());switch(this.currentView()){case"Month":this.addMonths(this.currentDate,1),this.switchView(e);break;case"Year":this.addYears(this.currentDate,1),this.switchView(e);break;case"Decade":this.addYears(this.currentDate,10),this.switchView(e)}},i.prototype.navigateNext=function(e){e.preventDefault(),"Gregorian"===this.calendarMode?this.next():this.islamicModule.islamicNext(),this.triggerNavigate(e),"calendar"===this.getModuleName()&&this.table.focus()},i.prototype.navigateTo=function(e,t,i){+t>=+this.min&&+t<=+this.max&&(this.currentDate=t),+t<=+this.min&&(this.currentDate=new Date(this.checkValue(this.min))),+t>=+this.max&&(this.currentDate=new Date(this.checkValue(this.max))),this.getViewNumber(this.depth)>=this.getViewNumber(e)&&(this.getViewNumber(this.depth)<=this.getViewNumber(this.start)||this.getViewNumber(this.depth)===this.getViewNumber(e))&&(e=this.depth),this.switchView(this.getViewNumber(e),null,null,i)},i.prototype.currentView=function(){return this.contentElement.classList.contains("e-year")?"Year":this.contentElement.classList.contains("e-decade")?"Decade":"Month"},i.prototype.getDateVal=function(e,i){return!t.isNullOrUndefined(i)&&e.getDate()===i.getDate()&&e.getMonth()===i.getMonth()&&e.getFullYear()===i.getFullYear()},i.prototype.getCultureObjects=function(e,i){var s=(t.isBlazor()?".dates.days.":".dates.calendars.gregorian.days.format.")+this.dayHeaderFormat.toLowerCase(),a=(t.isBlazor()?".dates.days.":".dates.calendars.islamic.days.format.")+this.dayHeaderFormat.toLowerCase(),n=t.isBlazor()?"":"main.";return"Gregorian"===this.calendarMode?t.getValue(n+""+this.locale+s,e):t.getValue("main."+this.locale+a,e)},i.prototype.getWeek=function(e){var t=new Date(this.checkValue(e)).valueOf(),i=new Date(e.getFullYear(),0,1).valueOf();return Math.ceil((t-i+864e5)/864e5/7)},i.prototype.setStartDate=function(e,t){var i=e.getTimezoneOffset(),s=new Date(e.getTime()+t),a=s.getTimezoneOffset()-i;e.setTime(s.getTime()+6e4*a)},i.prototype.addMonths=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setMonth(e.getMonth()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year,s.month+t,1)}},i.prototype.addYears=function(e,t){if("Gregorian"===this.calendarMode){var i=e.getDate();e.setDate(1),e.setFullYear(e.getFullYear()+t),e.setDate(Math.min(i,this.getMaxDays(e)))}else{var s=this.islamicModule.getIslamicDate(e);this.currentDate=this.islamicModule.toGregorian(s.year+t,s.month,1)}},i.prototype.getIdValue=function(e,i){var s;s=e?e.currentTarget:i;var a="Gregorian"===this.calendarMode?"gregorian":"islamic",n={type:"dateTime",skeleton:t.isBlazor()?"F":"full",calendar:a},r=this.globalize.formatDate(new Date(parseInt(""+s.getAttribute("id"),0)),n),l=this.globalize.parseDate(r,n),o=l.valueOf()-l.valueOf()%1e3;return new Date(o)},i.prototype.adjustLongHeaderSize=function(){t.removeClass([this.element],"e-calendar-day-header-lg"),"Wide"===this.dayHeaderFormat&&t.addClass(["calendar"===this.getModuleName()?this.element:this.calendarElement],"e-calendar-day-header-lg")},i.prototype.selectDate=function(e,i,s,a,n){var r=s||e.currentTarget;if(this.isDateSelected=!1,"Decade"===this.currentView())this.setDateDecade(this.currentDate,i.getFullYear());else if("Year"===this.currentView())this.setDateYear(this.currentDate,i);else{if(a&&!this.checkPresentDate(i,n)){o=this.copyValues(n);!t.isNullOrUndefined(n)&&o.length>0?(o.push(new Date(this.checkValue(i))),this.setProperties({values:o},!0),this.setProperties({value:n[n.length-1]},!0)):this.setProperties({values:[new Date(this.checkValue(i))]},!0)}else this.setProperties({value:new Date(this.checkValue(i))},!0);this.currentDate=new Date(this.checkValue(i))}var l=t.closest(r,"."+h);if(t.isNullOrUndefined(l)&&(l=this.tableBodyElement),a||t.isNullOrUndefined(l.querySelector("."+p))||t.removeClass([l.querySelector("."+p)],p),a||t.isNullOrUndefined(l.querySelector("."+c))||t.removeClass([l.querySelector("."+c)],c),a){for(var o=this.copyValues(n),u=Array.prototype.slice.call(this.tableBodyElement.querySelectorAll("td")),d=0;d<u.length;d++){var m=l.querySelectorAll("td."+c)[0],v=l.querySelectorAll("td."+p)[0];u[d]===m&&t.removeClass([u[d]],c),u[d]!==v||this.checkPresentDate(new Date(parseInt(v.getAttribute("id").split("_")[0],10)),n)||t.removeClass([u[d]],p)}if(r.classList.contains(p)){t.removeClass([r],p);for(var f=0;f<o.length;f++){var y="Gregorian"===this.calendarMode?"gregorian":"islamic",g={format:this.getFromatStringValue(),type:"date",skeleton:"short",calendar:y};if(this.globalize.formatDate(i,g)===this.globalize.formatDate(o[f],g)){d=o.indexOf(o[f]);o.splice(d,1),t.addClass([r],c)}}this.setProperties({values:o},!0)}else t.addClass([r],p)}else t.addClass([r],p);this.isDateSelected=!0},i.prototype.getFromatStringValue=function(){return t.isBlazor()?"M"+t.getDefaultDateObject().dateSeperator+"d"+t.getDefaultDateObject().dateSeperator+"yy":null},i.prototype.checkPresentDate=function(e,i){var s=!1;if(!t.isNullOrUndefined(i))for(var a=0;a<i.length;a++){var n="Gregorian"===this.calendarMode?"gregorian":"islamic";this.globalize.formatDate(e,{format:this.getFromatStringValue(),type:"date",skeleton:"short",calendar:n})===this.globalize.formatDate(i[a],{format:this.getFromatStringValue(),type:"date",skeleton:"short",calendar:n})&&(s=!0)}return s},i.prototype.setAriaActiveDescendant=function(){t.attributes(this.table,{"aria-activedescendant":""+this.setActiveDescendant()})},i.prototype.previousIconHandler=function(e){e?(t.EventHandler.remove(this.previousIcon,"click",this.navigatePreviousHandler),t.addClass([this.previousIcon],""+u),t.addClass([this.previousIcon],""+d),this.previousIcon.setAttribute("aria-disabled","true")):(t.EventHandler.add(this.previousIcon,"click",this.navigatePreviousHandler),t.removeClass([this.previousIcon],""+u),t.removeClass([this.previousIcon],""+d),this.previousIcon.setAttribute("aria-disabled","false"))},i.prototype.renderDayCellEvent=function(e){t.extend(this.renderDayCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},i.prototype.navigatedEvent=function(e){t.extend(this.navigatedArgs,{name:"navigated",event:e}),this.trigger("navigated",this.navigatedArgs)},i.prototype.triggerNavigate=function(e){this.navigatedArgs={view:this.currentView(),date:this.currentDate},this.navigatedEvent(e)},i.prototype.nextIconHandler=function(e){e?(t.EventHandler.remove(this.nextIcon,"click",this.navigateNextHandler),t.addClass([this.nextIcon],u),t.addClass([this.nextIcon],d),this.nextIcon.setAttribute("aria-disabled","true")):(t.EventHandler.add(this.nextIcon,"click",this.navigateNextHandler),t.removeClass([this.nextIcon],u),t.removeClass([this.nextIcon],d),this.nextIcon.setAttribute("aria-disabled","false"))},i.prototype.compare=function(e,t,i){var s,a,n=t.getFullYear();return s=n,a=0,i&&(s=(n-=n%i)-n%i+i-1),e.getFullYear()>s?a=1:e.getFullYear()<n&&(a=-1),a},i.prototype.isMinMaxRange=function(e){return+e>=+this.min&&+e<=+this.max},i.prototype.isMonthYearRange=function(e){if("Gregorian"===this.calendarMode)return e.getMonth()>=this.min.getMonth()&&e.getFullYear()>=this.min.getFullYear()&&e.getMonth()<=this.max.getMonth()&&e.getFullYear()<=this.max.getFullYear();var t=this.islamicModule.getIslamicDate(e);return t.month>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).month&&t.year>=this.islamicModule.getIslamicDate(new Date(1944,1,18)).year&&t.month<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).month&&t.year<=this.islamicModule.getIslamicDate(new Date(2069,1,16)).year},i.prototype.compareYear=function(e,t){return this.compare(e,t,0)},i.prototype.compareDecade=function(e,t){return this.compare(e,t,10)},i.prototype.shiftArray=function(e,t){return e.slice(t).concat(e.slice(0,t))},i.prototype.addDay=function(e,i,s,a,n){var r=i,l=new Date(+e);if(!t.isNullOrUndefined(this.tableBodyElement)&&!t.isNullOrUndefined(s)){for(;this.findNextTD(new Date(+e),r,a,n);)r+=i;var o=new Date(l.setDate(l.getDate()+r));r=+o>+a||+o<+n?r===i?i-i:i:r}e.setDate(e.getDate()+r)},i.prototype.findNextTD=function(e,i,s,a){var n=new Date(e.setDate(e.getDate()+i)),r=[],l=!1;if((!t.isNullOrUndefined(n)&&n.getMonth())===(!t.isNullOrUndefined(this.currentDate)&&this.currentDate.getMonth())){r=("Gregorian"===this.calendarMode?this.renderDays(n):this.islamicModule.islamicRenderDays(this.currentDate,n)).filter(function(e){return e.classList.contains(u)})}else r=this.tableBodyElement.querySelectorAll("td."+u);if(+n<=+s&&+n>=+a&&r.length)for(var o=0;o<r.length&&!(l=+n==+new Date(parseInt(r[o].id,0)));o++);return l},i.prototype.getMaxDays=function(e){var t,i=new Date(this.checkValue(e));t=28;for(var s=i.getMonth();i.getMonth()===s;)++t,i.setDate(t);return t-1},i.prototype.setDateDecade=function(e,t){e.setFullYear(t),this.setProperties({value:new Date(this.checkValue(e))},!0)},i.prototype.setDateYear=function(e,t){e.setFullYear(t.getFullYear(),t.getMonth(),e.getDate()),t.getMonth()!==e.getMonth()&&(e.setDate(0),this.currentDate=new Date(this.checkValue(t))),this.setProperties({value:new Date(this.checkValue(e))},!0)},i.prototype.compareMonth=function(e,t){return e.getFullYear()>t.getFullYear()?1:e.getFullYear()<t.getFullYear()?-1:e.getMonth()===t.getMonth()?0:e.getMonth()>t.getMonth()?1:-1},i.prototype.checkValue=function(e){return e instanceof Date?e.toUTCString():""+e},i.prototype.checkView=function(){"Decade"!==this.start&&"Year"!==this.start&&this.setProperties({start:"Month"},!0),"Decade"!==this.depth&&"Year"!==this.depth&&this.setProperties({depth:"Month"},!0),this.getViewNumber(this.depth)>this.getViewNumber(this.start)&&this.setProperties({depth:"Month"},!0)},i.prototype.getDate=function(e,t){return t&&(e=new Date(e.toLocaleString("en-US",{timeZone:t}))),e},l([t.Property(new Date(1900,0,1))],i.prototype,"min",void 0),l([t.Property(!0)],i.prototype,"enabled",void 0),l([t.Property(null)],i.prototype,"cssClass",void 0),l([t.Property(new Date(2099,11,31))],i.prototype,"max",void 0),l([t.Property(null)],i.prototype,"firstDayOfWeek",void 0),l([t.Property("Gregorian")],i.prototype,"calendarMode",void 0),l([t.Property("Month")],i.prototype,"start",void 0),l([t.Property("Month")],i.prototype,"depth",void 0),l([t.Property(!1)],i.prototype,"weekNumber",void 0),l([t.Property("FirstDay")],i.prototype,"weekRule",void 0),l([t.Property(!0)],i.prototype,"showTodayButton",void 0),l([t.Property("Short")],i.prototype,"dayHeaderFormat",void 0),l([t.Property(!1)],i.prototype,"enablePersistence",void 0),l([t.Property(null)],i.prototype,"keyConfigs",void 0),l([t.Property(null)],i.prototype,"serverTimezoneOffset",void 0),l([t.Event()],i.prototype,"created",void 0),l([t.Event()],i.prototype,"destroyed",void 0),l([t.Event()],i.prototype,"navigated",void 0),l([t.Event()],i.prototype,"renderDayCell",void 0),i=l([t.NotifyPropertyChanges],i)}(t.Component),f=function(e){function i(t,i){return e.call(this,t,i)||this}return r(i,e),i.prototype.render=function(){if("Islamic"===this.calendarMode&&void 0===this.islamicModule&&t.throwError("Requires the injectable Islamic modules to render Calendar in Islamic mode"),this.isMultiSelection&&"object"==typeof this.values&&!t.isNullOrUndefined(this.values)&&this.values.length>0){for(var i=[],s=[],a=0;a<this.values.length;a++)-1===i.indexOf(+this.values[a])&&(i.push(+this.values[a]),s.push(this.values[a]));this.setProperties({values:s},!0);for(var n=0;n<this.values.length;n++)if(!this.checkDateValue(this.values[n]))if("string"==typeof this.values[n]&&this.checkDateValue(new Date(this.checkValue(this.values[n])))){var r=new Date(this.checkValue(this.values[n]));this.values.splice(n,1),this.values.splice(n,0,r)}else this.values.splice(n,1);this.setProperties({value:this.values[this.values.length-1]},!0),this.previousValues=this.values.length}if(this.validateDate(),this.minMaxUpdate(),this.setEnable(this.enabled),"calendar"===this.getModuleName()&&this.setClass(this.cssClass),e.prototype.render.call(this),"calendar"===this.getModuleName()){var l=t.closest(this.element,"form");l&&t.EventHandler.add(l,"reset",this.formResetHandler.bind(this)),this.setTimeZone(this.serverTimezoneOffset)}this.renderComplete()},i.prototype.setEnable=function(e){e?t.removeClass([this.element],u):t.addClass([this.element],u)},i.prototype.setClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),t.isNullOrUndefined(i)||""===i||t.removeClass([this.element],i.split(" ")),t.isNullOrUndefined(e)||t.addClass([this.element],e.split(" "))},i.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),6,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),0,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(t,e)},i.prototype.setTimeZone=function(e){if(!t.isNullOrUndefined(this.serverTimezoneOffset)&&this.value){var i=e+(new Date).getTimezoneOffset()/60;i=this.isDayLightSaving()?i--:i,this.value=new Date(this.value.getTime()+60*i*60*1e3)}},i.prototype.formResetHandler=function(){this.setProperties({value:null},!0)},i.prototype.validateDate=function(){"string"==typeof this.value&&this.setProperties({value:this.checkDateValue(new Date(this.checkValue(this.value)))},!0),e.prototype.validateDate.call(this,this.value),!t.isNullOrUndefined(this.value)&&this.min<=this.max&&this.value>=this.min&&this.value<=this.max&&(this.currentDate=new Date(this.checkValue(this.value))),isNaN(+this.value)&&this.setProperties({value:null},!0)},i.prototype.minMaxUpdate=function(){"calendar"===this.getModuleName()&&(!t.isNullOrUndefined(this.value)&&this.value<=this.min&&this.min<=this.max?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!t.isNullOrUndefined(this.value)&&this.value>=this.max&&this.min<=this.max&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})),"calendar"===this.getModuleName()||t.isNullOrUndefined(this.value)?e.prototype.minMaxUpdate.call(this,this.value):!t.isNullOrUndefined(this.value)&&this.value<this.min&&this.min<=this.max?e.prototype.minMaxUpdate.call(this,this.min):!t.isNullOrUndefined(this.value)&&this.value>this.max&&this.min<=this.max&&e.prototype.minMaxUpdate.call(this,this.max)},i.prototype.generateTodayVal=function(i){var s=new Date;return t.isNullOrUndefined(this.timezone)||(s=e.prototype.getDate.call(this,s,this.timezone)),i&&t.isNullOrUndefined(this.timezone)?(s.setHours(i.getHours()),s.setMinutes(i.getMinutes()),s.setSeconds(i.getSeconds()),s.setMilliseconds(i.getMilliseconds())):s=new Date(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0,0),s},i.prototype.todayButtonClick=function(t){if(this.showTodayButton){var i=this.generateTodayVal(this.value);if(this.setProperties({value:i},!0),this.isTodayClicked=!0,this.todayButtonEvent=t,this.isMultiSelection){var s=this.copyValues(this.values);e.prototype.checkPresentDate.call(this,i,this.values)||(s.push(i),this.setProperties({values:s}))}e.prototype.todayButtonClick.call(this,t,new Date(+this.value))}},i.prototype.keyActionHandle=function(t){e.prototype.keyActionHandle.call(this,t,this.value,this.isMultiSelection)},i.prototype.preRender=function(){var t=this;this.changeHandler=function(e){t.triggerChange(e)},this.checkView(),e.prototype.preRender.call(this,this.value)},i.prototype.createContent=function(){this.previousDate=this.value,this.previousDateTime=this.value,e.prototype.createContent.call(this)},i.prototype.minMaxDate=function(t){return e.prototype.minMaxDate.call(this,t)},i.prototype.renderMonths=function(t,i,s){e.prototype.renderMonths.call(this,t,this.value,s)},i.prototype.renderDays=function(t,i,s,a,n){var r=e.prototype.renderDays.call(this,t,this.value,this.isMultiSelection,this.values,n);return this.isMultiSelection&&e.prototype.validateValues.call(this,this.isMultiSelection,this.values),r},i.prototype.renderYears=function(t){"Gregorian"===this.calendarMode?e.prototype.renderYears.call(this,t,this.value):this.islamicModule.islamicRenderYears(t,this.value)},i.prototype.renderDecades=function(t){"Gregorian"===this.calendarMode?e.prototype.renderDecades.call(this,t,this.value):this.islamicModule.islamicRenderDecade(t,this.value)},i.prototype.renderTemplate=function(t,i,s,a){"Gregorian"===this.calendarMode?e.prototype.renderTemplate.call(this,t,i,s,a,this.value):this.islamicModule.islamicRenderTemplate(t,i,s,a,this.value),this.changedArgs={value:this.value,values:this.values},this.changeHandler()},i.prototype.clickHandler=function(i){var s=i.currentTarget;if(this.isPopupClicked=!0,s.classList.contains(o))if(this.isMultiSelection){var a=this.copyValues(this.values);a.push(this.getIdValue(i,null)),this.setProperties({values:a},!0),this.setProperties({value:this.values[this.values.length-1]},!0)}else this.setProperties({value:this.getIdValue(i,null)},!0);var n=this.currentView();e.prototype.clickHandler.call(this,i,this.value),this.isMultiSelection&&this.currentDate!==this.value&&!t.isNullOrUndefined(this.tableBodyElement.querySelectorAll("."+c)[0])&&"Year"===n&&this.tableBodyElement.querySelectorAll("."+c)[0].classList.remove(c)},i.prototype.switchView=function(t,i,s,a){e.prototype.switchView.call(this,t,i,this.isMultiSelection,a)},i.prototype.getModuleName=function(){return e.prototype.getModuleName.call(this),"calendar"},i.prototype.getPersistData=function(){e.prototype.getPersistData.call(this);var t=["value","values"];return this.addOnPersist(t)},i.prototype.onPropertyChanged=function(t,i){this.effect="",this.rangeValidation(this.min,this.max);for(var s=0,a=Object.keys(t);s<a.length;s++)switch(a[s]){case"value":this.isDateSelected&&("string"==typeof t.value?this.setProperties({value:new Date(this.checkValue(t.value))},!0):t.value=new Date(this.checkValue(t.value)),isNaN(+this.value)&&this.setProperties({value:i.value},!0),this.update());break;case"values":if(this.isDateSelected){if("string"==typeof t.values||"number"==typeof t.values)this.setProperties({values:null},!0);else{for(var n=this.copyValues(this.values),r=0;r<n.length;r++){var l=n[r];this.checkDateValue(l)&&!e.prototype.checkPresentDate.call(this,l,n)&&n.push(l)}this.setProperties({values:n},!0),this.values.length>0&&this.setProperties({value:t.values[t.values.length-1]},!0)}this.validateValues(this.isMultiSelection,this.values),this.update()}break;case"isMultiSelection":this.isDateSelected&&(this.setProperties({isMultiSelection:t.isMultiSelection},!0),this.update());break;case"enabled":this.setEnable(this.enabled);break;case"cssClass":"calendar"===this.getModuleName()&&this.setClass(t.cssClass,i.cssClass);break;default:e.prototype.onPropertyChanged.call(this,t,i,this.isMultiSelection,this.values)}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange},i.prototype.destroy=function(){if(e.prototype.destroy.call(this),"calendar"===this.getModuleName()){var i=t.closest(this.element,"form");i&&t.EventHandler.remove(i,"reset",this.formResetHandler.bind(this))}},i.prototype.navigateTo=function(t,i,s){this.minMaxUpdate(),e.prototype.navigateTo.call(this,t,i,s)},i.prototype.currentView=function(){return e.prototype.currentView.call(this)},i.prototype.addDate=function(i){if("string"!=typeof i&&"number"!=typeof i){var s=this.copyValues(this.values);if("object"==typeof i&&i.length>0)for(var a=i,n=0;n<a.length;n++)this.checkDateValue(a[n])&&!e.prototype.checkPresentDate.call(this,a[n],s)&&(!t.isNullOrUndefined(s)&&s.length>0?s.push(a[n]):s=[new Date(+a[n])]);else this.checkDateValue(i)&&!e.prototype.checkPresentDate.call(this,i,s)&&(!t.isNullOrUndefined(s)&&s.length>0?s.push(i):s=[new Date(+i)]);this.setProperties({values:s},!0),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.validateValues(this.isMultiSelection,s),this.update(),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},i.prototype.removeDate=function(e){if("string"!=typeof e&&"number"!=typeof e&&!t.isNullOrUndefined(this.values)&&this.values.length>0){var i=this.copyValues(this.values);if("object"==typeof e&&e.length>0)for(var s=e,a=0;a<s.length;a++)for(n=0;n<i.length;n++)+i[n]==+s[a]&&i.splice(n,1);else for(var n=0;n<i.length;n++)+i[n]==+e&&i.splice(n,1);this.setProperties({values:i},!1),this.update(),this.isMultiSelection&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler()}},i.prototype.setTodayDate=function(t){var i=new Date(+t);this.setProperties({value:i},!0),e.prototype.todayButtonClick.call(this,null,i,!0)},i.prototype.update=function(){this.validateDate(),this.minMaxUpdate(),e.prototype.setValueUpdate.call(this)},i.prototype.selectDate=function(i,s,a){e.prototype.selectDate.call(this,i,s,a,this.isMultiSelection,this.values),this.isMultiSelection&&!t.isNullOrUndefined(this.values)&&this.values.length>0&&this.setProperties({value:this.values[this.values.length-1]},!0),this.changedArgs={value:this.value,values:this.values},this.changeHandler(i)},i.prototype.changeEvent=function(e){((this.value&&this.value.valueOf())!==(this.previousDate&&+this.previousDate.valueOf())||this.isMultiSelection)&&(this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.changedArgs),this.previousDate=new Date(+this.value))},i.prototype.triggerChange=function(e){!t.isNullOrUndefined(this.todayButtonEvent)&&this.isTodayClicked&&(e=this.todayButtonEvent,this.isTodayClicked=!1),this.changedArgs.event=e||null,this.changedArgs.isInteracted=!t.isNullOrUndefined(e),t.isNullOrUndefined(this.value)||this.setProperties({value:this.value},!0),this.isMultiSelection||+this.value===Number.NaN||+this.value==+this.previousDate&&(null!=this.previousDate||isNaN(+this.value))?t.isNullOrUndefined(this.values)||this.previousValues===this.values.length||(this.changeEvent(e),this.previousValues=this.values.length):this.changeEvent(e)},l([t.Property(null)],i.prototype,"value",void 0),l([t.Property(null)],i.prototype,"values",void 0),l([t.Property(!1)],i.prototype,"isMultiSelection",void 0),l([t.Event()],i.prototype,"change",void 0),i=l([t.NotifyPropertyChanges],i)}(v),y=function(){function e(e){this.calendarInstance=e}return e.prototype.getModuleName=function(){return"islamic"},e.prototype.islamicTitleUpdate=function(e,i){var s=new t.Internationalization(this.calendarInstance.locale);switch(i){case"days":this.calendarInstance.headerTitleElement.textContent=s.formatDate(e,{type:"dateTime",format:"MMMMyyyy",calendar:"islamic"});break;case"months":this.calendarInstance.headerTitleElement.textContent=s.formatDate(e,{type:"dateTime",format:"yyyy",calendar:"islamic"})}},e.prototype.islamicRenderDays=function(e,i,s,a){var n,r=[],l=new Date(this.islamicInValue(e));this.islamicTitleUpdate(e,"days");var o=this.getIslamicDate(l),h=this.toGregorian(o.year,o.month,1),u=o.month;for(l=h;l.getDay()!==this.calendarInstance.firstDayOfWeek;)this.calendarInstance.setStartDate(l,-864e5);for(var d=0;d<42;++d){var p=this.calendarInstance.createElement("td",{className:"e-cell"}),c=this.calendarInstance.createElement("span");d%7==0&&this.calendarInstance.weekNumber&&(c.textContent=""+this.calendarInstance.getWeek(l),p.appendChild(c),t.addClass([p],"e-week-number"),r.push(p)),n=new Date(+l),l=this.calendarInstance.minMaxDate(l);var m={type:"dateTime",skeleton:"full",calendar:"islamic"},v=this.calendarInstance.globalize.parseDate(this.calendarInstance.globalize.formatDate(l,m),m),f=this.islamicDayCell(l),y=this.calendarInstance.globalize.formatDate(l,{type:"date",skeleton:"full",calendar:"islamic"}),g=this.calendarInstance.createElement("span");g.textContent=this.calendarInstance.globalize.formatDate(l,{type:"date",skeleton:"d",calendar:"islamic"});var b=this.calendarInstance.min>l||this.calendarInstance.max<l;b?(t.addClass([f],"e-disabled"),t.addClass([f],"e-overlay")):g.setAttribute("title",""+y),u!==this.getIslamicDate(l).month&&t.addClass([f],"e-other-month"),0!==l.getDay()&&6!==l.getDay()||t.addClass([f],"e-weekend"),f.appendChild(g),this.calendarInstance.renderDayCellArgs={date:l,isDisabled:!1,element:f,isOutOfRange:b};var D=this.calendarInstance.renderDayCellArgs;if(this.calendarInstance.renderDayCellEvent(D),D.isDisabled)if(this.calendarInstance.isMultiSelection){if(!t.isNullOrUndefined(this.calendarInstance.values)&&this.calendarInstance.values.length>0)for(var E=0;E<a.length;E++)(w=+new Date(this.calendarInstance.globalize.formatDate(D.date,{type:"date",skeleton:"yMd",calendar:"islamic"})))===(V=+new Date(this.calendarInstance.globalize.formatDate(this.calendarInstance.values[E],{type:"date",skeleton:"yMd",calendar:"islamic"})))&&(this.calendarInstance.values.splice(E,1),E=-1)}else i&&+i==+D.date&&this.calendarInstance.setProperties({value:null},!0);this.calendarInstance.renderDayCellArgs.isDisabled&&!f.classList.contains("e-selected")&&(t.addClass([f],"e-disabled"),t.addClass([f],"e-overlay"),+this.calendarInstance.renderDayCellArgs.date==+this.calendarInstance.todayDate&&(this.calendarInstance.todayDisabled=!0));var C=f.classList.contains("e-other-month"),k=f.classList.contains("e-disabled");if(k||t.EventHandler.add(f,"click",this.calendarInstance.clickHandler,this.calendarInstance),!this.calendarInstance.isMultiSelection||t.isNullOrUndefined(this.calendarInstance.values)||C||k)C||k||!this.calendarInstance.getDateVal(l,i)?this.calendarInstance.updateFocus(C,k,l,f,e):t.addClass([f],"e-selected");else{for(var M=0;M<this.calendarInstance.values.length;M++){var w=this.calendarInstance.globalize.formatDate(l,{type:"date",skeleton:"short",calendar:"islamic"}),V=this.calendarInstance.globalize.formatDate(this.calendarInstance.values[M],{type:"date",skeleton:"short",calendar:"islamic"});w===V&&this.calendarInstance.getDateVal(l,this.calendarInstance.values[M])?t.addClass([f],"e-selected"):this.calendarInstance.updateFocus(C,k,l,f,e)}this.calendarInstance.values.length<=0&&this.calendarInstance.updateFocus(C,k,l,f,e)}v.getDate()===(new Date).getDate()&&v.getMonth()===(new Date).getMonth()&&v.getFullYear()===(new Date).getFullYear()&&t.addClass([f],"e-today"),l=new Date(+n),r.push(this.calendarInstance.renderDayCellArgs.element),this.calendarInstance.addDay(l,1,null,this.calendarInstance.max,this.calendarInstance.min)}return r},e.prototype.islamicIconHandler=function(){new Date(this.islamicInValue(this.calendarInstance.currentDate)).setDate(1);var e=new Date(this.islamicInValue(this.calendarInstance.currentDate));switch(this.calendarInstance.currentView()){case"Month":var t=this.islamicCompareMonth(e,this.calendarInstance.min)<1,i=this.islamicCompareMonth(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(t),this.calendarInstance.nextIconHandler(i);break;case"Year":var s=this.hijriCompareYear(e,this.calendarInstance.min)<1,a=this.hijriCompareYear(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(s),this.calendarInstance.nextIconHandler(a);break;case"Decade":var n=this.hijriCompareDecade(e,this.calendarInstance.min)<1,r=this.hijriCompareDecade(e,this.calendarInstance.max)>-1;this.calendarInstance.previousIconHandler(n),this.calendarInstance.nextIconHandler(r)}},e.prototype.islamicNext=function(){this.calendarInstance.effect="";var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView()),t=this.getIslamicDate(this.calendarInstance.currentDate);switch(this.calendarInstance.currentView()){case"Year":this.calendarInstance.currentDate=this.toGregorian(t.year+1,t.month,1),this.calendarInstance.switchView(e);break;case"Month":this.calendarInstance.currentDate=this.toGregorian(t.year,t.month+1,1),this.calendarInstance.switchView(e);break;case"Decade":this.calendarInstance.currentDate=this.toGregorian(t.year+10,t.month,1),this.calendarInstance.switchView(e)}},e.prototype.islamicPrevious=function(){var e=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.effect="";var t=this.getIslamicDate(this.calendarInstance.currentDate);switch(this.calendarInstance.currentView()){case"Month":this.calendarInstance.currentDate=this.toGregorian(t.year,t.month-1,1),this.calendarInstance.switchView(e);break;case"Year":this.calendarInstance.currentDate=this.toGregorian(t.year-1,t.month,1),this.calendarInstance.switchView(e);break;case"Decade":this.calendarInstance.currentDate=this.toGregorian(t.year-10,t.month-1,1),this.calendarInstance.switchView(e)}},e.prototype.islamicRenderYears=function(e,i){this.calendarInstance.removeTableHeadElement();var s=[],a=t.isNullOrUndefined(i),n=new Date(this.islamicInValue(this.calendarInstance.currentDate)),r=this.getIslamicDate(n);n=t.HijriParser.toGregorian(r.year,1,1);var l=r.month,o=r.year,h=r.year,u=this.getIslamicDate(this.calendarInstance.min).year,d=this.getIslamicDate(this.calendarInstance.min).month,p=this.getIslamicDate(this.calendarInstance.max).year,c=this.getIslamicDate(this.calendarInstance.max).month;this.islamicTitleUpdate(this.calendarInstance.currentDate,"months");for(var m=1;m<=12;++m){var v=this.getIslamicDate(n);n=t.HijriParser.toGregorian(v.year,m,1);var f=this.islamicDayCell(n),y=this.calendarInstance.createElement("span"),g=i&&this.getIslamicDate(i).month===this.getIslamicDate(n).month,b=i&&this.getIslamicDate(i).year===o&&g;y.textContent=this.calendarInstance.globalize.formatDate(n,{type:"dateTime",format:"MMM",calendar:"islamic"}),this.calendarInstance.min&&(h<u||m<d&&h===u)||this.calendarInstance.max&&(h>p||m>c&&h>=p)?t.addClass([f],"e-disabled"):!a&&b?t.addClass([f],"e-selected"):this.getIslamicDate(n).month===l&&this.getIslamicDate(this.calendarInstance.currentDate).month===l&&t.addClass([f],"e-focused-date"),f.classList.contains("e-disabled")||t.EventHandler.add(f,"click",this.calendarInstance.clickHandler,this.calendarInstance),f.appendChild(y),s.push(f)}this.islamicRenderTemplate(s,4,"e-year",e,i)},e.prototype.islamicRenderDecade=function(e,i){this.calendarInstance.removeTableHeadElement();var s=[],a=new Date(this.islamicInValue(this.calendarInstance.currentDate)),n=this.getIslamicDate(a),r=(a=t.HijriParser.toGregorian(n.year,1,1)).getFullYear(),l=new Date(this.islamicInValue(r-r%10)),o=new Date(this.islamicInValue(r-r%10+9)),h=l.getFullYear(),u=o.getFullYear(),d=this.calendarInstance.globalize.formatDate(l,{type:"dateTime",format:"y",calendar:"islamic"}),p=this.calendarInstance.globalize.formatDate(o,{type:"dateTime",format:"y",calendar:"islamic"});this.calendarInstance.headerTitleElement.textContent=d+" - "+p;for(var c=new Date(r-r%10-2,0,1).getFullYear(),m=1;m<=12;++m){var v=c+m;a.setFullYear(v),a.setDate(1),a.setMonth(0);var f=this.getIslamicDate(a);a=t.HijriParser.toGregorian(f.year,1,1);var y=this.islamicDayCell(a);t.attributes(y,{role:"gridcell"});var g=this.calendarInstance.createElement("span");g.textContent=this.calendarInstance.globalize.formatDate(a,{type:"dateTime",format:"y",calendar:"islamic"}),v<h||v>u?t.addClass([y],"e-other-month"):v<new Date(this.islamicInValue(this.calendarInstance.min)).getFullYear()||v>new Date(this.islamicInValue(this.calendarInstance.max)).getFullYear()?t.addClass([y],"e-disabled"):t.isNullOrUndefined(i)||this.getIslamicDate(a).year!==this.getIslamicDate(i).year?a.getFullYear()!==this.calendarInstance.currentDate.getFullYear()||y.classList.contains("e-disabled")||t.addClass([y],"e-focused-date"):t.addClass([y],"e-selected"),y.classList.contains("e-disabled")||t.EventHandler.add(y,"click",this.calendarInstance.clickHandler,this.calendarInstance),y.appendChild(g),s.push(y)}this.islamicRenderTemplate(s,4,"e-decade",e,i)},e.prototype.islamicDayCell=function(e){var i={skeleton:"full",type:"dateTime",calendar:"islamic"},s=this.calendarInstance.globalize.formatDate(e,i),a=this.calendarInstance.globalize.parseDate(s,i).valueOf(),n={className:"e-cell",attrs:{id:""+t.getUniqueID(""+a),"aria-selected":"false",role:"gridcell"}};return this.calendarInstance.createElement("td",n)},e.prototype.islamicRenderTemplate=function(e,i,s,a,n){var r,l=this.calendarInstance.getViewNumber(this.calendarInstance.currentView());this.calendarInstance.tableBodyElement=this.calendarInstance.createElement("tbody"),this.calendarInstance.table.appendChild(this.calendarInstance.tableBodyElement),t.removeClass([this.calendarInstance.contentElement,this.calendarInstance.headerElement],["e-month","e-decade","e-year"]),t.addClass([this.calendarInstance.contentElement,this.calendarInstance.headerElement],[s]);for(var o=i,h=0,u=0;u<e.length/i;++u){for(r=this.calendarInstance.createElement("tr",{attrs:{role:"row"}}),h=0+h;h<o;h++)e[h].classList.contains("e-week-number")||t.isNullOrUndefined(e[h].children[0])||(t.addClass([e[h].children[0]],["e-day"]),t.rippleEffect(e[h].children[0],{duration:600,isCenterRipple:!0})),r.appendChild(e[h]),this.calendarInstance.weekNumber&&7===h&&e[7].classList.contains("e-other-month")&&t.addClass([r],"e-month-hide"),!this.calendarInstance.weekNumber&&6===h&&e[6].classList.contains("e-other-month")&&t.addClass([r],"e-month-hide"),this.calendarInstance.weekNumber?41===h&&e[41].classList.contains("e-other-month")&&t.addClass([r],"e-month-hide"):35===h&&e[35].classList.contains("e-other-month")&&t.addClass([r],"e-month-hide");o+=i,h+=0,this.calendarInstance.tableBodyElement.appendChild(r)}this.calendarInstance.table.querySelector("tbody").className=this.calendarInstance.effect,this.islamicIconHandler(),(l!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView())||0===l&&l!==this.calendarInstance.getViewNumber(this.calendarInstance.currentView()))&&this.calendarInstance.navigateHandler(a),this.calendarInstance.setAriaActiveDescendant(),this.calendarInstance.changedArgs={value:this.calendarInstance.value,values:this.calendarInstance.values},this.calendarInstance.changeHandler()},e.prototype.islamicCompareMonth=function(e,t){var i=this.getIslamicDate(e),s=this.getIslamicDate(t);return i.year>s.year?1:i.year<s.year?-1:i.month===s.month?0:i.month>s.month?1:-1},e.prototype.islamicCompare=function(e,t,i){var s,a,n=this.getIslamicDate(e),r=this.getIslamicDate(t).year;return s=r,a=0,i&&(s=(r-=r%i)-r%i+i-1),n.year>s?a=1:"Decade"===this.calendarInstance.currentView()&&n.year<r&&!(e.getFullYear()>=2060&&e.getFullYear()<=2069)?a=-1:n.year<r&&"Year"===this.calendarInstance.currentView()&&(a=-1),a},e.prototype.getIslamicDate=function(e){return t.HijriParser.getHijriDate(e)},e.prototype.toGregorian=function(e,i,s){return t.HijriParser.toGregorian(e,i,s)},e.prototype.hijriCompareYear=function(e,t){return this.islamicCompare(e,t,0)},e.prototype.hijriCompareDecade=function(e,t){return this.islamicCompare(e,t,10)},e.prototype.destroy=function(){this.calendarInstance=null},e.prototype.islamicInValue=function(e){return e instanceof Date?e.toUTCString():""+e},e}(),g=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),b=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},D="e-datepicker",E=["title","class","style"],C=function(e){function a(t,i){var s=e.call(this,t,i)||this;return s.previousElementValue="",s.isDateIconClicked=!1,s.isAltKeyPressed=!1,s.isInteracted=!0,s.isBlazorServer=!1,s.invalidValueString=null,s.checkPreviousValue=null,s.maskedDateValue="",s.isAngular=!1,s.preventChange=!1,s.isIconClicked=!1,s.isDynamicValueChanged=!1,s.moduleName=s.getModuleName(),s.datepickerOptions=t,s}return g(a,e),a.prototype.render=function(){this.initialize(),this.bindEvents(),this.renderComplete(),this.isBlazorServer||this.setTimeZone(this.serverTimezoneOffset)},a.prototype.setTimeZone=function(e){if(!t.isNullOrUndefined(this.serverTimezoneOffset)&&this.value){var i=e+(new Date).getTimezoneOffset()/60;i=this.isDayLightSaving()?i--:i,this.value=new Date(this.value.getTime()+60*i*60*1e3),this.updateInput()}},a.prototype.isDayLightSaving=function(){var e=new Date(this.value.getFullYear(),0,1).getTimezoneOffset(),t=new Date(this.value.getFullYear(),6,1).getTimezoneOffset();return this.value.getTimezoneOffset()<Math.max(e,t)},a.prototype.setAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.updateIconState()},a.prototype.updateIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],["e-non-edit"]):t.addClass([this.inputWrapper.container],["e-non-edit"])},a.prototype.initialize=function(){if(this.isBlazorServer){var e=this.element.parentElement;this.inputWrapper={container:e,clearButton:e.querySelector(".e-clear-icon"),buttons:[e.querySelector(".e-date-icon")]},s.Input.bindInitialEvent({element:this.inputElement,floatLabelType:this.floatLabelType}),this.showClearButton&&this.inputWrapper.clearButton&&s.Input.wireClearBtnEvents(this.inputElement,this.inputWrapper.clearButton,this.inputWrapper.container),this.setAllowEdit()}else this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}),this.checkInvalidValue(this.value),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setAllowEdit(),this.updateInput(),!this.enableMask||this.value||!this.maskedDateValue||"Always"!=this.floatLabelType&&this.floatLabelType&&this.placeholder||this.updateInputValue(this.maskedDateValue);this.previousElementValue=this.inputElement.value,this.previousDate=t.isNullOrUndefined(this.value)?null:new Date(+this.value),this.inputElement.setAttribute("value",this.inputElement.value),this.inputValueCopy=this.value},a.prototype.createInput=function(){var e={"aria-live":"assertive","aria-atomic":"true","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_options","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-invalid":"false"};if("datepicker"===this.getModuleName()){var i={placeholder:this.placeholder};this.globalize=new t.Internationalization(this.locale),this.l10n=new t.L10n("datepicker",i,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0)}var a=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(a=this.cssClass.replace(/\s+/g," ").trim());var n=!this.enableMask;this.inputWrapper=s.Input.createInput({element:this.inputElement,floatLabelType:this.floatLabelType,bindClearAction:n,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:a,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:["e-input-group-icon e-date-icon e-icons"]},this.createElement),this.setWidth(this.width),""!==this.inputElement.name?this.inputElement.setAttribute("name",""+this.inputElement.getAttribute("name")):this.inputElement.setAttribute("name",""+this.element.id),t.attributes(this.inputElement,e),this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1),s.Input.addAttributes({"aria-label":"select"},this.inputWrapper.buttons[0]),t.addClass([this.inputWrapper.container],"e-date-wrapper")},a.prototype.updateInput=function(i){void 0===i&&(i=!1);var s;if(!this.value||this.isCalendar()||i||this.isBlazorServer||this.disabledDates(),isNaN(+new Date(this.checkValue(this.value)))&&this.setProperties({value:null},!0),this.strictMode&&(e.prototype.validateDate.call(this),this.minMaxUpdates(),e.prototype.minMaxUpdate.call(this)),!t.isNullOrUndefined(this.value)){var a=this.value,n=void 0,r=t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString;if("datetimepicker"===this.getModuleName()?n="Gregorian"===this.calendarMode?this.globalize.formatDate(this.value,{format:r,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}):this.globalize.formatDate(this.value,{format:r,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(s="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},n=this.globalize.formatDate(this.value,s)),+a<=+this.max&&+a>=+this.min)this.updateInputValue(n);else{var l=+a>=+this.max||!+this.value||!+this.value||+a<=+this.min;!this.strictMode&&l&&this.updateInputValue(n)}}t.isNullOrUndefined(this.value)&&this.strictMode&&(this.enableMask?(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})):this.updateInputValue("")),!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&this.updateInputValue(this.invalidValueString),this.changedArgs={value:this.value},this.errorClass(),this.updateIconState()},a.prototype.minMaxUpdates=function(){!t.isNullOrUndefined(this.value)&&this.value<this.min&&this.min<=this.max&&this.strictMode?(this.setProperties({value:this.min},!0),this.changedArgs={value:this.value}):!t.isNullOrUndefined(this.value)&&this.value>this.max&&this.min<=this.max&&this.strictMode&&(this.setProperties({value:this.max},!0),this.changedArgs={value:this.value})},a.prototype.checkStringValue=function(e){var i=null,s=null,a=null;if("datetimepicker"===this.getModuleName()){var n=new t.Internationalization(this.locale);"Gregorian"===this.calendarMode?(s={format:this.dateTimeFormat,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"},a={format:n.getDatePattern({skeleton:t.isBlazor()?"d":"yMd"}),type:"dateTime"}):(s={format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},a={format:n.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else s="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};return i=this.checkDateValue(this.globalize.parseDate(e,s)),t.isNullOrUndefined(i)&&"datetimepicker"===this.getModuleName()&&(i=this.checkDateValue(this.globalize.parseDate(e,a))),i},a.prototype.checkInvalidValue=function(e){if(!(e instanceof Date||t.isNullOrUndefined(e))){var i=null,s=e;"number"==typeof e&&(s=e.toString());if("datetimepicker"===this.getModuleName()){var a=new t.Internationalization(this.locale);"Gregorian"===this.calendarMode?({format:this.dateTimeFormat,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"},{format:a.getDatePattern({skeleton:t.isBlazor()?"d":"yMd"}),type:"dateTime"}):({format:this.dateTimeFormat,type:"dateTime",skeleton:"yMd",calendar:"islamic"},{format:a.getDatePattern({skeleton:"yMd"}),type:"dateTime",calendar:"islamic"})}else"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};var n=!1;if("string"!=typeof s)s=null,n=!0;else if("string"==typeof s&&(s=s.trim()),!(i=this.checkStringValue(s))){var r=null;r=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(s)&&!r.test(s)||/^[a-zA-Z0-9- ]*$/.test(s)||isNaN(+new Date(this.checkValue(s)))?n=!0:i=new Date(s)}n?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0)):this.setProperties({value:i},!0)}},a.prototype.bindInputEvent=function(){t.isNullOrUndefined(this.formatString)&&!this.enableMask||(this.enableMask||-1===this.formatString.indexOf("y")?t.EventHandler.add(this.inputElement,"input",this.inputHandler,this):t.EventHandler.remove(this.inputElement,"input",this.inputHandler))},a.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown touchstart",this.isBlazorServer?this.preventEventBubbling:this.dateIconHandler,this),t.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),this.enableMask&&t.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.bindInputEvent(),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&(this.inputWrapper.clearButton||this.isBlazorServer)&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.resetFormHandler,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.keyboardModules=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})},a.prototype.keydownHandler=function(e){switch(e.code){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":case"Delete":!this.enableMask||this.popupObj||this.readonly||("Delete"!==e.code&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}))}},a.prototype.unBindEvents=function(){t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.isBlazorServer?this.preventEventBubbling:this.dateIconHandler),t.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.enableMask&&t.EventHandler.remove(this.inputElement,"keydown",this.keydownHandler),this.showClearButton&&(this.inputWrapper.clearButton||this.isBlazorServer)&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.resetFormHandler)},a.prototype.resetFormHandler=function(){if(this.enabled&&!this.inputElement.disabled){var e=this.inputElement.getAttribute("value");"EJS-DATEPICKER"!==this.element.tagName&&"EJS-DATETIMEPICKER"!==this.element.tagName||(e="",this.inputValueCopy=null,this.inputElement.setAttribute("value","")),this.isBlazorServer||(this.setProperties({value:this.inputValueCopy},!0),this.restoreValue(),this.inputElement&&(this.updateInputValue(e),this.errorClass()))}},a.prototype.restoreValue=function(){this.currentDate=this.value?this.value:new Date,this.previousDate=this.value,this.previousElementValue=t.isNullOrUndefined(this.inputValueCopy)?"":this.globalize.formatDate(this.inputValueCopy,{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"})},a.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},a.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},a.prototype.resetHandler=function(e){this.enabled&&(e.preventDefault(),this.clear(e))},a.prototype.mouseUpHandler=function(e){this.enableMask&&(e.preventDefault(),this.notify("setMaskSelection",{module:"MaskedDateTime"}))},a.prototype.clear=function(e){this.isBlazorServer||this.setProperties({value:null},!0),this.enableMask||this.updateInputValue("");var t={event:e};this.trigger("cleared",t),this.invalidValueString="",this.isBlazorServer||(this.updateInput(),this.popupUpdate(),this.changeEvent(e),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"})),this.isBlazorServer&&this.interopAdaptor.invokeMethodAsync("OnValueCleared")},a.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnDateIconClick")},a.prototype.updateInputValue=function(e){s.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},a.prototype.dateIconHandler=function(e){this.enabled&&(this.isIconClicked=!0,t.Browser.isDevice&&(this.inputElement.setAttribute("readonly",""),this.inputElement.blur()),this.isBlazorServer||e.preventDefault(),this.readonly||(this.isCalendar()&&!this.isBlazorServer?this.hide(e):(!this.isBlazorServer||this.isBlazorServer&&this.inputWrapper.container.nextElementSibling)&&(this.isDateIconClicked=!0,this.show(null,e),"datetimepicker"===this.getModuleName()&&this.inputElement.focus(),this.inputElement.focus(),t.addClass([this.inputWrapper.container],["e-input-focus"]),t.addClass(this.inputWrapper.buttons,"e-active"))),this.isIconClicked=!1)},a.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(!t.isNullOrUndefined(this.htmlAttributes[s])&&E.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);t.isNullOrUndefined(n)?n=this.htmlAttributes[s]:";"===n.charAt(n.length-1)?n+=this.htmlAttributes[s]:n=n+";"+this.htmlAttributes[s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[s])}},a.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];E.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[s])}},a.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},a.prototype.calendarKeyActionHandle=function(e){switch(e.action){case"escape":this.isCalendar()?this.hide(e):this.inputWrapper.container.children[this.index].blur();break;case"enter":this.isCalendar()?+this.value==+this.currentDate||this.isCalendar()||this.inputWrapper.container.children[this.index].focus():this.show(null,e),"datetimepicker"===this.getModuleName()&&this.inputElement.focus();break;case"tab":this.hide(e)}},a.prototype.inputFocusHandler=function(){if(this.enabled){this.enableMask&&!this.inputElement.value&&this.placeholder&&(!this.maskedDateValue||this.value||"Auto"!=this.floatLabelType&&"Never"!=this.floatLabelType&&!this.placeholder||(this.updateInputValue(this.maskedDateValue),this.inputElement.selectionStart=0,this.inputElement.selectionEnd=this.inputElement.value.length));var e={model:t.isBlazor()&&this.isServerRendered?null:this};this.isDateIconClicked=!1,this.trigger("focus",e),this.updateIconState(),this.openOnFocus&&!this.isIconClicked&&this.show()}},a.prototype.inputHandler=function(){this.isPopupClicked=!1,this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},a.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnStrictModeUpdate",this.inputElement.value):(this.strictModeUpdate(),""===this.inputElement.value&&t.isNullOrUndefined(this.value)&&(this.invalidValueString=null,this.updateInputValue("")),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.enableMask&&this.maskedDateValue&&this.placeholder&&"Always"!==this.floatLabelType&&(this.inputElement.value!=this.maskedDateValue||this.value||"Auto"!=this.floatLabelType&&"Never"!=this.floatLabelType&&!this.placeholder||this.updateInputValue("")),this.errorClass()),this.isCalendar()&&document.activeElement===this.inputElement&&this.hide(e),"datepicker"===this.getModuleName()){var i={model:t.isBlazor()&&this.isServerRendered?null:this};this.trigger("blur",i)}this.isCalendar()&&(this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.calendarKeyboardModules=new t.KeyboardEvents(this.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:this.calendarKeyActionHandle.bind(this),keyConfigs:this.defaultKeyConfigs})),this.isPopupClicked=!1}},a.prototype.documentHandler=function(i){!t.isNullOrUndefined(this.popupObj)&&(this.inputWrapper.container.contains(i.target)||this.popupObj.element&&this.popupObj.element.contains(i.target))&&"touchstart"!==i.type&&i.preventDefault();var s=i.target;t.closest(s,".e-datepicker.e-popup-wrapper")||t.closest(s,".e-input-group")===this.inputWrapper.container||s.classList.contains("e-day")?t.closest(s,".e-datepicker.e-popup-wrapper")&&(s.classList.contains("e-day")&&!t.isNullOrUndefined(i.target.parentElement)&&i.target.parentElement.classList.contains("e-selected")&&t.closest(s,".e-content")&&t.closest(s,".e-content").classList.contains("e-"+this.depth.toLowerCase())?this.hide(i):t.closest(s,".e-footer-container")&&s.classList.contains("e-today")&&s.classList.contains("e-btn")&&+new Date(+this.value)==+e.prototype.generateTodayVal.call(this,this.value)&&!this.isBlazorServer&&this.hide(i)):(this.hide(i),this.focusOut())},a.prototype.inputKeyActionHandle=function(e){var t=this.currentView();switch(e.action){case"altUpArrow":this.isAltKeyPressed=!1,this.hide(e),this.inputElement.focus();break;case"altDownArrow":this.isAltKeyPressed=!0,this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnStrictModeUpdate",this.inputElement.value):(this.strictModeUpdate(),this.updateInput(),this.changeTrigger(e)),"datepicker"===this.getModuleName()&&(this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnPopupHide",!0):this.show(null,e));break;case"escape":this.hide(e);break;case"enter":this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnStrictModeUpdate",this.inputElement.value):(this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass()),this.isCalendar()||document.activeElement!==this.inputElement||this.hide(e),this.isCalendar()&&(e.preventDefault(),e.stopPropagation());break;case"tab":case"shiftTab":var i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd;if(this.enableMask&&!this.popupObj&&!this.readonly){var a=this.inputElement.value.length;(0==i&&s==a||s!==a&&"tab"==e.action||0!==i&&"shiftTab"==e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}),i=this.inputElement.selectionStart,s=this.inputElement.selectionEnd}this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnStrictModeUpdate",this.inputElement.value):(this.strictModeUpdate(),this.updateInput(),this.popupUpdate(),this.changeTrigger(e),this.errorClass()),this.enableMask&&(this.inputElement.selectionStart=i,this.inputElement.selectionEnd=s),this.hide(e);break;default:this.defaultAction(e),"select"===e.action&&t===this.depth&&this.hide(e)}},a.prototype.defaultAction=function(i){this.previousDate=!t.isNullOrUndefined(this.value)&&new Date(+this.value)||null,this.isCalendar()&&(e.prototype.keyActionHandle.call(this,i),!this.isBlazorServer&&this.isCalendar()&&t.attributes(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()}))},a.prototype.popupUpdate=function(){if((t.isNullOrUndefined(this.value)&&!t.isNullOrUndefined(this.previousDate)||+this.value!=+this.previousDate)&&(this.popupObj&&this.popupObj.element.querySelectorAll(".e-selected").length>0&&t.removeClass(this.popupObj.element.querySelectorAll(".e-selected"),["e-selected"]),!t.isNullOrUndefined(this.value)&&!this.isBlazorServer&&+this.value>=+this.min&&+this.value<=+this.max)){var i=new Date(this.checkValue(this.value));e.prototype.navigateTo.call(this,"Month",i)}},a.prototype.strictModeUpdate=function(){var e,i;e="datetimepicker"===this.getModuleName()?t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString:t.isNullOrUndefined(this.formatString)?this.formatString:this.formatString.replace("dd","d"),t.isNullOrUndefined(e)||e.split("M").length-1<3&&(e=e.replace("MM","M"));var s;s="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:i="Gregorian"===this.calendarMode?{format:e,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:e,type:"dateTime",skeleton:"yMd",calendar:"islamic"};var a;"string"==typeof this.inputElement.value&&(this.inputElement.value=this.inputElement.value.trim()),"datetimepicker"===this.getModuleName()?this.checkDateValue(this.globalize.parseDate(this.inputElement.value,s))?a=this.globalize.parseDate(this.inputElement.value,s):(i="Gregorian"===this.calendarMode?{type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{type:"dateTime",skeleton:"yMd",calendar:"islamic"},a=this.globalize.parseDate(this.inputElement.value,i)):(a=this.globalize.parseDate(this.inputElement.value,s),a=!t.isNullOrUndefined(a)&&isNaN(+a)?null:a,!t.isNullOrUndefined(this.formatString)&&""!==this.inputElement.value&&this.strictMode&&(this.isPopupClicked||!this.isPopupClicked&&this.inputElement.value===this.previousElementValue)&&-1===this.formatString.indexOf("y")&&a.setFullYear(this.value.getFullYear())),"datepicker"===this.getModuleName()&&this.value&&!isNaN(+this.value)&&a&&a.setHours(this.value.getHours(),this.value.getMinutes(),this.value.getSeconds(),this.value.getMilliseconds()),this.strictMode&&a?(this.updateInputValue(this.globalize.formatDate(a,s)),this.inputElement.value!==this.previousElementValue&&this.setProperties({value:a},!0)):this.strictMode||this.inputElement.value!==this.previousElementValue&&this.setProperties({value:a},!0),this.strictMode&&!a&&""===this.inputElement.value&&this.setProperties({value:null},!0),isNaN(+this.value)&&this.setProperties({value:null},!0),t.isNullOrUndefined(this.value)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)))},a.prototype.createCalendar=function(){var e=this;this.isBlazorServer?(this.popupWrapper=this.inputWrapper.container.nextElementSibling,this.calendarElement=this.popupWrapper.firstElementChild,this.tableBodyElement=t.select("tbody",this.calendarElement),this.contentElement=t.select(".e-content",this.calendarElement)):(this.popupWrapper=this.createElement("div",{className:D+" e-popup-wrapper"}),t.isNullOrUndefined(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass)),t.Browser.isDevice&&(this.modelHeader(),this.modal=this.createElement("div"),this.modal.className=D+" e-date-modal",document.body.className+=" e-date-overflow",this.modal.style.display="block",document.body.appendChild(this.modal)),this.calendarElement.querySelector("table tbody").className="",this.popupObj=new i.Popup(this.popupWrapper,{content:this.isBlazorServer?null:this.calendarElement,relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,position:t.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},offsetY:4,targetType:"container",enableRtl:this.enableRtl,zIndex:this.zIndex,collision:t.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},open:function(){"datetimepicker"!==e.getModuleName()&&document.activeElement!==e.inputElement&&(e.defaultKeyConfigs=t.extend(e.defaultKeyConfigs,e.keyConfigs),e.calendarElement.children[1].firstElementChild.focus(),e.calendarKeyboardModules=new t.KeyboardEvents(e.calendarElement.children[1].firstElementChild,{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}),e.calendarKeyboardModules=new t.KeyboardEvents(e.inputWrapper.container.children[e.index],{eventName:"keydown",keyAction:e.calendarKeyActionHandle.bind(e),keyConfigs:e.defaultKeyConfigs}))},close:function(){e.isDateIconClicked&&e.inputWrapper.container.children[e.index].focus(),e.value&&!e.isBlazorServer&&e.disabledDates(),e.popupObj&&e.popupObj.destroy(),e.resetCalendar(),t.detach(e.popupWrapper),e.popupObj=e.popupWrapper=null,e.preventArgs=null,e.calendarKeyboardModules=null,e.setAriaAttributes()},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),this.isBlazorServer||(this.popupObj.element.className+=" "+this.cssClass),this.setAriaAttributes()},a.prototype.setAriaDisabled=function(){this.enabled?(this.inputElement.setAttribute("aria-disabled","false"),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.inputElement.setAttribute("aria-disabled","true"),this.inputElement.tabIndex=-1)},a.prototype.modelHeader=function(){var e,t=this.createElement("div",{className:"e-model-header"}),i=this.createElement("h1",{className:"e-model-year"}),s=this.createElement("div"),a=this.createElement("span",{className:"e-model-day"}),n=this.createElement("span",{className:"e-model-month"});e="Gregorian"===this.calendarMode?{format:"y",skeleton:"dateTime"}:{format:"y",skeleton:"dateTime",calendar:"islamic"},i.textContent=""+this.globalize.formatDate(this.value||new Date,e),e="Gregorian"===this.calendarMode?{format:"E",skeleton:"dateTime"}:{format:"E",skeleton:"dateTime",calendar:"islamic"},a.textContent=this.globalize.formatDate(this.value||new Date,e)+", ",e="Gregorian"===this.calendarMode?{format:"MMM d",skeleton:"dateTime"}:{format:"MMM d",skeleton:"dateTime",calendar:"islamic"},n.textContent=""+this.globalize.formatDate(this.value||new Date,e),t.appendChild(i),s.appendChild(a),s.appendChild(n),t.appendChild(s),this.calendarElement.insertBefore(t,this.calendarElement.firstElementChild)},a.prototype.changeTrigger=function(e){this.inputElement.value!==this.previousElementValue&&(this.previousDate&&this.previousDate.valueOf())!==(this.value&&this.value.valueOf())&&(this.isDynamicValueChanged&&this.isCalendar()&&this.popupUpdate(),this.changedArgs.value=this.value,this.changedArgs.event=e||null,this.changedArgs.element=this.element,this.changedArgs.isInteracted=!t.isNullOrUndefined(e),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.changedArgs),this.previousElementValue=this.inputElement.value,this.previousDate=isNaN(+new Date(this.checkValue(this.value)))?null:new Date(this.checkValue(this.value)),this.isInteracted=!0)},a.prototype.navigatedEvent=function(){this.trigger("navigated",this.navigatedArgs)},a.prototype.changeEvent=function(e){(this.previousDate&&this.previousDate.valueOf())!==(this.value&&this.value.valueOf())&&(this.selectCalendar(e),this.changedArgs.event=e||null,this.changedArgs.element=this.element,this.changedArgs.isInteracted=this.isInteracted,this.isDynamicValueChanged||this.trigger("change",this.changedArgs),this.previousDate=this.value&&new Date(+this.value),this.isDynamicValueChanged||this.hide(e),this.previousElementValue=this.inputElement.value,this.errorClass())},a.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},a.prototype.selectCalendar=function(e){var i,s,a;s="datetimepicker"===this.getModuleName()&&t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,this.value&&("datetimepicker"===this.getModuleName()?(a="Gregorian"===this.calendarMode?{format:s,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:s,type:"dateTime",skeleton:"yMd",calendar:"islamic"},i=this.globalize.formatDate(this.changedArgs.value,a)):(a="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},i=this.globalize.formatDate(this.changedArgs.value,a)),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})),t.isNullOrUndefined(i)||(this.updateInputValue(i),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}))},a.prototype.isCalendar=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains("e-popup-wrapper"))},a.prototype.setWidth=function(e){this.inputWrapper.container.style.width="number"==typeof e?t.formatUnit(this.width):"string"==typeof e?e.match(/px|%|em/)?this.width:t.formatUnit(this.width):"100%"},a.prototype.show=function(i,s){var a=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupObj)){var n=!0,r=void 0;t.isNullOrUndefined(this.value)||+this.value>=+this.min&&+this.value<=+this.max?r=this.value||null:(r=new Date(this.checkValue(this.value)),this.isBlazorServer||this.setProperties({value:null},!0)),this.isCalendar()||(this.isBlazorServer||(e.prototype.render.call(this),this.setProperties({value:r||null},!0)),this.previousDate=r,this.createCalendar()),t.Browser.isDevice&&(this.mobilePopupWrapper=this.createElement("div",{className:"e-datepick-mob-popup-wrap"}),document.body.appendChild(this.mobilePopupWrapper)),this.preventArgs={preventDefault:function(){n=!1},popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj,event:s||null,cancel:!1,appendTo:t.Browser.isDevice?this.mobilePopupWrapper:document.body};var l=this.preventArgs;this.trigger("open",l,function(i){if(a.preventArgs=i,n&&!a.preventArgs.cancel){a.isBlazorServer&&(a.popupWrapper.style.visibility="",a.popupWrapper.style.width="auto",a.popupWrapper.style.height="auto"),t.addClass(a.inputWrapper.buttons,"e-active"),a.preventArgs.appendTo.appendChild(a.popupWrapper),a.popupObj.refreshPosition(a.inputElement);var s={name:"FadeIn",duration:t.Browser.isDevice?0:300};1e3===a.zIndex?a.popupObj.show(new t.Animation(s),a.element):a.popupObj.show(new t.Animation(s),null),a.isBlazorServer||e.prototype.setOverlayIndex.call(a,a.mobilePopupWrapper,a.popupObj.element,a.modal,t.Browser.isDevice),a.setAriaAttributes()}else a.popupObj.destroy(),a.isBlazorServer&&a.interopAdaptor.invokeMethodAsync("OnPopupHide",!1),a.popupWrapper=a.popupObj=null;t.isNullOrUndefined(a.inputElement)||""!==a.inputElement.value||!t.isNullOrUndefined(a.tableBodyElement)&&a.tableBodyElement.querySelectorAll("td.e-selected").length>0&&(t.addClass([a.tableBodyElement.querySelector("td.e-selected")],"e-focused-date"),t.removeClass(a.tableBodyElement.querySelectorAll("td.e-selected"),"e-selected")),t.EventHandler.add(document,"mousedown touchstart",a.documentHandler,a)})}},a.prototype.hide=function(e){var i=this;if(t.isNullOrUndefined(this.popupWrapper))t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit();else{var s=!0;this.preventArgs={preventDefault:function(){s=!1},popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj,event:e||null,cancel:!1},t.removeClass(this.inputWrapper.buttons,"e-active"),t.removeClass([document.body],"e-date-overflow");var a=this.preventArgs;this.isCalendar()?this.trigger("close",a,function(e){i.closeEventCallback(s,e)}):this.closeEventCallback(s,a)}},a.prototype.closeEventCallback=function(e,i){this.preventArgs=i,this.isCalendar()&&e&&!this.preventArgs.cancel&&(this.isBlazorServer?(this.interopAdaptor.invokeMethodAsync("OnPopupHide",!1),this.isAltKeyPressed=!1,this.popupWrapper=this.popupObj=null):(this.popupObj.hide(),this.isAltKeyPressed=!1,this.keyboardModule.destroy()),t.removeClass(this.inputWrapper.buttons,"e-active")),this.setAriaAttributes(),t.Browser.isDevice&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null),t.Browser.isDevice&&(t.isNullOrUndefined(this.mobilePopupWrapper)||(this.mobilePopupWrapper.remove(),this.mobilePopupWrapper=null)),t.EventHandler.remove(document,"mousedown touchstart",this.documentHandler),t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},a.prototype.focusIn=function(e){document.activeElement!==this.inputElement&&this.enabled&&(this.inputElement.focus(),t.addClass([this.inputWrapper.container],["e-input-focus"]))},a.prototype.focusOut=function(){document.activeElement===this.inputElement&&(t.removeClass([this.inputWrapper.container],["e-input-focus"]),this.inputElement.blur())},a.prototype.currentView=function(){var t;return this.calendarElement&&(t=e.prototype.currentView.call(this)),t},a.prototype.navigateTo=function(t,i){this.calendarElement&&e.prototype.navigateTo.call(this,t,i)},a.prototype.destroy=function(){this.unBindEvents(),this.isBlazorServer||(e.prototype.destroy.call(this),this.keyboardModules.destroy(),this.popupObj&&this.popupObj.element.classList.contains("e-popup")&&e.prototype.destroy.call(this));var i={"aria-live":"assertive","aria-atomic":"true","aria-disabled":"true","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_options","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"};this.inputElement&&(s.Input.removeAttributes(i,this.inputElement),t.isNullOrUndefined(this.inputElementCopy.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),this.ensureInputAttribute()),this.isCalendar()&&(this.popupWrapper&&t.detach(this.popupWrapper),this.popupObj=this.popupWrapper=null,this.isBlazorServer||this.keyboardModule.destroy()),null===this.ngTag&&(this.inputElement&&(this.inputWrapper.container.insertAdjacentElement("afterend",this.inputElement),t.removeClass([this.inputElement],["e-input"])),t.removeClass([this.element],[D]),t.detach(this.inputWrapper.container)),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.resetFormHandler)},a.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.inputElementCopy.getAttribute(e[i]))?("value"===e[i].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[i])):("value"===e[i].toLowerCase()&&(this.inputElement.value=this.inputElementCopy.getAttribute(e[i])),this.inputElement.setAttribute(e[i],this.inputElementCopy.getAttribute(e[i])))},a.prototype.preRender=function(){this.inputElementCopy=this.element.cloneNode(!0),t.removeClass([this.inputElementCopy],[D,"e-control","e-lib"]),this.inputElement=this.element,this.formElement=t.closest(this.inputElement,"form"),this.index=this.showClearButton?2:1,this.isBlazorServer=!(!t.isBlazor()||!this.isServerRendered||"datepicker"!==this.getModuleName()),this.isBlazorServer||(this.ngTag=null,"EJS-DATEPICKER"!==this.element.tagName&&"EJS-DATETIMEPICKER"!==this.element.tagName||(this.ngTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.element.getAttribute("id")?null!==this.ngTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):"datetimepicker"===this.getModuleName()?(this.element.id=t.getUniqueID("ej2-datetimepicker"),null!==this.ngTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})):(this.element.id=t.getUniqueID("ej2-datepicker"),null!==this.ngTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})),null!==this.ngTag&&this.validationAttribute(this.element,this.inputElement),this.updateHtmlAttributeToElement()),this.defaultKeyConfigs=this.getDefaultKeyConfig(),this.checkHtmlAttributes(!1),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.isBlazorServer||(this.element.removeAttribute("tabindex"),e.prototype.preRender.call(this))},a.prototype.getDefaultKeyConfig=function(){return this.defaultKeyConfigs={altUpArrow:"alt+uparrow",altDownArrow:"alt+downarrow",escape:"escape",enter:"enter",controlUp:"ctrl+38",controlDown:"ctrl+40",moveDown:"downarrow",moveUp:"uparrow",moveLeft:"leftarrow",moveRight:"rightarrow",select:"enter",home:"home",end:"end",pageUp:"pageup",pageDown:"pagedown",shiftPageUp:"shift+pageup",shiftPageDown:"shift+pagedown",controlHome:"ctrl+home",controlEnd:"ctrl+end",shiftTab:"shift+tab",tab:"tab"},this.defaultKeyConfigs},a.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},a.prototype.checkFormat=function(){var e=new t.Internationalization(this.locale);if(this.format)if("string"==typeof this.format)this.formatString=t.isBlazor()?this.format.replace(/tt/,"a"):this.format;else if(""===this.format.skeleton||t.isNullOrUndefined(this.format.skeleton))"datetimepicker"===this.getModuleName()?this.formatString=this.dateTimeFormat:this.formatString=null;else{var i=this.format.skeleton;"datetimepicker"===this.getModuleName()?this.formatString=e.getDatePattern({skeleton:i,type:"dateTime"}):this.formatString=e.getDatePattern({skeleton:i,type:"date"})}else this.formatString=null},a.prototype.checkHtmlAttributes=function(e){this.globalize=new t.Internationalization(this.locale),this.checkFormat(),this.checkView();var i,s=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","disabled","readonly","style","name","placeholder","type"];i="datetimepicker"===this.getModuleName()?"Gregorian"===this.calendarMode?{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}:"Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"};for(var a=0,n=s;a<n.length;a++){var r=n[a];if(!t.isNullOrUndefined(this.inputElement.getAttribute(r)))switch(r){case"disabled":if((t.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.enabled||e)&&!this.isBlazorServer){var l="disabled"!==this.inputElement.getAttribute(r)&&""!==this.inputElement.getAttribute(r)&&"true"!==this.inputElement.getAttribute(r);this.setProperties({enabled:l},!e)}break;case"readonly":if((t.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.readonly||e)&&!this.isBlazorServer){var o="readonly"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r);this.setProperties({readonly:o},!e)}break;case"placeholder":!t.isNullOrUndefined(this.datepickerOptions)&&void 0!==this.datepickerOptions.placeholder&&!e||this.isBlazorServer||this.setProperties({placeholder:this.inputElement.getAttribute(r)},!e);break;case"style":this.isBlazorServer||this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(r));break;case"name":this.isBlazorServer||this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(r));break;case"value":if((t.isNullOrUndefined(this.datepickerOptions)||void 0===this.datepickerOptions.value||e)&&!this.isBlazorServer){var h=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,this.globalize.parseDate(h,i),{}),!e)}break;case"min":if(+this.min==+new Date(1900,0,1)||e){var u=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,this.globalize.parseDate(u),{}),!e)}break;case"max":if(+this.max==+new Date(2099,11,31)||e){var d=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,this.globalize.parseDate(d),{}),!e)}break;case"type":"text"===this.inputElement.getAttribute(r)||this.isBlazorServer||this.inputElement.setAttribute("type","text")}}},a.prototype.getModuleName=function(){return"datepicker"},a.prototype.disabledDates=function(){var i,s=this.checkDateValue(this.value)?new Date(+this.value):new Date(this.checkValue(this.value)),a=this.previousDate;this.minMaxUpdates(),this.isBlazorServer||e.prototype.render.call(this),this.previousDate=a;var n=s&&+s,r='*[id^="/id"]'.replace("/id",""+n);this.strictMode||("string"==typeof this.value||"object"==typeof this.value&&+this.value!=+s)&&this.setProperties({value:s},!0),t.isNullOrUndefined(this.calendarElement.querySelectorAll(r)[0])||this.calendarElement.querySelectorAll(r)[0].classList.contains("e-disabled")&&(this.strictMode||(this.currentDate=new Date((new Date).setHours(0,0,0,0))));var l;"datetimepicker"===this.getModuleName()?l="Gregorian"===this.calendarMode?this.globalize.formatDate(s,{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}):this.globalize.formatDate(s,{format:t.isNullOrUndefined(this.formatString)?this.dateTimeFormat:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}):(i="Gregorian"===this.calendarMode?{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"},l=this.globalize.formatDate(s,i)),this.popupObj||(this.updateInputValue(l),this.enableMask&&(this.updateInputValue(this.maskedDateValue),this.notify("createMask",{module:"MaskedDateTime"})))},a.prototype.setAriaAttributes=function(){if(this.isBlazorServer)if(this.isCalendar()){var e=this.tableBodyElement.querySelector("tr td.e-focused-date"),i=this.tableBodyElement.querySelector("tr td.e-selected"),a=e||i?(e||i).getAttribute("id"):"null";t.attributes(this.inputElement,{"aria-activedescendant":""+a})}else t.attributes(this.inputElement,{"aria-activedescendant":"null"});else this.isCalendar()?(s.Input.addAttributes({"aria-expanded":"true"},this.inputElement),t.attributes(this.inputElement,{"aria-activedescendant":""+this.setActiveDescendant()})):(s.Input.addAttributes({"aria-expanded":"false"},this.inputElement),t.attributes(this.inputElement,{"aria-activedescendant":"null"}))},a.prototype.errorClass=function(){var e='*[id^="/id"]'.replace("/id",""+ +this.value),i=this.calendarElement&&this.calendarElement.querySelectorAll(e)[0]&&this.calendarElement.querySelectorAll(e)[0].classList.contains("e-disabled");!t.isNullOrUndefined(this.value)&&!(+new Date(+this.value).setMilliseconds(0)>=+this.min&&+new Date(+this.value).setMilliseconds(0)<=+this.max)||!this.strictMode&&""!==this.inputElement.value&&this.inputElement.value!==this.maskedDateValue&&t.isNullOrUndefined(this.value)||i?(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"})):(t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"}))},a.prototype.onPropertyChanged=function(i,a){for(var n=0,r=Object.keys(i);n<r.length;n++){switch(r[n]){case"value":this.isDynamicValueChanged=!0,this.isInteracted=!1,this.invalidValueString=null,this.isBlazorServer||this.checkInvalidValue(i.value),i.value=this.value,this.previousElementValue=this.inputElement.value,this.isBlazorServer||(t.isNullOrUndefined(this.value)&&(this.updateInputValue(""),this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.updateInput(!0),+this.previousDate!=+this.value&&this.changeTrigger(null)),this.isInteracted=!0,this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange,this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"});break;case"format":this.checkFormat(),this.bindInputEvent(),this.isBlazorServer||(this.updateInput(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||this.updateInputValue(this.maskedDateValue)));break;case"allowEdit":this.setAllowEdit();break;case"placeholder":s.Input.setPlaceholder(this.placeholder,this.inputElement);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement);break;case"enabled":s.Input.setEnabled(this.enabled,this.inputElement),this.setAriaDisabled();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkHtmlAttributes(!0);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement),this.isBlazorServer||(this.updateInput(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}));break;case"enableRtl":s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"start":case"depth":this.checkView(),this.calendarElement&&!this.isBlazorServer&&e.prototype.onPropertyChanged.call(this,i,a);break;case"zIndex":this.setProperties({zIndex:i.zIndex},!0);break;case"cssClass":this.updateCssClass(i.cssClass,a.cssClass);break;case"showClearButton":s.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent(),this.index=this.showClearButton?2:1;break;case"strictMode":this.invalidValueString=null,this.isBlazorServer||this.updateInput();break;case"width":this.setWidth(i.width);break;case"floatLabelType":this.floatLabelType=i.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),this.updateInputValue(this.maskedDateValue),this.bindInputEvent()):this.inputElement.value===this.maskedDateValue&&this.updateInputValue("");break;default:this.calendarElement&&!this.isBlazorServer&&this.isCalendar()&&e.prototype.onPropertyChanged.call(this,i,a)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},b([t.Property(null)],a.prototype,"width",void 0),b([t.Property(null)],a.prototype,"value",void 0),b([t.Property(null)],a.prototype,"cssClass",void 0),b([t.Property(!1)],a.prototype,"strictMode",void 0),b([t.Property(null)],a.prototype,"format",void 0),b([t.Property(!0)],a.prototype,"enabled",void 0),b([t.Property({})],a.prototype,"htmlAttributes",void 0),b([t.Property(null)],a.prototype,"values",void 0),b([t.Property(!1)],a.prototype,"isMultiSelection",void 0),b([t.Property(!0)],a.prototype,"showClearButton",void 0),b([t.Property(!0)],a.prototype,"allowEdit",void 0),b([t.Property(null)],a.prototype,"keyConfigs",void 0),b([t.Property(!1)],a.prototype,"enablePersistence",void 0),b([t.Property(1e3)],a.prototype,"zIndex",void 0),b([t.Property(!1)],a.prototype,"readonly",void 0),b([t.Property(null)],a.prototype,"placeholder",void 0),b([t.Property("Never")],a.prototype,"floatLabelType",void 0),b([t.Property(null)],a.prototype,"serverTimezoneOffset",void 0),b([t.Property(!1)],a.prototype,"openOnFocus",void 0),b([t.Property(!1)],a.prototype,"enableMask",void 0),b([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],a.prototype,"maskPlaceholder",void 0),b([t.Event()],a.prototype,"open",void 0),b([t.Event()],a.prototype,"cleared",void 0),b([t.Event()],a.prototype,"close",void 0),b([t.Event()],a.prototype,"blur",void 0),b([t.Event()],a.prototype,"focus",void 0),b([t.Event()],a.prototype,"created",void 0),b([t.Event()],a.prototype,"destroyed",void 0),a=b([t.NotifyPropertyChanges],a)}(f),k=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),M=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},w="e-left-calendar",V="e-right-calendar",O="e-daterangepicker",N="e-active",I="e-start-date",S="e-end-date",A="e-range-hover",x="e-disabled",T="e-calendar",P="e-focused-date",U="e-day-span",H="e-date-disabled",B="e-icon-disabled",W="e-overlay",z="e-list-item",L="e-hover",F=["title","class","style"],j=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),M([t.Property()],i.prototype,"label",void 0),M([t.Property()],i.prototype,"start",void 0),M([t.Property()],i.prototype,"end",void 0),i}(t.ChildProperty),R=function(e){function r(t,i){var s=e.call(this,t,i)||this;return s.isCustomRange=!1,s.isCustomWindow=!1,s.presetsItem=[],s.liCollections=[],s.previousEleValue="",s.isKeyPopup=!1,s.dateDisabled=!1,s.isRangeIconClicked=!1,s.isMaxDaysClicked=!1,s.disabledDays=[],s.preventBlur=!1,s.preventFocus=!1,s.invalidValueString=null,s.isAngular=!1,s.preventChange=!1,s.dateRangeOptions=t,s}return k(r,e),r.prototype.render=function(){this.initialize(),this.setProperties({startDate:this.startValue},!0),this.setProperties({endDate:this.endValue},!0),this.setModelValue(),this.setDataAttribute(!1),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.renderComplete()},r.prototype.preRender=function(){if(this.keyInputConfigs={altDownArrow:"alt+downarrow",escape:"escape",enter:"enter",tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow",moveUp:"uparrow",moveDown:"downarrow",spacebar:"space"},this.defaultConstant={placeholder:this.placeholder,startLabel:"Start Date",endLabel:"End Date",customRange:"Custom Range",applyText:"Apply",cancelText:"Cancel",selectedDays:"Selected Days",days:"days"},this.isMobile=window.matchMedia("(max-width:550px)").matches,this.inputElement=this.element,this.angularTag=null,"EJS-DATERANGEPICKER"===this.element.tagName&&(this.angularTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],[O,"e-control","e-lib"]),this.updateHtmlAttributeToElement(),this.element.getAttribute("id")?null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"):(this.element.id=t.getUniqueID("ej2-datetimepicker"),null!==this.angularTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})),this.checkInvalidRange(this.value),!this.invalidValueString&&"string"==typeof this.value){var i=this.value.split(" "+this.separator+" ");this.value=[new Date(i[0]),new Date(i[1])]}this.initProperty(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),e.prototype.preRender.call(this),this.navNextFunction=this.navNextMonth.bind(this),this.navPrevFunction=this.navPrevMonth.bind(this),this.deviceNavNextFunction=this.deviceNavNext.bind(this),this.deviceNavPrevFunction=this.deviceNavPrevious.bind(this),this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.formElement=t.closest(this.element,"form")},r.prototype.updateValue=function(){this.value&&this.value.length>0?(this.value[0]instanceof Date&&!isNaN(+this.value[0])?(this.setProperties({startDate:this.value[0]},!0),this.startValue=this.value[0]):"string"==typeof this.value[0]?0==+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.startValue=null,this.setValue()):(this.setProperties({startDate:new Date(this.checkValue(this.value[0]))},!0),this.startValue=new Date(this.checkValue(this.value[0]))):(this.startValue=null,this.setValue()),this.value[1]instanceof Date&&!isNaN(+this.value[1])?(this.setProperties({endDate:this.value[1]},!0),this.endValue=this.value[1]):"string"==typeof this.value[1]?0==+this.value[0]||isNaN(+new Date(this.checkValue(this.value[0])))?(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue()):(this.setProperties({endDate:new Date(this.checkValue(this.value[1]))},!0),this.endValue=new Date(this.checkValue(this.value[1])),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):this.value&&this.value.start?(this.value.start instanceof Date&&!isNaN(+this.value.start)?(this.setProperties({startDate:this.value.start},!0),this.startValue=this.value.start):"string"==typeof this.value.start?(this.setProperties({startDate:new Date(this.checkValue(this.value.start))},!0),this.startValue=new Date(this.checkValue(this.value.start))):(this.startValue=null,this.setValue()),this.value.end instanceof Date&&!isNaN(+this.value.end)?(this.setProperties({endDate:this.value.end},!0),this.endValue=this.value.end):"string"==typeof this.value.end?(this.setProperties({endDate:new Date(this.checkValue(this.value.end))},!0),this.endValue=new Date(this.checkValue(this.value.end)),this.setValue()):(this.setProperties({endDate:null},!0),this.endValue=null,this.setValue())):t.isNullOrUndefined(this.value)&&(this.endValue=this.checkDateValue(new Date(this.checkValue(this.endDate))),this.startValue=this.checkDateValue(new Date(this.checkValue(this.startDate))),this.setValue())},r.prototype.initProperty=function(){this.globalize=new t.Internationalization(this.locale),this.checkFormat(),this.checkView(),(t.isNullOrUndefined(this.firstDayOfWeek)||this.firstDayOfWeek>6||this.firstDayOfWeek<0)&&this.setProperties({firstDayOfWeek:this.globalize.getFirstDayOfWeek()},!0),this.updateValue()},r.prototype.checkFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(""===this.format.skeleton||t.isNullOrUndefined(this.format.skeleton))this.formatString=null;else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({skeleton:e,type:"date"})}else this.formatString=null},r.prototype.initialize=function(){null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.checkHtmlAttributes(!1),t.merge(this.defaultKeyConfigs,{shiftTab:"shift+tab"});var e=this.checkDateValue(new Date(this.checkValue(this.startValue)));this.setProperties({startDate:e},!0),this.setProperties({endValue:this.checkDateValue(new Date(this.checkValue(this.endValue)))},!0),this.setValue(),this.setProperties({min:this.checkDateValue(new Date(this.checkValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkValue(this.max)))},!0),this.l10n=new t.L10n("daterangepicker",this.defaultConstant,this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.processPresets(),this.createInput(),this.updateHtmlAttributeToWrapper(),this.setRangeAllowEdit(),this.bindEvents()},r.prototype.setDataAttribute=function(e){var t={};if(e)t=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)t[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,a=Object.keys(t);s<a.length;s++){var n=a[s];0===n.indexOf("data")&&(this.firstHiddenChild.setAttribute(n,t[n]),this.secondHiddenChild.setAttribute(n,t[n]))}},r.prototype.setRangeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.updateClearIconState()},r.prototype.updateClearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],["e-non-edit"]):t.addClass([this.inputWrapper.container],["e-non-edit"])},r.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},r.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(F.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);n=t.isNullOrUndefined(n)?this.htmlAttributes[s]:n+this.htmlAttributes[s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[s])}},r.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];F.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[s])}},r.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},r.prototype.processPresets=function(){this.presetsItem=[];var e=0;if(!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){for(var i=0,s=this.presets;i<s.length;i++){var a=s[i],n=a.label.replace(/\s+/g,"")+"_"+ ++e;"string"==typeof a.end?this.presetsItem.push({id:n,text:a.label,end:new Date(this.checkValue(a.end)),start:new Date(this.checkValue(a.start))}):this.presetsItem.push({id:n,text:a.label,start:a.start,end:a.end})}var r=t.isNullOrUndefined(this.startValue)?null:new Date(+this.startValue),l=t.isNullOrUndefined(this.endValue)?null:new Date(+this.endValue);this.presetsItem.push({id:"custom_range",text:this.l10n.getConstant("customRange"),start:r,end:l}),t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.endValue)||(this.isCustomRange=!0,this.activeIndex=this.presetsItem.length-1)}},r.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this),this.isMobile||(this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.inputKeyboardModule=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputHandler.bind(this),keyConfigs:this.keyInputConfigs})),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1},r.prototype.unBindEvents=function(){t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler),this.isMobile||t.isNullOrUndefined(this.inputKeyboardModule)||this.inputKeyboardModule.destroy(),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),this.inputElement.tabIndex=-1},r.prototype.updateHiddenInput=function(){if(this.firstHiddenChild&&this.secondHiddenChild){var e={type:"datetime",skeleton:t.isBlazor()?"d":"yMd"};"string"==typeof this.startDate&&(this.startDate=this.globalize.parseDate(this.startDate,e)),"string"==typeof this.endDate&&(this.endDate=this.globalize.parseDate(this.endDate,e)),this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e)||this.inputElement.value,this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e)||this.inputElement.value,this.dispatchEvent(this.firstHiddenChild,"focusout"),this.dispatchEvent(this.firstHiddenChild,"change")}},r.prototype.inputChangeHandler=function(e){this.enabled&&(e.stopPropagation(),this.updateHiddenInput())},r.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},r.prototype.resetHandler=function(e){if(this.enabled){this.valueType=this.value,e.preventDefault(),this.clear();var t={event:e};this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.trigger("cleared",t),this.changeTrigger(e),this.clearRange(),this.hide(e)}},r.prototype.restoreValue=function(){this.previousEleValue=this.inputElement.value,this.previousStartValue=this.startValue,this.previousEndValue=this.endValue,this.valueType=null,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue),this.setValue(),this.setModelValue()},r.prototype.formResetHandler=function(e){if(this.enabled&&this.formElement&&e.target===this.formElement&&!this.inputElement.disabled){var i=this.inputElement.getAttribute("value");t.isNullOrUndefined(this.startCopy)?(this.setProperties({value:null,startDate:null,endDate:null},!0),this.startValue=this.endValue=null):(t.isNullOrUndefined(this.value)||t.isNullOrUndefined(this.value.start)?(this.setProperties({value:[this.startCopy,this.endCopy]},!0),this.startValue=this.value[0],this.endValue=this.value[1]):(this.setProperties({value:{start:this.startCopy,end:this.endCopy}},!0),this.startValue=this.value.start,this.endValue=this.value.end),this.setProperties({startDate:this.startValue,endDate:this.endValue},!0)),"EJS-DATERANGEPICKER"===this.element.tagName&&(this.setProperties({value:null,startDate:null,endDate:null},!0),i="",this.startValue=this.endValue=null,this.inputElement.setAttribute("value","")),this.restoreValue(),this.inputElement&&(s.Input.setValue(i,this.inputElement,this.floatLabelType,this.showClearButton),this.errorClass())}},r.prototype.clear=function(){null!==this.startValue&&(this.startValue=null),null!==this.endValue&&(this.endValue=null),this.value&&this.value.start&&this.setProperties({value:{start:null,end:null}},!0),null!==this.value&&this.value.length>0&&this.setProperties({value:null},!0),s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),t.isNullOrUndefined(this.applyButton)||(this.applyButton.disabled=this.applyButton.element.disabled=!0),this.removeSelection()},r.prototype.rangeIconHandler=function(e){this.enabled&&(this.isMobile&&this.inputElement.setAttribute("readonly",""),e.preventDefault(),this.targetElement=null,this.isPopupOpen()&&document.body.contains(this.popupObj.element)?this.applyFunction(e):(this.isRangeIconClicked=!0,this.inputWrapper.container.children[0].focus(),this.show(null,e),this.isMobile||t.isNullOrUndefined(this.leftCalendar)||(this.isRangeIconClicked=!1,this.calendarFocus(),this.isRangeIconClicked=!0),t.addClass([this.inputWrapper.container],["e-input-focus"])))},r.prototype.checkHtmlAttributes=function(e){this.globalize=new t.Internationalization(this.locale);for(var i=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["startDate","endDate","minDays","maxDays","min","max","disabled","readonly","style","name","placeholder","type","value"],s={format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"},a=0,n=i;a<n.length;a++){var r=n[a];if(!t.isNullOrUndefined(this.inputElement.getAttribute(r)))switch(r){case"disabled":if(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.enabled||e){var l="disabled"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r);this.setProperties({enabled:!l},!e)}break;case"readonly":if(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.readonly||e){var o="readonly"===this.inputElement.getAttribute(r)||"true"===this.inputElement.getAttribute(r)||""===this.inputElement.getAttribute(r);this.setProperties({readonly:o},!e)}break;case"placeholder":(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(r)},!e);break;case"value":if(t.isNullOrUndefined(this.dateRangeOptions)||void 0===this.dateRangeOptions.value||e){var h=this.inputElement.getAttribute(r);this.setProperties(t.setValue(r,h,{}),!e)}break;case"style":this.inputElement.setAttribute("style",""+this.inputElement.getAttribute(r));break;case"min":if(t.isNullOrUndefined(this.min)||+this.min==+new Date(1900,0,1)||e){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.setProperties(t.setValue(r,u,{}),!e)}break;case"name":this.inputElement.setAttribute("name",""+this.inputElement.getAttribute(r));break;case"max":if(t.isNullOrUndefined(this.max)||+this.max==+new Date(2099,11,31)||e){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.setProperties(t.setValue(r,u,{}),!e)}break;case"startDate":if(t.isNullOrUndefined(this.startDate)){u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.startValue=u,this.setValue()}break;case"endDate":if(t.isNullOrUndefined(this.endDate)){var u=this.globalize.parseDate(this.inputElement.getAttribute(r),s);this.endValue=u,this.setValue()}break;case"minDays":t.isNullOrUndefined(this.minDays)&&this.setProperties(t.setValue(r,parseInt(this.inputElement.getAttribute(r),10),{}),!0);break;case"maxDays":t.isNullOrUndefined(this.maxDays)&&this.setProperties(t.setValue(r,parseInt(this.inputElement.getAttribute(r),10),{}),!0);break;case"type":"text"!==this.inputElement.getAttribute(r)&&this.inputElement.setAttribute("type","text")}}},r.prototype.createPopup=function(){for(e=0;e<this.presetsItem.length;e++)e!==this.presetsItem.length-1&&"custom_range"===this.presetsItem[e].id&&this.presetsItem.splice(e,1);this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0;for(var e=0;e<=this.presetsItem.length-2;e++){var i=this.presetsItem[e].start,s=this.presetsItem[e].end;this.startValue&&this.endValue&&+new Date(i.setHours(0,0,0,0))==+new Date(this.startValue.setHours(0,0,0,0))&&+new Date(s.setHours(0,0,0,0))==+new Date(this.endValue.setHours(0,0,0,0))&&(this.activeIndex=e,this.isCustomRange=!1)}this.popupWrapper=t.createElement("div",{id:this.element.id+"_popup",className:O+" e-popup"}),this.adjustLongHeaderWidth();var a=!this.isCustomRange||this.isMobile;!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)&&a?(this.isCustomWindow=!1,this.createPresets(),this.listRippleEffect(),this.renderPopup()):(this.isCustomWindow=!0,this.renderControl())},r.prototype.renderControl=function(){this.createControl(),this.bindCalendarEvents(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||this.disabledDateRender(),this.updateHeader()},r.prototype.clearCalendarEvents=function(){t.EventHandler.clearEvents(this.leftCalPrevIcon),t.EventHandler.clearEvents(this.leftCalNextIcon),t.EventHandler.clearEvents(this.rightCalPrevIcon),t.EventHandler.clearEvents(this.rightCalNextIcon)},r.prototype.updateNavIcons=function(){e.prototype.iconHandler.call(this)},r.prototype.calendarIconEvent=function(){this.clearCalendarEvents(),this.leftCalPrevIcon&&!this.leftCalPrevIcon.classList.contains(x)&&t.EventHandler.add(this.leftCalPrevIcon,"mousedown",this.navPrevFunction),this.leftCalNextIcon&&!this.leftCalNextIcon.classList.contains(x)&&t.EventHandler.add(this.leftCalNextIcon,"mousedown",this.navNextFunction),this.rightCalPrevIcon&&!this.rightCalPrevIcon.classList.contains(x)&&t.EventHandler.add(this.rightCalPrevIcon,"mousedown",this.navPrevFunction),this.rightCalNextIcon&&!this.rightCalNextIcon.classList.contains(x)&&t.EventHandler.add(this.rightCalNextIcon,"mousedown",this.navNextFunction)},r.prototype.bindCalendarEvents=function(){this.isMobile?(this.deviceCalendarEvent(),t.EventHandler.add(this.startButton.element,"click",this.deviceHeaderClick,this),t.EventHandler.add(this.endButton.element,"click",this.deviceHeaderClick,this)):(this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.headerTitleElement=this.popupObj.element.querySelector(".e-right-calendar .e-header .e-title"),this.headerTitleElement=this.popupObj.element.querySelector(".e-left-calendar .e-header .e-title"),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.leftKeyboardModule=new t.KeyboardEvents(this.leftCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs}),this.rightKeyboardModule=new t.KeyboardEvents(this.rightCalendar,{eventName:"keydown",keyAction:this.keyInputHandler.bind(this),keyConfigs:this.defaultKeyConfigs})),this.start===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},r.prototype.calendarIconRipple=function(){t.rippleEffect(this.leftCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.leftCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),t.rippleEffect(this.rightCalPrevIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.rightCalNextIcon,{selector:".e-next",duration:400,isCenterRipple:!0})},r.prototype.deviceCalendarEvent=function(){t.EventHandler.clearEvents(this.nextIcon),t.EventHandler.clearEvents(this.previousIcon),t.rippleEffect(this.nextIcon,{selector:".e-prev",duration:400,isCenterRipple:!0}),t.rippleEffect(this.previousIcon,{selector:".e-next",duration:400,isCenterRipple:!0}),this.nextIcon&&!this.nextIcon.classList.contains(x)&&t.EventHandler.add(this.nextIcon,"mousedown",this.deviceNavNextFunction),this.previousIcon&&!this.previousIcon.classList.contains(x)&&t.EventHandler.add(this.previousIcon,"mousedown",this.deviceNavPrevFunction)},r.prototype.deviceNavNext=function(e){var i=t.closest(e.target,"."+T);this.updateDeviceCalendar(i),this.navigateNext(e),this.deviceNavigation()},r.prototype.deviceNavPrevious=function(e){var i=t.closest(e.target,"."+T);this.updateDeviceCalendar(i),this.navigatePrevious(e),this.deviceNavigation()},r.prototype.updateDeviceCalendar=function(e){e&&(this.previousIcon=e.querySelector(".e-prev"),this.nextIcon=e.querySelector(".e-next"),this.calendarElement=e,this.deviceCalendar=e,this.contentElement=e.querySelector(".e-content"),this.tableBodyElement=t.select(".e-content tbody",e),this.table=e.querySelector(".e-content").getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header .e-title"),this.headerElement=e.querySelector(".e-header"))},r.prototype.deviceHeaderClick=function(e){if(e.currentTarget.classList.contains("e-start-btn")&&!t.isNullOrUndefined(this.startValue)){this.endButton.element.classList.remove(N),this.startButton.element.classList.add(N);i=this.popupObj.element.querySelector("."+T);this.updateDeviceCalendar(i),t.isNullOrUndefined(this.calendarElement.querySelector(".e-start-date:not(.e-other-month)"))&&(this.currentDate=new Date(+this.startValue),t.remove(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.removeClassDisabled()}else if(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)){this.startButton.element.classList.remove(N),this.endButton.element.classList.add(N);var i=this.popupObj.element.querySelector("."+T);this.updateDeviceCalendar(i),t.isNullOrUndefined(this.calendarElement.querySelector(".e-end-date:not(.e-other-month)"))&&(this.currentDate=new Date(+this.endValue),t.remove(this.tableBodyElement),this.createContentBody(),this.deviceNavigation()),this.updateMinMaxDays(this.popupObj.element.querySelector("."+T)),this.selectableDates()}},r.prototype.inputFocusHandler=function(){if(this.enabled){this.preventBlur=!1;var e={model:t.isBlazor()&&this.isServerRendered?null:this};this.preventFocus||this.trigger("focus",e),this.updateClearIconState(),this.updateHiddenInput(),this.openOnFocus&&!this.preventFocus?(this.preventFocus=!0,this.show()):this.preventFocus=!0}},r.prototype.inputBlurHandler=function(e){if(this.enabled){if(!this.preventBlur){var i=this.inputElement.value;if(t.isNullOrUndefined(this.presetsItem)||this.presetsItem.length>0&&this.previousEleValue!==this.inputElement.value&&(this.activeIndex=this.presetsItem.length-1,this.isCustomRange=!0),!t.isNullOrUndefined(i)&&""!==i.trim()){var a=i.split(" "+this.separator+" ");if(a.length>1){this.invalidValueString=null;var n={format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"},r=this.globalize.parseDate(a[0].trim(),n),l=this.globalize.parseDate(a[1].trim(),n);if(!(t.isNullOrUndefined(r)||isNaN(+r)||t.isNullOrUndefined(l)||isNaN(+l))){var o=this.startValue;this.startValue=r;var h=this.endValue;if(this.endValue=l,this.setValue(),this.refreshControl(),i!==this.previousEleValue&&this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;u={model:t.isBlazor()&&this.isServerRendered?null:this};this.trigger("blur",u)}return this.updateHiddenInput(),void(this.isMobile&&this.isPopupOpen()&&(this.startValue=o,this.endValue=h))}this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}else this.strictMode||(this.startValue=null,this.endValue=null,this.setValue())}if(this.strictMode?(t.isNullOrUndefined(i)||""!==i.trim()||(this.startValue=null,this.endValue=null),s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.updateInput()):(t.isNullOrUndefined(this.popupObj)&&(this.currentDate=null),this.previousStartValue=this.previousEndValue=null,this.startValue=null,this.endValue=null,this.setValue()),this.errorClass(),this.changeTrigger(e),!this.preventBlur&&document.activeElement!==this.inputElement){this.preventFocus=!1;var u={model:t.isBlazor()&&this.isServerRendered?null:this};this.trigger("blur",u)}}this.updateHiddenInput()}},r.prototype.clearRange=function(){this.previousStartValue=this.previousEndValue=null,this.currentDate=null},r.prototype.errorClass=function(){var e=this.inputElement.value.trim();(t.isNullOrUndefined(this.endValue)&&t.isNullOrUndefined(this.startValue)&&""!==e||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||this.startValue&&this.isDateDisabled(this.startValue)||this.endValue&&this.isDateDisabled(this.endValue))&&""!==e?(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"})):this.inputWrapper&&(t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"}))},r.prototype.keyCalendarUpdate=function(e,t){return this.removeFocusedDate(),e?(this.leftCalCurrentDate=new Date(+this.currentDate),t=this.leftCalendar):(this.rightCalCurrentDate=new Date(+this.currentDate),t=this.rightCalendar),this.updateCalendarElement(t),this.table.focus(),t},r.prototype.navInCalendar=function(e,i,s,a,n){var r,l,o=this.getViewNumber(this.currentView()),h=this.min;switch(l=t.isNullOrUndefined(this.maxDays)||!this.isMaxDaysClicked||t.isNullOrUndefined(this.startValue)?this.max:new Date(new Date(+this.startValue).setDate(this.startValue.getDate()+(this.maxDays-1))),e.action){case"moveRight":r=new Date(+this.currentDate),this.addDay(r,1,e,l,h),i&&+r==+a&&(n=this.keyCalendarUpdate(!1,n)),this.keyboardNavigate(1,o,e,l,h),this.keyNavigation(n,e);break;case"moveLeft":r=new Date(+this.currentDate),this.addDay(r,-1,e,l,h),i||+r==+s&&(n=this.keyCalendarUpdate(!0,n)),this.keyboardNavigate(-1,o,e,l,h),this.keyNavigation(n,e);break;case"moveUp":0===o?(r=new Date(+this.currentDate),this.addDay(r,-7,e,l,h),+r<=+s&&!i&&(n=this.keyCalendarUpdate(!0,n)),this.keyboardNavigate(-7,o,e,l,h)):this.keyboardNavigate(-4,o,e,this.max,this.min),this.keyNavigation(n,e);break;case"moveDown":0===o?(r=new Date(+this.currentDate),this.addDay(r,7,e,l,h),i&&+r>=+a&&(n=this.keyCalendarUpdate(!1,n)),this.keyboardNavigate(7,o,e,l,h)):this.keyboardNavigate(4,o,e,this.max,this.min),this.keyNavigation(n,e);break;case"home":this.currentDate=this.firstDay(this.currentDate),t.remove(this.tableBodyElement),0===o?this.renderMonths(e):1===o?this.renderYears(e):this.renderDecades(e),this.keyNavigation(n,e);break;case"end":this.currentDate=this.lastDay(this.currentDate,o),t.remove(this.tableBodyElement),0===o?this.renderMonths(e):1===o?this.renderYears(e):this.renderDecades(e),this.keyNavigation(n,e)}},r.prototype.keyInputHandler=function(i,s){var a,n=this.getViewNumber(this.currentView()),r=new Date(this.rightCalCurrentDate.getFullYear(),this.rightCalCurrentDate.getMonth(),1),l=new Date(this.leftCalCurrentDate.getFullYear(),this.leftCalCurrentDate.getMonth()+1,0),o=t.closest(i.target,"."+V),h=(o=t.isNullOrUndefined(o)?this.leftCalendar:o).classList.contains(w);this.updateCalendarElement(o);var u=this.tableBodyElement.querySelector("tr td.e-selected"),d=o.querySelector("tr td."+P),p=o.querySelector("tr td."+I),c=o.querySelector("tr td."+S),m=this.getViewNumber(this.depth),v=n===m&&this.getViewNumber(this.start)>=m,f=t.closest(i.target,"."+w),y=t.closest(i.target,"."+V),g=t.closest(i.target,".e-presets");switch(t.isNullOrUndefined(d)?t.isNullOrUndefined(c)||this.dateDisabled?t.isNullOrUndefined(p)||this.dateDisabled?this.dateDisabled||this.currentDate.setDate(1):this.currentDate=new Date(+this.startValue):this.currentDate=new Date(+this.endValue):this.currentDate=this.currentDate,this.effect="",i.action){case"altUpArrow":this.isPopupOpen()&&(this.hide(i),this.preventFocus=!0,this.inputElement.focus(),t.addClass([this.inputWrapper.container],["e-input-focus"]));break;case"select":if(v){var b=t.isNullOrUndefined(d)?p:d;t.isNullOrUndefined(b)||b.classList.contains(x)||this.selectRange(null,b)}else(t.isNullOrUndefined(u)||v)&&t.isNullOrUndefined(d)||(t.isNullOrUndefined(this.value)||(s=this.calendarElement.classList.contains(w)?this.startDate:this.endDate),this.controlDown=i,this.contentClick(null,--n,d||u,s));i.preventDefault();break;case"controlHome":D=new Date(this.currentDate.getFullYear(),0,1);!h&&+D<+l&&(o=this.keyCalendarUpdate(!0,o)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),0,1)),this.keyNavigation(o,i);break;case"altRightArrow":t.isNullOrUndefined(f)?t.isNullOrUndefined(y)?t.isNullOrUndefined(g)||this.cancelButton.element.focus():t.isNullOrUndefined(this.presetElement)?this.cancelButton.element.focus():(this.presetElement.focus(),this.removeFocusedDate()):this.rightCalendar.children[1].firstElementChild.focus(),i.preventDefault();break;case"altLeftArrow":t.isNullOrUndefined(f)?t.isNullOrUndefined(y)||this.leftCalendar.children[1].firstElementChild.focus():!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.cancelButton.element.focus(),i.preventDefault();break;case"controlUp":this.calendarElement.classList.contains(w),this.calendarNavigation(i,this.calendarElement),i.preventDefault();break;case"controlDown":t.isNullOrUndefined(u)&&t.isNullOrUndefined(d)||v||(t.isNullOrUndefined(this.value)||(s=this.calendarElement.classList.contains(w)?this.startDate:this.endDate),this.controlDown=i,this.contentClick(null,--n,u||d,s)),i.preventDefault();break;case"controlEnd":var D=new Date(this.currentDate.getFullYear(),11,31);h&&+D>+r&&(o=this.keyCalendarUpdate(!1,o)),e.prototype.navigateTo.call(this,"Month",new Date(this.currentDate.getFullYear(),11,31)),this.keyNavigation(o,i);break;case"pageUp":a=new Date(+this.currentDate),this.addMonths(a,-1),!h&&+a<=+l&&(o=this.keyCalendarUpdate(!0,o)),this.addMonths(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,i);break;case"pageDown":a=new Date(+this.currentDate),this.addMonths(a,1),h&&+a>=+r&&(o=this.keyCalendarUpdate(!1,o)),this.addMonths(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,i);break;case"shiftPageUp":a=new Date(+this.currentDate),this.addYears(a,-1),!h&&+a<=+l&&(o=this.keyCalendarUpdate(!0,o)),this.addYears(this.currentDate,-1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,i);break;case"shiftPageDown":a=new Date(+this.currentDate),this.addYears(a,1),h&&+a>=+r&&(o=this.keyCalendarUpdate(!1,o)),this.addYears(this.currentDate,1),e.prototype.navigateTo.call(this,"Month",this.currentDate),this.keyNavigation(o,i);break;case"shiftTab":t.isNullOrUndefined(this.presetElement)||(this.presetElement.setAttribute("tabindex","0"),this.presetElement.focus(),this.removeFocusedDate()),i.preventDefault();break;case"spacebar":this.applyButton&&!this.applyButton.disabled&&this.applyFunction(i);break;default:this.navInCalendar(i,h,l,r,o),this.checkMinMaxDays()}this.presetHeight()},r.prototype.keyNavigation=function(e,t){this.bindCalendarCellEvents(e),e.classList.contains(w)?this.leftCalCurrentDate=new Date(+this.currentDate):this.rightCalCurrentDate=new Date(+this.currentDate),this.updateNavIcons(),this.calendarIconEvent(),this.updateRange([e]),this.dateDisabled=this.isDateDisabled(this.currentDate),t.preventDefault()},r.prototype.inputHandler=function(e){switch(e.action){case"altDownArrow":this.isPopupOpen()||(""===this.inputElement.value&&(this.clear(),this.changeTrigger(e),this.clearRange()),this.show(null,e),this.isRangeIconClicked=!1,this.isMobile||t.isNullOrUndefined(this.leftCalendar)||this.calendarFocus(),this.isKeyPopup=!0);break;case"escape":this.isPopupOpen()&&this.hide(e);break;case"enter":document.activeElement===this.inputElement&&(this.inputBlurHandler(e),this.hide(e));break;case"tab":document.activeElement===this.inputElement&&this.isPopupOpen()&&(this.hide(e),e.preventDefault())}},r.prototype.bindCalendarCellEvents=function(e){for(var i,s=0,a=i=e?e.querySelectorAll(".e-calendar td"):this.popupObj.element.querySelectorAll(".e-calendar td");s<a.length;s++){var n=a[s];t.EventHandler.clearEvents(n),n.classList.contains(x)||n.classList.contains(H)||n.classList.contains("e-week-number")||(this.isMobile||t.EventHandler.add(n,"mouseover",this.hoverSelection,this),t.EventHandler.add(n,"mousedown",this.selectRange,this))}},r.prototype.removeFocusedDate=function(){for(var e=!t.isNullOrUndefined(this.startValue)||!t.isNullOrUndefined(this.endValue),i=0,s=this.popupObj.element.querySelectorAll(".e-calendar ."+P);i<s.length;i++){var a=s[i],n=new Date,r=this.getIdValue(null,a);("Month"===this.depth&&"Month"===this.currentView()&&(!a.classList.contains("e-today")||a.classList.contains("e-today")&&e)||"Year"===this.depth&&"Year"===this.currentView()&&(!this.isSameMonth(n,r)&&!this.isSameYear(n,r)||e)||"Decade"===this.depth&&"Decade"===this.currentView()&&(!this.isSameYear(n,r)||e))&&(a.classList.remove(P),a.classList.contains(I)||a.classList.contains(S)||a.removeAttribute("aria-label"))}},r.prototype.hoverSelection=function(e,i){var s=i||e.currentTarget,a=this.getIdValue(null,s);if(!t.isNullOrUndefined(this.startValue)&&+this.startValue>=+this.min&&+this.startValue<=+this.max&&(!this.isDateDisabled(this.endValue)&&!this.isDateDisabled(this.startValue)&&t.isNullOrUndefined(this.endValue)&&t.isNullOrUndefined(this.startValue)||!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)))for(var n=0,r=this.popupObj.element.querySelectorAll(".e-calendar td");n<r.length;n++){var l=r[n],o=!l.classList.contains(x)||l.classList.contains(H);if(!l.classList.contains("e-week-number")&&o){var h=this.getIdValue(null,l),u=new Date(+this.startValue);new Date(+h).setHours(0,0,0,0)>=u.setHours(0,0,0,0)&&+h<=+a?t.addClass([l],A):t.removeClass([l],[A])}}},r.prototype.isSameStartEnd=function(e,t){var i=!1;return"Month"===this.depth?e.setHours(0,0,0,0)===t.setHours(0,0,0,0)&&(i=!0):"Year"===this.depth?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&(i=!0):"Decade"===this.depth&&e.getFullYear()===t.getFullYear()&&(i=!0),i},r.prototype.updateRange=function(e){if(!t.isNullOrUndefined(this.startValue))for(var i=0,s=e;i<s.length;i++)for(var a=0,n=s[i].querySelectorAll(".e-calendar td");a<n.length;a++){var r=n[a];if(!r.classList.contains("e-week-number")&&!r.classList.contains(x)){var l=this.getIdValue(null,r),o=this.getIdValue(null,r);if(t.isNullOrUndefined(this.endValue)?t.removeClass([r],[A]):this.currentView()===this.depth&&+o.setHours(0,0,0,0)>=+new Date(+this.startValue).setHours(0,0,0,0)&&+o.setHours(0,0,0,0)<=+new Date(+this.endValue).setHours(0,0,0,0)&&!this.isSameStartEnd(new Date(+this.startValue),new Date(+this.endValue))&&+new Date(+this.startValue).setHours(0,0,0,0)>=+this.min&&+new Date(+this.endValue).setHours(0,0,0,0)<=+this.max&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&t.addClass([r],A),r.classList.contains("e-selected")&&r.classList.contains(S)&&+o!=+this.endValue&&(t.removeClass([r],["e-selected"]),t.removeClass([r],[S])),r.classList.contains(A)&&+o>+this.endValue&&t.removeClass([r],[A]),!r.classList.contains("e-other-month")){var h=new Date(+this.startValue),u=new Date(+l);this.currentView()===this.depth&&+u.setHours(0,0,0,0)==+h.setHours(0,0,0,0)&&+u.setHours(0,0,0,0)>=+h.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(t.addClass([r],[I,"e-selected"]),this.addSelectedAttributes(r,this.startValue,!0));var d=new Date(+this.endValue);"Year"===this.currentView()?u=new Date(u.getFullYear(),u.getMonth()+1,0):"Decade"===this.currentView()&&(u=new Date(u.getFullYear(),11,31)),this.currentView()===this.depth&&!t.isNullOrUndefined(this.endValue)&&+u.setHours(0,0,0,0)==+d.setHours(0,0,0,0)&&+u.setHours(0,0,0,0)<=+d.setHours(0,0,0,0)&&+this.startValue>=+this.min&&!this.inputWrapper.container.classList.contains("e-error")&&!this.isDateDisabled(this.startValue)&&!this.isDateDisabled(this.endValue)&&(t.addClass([r],[S,"e-selected"]),this.addSelectedAttributes(r,this.startValue,!1)),+l!=+this.startValue||t.isNullOrUndefined(this.endValue)||+l!=+this.endValue||this.addSelectedAttributes(r,this.endValue,!1,!0)}}}},r.prototype.checkMinMaxDays=function(){(!t.isNullOrUndefined(this.minDays)&&this.minDays>0||!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0)&&(this.isMobile?this.updateMinMaxDays(this.popupObj.element.querySelector("."+T)):(this.updateMinMaxDays(this.popupObj.element.querySelector("."+w)),this.updateMinMaxDays(this.popupObj.element.querySelector("."+V))))},r.prototype.rangeArgs=function(e){var i,s,a=t.isNullOrUndefined(this.startValue)?null:this.globalize.formatDate(this.startValue,{format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"}),n=t.isNullOrUndefined(this.endValue)?null:this.globalize.formatDate(this.endValue,{format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"});return t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?(i="",s=0):(i=a+" "+this.separator+" "+n,s=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1),{value:this.value,startDate:this.startValue,endDate:this.endValue,daySpan:s,event:e||null,element:this.element,isInteracted:!t.isNullOrUndefined(e),text:i}},r.prototype.otherMonthSelect=function(e,i,s){var a=+this.getIdValue(null,e),n='*[id^="/id"]:not(.e-other-month)'.replace("/id",""+a),r=this.popupObj&&this.popupObj.element.querySelector(n);t.isNullOrUndefined(r)||(i?(t.addClass([r],[I,"e-selected"]),this.addSelectedAttributes(r,this.startValue,!0)):(t.addClass([r],[S,"e-selected"]),this.addSelectedAttributes(r,this.endValue,!0)),s&&this.addSelectedAttributes(e,this.endValue,!1,!0))},r.prototype.selectRange=function(e,i){var s,a;e&&e.preventDefault();var n=t.isNullOrUndefined(e)?this.getIdValue(null,i):this.getIdValue(e,null),r=n.getFullYear(),l=n.getMonth(),o=new Date(r,l,1),h=new Date(r,l+1,0),u=new Date(r,0,1),d=new Date(r,11,31);t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.isMobile&&this.startButton.element.classList.contains(N)&&this.removeSelection():(!this.isMobile||this.isMobile&&!this.endButton.element.classList.contains(N))&&this.removeSelection();var p=i||e.currentTarget;if(t.isNullOrUndefined(this.startValue))t.isNullOrUndefined(this.previousStartValue)||(n.setHours(this.previousStartValue.getHours()),n.setMinutes(this.previousStartValue.getMinutes()),n.setSeconds(this.previousStartValue.getSeconds())),this.startValue="Month"===this.depth?new Date(this.checkValue(n)):"Year"===this.depth?o:u,this.endValue=null,this.setValue(),t.addClass([p],I),this.addSelectedAttributes(p,this.startValue,!0),p.classList.contains("e-other-month")&&this.otherMonthSelect(p,!0),this.checkMinMaxDays(),this.applyButton.disabled=!0,this.applyButton.element.disabled=!0,this.isMobile&&(this.endButton.element.classList.add(N),this.startButton.element.classList.remove(N),this.endButton.element.removeAttribute("disabled"),this.selectableDates()),this.trigger("select",this.rangeArgs(e));else if(+n==+this.startValue||+n>+this.startValue){if(+n==+this.startValue&&!t.isNullOrUndefined(this.minDays)&&this.minDays>1)return;this.endValue=null,this.setValue(),(this.isMobile||i)&&this.hoverSelection(e,i),t.isNullOrUndefined(this.previousEndValue)||(n.setHours(this.previousEndValue.getHours()),n.setMinutes(this.previousEndValue.getMinutes()),n.setSeconds(this.previousEndValue.getSeconds())),this.endValue="Month"===this.depth?new Date(this.checkValue(n)):"Year"===this.depth?h:d,this.setValue();var c=this.popupObj.element.querySelectorAll("."+S);if(this.isMobile){this.startButton.element.classList.remove(N),this.endButton.element.classList.add(N);for(var m=0,v=c;m<v.length;m++){var f=v[m];f.removeAttribute("aria-label"),f.classList.contains(I)?(this.addSelectedAttributes(f,this.startValue,!0),t.removeClass([f],[S])):(f.setAttribute("aria-selected","false"),t.removeClass([f],[S,"e-selected"]))}}t.addClass([p],S),+this.endValue==+this.startValue?this.addSelectedAttributes(p,this.endValue,!1,!0):this.addSelectedAttributes(p,this.endValue,!1),p.classList.contains("e-other-month")&&(+this.endValue==+this.startValue?this.otherMonthSelect(p,!1,!0):this.otherMonthSelect(p,!1));for(var y=0,g=c=this.popupObj.element.querySelectorAll("."+S);y<g.length;y++){var b=g[y];b.classList.contains(I)&&t.removeClass([b],[A])}this.applyButton.disabled=!1,this.applyButton.element.disabled=!1,this.isMobile||this.removeClassDisabled(),this.disabledDateRender(),this.trigger("select",this.rangeArgs(e))}else+n<+this.startValue&&(this.removeClassDisabled(),this.startValue="Month"===this.depth?new Date(this.checkValue(n)):"Year"===this.depth?o:u,this.setValue(),this.removeSelectedAttributes(),t.removeClass(this.popupObj.element.querySelectorAll("."+I),[I,"e-selected"]),t.addClass([p],I),this.addSelectedAttributes(p,this.startValue,!0),p.classList.contains("e-other-month")&&this.otherMonthSelect(p,!0),this.checkMinMaxDays());e&&(s=t.closest(e.target,"."+w)),t.isNullOrUndefined(s)?(e&&(a=e&&t.closest(e.target,"."+V)),t.isNullOrUndefined(a)||this.rightCalendar.children[1].firstElementChild.focus()):this.leftCalendar.children[1].firstElementChild.focus(),t.addClass([p],"e-selected"),this.updateHeader(),this.removeFocusedDate()},r.prototype.selectableDates=function(){if(!t.isNullOrUndefined(this.startValue)){var e=this.calendarElement.querySelectorAll(".e-calendar td"),i=!1;if(this.currentView()===this.depth){for(var s=0,a=e;s<a.length;s++){if(!(l=a[s]).classList.contains(I)&&!l.classList.contains("e-week-number")&&!l.classList.contains(x)){if(+this.getIdValue(null,l)<+this.startValue){t.addClass([l],[H,x,W]),t.EventHandler.clearEvents(l);continue}break}if(l.classList.contains(I)&&!l.classList.contains("e-other-month")){i=!0;break}}i&&(this.previousIcon.classList.contains(x)||t.addClass([this.previousIcon],[B,x,W]))}else{for(var n=0,r=e;n<r.length;n++){var l=r[n],o=this.startValue.getMonth(),h=this.startValue.getFullYear(),u=this.getIdValue(null,l);if(this.startButton.element.classList.contains(N)||!("Year"===this.currentView()&&u.getMonth()<o&&u.getFullYear()<=h||"Decade"===this.currentView()&&u.getMonth()<=o&&u.getFullYear()<h))break;t.addClass([l],[x])}e[0].classList.contains(x)?this.previousIconHandler(!0):e[e.length-1].classList.contains(x)&&this.nextIconHandler(!0)}}},r.prototype.updateMinMaxDays=function(e){if(!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)||this.isMobile&&this.endButton.element.classList.contains(N)){if(!t.isNullOrUndefined(this.minDays)&&this.minDays>0||!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0){var i=this.removeTimeValueFromDate(this.startValue),s=new Date(new Date(+i).setDate(i.getDate()+(this.minDays-1))),a=new Date(new Date(+i).setDate(i.getDate()+(this.maxDays-1)));s=!t.isNullOrUndefined(this.minDays)&&this.minDays>0?s:null,a=!t.isNullOrUndefined(this.maxDays)&&this.maxDays>0?a:null,"Year"===this.currentView()?(s=t.isNullOrUndefined(s)?null:new Date(s.getFullYear(),s.getMonth(),0),a=t.isNullOrUndefined(a)?null:new Date(a.getFullYear(),a.getMonth(),1)):"Decade"===this.currentView()&&(s=t.isNullOrUndefined(s)?null:new Date(s.getFullYear()-1,11,1),a=t.isNullOrUndefined(a)?null:new Date(a.getFullYear(),0,1));for(var n=void 0,r=0,l=e.querySelectorAll(".e-calendar td");r<l.length;r++){var o=l[r];if(!o.classList.contains(I)&&!o.classList.contains("e-week-number")){var h=this.getIdValue(null,o);if(h=this.removeTimeValueFromDate(h),!t.isNullOrUndefined(s)&&+h==+s&&o.classList.contains(x)&&s.setDate(s.getDate()+1),!o.classList.contains(x)){if(+h<=+i)continue;!t.isNullOrUndefined(s)&&+h<+s&&(t.addClass([o],[H,x,W]),t.EventHandler.clearEvents(o)),!t.isNullOrUndefined(a)&&+h>+a&&(t.addClass([o],[H,x,W]),this.isMaxDaysClicked=!0,t.EventHandler.clearEvents(o),t.isNullOrUndefined(n)&&!o.classList.contains("e-other-month")&&(n=o))}}}if(!t.isNullOrUndefined(n))if(this.isMobile)this.nextIcon.classList.contains(x)||t.addClass([this.nextIcon],[B,x,W]);else{var u=t.closest(n,"."+V);(u=t.isNullOrUndefined(u)?this.leftCalendar:u).classList.contains(w)?(this.rightCalNextIcon.classList.contains(x)||t.addClass([this.rightCalNextIcon],[B,x,W]),this.leftCalNextIcon.classList.contains(x)||t.addClass([this.leftCalNextIcon],[B,x,W]),this.rightCalPrevIcon.classList.contains(x)||t.addClass([this.rightCalPrevIcon],[B,x,W])):this.rightCalNextIcon.classList.contains(x)||t.addClass([this.rightCalNextIcon],[B,x,W])}}}else this.isMaxDaysClicked=!1},r.prototype.removeTimeValueFromDate=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},r.prototype.removeClassDisabled=function(){for(var e=0,i=this.popupObj.element.querySelectorAll(".e-calendar td."+H);e<i.length;e++){var s=i[e];s.classList.contains(H)&&(t.removeClass([s],[H,x,W]),t.EventHandler.add(s,"click",this.selectRange,this),this.isMobile||t.EventHandler.add(s,"mouseover",this.hoverSelection,this))}this.isMobile?(this.nextIcon.classList.contains(B)&&t.removeClass([this.nextIcon],[B,x,W]),this.previousIcon.classList.contains(B)&&t.removeClass([this.previousIcon],[B,x,W])):(this.rightCalNextIcon.classList.contains(B)&&t.removeClass([this.rightCalNextIcon],[B,x,W]),this.rightCalPrevIcon.classList.contains(B)&&t.removeClass([this.rightCalPrevIcon],[B,x,W]),this.leftCalNextIcon.classList.contains(B)&&t.removeClass([this.leftCalNextIcon],[B,x,W]))},r.prototype.updateHeader=function(){var e={type:"date",skeleton:t.isBlazor()?"D":"yMMMd"};if(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue))this.popupObj.element.querySelector("."+U).textContent=this.l10n.getConstant("selectedDays");else{var i=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;t.isNullOrUndefined(this.disabledDayCnt)||(i-=this.disabledDayCnt,this.disabledDayCnt=null),this.popupObj.element.querySelector("."+U).textContent=i.toString()+" "+this.l10n.getConstant("days")}this.isMobile?(t.isNullOrUndefined(this.startValue)?this.startButton.element.textContent=this.l10n.getConstant("startLabel"):this.startButton.element.textContent=this.globalize.formatDate(this.startValue,e),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.endButton.element.textContent=this.l10n.getConstant("endLabel"):this.endButton.element.textContent=this.globalize.formatDate(this.endValue,e)):(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector(".e-end-label").textContent=this.l10n.getConstant("endLabel"):this.popupObj.element.querySelector(".e-end-label").textContent=this.globalize.formatDate(this.endValue,e),t.isNullOrUndefined(this.startValue)?this.popupObj.element.querySelector(".e-start-label").textContent=this.l10n.getConstant("startLabel"):this.popupObj.element.querySelector(".e-start-label").textContent=this.globalize.formatDate(this.startValue,e)),(this.isDateDisabled(this.startValue)||this.isDateDisabled(this.endValue)||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue)&&(this.isMobile?(this.startButton.element.textContent=this.l10n.getConstant("startLabel"),this.endButton.element.textContent=this.l10n.getConstant("endLabel"),this.popupObj.element.querySelector("."+U).textContent=this.l10n.getConstant("selectedDays")):(this.popupObj.element.querySelector("."+U).textContent=this.l10n.getConstant("selectedDays"),this.popupObj.element.querySelector(".e-start-label").textContent=this.l10n.getConstant("startLabel"),this.popupObj.element.querySelector(".e-end-label").textContent=this.l10n.getConstant("endLabel"))),this.popupObj.element.querySelector("#custom_range")&&(this.popupObj.element.querySelector("#custom_range").textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range")},r.prototype.removeSelection=function(){this.startValue=null,this.endValue=null,this.setValue(),this.removeSelectedAttributes(),this.popupObj&&(this.popupObj.element.querySelectorAll(".e-selected").length>0&&t.removeClass(this.popupObj.element.querySelectorAll(".e-selected"),[I,S,"e-selected"]),this.popupObj.element.querySelectorAll("."+P).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+P),P),this.popupObj.element.querySelectorAll("."+A).length>0&&t.removeClass(this.popupObj.element.querySelectorAll("."+A),[A]))},r.prototype.addSelectedAttributes=function(e,i,s,a){if(e){var n=this.globalize.formatDate(i,{type:"date",skeleton:t.isBlazor()?"D":"full"});!t.isNullOrUndefined(a)&&a?e.setAttribute("aria-label","The current start and end date is "+n):e.setAttribute("aria-label","The current "+(s?"start":"end")+" date is "+n),e.setAttribute("aria-selected","true")}},r.prototype.removeSelectedAttributes=function(){if(this.popupObj){for(var e=0,t=this.popupObj.element.querySelectorAll("."+I);e<t.length;e++)(a=t[e]).setAttribute("aria-selected","false"),a.removeAttribute("aria-label");for(var i=0,s=this.popupObj.element.querySelectorAll("."+S);i<s.length;i++){var a=s[i];a.setAttribute("aria-selected","false"),a.removeAttribute("aria-label")}}},r.prototype.updateCalendarElement=function(e){e.classList.contains(w)?(this.calendarElement=this.leftCalendar,this.currentDate=this.leftCalCurrentDate,this.previousIcon=this.leftCalPrevIcon,this.nextIcon=this.leftCalNextIcon):(this.calendarElement=this.rightCalendar,this.currentDate=this.rightCalCurrentDate,this.previousIcon=this.rightCalPrevIcon,this.nextIcon=this.rightCalNextIcon),this.contentElement=e.querySelector(".e-content"),this.tableBodyElement=t.select(".e-content tbody",e),this.table=e.querySelector(".e-content").getElementsByTagName("table")[0],this.headerTitleElement=e.querySelector(".e-header .e-title"),this.headerElement=e.querySelector(".e-header")},r.prototype.navPrevMonth=function(e){e.preventDefault();var i=t.closest(e.target,"."+w);i=t.isNullOrUndefined(i)?t.closest(e.target,"."+V):i,this.updateCalendarElement(i),this.navigatePrevious(e),!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)&&this.updateMinMaxDays(i),this.updateControl(i)},r.prototype.deviceNavigation=function(e){this.deviceCalendarEvent(),this.updateRange([this.popupObj.element.querySelector("."+T)]),this.endButton.element.classList.contains(N)&&this.updateMinMaxDays(this.popupObj.element.querySelector("."+T)),this.endButton.element.classList.contains(N)&&this.selectableDates(),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate()},r.prototype.updateControl=function(e){e.classList.contains(V)?this.rightCalCurrentDate=new Date(+this.currentDate):this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarIconEvent(),("Month"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-month")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-month")||"Year"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-year")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-year")||"Decade"===this.depth&&this.leftCalendar.querySelector(".e-content").classList.contains("e-decade")&&this.rightCalendar.querySelector(".e-content").classList.contains("e-decade")||this.isMobile)&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange([e])},r.prototype.navNextMonth=function(e){e.preventDefault();var i=t.closest(e.target,"."+w);i=t.isNullOrUndefined(i)?t.closest(e.target,"."+V):i,this.updateCalendarElement(i),this.navigateNext(e),!t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)&&this.updateMinMaxDays(i),this.updateControl(i)},r.prototype.isPopupOpen=function(){return!(t.isNullOrUndefined(this.popupObj)||!this.popupObj.element.classList.contains("e-popup"))},r.prototype.createRangeHeader=function(){var e=this.createElement("div",{className:"e-start-end"});if(this.isMobile){var i=this.createElement("button",{className:"e-end-btn"}),s=this.createElement("button",{className:"e-start-btn"});this.startButton=new a.Button({content:this.l10n.getConstant("startLabel")},s),this.endButton=new a.Button({content:this.l10n.getConstant("endLabel")},i),e.appendChild(s),e.appendChild(i)}else{var n=this.createElement("a",{className:"e-start-label"}),r=this.createElement("a",{className:"e-end-label"}),l=this.createElement("span",{className:"e-change-icon e-icons"});t.attributes(n,{"aria-atomic":"true","aria-live":"assertive","aria-label":"Start Date",role:"button"}),t.attributes(r,{"aria-atomic":"true","aria-live":"assertive","aria-label":"End Date",role:"button"}),e.appendChild(n),e.appendChild(l),e.appendChild(r),n.textContent=this.l10n.getConstant("startLabel"),r.textContent=this.l10n.getConstant("endLabel")}return e},r.prototype.disableInput=function(){this.strictMode?t.isNullOrUndefined(this.previousStartValue)||t.isNullOrUndefined(this.previousEndValue)||(this.startValue=this.previousStartValue,this.endValue=this.previousEndValue,this.setValue(),this.updateInput()):(this.updateInput(),this.clearRange(),this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),this.startValue=null,this.endValue=null,this.setValue(),this.errorClass()),this.setProperties({enabled:!1},!0),s.Input.setEnabled(this.enabled,this.inputElement),this.bindEvents()},r.prototype.validateMinMax=function(){if(this.min=t.isNullOrUndefined(this.min)||!+this.min?this.min=new Date(1900,0,1):this.min,this.max=t.isNullOrUndefined(this.max)||!+this.max?this.max=new Date(2099,11,31):this.max,!(this.min<=this.max))return void this.disableInput();t.isNullOrUndefined(this.minDays)||t.isNullOrUndefined(this.maxDays)||this.maxDays>0&&this.minDays>0&&this.minDays>this.maxDays&&(this.maxDays=null),!t.isNullOrUndefined(this.minDays)&&this.minDays<0&&(this.minDays=null),!t.isNullOrUndefined(this.maxDays)&&this.maxDays<0&&(this.maxDays=null)},r.prototype.validateRangeStrict=function(){t.isNullOrUndefined(this.startValue)||(+this.startValue<=+this.min?(this.startValue=this.min,this.setValue()):+this.startValue>=+this.min&&+this.startValue>=+this.max&&(this.startValue=this.max)),t.isNullOrUndefined(this.endValue)||(+this.endValue>+this.max?(this.endValue=this.max,this.setValue()):+this.endValue<+this.min&&(this.endValue=this.min,this.setValue())),this.validateMinMaxDays()},r.prototype.validateRange=function(){this.validateMinMaxDays()},r.prototype.validateMinMaxDays=function(){if(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)){var e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1;if(!t.isNullOrUndefined(this.minDays)&&this.minDays>0&&!(e>=this.minDays))if(this.strictMode){var i=new Date(+this.startValue);i.setDate(i.getDate()+(this.minDays-1)),+i>+this.max?(this.endValue=this.max,this.setValue()):(this.endValue=i,this.setValue())}else this.startValue=null,this.endValue=null,this.setValue();t.isNullOrUndefined(this.maxDays)||!(this.maxDays>0)||e<=this.maxDays||(this.strictMode?(this.endValue=new Date(+this.startValue),this.endValue.setDate(this.endValue.getDate()+(this.maxDays-1)),this.setValue()):(this.startValue=null,this.endValue=null,this.setValue()))}},r.prototype.renderCalendar=function(){this.calendarElement=this.createElement("div"),this.calendarElement.classList.add(T),this.enableRtl&&this.calendarElement.classList.add("e-rtl"),t.attributes(this.calendarElement,{role:"calendar"}),e.prototype.createHeader.call(this),e.prototype.createContent.call(this)},r.prototype.isSameMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},r.prototype.isSameYear=function(e,t){return e.getFullYear()===t.getFullYear()},r.prototype.isSameDecade=function(e,t){var i=e.getFullYear(),s=t.getFullYear();return i-i%10==s-s%10},r.prototype.startMonthCurrentDate=function(){this.isSameMonth(this.min,this.max)||+this.currentDate>+this.max||this.isSameMonth(this.currentDate,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.currentDate<this.min&&(this.currentDate=new Date(this.checkValue(this.min)))},r.prototype.selectNextMonth=function(){if(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||this.isSameMonth(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue))return this.currentDate.setDate(1),void this.currentDate.setMonth(this.currentDate.getMonth()+1);if(this.currentDate=new Date(+this.endValue),!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue){this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setDate(1);var e=this.currentDate.getMonth()+1;this.currentDate.setMonth(e)}},r.prototype.selectNextYear=function(){if(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||this.isSameYear(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){this.currentDate.setMonth(0);var e=this.currentDate.getFullYear()+1;return void this.currentDate.setFullYear(e)}this.currentDate=new Date(+this.endValue),(!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setMonth(0),this.currentDate.setFullYear(this.currentDate.getFullYear()+1))},r.prototype.selectNextDecade=function(){if(t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||this.isSameDecade(this.endValue,this.currentDate)||this.isDateDisabled(this.endValue)||this.isDateDisabled(this.startValue)){var e=this.currentDate.getFullYear()+10;return void this.currentDate.setFullYear(e)}this.currentDate=new Date(+this.endValue),(!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue||!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.currentDate.setFullYear(this.currentDate.getFullYear()+10))},r.prototype.selectStartMonth=function(){t.isNullOrUndefined(this.startValue)?(this.currentDate=new Date((new Date).setHours(0,0,0,0)),this.startMonthCurrentDate()):!t.isNullOrUndefined(this.max)&&this.isSameMonth(this.startValue,this.max)?(this.currentDate=new Date(+this.max),this.currentDate.setDate(1),this.currentDate.setMonth(this.currentDate.getMonth()-1)):this.startValue>=this.min&&this.startValue<=this.max&&!this.isDateDisabled(this.startValue)?this.currentDate=new Date(+this.startValue):this.currentDate=new Date((new Date).setHours(0,0,0,0)),(!t.isNullOrUndefined(this.endValue)&&+this.endValue>+this.max||!t.isNullOrUndefined(this.startValue)&&+this.startValue<+this.min||!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue)&&+this.startValue>+this.endValue)&&(this.currentDate=new Date((new Date).setHours(0,0,0,0))),this.startMonthCurrentDate()},r.prototype.createCalendar=function(){var i=this.createElement("div",{className:"e-calendar-container"});if(this.isMobile){t.isNullOrUndefined(this.startValue)||(this.currentDate=new Date(+this.startValue)),e.prototype.validateDate.call(this),e.prototype.minMaxUpdate.call(this),e.prototype.render.call(this);var s=this.calendarElement.querySelector(".e-calendar .e-prev"),a=this.calendarElement.querySelector(".e-calendar .e-next");t.remove(this.calendarElement.querySelector(".e-calendar .e-icon-container")),this.calendarElement.querySelector(".e-calendar .e-header").appendChild(a),this.calendarElement.querySelector(".e-calendar .e-header").appendChild(s),t.prepend([s],this.calendarElement.querySelector(".e-calendar .e-header")),this.deviceCalendar=this.calendarElement,i.appendChild(this.calendarElement),this.headerTitleElement=this.calendarElement.querySelector(".e-calendar .e-header .e-title")}else{this.selectStartMonth(),this.renderCalendar(),this.leftCalCurrentDate=new Date(+this.currentDate),this.calendarElement.classList.add(w),this.leftCalPrevIcon=this.calendarElement.querySelector(".e-left-calendar .e-prev"),this.leftCalNextIcon=this.calendarElement.querySelector(".e-left-calendar .e-next"),this.leftTitle=this.calendarElement.querySelector(".e-left-calendar .e-title"),t.remove(this.calendarElement.querySelector(".e-left-calendar .e-icon-container")),this.calendarElement.querySelector(".e-left-calendar .e-header").appendChild(this.leftCalNextIcon),this.calendarElement.querySelector(".e-left-calendar .e-header").appendChild(this.leftCalPrevIcon),t.prepend([this.leftCalPrevIcon],this.calendarElement.querySelector(".e-left-calendar .e-header")),this.leftCalendar=this.calendarElement;var n=this.createElement("div",{className:"e-left-container"}),r=this.createElement("div",{className:"e-right-container"});n.appendChild(this.leftCalendar),i.appendChild(n),this.isMobile||t.EventHandler.add(this.leftTitle,"click",this.leftNavTitle,this),"Month"===this.start&&this.selectNextMonth(),"Year"===this.start&&this.selectNextYear(),"Decade"===this.start&&this.selectNextDecade(),this.renderCalendar(),this.rightCalCurrentDate=new Date(+this.currentDate),t.addClass([this.calendarElement],V),this.rightCalendar=this.calendarElement,t.removeClass([this.leftCalendar&&this.leftCalendar.querySelector(".e-content tbody")],"e-zoomin"),t.removeClass([this.rightCalendar&&this.rightCalendar.querySelector(".e-content tbody")],"e-zoomin"),this.rightCalPrevIcon=this.calendarElement.querySelector(".e-right-calendar .e-prev"),this.rightCalNextIcon=this.calendarElement.querySelector(".e-right-calendar .e-next"),this.rightTitle=this.calendarElement.querySelector(".e-right-calendar .e-title"),t.remove(this.calendarElement.querySelector(".e-right-calendar .e-icon-container")),this.calendarElement.querySelector("table").setAttribute("tabindex","-1"),this.calendarElement.querySelector(".e-right-calendar .e-header").appendChild(this.rightCalNextIcon),this.calendarElement.querySelector(".e-right-calendar .e-header").appendChild(this.rightCalPrevIcon),t.prepend([this.rightCalPrevIcon],this.calendarElement.querySelector(".e-right-calendar .e-header")),r.appendChild(this.rightCalendar),i.appendChild(r),this.isMobile||t.EventHandler.add(this.rightTitle,"click",this.rightNavTitle,this)}return i},r.prototype.leftNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.leftCalendar,this.calendarNavigation(e,this.calendarElement))},r.prototype.calendarNavigation=function(t,i){this.table=i.querySelector("table"),this.headerTitleElement=i.querySelector(".e-title"),this.tableBodyElement=i.querySelector("tbody"),this.tableHeadElement=i.querySelector("thead"),this.contentElement=i.querySelector(".e-content"),this.updateCalendarElement(i),e.prototype.navigateTitle.call(this,t),this.updateNavIcons()},r.prototype.rightNavTitle=function(e){this.isPopupOpen()&&(this.calendarElement=this.rightCalendar,this.calendarNavigation(e,this.calendarElement))},r.prototype.clickEventEmitter=function(e){this.isMobile||(t.closest(e.target,".e-calendar.e-left-calendar")?(this.calendarElement=this.leftCalendar,this.updateCalendarElement(this.leftCalendar)):(this.calendarElement=this.rightCalendar,this.updateCalendarElement(this.rightCalendar)))},r.prototype.currentView=function(){return e.prototype.currentView.call(this)},r.prototype.getCalendarView=function(e){return"Year"===e?"Year":"Decade"===e?"Decade":"Month"},r.prototype.navigatedEvent=function(i){if(this.trigger("navigated",this.navigatedArgs),!t.isNullOrUndefined(this.popupObj)){var s=this.getCalendarView(this.currentView());this.isMobile?s===this.depth?(this.bindCalendarCellEvents(),this.deviceNavigation(),this.removeFocusedDate(),this.checkMinMaxDays()):this.selectableDates():this.isMobile||s!==this.depth?(this.updateNavIcons(),this.calendarIconEvent()):((this.calendarElement.classList.contains("e-left-calendar")?this.leftCalendar:this.rightCalendar)!==this.leftCalendar||(!i||i.currentTarget.children[0].classList.contains("e-icons"))&&t.isNullOrUndefined(this.controlDown)?(i&&!i.currentTarget.children[0].classList.contains("e-icons")||!t.isNullOrUndefined(this.controlDown))&&(this.rightCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.rightCalCurrentDate,this.updateCalendarElement(this.rightCalendar),this.updateControl(this.rightCalendar),this.updateCalendarElement(this.leftCalendar),this.startValue&&t.isNullOrUndefined(this.endValue)?"Month"===s&&this.startValue.getMonth()<this.rightCalCurrentDate.getMonth()&&this.startValue.getFullYear()<=this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,s,new Date(+this.startValue)):"Year"===s&&this.startValue.getFullYear()<this.rightCalCurrentDate.getFullYear()?e.prototype.navigateTo.call(this,s,new Date(+this.startValue)):e.prototype.navigateTo.call(this,s,this.leftCalCurrentDate):e.prototype.navigateTo.call(this,s,this.leftCalCurrentDate),this.updateControl(this.leftCalendar),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null):(this.leftCalCurrentDate=new Date(+this.currentDate),this.effect="",this.currentDate=this.leftCalCurrentDate,this.updateCalendarElement(this.leftCalendar),this.updateControl(this.leftCalendar),this.updateCalendarElement(this.rightCalendar),e.prototype.navigateTo.call(this,s,this.rightCalCurrentDate),this.updateControl(this.rightCalendar),this.updateNavIcons(),this.calendarIconEvent(),this.calendarIconRipple(),this.controlDown=null),this.checkMinMaxDays())}},r.prototype.createControl=function(){var e=this.createElement("div",{className:"e-date-range-container"}),i=this.createElement("div",{className:"e-range-header"}),s=this.createRangeHeader();i.appendChild(s);var n=this.createElement("div",{className:U});t.attributes(n,{"aria-label":"Selected Days"}),n.textContent=this.l10n.getConstant("selectedDays"),i.appendChild(n);var r=this.createElement("div",{className:"e-separator"}),l=this.createCalendar();e.appendChild(i),e.appendChild(r),e.appendChild(l);var o=this.createElement("div",{className:"e-footer"}),h=this.createElement("button",{className:"e-cancel e-flat e-css"}),u=this.createElement("button");t.addClass([u],["e-apply","e-flat","e-primary","e-css"]),o.appendChild(u),o.appendChild(h);var d=!t.isNullOrUndefined(this.startValue)&&!t.isNullOrUndefined(this.endValue);this.cancelButton=new a.Button({content:this.l10n.getConstant("cancelText")},h),this.applyButton=new a.Button({content:this.l10n.getConstant("applyText"),disabled:!d},u),t.EventHandler.add(u,"click",this.applyFunction,this),t.EventHandler.add(h,"click",this.cancelFunction,this),this.popupWrapper.appendChild(e),this.isMobile||t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||(this.createPresets(),this.listRippleEffect(),t.addClass([e],"e-range-border"),t.addClass([this.popupWrapper],"e-preset-wrapper"),this.popupWrapper.querySelector(".e-presets").style.height=this.popupWrapper.querySelector(".e-date-range-container").getBoundingClientRect().height+"px"),this.popupWrapper.appendChild(o),this.isMobile&&this.deviceHeaderUpdate(),this.renderPopup()},r.prototype.cancelFunction=function(e){document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),t.addClass([this.inputWrapper.container],["e-input-focus"])),e.preventDefault(),this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.startValue=null,this.endValue=null,this.removeSelection(),this.hide(e)},r.prototype.deviceHeaderUpdate=function(){t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)?(this.endButton.element.setAttribute("disabled",""),this.startButton.element.classList.add(N)):t.isNullOrUndefined(this.startValue)||this.startButton.element.classList.add(N)},r.prototype.applyFunction=function(e){var i=!1;"touchstart"!==e.type&&e.preventDefault(),this.closeEventArgs&&this.closeEventArgs.cancel&&(this.startValue=this.popupWrapper.querySelector(".e-start-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-start-date")),this.endValue=this.popupWrapper.querySelector(".e-end-date")&&this.getIdValue(null,this.popupWrapper.querySelector(".e-end-date")),this.setValue()),document.activeElement!==this.inputElement&&(this.preventFocus=!0,this.inputElement.focus(),t.addClass([this.inputWrapper.container],["e-input-focus"])),"touchstart"!==e.type&&this.closeEventArgs&&!this.closeEventArgs.cancel&&e.preventDefault(),t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.endValue)?this.hide(e||null):(this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue),this.previousEleValue=this.inputElement.value,s.Input.setValue(this.rangeArgs(e).text,this.inputElement,this.floatLabelType,this.showClearButton),+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(i=!0),this.changeTrigger(e),this.hide(e||null),this.errorClass(),i=!0),t.closest(e.target,".e-input-group")||i||this.focusOut(),this.isMobile||(this.isKeyPopup=!1,this.isRangeIconClicked&&(this.inputWrapper.container.children[1].focus(),this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new t.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyConfigs:this.keyInputConfigs,keyAction:this.popupKeyActionHandle.bind(this)})))},r.prototype.onMouseClick=function(e,i){if("touchstart"!==e.type){var s=i||e.target,a=t.closest(s,"."+z),n=a&&a.classList.contains(N);a&&a.classList.contains(z)&&this.setListSelection(a,e),this.preventFocus=!0,this.inputElement.focus(),this.isMobile||(this.preventFocus=!0,a&&a.classList.contains(z)&&"custom_range"===a.getAttribute("id")?this.leftCalendar.children[1].firstElementChild.focus():n||"keydown"!==e.type||this.inputElement.focus())}},r.prototype.onMouseOver=function(e){var i=t.closest(e.target,"."+z);i&&i.classList.contains(z)&&!i.classList.contains(L)&&t.addClass([i],L)},r.prototype.onMouseLeave=function(e){var i=t.closest(e.target,"."+L);t.isNullOrUndefined(i)||t.removeClass([i],L)},r.prototype.setListSelection=function(e,i){if(e&&(!e.classList.contains(N)||this.isMobile&&e.classList.contains(N))){if(this.isMobile&&e.classList.contains(N)){if(this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),"custom_range"===this.presetsItem[this.activeIndex].id)return void this.renderCustomPopup();return}this.removeListSelection(),this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),t.addClass([e],N),e.setAttribute("aria-selected","true");var s=this.presetsItem[this.activeIndex];"custom_range"===s.id?this.renderCustomPopup():this.applyPresetRange(s,i)}},r.prototype.removeListSelection=function(){var e=this.presetElement.querySelector(".e-active");t.isNullOrUndefined(e)||(t.removeClass([e],N),e.removeAttribute("aria-selected"))},r.prototype.setValue=function(){this.modelValue=[this.startValue,this.endValue]},r.prototype.applyPresetRange=function(e,t){this.hide(null),this.presetsItem[this.presetsItem.length-1].start=null,this.presetsItem[this.presetsItem.length-1].end=null,this.startValue=e.start,this.endValue=e.end,this.setValue(),this.refreshControl(),this.trigger("select",this.rangeArgs(t)),this.changeTrigger(t),this.previousEleValue=this.inputElement.value,this.isCustomRange=!1,this.leftCalendar=this.rightCalendar=null,this.isKeyPopup&&(this.isRangeIconClicked=!1,this.inputElement.focus())},r.prototype.showPopup=function(e,t){this.presetHeight(),1e3===this.zIndex?this.popupObj.show(null,this.element):this.popupObj.show(null,null),this.isMobile&&this.popupObj.refreshPosition()},r.prototype.renderCustomPopup=function(){this.isCustomWindow=!0,this.popupObj.hide(),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:O+" e-popup"}),this.renderControl(),this.openEventArgs.appendTo.appendChild(this.popupWrapper),this.showPopup(),this.isCustomRange=!0,this.isMobile||this.calendarFocus()},r.prototype.listRippleEffect=function(){for(var e=0,i=this.liCollections;e<i.length;e++){var s=i[e];t.rippleEffect(s)}},r.prototype.createPresets=function(){if(!t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)){this.presetElement=this.createElement("div",{className:"e-presets",attrs:{tabindex:"0"}});var e=n.ListBase.createList(this.createElement,this.presetsItem,null,!0);t.attributes(e,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),this.presetElement.appendChild(e),this.popupWrapper.appendChild(this.presetElement);var i=this.presetElement.querySelector("#custom_range");t.isNullOrUndefined(i)||(i.textContent=""!==this.l10n.getConstant("customRange")?this.l10n.getConstant("customRange"):"Custom Range"),this.liCollections=this.presetElement.querySelectorAll("."+z),this.wireListEvents(),this.isMobile&&(this.presetElement.style.width=this.inputWrapper.container.getBoundingClientRect().width+"px"),!t.isNullOrUndefined(this.activeIndex)&&this.activeIndex>-1&&t.addClass([this.liCollections[this.activeIndex]],N)}},r.prototype.wireListEvents=function(){t.EventHandler.add(this.presetElement,"click",this.onMouseClick,this),this.isMobile||(t.EventHandler.add(this.presetElement,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.presetElement,"mouseout",this.onMouseLeave,this))},r.prototype.unWireListEvents=function(){t.isNullOrUndefined(this.presetElement)||(t.EventHandler.remove(this.presetElement,"click touchstart",this.onMouseClick),this.isMobile||(t.EventHandler.remove(this.presetElement,"mouseover",this.onMouseOver),t.EventHandler.remove(this.presetElement,"mouseout",this.onMouseLeave)))},r.prototype.renderPopup=function(){var e=this;this.popupWrapper.classList.add("e-control");var s=this.popupWrapper.getBoundingClientRect().width;t.isNullOrUndefined(this.cssClass)||""===this.cssClass.trim()||(this.popupWrapper.className+=" "+this.cssClass),this.isMobile&&this.isCustomWindow&&(this.modal=this.createElement("div"),document.body.appendChild(this.modal)),this.popupObj=new i.Popup(this.popupWrapper,{relateTo:this.isMobile&&this.isCustomWindow?document.body:t.isNullOrUndefined(this.targetElement)?this.inputWrapper.container:this.targetElement,position:this.isMobile?t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"center",Y:"center"}:{X:"left",Y:"bottom"}:this.enableRtl?{X:"left",Y:"bottom"}:{X:"right",Y:"bottom"},offsetX:this.isMobile||this.enableRtl?0:-s,offsetY:4,collision:this.isMobile?t.isUndefined(this.presets[0].start&&this.presets[0].end&&this.presets[0].label)||this.isCustomWindow?{X:"fit",Y:"fit"}:{X:"fit"}:{X:"fit",Y:"flip"},targetType:this.isMobile&&this.isCustomWindow?"container":"relative",enableRtl:this.enableRtl,zIndex:this.zIndex,open:function(){t.attributes(e.inputElement,{"aria-expanded":"true"}),t.addClass([e.inputWrapper.buttons[0]],N),e.isMobile||(e.cancelButton&&(e.btnKeyboardModule=new t.KeyboardEvents(e.cancelButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{tab:"tab",altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),e.btnKeyboardModule=new t.KeyboardEvents(e.applyButton.element,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}})),t.isNullOrUndefined(e.leftCalendar)||e.isRangeIconClicked||e.calendarFocus(),t.isNullOrUndefined(e.presetElement)||(e.keyInputConfigs=t.extend(e.keyInputConfigs,e.keyConfigs),e.presetKeyboardModule=new t.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.presetKeyActionHandler.bind(e),keyConfigs:e.keyInputConfigs}),e.presetKeyboardModule=new t.KeyboardEvents(e.presetElement,{eventName:"keydown",keyAction:e.popupKeyActionHandle.bind(e),keyConfigs:{altRightArrow:"alt+rightarrow",altLeftArrow:"alt+leftarrow"}}),t.isNullOrUndefined(e.leftCalendar)?(e.preventBlur=!0,e.presetElement.focus()):e.presetElement.setAttribute("tabindex","-1")),e.popupKeyBoardHandler()),e.isMobile&&!t.Browser.isDevice&&t.EventHandler.add(document,"keydown",e.popupCloseHandler,e)},close:function(){t.attributes(e.inputElement,{"aria-expanded":"false"}),t.removeClass([e.inputWrapper.buttons[0]],N),e.isRangeIconClicked&&e.inputWrapper.container.children[1].focus(),t.isUndefined(e.presets[0].start&&e.presets[0].end&&e.presets[0].label)||e.unWireListEvents(),t.isNullOrUndefined(e.popupObj)||(t.isNullOrUndefined(e.popupObj.element.parentElement)||t.detach(e.popupObj.element),e.popupObj.destroy(),e.popupObj=null),e.isMobile&&!t.Browser.isDevice&&t.EventHandler.remove(document,"keydown",e.popupCloseHandler)},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),this.isMobile&&(this.popupObj.element.classList.add("e-device"),this.isMobile||this.popupObj.element.classList.add("e-bigger")),this.isMobile&&this.isCustomWindow&&(t.addClass([this.modal],["e-device",O,"e-range-modal"]),document.body.className+=" e-range-overflow",this.modal.style.display="block"),t.EventHandler.add(document,"mousedown touchstart",this.documentHandler,this)},r.prototype.popupCloseHandler=function(e){switch(e.keyCode){case 27:this.hide(e)}},r.prototype.calendarFocus=function(){var e=this.popupObj&&this.popupObj.element.querySelector("."+I);if(e){var i=t.closest(e,"."+V);i=t.isNullOrUndefined(i)?this.leftCalendar:i,this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,i.children[1].firstElementChild.focus()),t.addClass([e],P)}else this.isRangeIconClicked?this.inputWrapper.container.focus():(this.preventBlur=!0,this.leftCalendar.children[1].firstElementChild.focus())},r.prototype.presetHeight=function(){var e=this.popupObj&&this.popupObj.element.querySelector(".e-presets"),i=this.popupObj&&this.popupObj.element.querySelector(".e-date-range-container");t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||(e.style.height=i.getBoundingClientRect().height+"px")},r.prototype.presetKeyActionHandler=function(e){switch(e.action){case"moveDown":this.listMoveDown(e),this.setScrollPosition(),e.preventDefault();break;case"moveUp":this.listMoveUp(e),this.setScrollPosition(),e.preventDefault();break;case"enter":var i=this.getHoverLI(),s=this.getActiveLI();if(!t.isNullOrUndefined(this.leftCalendar)&&!t.isNullOrUndefined(s)&&(t.isNullOrUndefined(i)||!t.isNullOrUndefined(s)&&s===i)&&(this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(s),"custom_range"===this.presetsItem[this.activeIndex].id))return this.calendarFocus(),s.classList.remove(L),void e.preventDefault();t.isNullOrUndefined(i)&&t.isNullOrUndefined(s)||this.onMouseClick(e,i||s),e.preventDefault();break;case"tab":if(this.leftCalendar){var a=this.getHoverLI();t.isNullOrUndefined(a)||a.classList.remove(L)}else this.hide(e),e.preventDefault()}},r.prototype.listMoveDown=function(e){var i=this.getHoverLI(),s=this.getActiveLI();if(t.isNullOrUndefined(i))if(t.isNullOrUndefined(s))t.addClass([this.liCollections[0]],L);else{a=s.nextElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(z)&&t.addClass([a],L)}else{var a=i.nextElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(z)&&(t.removeClass([i],L),t.addClass([a],L))}},r.prototype.listMoveUp=function(e){var i=this.getHoverLI(),s=this.getActiveLI();if(t.isNullOrUndefined(i)){if(!t.isNullOrUndefined(s)){a=s.previousElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(z)&&t.addClass([a],L)}}else{var a=i.previousElementSibling;!t.isNullOrUndefined(a)&&a.classList.contains(z)&&(t.removeClass([i],L),t.addClass([a],L))}},r.prototype.getHoverLI=function(){return this.presetElement.querySelector("."+L)},r.prototype.getActiveLI=function(){return this.presetElement.querySelector(".e-active")},r.prototype.popupKeyBoardHandler=function(){this.popupKeyboardModule=new t.KeyboardEvents(this.popupWrapper,{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:{escape:"escape"}}),this.keyInputConfigs=t.extend(this.keyInputConfigs,this.keyConfigs),this.popupKeyboardModule=new t.KeyboardEvents(this.inputWrapper.container.children[1],{eventName:"keydown",keyAction:this.popupKeyActionHandle.bind(this),keyConfigs:this.keyInputConfigs})},r.prototype.setScrollPosition=function(){var e=this.presetElement.getBoundingClientRect().height,i=this.presetElement.querySelector("."+L),s=this.presetElement.querySelector(".e-active"),a=t.isNullOrUndefined(i)?s:i;if(!t.isNullOrUndefined(a)){var n=a.nextElementSibling,r=n?n.offsetTop:a.offsetTop,l=a.getBoundingClientRect().height;r+a.offsetTop>e?this.presetElement.scrollTop=n?r-(e/2+l/2):r:this.presetElement.scrollTop=0}},r.prototype.popupKeyActionHandle=function(e){var i=t.closest(e.target,".e-presets");switch(e.action){case"escape":this.isPopupOpen()?(this.isKeyPopup&&(this.inputElement.focus(),this.isKeyPopup=!1),this.hide(e)):this.inputWrapper.container.children[1].blur();break;case"enter":this.isPopupOpen()?this.inputWrapper.container.children[1].focus():this.show(null,e);break;case"tab":this.hide(e);break;case"altRightArrow":t.isNullOrUndefined(i)?document.activeElement===this.cancelButton.element&&!0!==this.applyButton.element.disabled?this.applyButton.element.focus():this.leftCalendar.children[1].firstElementChild.focus():this.cancelButton.element.focus(),e.preventDefault();break;case"altLeftArrow":t.isNullOrUndefined(i)?document.activeElement===this.applyButton.element&&!0!==this.applyButton.element.disabled?this.cancelButton.element.focus():t.isNullOrUndefined(this.presetElement)||document.activeElement!==this.cancelButton.element?this.rightCalendar.children[1].firstElementChild.focus():this.presetElement.focus():this.rightCalendar.children[1].firstElementChild.focus(),e.preventDefault()}},r.prototype.documentHandler=function(e){if(!t.isNullOrUndefined(this.popupObj)){var i=e.target;this.inputWrapper.container.contains(i)&&(t.isNullOrUndefined(this.popupObj)||t.closest(i,'[id="'+this.popupWrapper.id+'"]'))||"touchstart"!==e.type&&("mousedown"===e.type||this.closeEventArgs&&!this.closeEventArgs.cancel)&&e.preventDefault(),!t.isNullOrUndefined(this.targetElement)&&(t.isNullOrUndefined(this.targetElement)||i===this.targetElement)||t.closest(i,'[id="'+this.popupWrapper.id+'"]')||t.closest(i,".e-input-group")===this.inputWrapper.container||t.closest(i,".e-daterangepicker.e-popup")&&!i.classList.contains("e-day")||(this.preventBlur=!1,this.isPopupOpen()&&document.body.contains(this.popupObj.element)&&(this.applyFunction(e),this.isMobile||(this.isRangeIconClicked=!1)))}},r.prototype.createInput=function(){var e=this.cssClass;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=s.Input.createInput({floatLabelType:this.floatLabelType,element:this.inputElement,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:["e-input-group-icon e-range-icon e-icons"]},this.createElement),t.attributes(this.inputElement,{"aria-readonly":this.readonly?"true":"false",tabindex:"0","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_popup","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}),s.Input.addAttributes({"aria-label":"select"},this.inputWrapper.buttons[0]),t.isNullOrUndefined(this.placeholder)||""===this.placeholder.trim()||s.Input.addAttributes({"aria-placeholder":this.placeholder},this.inputElement),this.setEleWidth(this.width),t.addClass([this.inputWrapper.container],"e-date-range-wrapper"),t.isNullOrUndefined(this.inputElement.getAttribute("name"))&&t.attributes(this.inputElement,{name:this.element.id}),"hidden"===this.inputElement.type&&(this.inputWrapper.container.style.display="none"),this.refreshControl(),this.previousEleValue=this.inputElement.value,this.inputElement.setAttribute("value",this.inputElement.value),this.startCopy=this.startDate,this.endCopy=this.endDate},r.prototype.setEleWidth=function(e){this.inputWrapper.container.style.width="string"==typeof e?this.width:"number"==typeof e?t.formatUnit(this.width):"100%"},r.prototype.adjustLongHeaderWidth=function(){"Wide"===this.dayHeaderFormat&&t.addClass([this.popupWrapper],"e-daterange-day-header-lg")},r.prototype.refreshControl=function(){this.validateMinMax(),this.strictMode&&this.validateRangeStrict();var e=this.disabledDates();this.strictMode&&e&&(this.startValue=this.previousStartValue,this.setProperties({startDate:this.startValue},!0),this.endValue=this.previousEndValue,this.setProperties({endDate:this.endValue},!0),this.setValue()),this.updateInput(),this.strictMode||this.validateRange(),!this.strictMode&&e&&this.clearRange(),t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||e||this.disabledDateRender(),this.errorClass(),this.previousStartValue=t.isNullOrUndefined(this.startValue)||isNaN(+this.startValue)?null:new Date(+this.startValue),this.previousEndValue=t.isNullOrUndefined(this.endValue)||isNaN(+this.endValue)?null:new Date(+this.endValue)},r.prototype.updateInput=function(){if(!t.isNullOrUndefined(this.endValue)&&!t.isNullOrUndefined(this.startValue)){var e={format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"},i=this.globalize.formatDate(this.startValue,e),a=this.globalize.formatDate(this.endValue,e);s.Input.setValue(i+" "+this.separator+" "+a,this.inputElement,this.floatLabelType,this.showClearButton),this.previousStartValue=new Date(+this.startValue),this.previousEndValue=new Date(+this.endValue)}!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&s.Input.setValue(this.invalidValueString,this.inputElement,this.floatLabelType,this.showClearButton)},r.prototype.checkInvalidRange=function(e){if(!t.isNullOrUndefined(e)){var i=!1,s=void 0,a=void 0,n=null,r=null,l=null,o=!1,h=!1,u=!1;if("string"==typeof e){var d=e.split(" "+this.separator+" ");2===d.length?(n=d[0],r=d[1]):(i=!0,l=e)}else e.length>0?(s=e[0],a=e[1]):(s=e.start,a=e.end),s instanceof Date||"object"==typeof s?s instanceof Date?o=!0:t.isNullOrUndefined(s)||(u=!0):n=this.getstringvalue(s),a instanceof Date||"object"==typeof a?a instanceof Date?h=!0:t.isNullOrUndefined(a)||(u=!0):r=this.getstringvalue(a);(t.isNullOrUndefined(n)&&!o&&!t.isNullOrUndefined(r)||!t.isNullOrUndefined(n)&&!h&&t.isNullOrUndefined(r))&&(i=!0),u&&(n=r=l=null,i=!0),n&&(i=i||this.checkInvalidValue(n)),r&&(i=i||this.checkInvalidValue(r)),i&&(o&&!u&&(n=s.toLocaleDateString()),h&&!u&&(r=a.toLocaleDateString()),t.isNullOrUndefined(n)||t.isNullOrUndefined(r)?t.isNullOrUndefined(n)?t.isNullOrUndefined(r)||(l=r):l=n:l=n+" "+this.separator+" "+r,this.invalidValueString=l,this.setProperties({value:null},!0),this.setProperties({startValue:null},!0),this.setProperties({endValue:null},!0),this.startDate=null,this.endDate=null)}},r.prototype.getstringvalue=function(e){var i=null;return t.isNullOrUndefined(e)||"number"!=typeof e?t.isNullOrUndefined(e)||"string"!=typeof e||(i=""+e):i=e.toString(),i},r.prototype.checkInvalidValue=function(e){var i=e,s=!1,a=null;if(a={format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"},"string"!=typeof i)s=!0;else{var n=new t.Internationalization(this.locale);if(!this.checkDateValue(n.parseDate(i,a))){var r=null;r=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,(!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(i)&&!r.test(i)||/^[a-zA-Z0-9- ]*$/.test(i)||isNaN(+new Date(this.checkValue(i))))&&(s=!0)}}return s},r.prototype.isDateDisabled=function(e){if(t.isNullOrUndefined(e))return!1;var i=new Date(+e);if(+i<+this.min||+i>+this.max)return!0;this.virtualRenderCellArgs={date:i,isDisabled:!1};var s=this.virtualRenderCellArgs;return this.virtualRenderCellEvent(s),!!s.isDisabled},r.prototype.disabledDateRender=function(){this.disabledDays=[],this.disabledDayCnt=null;for(var e=new Date(+this.startValue),t=0;+e<=+this.endValue;){this.virtualRenderCellArgs={date:e,isDisabled:!1};var i=this.virtualRenderCellArgs;this.virtualRenderCellEvent(i),i.isDisabled&&(this.disabledDays.push(new Date(+i.date)),+e>+this.startValue&&+e<+this.endValue&&t++),this.addDay(e,1,null,this.max,this.min)}this.disabledDayCnt=t},r.prototype.virtualRenderCellEvent=function(e){t.extend(this.virtualRenderCellArgs,{name:"renderDayCell"}),this.trigger("renderDayCell",e)},r.prototype.disabledDates=function(){var e=!1,i=!1;return t.isNullOrUndefined(this.endValue)||t.isNullOrUndefined(this.startValue)||(e=this.isDateDisabled(this.startValue),i=this.isDateDisabled(this.endValue),this.isPopupOpen()||(this.currentDate=null),this.setValue()),e||i},r.prototype.setModelValue=function(){this.value||null!==this.startDate||null!==this.endDate?null===this.value||null===this.value.start?null===this.value?this.setProperties({value:[this.startDate,this.endDate]},!0):null===this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.value&&this.value.length>0||this.valueType&&this.valueType.length>0?(+this.startDate==+this.value[0]&&+this.endDate==+this.value[1]||this.setProperties({value:[this.startDate,this.endDate]},!0),this.value&&null==this.value[0]&&null==this.value[1]&&this.setProperties({value:null},!0)):this.value&&this.value.start&&this.setProperties({value:{start:this.startDate,end:this.endDate}},!0):this.setProperties({value:null},!0),this.createHiddenInput()},r.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e.dispatchEvent(i),this.firstHiddenChild.dispatchEvent(i)},r.prototype.changeTrigger=function(e){+this.initStartDate==+this.startValue&&+this.initEndDate==+this.endValue||(this.setProperties({endDate:this.checkDateValue(this.endValue)},!0),this.setProperties({startDate:this.checkDateValue(this.startValue)},!0),this.setModelValue(),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",this.rangeArgs(e))),this.previousEleValue=this.inputElement.value,this.initStartDate=this.checkDateValue(this.startValue),this.initEndDate=this.checkDateValue(this.endValue)},r.prototype.navigateTo=function(t,i){if(this.isPopupOpen()){if("month"===t.toLowerCase())t="Month";else if("year"===t.toLowerCase())t="Year";else{if("decade"!==t.toLowerCase())return;t="Decade"}this.getViewNumber(t)<this.getViewNumber(this.depth)&&(t=this.depth),this.isMobile?e.prototype.navigateTo.call(this,t,i):(i<this.min?i=new Date(+this.min):i>=this.max&&(i=new Date(+this.max)),"Month"===t&&this.isSameMonth(i,this.max)?i=new Date(this.max.getFullYear(),this.max.getMonth()-1,this.min.getDate()):"Year"===t&&this.isSameYear(i,this.max)?i=new Date(this.max.getFullYear()-1,this.max.getMonth(),this.max.getDate()):"Decade"===t&&this.isSameDecade(i,this.max)&&(i=new Date(this.max.getFullYear()-10,this.max.getMonth(),this.max.getDate())),this.leftCalCurrentDate=i,this.navigate(this.leftCalendar,this.leftCalCurrentDate,t),i="Month"===t?new Date(this.currentDate.setMonth(this.currentDate.getMonth()+1)):"Year"===t?new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+1)):new Date(this.currentDate.setFullYear(this.currentDate.getFullYear()+10)),this.rightCalCurrentDate=i,this.navigate(this.rightCalendar,this.rightCalCurrentDate,t),this.leftKeyboardModule=this.rightKeyboardModule=null,this.updateNavIcons()),this.currentView()===this.depth&&this.bindCalendarCellEvents(),this.removeFocusedDate(),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar])}},r.prototype.navigate=function(t,i,s){this.calendarElement=t,this.table=t.querySelector("table"),this.tableBodyElement=t.querySelector("tbody"),this.headerTitleElement=t.querySelector(".e-title"),this.tableHeadElement=t.querySelector("thead"),this.contentElement=t.querySelector(".e-content"),this.previousIcon=t.querySelector(".e-prev"),this.nextIcon=t.querySelector(".e-next"),this.effect="e-zoomin",e.prototype.navigateTo.call(this,s,i)},r.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&(t.addClass([this.inputWrapper.container],["e-input-focus"]),this.inputElement.focus())},r.prototype.focusOut=function(){var e=this.preventBlur;document.activeElement===this.inputElement&&(t.removeClass([this.inputWrapper.container],["e-input-focus"]),this.preventBlur=!1,this.inputElement.blur(),this.preventBlur=e)},r.prototype.destroy=function(){this.unBindEvents(),this.hide(null);var i={"aria-readonly":this.readonly?"true":"false",tabindex:"0","aria-haspopup":"true","aria-activedescendant":"null","aria-owns":this.element.id+"_popup","aria-expanded":"false",role:"combobox",autocomplete:"off","aria-disabled":this.enabled?"false":"true",autocorrect:"off",autocapitalize:"off","aria-invalid":"false",spellcheck:"false"};this.inputElement&&(t.removeClass([this.inputElement],[O]),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),s.Input.removeAttributes(i,this.inputElement),t.isNullOrUndefined(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.inputElement.classList.remove("e-input"),t.isNullOrUndefined(this.inputWrapper)||(t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.rangeIconHandler),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),t.detach(this.inputWrapper.container))),t.isNullOrUndefined(this.inputKeyboardModule)||this.isMobile||this.inputKeyboardModule.destroy(),this.popupObj&&(this.isMobile||this.clearCalendarEvents()),e.prototype.destroy.call(this),this.inputWrapper=this.popupWrapper=this.popupObj=this.cloneElement=this.presetElement=null,this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),t.isNullOrUndefined(this.firstHiddenChild)||t.isNullOrUndefined(this.secondHiddenChild)||(t.detach(this.firstHiddenChild),t.detach(this.secondHiddenChild),this.firstHiddenChild=this.secondHiddenChild=null,this.inputElement.setAttribute("name",this.element.getAttribute("data-name")),this.inputElement.removeAttribute("data-name"))},r.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.cloneElement.getAttribute(e[i]))?("value"===e[i].toLowerCase()&&(this.inputElement.value=""),this.inputElement.removeAttribute(e[i])):("value"===e[i].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[i])),this.inputElement.setAttribute(e[i],this.cloneElement.getAttribute(e[i])))},r.prototype.getModuleName=function(){return"daterangepicker"},r.prototype.getPersistData=function(){var e=["startDate","endDate","value"];return this.addOnPersist(e)},r.prototype.getSelectedRange=function(){var e;return t.isNullOrUndefined(this.startValue)||t.isNullOrUndefined(this.endValue)?e=0:(e=Math.round(Math.abs((this.removeTimeValueFromDate(this.startValue).getTime()-this.removeTimeValueFromDate(this.endValue).getTime())/864e5))+1,this.disabledDateRender(),t.isNullOrUndefined(this.disabledDayCnt)||(e-=this.disabledDayCnt,this.disabledDayCnt=null)),{startDate:this.startValue,endDate:this.endValue,daySpan:e}},r.prototype.show=function(i,s){var a=this;if(this.isMobile&&this.popupObj&&this.popupObj.refreshPosition(),!(this.enabled&&this.readonly||!this.enabled||this.popupObj||this.isPopupOpen())){i&&(this.targetElement=i),this.createPopup(),(this.isMobile||t.Browser.isDevice)&&(this.mobileRangePopupWrap=this.createElement("div",{className:"e-daterangepick-mob-popup-wrap"}),document.body.appendChild(this.mobileRangePopupWrap)),this.openEventArgs={popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj||null,cancel:!1,date:this.inputElement.value,model:t.isBlazor()&&this.isServerRendered?null:this,event:s||null,appendTo:this.isMobile||t.Browser.isDevice?this.mobileRangePopupWrap:document.body};var n=this.openEventArgs;this.trigger("open",n,function(n){if(a.openEventArgs=n,!a.openEventArgs.cancel){a.openEventArgs.appendTo.appendChild(a.popupWrapper),a.showPopup(i,s);var r=!a.isCustomRange||a.isMobile&&a.isCustomRange;!t.isUndefined(a.presets[0].start&&a.presets[0].end&&a.presets[0].label)&&r&&a.setScrollPosition(),a.checkMinMaxDays(),a.isMobile&&!t.isNullOrUndefined(a.startDate)&&t.isNullOrUndefined(a.endDate)&&(a.endButton.element.classList.add(N),a.startButton.element.classList.remove(N),a.endButton.element.removeAttribute("disabled"),a.selectableDates()),e.prototype.setOverlayIndex.call(a,a.mobileRangePopupWrap,a.popupObj.element,a.modal,a.isMobile||t.Browser.isDevice)}})}},r.prototype.hide=function(e){var i=this;if(this.popupObj){if(t.isNullOrUndefined(this.previousEndValue)&&t.isNullOrUndefined(this.previousStartValue)?this.clearRange():(t.isNullOrUndefined(this.previousStartValue)?(this.startValue=null,this.setValue()):(this.startValue=new Date(this.checkValue(this.previousStartValue)),this.setValue(),this.currentDate=new Date(this.checkValue(this.startValue))),t.isNullOrUndefined(this.previousEndValue)?(this.endValue=null,this.setValue()):(this.endValue=new Date(this.checkValue(this.previousEndValue)),this.setValue())),this.isPopupOpen()){this.closeEventArgs={cancel:!1,popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj,date:this.inputElement.value,model:t.isBlazor()&&this.isServerRendered?null:this,event:e||null};var s=this.closeEventArgs;this.trigger("close",s,function(e){i.closeEventArgs=e,i.closeEventArgs.cancel?t.removeClass([i.inputWrapper.buttons[0]],N):(i.isMobile&&(t.isNullOrUndefined(i.startButton)||t.isNullOrUndefined(i.endButton)||(t.EventHandler.remove(i.startButton.element,"click touchstart",i.deviceHeaderClick),t.EventHandler.remove(i.endButton.element,"click touchstart",i.deviceHeaderClick))),i.popupObj&&(i.popupObj.hide(),i.preventBlur&&(i.inputElement.focus(),t.addClass([i.inputWrapper.container],["e-input-focus"]))),i.isMobile||(t.isNullOrUndefined(i.leftKeyboardModule)||t.isNullOrUndefined(i.rightKeyboardModule)||(i.leftKeyboardModule.destroy(),i.rightKeyboardModule.destroy()),t.isNullOrUndefined(i.presetElement)||i.presetKeyboardModule.destroy(),t.isNullOrUndefined(i.cancelButton)||i.btnKeyboardModule.destroy()),i.targetElement=null,t.removeClass([document.body],"e-range-overflow"),t.EventHandler.remove(document,"mousedown touchstart",i.documentHandler),i.isMobile&&i.modal&&(i.modal.style.display="none",i.modal.outerHTML="",i.modal=null),(i.isMobile||t.Browser.isDevice)&&(t.isNullOrUndefined(i.mobileRangePopupWrap)||(i.mobileRangePopupWrap.remove(),i.mobileRangePopupWrap=null)),i.isKeyPopup=i.dateDisabled=!1),i.updateClearIconState(),i.updateHiddenInput(),i.isMobile&&i.allowEdit&&!i.readonly&&i.inputElement.removeAttribute("readonly")})}}else this.updateClearIconState(),this.updateHiddenInput(),this.isMobile&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},r.prototype.setLocale=function(){this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement),this.updateInput(),this.updateHiddenInput(),this.changeTrigger()},r.prototype.refreshChange=function(){this.checkView(),this.refreshControl(),this.changeTrigger()},r.prototype.setDate=function(){s.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.refreshChange()},r.prototype.enableInput=function(){+this.min<=+this.max&&(this.setProperties({enabled:!0},!0),s.Input.setEnabled(this.enabled,this.inputElement),this.element.hasAttribute("disabled")&&this.bindEvents())},r.prototype.clearModelvalue=function(e,t){this.setProperties({startDate:null},!0),this.setProperties({endDate:null},!0),t.value&&t.value.length>0?this.setProperties({value:null},!0):t.value&&t.value.start?this.setProperties({value:{start:null,end:null}},!0):t.value&&!t.value.start&&this.setProperties({value:{start:null,end:null}},!0),this.updateValue(),this.setDate()},r.prototype.createHiddenInput=function(){t.isNullOrUndefined(this.firstHiddenChild)&&t.isNullOrUndefined(this.secondHiddenChild)&&(this.firstHiddenChild=this.createElement("input"),this.secondHiddenChild=this.createElement("input")),t.isNullOrUndefined(this.inputElement.getAttribute("name"))||(this.inputElement.setAttribute("data-name",this.inputElement.getAttribute("name")),this.inputElement.removeAttribute("name")),t.attributes(this.firstHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:"e-daterange-hidden"}),t.attributes(this.secondHiddenChild,{type:"text",name:this.inputElement.getAttribute("data-name"),class:"e-daterange-hidden"});var e={type:"datetime",skeleton:t.isBlazor()?"d":"yMd"};this.firstHiddenChild.value=this.startDate&&this.globalize.formatDate(this.startDate,e),this.secondHiddenChild.value=this.endDate&&this.globalize.formatDate(this.endDate,e),this.inputElement.parentElement.appendChild(this.firstHiddenChild),this.inputElement.parentElement.appendChild(this.secondHiddenChild)},r.prototype.setMinMaxDays=function(){this.isPopupOpen()&&(this.removeClassDisabled(),this.checkMinMaxDays(),this.isMobile&&this.selectableDates(),!this.strictMode&&t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue)?this.removeSelection():this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader())},r.prototype.onPropertyChanged=function(e,i){for(var a={format:this.formatString,type:"date",skeleton:t.isBlazor()?"d":"yMd"},n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(["maxDays","minDays","value"].indexOf(l)<0&&this.hide(null),l){case"width":this.setEleWidth(this.width);break;case"separator":this.previousEleValue=this.inputElement.value,this.setProperties({separator:e.separator},!0),this.updateInput(),this.changeTrigger();break;case"placeholder":s.Input.setPlaceholder(e.placeholder,this.inputElement),this.setProperties({placeholder:e.placeholder},!0);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement),this.inputElement.setAttribute("aria-readonly",""+this.readonly),this.setRangeAllowEdit();break;case"cssClass":this.updateCssClass(e.cssClass,i.cssClass);break;case"enabled":this.setProperties({enabled:e.enabled},!0),s.Input.setEnabled(this.enabled,this.inputElement),this.enabled?this.inputElement.setAttribute("tabindex",this.tabIndex):this.inputElement.tabIndex=-1;break;case"allowEdit":this.setRangeAllowEdit();break;case"enableRtl":this.setProperties({enableRtl:e.enableRtl},!0),s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.updateInput(),this.changeTrigger();break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.placeholder,this.inputElement),this.setLocale();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.setDataAttribute(!0),this.checkHtmlAttributes(!0);break;case"showClearButton":s.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"startDate":"string"==typeof e.startDate&&(e.startDate=this.globalize.parseDate(e.startDate,a)),+this.initStartDate!=+e.startDate&&(this.startValue=this.checkDateValue(new Date(this.checkValue(e.startDate))),this.setDate(),this.setValue());break;case"endDate":"string"==typeof e.endDate&&(e.endDate=this.globalize.parseDate(e.endDate,a)),+this.initEndDate!=+e.endDate&&(this.endValue=this.checkDateValue(new Date(this.checkValue(e.endDate))),this.setDate(),this.setValue());break;case"value":if(this.invalidValueString=null,this.checkInvalidRange(e.value),"string"==typeof e.value)if(this.invalidValueString)this.clearModelvalue(e,i);else{var o=e.value.split(" "+this.separator+" ");this.value=[new Date(o[0]),new Date(o[1])],this.updateValue(),this.setDate()}else!t.isNullOrUndefined(e.value)&&e.value.length>0||!t.isNullOrUndefined(e.value)&&e.value.start?(this.valueType=e.value,null===e.value[0]||null===e.value.start?1===e.value.length||e.value.start?this.clearModelvalue(e,i):null!==e.value[1]&&null!==e.value.start||this.clearModelvalue(e,i):+this.initStartDate==+e.value[0]&&+this.initEndDate==+e.value[1]&&+this.initStartDate==+(e.value.start||+this.initEndDate!=+e.value.start)||(1===e.value.length?this.modelValue=e.value:e.value.start&&(this.modelValue=e.value),this.updateValue(),this.setDate())):(t.isNullOrUndefined(this.value)||null==e.value.start)&&(this.valueType=e.value,this.startValue=null,this.endValue=null,this.clearModelvalue(e,i));if(this.isPopupOpen()){if(t.isNullOrUndefined(this.startValue)&&t.isNullOrUndefined(this.endValue))return this.removeSelection(),void(this.isMobile&&this.deviceHeaderUpdate());this.isMobile?(this.navigate(this.deviceCalendar,this.startValue,this.currentView()),this.deviceHeaderUpdate()):(this.navigate(this.leftCalendar,this.startValue,this.currentView()),this.updateControl(this.leftCalendar),this.navigate(this.rightCalendar,this.endValue,this.currentView()),this.updateControl(this.rightCalendar)),this.updateRange(this.isMobile?[this.calendarElement]:[this.leftCalendar,this.rightCalendar]),this.updateHeader(),this.applyButton.disabled=this.applyButton.element.disabled=!1}this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"minDays":this.setProperties({minDays:e.minDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"maxDays":this.setProperties({maxDays:e.maxDays},!0),this.refreshChange(),this.setMinMaxDays();break;case"min":this.setProperties({min:this.checkDateValue(new Date(this.checkValue(e.min)))},!0),this.previousEleValue=this.inputElement.value,this.enableInput(),this.refreshChange();break;case"max":this.setProperties({max:this.checkDateValue(new Date(this.checkValue(e.max)))},!0),this.enableInput(),this.refreshChange();break;case"strictMode":this.invalidValueString=null,this.setProperties({strictMode:e.strictMode},!0),this.refreshChange();break;case"presets":this.setProperties({presets:e.presets},!0),this.processPresets();break;case"floatLabelType":this.floatLabelType=e.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder);break;case"start":this.setProperties({start:e.start},!0),this.refreshChange();break;case"depth":this.setProperties({depth:e.depth},!0),this.refreshChange()}}},M([t.Property(null)],r.prototype,"value",void 0),M([t.Property(!1)],r.prototype,"enablePersistence",void 0),M([t.Property(new Date(1900,0,1))],r.prototype,"min",void 0),M([t.Property(new Date(2099,11,31))],r.prototype,"max",void 0),M([t.Property(null)],r.prototype,"locale",void 0),M([t.Property(null)],r.prototype,"firstDayOfWeek",void 0),M([t.Property(!1)],r.prototype,"weekNumber",void 0),M([t.Property("Gregorian")],r.prototype,"calendarMode",void 0),M([t.Property(!1)],r.prototype,"openOnFocus",void 0),M([t.Event()],r.prototype,"created",void 0),M([t.Event()],r.prototype,"destroyed",void 0),M([t.Event()],r.prototype,"change",void 0),M([t.Event()],r.prototype,"cleared",void 0),M([t.Event()],r.prototype,"navigated",void 0),M([t.Event()],r.prototype,"renderDayCell",void 0),M([t.Property(null)],r.prototype,"startDate",void 0),M([t.Property(null)],r.prototype,"endDate",void 0),M([t.Collection([{}],j)],r.prototype,"presets",void 0),M([t.Property("")],r.prototype,"width",void 0),M([t.Property(1e3)],r.prototype,"zIndex",void 0),M([t.Property(!0)],r.prototype,"showClearButton",void 0),M([t.Property(!0)],r.prototype,"showTodayButton",void 0),M([t.Property("Month")],r.prototype,"start",void 0),M([t.Property("Month")],r.prototype,"depth",void 0),M([t.Property("")],r.prototype,"cssClass",void 0),M([t.Property("-")],r.prototype,"separator",void 0),M([t.Property(null)],r.prototype,"minDays",void 0),M([t.Property(null)],r.prototype,"maxDays",void 0),M([t.Property(!1)],r.prototype,"strictMode",void 0),M([t.Property(null)],r.prototype,"keyConfigs",void 0),M([t.Property(null)],r.prototype,"format",void 0),M([t.Property(!0)],r.prototype,"enabled",void 0),M([t.Property(!1)],r.prototype,"readonly",void 0),M([t.Property(!0)],r.prototype,"allowEdit",void 0),M([t.Property("Never")],r.prototype,"floatLabelType",void 0),M([t.Property(null)],r.prototype,"placeholder",void 0),M([t.Property({})],r.prototype,"htmlAttributes",void 0),M([t.Event()],r.prototype,"open",void 0),M([t.Event()],r.prototype,"close",void 0),M([t.Event()],r.prototype,"select",void 0),M([t.Event()],r.prototype,"focus",void 0),M([t.Event()],r.prototype,"blur",void 0),r=M([t.NotifyPropertyChanges],r)}(v),Y=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),q=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},K=(new Date).getDate(),_=(new Date).getMonth(),G=(new Date).getFullYear(),X="e-timepicker",Z="e-input-focus",J=["title","class","style"];!function(e){function t(e,t,i,s,a,r){this.calendarMode;var l,o=6e4*r,h=[],u=[];l=+t.setMilliseconds(0);for(var d=+i.setMilliseconds(0);d>=l;)u.push(l),h.push(s.formatDate(new Date(l),{format:a,type:"time"})),l+=o;return{collection:u,list:n.ListBase.createList(e,h,null,!0)}}e.createListItems=t}(e.TimePickerBase||(e.TimePickerBase={}));var $=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Y(i,e),q([t.Property("day")],i.prototype,"day",void 0),q([t.Property("month")],i.prototype,"month",void 0),q([t.Property("year")],i.prototype,"year",void 0),q([t.Property("day of the week")],i.prototype,"dayOfTheWeek",void 0),q([t.Property("hour")],i.prototype,"hour",void 0),q([t.Property("minute")],i.prototype,"minute",void 0),q([t.Property("second")],i.prototype,"second",void 0),i}(t.ChildProperty),Q=function(e){function a(t,i){var s=e.call(this,t,i)||this;return s.liCollections=[],s.timeCollections=[],s.blazorTimeCollections=[],s.disableItemCollection=[],s.invalidValueString=null,s.isBlazorServer=!1,s.isAngular=!1,s.preventChange=!1,s.maskedDateValue="",s.moduleName=s.getModuleName(),s.timeOptions=t,s}return Y(a,e),a.prototype.preRender=function(){this.keyConfigure={enter:"enter",escape:"escape",end:"end",tab:"tab",home:"home",down:"downarrow",up:"uparrow",left:"leftarrow",right:"rightarrow",open:"alt+downarrow",close:"alt+uparrow"},this.cloneElement=this.element.cloneNode(!0),t.removeClass([this.cloneElement],[X,"e-control","e-lib"]),this.inputElement=this.element,this.angularTag=null,this.formElement=t.closest(this.element,"form"),this.isBlazorServer=!(!t.isBlazor()||!this.isServerRendered||"timepicker"!==this.getModuleName()),this.isBlazorServer||("EJS-TIMEPICKER"===this.element.tagName&&(this.angularTag=this.element.tagName,this.inputElement=this.createElement("input"),this.element.appendChild(this.inputElement)),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.openPopupEventArgs={appendTo:document.body})},a.prototype.render=function(){if(this.isBlazorServer){this.globalize=new t.Internationalization(this.locale),this.defaultCulture=new t.Internationalization("en"),this.checkTimeFormat();var e=this.element.parentElement;this.inputWrapper={container:e,clearButton:e.querySelector(".e-clear-icon"),buttons:[e.querySelector(".e-time-icon")]},s.Input.bindInitialEvent({element:this.inputElement,floatLabelType:this.floatLabelType}),this.showClearButton&&this.inputWrapper.clearButton&&s.Input.wireClearBtnEvents(this.inputElement,this.inputWrapper.clearButton,this.inputWrapper.container)}else this.initialize(),this.createInputElement(),this.updateHtmlAttributeToWrapper(),this.setTimeAllowEdit(),this.setEnable(),this.validateInterval();this.bindEvents(),this.isBlazorServer||(this.validateDisable(),this.setValue(this.getFormattedValue(this.value)),!this.enableMask||this.value||!this.maskedDateValue||"Always"!=this.floatLabelType&&this.floatLabelType&&this.placeholder||(this.updateInputValue(this.maskedDateValue),this.checkErrorState(this.maskedDateValue))),this.anchor=this.inputElement,this.inputElement.setAttribute("value",this.inputElement.value),this.isBlazorServer||(this.inputEleValue=this.getDateObject(this.inputElement.value)),this.renderComplete()},a.prototype.setTimeAllowEdit=function(){this.allowEdit?this.readonly||this.inputElement.removeAttribute("readonly"):t.attributes(this.inputElement,{readonly:""}),this.clearIconState()},a.prototype.clearIconState=function(){this.allowEdit||!this.inputWrapper||this.readonly?this.inputWrapper&&t.removeClass([this.inputWrapper.container],["e-non-edit"]):""===this.inputElement.value?t.removeClass([this.inputWrapper.container],["e-non-edit"]):t.addClass([this.inputWrapper.container],["e-non-edit"])},a.prototype.validateDisable=function(){this.setMinMax(this.initMin,this.initMax),this.popupCreation(),this.popupObj.destroy(),this.popupWrapper=this.popupObj=null,isNaN(+this.value)||null===this.value||this.valueIsDisable(this.value)||(this.strictMode&&this.resetState(),this.initValue=null,this.initMax=this.getDateObject(this.initMax),this.initMin=this.getDateObject(this.initMin),this.timeCollections=this.liCollections=[],this.setMinMax(this.initMin,this.initMax))},a.prototype.validationAttribute=function(e,i){var s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id");i.setAttribute("name",s),e.removeAttribute("name");for(var a=["required","aria-required","form"],n=0;n<a.length;n++)if(!t.isNullOrUndefined(e.getAttribute(a[n]))){var r=e.getAttribute(a[n]);i.setAttribute(a[n],r),e.removeAttribute(a[n])}},a.prototype.initialize=function(){this.globalize=new t.Internationalization(this.locale),this.defaultCulture=new t.Internationalization("en"),this.checkTimeFormat(),this.checkInvalidValue(this.value),this.setProperties({value:this.checkDateValue(new Date(this.checkInValue(this.value)))},!0),this.setProperties({min:this.checkDateValue(new Date(this.checkInValue(this.min)))},!0),this.setProperties({max:this.checkDateValue(new Date(this.checkInValue(this.max)))},!0),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkInValue(this.scrollTo)))},!0),null!==this.angularTag&&this.validationAttribute(this.element,this.inputElement),this.updateHtmlAttributeToElement(),this.checkAttributes(!1);var e={placeholder:this.placeholder};this.l10n=new t.L10n("timepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.initValue=this.checkDateValue(this.value),this.initMin=this.checkDateValue(this.min),this.initMax=this.checkDateValue(this.max),this.isNavigate=this.isPreventBlur=this.isTextSelected=!1,this.activeIndex=this.valueWithMinutes=this.prevDate=null,t.isNullOrUndefined(this.element.getAttribute("id"))?(this.element.id=t.getUniqueID("ej2_timepicker"),null!==this.angularTag&&t.attributes(this.inputElement,{id:this.element.id+"_input"})):null!==this.angularTag&&(this.inputElement.id=this.element.getAttribute("id")+"_input"),t.isNullOrUndefined(this.inputElement.getAttribute("name"))&&t.attributes(this.inputElement,{name:this.element.id}),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"})},a.prototype.checkTimeFormat=function(){if(this.format)if("string"==typeof this.format)this.formatString=this.format;else if(t.isNullOrUndefined(this.format.skeleton)||""===this.format.skeleton)this.formatString=this.globalize.getDatePattern({type:"time",skeleton:"short"});else{var e=this.format.skeleton;this.formatString=this.globalize.getDatePattern({type:"time",skeleton:e})}else this.formatString=null},a.prototype.checkDateValue=function(e){return!t.isNullOrUndefined(e)&&e instanceof Date&&!isNaN(+e)?e:null},a.prototype.createInputElement=function(){var e=this.cssClass,i=!this.enableMask;t.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),this.inputWrapper=s.Input.createInput({element:this.inputElement,bindClearAction:i,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton},buttons:[" e-input-group-icon e-time-icon e-icons"]},this.createElement),this.inputWrapper.container.style.width=this.setWidth(this.width),t.attributes(this.inputElement,{"aria-haspopup":"true","aria-autocomplete":"list",tabindex:"0","aria-activedescendant":"null","aria-owns":this.element.id+"_options","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-disabled":"false","aria-invalid":"false"}),this.isNullOrEmpty(this.inputStyle)||s.Input.addAttributes({style:this.inputStyle},this.inputElement),t.addClass([this.inputWrapper.container],"e-time-wrapper")},a.prototype.getCldrDateTimeFormat=function(){var e=new t.Internationalization(this.locale).getDatePattern({skeleton:t.isBlazor()?"d":"yMd"});return this.isNullOrEmpty(this.formatString)?e+" "+this.cldrFormat("time"):this.formatString},a.prototype.checkInvalidValue=function(e){var i=!1;if("object"!=typeof e&&!t.isNullOrUndefined(e)){var s=e;"string"==typeof s&&(s=s.trim());var a=null,n=null;if("number"==typeof e?s=e.toString():"string"==typeof e&&(/^[a-zA-Z0-9- ]*$/.test(e)||(a=this.setCurrentDate(this.getDateObject(e)),t.isNullOrUndefined(a)&&(a=this.checkDateValue(this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"})),t.isNullOrUndefined(a)&&(a=this.checkDateValue(this.globalize.parseDate(s,{format:this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"})))))),n=this.globalize.parseDate(s,{format:this.getCldrDateTimeFormat(),type:"datetime"}),a=!t.isNullOrUndefined(n)&&n instanceof Date&&!isNaN(+n)?n:null,t.isNullOrUndefined(a)&&s.replace(/\s/g,"").length){var r=null;r=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,!/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/.test(s)&&!r.test(s)||/^[a-zA-Z0-9- ]*$/.test(e)||isNaN(+new Date(""+s))?i=!0:a=new Date(""+s)}i?(this.strictMode||(this.invalidValueString=s),this.setProperties({value:null},!0),this.initValue=null):(this.setProperties({value:a},!0),this.initValue=this.value)}},a.prototype.requiredModules=function(){var e=[];return this.enableMask&&e.push({args:[this],member:"MaskedDateTime"}),e},a.prototype.cldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?t.isBlazor()?this.getBlazorCultureFormat("t"):t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale)},a.prototype.destroy=function(){if(this.isBlazorServer)this.unBindEvents();else{this.hide(),this.unBindEvents();var i={"aria-haspopup":"true","aria-autocomplete":"list",tabindex:"0","aria-activedescendant":"null","aria-owns":this.element.id+"_options","aria-expanded":"false",role:"combobox",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-disabled":"true","aria-invalid":"false"};this.inputElement&&(s.Input.removeAttributes(i,this.inputElement),null===this.angularTag&&this.inputWrapper.container.parentElement.appendChild(this.inputElement),t.isNullOrUndefined(this.cloneElement.getAttribute("tabindex"))?this.inputElement.removeAttribute("tabindex"):this.inputElement.setAttribute("tabindex",this.tabIndex),this.ensureInputAttribute(),this.enableElement([this.inputElement]),this.inputElement.classList.remove("e-input"),t.isNullOrUndefined(this.cloneElement.getAttribute("disabled"))&&s.Input.setEnabled(!0,this.inputElement,this.floatLabelType)),this.inputWrapper.container&&t.detach(this.inputWrapper.container),this.inputWrapper=this.popupWrapper=this.cloneElement=void 0,this.liCollections=this.timeCollections=this.disableItemCollection=[],t.isNullOrUndefined(this.rippleFn)||this.rippleFn(),e.prototype.destroy.call(this),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)}},a.prototype.ensureInputAttribute=function(){for(var e=[],i=0;i<this.inputElement.attributes.length;i++)e[i]=this.inputElement.attributes[i].name;for(i=0;i<e.length;i++)t.isNullOrUndefined(this.cloneElement.getAttribute(e[i]))?(this.inputElement.removeAttribute(e[i]),"value"===e[i].toLowerCase()&&(this.inputElement.value="")):(this.inputElement.setAttribute(e[i],this.cloneElement.getAttribute(e[i])),"value"===e[i].toLowerCase()&&(this.inputElement.value=this.cloneElement.getAttribute(e[i])))},a.prototype.popupCreation=function(){this.isBlazorServer?(this.popupWrapper=this.inputWrapper.container.nextElementSibling,this.generateList()):(this.popupWrapper=this.createElement("div",{className:X+" e-popup",attrs:{id:this.element.id+"_popup",style:"visibility:hidden"}}),t.isNullOrUndefined(this.cssClass)||(this.popupWrapper.className+=" "+this.cssClass),!t.isNullOrUndefined(this.step)&&this.step>0&&(this.generateList(),t.append([this.listWrapper],this.popupWrapper)),this.openPopupEventArgs.appendTo.appendChild(this.popupWrapper)),this.addSelection(),this.renderPopup(),t.detach(this.popupWrapper)},a.prototype.getPopupHeight=function(){var e=parseInt("240px",10),t=this.popupWrapper.getBoundingClientRect().height;return t>e?e:t},a.prototype.generateList=function(){this.isBlazorServer?this.listWrapper=this.popupWrapper.querySelector(".e-content"):this.createListItems(),this.wireListEvents();var e={duration:300,selector:".e-list-item"};if(this.rippleFn=t.rippleEffect(this.listWrapper,e),this.liCollections=this.listWrapper.querySelectorAll(".e-list-item"),this.isBlazorServer){this.blazorTimeCollections=[];for(var i=0;i<this.liCollections.length;i++)this.blazorTimeCollections.push(this.liCollections[i].getAttribute("data-value"))}},a.prototype.renderPopup=function(){var e=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),this.popupObj=new i.Popup(this.popupWrapper,{width:this.setPopupWidth(this.width),zIndex:this.zIndex,targetType:"relative",position:t.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},collision:t.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},enableRtl:this.enableRtl,relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,offsetY:4,open:function(){e.popupWrapper.style.visibility="visible",t.addClass([e.inputWrapper.buttons[0]],"e-active")},close:function(){t.removeClass([e.inputWrapper.buttons[0]],"e-active"),e.unWireListEvents(),e.inputElement.setAttribute("aria-activedescendant","null"),e.isBlazorServer||(t.remove(e.popupObj.element),e.popupObj.destroy(),e.popupWrapper.innerHTML=""),e.listWrapper=e.popupWrapper=e.listTag=void 0},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),t.Browser.isDevice||(this.popupObj.collision={X:"none",Y:"flip"}),this.popupObj.element.style.maxHeight="240px"},a.prototype.getFormattedValue=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{skeleton:t.isBlazor()?"t":"medium",type:"time"})},a.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var t=this.createDateObj(e),i=!this.isNullOrEmpty(this.initValue);if(this.checkDateValue(t)){var s=i?this.initValue.getDate():K,a=i?this.initValue.getMonth():_,n=i?this.initValue.getFullYear():G;return new Date(n,a,s,t.getHours(),t.getMinutes(),t.getSeconds())}}return null},a.prototype.updateHtmlAttributeToWrapper=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];if(J.indexOf(s)>-1)if("class"===s){var a=this.htmlAttributes[s].replace(/\s+/g," ").trim();""!==a&&t.addClass([this.inputWrapper.container],a.split(" "))}else if("style"===s){var n=this.inputWrapper.container.getAttribute(s);n=t.isNullOrUndefined(n)?this.htmlAttributes[s]:n+this.htmlAttributes[s],this.inputWrapper.container.setAttribute(s,n)}else this.inputWrapper.container.setAttribute(s,this.htmlAttributes[s])}},a.prototype.updateHtmlAttributeToElement=function(){if(!t.isNullOrUndefined(this.htmlAttributes))for(var e=0,i=Object.keys(this.htmlAttributes);e<i.length;e++){var s=i[e];J.indexOf(s)<0&&this.inputElement.setAttribute(s,this.htmlAttributes[s])}},a.prototype.updateCssClass=function(e,i){t.isNullOrUndefined(i)||(i=i.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),s.Input.setCssClass(e,[this.inputWrapper.container],i),this.popupWrapper&&s.Input.setCssClass(e,[this.popupWrapper],i)},a.prototype.removeErrorClass=function(){t.removeClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"false"})},a.prototype.checkErrorState=function(e){var i=this.getDateObject(e);this.validateState(i)&&!this.invalidValueString||this.enableMask&&this.inputElement.value===this.maskedDateValue?this.removeErrorClass():(t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":"true"}))},a.prototype.validateInterval=function(){!t.isNullOrUndefined(this.step)&&this.step>0?this.enableElement([this.inputWrapper.buttons[0]]):this.disableTimeIcon()},a.prototype.disableTimeIcon=function(){this.disableElement([this.inputWrapper.buttons[0]]),this.hide()},a.prototype.disableElement=function(e){t.addClass(e,"e-disabled")},a.prototype.enableElement=function(e){t.removeClass(e,"e-disabled")},a.prototype.selectInputText=function(){this.inputElement.setSelectionRange(0,this.inputElement.value.length)},a.prototype.setCursorToEnd=function(){this.inputElement.setSelectionRange(this.inputElement.value.length,this.inputElement.value.length)},a.prototype.getMeridianText=function(){var e;if("en"===this.locale||"en-US"===this.locale)e=t.getValue(t.isBlazor()?"dayPeriods.wide":"dayPeriods.format.wide",t.getDefaultDateObject());else{var i=t.isBlazor()?".dates.dayPeriods.abbreviated":".dates.calendars.gregorian.dayPeriods.format.abbreviated",s=t.isBlazor()?"":"main.";e=t.getValue(s+""+this.locale+i,t.cldrData)}return e},a.prototype.getCursorSelection=function(){var e=this.inputElement,t=0,i=0;return isNaN(e.selectionStart)||(t=e.selectionStart,i=e.selectionEnd),{start:Math.abs(t),end:Math.abs(i)}},a.prototype.getActiveElement=function(){return t.isNullOrUndefined(this.popupWrapper)?null:this.popupWrapper.querySelectorAll(".e-active")},a.prototype.isNullOrEmpty=function(e){return!!(t.isNullOrUndefined(e)||"string"==typeof e&&""===e.trim())},a.prototype.setWidth=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:t.formatUnit(e):"100%"},a.prototype.setPopupWidth=function(e){return(e=this.setWidth(e)).indexOf("%")>-1&&(e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"),e},a.prototype.setScrollPosition=function(){var e=this.selectedElement;t.isNullOrUndefined(e)?this.popupWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},a.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,s=i?i.offsetTop:e.offsetTop,a=e.getBoundingClientRect().height;s+e.offsetTop>t?this.popupWrapper.scrollTop=i?s-(t/2+a/2):s:this.popupWrapper.scrollTop=0},a.prototype.setScrollTo=function(){var e;if(t.isNullOrUndefined(this.popupWrapper))this.popupWrapper.scrollTop=0;else{var i=this.popupWrapper.querySelectorAll(".e-list-item");if(i.length){var s=this.isBlazorServer?new Date((new Date).toDateString()+" "+this.blazorTimeCollections[0]).setMilliseconds(0):this.timeCollections[0],a=this.isBlazorServer?new Date((new Date).toDateString()+" "+this.scrollTo.toLocaleTimeString()).setMilliseconds(0):this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=i[Math.round((a-s)/(6e4*this.step))]}}t.isNullOrUndefined(e)?this.popupWrapper.scrollTop=0:this.findScrollTop(e)},a.prototype.getText=function(){return t.isNullOrUndefined(this.checkDateValue(this.value))?"":this.getValue(this.value)},a.prototype.getValue=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},a.prototype.cldrDateFormat=function(){return"en"===this.locale||"en-US"===this.locale?t.isBlazor()?t.getValue("d",t.getValue(this.locale,t.blazorCultureFormats)):t.getValue("dateFormats.short",t.getDefaultDateObject()):this.getCultureDateObject(t.cldrData,""+this.locale)},a.prototype.getBlazorCultureFormat=function(e){return t.getValue(e,t.getValue(this.locale,t.blazorCultureFormats)).replace(/tt/,"a")},a.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.formatString)?"en"===this.locale||"en-US"===this.locale?t.isBlazor()?this.getBlazorCultureFormat("t"):t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale):this.formatString},a.prototype.dateToNumeric=function(){return"en"===this.locale||"en-US"===this.locale?t.isBlazor()?this.getBlazorCultureFormat("T"):t.getValue("timeFormats.medium",t.getDefaultDateObject()):t.isBlazor()?this.getBlazorCultureFormat("T"):t.getValue("main."+this.locale+".dates.calendars.gregorian.timeFormats.medium",t.cldrData)},a.prototype.getExactDateTime=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.dateToNumeric(),type:"time"})},a.prototype.setValue=function(e){var t=this.checkValue(e);this.strictMode||this.validateState(t)?this.isNullOrEmpty(t)?(this.initValue=null,this.validateMinMax(this.value,this.min,this.max)):this.initValue=this.compareFormatChange(t):(null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.validateMinMax(this.value,this.min,this.max)),this.updateInput(!0,this.initValue)},a.prototype.compareFormatChange=function(e){return t.isNullOrUndefined(e)?null:e!==this.getText()?this.getDateObject(e):this.getDateObject(this.value)},a.prototype.updatePlaceHolder=function(){s.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement)},a.prototype.updateInputValue=function(e){s.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton)},a.prototype.preventEventBubbling=function(e){e.preventDefault(),this.interopAdaptor.invokeMethodAsync("OnTimeIconClick")},a.prototype.updateBlazorTimeCollections=function(e){this.blazorTimeCollections=e},a.prototype.popupHandler=function(e){this.enabled&&(t.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),this.isBlazorServer||e.preventDefault(),this.isPopupOpen()&&!this.isBlazorServer?this.closePopup(0,e):(this.inputElement.focus(),this.show(e)))},a.prototype.mouseDownHandler=function(){this.enabled&&(this.readonly||(this.inputElement.setSelectionRange(0,0),t.EventHandler.add(this.inputElement,"mouseup",this.mouseUpHandler,this)))},a.prototype.mouseUpHandler=function(e){if(!this.readonly){if(e.preventDefault(),this.enableMask)return e.preventDefault(),void this.notify("setMaskSelection",{module:"MaskedDateTime"});t.EventHandler.remove(this.inputElement,"mouseup",this.mouseUpHandler);var i=this.getCursorSelection();0===i.start&&i.end===this.inputElement.value.length||(this.inputElement.value.length>0&&(this.cursorDetails=this.focusSelection()),this.inputElement.setSelectionRange(this.cursorDetails.start,this.cursorDetails.end))}},a.prototype.focusSelection=function(){var e=new RegExp("^[a-zA-Z0-9]+$"),t=this.inputElement.value.split("");t.push(" ");var i=this.getCursorSelection(),s=0,a=0,n=!1;if(this.isTextSelected)s=i.start,a=i.end,this.isTextSelected=!1;else for(var r=0;r<t.length;r++)if(e.test(t[r])||(a=r,n=!0),n){if(i.start>=s&&i.end<=a){a=a,this.isTextSelected=!0;break}s=r+1,n=!1}return{start:s,end:a}},a.prototype.inputHandler=function(e){if(!this.readonly&&this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&e.preventDefault(),e.action){case"home":case"end":case"up":case"down":!this.enableMask||this.readonly||this.isPopupOpen()||(e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})),this.enableMask&&!this.isPopupOpen()||this.keyHandler(e);break;case"enter":this.isNavigate?(this.selectedElement=this.liCollections[this.activeIndex],this.isBlazorServer?(this.inputElement.setAttribute("value",this.selectedElement.getAttribute("data-value")),this.interopAdaptor.invokeMethodAsync("OnListItemClick",this.activeIndex,!0)):(this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),this.updateValue(this.valueWithMinutes,e))):this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnStrictMode",this.inputElement.value):this.updateValue(this.inputElement.value,e),this.hide(),this.isNavigate=!1,this.isPopupOpen()&&e.stopPropagation();break;case"open":this.isBlazorServer?this.interopAdaptor.invokeMethodAsync("OnPopupHide",!0):this.show(e);break;case"escape":this.isBlazorServer||(this.updateInputValue(this.objToString(this.value)),this.enableMask&&(this.value||this.updateInputValue(this.maskedDateValue),this.createMask()),this.previousState(this.value)),this.hide();break;case"close":this.hide();break;case"right":case"left":case"tab":case"shiftTab":this.isPopupOpen()||!this.enableMask||this.readonly||((0==this.inputElement.selectionStart&&this.inputElement.selectionEnd==this.inputElement.value.length||this.inputElement.selectionEnd!==length&&"tab"==e.action||0!==this.inputElement.selectionStart&&"shiftTab"==e.action||"left"==e.action||"right"==e.action)&&e.preventDefault(),this.notify("keyDownHandler",{module:"MaskedDateTime",e:e}));break;default:this.isNavigate=!1}},a.prototype.onMouseClick=function(e){var i=e.target,s=this.selectedElement=t.closest(i,".e-list-item");this.setSelection(s,e),s&&s.classList.contains("e-list-item")&&this.hide()},a.prototype.closePopup=function(e,i){var s=this;if(this.isPopupOpen()&&this.popupWrapper){var a={popup:this.isBlazorServer?null:this.popupObj,event:i||null,cancel:!1,name:"open"};t.removeClass([document.body],"e-time-overflow"),this.trigger("close",a,function(i){if(!i.cancel){var a={name:"FadeOut",duration:50,delay:e||0};s.popupObj.hide(new t.Animation(a)),t.removeClass([s.inputWrapper.container],["e-icon-anim"]),t.attributes(s.inputElement,{"aria-expanded":"false"}),t.EventHandler.remove(document,"mousedown touchstart",s.documentClickHandler),s.isBlazorServer&&(s.disposeServerPopup(),s.inputWrapper.container.parentElement.insertBefore(s.popupWrapper,s.inputWrapper.container.nextElementSibling),s.interopAdaptor.invokeMethodAsync("OnPopupHide",!1),s.popupWrapper=s.popupObj=null)}t.Browser.isDevice&&s.modal&&(s.modal.style.display="none",s.modal.outerHTML="",s.modal=null),t.Browser.isDevice&&(t.isNullOrUndefined(s.mobileTimePopupWrap)||(s.mobileTimePopupWrap.remove(),s.mobileTimePopupWrap=null)),t.Browser.isDevice&&s.allowEdit&&!s.readonly&&s.inputElement.removeAttribute("readonly")})}else t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly")},a.prototype.disposeServerPopup=function(){this.popupWrapper&&(this.popupWrapper.style.visibility="hidden",this.popupWrapper.style.top="-9999px",this.popupWrapper.style.left="-9999px",this.popupWrapper.style.width="0px",this.popupWrapper.style.height="0px")},a.prototype.checkValueChange=function(e,i){if(this.strictMode||this.validateState(this.valueWithMinutes))if(i){var s=this.getDateObject(new Date(this.timeCollections[this.activeIndex]));+this.prevDate!=+s&&this.valueProcess(e,s)}else(this.prevValue!==this.inputElement.value||t.isNullOrUndefined(this.checkDateValue(this.value)))&&this.valueProcess(e,this.compareFormatChange(this.inputElement.value));else null===this.checkDateValue(this.valueWithMinutes)&&(this.initValue=this.valueWithMinutes=null),this.setProperties({value:this.compareFormatChange(this.inputElement.value)},!0),this.initValue=this.valueWithMinutes=this.compareFormatChange(this.inputElement.value),this.prevValue=this.inputElement.value,+this.prevDate!=+this.value&&this.changeEvent(e)},a.prototype.onMouseOver=function(e){var i=t.closest(e.target,".e-list-item");this.setHover(i,"e-hover")},a.prototype.setHover=function(e,i){this.enabled&&this.isValidLI(e)&&!e.classList.contains(i)&&(this.removeHover(i),t.addClass([e],i),"e-navigation"===i&&e.setAttribute("aria-selected","true"))},a.prototype.setSelection=function(e,i){this.isValidLI(e)&&!e.classList.contains("e-active")&&(this.isBlazorServer?(this.selectedElement=e,this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),t.addClass([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"),this.inputElement.setAttribute("value",e.getAttribute("data-value")),this.interopAdaptor.invokeMethodAsync("OnListItemClick",this.activeIndex,!1),this.addSelection()):(this.checkValue(e.getAttribute("data-value")),this.enableMask&&this.notify("setMaskSelection",{module:"MaskedDateTime"}),this.selectedElement=e,this.activeIndex=Array.prototype.slice.call(this.liCollections).indexOf(e),this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),t.addClass([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"),this.checkValueChange(i,!0)))},a.prototype.onMouseLeave=function(){this.removeHover("e-hover")},a.prototype.scrollHandler=function(){"timepicker"===this.getModuleName()&&t.Browser.isDevice||this.hide()},a.prototype.setMinMax=function(e,i){t.isNullOrUndefined(this.checkDateValue(e))&&(this.initMin=this.getDateObject("12:00:00 AM")),t.isNullOrUndefined(this.checkDateValue(i))&&(this.initMax=this.getDateObject("11:59:59 PM"))},a.prototype.validateMinMax=function(e,i,s){var a=e instanceof Date?e:this.getDateObject(e);return t.isNullOrUndefined(this.checkDateValue(a))?+this.createDateObj(this.getFormattedValue(this.initMin))>+this.createDateObj(this.getFormattedValue(this.initMax))&&this.disableTimeIcon():e=this.strictOperation(this.initMin,this.initMax,e,a),this.strictMode&&(e=this.valueIsDisable(e)?e:null),this.checkErrorState(e),e},a.prototype.valueIsDisable=function(e){if(this.disableItemCollection.length>0){if(this.disableItemCollection.length===this.timeCollections.length)return!1;for(var t=e instanceof Date?this.objToString(e):e,i=0;i<this.disableItemCollection.length;i++)if(t===this.disableItemCollection[i])return!1}return!0},a.prototype.validateState=function(e){if(!this.strictMode){if(!this.valueIsDisable(e))return!1;var i=this.setCurrentDate(this.getDateObject(e)),s=this.setCurrentDate(this.getDateObject(this.initMax)),a=this.setCurrentDate(this.getDateObject(this.initMin));if(t.isNullOrUndefined(this.checkDateValue(i))){if(+s<+a||""!==this.inputElement.value)return!1}else if(+i>+s||+i<+a)return!1}return!0},a.prototype.strictOperation=function(e,t,i,s){var a=this.createDateObj(this.getFormattedValue(t)),n=this.createDateObj(this.getFormattedValue(e)),r=this.createDateObj(this.getFormattedValue(s));if(this.strictMode){if(+n>+a)return this.disableTimeIcon(),this.initValue=this.getDateObject(a),this.updateInputValue(this.getValue(this.initValue)),this.enableMask&&this.createMask(),this.inputElement.value;if(+n>=+r)return this.getDateObject(n);if(+r>=+a||+n==+a)return this.getDateObject(a)}else if(+n>+a&&(this.disableTimeIcon(),!isNaN(+this.createDateObj(i))))return i;return i},a.prototype.bindEvents=function(){t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.isBlazorServer?this.preventEventBubbling:this.popupHandler,this),t.EventHandler.add(this.inputElement,"blur",this.inputBlurHandler,this),t.EventHandler.add(this.inputElement,"focus",this.inputFocusHandler,this),t.EventHandler.add(this.inputElement,"change",this.inputChangeHandler,this),t.EventHandler.add(this.inputElement,"input",this.inputEventHandler,this),this.enableMask&&t.EventHandler.add(this.inputElement,"keydown",this.keydownHandler,this),this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),t.Browser.isDevice||(this.keyConfigure=t.extend(this.keyConfigure,this.keyConfigs),this.inputEvent=new t.KeyboardEvents(this.inputWrapper.container,{keyAction:this.inputHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.showClearButton&&this.inputElement&&t.EventHandler.add(this.inputElement,"mousedown",this.mouseDownHandler,this))},a.prototype.keydownHandler=function(e){switch(e.code){case"Delete":!this.enableMask||this.popupObj||this.readonly||this.notify("keyDownHandler",{module:"MaskedDateTime",e:e})}},a.prototype.formResetHandler=function(){if(this.enabled&&!this.inputElement.disabled){var e=this.inputElement.getAttribute("value"),t=this.isBlazorServer?this.inputEleValue:this.checkDateValue(this.inputEleValue);"EJS-TIMEPICKER"===this.element.tagName&&(t=null,e="",this.inputElement.setAttribute("value","")),this.isBlazorServer||(this.setProperties({value:t},!0),this.prevDate=this.value,this.valueWithMinutes=this.value,this.initValue=this.value),this.inputElement&&(this.updateInputValue(e),this.enableMask&&(e||this.updateInputValue(this.maskedDateValue),this.createMask()),this.isBlazorServer||this.checkErrorState(e),this.prevValue=this.inputElement.value)}},a.prototype.inputChangeHandler=function(e){this.enabled&&e.stopPropagation()},a.prototype.inputEventHandler=function(){this.enableMask&&this.notify("inputHandler",{module:"MaskedDateTime"})},a.prototype.unBindEvents=function(){this.inputWrapper&&t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.isBlazorServer?this.preventEventBubbling:this.popupHandler),t.EventHandler.remove(this.inputElement,"blur",this.inputBlurHandler),t.EventHandler.remove(this.inputElement,"focus",this.inputFocusHandler),t.EventHandler.remove(this.inputElement,"change",this.inputChangeHandler),t.EventHandler.remove(this.inputElement,"input",this.inputEventHandler),this.inputEvent&&this.inputEvent.destroy(),t.EventHandler.remove(this.inputElement,"mousedown touchstart",this.mouseDownHandler),this.showClearButton&&!t.isNullOrUndefined(this.inputWrapper.clearButton)&&t.EventHandler.remove(this.inputWrapper.clearButton,"mousedown touchstart",this.clearHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},a.prototype.bindClearEvent=function(){this.showClearButton&&this.inputWrapper.clearButton&&t.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.clearHandler,this)},a.prototype.raiseClearedEvent=function(e){var t={event:e};this.trigger("cleared",t)},a.prototype.clearHandler=function(e){this.enabled&&(e.preventDefault(),t.isNullOrUndefined(this.value)?(this.resetState(),this.raiseClearedEvent(e)):this.clear(e),this.isBlazorServer&&this.interopAdaptor.invokeMethodAsync("OnValueCleared"),this.popupWrapper&&(this.popupWrapper.scrollTop=0),this.enableMask&&this.notify("clearHandler",{module:"MaskedDateTime"}))},a.prototype.clear=function(e){this.isBlazorServer||this.setProperties({value:null},!0),this.initValue=null,this.resetState(),this.raiseClearedEvent(e),this.isBlazorServer||this.changeEvent(e)},a.prototype.setZIndex=function(){this.popupObj&&(this.popupObj.zIndex=this.zIndex,this.popupObj.dataBind())},a.prototype.checkAttributes=function(e){for(var i,s=0,a=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["step","disabled","readonly","style","name","value","min","max","placeholder"];s<a.length;s++){var n=a[s];if(!t.isNullOrUndefined(this.inputElement.getAttribute(n)))switch(n){case"disabled":if(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.enabled||e){var r="disabled"!==this.inputElement.getAttribute(n)&&""!==this.inputElement.getAttribute(n)&&"true"!==this.inputElement.getAttribute(n);this.setProperties({enabled:r},!e)}break;case"style":this.inputStyle=this.inputElement.getAttribute(n);break;case"readonly":if(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.readonly||e){var l="readonly"===this.inputElement.getAttribute(n)||""===this.inputElement.getAttribute(n)||"true"===this.inputElement.getAttribute(n);this.setProperties({readonly:l},!e)}break;case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(n));break;case"step":this.step=parseInt(this.inputElement.getAttribute(n),10);break;case"placeholder":(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":this.isBlazorServer||(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.min||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||this.setProperties({min:i},!e));break;case"max":this.isBlazorServer||(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.max||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||this.setProperties({max:i},!e));break;case"value":this.isBlazorServer||(t.isNullOrUndefined(this.timeOptions)||void 0===this.timeOptions.value||e)&&(i=new Date(this.inputElement.getAttribute(n)),t.isNullOrUndefined(this.checkDateValue(i))||(this.initValue=i,this.updateInput(!1,this.initValue),this.setProperties({value:i},!e)))}}},a.prototype.setCurrentDate=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:new Date(G,_,K,e.getHours(),e.getMinutes(),e.getSeconds())},a.prototype.getTextFormat=function(){var e=0;if("a"===this.cldrTimeFormat().split(" ")[0]||0===this.cldrTimeFormat().indexOf("a"))e=1;else if(this.cldrTimeFormat().indexOf("a")<0)for(var t=this.cldrTimeFormat().split(" "),i=0;i<t.length;i++)if(t[i].toLowerCase().indexOf("h")>=0){e=i;break}return e},a.prototype.updateValue=function(e,t){var i;if(this.isNullOrEmpty(e))this.resetState();else if(i=this.checkValue(e),this.strictMode){var s=null===i&&e.trim().length>0?this.previousState(this.prevDate):this.inputElement.value;this.updateInputValue(s),this.enableMask&&(s||this.updateInputValue(this.maskedDateValue),this.createMask())}this.checkValueChange(t,"string"!=typeof e)},a.prototype.previousState=function(e){for(var t=this.getDateObject(e),i=0;i<this.timeCollections.length;i++)if(+t===this.timeCollections[i]){this.activeIndex=i,this.selectedElement=this.liCollections[i],this.valueWithMinutes=new Date(this.timeCollections[i]);break}return this.prevValue},a.prototype.resetState=function(){this.removeSelection(),s.Input.setValue("",this.inputElement,this.floatLabelType,!1),this.valueWithMinutes=this.activeIndex=null,this.strictMode||this.isBlazorServer||this.checkErrorState(null)},a.prototype.objToString=function(e){return t.isNullOrUndefined(this.checkDateValue(e))?null:this.globalize.formatDate(e,{format:this.cldrTimeFormat(),type:"time"})},a.prototype.checkValue=function(e){if(!this.isNullOrEmpty(e)){var t=e instanceof Date?e:this.getDateObject(e);return this.validateValue(t,e)}return this.resetState(),this.valueWithMinutes=null},a.prototype.validateValue=function(e,i){var s,a=this.validateMinMax(i,this.min,this.max),n=this.createDateObj(a);if(this.getFormattedValue(n)!==this.getFormattedValue(this.value)?(this.valueWithMinutes=t.isNullOrUndefined(n)?null:n,s=this.objToString(this.valueWithMinutes)):(this.strictMode&&(e=n),this.valueWithMinutes=this.checkDateValue(e),s=this.objToString(this.valueWithMinutes)),!this.strictMode&&t.isNullOrUndefined(s)){var r=a.trim().length>0?a:"";this.updateInputValue(r),this.enableMask&&(r||this.updateInputValue(this.maskedDateValue))}else this.updateInputValue(s),this.enableMask&&(""==s&&this.updateInputValue(this.maskedDateValue),this.createMask());return s},a.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},a.prototype.findNextElement=function(e){var i=this.inputElement.value,s=t.isNullOrUndefined(this.valueWithMinutes)||this.isBlazorServer?this.createDateObj(i):this.getDateObject(this.valueWithMinutes),a=null,n=this.liCollections.length,r=this.isBlazorServer?t.isNullOrUndefined(this.blazorTimeCollections)?[]:this.blazorTimeCollections:this.timeCollections;if(t.isNullOrUndefined(this.checkDateValue(s))&&t.isNullOrUndefined(this.activeIndex))this.selectNextItem(e);else{if("home"===e.action){o=this.validLiElement(0);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o}else if("end"===e.action){o=this.validLiElement(r.length-1,!0);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o}else if("down"===e.action)for(l=0;l<n;l++){if(this.isBlazorServer?+s<+this.createDateObj(this.blazorTimeCollections[l]):+s<this.timeCollections[l]){o=this.validLiElement(l);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o;break}if(l===n-1){o=this.validLiElement(0);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o;break}}else for(var l=n-1;l>=0;l--){if(this.isBlazorServer?+s>+this.createDateObj(this.blazorTimeCollections[l]):+s>this.timeCollections[l]){o=this.validLiElement(l,!0);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o;break}if(0===l){var o=this.validLiElement(n-1);this.isBlazorServer||(a=+this.createDateObj(new Date(this.timeCollections[o]))),this.activeIndex=o;break}}this.selectedElement=this.liCollections[this.activeIndex],this.isBlazorServer?(this.inputElement.setAttribute("value",this.selectedElement.getAttribute("data-value")),this.interopAdaptor.invokeMethodAsync("OnListItemClick",this.activeIndex,!0)):this.elementValue(t.isNullOrUndefined(a)?null:new Date(a))}},a.prototype.selectNextItem=function(e){var t=this.validLiElement(0,"down"!==e.action);this.activeIndex=t,this.selectedElement=this.liCollections[t],this.isBlazorServer?(this.inputElement.setAttribute("value",this.selectedElement.getAttribute("data-value")),this.interopAdaptor.invokeMethodAsync("OnListItemClick",t,!0)):this.elementValue(new Date(this.timeCollections[t]))},a.prototype.findNextInBlazor=function(e){var i=t.isNullOrUndefined(this.blazorTimeCollections)?0:this.blazorTimeCollections.length,s=0,a=this.createDateObj(this.inputElement.value);switch(e.action){case"home":this.activeIndex=s;break;case"end":s=i-1,this.activeIndex=s;break;case"down":for(l=0;l<i;l++){if(this.isBlazorServer?+a<+this.createDateObj(this.blazorTimeCollections[l]):+a<this.timeCollections[l]){var n=this.validLiElement(l);this.activeIndex=n;break}if(l===i-1){var r=this.validLiElement(0);this.activeIndex=r;break}}break;case"up":for(var l=i-1;l>=0;l--){if(this.isBlazorServer?+a>+this.createDateObj(this.blazorTimeCollections[l]):+a>this.timeCollections[l]){var o=this.validLiElement(l,!0);this.activeIndex=o;break}if(0===l){var h=this.validLiElement(i-1);this.activeIndex=h;break}}}this.interopAdaptor.invokeMethodAsync("OnListItemClick",this.activeIndex,!0)},a.prototype.elementValue=function(e){t.isNullOrUndefined(this.checkDateValue(e))||this.checkValue(e)},a.prototype.validLiElement=function(e,i){var s=null;if(this.isBlazorServer&&t.isNullOrUndefined(this.popupWrapper)){if((a=this.blazorTimeCollections).length)if(i)for(r=e;r>=0;r--){s=r;break}else for(r=e;r<=a.length-1;r++){s=r;break}}else{var a=t.isNullOrUndefined(this.popupWrapper)?this.liCollections:this.popupWrapper.querySelectorAll(".e-list-item"),n=!0;if(a.length)if(i)for(r=e;r>=0;r--){if(!a[r].classList.contains("e-disabled")){s=r;break}0===r&&n&&(e=r=a.length,n=!1)}else for(var r=e;r<=a.length-1;r++){if(!a[r].classList.contains("e-disabled")){s=r;break}r===a.length-1&&n&&(e=r=-1,n=!1)}}return s},a.prototype.keyHandler=function(e){if(!(t.isNullOrUndefined(this.step)||this.step<=0||this.inputWrapper.buttons[0].classList.contains("e-disabled"))){var i=this.isBlazorServer?t.isNullOrUndefined(this.blazorTimeCollections)?0:this.blazorTimeCollections.length:this.timeCollections.length;if(t.isNullOrUndefined(this.getActiveElement())||0===this.getActiveElement().length)if(t.isNullOrUndefined(this.popupObj)&&this.isBlazorServer)if(t.isNullOrUndefined(this.activeIndex)){a=this.validLiElement(0,"down"!==e.action);this.activeIndex=a,this.interopAdaptor.invokeMethodAsync("OnListItemClick",a,!0)}else this.findNextInBlazor(e);else this.liCollections.length>0&&(this.isBlazorServer?t.isNullOrUndefined(this.activeIndex):t.isNullOrUndefined(this.value)&&t.isNullOrUndefined(this.activeIndex))?this.selectNextItem(e):this.findNextElement(e);else{var s=void 0;if(e.keyCode>=37&&e.keyCode<=40){a=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex;this.activeIndex=a=this.activeIndex===i?0:this.activeIndex,this.activeIndex=a=this.activeIndex<0?i-1:this.activeIndex,this.activeIndex=a=this.validLiElement(this.activeIndex,40!==e.keyCode&&39!==e.keyCode),this.isBlazorServer||(s=t.isNullOrUndefined(this.timeCollections[a])?this.timeCollections[0]:this.timeCollections[a])}else if("home"===e.action){a=this.validLiElement(0);this.activeIndex=a,this.isBlazorServer||(s=this.timeCollections[a])}else if("end"===e.action){var a=this.validLiElement(i-1,!0);this.activeIndex=a,this.isBlazorServer||(s=this.timeCollections[a])}this.selectedElement=this.liCollections[this.activeIndex],this.isBlazorServer?(this.inputElement.setAttribute("value",this.selectedElement.getAttribute("data-value")),this.interopAdaptor.invokeMethodAsync("OnListItemClick",this.activeIndex,!0)):this.elementValue(new Date(s))}this.isNavigate=!0,this.setHover(this.selectedElement,"e-navigation"),this.setActiveDescendant(),this.isBlazorServer||this.selectInputText(),!this.isPopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setScrollPosition()}},a.prototype.getCultureTimeObject=function(e,i){return t.isBlazor()?t.getValue("t",t.getValue(i,t.blazorCultureFormats)).replace(/tt/,"a"):t.getValue("main."+i+".dates.calendars.gregorian.timeFormats.short",e)},a.prototype.getCultureDateObject=function(e,i){return t.isBlazor()?t.getValue("d",t.getValue(i,t.blazorCultureFormats)):t.getValue("main."+i+".dates.calendars.gregorian.dateFormats.short",e)},a.prototype.wireListEvents=function(){t.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},a.prototype.unWireListEvents=function(){this.listWrapper&&(t.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),t.Browser.isDevice||(t.EventHandler.remove(this.listWrapper,"mouseover",this.onMouseOver),t.EventHandler.remove(this.listWrapper,"mouseout",this.onMouseLeave)))},a.prototype.valueProcess=function(e,i){var s=t.isNullOrUndefined(this.checkDateValue(i))?null:i;+this.prevDate!=+s&&(this.initValue=s,this.changeEvent(e))},a.prototype.changeEvent=function(e){this.addSelection(),this.updateInput(!0,this.initValue);var i={event:e||null,value:this.value,text:this.inputElement.value,isInteracted:!t.isNullOrUndefined(e),element:this.element};i.value=this.valueWithMinutes||this.getDateObject(this.inputElement.value),this.prevDate=this.valueWithMinutes||this.getDateObject(this.inputElement.value),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i),this.invalidValueString=null,this.checkErrorState(this.value)},a.prototype.updateInput=function(e,i){e&&(this.prevValue=this.getValue(i)),this.prevDate=this.valueWithMinutes=i,"number"==typeof i&&(this.value&&+new Date(+this.value).setMilliseconds(0))===+i||(this.setProperties({value:i},!0),this.enableMask&&this.createMask()),!this.strictMode&&t.isNullOrUndefined(this.value)&&this.invalidValueString&&(this.checkErrorState(this.invalidValueString),this.updateInputValue(this.invalidValueString)),this.clearIconState()},a.prototype.setActiveDescendant=function(){t.isNullOrUndefined(this.selectedElement)?t.attributes(this.inputElement,{"aria-activedescendant":"null"}):t.attributes(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")})},a.prototype.removeSelection=function(){if(this.removeHover("e-hover"),!t.isNullOrUndefined(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll(".e-active");e.length&&(t.removeClass(e,"e-active"),e[0].removeAttribute("aria-selected"))}},a.prototype.removeHover=function(e){var i=this.getHoverItem(e);i&&i.length&&(t.removeClass(i,e),"e-navigation"===e&&i[0].removeAttribute("aria-selected"))},a.prototype.getHoverItem=function(e){var i;return t.isNullOrUndefined(this.popupWrapper)||(i=this.popupWrapper.querySelectorAll("."+e)),i},a.prototype.setActiveClass=function(){if(!t.isNullOrUndefined(this.popupWrapper)){var e=this.popupWrapper.querySelectorAll(".e-list-item");if(e.length)for(var i=0;i<e.length;i++)if(!this.isBlazorServer&&this.timeCollections[i]===+this.getDateObject(this.valueWithMinutes)||this.isBlazorServer&&this.blazorTimeCollections[i]===this.blazorTimeCollections[this.activeIndex]){e[i].setAttribute("aria-selected","true"),this.selectedElement=e[i],this.activeIndex=i;break}}},a.prototype.addSelection=function(){this.selectedElement=null,this.removeSelection(),this.setActiveClass(),t.isNullOrUndefined(this.selectedElement)||(t.addClass([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"))},a.prototype.isValidLI=function(e){return e&&e.classList.contains("e-list-item")&&!e.classList.contains("e-disabled")},a.prototype.createDateObj=function(e){var i=t.isBlazor()?"M"+t.getDefaultDateObject().dateSeperator+"d"+t.getDefaultDateObject().dateSeperator+"yy":null,s=this.globalize.formatDate(new Date,{format:i,skeleton:"short",type:"date"}),a=null;return"string"==typeof e?e.toUpperCase().indexOf("AM")>-1||e.toUpperCase().indexOf("PM")>-1?(s=this.defaultCulture.formatDate(new Date,{format:i,skeleton:"short",type:"date"}),a=isNaN(+new Date(s+" "+e))?null:new Date(new Date(s+" "+e).setMilliseconds(0)),t.isNullOrUndefined(a)&&(a=this.timeParse(s,e))):a=this.timeParse(s,e):e instanceof Date&&(a=e),a},a.prototype.timeParse=function(e,i){var s;return s=this.globalize.parseDate(e+" "+i,{format:this.cldrDateFormat()+" "+this.cldrTimeFormat(),type:"datetime"}),s=t.isNullOrUndefined(s)?this.globalize.parseDate(e+" "+i,{format:this.cldrDateFormat()+" "+this.dateToNumeric(),type:"datetime"}):s,s=t.isNullOrUndefined(s)?s:new Date(s.setMilliseconds(0))},a.prototype.createListItems=function(){var e=this;this.listWrapper=this.createElement("div",{className:"e-content",attrs:{tabindex:"0"}});var i,s=6e4*this.step,a=[];this.timeCollections=[],this.disableItemCollection=[],i=+this.getDateObject(this.initMin).setMilliseconds(0);for(var r=+this.getDateObject(this.initMax).setMilliseconds(0);r>=i;)this.timeCollections.push(i),a.push(this.globalize.formatDate(new Date(i),{format:this.cldrTimeFormat(),type:"time"})),i+=s;var l={itemCreated:function(t){var i={element:t.item,text:t.text,value:e.getDateObject(t.text),isDisabled:!1};e.trigger("itemRender",i,function(t){t.isDisabled&&t.element.classList.add("e-disabled"),t.element.classList.contains("e-disabled")&&e.disableItemCollection.push(t.element.getAttribute("data-value"))})}};this.listTag=n.ListBase.createList(this.createElement,a,l,!0),t.attributes(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),t.append([this.listTag],this.listWrapper)},a.prototype.documentClickHandler=function(e){var i=e.target;!t.isNullOrUndefined(this.popupObj)&&(this.inputWrapper.container.contains(i)||this.popupObj.element&&this.popupObj.element.contains(i))&&"touchstart"!==e.type&&e.preventDefault(),t.closest(i,'[id="'+this.popupObj.element.id+'"]')||i===this.inputElement||i===(this.inputWrapper&&this.inputWrapper.buttons[0])||i===(this.inputWrapper&&this.inputWrapper.clearButton)||i===(this.inputWrapper&&this.inputWrapper.container)?i!==this.inputElement&&(t.Browser.isDevice||(this.isPreventBlur=(t.Browser.isIE||"edge"===t.Browser.info.name)&&document.activeElement===this.inputElement&&i===this.popupWrapper)):this.isPopupOpen()&&(this.hide(),this.focusOut())},a.prototype.setEnableRtl=function(){s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},a.prototype.setEnable=function(){s.Input.setEnabled(this.enabled,this.inputElement,this.floatLabelType),this.enabled?(t.removeClass([this.inputWrapper.container],"e-disabled"),t.attributes(this.inputElement,{"aria-disabled":"false"}),this.inputElement.setAttribute("tabindex",this.tabIndex)):(this.hide(),t.addClass([this.inputWrapper.container],"e-disabled"),t.attributes(this.inputElement,{"aria-disabled":"true"}),this.inputElement.tabIndex=-1)},a.prototype.getProperty=function(e,t){"min"===t?(this.initMin=this.checkDateValue(new Date(this.checkInValue(e.min))),this.setProperties({min:this.initMin},!0)):(this.initMax=this.checkDateValue(new Date(this.checkInValue(e.max))),this.setProperties({max:this.initMax},!0)),""===this.inputElement.value?this.validateMinMax(this.value,this.min,this.max):this.checkValue(this.inputElement.value),this.checkValueChange(null,!1)},a.prototype.inputBlurHandler=function(e){if(this.enabled){if(this.isPreventBlur&&this.isPopupOpen())return void this.inputElement.focus();this.closePopup(0,e),this.enableMask&&this.maskedDateValue&&this.placeholder&&"Always"!==this.floatLabelType&&(this.inputElement.value!=this.maskedDateValue||this.value||"Auto"!=this.floatLabelType&&"Never"!=this.floatLabelType&&!this.placeholder||this.updateInputValue("")),t.removeClass([this.inputWrapper.container],[Z]);var i={model:this.isBlazorServer?null:this};this.trigger("blur",i),this.isBlazorServer||this.getText()===this.inputElement.value?0===this.inputElement.value.trim().length&&this.resetState():this.updateValue(this.inputElement.value,e),this.isBlazorServer&&this.interopAdaptor.invokeMethodAsync("OnStrictMode",this.inputElement.value),this.cursorDetails=null,this.isNavigate=!1,""===this.inputElement.value&&(this.invalidValueString=null)}},a.prototype.focusOut=function(){if(document.activeElement===this.inputElement){this.inputElement.blur(),t.removeClass([this.inputWrapper.container],[Z]);var e={model:this.isBlazorServer?null:this};this.trigger("blur",e)}},a.prototype.isPopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains(""+X))},a.prototype.inputFocusHandler=function(){if(this.enabled){var e={model:this.isBlazorServer?null:this};this.readonly||t.Browser.isDevice||this.enableMask||this.selectInputText(),this.enableMask&&!this.inputElement.value&&this.placeholder&&(!this.maskedDateValue||this.value||"Auto"!=this.floatLabelType&&"Never"!=this.floatLabelType&&!this.placeholder||(this.updateInputValue(this.maskedDateValue),this.inputElement.selectionStart=0,this.inputElement.selectionEnd=this.inputElement.value.length)),this.trigger("focus",e),this.clearIconState(),this.openOnFocus&&this.show()}},a.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},a.prototype.hide=function(){this.closePopup(100,null),this.clearIconState()},a.prototype.show=function(e){var i=this;if(!(this.enabled&&this.readonly||!this.enabled||this.popupWrapper)){this.popupCreation(),t.Browser.isDevice&&this.listWrapper&&(this.modal=this.createElement("div"),this.modal.className=X+" e-time-modal",document.body.className+=" e-time-overflow",document.body.appendChild(this.modal)),t.Browser.isDevice&&(this.mobileTimePopupWrap=this.createElement("div",{className:"e-timepicker-mob-popup-wrap"}),document.body.appendChild(this.mobileTimePopupWrap)),this.openPopupEventArgs={popup:this.isBlazorServer?null:this.popupObj||null,cancel:!1,event:e||null,name:"open",appendTo:t.Browser.isDevice?this.mobileTimePopupWrap:document.body};var s=this.openPopupEventArgs;this.trigger("open",s,function(e){if(t.isBlazor()&&i.isServerRendered&&(e.popup=i.popupObj||null),i.openPopupEventArgs=e,i.openPopupEventArgs.cancel||i.inputWrapper.buttons[0].classList.contains("e-disabled"))i.popupObj.destroy(),i.isBlazorServer&&(i.disposeServerPopup(),i.inputWrapper.container.parentElement.insertBefore(i.popupWrapper,i.inputWrapper.container.nextElementSibling),i.interopAdaptor.invokeMethodAsync("OnPopupHide",!1)),i.popupWrapper=i.listTag=void 0,i.liCollections=i.timeCollections=i.disableItemCollection=[],i.popupObj=null;else{i.isBlazorServer&&(i.popupWrapper.style.visibility="",i.popupWrapper.style.width=i.inputWrapper.container.offsetWidth+"px",i.popupWrapper.style.height="auto"),i.isBlazorServer&&(i.openPopupEventArgs.popup=i.popupObj),i.openPopupEventArgs.appendTo.appendChild(i.popupWrapper),i.popupAlignment(i.openPopupEventArgs),i.setScrollPosition(),t.Browser.isDevice||i.inputElement.focus();var s={name:"FadeIn",duration:50};i.popupObj.refreshPosition(i.anchor),1e3===i.zIndex?i.popupObj.show(new t.Animation(s),i.element):i.popupObj.show(new t.Animation(s),null),i.setActiveDescendant(),t.attributes(i.inputElement,{"aria-expanded":"true"}),t.addClass([i.inputWrapper.container],Z),t.EventHandler.add(document,"mousedown touchstart",i.documentClickHandler,i),i.setOverlayIndex(i.mobileTimePopupWrap,i.popupObj.element,i.modal,t.Browser.isDevice)}})}},a.prototype.setOverlayIndex=function(e,i,s,a){if(a&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(e)){var n=parseInt(i.style.zIndex,10)?parseInt(i.style.zIndex,10):1e3;s.style.zIndex=(n-1).toString(),e.style.zIndex=n.toString()}},a.prototype.formatValues=function(e){var i;return"number"==typeof e?i=t.formatUnit(e):"string"==typeof e&&(i=e.match(/px|%|em/)?e:isNaN(parseInt(e,10))?e:t.formatUnit(e)),i},a.prototype.popupAlignment=function(e){if(e.popup.position.X=this.formatValues(e.popup.position.X),e.popup.position.Y=this.formatValues(e.popup.position.Y),isNaN(parseFloat(e.popup.position.X))&&isNaN(parseFloat(e.popup.position.Y))||(this.popupObj.relateTo=this.anchor=document.body,this.popupObj.targetType="container"),isNaN(parseFloat(e.popup.position.X))||(this.popupObj.offsetX=parseFloat(e.popup.position.X)),isNaN(parseFloat(e.popup.position.Y))||(this.popupObj.offsetY=parseFloat(e.popup.position.Y)),t.Browser.isDevice)"center"===e.popup.position.X&&"center"===e.popup.position.Y&&(this.popupObj.relateTo=this.anchor=document.body,this.popupObj.offsetY=0,this.popupObj.targetType="container",this.popupObj.collision={X:"fit",Y:"fit"});else{switch(e.popup.position.X){case"left":break;case"right":e.popup.offsetX=this.containerStyle.width;break;case"center":e.popup.offsetX=-this.containerStyle.width/2}switch(e.popup.position.Y){case"top":case"bottom":break;case"center":e.popup.offsetY=-this.containerStyle.height/2}"center"===e.popup.position.X&&"center"===e.popup.position.Y&&(this.popupObj.relateTo=this.inputWrapper.container,this.anchor=this.inputElement,this.popupObj.targetType="relative")}},a.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},a.prototype.getModuleName=function(){return"timepicker"},a.prototype.onPropertyChanged=function(e,i){for(var a=0,n=Object.keys(e);a<n.length;a++){var r=n[a];switch(r){case"placeholder":s.Input.setPlaceholder(e.placeholder,this.inputElement),this.inputElement.setAttribute("aria-placeholder",e.placeholder);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement,this.floatLabelType),this.readonly&&this.hide(),this.setTimeAllowEdit();break;case"enabled":this.setProperties({enabled:e.enabled},!0),this.setEnable();break;case"allowEdit":this.setTimeAllowEdit();break;case"enableRtl":this.isBlazorServer||(this.setProperties({enableRtl:e.enableRtl},!0),this.setEnableRtl());break;case"cssClass":this.updateCssClass(e.cssClass,i.cssClass);break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex();break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"min":case"max":this.isBlazorServer||this.getProperty(e,r);break;case"showClearButton":s.Input.setClearButton(this.showClearButton,this.inputElement,this.inputWrapper),this.bindClearEvent();break;case"locale":this.setProperties({locale:e.locale},!0),this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.updatePlaceHolder(),this.isBlazorServer||(this.setValue(this.value),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}));break;case"width":t.setStyleAttribute(this.inputWrapper.container,{width:this.setWidth(e.width)}),this.containerStyle=this.inputWrapper.container.getBoundingClientRect();break;case"format":this.setProperties({format:e.format},!0),this.checkTimeFormat(),this.isBlazorServer||(this.setValue(this.value),this.enableMask&&(this.createMask(),this.value||this.updateInputValue(this.maskedDateValue)));break;case"value":this.isBlazorServer||(this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,this.invalidValueString?(this.updateInputValue(this.invalidValueString),this.checkErrorState(this.invalidValueString)):("string"==typeof e.value?(this.setProperties({value:this.checkDateValue(new Date(e.value))},!0),e.value=this.value):(e.value&&+new Date(+e.value).setMilliseconds(0))!==+this.value&&(e.value=this.checkDateValue(new Date(""+e.value))),this.initValue=e.value,e.value=this.compareFormatChange(this.checkValue(e.value))),this.checkValueChange(null,!1),this.isPopupOpen()&&this.setScrollPosition(),this.isAngular&&this.preventChange&&(this.preventChange=!1),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}));break;case"floatLabelType":this.floatLabelType=e.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder);break;case"strictMode":this.isBlazorServer||(this.invalidValueString=null,e.strictMode&&this.checkErrorState(null),this.setProperties({strictMode:e.strictMode},!0),this.checkValue(this.inputElement.value),this.checkValueChange(null,!1));break;case"scrollTo":this.isBlazorServer?this.popupWrapper&&this.setScrollTo():this.checkDateValue(new Date(this.checkInValue(e.scrollTo)))?(this.popupWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkInValue(e.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),this.updateInputValue(this.maskedDateValue)):this.inputElement.value===this.maskedDateValue&&this.updateInputValue("")}}},a.prototype.checkInValue=function(e){return e instanceof Date?e.toUTCString():""+e},q([t.Property(null)],a.prototype,"width",void 0),q([t.Property(null)],a.prototype,"cssClass",void 0),q([t.Property(!1)],a.prototype,"strictMode",void 0),q([t.Property(null)],a.prototype,"keyConfigs",void 0),q([t.Property(null)],a.prototype,"format",void 0),q([t.Property(!0)],a.prototype,"enabled",void 0),q([t.Property(!1)],a.prototype,"readonly",void 0),q([t.Property({})],a.prototype,"htmlAttributes",void 0),q([t.Property("Never")],a.prototype,"floatLabelType",void 0),q([t.Property(null)],a.prototype,"placeholder",void 0),q([t.Property(1e3)],a.prototype,"zIndex",void 0),q([t.Property(!1)],a.prototype,"enablePersistence",void 0),q([t.Property(!0)],a.prototype,"showClearButton",void 0),q([t.Property(30)],a.prototype,"step",void 0),q([t.Property(null)],a.prototype,"scrollTo",void 0),q([t.Property(null)],a.prototype,"value",void 0),q([t.Property(null)],a.prototype,"min",void 0),q([t.Property(null)],a.prototype,"max",void 0),q([t.Property(!0)],a.prototype,"allowEdit",void 0),q([t.Property(!1)],a.prototype,"openOnFocus",void 0),q([t.Property(!1)],a.prototype,"enableMask",void 0),q([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],a.prototype,"maskPlaceholder",void 0),q([t.Event()],a.prototype,"change",void 0),q([t.Event()],a.prototype,"created",void 0),q([t.Event()],a.prototype,"destroyed",void 0),q([t.Event()],a.prototype,"open",void 0),q([t.Event()],a.prototype,"itemRender",void 0),q([t.Event()],a.prototype,"close",void 0),q([t.Event()],a.prototype,"cleared",void 0),q([t.Event()],a.prototype,"blur",void 0),q([t.Event()],a.prototype,"focus",void 0),a=q([t.NotifyPropertyChanges],a)}(t.Component),ee=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),te=function(e,t,i,s){var a,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(r=(n<3?a(r):n>3?a(t,i,r):a(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},ie=(new Date).getDate(),se=(new Date).getMonth(),ae=(new Date).getFullYear(),ne=(new Date).getHours(),re=(new Date).getMinutes(),le=(new Date).getSeconds(),oe=(new Date).getMilliseconds(),he="e-datetimepicker",ue=function(a){function n(e,t){var i=a.call(this,e,t)||this;return i.valueWithMinutes=null,i.scrollInvoked=!1,i.moduleName=i.getModuleName(),i.dateTimeOptions=e,i}return ee(n,a),n.prototype.focusHandler=function(){this.enabled&&t.addClass([this.inputWrapper.container],"e-input-focus")},n.prototype.focusIn=function(){a.prototype.focusIn.call(this)},n.prototype.focusOut=function(){document.activeElement===this.inputElement&&(this.inputElement.blur(),t.removeClass([this.inputWrapper.container],["e-input-focus"]))},n.prototype.blurHandler=function(e){if(this.enabled){if(this.isTimePopupOpen()&&this.isPreventBlur)return void this.inputElement.focus();t.removeClass([this.inputWrapper.container],"e-input-focus");var i={model:t.isBlazor()&&this.isServerRendered?null:this};this.isTimePopupOpen()&&this.hide(e),this.trigger("blur",i)}},n.prototype.destroy=function(){this.popupObject&&this.popupObject.element.classList.contains("e-popup")&&(this.popupObject.destroy(),t.detach(this.dateTimeWrapper),this.dateTimeWrapper=void 0,this.liCollections=this.timeCollections=[],t.isNullOrUndefined(this.rippleFn)||this.rippleFn());var e={"aria-live":"assertive","aria-atomic":"true","aria-invalid":"false","aria-haspopup":"true","aria-activedescendant":"null",autocorrect:"off",autocapitalize:"off",spellcheck:"false","aria-owns":this.element.id+"_options","aria-expanded":"false",role:"combobox",autocomplete:"off"};this.inputElement&&(s.Input.removeAttributes(e,this.inputElement),this.inputElement.removeAttribute("aria-placeholder")),this.isCalendar()&&(this.popupWrapper&&t.detach(this.popupWrapper),this.popupObject=this.popupWrapper=null,this.keyboardHandler.destroy()),this.unBindInputEvents(),a.prototype.destroy.call(this)},n.prototype.render=function(){this.timekeyConfigure={enter:"enter",escape:"escape",end:"end",tab:"tab",home:"home",down:"downarrow",up:"uparrow",left:"leftarrow",right:"rightarrow",open:"alt+downarrow",close:"alt+uparrow"},this.valueWithMinutes=null,this.previousDateTime=null,this.isPreventBlur=!1,this.cloneElement=this.element.cloneNode(!0),this.dateTimeFormat=this.cldrDateTimeFormat(),this.initValue=this.value,a.prototype.updateHtmlAttributeToElement.call(this),this.checkAttributes(!1);var e={placeholder:this.placeholder};this.l10n=new t.L10n("datetimepicker",e,this.locale),this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),a.prototype.render.call(this),this.createInputElement(),a.prototype.updateHtmlAttributeToWrapper.call(this),this.bindInputEvents(),this.enableMask&&this.notify("createMask",{module:"MaskedDateTime"}),this.setValue(),!this.enableMask||this.value||!this.maskedDateValue||"Always"!=this.floatLabelType&&this.floatLabelType&&this.placeholder||s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(this.scrollTo)))},!0),this.previousDateTime=this.value&&new Date(+this.value),"EJS-DATETIMEPICKER"===this.element.tagName&&(this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.enabled||(this.inputElement.tabIndex=-1)),this.renderComplete()},n.prototype.setValue=function(){if(this.initValue=this.validateMinMaxRange(this.value),!this.strictMode&&this.isDateObject(this.initValue)){var e=this.validateMinMaxRange(this.initValue);s.Input.setValue(this.getFormattedValue(e),this.inputElement,this.floatLabelType,this.showClearButton),this.setProperties({value:e},!0)}else t.isNullOrUndefined(this.value)&&(this.initValue=null,this.setProperties({value:null},!0));this.valueWithMinutes=this.value,a.prototype.updateInput.call(this)},n.prototype.validateMinMaxRange=function(e){var t=e;return this.isDateObject(e)?t=this.validateValue(e):+this.min>+this.max&&this.disablePopupButton(!0),this.checkValidState(t),t},n.prototype.checkValidState=function(e){this.isValidState=!0,this.strictMode||(+e>+this.max||+e<+this.min)&&(this.isValidState=!1),this.checkErrorState()},n.prototype.checkErrorState=function(){this.isValidState?t.removeClass([this.inputWrapper.container],"e-error"):t.addClass([this.inputWrapper.container],"e-error"),t.attributes(this.inputElement,{"aria-invalid":this.isValidState?"false":"true"})},n.prototype.validateValue=function(e){var t=e;return this.strictMode?+this.min>+this.max?(this.disablePopupButton(!0),t=this.max):+e<+this.min?t=this.min:+e>+this.max&&(t=this.max):+this.min>+this.max&&(this.disablePopupButton(!0),t=e),t},n.prototype.disablePopupButton=function(e){e?(t.addClass([this.inputWrapper.buttons[0],this.timeIcon],"e-disabled"),this.hide()):t.removeClass([this.inputWrapper.buttons[0],this.timeIcon],"e-disabled")},n.prototype.getFormattedValue=function(e){var i;return t.isNullOrUndefined(e)?null:(i="Gregorian"===this.calendarMode?{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}:{format:this.cldrDateTimeFormat(),type:"dateTime",skeleton:"yMd",calendar:"islamic"},this.globalize.formatDate(e,i))},n.prototype.isDateObject=function(e){return!t.isNullOrUndefined(e)&&!isNaN(+e)},n.prototype.createInputElement=function(){t.removeClass([this.inputElement],"e-datepicker"),t.removeClass([this.inputWrapper.container],"e-date-wrapper"),t.addClass([this.inputWrapper.container],"e-datetime-wrapper"),t.addClass([this.inputElement],he),this.renderTimeIcon()},n.prototype.renderTimeIcon=function(){this.timeIcon=s.Input.appendSpan("e-input-group-icon e-time-icon e-icons",this.inputWrapper.container)},n.prototype.bindInputEvents=function(){t.EventHandler.add(this.timeIcon,"mousedown",this.timeHandler,this),t.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dateHandler,this),t.EventHandler.add(this.inputElement,"blur",this.blurHandler,this),t.EventHandler.add(this.inputElement,"focus",this.focusHandler,this),this.defaultKeyConfigs=t.extend(this.defaultKeyConfigs,this.keyConfigs),this.keyboardHandler=new t.KeyboardEvents(this.inputElement,{eventName:"keydown",keyAction:this.inputKeyAction.bind(this),keyConfigs:this.defaultKeyConfigs})},n.prototype.unBindInputEvents=function(){t.EventHandler.remove(this.timeIcon,"mousedown touchstart",this.timeHandler),t.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown touchstart",this.dateHandler),this.inputElement&&(t.EventHandler.remove(this.inputElement,"blur",this.blurHandler),t.EventHandler.remove(this.inputElement,"focus",this.focusHandler)),this.keyboardHandler&&this.keyboardHandler.destroy()},n.prototype.cldrTimeFormat=function(){return this.isNullOrEmpty(this.timeFormat)?"en"===this.locale||"en-US"===this.locale?t.isBlazor()?t.getValue("t",t.getValue(this.locale,t.blazorCultureFormats)).replace(/tt/,"a"):t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale):this.timeFormat},n.prototype.cldrDateTimeFormat=function(){var e=new t.Internationalization(this.locale).getDatePattern({skeleton:t.isBlazor()?"d":"yMd"});return this.isNullOrEmpty(this.formatString)?e+" "+this.getCldrFormat("time"):this.formatString},n.prototype.getCldrFormat=function(e){return"en"===this.locale||"en-US"===this.locale?t.isBlazor()?t.getValue("t",t.getValue(this.locale,t.blazorCultureFormats)).replace(/tt/,"a"):t.getValue("timeFormats.short",t.getDefaultDateObject()):this.getCultureTimeObject(t.cldrData,""+this.locale)},n.prototype.isNullOrEmpty=function(e){return!!(t.isNullOrUndefined(e)||"string"==typeof e&&""===e.trim())},n.prototype.getCultureTimeObject=function(e,i){return"Gregorian"===this.calendarMode?t.isBlazor()?t.getValue("t",t.getValue(this.locale,t.blazorCultureFormats)).replace(/tt/,"a"):t.getValue("main."+this.locale+".dates.calendars.gregorian.timeFormats.short",e):t.getValue("main."+this.locale+".dates.calendars.islamic.timeFormats.short",e)},n.prototype.timeHandler=function(e){this.enabled&&(this.isIconClicked=!0,t.Browser.isDevice&&this.inputElement.setAttribute("readonly",""),e.currentTarget===this.timeIcon&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isDatePopupOpen()&&a.prototype.hide.call(this,e),this.isTimePopupOpen()?this.closePopup(e):(this.inputElement.focus(),this.popupCreation("time",e),t.addClass([this.inputWrapper.container],["e-input-focus"]))),this.isIconClicked=!1)},n.prototype.dateHandler=function(e){this.enabled&&(e.currentTarget===this.inputWrapper.buttons[0]&&e.preventDefault(),this.enabled&&!this.readonly&&(this.isTimePopupOpen()&&this.closePopup(e),t.isNullOrUndefined(this.popupWrapper)||this.popupCreation("date",e)))},n.prototype.show=function(e,t){this.enabled&&this.readonly||!this.enabled||("time"!==e||this.dateTimeWrapper?this.popupObj||(this.isTimePopupOpen()&&this.hide(t),a.prototype.show.call(this),this.popupCreation("date",t)):(this.isDatePopupOpen()&&this.hide(t),this.popupCreation("time",t)))},n.prototype.toggle=function(e){this.isDatePopupOpen()?(a.prototype.hide.call(this,e),this.show("time",null)):this.isTimePopupOpen()?(this.hide(e),a.prototype.show.call(this,null,e),this.popupCreation("date",null)):this.show(null,e)},n.prototype.listCreation=function(){var i;i="Gregorian"===this.calendarMode?this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime"}):this.globalize.parseDate(this.inputElement.value,{format:this.cldrDateTimeFormat(),type:"datetime",calendar:"islamic"});var s=t.isNullOrUndefined(this.value)?""!==this.inputElement.value?i:new Date:this.value;this.valueWithMinutes=s,this.listWrapper=t.createElement("div",{className:"e-content",attrs:{tabindex:"0"}});var a=this.startTime(s),n=this.endTime(s),r=e.TimePickerBase.createListItems(this.createElement,a,n,this.globalize,this.cldrTimeFormat(),this.step);this.timeCollections=r.collection,this.listTag=r.list,t.attributes(this.listTag,{role:"listbox","aria-hidden":"false",id:this.element.id+"_options"}),t.append([r.list],this.listWrapper),this.wireTimeListEvents();var l={duration:300,selector:".e-list-item"};this.rippleFn=t.rippleEffect(this.listWrapper,l),this.liCollections=this.listWrapper.querySelectorAll(".e-list-item")},n.prototype.popupCreation=function(e,i){t.Browser.isDevice&&this.element.setAttribute("readonly","readonly"),"date"===e?!this.readonly&&this.popupWrapper&&(t.addClass([this.popupWrapper],"e-datetimepopup-wrapper"),t.attributes(this.popupWrapper,{id:this.element.id+"_datepopup"})):this.readonly||(this.dateTimeWrapper=t.createElement("div",{className:he+" e-popup",attrs:{id:this.element.id+"_timepopup",style:"visibility:hidden ; display:block"}}),t.isNullOrUndefined(this.cssClass)||(this.dateTimeWrapper.className+=" "+this.cssClass),!t.isNullOrUndefined(this.step)&&this.step>0&&(this.listCreation(),t.append([this.listWrapper],this.dateTimeWrapper)),document.body.appendChild(this.dateTimeWrapper),this.addTimeSelection(),this.renderPopup(),this.setTimeScrollPosition(),this.openPopup(i),this.popupObject.refreshPosition(this.inputElement))},n.prototype.openPopup=function(e){var i=this;this.preventArgs={cancel:!1,popup:t.isBlazor()&&this.isServerRendered?null:this.popupObject,event:e||null};var s=this.preventArgs;this.trigger("open",s,function(e){if(i.preventArgs=e,!i.preventArgs.cancel&&!i.readonly){var s={name:"FadeIn",duration:100};1e3===i.zIndex?i.popupObject.show(new t.Animation(s),i.element):i.popupObject.show(new t.Animation(s),null),t.addClass([i.inputWrapper.container],["e-icon-anim"]),t.attributes(i.inputElement,{"aria-expanded":"true"}),t.EventHandler.add(document,"mousedown touchstart",i.documentClickHandler,i)}})},n.prototype.documentClickHandler=function(e){var i=e.target;!t.isNullOrUndefined(this.popupObject)&&(this.inputWrapper.container.contains(i)||this.popupObject.element&&this.popupObject.element.contains(i))&&"touchstart"!==e.type&&e.preventDefault(),t.closest(i,'[id="'+(this.popupObject&&this.popupObject.element.id+'"]'))||i===this.inputElement||i===this.timeIcon||i===this.inputWrapper.container?i!==this.inputElement&&(t.Browser.isDevice||(this.isPreventBlur=document.activeElement===this.inputElement&&(t.Browser.isIE||"edge"===t.Browser.info.name)&&i===this.popupObject.element)):this.isTimePopupOpen()&&(this.hide(e),this.focusOut())},n.prototype.isTimePopupOpen=function(){return!(!this.dateTimeWrapper||!this.dateTimeWrapper.classList.contains(""+he))},n.prototype.isDatePopupOpen=function(){return!(!this.popupWrapper||!this.popupWrapper.classList.contains("e-datetimepopup-wrapper"))},n.prototype.renderPopup=function(){var e=this;this.containerStyle=this.inputWrapper.container.getBoundingClientRect(),t.Browser.isDevice&&(this.timeModal=t.createElement("div"),this.timeModal.className=he+" e-time-modal",document.body.className+=" e-time-overflow",this.timeModal.style.display="block",document.body.appendChild(this.timeModal));this.popupObject=new i.Popup(this.dateTimeWrapper,{width:this.setPopupWidth(),zIndex:this.zIndex,targetType:"container",collision:t.Browser.isDevice?{X:"fit",Y:"fit"}:{X:"flip",Y:"flip"},relateTo:t.Browser.isDevice?document.body:this.inputWrapper.container,position:t.Browser.isDevice?{X:"center",Y:"center"}:{X:"left",Y:"bottom"},enableRtl:this.enableRtl,offsetY:4,open:function(){e.dateTimeWrapper.style.visibility="visible",t.addClass([e.timeIcon],"e-active"),t.Browser.isDevice||(e.timekeyConfigure=t.extend(e.timekeyConfigure,e.keyConfigs),e.inputEvent=new t.KeyboardEvents(e.inputWrapper.container,{keyAction:e.timeKeyActionHandle.bind(e),keyConfigs:e.timekeyConfigure,eventName:"keydown"}))},close:function(){t.removeClass([e.timeIcon],"e-active"),e.unWireTimeListEvents(),e.inputElement.setAttribute("aria-activedescendant","null"),t.remove(e.popupObject.element),e.popupObject.destroy(),e.dateTimeWrapper.innerHTML="",e.listWrapper=e.dateTimeWrapper=void 0,e.inputEvent&&e.inputEvent.destroy()},targetExitViewport:function(){t.Browser.isDevice||e.hide()}}),this.popupObject.element.style.maxHeight="250px"},n.prototype.setDimension=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e:"100%"},n.prototype.setPopupWidth=function(){var e=this.setDimension(this.width);return e.indexOf("%")>-1&&(e=(this.containerStyle.width*parseFloat(e)/100).toString()+"px"),e},n.prototype.wireTimeListEvents=function(){t.EventHandler.add(this.listWrapper,"click",this.onMouseClick,this),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this))},n.prototype.unWireTimeListEvents=function(){this.listWrapper&&(t.EventHandler.remove(this.listWrapper,"click",this.onMouseClick),t.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler),t.Browser.isDevice||(t.EventHandler.add(this.listWrapper,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.listWrapper,"mouseout",this.onMouseLeave,this)))},n.prototype.onMouseOver=function(e){var i=t.closest(e.target,".e-list-item");this.setTimeHover(i,"e-hover")},n.prototype.onMouseLeave=function(){this.removeTimeHover("e-hover")},n.prototype.setTimeHover=function(e,i){this.enabled&&this.isValidLI(e)&&!e.classList.contains(i)&&(this.removeTimeHover(i),t.addClass([e],i))},n.prototype.getPopupHeight=function(){var e=parseInt("250px",10),t=this.dateTimeWrapper.getBoundingClientRect().height;return t>e?e:t},n.prototype.changeEvent=function(e){(this.value&&this.value.valueOf())!==(this.previousDateTime&&+this.previousDateTime.valueOf())&&(a.prototype.changeEvent.call(this,e),this.valueWithMinutes=this.value,this.setInputValue("date"),this.previousDateTime=this.value&&new Date(+this.value))},n.prototype.updateValue=function(e){this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs={value:this.value,event:e||null,isInteracted:!t.isNullOrUndefined(e),element:this.element},this.addTimeSelection(),this.trigger("change",this.changedArgs),this.previousDateTime=this.value)},n.prototype.setTimeScrollPosition=function(){var e=this.selectedElement;t.isNullOrUndefined(e)?this.dateTimeWrapper&&this.checkDateValue(this.scrollTo)&&this.setScrollTo():this.findScrollTop(e)},n.prototype.findScrollTop=function(e){var t=this.getPopupHeight(),i=e.nextElementSibling,s=i?i.offsetTop:e.offsetTop,a=e.getBoundingClientRect().height;s+e.offsetTop>t?this.dateTimeWrapper.scrollTop=i?s-(t/2+a/2):s:this.dateTimeWrapper.scrollTop=0},n.prototype.setScrollTo=function(){var e,i=this.dateTimeWrapper.querySelectorAll(".e-list-item");if(i.length>=0){this.scrollInvoked=!0;var s=this.timeCollections[0],a=this.getDateObject(this.checkDateValue(this.scrollTo)).getTime();e=i[Math.round((a-s)/(6e4*this.step))]}else this.dateTimeWrapper.scrollTop=0;t.isNullOrUndefined(e)?this.dateTimeWrapper.scrollTop=0:this.findScrollTop(e)},n.prototype.setInputValue=function(e){if("date"===e)this.inputElement.value=this.previousElementValue=this.getFormattedValue(this.getFullDateTime()),this.setProperties({value:this.getFullDateTime()},!0);else{var t=this.getFormattedValue(new Date(this.timeCollections[this.activeIndex]));s.Input.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton),this.previousElementValue=this.inputElement.value,this.setProperties({value:new Date(this.timeCollections[this.activeIndex])},!0),this.enableMask&&this.createMask()}this.updateIconState()},n.prototype.getFullDateTime=function(){var e=null;return e=this.isDateObject(this.valueWithMinutes)?this.combineDateTime(this.valueWithMinutes):this.previousDate,this.validateMinMaxRange(e)},n.prototype.createMask=function(){this.notify("createMask",{module:"MaskedDateTime"})},n.prototype.combineDateTime=function(e){if(this.isDateObject(e)){var t=this.previousDate.getDate(),i=this.previousDate.getMonth(),s=this.previousDate.getFullYear(),a=e.getHours(),n=e.getMinutes(),r=e.getSeconds();return new Date(s,i,t,a,n,r)}return this.previousDate},n.prototype.onMouseClick=function(e){var i=e.target,s=this.selectedElement=t.closest(i,".e-list-item");s&&s.classList.contains("e-list-item")&&(this.timeValue=s.getAttribute("data-value"),this.hide(e)),this.setSelection(s,e)},n.prototype.setSelection=function(e,i){if(this.isValidLI(e)&&!e.classList.contains("e-active")){this.selectedElement=e;var s=Array.prototype.slice.call(this.liCollections).indexOf(e);this.activeIndex=s,this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),t.addClass([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"),this.updateValue(i)}},n.prototype.setTimeActiveClass=function(){var e=t.isNullOrUndefined(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;if(!t.isNullOrUndefined(e)){var i=e.querySelectorAll(".e-list-item");if(i.length)for(var s=0;s<i.length;s++)if(this.timeCollections[s]===+this.valueWithMinutes){i[s].setAttribute("aria-selected","true"),this.selectedElement=i[s],this.activeIndex=s,this.setTimeActiveDescendant();break}}},n.prototype.setTimeActiveDescendant=function(){t.isNullOrUndefined(this.selectedElement)?t.attributes(this.inputElement,{"aria-activedescendant":"null"}):t.attributes(this.inputElement,{"aria-activedescendant":this.selectedElement.getAttribute("id")})},n.prototype.addTimeSelection=function(){this.selectedElement=null,this.removeTimeSelection(),this.setTimeActiveClass(),t.isNullOrUndefined(this.selectedElement)||(t.addClass([this.selectedElement],"e-active"),this.selectedElement.setAttribute("aria-selected","true"))},n.prototype.removeTimeSelection=function(){if(this.removeTimeHover("e-hover"),!t.isNullOrUndefined(this.dateTimeWrapper)){var e=this.dateTimeWrapper.querySelectorAll(".e-active");e.length&&(t.removeClass(e,"e-active"),e[0].removeAttribute("aria-selected"))}},n.prototype.removeTimeHover=function(e){var i=this.getTimeHoverItem(e);i&&i.length&&t.removeClass(i,e)},n.prototype.getTimeHoverItem=function(e){var i,s=t.isNullOrUndefined(this.dateTimeWrapper)?this.listWrapper:this.dateTimeWrapper;return t.isNullOrUndefined(s)||(i=s.querySelectorAll("."+e)),i},n.prototype.isValidLI=function(e){return e&&e.classList.contains("e-list-item")&&!e.classList.contains("e-disabled")},n.prototype.calculateStartEnd=function(e,t,i){var s=e.getDate(),a=e.getMonth(),n=e.getFullYear(),r=e.getHours(),l=e.getMinutes(),o=e.getSeconds(),h=e.getMilliseconds();return t?"starttime"===i?new Date(n,a,s,0,0,0):new Date(n,a,s,23,59,59):new Date(n,a,s,r,l,o,h)},n.prototype.startTime=function(e){var t,i,s=this.min,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getFullYear(),a.getMonth(),a.getDate())<=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.min):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a>=+this.max&&(i=!0,t=this.max),this.calculateStartEnd(t,i,"starttime")},n.prototype.endTime=function(e){var t,i,s=this.max,a=null===e?new Date:e;return+a.getDate()==+s.getDate()&&+a.getMonth()==+s.getMonth()&&+a.getFullYear()==+s.getFullYear()||+new Date(a.getUTCFullYear(),a.getMonth(),a.getDate())>=+new Date(s.getFullYear(),s.getMonth(),s.getDate())?(i=!1,t=this.max):+a<+this.max&&+a>+this.min?(i=!0,t=a):+a<=+this.min&&(i=!0,t=this.min),this.calculateStartEnd(t,i,"endtime")},n.prototype.hide=function(e){var i=this;if(this.popupObj||this.dateTimeWrapper){this.preventArgs={cancel:!1,popup:t.isBlazor()&&this.isServerRendered?null:this.popupObj||this.popupObject,event:e||null};var s=this.preventArgs;t.isNullOrUndefined(this.popupObj)?this.trigger("close",s,function(t){i.dateTimeCloseEventCallback(e,t)}):this.dateTimeCloseEventCallback(e,s)}else t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},n.prototype.dateTimeCloseEventCallback=function(e,i){this.preventArgs=i,this.preventArgs.cancel||(this.isDatePopupOpen()?a.prototype.hide.call(this,e):this.isTimePopupOpen()&&(this.closePopup(e),t.removeClass([document.body],"e-time-overflow"),t.Browser.isDevice&&this.timeModal&&(this.timeModal.style.display="none",this.timeModal.outerHTML="",this.timeModal=null),this.setTimeActiveDescendant())),t.Browser.isDevice&&this.allowEdit&&!this.readonly&&this.inputElement.removeAttribute("readonly"),this.setAllowEdit()},n.prototype.closePopup=function(e){if(this.isTimePopupOpen()&&this.popupObject){var i={name:"FadeOut",duration:100,delay:0};this.popupObject.hide(new t.Animation(i)),this.inputWrapper.container.classList.remove("e-icon-anim"),t.attributes(this.inputElement,{"aria-expanded":"false"}),t.EventHandler.remove(document,"mousedown touchstart",this.documentClickHandler)}},n.prototype.preRender=function(){this.checkFormat(),this.dateTimeFormat=this.cldrDateTimeFormat(),a.prototype.preRender.call(this),t.removeClass([this.inputElementCopy],[he])},n.prototype.getProperty=function(e,t){"min"===t?this.setProperties({min:this.validateValue(e.min)},!0):this.setProperties({max:this.validateValue(e.max)},!0)},n.prototype.checkAttributes=function(e){for(var i,s=0,a=e?t.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["style","name","step","disabled","readonly","value","min","max","placeholder","type"];s<a.length;s++){var n=a[s];if(!t.isNullOrUndefined(this.inputElement.getAttribute(n)))switch(n){case"name":this.inputElement.setAttribute("name",this.inputElement.getAttribute(n));break;case"step":this.step=parseInt(this.inputElement.getAttribute(n),10);break;case"readonly":if(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.readonly||e){var r="disabled"===this.inputElement.getAttribute(n)||""===this.inputElement.getAttribute(n)||"true"===this.inputElement.getAttribute(n);this.setProperties({readonly:r},!e)}break;case"placeholder":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.placeholder||e)&&this.setProperties({placeholder:this.inputElement.getAttribute(n)},!e);break;case"min":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.min||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({min:i},!e));break;case"disabled":if(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.enabled||e){var l="disabled"!==this.inputElement.getAttribute(n)&&"true"!==this.inputElement.getAttribute(n)&&""!==this.inputElement.getAttribute(n);this.setProperties({enabled:l},!e)}break;case"value":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.value||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({value:i},!e));break;case"max":(t.isNullOrUndefined(this.dateTimeOptions)||void 0===this.dateTimeOptions.max||e)&&(i=new Date(this.inputElement.getAttribute(n)),this.isNullOrEmpty(i)||isNaN(+i)||this.setProperties({max:i},!e))}}},n.prototype.requiredModules=function(){var e=[];return this&&e.push({args:[this],member:"islamic"}),this.enableMask&&e.push(this.maskedDateModule()),e},n.prototype.maskedDateModule=function(){return{args:[this],member:"MaskedDateTime"}},n.prototype.getTimeActiveElement=function(){return t.isNullOrUndefined(this.dateTimeWrapper)?null:this.dateTimeWrapper.querySelectorAll(".e-active")},n.prototype.createDateObj=function(e){return e instanceof Date?e:null},n.prototype.getDateObject=function(e){if(!this.isNullOrEmpty(e)){var i=this.createDateObj(e),s=this.valueWithMinutes,a=!t.isNullOrUndefined(s);if(this.checkDateValue(i)){var n=a?s.getDate():ie,r=a?s.getMonth():se,l=a?s.getFullYear():ae,o=a?s.getHours():ne,h=a?s.getMinutes():re,u=a?s.getSeconds():le,d=a?s.getMilliseconds():oe;return this.scrollInvoked?(this.scrollInvoked=!1,new Date(l,r,n,i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds())):new Date(l,r,n,o,h,u,d)}}return null},n.prototype.findNextTimeElement=function(e){var i=this.inputElement.value,s=t.isNullOrUndefined(this.valueWithMinutes)?this.createDateObj(i):this.getDateObject(this.valueWithMinutes),a=null,n=this.liCollections.length;if(!t.isNullOrUndefined(this.activeIndex)||!t.isNullOrUndefined(this.checkDateValue(s))){if("home"===e.action)a=+this.createDateObj(new Date(this.timeCollections[0])),this.activeIndex=0;else if("end"===e.action)a=+this.createDateObj(new Date(this.timeCollections[this.timeCollections.length-1])),this.activeIndex=this.timeCollections.length-1;else if("down"===e.action){for(r=0;r<n;r++)if(+s<this.timeCollections[r]){a=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}}else for(var r=n-1;r>=0;r--)if(+s>this.timeCollections[r]){a=+this.createDateObj(new Date(this.timeCollections[r])),this.activeIndex=r;break}this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(t.isNullOrUndefined(a)?null:new Date(a))}},n.prototype.setTimeValue=function(e,i){var a,n,r=this.validateMinMaxRange(i),l=this.createDateObj(r);return this.getFormattedValue(l)!==(t.isNullOrUndefined(this.value)?null:this.getFormattedValue(this.value))?(this.valueWithMinutes=t.isNullOrUndefined(l)?null:l,n=new Date(+this.valueWithMinutes)):(this.strictMode&&(e=l),this.valueWithMinutes=this.checkDateValue(e),n=new Date(+this.valueWithMinutes)),a="Gregorian"===this.calendarMode?this.globalize.formatDate(n,{format:t.isNullOrUndefined(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:t.isBlazor()?"d":"yMd"}):this.globalize.formatDate(n,{format:t.isNullOrUndefined(this.formatString)?this.cldrDateTimeFormat():this.formatString,type:"dateTime",skeleton:"yMd",calendar:"islamic"}),!this.strictMode&&t.isNullOrUndefined(n),s.Input.setValue(a,this.inputElement,this.floatLabelType,this.showClearButton),n},n.prototype.timeElementValue=function(e){if(!t.isNullOrUndefined(this.checkDateValue(e))&&!this.isNullOrEmpty(e)){var i=e instanceof Date?e:this.getDateObject(e);return this.setTimeValue(i,e)}return null},n.prototype.timeKeyHandler=function(e){if(!(t.isNullOrUndefined(this.step)||this.step<=0)){var i=this.timeCollections.length;if(t.isNullOrUndefined(this.getTimeActiveElement())||0===this.getTimeActiveElement().length)this.liCollections.length>0&&(t.isNullOrUndefined(this.value)&&t.isNullOrUndefined(this.activeIndex)?(this.activeIndex=0,this.selectedElement=this.liCollections[0],this.timeElementValue(new Date(this.timeCollections[0]))):this.findNextTimeElement(e));else{var s=void 0;if(e.keyCode>=37&&e.keyCode<=40){var a=40===e.keyCode||39===e.keyCode?++this.activeIndex:--this.activeIndex;this.activeIndex=a=this.activeIndex===i?0:this.activeIndex,this.activeIndex=a=this.activeIndex<0?i-1:this.activeIndex,s=t.isNullOrUndefined(this.timeCollections[a])?this.timeCollections[0]:this.timeCollections[a]}else"home"===e.action?(this.activeIndex=0,s=this.timeCollections[0]):"end"===e.action&&(this.activeIndex=i-1,s=this.timeCollections[i-1]);this.selectedElement=this.liCollections[this.activeIndex],this.timeElementValue(new Date(s))}this.isNavigate=!0,this.setTimeHover(this.selectedElement,"e-navigation"),this.setTimeActiveDescendant(),!this.isTimePopupOpen()||null===this.selectedElement||e&&"click"===e.type||this.setTimeScrollPosition()}},n.prototype.timeKeyActionHandle=function(e){if(this.enabled)switch("right"!==e.action&&"left"!==e.action&&"tab"!==e.action&&e.preventDefault(),e.action){case"up":case"down":case"home":case"end":this.timeKeyHandler(e);break;case"enter":this.isNavigate?(this.selectedElement=this.liCollections[this.activeIndex],this.valueWithMinutes=new Date(this.timeCollections[this.activeIndex]),this.setInputValue("time"),+this.previousDateTime!=+this.value&&(this.changedArgs.value=this.value,this.addTimeSelection(),this.previousDateTime=this.value)):this.updateValue(e),this.hide(e),t.addClass([this.inputWrapper.container],"e-input-focus"),this.isNavigate=!1,e.stopPropagation();break;case"escape":this.hide(e);break;default:this.isNavigate=!1}},n.prototype.inputKeyAction=function(e){switch(e.action){case"altDownArrow":this.strictModeUpdate(),this.updateInput(),this.toggle(e)}},n.prototype.onPropertyChanged=function(e,i){for(var n=0,r=Object.keys(e);n<r.length;n++){var l=r[n];switch(l){case"value":this.isDynamicValueChanged=!0,this.invalidValueString=null,this.checkInvalidValue(e.value),e.value=this.value,e.value=this.validateValue(e.value),s.Input.setValue(this.getFormattedValue(e.value),this.inputElement,this.floatLabelType,this.showClearButton),this.valueWithMinutes=e.value,this.setProperties({value:e.value},!0),this.popupObj&&this.popupUpdate(),this.previousDateTime=new Date(this.inputElement.value),this.updateInput(),this.changeTrigger(null),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange,this.enableMask&&this.value&&this.notify("createMask",{module:"MaskedDateTime"});break;case"min":case"max":this.getProperty(e,l),this.updateInput();break;case"enableRtl":s.Input.setEnableRtl(this.enableRtl,[this.inputWrapper.container]);break;case"cssClass":t.isNullOrUndefined(i.cssClass)||(i.cssClass=i.cssClass.replace(/\s+/g," ").trim()),t.isNullOrUndefined(e.cssClass)||(e.cssClass=e.cssClass.replace(/\s+/g," ").trim()),s.Input.setCssClass(e.cssClass,[this.inputWrapper.container],i.cssClass),this.dateTimeWrapper&&s.Input.setCssClass(e.cssClass,[this.dateTimeWrapper],i.cssClass);break;case"locale":this.globalize=new t.Internationalization(this.locale),this.l10n.setLocale(this.locale),this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0),s.Input.setPlaceholder(this.l10n.getConstant("placeholder"),this.inputElement),this.dateTimeFormat=this.cldrDateTimeFormat(),a.prototype.updateInput.call(this);break;case"htmlAttributes":this.updateHtmlAttributeToElement(),this.updateHtmlAttributeToWrapper(),this.checkAttributes(!0);break;case"format":this.setProperties({format:e.format},!0),this.checkFormat(),this.dateTimeFormat=this.formatString,this.setValue(),this.enableMask&&(this.notify("createMask",{module:"MaskedDateTime"}),this.value||s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;case"placeholder":s.Input.setPlaceholder(e.placeholder,this.inputElement),this.inputElement.setAttribute("aria-placeholder",e.placeholder);break;case"enabled":s.Input.setEnabled(this.enabled,this.inputElement),this.enabled||(this.inputElement.tabIndex=-1);break;case"strictMode":this.invalidValueString=null,this.updateInput();break;case"width":this.setWidth(e.width);break;case"readonly":s.Input.setReadonly(this.readonly,this.inputElement);break;case"floatLabelType":this.floatLabelType=e.floatLabelType,s.Input.removeFloating(this.inputWrapper),s.Input.addFloating(this.inputElement,this.floatLabelType,this.placeholder);break;case"scrollTo":this.checkDateValue(new Date(this.checkValue(e.scrollTo)))?(this.dateTimeWrapper&&this.setScrollTo(),this.setProperties({scrollTo:this.checkDateValue(new Date(this.checkValue(e.scrollTo)))},!0)):this.setProperties({scrollTo:null},!0);break;case"enableMask":this.enableMask?(this.notify("createMask",{module:"MaskedDateTime"}),s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton)):this.inputElement.value===this.maskedDateValue&&(this.maskedDateValue="",s.Input.setValue(this.maskedDateValue,this.inputElement,this.floatLabelType,this.showClearButton));break;default:a.prototype.onPropertyChanged.call(this,e,i)}this.isDynamicValueChanged||this.hide(null),this.isDynamicValueChanged=!1}},n.prototype.getModuleName=function(){return"datetimepicker"},n.prototype.restoreValue=function(){this.previousDateTime=this.previousDate,this.currentDate=this.value?this.value:new Date,this.valueWithMinutes=this.value,this.previousDate=this.value,this.previousElementValue=this.previousElementValue=t.isNullOrUndefined(this.inputValueCopy)?"":this.getFormattedValue(this.inputValueCopy)},te([t.Property(null)],n.prototype,"timeFormat",void 0),te([t.Property(30)],n.prototype,"step",void 0),te([t.Property(null)],n.prototype,"scrollTo",void 0),te([t.Property(1e3)],n.prototype,"zIndex",void 0),te([t.Property(null)],n.prototype,"value",void 0),te([t.Property(null)],n.prototype,"keyConfigs",void 0),te([t.Property({})],n.prototype,"htmlAttributes",void 0),te([t.Property(!1)],n.prototype,"enablePersistence",void 0),te([t.Property(!0)],n.prototype,"allowEdit",void 0),te([t.Property(!1)],n.prototype,"isMultiSelection",void 0),te([t.Property(null)],n.prototype,"values",void 0),te([t.Property(!0)],n.prototype,"showClearButton",void 0),te([t.Property(null)],n.prototype,"placeholder",void 0),te([t.Property(!1)],n.prototype,"strictMode",void 0),te([t.Property(null)],n.prototype,"serverTimezoneOffset",void 0),te([t.Property(new Date(1900,0,1))],n.prototype,"min",void 0),te([t.Property(new Date(2099,11,31))],n.prototype,"max",void 0),te([t.Property(null)],n.prototype,"firstDayOfWeek",void 0),te([t.Property("Gregorian")],n.prototype,"calendarMode",void 0),te([t.Property("Month")],n.prototype,"start",void 0),te([t.Property("Month")],n.prototype,"depth",void 0),te([t.Property(!1)],n.prototype,"weekNumber",void 0),te([t.Property(!0)],n.prototype,"showTodayButton",void 0),te([t.Property("Short")],n.prototype,"dayHeaderFormat",void 0),te([t.Property(!1)],n.prototype,"openOnFocus",void 0),te([t.Property(!1)],n.prototype,"enableMask",void 0),te([t.Property({day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"})],n.prototype,"maskPlaceholder",void 0),te([t.Event()],n.prototype,"open",void 0),te([t.Event()],n.prototype,"close",void 0),te([t.Event()],n.prototype,"cleared",void 0),te([t.Event()],n.prototype,"blur",void 0),te([t.Event()],n.prototype,"focus",void 0),te([t.Event()],n.prototype,"created",void 0),te([t.Event()],n.prototype,"destroyed",void 0),n=te([t.NotifyPropertyChanges],n)}(C),de=function(){function e(e){this.mask="",this.defaultConstant={day:"day",month:"month",year:"year",hour:"hour",minute:"minute",second:"second",dayOfTheWeek:"day of the week"},this.hiddenMask="",this.validCharacters="dMyhmHfasz",this.isDayPart=!1,this.isMonthPart=!1,this.isYearPart=!1,this.isHourPart=!1,this.isMinutePart=!1,this.isSecondsPart=!1,this.isMilliSecondsPart=!1,this.monthCharacter="",this.periodCharacter="",this.isHiddenMask=!1,this.isComplete=!1,this.isNavigate=!1,this.formatRegex=/EEEEE|EEEE|EEE|EE|E|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|HH|H|hh|h|mm|m|fff|ff|f|aa|a|ss|s|zzzz|zzz|zz|z|'[^']*'|'[^']*'/g,this.isDeletion=!1,this.isShortYear=!1,this.isDeleteKey=!1,this.parent=e,this.dateformat=this.getCulturedFormat(),this.value=null!=this.parent.value?this.parent.value:new Date,this.value.setMonth(0),this.value.setHours(0),this.value.setMinutes(0),this.value.setSeconds(0),this.previousDate=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.value.getHours(),this.value.getMinutes(),this.value.getSeconds()),this.removeEventListener(),this.addEventListener()}return e.prototype.getModuleName=function(){return"MaskedDateTime"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("createMask",this.createMask,this),this.parent.on("setMaskSelection",this.validCharacterCheck,this),this.parent.on("inputHandler",this.maskInputHandler,this),this.parent.on("keyDownHandler",this.maskKeydownHandler,this),this.parent.on("clearHandler",this.clearHandler,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("createMask",this.createMask),this.parent.off("setMaskSelection",this.validCharacterCheck),this.parent.off("inputHandler",this.maskInputHandler),this.parent.off("keyDownHandler",this.maskKeydownHandler),this.parent.off("clearHandler",this.clearHandler))},e.prototype.createMask=function(e){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.dateformat=this.getCulturedFormat(),this.parent.maskPlaceholder.day&&(this.defaultConstant.day=this.parent.maskPlaceholder.day),this.parent.maskPlaceholder.month&&(this.defaultConstant.month=this.parent.maskPlaceholder.month),this.parent.maskPlaceholder.year&&(this.defaultConstant.year=this.parent.maskPlaceholder.year),this.parent.maskPlaceholder.hour&&(this.defaultConstant.hour=this.parent.maskPlaceholder.hour),this.parent.maskPlaceholder.minute&&(this.defaultConstant.minute=this.parent.maskPlaceholder.minute),this.parent.maskPlaceholder.second&&(this.defaultConstant.second=this.parent.maskPlaceholder.second),this.parent.maskPlaceholder.dayOfTheWeek&&(this.defaultConstant.dayOfTheWeek=this.parent.maskPlaceholder.dayOfTheWeek.toString()),this.getCUltureMaskFormat();var t=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.mask=this.previousValue=t,this.parent.maskedDateValue=this.mask,this.parent.value&&this.setDynamicValue()},e.prototype.getCUltureMaskFormat=function(){this.l10n=new t.L10n(this.parent.moduleName,this.defaultConstant,this.parent.locale),this.objectString=Object.keys(this.defaultConstant);for(var e=0;e<this.objectString.length;e++)this.defaultConstant[this.objectString[e].toString()]=this.l10n.getConstant(this.objectString[e].toString())},e.prototype.validCharacterCheck=function(){for(var e=this.parent.inputElement.selectionStart,t=e,i=e-1;t<this.hiddenMask.length||i>=0;t++,i--){if(t<this.hiddenMask.length&&-1!==this.validCharacters.indexOf(this.hiddenMask[t]))return void this.setSelection(this.hiddenMask[t]);if(i>=0&&-1!==this.validCharacters.indexOf(this.hiddenMask[i]))return void this.setSelection(this.hiddenMask[i])}},e.prototype.setDynamicValue=function(){this.value=this.parent.value,this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!0,this.updateValue()},e.prototype.setSelection=function(e){for(var t=-1,i=0,s=0;s<this.hiddenMask.length;s++)this.hiddenMask[s]===e&&(i=s+1,-1===t&&(t=s));t<0&&(t=0),this.parent.inputElement.setSelectionRange(t,i)},e.prototype.maskKeydownHandler=function(e){if("Delete"===e.e.key)return void(this.isDeleteKey=!0);if(!(e.e.altKey||e.e.ctrlKey||"ArrowLeft"!==e.e.key&&"ArrowRight"!==e.e.key&&"shiftTab"!==e.e.key&&"Tab"!==e.e.key&&"shiftTab"!==e.e.action&&"End"!==e.e.key&&"Home"!==e.e.key)){var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,s=this.parent.inputElement.value.length;if(0==t&&i==s&&("Tab"===e.e.key||"shiftTab"===e.e.action)){var a="shiftTab"===e.e.action?i:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=a}if("End"===e.e.key||"Home"===e.e.key){var n="End"===e.e.key?s:0;this.parent.inputElement.selectionStart=this.parent.inputElement.selectionEnd=n}this.navigateSelection("ArrowLeft"===e.e.key||"shiftTab"===e.e.action||"End"===e.e.key)}if(!(e.e.altKey||e.e.ctrlKey||"ArrowUp"!==e.e.key&&"ArrowDown"!==e.e.key)){t=this.parent.inputElement.selectionStart;this.dateAlteration("ArrowDown"===e.e.key);var r=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=r,this.parent.inputElement.value=r,this.parent.inputElement.selectionStart=t,this.validCharacterCheck()}},e.prototype.differenceCheck=function(){var e=this.parent.inputElement.selectionStart,t=this.parent.inputElement.value,i=this.previousValue.substring(0,e+this.previousValue.length-t.length),s=t.substring(0,e),a=this.value,n=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();if(0===i.indexOf(s)&&(0===s.length||this.previousHiddenMask[s.length-1]!==this.previousHiddenMask[s.length])){for(u=s.length;u<i.length;u++)""!==this.previousHiddenMask[u]&&this.validCharacters.indexOf(this.previousHiddenMask[u])>=0&&(this.isDeletion=this.handleDeletion(this.previousHiddenMask[u],!1));if(this.isDeletion)return}switch(this.previousHiddenMask[e-1]){case"d":var r=(this.isDayPart&&a.getDate().toString().length<2?10*a.getDate():0)+parseInt(s[e-1],10);if(isNaN(r))return;for(u=0;r>n;u++)r=parseInt(r.toString().slice(1),10);if(r>=1){if(a.setDate(r),this.isNavigate=2===r.toString().length,this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),a.getMonth()!==this.value.getMonth())return;this.isDayPart=!0}else this.isDayPart=!1;break;case"M":var l=void 0;if(l=a.getMonth().toString().length<2?(this.isMonthPart?10*(a.getMonth()+1):0)+parseInt(s[e-1],10):parseInt(s[e-1],10),isNaN(l)){var o=this.getCulturedValue("months[stand-alone].wide"),h=Object.keys(o);for(this.monthCharacter+=s[e-1].toLowerCase();this.monthCharacter.length>0;){for(var u=1,d=0,p=h;d<p.length;d++){p[d];if(0===o[u].toLowerCase().indexOf(this.monthCharacter))return a.setMonth(u-1),this.isMonthPart=!0,void(this.value=a);u++}this.monthCharacter=this.monthCharacter.substring(1,this.monthCharacter.length)}}else{for(;l>12;)l=parseInt(l.toString().slice(1),10);if(l>=1){if(a.setMonth(l-1),this.isNavigate=2===l.toString().length,a.getMonth()!==l-1&&(a.setDate(1),a.setMonth(l-1)),this.isDayPart){var c=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),m=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();this.previousDate.getDate()==c&&m<=c&&a.setDate(m)}this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),this.isMonthPart=!0}else a.setMonth(0),this.isMonthPart=!1}break;case"y":var v=(this.isYearPart&&a.getFullYear().toString().length<4&&!this.isShortYear?10*a.getFullYear():0)+parseInt(s[e-1],10);if(this.isShortYear=!1,isNaN(v))return;for(;v>9999;)v=parseInt(v.toString().slice(1),10);v<1?this.isYearPart=!1:(a.setFullYear(v),4===v.toString().length&&(this.isNavigate=!0),this.previousDate=new Date(a.getFullYear(),a.getMonth(),a.getDate()),this.isYearPart=!0);break;case"h":if(this.hour=(this.isHourPart&&(a.getHours()%12||12).toString().length<2?10*(a.getHours()%12||12):0)+parseInt(s[e-1],10),isNaN(this.hour))return;for(;this.hour>12;)this.hour=parseInt(this.hour.toString().slice(1),10);a.setHours(12*Math.floor(a.getHours()/12)+this.hour%12),this.isNavigate=2===this.hour.toString().length,this.isHourPart=!0;break;case"H":if(this.hour=(this.isHourPart&&a.getHours().toString().length<2?10*a.getHours():0)+parseInt(s[e-1],10),isNaN(this.hour))return;for(u=0;this.hour>23;u++)this.hour=parseInt(this.hour.toString().slice(1),10);a.setHours(this.hour),this.isNavigate=2===this.hour.toString().length,this.isHourPart=!0;break;case"m":var f=(this.isMinutePart&&a.getMinutes().toString().length<2?10*a.getMinutes():0)+parseInt(s[e-1],10);if(isNaN(f))return;for(u=0;f>59;u++)f=parseInt(f.toString().slice(1),10);a.setMinutes(f),this.isNavigate=2===f.toString().length,this.isMinutePart=!0;break;case"s":var y=(this.isSecondsPart&&a.getSeconds().toString().length<2?10*a.getSeconds():0)+parseInt(s[e-1],10);if(isNaN(y))return;for(u=0;y>59;u++)y=parseInt(y.toString().slice(1),10);a.setSeconds(y),this.isNavigate=2===y.toString().length,this.isSecondsPart=!0;break;case"a":this.periodCharacter+=s[e-1].toLowerCase();for(var g=this.getCulturedValue("dayPeriods.format.wide"),b=Object.keys(g),u=0;this.periodCharacter.length>0;u++)(0===g[b[0]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()>=12||0===g[b[1]].toLowerCase().indexOf(this.periodCharacter)&&a.getHours()<12)&&(a.setHours((a.getHours()+12)%24),this.value=a),this.periodCharacter=this.periodCharacter.substring(1,this.periodCharacter.length)}this.value=a},e.prototype.formatCheck=function(){function e(e){var i,s,a,n=t.getCulturedValue("days[stand-alone].abbreviated"),r=Object.keys(n),l=t.getCulturedValue("days[stand-alone].wide"),o=Object.keys(l),h=t.getCulturedValue("days[stand-alone].narrow"),u=Object.keys(h),d=t.getCulturedValue("months[stand-alone].abbreviated"),p=t.getCulturedValue("months[stand-alone].wide"),c=t.getCulturedValue("dayPeriods.format.wide"),m=Object.keys(c);switch(e){case"ddd":case"dddd":case"d":i=t.isDayPart?t.value.getDate().toString():t.defaultConstant.day.toString();break;case"dd":i=t.isDayPart?t.roundOff(t.value.getDate(),2):t.defaultConstant.day.toString();break;case"E":case"EE":case"EEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?n[r[t.value.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"EEEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?l[o[t.value.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"EEEEE":i=t.isDayPart&&t.isMonthPart&&t.isYearPart?h[u[t.value.getDay()]].toString():t.defaultConstant.dayOfTheWeek.toString();break;case"M":i=t.isMonthPart?(t.value.getMonth()+1).toString():t.defaultConstant.month.toString();break;case"MM":i=t.isMonthPart?t.roundOff(t.value.getMonth()+1,2):t.defaultConstant.month.toString();break;case"MMM":i=t.isMonthPart?d[t.value.getMonth()+1]:t.defaultConstant.month.toString();break;case"MMMM":i=t.isMonthPart?p[t.value.getMonth()+1]:t.defaultConstant.month.toString();break;case"yy":i=t.isYearPart?t.roundOff(t.value.getFullYear()%100,2):t.defaultConstant.year.toString(),t.isYearPart&&(t.isNavigate=t.isShortYear=2===(t.value.getFullYear()%100).toString().length);break;case"y":case"yyyy":i=t.isYearPart?t.roundOff(t.value.getFullYear(),4):t.defaultConstant.year.toString();break;case"h":i=t.isHourPart?(t.value.getHours()%12||12).toString():t.defaultConstant.hour.toString();break;case"hh":i=t.isHourPart?t.roundOff(t.value.getHours()%12||12,2):t.defaultConstant.hour.toString();break;case"H":i=t.isHourPart?t.value.getHours().toString():t.defaultConstant.hour.toString();break;case"HH":i=t.isHourPart?t.roundOff(t.value.getHours(),2):t.defaultConstant.hour.toString();break;case"m":i=t.isMinutePart?t.value.getMinutes().toString():t.defaultConstant.minute.toString();break;case"mm":i=t.isMinutePart?t.roundOff(t.value.getMinutes(),2):t.defaultConstant.minute.toString();break;case"s":i=t.isSecondsPart?t.value.getSeconds().toString():t.defaultConstant.second.toString();break;case"ss":i=t.isSecondsPart?t.roundOff(t.value.getSeconds(),2):t.defaultConstant.second.toString();break;case"f":i=Math.floor(t.value.getMilliseconds()/100).toString();break;case"ff":s=t.value.getMilliseconds(),t.value.getMilliseconds()>99&&(s=Math.floor(t.value.getMilliseconds()/10)),i=t.roundOff(s,2);break;case"fff":i=t.roundOff(t.value.getMilliseconds(),3);break;case"a":case"aa":i=t.value.getHours()<12?c[m[0]]:c[m[1]];break;case"z":case"zz":case"zzz":case"zzzz":a={format:e,type:"dateTime",skeleton:"yMd",calendar:t.parent.calendarMode},i=t.parent.globalize.formatDate(t.value,a)}if(i=void 0!==i?i:e.slice(1,e.length-1),t.isHiddenMask){for(var v="",f=0;f<i.length;f++)v+=e[0];return v}return i}var t=this;return e},e.prototype.maskInputHandler=function(){var e,t=this.parent.inputElement.selectionStart;this.previousHiddenMask[t-1];if(this.differenceCheck(),e=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=e,this.parent.inputElement.value=e,this.parent.inputElement.selectionStart=t,this.validCharacterCheck(),(this.isNavigate||this.isDeletion)&&!this.isDeleteKey){var i=!this.isNavigate;this.isNavigate=this.isDeletion=!1,this.navigateSelection(i)}this.isDeleteKey=!1},e.prototype.navigateSelection=function(e){for(var t=this.parent.inputElement.selectionStart,i=this.parent.inputElement.selectionEnd,s=e?t-1:i+1;s<this.hiddenMask.length&&s>=0;){if(this.validCharacters.indexOf(this.hiddenMask[s])>=0){this.setSelection(this.hiddenMask[s]);break}s+=e?-1:1}},e.prototype.roundOff=function(e,t){for(var i=e.toString(),s=t-i.length,a="",n=0;n<s;n++)a+="0";return a+i},e.prototype.handleDeletion=function(e,t){switch(e){case"d":this.isDayPart=t;break;case"M":this.isMonthPart=t,t||(this.value.setMonth(0),this.monthCharacter="");break;case"y":this.isYearPart=t;break;case"H":case"h":this.isHourPart=t,t||(this.periodCharacter="");break;case"m":this.isMinutePart=t;break;case"s":this.isSecondsPart=t;break;default:return!1}return!0},e.prototype.dateAlteration=function(e){var t=this.parent.inputElement.selectionStart,i="";if(-1!==this.validCharacters.indexOf(this.hiddenMask[t])){i=this.hiddenMask[t];var s=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.value.getHours(),this.value.getMinutes(),this.value.getSeconds());this.previousDate=new Date(this.value.getFullYear(),this.value.getMonth(),this.value.getDate(),this.value.getHours(),this.value.getMinutes(),this.value.getSeconds());var a=e?-1:1;switch(i){case"d":s.setDate(s.getDate()+a);break;case"M":var n=s.getMonth()+a;if(s.setDate(1),s.setMonth(n),this.isDayPart){var r=new Date(this.previousDate.getFullYear(),this.previousDate.getMonth()+1,0).getDate(),l=new Date(s.getFullYear(),s.getMonth()+1,0).getDate();this.previousDate.getDate()==r&&l<=r?s.setDate(l):s.setDate(this.previousDate.getDate())}else s.setDate(this.previousDate.getDate());this.previousDate=new Date(s.getFullYear(),s.getMonth(),s.getDate());break;case"y":s.setFullYear(s.getFullYear()+a);break;case"H":case"h":s.setHours(s.getHours()+a);break;case"m":s.setMinutes(s.getMinutes()+a);break;case"s":s.setSeconds(s.getSeconds()+a);break;case"a":s.setHours((s.getHours()+12)%24)}this.value=s.getFullYear()>0?s:this.value,-1!==this.validCharacters.indexOf(this.hiddenMask[t])&&this.handleDeletion(this.hiddenMask[t],!0)}},e.prototype.getCulturedValue=function(e){var i=this.parent.locale;return"en"===i||"en-US"===i?t.getValue(e,t.getDefaultDateObject()):t.getValue("main."+i+".dates.calendars.gregorian."+e,t.cldrData)},e.prototype.getCulturedFormat=function(){var e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString();return"datepicker"==this.parent.moduleName&&(e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString(),this.parent.format&&this.parent.formatString&&(e=this.parent.formatString)),"datetimepicker"==this.parent.moduleName&&(e=this.getCulturedValue("dateTimeFormats[availableFormats].yMd").toString(),this.parent.dateTimeFormat&&(e=this.parent.dateTimeFormat)),"timepicker"==this.parent.moduleName&&(e=this.parent.cldrTimeFormat()),e},e.prototype.clearHandler=function(){this.isDayPart=this.isMonthPart=this.isYearPart=this.isHourPart=this.isMinutePart=this.isSecondsPart=!1,this.updateValue()},e.prototype.updateValue=function(){this.monthCharacter=this.periodCharacter="";var e=this.dateformat.replace(this.formatRegex,this.formatCheck());this.isHiddenMask=!0,this.hiddenMask=this.dateformat.replace(this.formatRegex,this.formatCheck()),this.isHiddenMask=!1,this.previousHiddenMask=this.hiddenMask,this.previousValue=e,this.parent.updateInputValue(e)},e.prototype.destroy=function(){this.removeEventListener()},e}();return f.Inject(y),C.Inject(y,de),Q.Inject(de),ue.Inject(y,de),e.MaskPlaceholder=m,e.CalendarBase=v,e.Calendar=f,e.Islamic=y,e.DatePicker=C,e.Presets=j,e.DateRangePicker=R,e.TimeMaskPlaceholder=$,e.TimePicker=Q,e.DateTimePicker=ue,e.MaskedDateTime=de,e}({},ej.base,ej.popups,ej.inputs,ej.buttons,ej.lists),this.ejs=ej;
- /*!
- * filename: ej2-pdf-export.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.pdfexport=function(t,e,i){"use strict";function r(t){return"[object String]"===Object.prototype.toString.call(t)?"$s"+t:"$o"+t.toString()}var n=function(){function t(t){this.table={},this.nElements=0,this.toStr=t||r}return t.prototype.getValue=function(t){var e=this.table["$"+this.toStr(t)];if(void 0!==e)return e.value},t.prototype.setValue=function(t,e){var i="$"+this.toStr(t);this.table[i];this.nElements++,this.table[i]={key:t,value:e}},t.prototype.remove=function(t){var e="$"+this.toStr(t),i=this.table[e];return delete this.table[e],this.nElements--,i.value},t.prototype.keys=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.key)}return t},t.prototype.values=function(){for(var t=[],e=Object.keys(this.table),i=0;i<e.length;i++){var r=this.table[e[i]];t.push(r.value)}return t},t.prototype.containsKey=function(t){return!(void 0===this.getValue(t))},t.prototype.clear=function(){this.table={},this.nElements=0},t.prototype.size=function(){return this.nElements},t}(),o=function(){function t(t){this.stringStartMark="/",this.internalValue="",this.isSaving6=!1,this.position6=-1,this.internalValue=this.normalizeValue(t)}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status6},set:function(t){this.status6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving6},set:function(t){this.isSaving6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index6},set:function(t){this.index6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position6},set:function(t){this.position6=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.internalValue},set:function(t){var e=t;null!==t&&t.length>0?(e=t,this.internalValue=this.normalizeValue(e)):this.internalValue=e},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.toString())},t.prototype.toString=function(){return this.stringStartMark+this.escapeString(this.value)},t.prototype.clone=function(e){var i=new t;return i.value=this.internalValue,i},t.prototype.escapeString=function(e){for(var i="",r=0,n=e.length;r<n;r++){var o=e[r];t.delimiters.indexOf(o);i+=o}return i},t.prototype.normalizeValue=function(t,e){return t},t.delimiters="()<>[]{}/%}",t.replacements=[" ","\t","\n","\r"],t}(),s=function(){function t(){this.forTest="test",this.forTest=t.obj}return t.obj="obj",t.endObj="endobj",t.r="R",t.whiteSpace=" ",t.slash="/",t.newLine="\r\n",t.stream="stream",t.endStream="endstream",t.xref="xref",t.f="f",t.n="n",t.trailer="trailer",t.startxref="startxref",t.eof="%%EOF",t.header="%PDF-1.5",t.beginText="BT",t.endText="ET",t.beginPath="m",t.appendLineSegment="l",t.stroke="S",t.fill="f",t.fillEvenOdd="f*",t.fillStroke="B",t.fillStrokeEvenOdd="B*",t.appendbeziercurve="c",t.appendRectangle="re",t.saveState="q",t.restoreState="Q",t.paintXObject="Do",t.modifyCtm="cm",t.modifyTM="Tm",t.setLineWidth="w",t.setLineCapStyle="J",t.setLineJoinStyle="j",t.setDashPattern="d",t.setFlatnessTolerance="i",t.closePath="h",t.closeStrokePath="s",t.closeFillStrokePath="b",t.setCharacterSpace="Tc",t.setWordSpace="Tw",t.setHorizontalScaling="Tz",t.setTextLeading="TL",t.setFont="Tf",t.setRenderingMode="Tr",t.setTextRise="Ts",t.setTextScaling="Tz",t.setCoords="Td",t.goToNextLine="T*",t.setText="Tj",t.setTextWithFormatting="TJ",t.setTextOnNewLine="'",t.selectcolorspaceforstroking="CS",t.selectcolorspacefornonstroking="cs",t.setrbgcolorforstroking="RG",t.setrbgcolorfornonstroking="rg",t.setcmykcolorforstroking="K",t.setcmykcolorfornonstroking="k",t.setgraycolorforstroking="G",t.setgraycolorfornonstroking="g",t.clipPath="W",t.clipPathEvenOdd="W*",t.endPath="n",t.setGraphicsState="gs",t.comment="%",t.evenOdd="*",t.setMiterLimit="M",t.setColorAndPattern="scn",t.setColorAndPatternStroking="SCN",t}(),a=function(){function t(){this.pages="Pages",this.kids="Kids",this.count="Count",this.resources="Resources",this.type="Type",this.size="Size",this.mediaBox="MediaBox",this.parent="Parent",this.root="Root",this.decodeParms="DecodeParms",this.filter="Filter",this.font="Font",this.type1="Type1",this.baseFont="BaseFont",this.encoding="Encoding",this.subtype="Subtype",this.contents="Contents",this.procset="ProcSet",this.colorSpace="ColorSpace",this.extGState="ExtGState",this.pattern="Pattern",this.xObject="XObject",this.length="Length",this.width="Width",this.height="Height",this.bitsPerComponent="BitsPerComponent",this.image="Image",this.dctdecode="DCTDecode",this.columns="Columns",this.blackIs1="BlackIs1",this.k="K",this.s="S",this.predictor="Predictor",this.deviceRgb="DeviceRGB",this.next="Next",this.action="Action",this.link="Link",this.a="A",this.annot="Annot",this.p="P",this.c="C",this.rect="Rect",this.uri="URI",this.annots="Annots",this.ca="ca",this.CA="CA",this.xyz="XYZ",this.fit="Fit",this.dest="Dest",this.BM="BM",this.flatedecode="FlateDecode",this.rotate="Rotate",this.bBox="BBox",this.form="Form",this.w="W",this.cIDFontType2="CIDFontType2",this.cIDToGIDMap="CIDToGIDMap",this.identity="Identity",this.dw="DW",this.fontDescriptor="FontDescriptor",this.cIDSystemInfo="CIDSystemInfo",this.fontName="FontName",this.flags="Flags",this.fontBBox="FontBBox",this.missingWidth="MissingWidth",this.stemV="StemV",this.italicAngle="ItalicAngle",this.capHeight="CapHeight",this.ascent="Ascent",this.descent="Descent",this.leading="Leading",this.avgWidth="AvgWidth",this.fontFile2="FontFile2",this.maxWidth="MaxWidth",this.xHeight="XHeight",this.stemH="StemH",this.registry="Registry",this.ordering="Ordering",this.supplement="Supplement",this.type0="Type0",this.identityH="Identity-H",this.toUnicode="ToUnicode",this.descendantFonts="DescendantFonts",this.background="Background",this.shading="Shading",this.matrix="Matrix",this.antiAlias="AntiAlias",this.function="Function",this.extend="Extend",this.shadingType="ShadingType",this.coords="Coords",this.domain="Domain",this.range="Range",this.functionType="FunctionType",this.bitsPerSample="BitsPerSample",this.patternType="PatternType",this.paintType="PaintType",this.tilingType="TilingType",this.xStep="XStep",this.yStep="YStep"}return t}(),h=function(){function t(t){if(this.position7=-1,this.primitiveItems=new n,this.prefix="<<",this.suffix=">>",this.resources=[],this.object=null,this.archive=!0,this.isFont=!1,void 0===t)this.primitiveItems=new n,this.encrypt=!0,this.dictionaryProperties=new a;else{this.primitiveItems=new n;for(var e=t.items.keys(),i=t.items.values(),r=0;r<t.items.size();r++)this.primitiveItems.setValue(e[r],i[r]);this.status=t.status,this.freezeChanges(this),this.encrypt=!0,this.dictionaryProperties=new a}}return Object.defineProperty(t.prototype,"items",{get:function(){return this.primitiveItems},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status7},set:function(t){this.status7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving7},set:function(t){this.isSaving7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index7},set:function(t){this.index7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position7},set:function(t){this.position7=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Count",{get:function(){return this.primitiveItems.size()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Dictionary",{get:function(){return this},enumerable:!0,configurable:!0}),t.prototype.getArchive=function(){return this.archive},t.prototype.setArchive=function(t){this.archive=t},t.prototype.setEncrypt=function(t){this.encrypt=t,this.modify()},t.prototype.getEncrypt=function(){return this.encrypt},t.prototype.freezeChanges=function(t){this.bChanged=!1},t.prototype.clone=function(e){return new t},t.prototype.modify=function(){this.bChanged=!0},t.prototype.remove=function(t){"string"!=typeof t?(this.primitiveItems.remove(t.value),this.modify()):this.remove(new o(t))},t.prototype.containsKey=function(t){return this.primitiveItems.containsKey(t.toString())},t.prototype.onBeginSave=function(){this.beginSave.sender.beginSave()},t.prototype.onFontDictionaryBeginSave=function(){this.fontDictionaryBeginSave.sender.fontDictionaryBeginSave()},t.prototype.onDescendantFontBeginSave=function(){this.descendantFontBeginSave.sender.descendantFontBeginSave()},t.prototype.onTemplateBeginSave=function(){this.pageBeginDrawTemplate.sender.pageBeginSave()},t.prototype.onBeginAnnotationSave=function(){this.annotationBeginSave.sender.beginSave()},t.prototype.onSectionBeginSave=function(t){var e=this.sectionBeginSave;e.sender.beginSave(e.state,t)},t.prototype.save=function(t,e){void 0===e?this.save(t,!0):(t.write(this.prefix),void 0!==this.beginSave&&this.onBeginSave(),void 0!==this.descendantFontBeginSave&&this.onDescendantFontBeginSave(),void 0!==this.fontDictionaryBeginSave&&this.onFontDictionaryBeginSave(),void 0!==this.annotationBeginSave&&this.onBeginAnnotationSave(),void 0!==this.sectionBeginSave&&this.onSectionBeginSave(t),void 0!==this.pageBeginDrawTemplate&&this.onTemplateBeginSave(),this.Count>0&&this.saveItems(t),t.write(this.suffix),t.write(s.newLine))},t.prototype.saveItems=function(t){t.write(s.newLine);for(var e=this.primitiveItems.keys(),i=this.primitiveItems.values(),r=0;r<e.length;r++){var n=e[r];new o(n).save(t),t.write(s.whiteSpace),i[r].save(t),t.write(s.newLine)}},t}(),l=function(){function t(t){this.sender=t}return t}(),u=function(){function t(t){this.sender=t}return t}(),c=function(){function t(t){this.sender=t}return t}(),p=function(){function t(t){this.sender=t}return t}(),d=function(){function t(t,e){this.sender=t,this.state=e}return t}(),f=function(){function t(t){this.sender=t}return t}(),g=function(){function t(t){this.position5=-1,this.value=t}return Object.defineProperty(t.prototype,"intValue",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isInteger",{get:function(){return this.integer},set:function(t){this.integer=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status5},set:function(t){this.status5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving5},set:function(t){this.isSaving5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index5},set:function(t){this.index5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position5},set:function(t){this.position5=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.intValue.toString())},t.prototype.clone=function(e){return new t(this.value)},t.floatToString=function(t){var e=t.toFixed(2);return"0.00"===e&&(e=".00"),e},t.min=function(t,e,i){var r=Math.min(t,e);return Math.min(i,r)},t}(),m=function(){function t(e){if(this.startMark="[",this.endMark="]",this.position9=-1,this.clonedObject9=null,this.isFont=!1,void 0===e)this.internalElements=[];else if(void 0===e||e instanceof t){var i=e;this.internalElements=[];for(n=0;n<i.elements.length;n++)this.internalElements.push(i.elements[n])}else for(var r=e,n=0;n<r.length;n++){var o=new g(r[n]);this.add(o)}}return t.prototype.items=function(t){return this.internalElements[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.internalElements.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this.status9},set:function(t){this.status9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving9},set:function(t){this.isSaving9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return this.clonedObject9},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position9},set:function(t){this.position9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index9},set:function(t){this.index9=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"CrossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"elements",{get:function(){return this.internalElements},enumerable:!0,configurable:!0}),t.prototype.add=function(t){void 0===this.internalElements&&(this.internalElements=[]),this.internalElements.push(t),this.markedChange()},t.prototype.markedChange=function(){this.bChanged=!0},t.prototype.contains=function(t){for(var e=0;e<this.internalElements.length;e++){var i=this.internalElements[e],r=t;if(null!=i&&void 0!==i&&null!=r&&void 0!==r&&i.value===r.value)return!0}return!1},t.prototype.getItems=function(t){return this.internalElements[t]},t.prototype.save=function(t){t.write(this.startMark);for(var e=0,i=this.count;e<i;e++)this.getItems(e).save(t),e+1!==i&&t.write(s.whiteSpace);t.write(this.endMark)},t.prototype.clone=function(e){this.clonedObject9=null;for(var i=new t,r=0;r<this.internalElements.length;r++){var n=this.internalElements[r];i.add(n.clone(e))}return i.pdfCrossTable=e,this.clonedObject9=i,i},t.fromRectangle=function(e){return new t([e.x,e.y,e.width,e.height])},t.prototype.insert=function(t,e){if(t<this.internalElements.length&&t>0){for(var i=[],r=0;r<t;r++)i.push(this.internalElements[r]);i.push(e);for(r=t;r<this.internalElements.length;r++)i.push(this.internalElements[r]);this.internalElements=i}else this.internalElements.push(e);this.markChanged()},t.prototype.indexOf=function(t){return this.internalElements.indexOf(t)},t.prototype.remove=function(t){var e=this.internalElements.indexOf(t);this.internalElements[e]=null,this.markChanged()},t.prototype.removeAt=function(t){if(this.internalElements.length>t){for(var e=[],i=0;i<t;i++)e.push(this.internalElements[i]);for(i=t+1;i<this.internalElements.length;i++)e.push(this.internalElements[i]);this.internalElements=e}this.markChanged()},t.prototype.clear=function(){this.internalElements=[],this.markChanged()},t.prototype.markChanged=function(){this.bChanged=!0},t}(),y=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),b=function(t){function i(e,i){var r=t.call(this,e)||this;return r.dicPrefix="stream",r.dicSuffix="endstream",r.clonedObject2=null,r.bCompress=!0,r.isImageStream=!1,r.isFontStream=!1,void 0!==e||void 0!==i?(r.dataStream2=[],r.dataStream2=i,r.bCompress2=!1):(r.dataStream2=[],r.bCompress2=!0),r}return y(i,t),Object.defineProperty(i.prototype,"internalStream",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isImage",{get:function(){return this.isImageStream},set:function(t){this.isImageStream=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isFont",{get:function(){return this.isFontStream},set:function(t){this.isFontStream=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"compress",{get:function(){return this.bCompress},set:function(t){this.bCompress=t,this.modify()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"data",{get:function(){return this.dataStream2},set:function(t){this.dataStream2=[],this.dataStream2=t,this.modify()},enumerable:!0,configurable:!0}),i.prototype.clearStream=function(){this.internalStream=[],this.items.containsKey(this.dictionaryProperties.filter)&&this.remove(this.dictionaryProperties.filter),this.bCompress=!0,this.modify()},i.prototype.write=function(t){if(null==t)throw new Error("ArgumentNullException:text");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty string, text");this.dataStream2.push(t),this.modify()},i.prototype.writeBytes=function(t){if(null===t)throw new Error("ArgumentNullException:data");if(t.length<=0)throw new Error("ArgumentException: Can not write an empty bytes, data");for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);this.dataStream2.push(e),this.modify()},i.prototype.onCmapBeginSave=function(){this.cmapBeginSave.sender.cmapBeginSave()},i.prototype.onFontProgramBeginSave=function(){this.fontProgramBeginSave.sender.fontProgramBeginSave()},i.prototype.compressContent=function(t,i){if(this.bCompress){for(var r=[],n=0;n<t.length;n++)r.push(t.charCodeAt(n));var o=new Uint8Array(r),s=new e.CompressedStreamWriter;s.write(o,0,o.length),s.close(),t=s.getCompressedString,this.addFilter(this.dictionaryProperties.flatedecode)}return t},i.prototype.addFilter=function(t){var e=this.items.getValue(this.dictionaryProperties.filter);e instanceof C&&(e=e.object);var i=e,r=e;null!=r&&((i=new m).insert(0,r),this.items.setValue(this.dictionaryProperties.filter,i)),r=new o(t),null==i?this.items.setValue(this.dictionaryProperties.filter,r):i.insert(0,r)},i.prototype.save=function(e){void 0!==this.cmapBeginSave&&this.onCmapBeginSave(),void 0!==this.fontProgramBeginSave&&this.onFontProgramBeginSave();for(var i="",r=0;r<this.data.length;r++)i+=this.data[r];i.length>1&&!this.isImage&&!this.isFont&&(i="q\r\n"+i+"Q\r\n");var n=(i=this.compressContent(i,e)).length;this.items.setValue(this.dictionaryProperties.length,new g(n)),t.prototype.save.call(this,e,!1),e.write(this.dicPrefix),e.write(s.newLine),i.length>0&&e.write(i),e.write(s.newLine),e.write(this.dicSuffix),e.write(s.newLine)},i.bytesToString=function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},i}(h),w=function(){function t(t){this.sender=t}return t}(),S=function(){function t(t){this.sender=t}return t}();!function(t){!function(t){t[t.None=0]="None",t[t.Ascii=1]="Ascii",t[t.Unicode=2]="Unicode"}(t.ForceEncoding||(t.ForceEncoding={}));var e;!function(t){t[t.StringValue=0]="StringValue",t[t.ByteBuffer=1]="ByteBuffer"}(e||(e={}))}(t.InternalEnum||(t.InternalEnum={}));var P=function(){function e(t){if(this.bHex=!1,this.position1=-1,this.clonedObject1=null,this.bDecrypted=!1,this.isParentDecrypted=!1,this.isPacked=!1,this.isFormField=!1,this.isColorSpace=!1,this.isHexString=!0,void 0===t)this.bHex=!1;else if(!(t.length>0&&"0xfeff"===t[0])){this.stringValue=t,this.data=[];for(var e=0;e<t.length;++e)this.data.push(t.charCodeAt(e))}}return Object.defineProperty(e.prototype,"hex",{get:function(){return this.bHex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.stringValue},set:function(t){this.stringValue=t,this.data=null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.status1},set:function(t){this.status1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSaving",{get:function(){return this.isSaving1},set:function(t){this.isSaving1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollectionIndex",{get:function(){return this.index1},set:function(t){this.index1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clonedObject",{get:function(){return this.clonedObject1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.position1},set:function(t){this.position1=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CrossTable",{get:function(){return this.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"converted",{get:function(){return this.bConverted},set:function(t){this.bConverted=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"encode",{get:function(){return this.bForceEncoding},set:function(t){this.bForceEncoding=t},enumerable:!0,configurable:!0}),e.bytesToHex=function(t){if(null==t)return"";return""},e.prototype.save=function(i){if(null===i)throw new Error("ArgumentNullException : writer");void 0!==this.encode&&this.encode===t.InternalEnum.ForceEncoding.Ascii?i.write(this.pdfEncode()):i.write(e.stringMark[0]+this.value+e.stringMark[1])},e.prototype.pdfEncode=function(){var i="";if(void 0!==this.encode&&this.encode===t.InternalEnum.ForceEncoding.Ascii){for(var r=this.escapeSymbols(this.value),n=0;n<r.length;n++)i+=String.fromCharCode(r[n]);i=e.stringMark[0]+i+e.stringMark[1]}else i=this.value;return i},e.prototype.escapeSymbols=function(t){for(var e=[],i=0;i<t.length;i++){var r=t.charCodeAt(i);switch(r){case 40:case 41:e.push(92),e.push(r);break;case 13:e.push(92),e.push(114);break;case 92:e.push(92),e.push(r);break;default:e.push(r)}}return e},e.prototype.clone=function(t){if(null!==this.clonedObject1&&this.clonedObject1.CrossTable===t)return this.clonedObject1;this.clonedObject1=null;var i=new e(this.stringValue);return i.bHex=this.bHex,i.crossTable=t,i.isColorSpace=this.isColorSpace,this.clonedObject1=i,i},e.toUnicodeArray=function(t,e){if(null==t)throw new Error("Argument Null Exception : value");for(var i=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);i.push(n/256>>>0),i.push(255&n)}return i},e.byteToString=function(t){if(null==t)throw new Error("Argument Null Exception : stream");for(var e="",i=0;i<t.length;++i)e+=String.fromCharCode(t[i]);return e},e.stringMark="()",e.hexStringMark="<>",e.hexFormatPattern="{0:X2}",e}(),v=function(){function t(t,e){this.index3=-1,this.position3=-1,this.objNumber=0,this.genNumber=0,"number"==typeof t&&"number"==typeof e?(this.objNumber=t,this.genNumber=e):(this.objNumber=Number(t),this.genNumber=Number(e))}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status3},set:function(t){this.status3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving3},set:function(t){this.isSaving3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index3},set:function(t){this.index3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position3},set:function(t){this.position3=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.toString())},t.prototype.toString=function(){return this.objNumber.toString()+" "+this.genNumber.toString()+" R"},t.prototype.clone=function(t){return null},t}(),C=function(){function t(t,e){this.index4=-1,this.position4=-1,this.objectIndex=-1,this.dictionaryProperties=new a,this.initialize(t)}return Object.defineProperty(t.prototype,"status",{get:function(){return this.status4},set:function(t){this.status4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.isSaving4},set:function(t){this.isSaving4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index4},set:function(t){this.index4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.position4},set:function(t){this.position4=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"object",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this.objectIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.primitiveObject},enumerable:!0,configurable:!0}),t.prototype.initialize=function(t){if(t instanceof m||t instanceof h||t instanceof o||t instanceof g||t instanceof b||t instanceof v||t instanceof P)this.primitiveObject=t;else{var e=t;this.initialize(e.element)}},t.prototype.save=function(t){t.position;var e=t.document.crossTable;this.object.isSaving=!0;e.getReference(this.object).save(t)},t.prototype.clone=function(t){return null},t}(),B=function(){function t(){this.action=null,this.dictionaryProperties=new a,this.initialize()}return Object.defineProperty(t.prototype,"next",{get:function(){return this.action},set:function(t){this.action=t,this.dictionary.items.setValue(this.dictionaryProperties.next,new C(this.action))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return void 0===this.pdfDictionary&&(this.pdfDictionary=new h),this.pdfDictionary},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.action))},Object.defineProperty(t.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0}),t}(),O=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),x=function(t){function e(e){var i=t.call(this)||this;return i.uniformResourceIdentifier="",i}return O(e,t),Object.defineProperty(e.prototype,"uri",{get:function(){return this.uniformResourceIdentifier},set:function(t){this.uniformResourceIdentifier=t,this.dictionary.items.setValue(this.dictionaryProperties.uri,new P(this.uniformResourceIdentifier))},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.s,new o(this.dictionaryProperties.uri))},e}(B);!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"}(t.PdfHorizontalAlignment||(t.PdfHorizontalAlignment={})),function(t){t[t.Top=0]="Top",t[t.Middle=1]="Middle",t[t.Bottom=2]="Bottom"}(t.PdfVerticalAlignment||(t.PdfVerticalAlignment={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Justify=3]="Justify"}(t.PdfTextAlignment||(t.PdfTextAlignment={})),function(t){t[t.Fill=0]="Fill",t[t.Stroke=1]="Stroke",t[t.FillStroke=2]="FillStroke",t[t.None=3]="None",t[t.ClipFlag=4]="ClipFlag",t[t.ClipFill=4]="ClipFill",t[t.ClipStroke=5]="ClipStroke",t[t.ClipFillStroke=6]="ClipFillStroke",t[t.Clip=7]="Clip"}(t.TextRenderingMode||(t.TextRenderingMode={})),function(t){t[t.Miter=0]="Miter",t[t.Round=1]="Round",t[t.Bevel=2]="Bevel"}(t.PdfLineJoin||(t.PdfLineJoin={})),function(t){t[t.Flat=0]="Flat",t[t.Round=1]="Round",t[t.Square=2]="Square"}(t.PdfLineCap||(t.PdfLineCap={})),function(t){t[t.Solid=0]="Solid",t[t.Dash=1]="Dash",t[t.Dot=2]="Dot",t[t.DashDot=3]="DashDot",t[t.DashDotDot=4]="DashDotDot",t[t.Custom=5]="Custom"}(t.PdfDashStyle||(t.PdfDashStyle={})),function(t){t[t.Winding=0]="Winding",t[t.Alternate=1]="Alternate"}(t.PdfFillMode||(t.PdfFillMode={})),function(t){t[t.Rgb=0]="Rgb",t[t.Cmyk=1]="Cmyk",t[t.GrayScale=2]="GrayScale",t[t.Indexed=3]="Indexed"}(t.PdfColorSpace||(t.PdfColorSpace={})),function(t){t[t.Normal=0]="Normal",t[t.Multiply=1]="Multiply",t[t.Screen=2]="Screen",t[t.Overlay=3]="Overlay",t[t.Darken=4]="Darken",t[t.Lighten=5]="Lighten",t[t.ColorDodge=6]="ColorDodge",t[t.ColorBurn=7]="ColorBurn",t[t.HardLight=8]="HardLight",t[t.SoftLight=9]="SoftLight",t[t.Difference=10]="Difference",t[t.Exclusion=11]="Exclusion",t[t.Hue=12]="Hue",t[t.Saturation=13]="Saturation",t[t.Color=14]="Color",t[t.Luminosity=15]="Luminosity"}(t.PdfBlendMode||(t.PdfBlendMode={})),function(t){t[t.Centimeter=0]="Centimeter",t[t.Pica=1]="Pica",t[t.Pixel=2]="Pixel",t[t.Point=3]="Point",t[t.Inch=4]="Inch",t[t.Document=5]="Document",t[t.Millimeter=6]="Millimeter"}(t.PdfGraphicsUnit||(t.PdfGraphicsUnit={})),function(t){t[t.Fit=0]="Fit",t[t.Center=1]="Center",t[t.Stretch=2]="Stretch",t[t.Tile=3]="Tile"}(t.PdfGridImagePosition||(t.PdfGridImagePosition={})),function(t){t[t.None=0]="None",t[t.LeftToRight=1]="LeftToRight",t[t.RightToLeft=2]="RightToLeft"}(t.PdfTextDirection||(t.PdfTextDirection={}));var L=function(){function e(t,i,r,n){void 0===t?void 0!==i&&void 0!==r&&void 0!==n?this.assignRGB(i,r,n):this.filled=!1:t instanceof e?(this.redColor=t.r,this.greenColor=t.g,this.blueColor=t.b,this.grayColor=t.gray,this.alpha=t.alpha,this.filled=0!==this.alpha):"number"==typeof t&&void 0===i&&void 0===r&&void 0===n?(t<0&&(t=0),t>1&&(t=1),this.redColor=t*e.maxColourChannelValue,this.greenColor=t*e.maxColourChannelValue,this.blueColor=t*e.maxColourChannelValue,this.cyanColor=t,this.magentaColor=t,this.yellowColor=t,this.blackColor=t,this.grayColor=t,this.alpha=e.maxColourChannelValue,this.filled=!0):void 0===n?this.assignRGB(t,i,r):this.assignRGB(i,r,n,t)}return e.prototype.assignRGB=function(t,i,r,n){void 0===t||void 0===i||void 0===r?this.filled=!1:(this.cyanColor=0,this.magentaColor=0,this.yellowColor=0,this.blackColor=0,this.grayColor=0,this.redColor=t,this.greenColor=i,this.blueColor=r,this.alpha=void 0===n?e.maxColourChannelValue:n,this.filled=!0,this.assignCMYK(t,i,r))},e.prototype.assignCMYK=function(t,i,r){var n=t/e.maxColourChannelValue,o=i/e.maxColourChannelValue,s=r/e.maxColourChannelValue,a=g.min(1-n,1-o,1-s),h=1===a?0:(1-n-a)/(1-a),l=1===a?0:(1-o-a)/(1-a),u=1===a?0:(1-s-a)/(1-a);this.blackColor=a,this.cyanColor=h,this.magentaColor=l,this.yellowColor=u},Object.defineProperty(e.prototype,"r",{get:function(){return this.redColor},set:function(t){this.redColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"red",{get:function(){return this.r/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.blueColor},set:function(t){this.blueColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blue",{get:function(){return this.b/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.cyanColor},set:function(t){this.cyanColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"k",{get:function(){return this.blackColor},set:function(t){this.blackColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"m",{get:function(){return this.magentaColor},set:function(t){this.magentaColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.yellowColor},set:function(t){this.yellowColor=t<0?0:t>1?1:t,this.assignRGB(this.cyanColor,this.magentaColor,this.yellowColor,this.blackColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this.greenColor},set:function(t){this.greenColor=t,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"green",{get:function(){return this.g/e.maxColourChannelValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gray",{get:function(){return(this.redColor+this.greenColor+this.blueColor)/(3*e.maxColourChannelValue)},set:function(t){this.grayColor=t<0?0:t>1?1:t,this.r=this.grayColor*e.maxColourChannelValue,this.g=this.grayColor*e.maxColourChannelValue,this.b=this.grayColor*e.maxColourChannelValue,this.assignCMYK(this.redColor,this.greenColor,this.blueColor),this.filled=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return!this.filled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this.alpha},set:function(t){this.alpha=t<0?0:t,this.filled=!0},enumerable:!0,configurable:!0}),e.prototype.toString=function(e,i){if(this.isEmpty)return"";var r="";switch(e){case t.PdfColorSpace.Rgb:r=this.rgbToString(i);break;case t.PdfColorSpace.GrayScale:r=this.grayScaleToString(i);break;case t.PdfColorSpace.Cmyk:r=this.cmykToString(i)}return r},e.prototype.grayScaleToString=function(t){var i=this.gray,r="",n=null;return n=t?e.grayStringsSroke.containsKey(i)?e.grayStringsSroke.getValue(i):null:e.grayStringsFill.containsKey(i)?e.grayStringsFill.getValue(i):null,null==n?t&&(r=i.toString()+" G",e.grayStringsSroke.setValue(i,r)):r=n.toString(),r+s.newLine},e.prototype.rgbToString=function(t){var i=this.r,r=this.g,n=this.b,o=(i<<16)+(r<<8)+n;t&&(o+=1<<24);var a="",h=null;if(e.rgbStrings.containsKey(o)&&(h=e.rgbStrings.getValue(o)),null==h){var l=i/e.maxColourChannelValue,u=r/e.maxColourChannelValue,c=n/e.maxColourChannelValue;a=t?l.toString()+" "+u.toString()+" "+c.toString()+" RG":l.toString()+" "+u.toString()+" "+c.toString()+" rg",e.rgbStrings.setValue(o,a)}else a=h.toString();return a+s.newLine},e.prototype.cmykToString=function(t){var e=this.c,i=this.m,r=this.y,n=this.b;return e.toString()+" "+i.toString()+" "+r.toString()+" "+n.toString()+" K"+s.newLine},e.prototype.toArray=function(e){var i=new m;switch(e){case t.PdfColorSpace.Rgb:i.add(new g(this.red)),i.add(new g(this.green)),i.add(new g(this.blue))}return i},e.rgbStrings=new n,e.grayStringsSroke=new n,e.grayStringsFill=new n,e.maxColourChannelValue=255,e}(),T=function(){function t(t,e){void 0===t?(this.x=0,this.y=0):(this.x=null!==t?t:0,this.y=null!==e?e:0)}return t}(),j=function(){function t(t,e){void 0===e?(this.height=0,this.width=0):(this.height=null!==e?e:0,this.width=null!==t?t:0)}return t}(),k=function(){function t(t,e,i,r){if(typeof t==typeof t&&void 0===t)this.x=0,this.y=0,this.height=0,this.width=0;else if(t instanceof T&&e instanceof j&&void 0===i){var n=t;this.x=n.x,this.y=n.y;var o=e;this.height=o.height,this.width=o.width}else{var s=t,a=e,h=i,l=r;this.x=s,this.y=a,this.height=l,this.width=h}}return t}(),V=function(){function t(t,e,i,r){this.left=t,this.top=e,this.right=i,this.bottom=r}return Object.defineProperty(t.prototype,"width",{get:function(){return this.right-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topLeft",{get:function(){return new T(this.left,this.top)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return new j(this.width,this.height)},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.topLeft+"x"+this.size},t}(),R=function(){function t(){}return t.prototype.clone=function(){return this},t}(),N=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),A=function(e){function i(t){var i=e.call(this)||this;return i.pdfColor=t,i}return N(i,e),Object.defineProperty(i.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),i.prototype.monitorChanges=function(t,e,i,r,n){if(null==e)throw new Error("ArgumentNullException:streamWriter");var o=!1;return o=!0,e.setColorAndSpace(this.pdfColor,n,!1),o},i.prototype.resetChanges=function(e){e.setColorAndSpace(new L(0,0,0),t.PdfColorSpace.Rgb,!1)},i}(R);!function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold",t[t.Italic=2]="Italic",t[t.Underline=4]="Underline",t[t.Strikeout=8]="Strikeout"}(t.PdfFontStyle||(t.PdfFontStyle={})),function(t){t[t.Helvetica=0]="Helvetica",t[t.Courier=1]="Courier",t[t.TimesRoman=2]="TimesRoman",t[t.Symbol=3]="Symbol",t[t.ZapfDingbats=4]="ZapfDingbats"}(t.PdfFontFamily||(t.PdfFontFamily={})),function(t){t[t.Standard=0]="Standard",t[t.TrueType=1]="TrueType",t[t.TrueTypeEmbedded=2]="TrueTypeEmbedded"}(t.PdfFontType||(t.PdfFontType={})),function(t){t[t.None=0]="None",t[t.Word=1]="Word",t[t.WordOnly=2]="WordOnly",t[t.Character=3]="Character"}(t.PdfWordWrapType||(t.PdfWordWrapType={})),function(t){t[t.None=0]="None",t[t.SuperScript=1]="SuperScript",t[t.SubScript=2]="SubScript"}(t.PdfSubSuperScript||(t.PdfSubSuperScript={})),function(t){t[t.Unknown=0]="Unknown",t[t.StandardEncoding=1]="StandardEncoding",t[t.MacRomanEncoding=2]="MacRomanEncoding",t[t.MacExpertEncoding=3]="MacExpertEncoding",t[t.WinAnsiEncoding=4]="WinAnsiEncoding",t[t.PdfDocEncoding=5]="PdfDocEncoding",t[t.IdentityH=6]="IdentityH"}(t.FontEncoding||(t.FontEncoding={})),function(t){t[t.Apple=0]="Apple",t[t.Microsoft=4]="Microsoft",t[t.Trimmed=6]="Trimmed"}(t.TtfCmapFormat||(t.TtfCmapFormat={})),function(t){t[t.Unknown=0]="Unknown",t[t.Symbol=1]="Symbol",t[t.Unicode=2]="Unicode",t[t.Macintosh=3]="Macintosh"}(t.TtfCmapEncoding||(t.TtfCmapEncoding={})),function(t){t[t.AppleUnicode=0]="AppleUnicode",t[t.Macintosh=1]="Macintosh",t[t.Iso=2]="Iso",t[t.Microsoft=3]="Microsoft"}(t.TtfPlatformID||(t.TtfPlatformID={})),function(t){t[t.Undefined=0]="Undefined",t[t.Unicode=1]="Unicode"}(t.TtfMicrosoftEncodingID||(t.TtfMicrosoftEncodingID={})),function(t){t[t.Roman=0]="Roman",t[t.Japanese=1]="Japanese",t[t.Chinese=2]="Chinese"}(t.TtfMacintoshEncodingID||(t.TtfMacintoshEncodingID={})),function(t){t[t.FixedPitch=1]="FixedPitch",t[t.Serif=2]="Serif",t[t.Symbolic=4]="Symbolic",t[t.Script=8]="Script",t[t.Nonsymbolic=32]="Nonsymbolic",t[t.Italic=64]="Italic",t[t.ForceBold=262144]="ForceBold"}(t.FontDescriptorFlags||(t.FontDescriptorFlags={})),function(t){t[t.Arg1And2AreWords=1]="Arg1And2AreWords",t[t.ArgsAreXyValues=2]="ArgsAreXyValues",t[t.RoundXyToGrid=4]="RoundXyToGrid",t[t.WeHaveScale=8]="WeHaveScale",t[t.Reserved=16]="Reserved",t[t.MoreComponents=32]="MoreComponents",t[t.WeHaveAnXyScale=64]="WeHaveAnXyScale",t[t.WeHaveTwoByTwo=128]="WeHaveTwoByTwo",t[t.WeHaveInstructions=256]="WeHaveInstructions",t[t.UseMyMetrics=512]="UseMyMetrics"}(t.TtfCompositeGlyphFlags||(t.TtfCompositeGlyphFlags={}));var D=function(){function e(e,i){this.scalingFactor=100,this.wordWrapType=t.PdfWordWrapType.Word,this.internalLineLimit=!0,this.wordWrapType=t.PdfWordWrapType.Word,void 0!==e&&"string"!=typeof e&&(this.textAlignment=e),void 0!==i&&(this.verticalAlignment=i)}return Object.defineProperty(e.prototype,"alignment",{get:function(){return this.textAlignment},set:function(t){this.textAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textDirection",{get:function(){return this.direction},set:function(t){this.direction=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineAlignment",{get:function(){return void 0===this.verticalAlignment||null==this.verticalAlignment?t.PdfVerticalAlignment.Top:this.verticalAlignment},set:function(t){this.verticalAlignment=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightToLeft",{get:function(){return void 0!==this.isRightToLeft&&null!=this.isRightToLeft&&this.isRightToLeft},set:function(t){this.isRightToLeft=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterSpacing",{get:function(){return void 0===this.internalCharacterSpacing||null==this.internalCharacterSpacing?0:this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordSpacing",{get:function(){return void 0===this.internalWordSpacing||null==this.internalWordSpacing?0:this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacing",{get:function(){return void 0===this.leading||null==this.leading?0:this.leading},set:function(t){this.leading=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clipPath",{get:function(){return void 0!==this.clip&&null!=this.clip&&this.clip},set:function(t){this.clip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"subSuperScript",{get:function(){return void 0===this.pdfSubSuperScript||null==this.pdfSubSuperScript?t.PdfSubSuperScript.None:this.pdfSubSuperScript},set:function(t){this.pdfSubSuperScript=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphIndent",{get:function(){return void 0===this.internalParagraphIndent||null==this.internalParagraphIndent?0:this.internalParagraphIndent},set:function(t){this.internalParagraphIndent=t,this.firstLineIndent=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineLimit",{get:function(){return this.internalLineLimit},set:function(t){this.internalLineLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"measureTrailingSpaces",{get:function(){return void 0!==this.trailingSpaces&&null!=this.trailingSpaces&&this.trailingSpaces},set:function(t){this.trailingSpaces=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noClip",{get:function(){return void 0!==this.isNoClip&&null!=this.isNoClip&&this.isNoClip},set:function(t){this.isNoClip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordWrap",{get:function(){return this.wordWrapType},set:function(t){this.wordWrapType=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalScalingFactor",{get:function(){return this.scalingFactor},set:function(t){if(t<=0)throw new Error("ArgumentOutOfRangeException:The scaling factor cant be less of equal to zero, ScalingFactor");this.scalingFactor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLineIndent",{get:function(){return void 0===this.initialLineIndent||null==this.initialLineIndent?0:this.initialLineIndent},set:function(t){this.initialLineIndent=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return this},e}(),M=function(){function t(t){if(this.currentPosition=0,null==t)throw new Error("ArgumentNullException:text");this.text=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.currentPosition===this.text.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),t.getCharsCount=function(t,e){if("string"==typeof e){if(null==t)throw new Error("ArgumentNullException:wholeText");for(var i=0,r=0;-1!==(r=t.indexOf(e,r));)i++,r++;return i}if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:symbols");for(var n=0,o=0,s=t.length;o<s;o++){var a=t[o];this.contains(e,a)&&n++}return n},t.prototype.readLine=function(){for(var t=this.currentPosition;t<this.length;){var e=this.text[t];switch(e){case"\r":case"\n":var i=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===e&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,i}t++}if(t>this.currentPosition){var r=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,r}return null},t.prototype.peekLine=function(){var t=this.currentPosition,e=this.readLine();return this.currentPosition=t,e},t.prototype.readWord=function(){for(var t=this.currentPosition;t<this.length;){var e=this.text[t];switch(e){case"\r":case"\n":var i=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t+1,"\r"===e&&this.currentPosition<this.length&&"\n"===this.text[this.currentPosition]&&this.currentPosition++,i;case" ":case"\t":t===this.currentPosition&&t++;var r=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,r}t++}if(t>this.currentPosition){var n=this.text.substr(this.currentPosition,t-this.currentPosition);return this.currentPosition=t,n}return null},t.prototype.peekWord=function(){var t=this.currentPosition,e=this.readWord();return this.currentPosition=t,e},t.prototype.read=function(t){if(void 0===t){var e="0";return this.end||(e=this.text[this.currentPosition],this.currentPosition++),e}for(var i=0,r="";!this.end&&i<t;)r+=e=this.read(),i++;return r},t.prototype.peek=function(){var t="0";return this.end||(t=this.text[this.currentPosition]),t},t.prototype.close=function(){this.text=null},t.prototype.readToEnd=function(){var t;return t=0===this.currentPosition?this.text:this.text.substr(this.length,this.currentPosition),this.currentPosition=this.length,t},t.contains=function(t,e){for(var i=!1,r=0;r<t.length;r++)if(t[r]===e){i=!0;break}return i},t.whiteSpace=" ",t.tab="\t",t.spaces=[t.whiteSpace,t.tab],t.whiteSpacePattern="^[ \t]+$",t}(),I=function(){function e(){this.isOverloadWithPosition=!1}return e.prototype.layout=function(t,e,i,r,n,o,s){if(r instanceof k){this.initialize(t,e,i,r,n),this.isOverloadWithPosition=o,this.clientSize=s;a=this.doLayout();return this.clear(),a}this.initialize(t,e,i,r),this.isOverloadWithPosition=n,this.clientSize=o;var a=this.doLayout();return this.clear(),a},e.prototype.initialize=function(t,e,i,r,n){if("number"==typeof n){if(null==t)throw new Error("ArgumentNullException:text");if(null==e)throw new Error("ArgumentNullException:font");this.text=t,this.font=e,this.format=i,this.size=new j(r.width,r.height),this.rectangle=r,this.pageHeight=n,this.reader=new M(t)}else this.initialize(t,e,i,new k(new T(0,0),r),0)},e.prototype.clear=function(){this.font=null,this.format=null,this.reader.close(),this.reader=null,this.text=null},e.prototype.doLayout=function(){for(var t=new F,e=new F,i=[],r=this.reader.peekLine(),n=this.getLineIndent(!0);null!=r;){if(null!==(e=this.layoutLine(r,n))||void 0!==e){var o=0,s=this.copyToResult(t,e,i,o),a=s.success;if(o=s.numInserted,!a){this.reader.read(o);break}}this.reader.readLine(),r=this.reader.peekLine(),n=this.getLineIndent(!1)}return this.finalizeResult(t,i),t},e.prototype.getLineIndent=function(t){var e=0;return null!=this.format&&(e=t?this.format.firstLineIndent:this.format.paragraphIndent,e=this.size.width>0?Math.min(this.size.width,e):e),e},e.prototype.getLineHeight=function(){var t=this.font.height;return null!=this.format&&0!==this.format.lineSpacing&&(t=this.format.lineSpacing+this.font.height),t},e.prototype.getLineWidth=function(t){return this.font.getLineWidth(t,this.format)},e.prototype.layoutLine=function(e,i){var r=new F;r.layoutLineHeight=this.getLineHeight();var n=[],o=this.size.width,s=this.getLineWidth(e)+i,a=t.LineType.FirstParagraphLine,h=!0;if(o<=0||Math.round(s)<=Math.round(o))this.addToLineResult(r,n,e,s,t.LineType.NewLineBreak|a);else{var l="",u="";s=i;var c=i,p=new M(e),d=p.peekWord();for(d.length!==p.length&&" "===d&&(u+=d,l+=d,p.position+=1,d=p.peekWord());null!=d;){u+=d;var f=this.getLineWidth(u.toString())+c;if(" "===u.toString()&&(u="",f=0),f>o){if(this.getWrapType()===t.PdfWordWrapType.None)break;if(u.length===d.length){if(this.getWrapType()===t.PdfWordWrapType.WordOnly){r.textRemainder=e.substring(p.position);break}if(1===u.length){l+=d;break}h=!1,u="",d=p.peek().toString();continue}this.getLineWidth(d.toString())>o?this.format.wordWrap=t.PdfWordWrapType.Character:void 0!==this.format&&null!==this.format&&(this.format.wordWrap=t.PdfWordWrapType.Word),this.getWrapType()===t.PdfWordWrapType.Character&&h?(h=!1,u="",u+=l.toString(),d=p.peek().toString()):(" "!==(g=l.toString())&&this.addToLineResult(r,n,g,s,t.LineType.LayoutBreak|a),this.isOverloadWithPosition&&(o=this.clientSize.width),u="",l="",s=0,c=0,f=0,a=t.LineType.None,d=h?d:p.peekWord(),h=!0)}else l+=d,s=f,h?(p.readWord(),d=p.peekWord()):(p.read(),d=p.peek().toString())}if(l.length>0){var g=l.toString();this.addToLineResult(r,n,g,s,t.LineType.NewLineBreak|t.LineType.LastParagraphLine)}p.close()}r.layoutLines=[];for(var m=0;m<n.length;m++)r.layoutLines.push(n[m]);return n=[],r},e.prototype.addToLineResult=function(t,e,i,r,n){var o=new E;o.text=i,o.width=r,o.lineType=n,e.push(o);var s=t.actualSize;s.height+=this.getLineHeight(),s.width=Math.max(s.width,r),t.size=s},e.prototype.copyToResult=function(t,e,i,r){var n=!0,o=null!=this.format&&!this.format.lineLimit,s=t.actualSize.height,a=this.size.height;if(this.pageHeight>0&&a+this.rectangle.y>this.pageHeight&&(a=this.rectangle.y-this.pageHeight,a=Math.max(a,-a)),r=0,null!=e.lines)for(var h=0,l=e.lines.length;h<l;h++){var u=s+e.lineHeight;if(!(u<=a||a<=0||o)){n=!1;break}var c=e.lines[h];r+=c.text.length,c=this.trimLine(c,0===i.length),i.push(c);var p=t.actualSize;p.width=Math.max(p.width,c.width),t.size=p,s=u}if(s!=t.size.height){var d=t.actualSize;d.height=s,t.size=d}return{success:n,numInserted:r}},e.prototype.finalizeResult=function(t,e){t.layoutLines=[];for(var i=0;i<e.length;i++)t.layoutLines.push(e[i]);t.layoutLineHeight=this.getLineHeight(),this.reader.end||(t.textRemainder=this.reader.readToEnd()),e=[]},e.prototype.trimLine=function(e,i){var r=e.text,n=e.width;e.lineType,t.LineType.FirstParagraphLine,null==this.format||this.format.rightToLeft;return(r=r.trim()).length!==e.text.length&&(n=this.getLineWidth(r),(e.lineType&t.LineType.FirstParagraphLine)>0&&(n+=this.getLineIndent(i))),e.text=r,e.width=n,e},e.prototype.getWrapType=function(){return null!=this.format?this.format.wordWrap:t.PdfWordWrapType.Word},e}(),F=function(){function t(){}return Object.defineProperty(t.prototype,"remainder",{get:function(){return this.textRemainder},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actualSize",{get:function(){return void 0===this.size&&(this.size=new j(0,0)),this.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lines",{get:function(){return this.layoutLines},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.layoutLineHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return null==this.layoutLines||0===this.layoutLines.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.empty?0:this.layoutLines.length},enumerable:!0,configurable:!0}),t}(),E=function(){function t(){}return Object.defineProperty(t.prototype,"lineType",{get:function(){return this.type},set:function(t){this.type=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.lineWidth},set:function(t){this.lineWidth=t},enumerable:!0,configurable:!0}),t}();!function(t){t[t.None=0]="None",t[t.NewLineBreak=1]="NewLineBreak",t[t.LayoutBreak=2]="LayoutBreak",t[t.FirstParagraphLine=4]="FirstParagraphLine",t[t.LastParagraphLine=8]="LastParagraphLine"}(t.LineType||(t.LineType={}));var G=function(){function e(e,i){this.fontStyle=t.PdfFontStyle.Regular,"number"==typeof e&&void 0===i?this.fontSize=e:(this.fontSize=e,this.setStyle(i))}return Object.defineProperty(e.prototype,"name",{get:function(){return this.metrics.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.fontSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.metrics.getHeight(null)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this.fontStyle},set:function(t){this.fontStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bold",{get:function(){return(this.style&t.PdfFontStyle.Bold)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"italic",{get:function(){return(this.style&t.PdfFontStyle.Italic)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strikeout",{get:function(){return(this.style&t.PdfFontStyle.Strikeout)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{get:function(){return(this.style&t.PdfFontStyle.Underline)>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metrics",{get:function(){return this.fontMetrics},set:function(t){this.fontMetrics=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.pdfFontInternals},enumerable:!0,configurable:!0}),e.prototype.measureString=function(t,e,i,r,n){if("string"==typeof t&&void 0===e)return this.measureString(t,null);if("string"==typeof t&&(e instanceof D||null==e)&&void 0===i&&void 0===r){a=e;return this.measureString(t,a,0,0)}if("string"==typeof t&&(e instanceof D||null==e)&&"number"==typeof i&&"number"==typeof r){a=e;return this.measureString(t,0,a,i,r)}if("string"==typeof t&&"number"==typeof e&&(i instanceof D||null==i)&&"number"==typeof r&&"number"==typeof n){var o=new j(e,0),s=i;return this.measureString(t,o,s,r,n)}if(null==t)throw Error('ArgumentNullException("text")');var a=e,s=i,h=(new I).layout(t,this,s,a,!1,new j(0,0));return r=t.length,n=h.empty?0:h.lines.length,h.actualSize},e.prototype.equalsTo=function(t){return this.equalsToFont(t)},e.prototype.getInternals=function(){return this.pdfFontInternals},e.prototype.setInternals=function(t){if(null==t)throw new Error("ArgumentNullException:internals");this.pdfFontInternals=t},e.prototype.setStyle=function(t){this.fontStyle=t},e.prototype.applyFormatSettings=function(t,e,i){var r=i;if(null!=e&&i>0&&(0!==e.characterSpacing&&(r+=(t.length-1)*e.characterSpacing),0!==e.wordSpacing)){var n=M.spaces;r+=M.getCharsCount(t,n)*e.wordSpacing}return r},e.charSizeMultiplier=.001,e.syncObject=new Object,e}(),z=function(){function t(t){this.streamWriter=t}return Object.defineProperty(t.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.streamWriter.buffer.size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stream",{get:function(){return this.streamWriter},enumerable:!0,configurable:!0}),t.prototype.write=function(t){var e=t;this.streamWriter.write(e)},t}();!function(t){t[t.None=0]="None",t[t.Registered=1]="Registered"}(t.ObjectStatus||(t.ObjectStatus={}));var W=function(){function e(){this.objectCollections=[],this.mainObjectCollection=new n,this.primitiveObjectCollection=new n}return Object.defineProperty(e.prototype,"count",{get:function(){return this.objectCollections.length},enumerable:!0,configurable:!0}),e.prototype.items=function(t){return this.objectCollections[t]},Object.defineProperty(e.prototype,"outIsNew",{get:function(){return this.isNew},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var i=new H(e);this.objectCollections.push(i),this.primitiveObjectCollection.containsKey(e)||this.primitiveObjectCollection.setValue(e,this.objectCollections.length-1),e.position=this.index=this.objectCollections.length-1,e.status=t.ObjectStatus.Registered},e.prototype.lookFor=function(t){var e=-1;if(-1!==t.position)return t.position;if(this.primitiveObjectCollection.containsKey(t)&&this.count===this.primitiveObjectCollection.size())e=this.primitiveObjectCollection.getValue(t);else for(var i=this.count-1;i>=0;i--)if(this.objectCollections[i].object===t){e=i;break}return e},e.prototype.getReference=function(t,e){this.index=this.lookFor(t);return this.isNew=!1,{reference:this.objectCollections[this.index].reference,wasNew:e}},e.prototype.trySetReference=function(t,e,i){return!0,this.index=this.lookFor(t),this.objectCollections[this.index].setReference(e),!0},e.prototype.destroy=function(){for(var t=0,e=this.objectCollections;t<e.length;t++){var i=e[t];void 0!==i&&(i.pdfObject.position=-1,i.pdfObject.isSaving=void 0,i.pdfObject.objectCollectionIndex=void 0,i.pdfObject.position=void 0)}this.objectCollections=[],this.mainObjectCollection=new n,this.primitiveObjectCollection=new n},e}(),H=function(){function t(t,e){this.pdfObject=t,this.pdfReference=e}return Object.defineProperty(t.prototype,"object",{get:function(){return this.pdfObject},set:function(t){this.pdfObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.pdfReference},enumerable:!0,configurable:!0}),t.prototype.setReference=function(t){this.pdfReference=t},t}(),_=function(){function t(t){this.isStreamCopied=!1,t instanceof Ce&&(this.document=t)}return Object.defineProperty(t.prototype,"pdfObjects",{get:function(){return this.objects},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"crossTable",{get:function(){return this.pdfCrossTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentSavingObj",{get:function(){return this.currentSavingObject},set:function(t){this.currentSavingObject=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"catalog",{get:function(){return this.pdfCatalog},set:function(t){this.pdfCatalog=t},enumerable:!0,configurable:!0}),t.prototype.setMainObjectCollection=function(t){this.objects=t},t.prototype.setCrossTable=function(t){this.pdfCrossTable=t},t.prototype.setCatalog=function(t){this.pdfCatalog=t},t.prototype.save=function(t){var e=this,r=new i.Encoding(!0),n=new i.StreamWriter(r);if(void 0===t){var o=new i.Encoding(!0),s=new i.StreamWriter(o);return new Promise(function(t,i){var r={};r.blobData=new Blob([e.document.docSave(s,!0)],{type:"application/pdf"}),t(r)})}this.document.docSave(n,t,!0)},t.prototype.clone=function(){return this.document},t}();!function(t){t[t.Free=0]="Free",t[t.Normal=1]="Normal",t[t.Packed=2]="Packed"}(t.ObjectType||(t.ObjectType={}));var K=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),U=function(t){function e(){var e=t.call(this)||this;return e.sections=null,e.tempDictionaryProperties=new a,e.items.setValue((new a).type,new o("Catalog")),e}return K(e,t),Object.defineProperty(e.prototype,"pages",{get:function(){return this.sections},set:function(t){t.element;this.sections=t,this.items.setValue(this.tempDictionaryProperties.pages,new C(t))},enumerable:!0,configurable:!0}),e}(h),q=function(){function e(){this.objects=new n,this.maxGenNumIndex=0,this.objectCount=0,this.dictionaryProperties=new a}return Object.defineProperty(e.prototype,"isMerging",{get:function(){return this.merging},set:function(t){this.merging=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trailer",{get:function(){return null==this.internalTrailer&&(this.internalTrailer=new b),this.internalTrailer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t,this.items=this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pdfObjects",{get:function(){return this.items},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"objectCollection",{get:function(){return this.pdfDocument.pdfObjects},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this.objectCount},set:function(t){this.objectCount=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextObjNumber",{get:function(){return this.count=this.count+1,this.count},enumerable:!0,configurable:!0}),e.prototype.save=function(t,e){this.saveHead(t),this.mappedReferences=null,this.objects.clear(),this.markTrailerReferences(),this.saveObjects(t);var i=this.count,r=t.position;this.registerObject(0,new v(0,-1),!0);t.write(s.xref),t.write(s.newLine),this.saveSections(t),this.saveTrailer(t,this.count,0),this.saveTheEndess(t,r),this.count=i;for(var n=0;n<this.objectCollection.count;++n)this.objectCollection.items(n).object.isSaving=!1;if(void 0===e)return t.stream.buffer;t.stream.save(e)},e.prototype.saveTheEndess=function(t,e){t.write(s.newLine+s.startxref+s.newLine),t.write(e.toString()+s.newLine),t.write(s.eof+s.newLine)},e.prototype.saveTrailer=function(t,e,i){t.write(s.trailer+s.newLine);var r=this.trailer;r.items.setValue(this.dictionaryProperties.size,new g(this.objectCount+1)),(r=new h(r)).setEncrypt(!1),r.save(t)},e.prototype.saveSections=function(t){var e=0,i=0;do{i=this.prepareSubsection(e),this.saveSubsection(t,e,i),e+=i}while(0!==i)},e.prototype.saveSubsection=function(e,i,r){if(!(r<=0||i>=this.count)){e.write(i+" "+(r+1)+s.newLine);for(var n=i;n<=i+r;++n){var o=this.objects.getValue(n),a="";a=o.type===t.ObjectType.Free?this.getItem(o.offset,65535,!0):this.getItem(o.offset,o.generation,!1),e.write(a)}}},e.prototype.getItem=function(t,e,i){var r="",n=10-t.toString().length;e<=0&&(e=0);for(var o=5-e.toString().length<=0?0:5-e.toString().length,a=0;a<n;a++)r+="0";r=r+t.toString()+" ";for(a=0;a<o;a++)r+="0";return r=r+e.toString()+" ",r=r+(i?s.f:s.n)+s.newLine},e.prototype.prepareSubsection=function(t){for(var e,i=0,r=this.count,n=0;n<this.document.pdfObjects.count;n++)this.document.pdfObjects.items(n).reference.toString().split(" ");if(t>=r)return i;for(e=t;e<r;++e)break;for(t=e;e<r;++e)++i;return i},e.prototype.markTrailerReferences=function(){this.trailer.items.keys(),this.trailer.items.values()},e.prototype.saveHead=function(t){var e=this.generateFileVersion(t.document);t.write("%PDF-"+e),t.write(s.newLine)},e.prototype.generateFileVersion=function(t){return"1."+4..toString()},e.prototype.getReference=function(t,e){if(void 0===e){return this.getReference(t,!1)}return this.getSubReference(t,e)},e.prototype.getSubReference=function(e,i){var r,n=!1,o=null;if(this.items.count>0&&e.objectCollectionIndex>0&&this.items.count>e.objectCollectionIndex-1){var s=this.document.pdfObjects.getReference(e,r);o=s.reference,r=s.wasNew}if(r=null==o&&e.status!==t.ObjectStatus.Registered,null==o){var a=this.nextObjNumber;o=new v(a,0);if(r){this.document.pdfObjects.add(e),this.document.pdfObjects.trySetReference(e,o,void 0);var h=this.document.pdfObjects.count-1,l=this.document.pdfObjects.objectCollections[h].reference.objNumber,u=this.document.pdfObjects.objectCollections[this.document.pdfObjects.count-1];this.document.pdfObjects.mainObjectCollection.setValue(l,u),e.position=-1}else this.document.pdfObjects.trySetReference(e,o,void 0);e.objectCollectionIndex=o.objNumber,e.status=t.ObjectStatus.None,n=!0}return n||this.bForceNew,o},e.prototype.saveObjects=function(t){for(var e=this.objectCollection,i=0;i<e.count;++i){var r=e.items(i).object;r.isSaving=!0,this.saveIndirectObject(r,t)}},e.prototype.saveIndirectObject=function(t,e){var i=this.getReference(t);t instanceof U&&this.trailer.items.setValue(this.dictionaryProperties.root,i),this.pdfDocument.currentSavingObj=i;t.getArchive(),this.registerObject(e.position,i),this.doSaveObject(t,i,e)},e.prototype.doSaveObject=function(t,e,i){i.length;i.write(e.objNumber.toString()),i.write(s.whiteSpace),i.write(e.genNumber.toString()),i.write(s.whiteSpace),i.write(s.obj),i.write(s.newLine),t.save(i);i.stream;i.write(s.endObj),i.write(s.newLine)},e.prototype.registerObject=function(t,e,i){"boolean"==typeof i?(this.objects.setValue(e.objNumber,new Y(t,e,i)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber)):void 0===i&&(this.objects.setValue(e.objNumber,new Y(t,e)),this.maxGenNumIndex=Math.max(this.maxGenNumIndex,e.genNumber))},e.dereference=function(t){var e=t;return null!=e&&(t=e.object),t},e}(),Y=function(){function e(e,i,r){var n=e;this.offsetNumber=n;var o=i;this.generation=o.genNumber,this.object=o.objNumber,this.type=void 0===r?t.ObjectType.Normal:t.ObjectType.Free}return Object.defineProperty(e.prototype,"objectNumber",{get:function(){return this.object},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offset",{get:function(){return this.offsetNumber},enumerable:!0,configurable:!0}),e}(),X=function(){function t(){}return t.letter=new j(612,792),t.note=new j(540,720),t.legal=new j(612,1008),t.a0=new j(2380,3368),t.a1=new j(1684,2380),t.a2=new j(1190,1684),t.a3=new j(842,1190),t.a4=new j(595,842),t.a5=new j(421,595),t.a6=new j(297,421),t.a7=new j(210,297),t.a8=new j(148,210),t.a9=new j(105,148),t.a10=new j(74,105),t.b0=new j(2836,4008),t.b1=new j(2004,2836),t.b2=new j(1418,2004),t.b3=new j(1002,1418),t.b4=new j(709,1002),t.b5=new j(501,709),t.archE=new j(2592,3456),t.archD=new j(1728,2592),t.archC=new j(1296,1728),t.archB=new j(864,1296),t.archA=new j(648,864),t.flsa=new j(612,936),t.halfLetter=new j(396,612),t.letter11x17=new j(792,1224),t.ledger=new j(1224,792),t}();!function(t){t[t.Portrait=0]="Portrait",t[t.Landscape=1]="Landscape"}(t.PdfPageOrientation||(t.PdfPageOrientation={})),function(t){t[t.RotateAngle0=0]="RotateAngle0",t[t.RotateAngle90=1]="RotateAngle90",t[t.RotateAngle180=2]="RotateAngle180",t[t.RotateAngle270=3]="RotateAngle270"}(t.PdfPageRotateAngle||(t.PdfPageRotateAngle={})),function(t){t[t.None=0]="None",t[t.Numeric=1]="Numeric",t[t.LowerLatin=2]="LowerLatin",t[t.LowerRoman=3]="LowerRoman",t[t.UpperLatin=4]="UpperLatin",t[t.UpperRoman=5]="UpperRoman"}(t.PdfNumberStyle||(t.PdfNumberStyle={})),function(t){t[t.None=0]="None",t[t.Bottom=1]="Bottom",t[t.Top=2]="Top",t[t.Left=3]="Left",t[t.Right=4]="Right",t[t.Fill=5]="Fill"}(t.PdfDockStyle||(t.PdfDockStyle={})),function(t){t[t.None=0]="None",t[t.TopLeft=1]="TopLeft",t[t.TopCenter=2]="TopCenter",t[t.TopRight=3]="TopRight",t[t.MiddleLeft=4]="MiddleLeft",t[t.MiddleCenter=5]="MiddleCenter",t[t.MiddleRight=6]="MiddleRight",t[t.BottomLeft=7]="BottomLeft",t[t.BottomCenter=8]="BottomCenter",t[t.BottomRight=9]="BottomRight"}(t.PdfAlignmentStyle||(t.PdfAlignmentStyle={})),function(t){t[t.None=0]="None",t[t.Top=1]="Top",t[t.Bottom=2]="Bottom",t[t.Left=3]="Left",t[t.Right=4]="Right"}(t.TemplateType||(t.TemplateType={}));var J=function(){function t(){this.pdfMargin=40,this.setMargins(this.pdfMargin)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.leftMargin},set:function(t){this.leftMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.topMargin},set:function(t){this.topMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.rightMargin},set:function(t){this.rightMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.bottomMargin},set:function(t){this.bottomMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"all",{set:function(t){this.setMargins(t)},enumerable:!0,configurable:!0}),t.prototype.setMargins=function(t,e,i,r){void 0===e?this.leftMargin=this.topMargin=this.rightMargin=this.bottomMargin=t:void 0===i?(this.leftMargin=this.rightMargin=t,this.bottomMargin=this.topMargin=e):(this.leftMargin=t,this.topMargin=e,this.rightMargin=i,this.bottomMargin=r)},t.prototype.clone=function(){return this},t}(),Z=function(){function e(e){this.pageMargins=new J,this.pageSize=X.a4,this.rotateAngle=t.PdfPageRotateAngle.RotateAngle0,this.pageOrientation=t.PdfPageOrientation.Portrait,this.pageOrigin=new T(0,0),this.isRotation=!1,"number"==typeof e&&this.pageMargins.setMargins(e)}return Object.defineProperty(e.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.setSize(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation!==t&&(this.pageOrientation=t,this.updateSize(t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"margins",{get:function(){return this.pageMargins},set:function(t){this.pageMargins=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.pageSize.width},set:function(t){this.pageSize.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.pageSize.height},set:function(t){this.pageSize.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this.rotateAngle},set:function(t){this.rotateAngle=t,this.isRotation=!0},enumerable:!0,configurable:!0}),e.prototype.updateSize=function(e){var i=Math.min(this.pageSize.width,this.pageSize.height),r=Math.max(this.pageSize.width,this.pageSize.height);switch(e){case t.PdfPageOrientation.Portrait:this.pageSize=new j(i,r);break;case t.PdfPageOrientation.Landscape:this.pageSize=new j(r,i)}},e.prototype.clone=function(){var t=this;return t.pageMargins=this.pageMargins.clone(),t},e.prototype.getActualSize=function(){var t=this.width-(this.margins.left+this.margins.right),e=this.height-(this.margins.top+this.margins.bottom);return new j(t,e)},e.prototype.setSize=function(e){var i=Math.min(e.width,e.height),r=Math.max(e.width,e.height);this.orientation===t.PdfPageOrientation.Portrait?this.pageSize=new j(i,r):this.pageSize=new j(r,i)},e}(),$=function(){function t(t){if(null==t)throw new Error("ArgumentNullException:stream");this.stream=t}return t.prototype.clear=function(){this.stream.clearStream()},t.prototype.setGraphicsState=function(t){t instanceof o?(this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setGraphicsState)):(this.stream.write(s.slash),this.stream.write(t),this.stream.write(s.whiteSpace),this.writeOperator(s.setGraphicsState))},t.prototype.executeObject=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.paintXObject),this.stream.write(s.newLine)},t.prototype.closePath=function(){this.writeOperator(s.closePath)},t.prototype.clipPath=function(t){this.stream.write(s.clipPath),t&&this.stream.write(s.evenOdd),this.stream.write(s.whiteSpace),this.stream.write(s.endPath),this.stream.write(s.newLine)},t.prototype.closeFillStrokePath=function(t){this.stream.write(s.closeFillStrokePath),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.fillStrokePath=function(t){this.stream.write(s.fillStroke),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.fillPath=function(t){this.stream.write(s.fill),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.endPath=function(){this.writeOperator(s.n)},t.prototype.closeFillPath=function(t){this.writeOperator(s.closePath),this.stream.write(s.fill),t?(this.stream.write(s.evenOdd),this.stream.write(s.newLine)):this.stream.write(s.newLine)},t.prototype.closeStrokePath=function(){this.writeOperator(s.closeStrokePath)},t.prototype.setTextScaling=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setTextScaling)},t.prototype.strokePath=function(){this.writeOperator(s.stroke)},t.prototype.restoreGraphicsState=function(){this.writeOperator(s.restoreState)},t.prototype.saveGraphicsState=function(){this.writeOperator(s.saveState)},t.prototype.startNextLine=function(t,e){void 0===t?this.writeOperator(s.goToNextLine):t instanceof T?(this.writePoint(t),this.writeOperator(s.setCoords)):(this.writePoint(t,e),this.writeOperator(s.setCoords))},t.prototype.showText=function(t){this.checkTextParam(t),this.writeText(t),this.writeOperator(s.setText)},t.prototype.setLeading=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setTextLeading)},t.prototype.beginPath=function(t,e){this.writePoint(t,e),this.writeOperator(s.beginPath)},t.prototype.beginText=function(){this.writeOperator(s.beginText)},t.prototype.endText=function(){this.writeOperator(s.endText)},t.prototype.appendRectangle=function(t,e,i,r){t instanceof k?this.appendRectangle(t.x,t.y,t.width,t.height):(this.writePoint(t,e),this.writePoint(i,r),this.writeOperator(s.appendRectangle))},t.prototype.appendLineSegment=function(t,e){t instanceof T?this.appendLineSegment(t.x,t.y):(this.writePoint(t,e),this.writeOperator(s.appendLineSegment))},t.prototype.setTextRenderingMode=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setRenderingMode)},t.prototype.setCharacterSpacing=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.stream.write(s.setCharacterSpace),this.stream.write(s.newLine)},t.prototype.setWordSpacing=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setWordSpace)},t.prototype.showNextLineText=function(t,e){t instanceof P?(this.checkTextParam(t),this.writeText(t),this.writeOperator(s.setTextOnNewLine)):(this.checkTextParam(t),this.writeText(t,e),this.writeOperator(s.setTextOnNewLine))},t.prototype.setColorSpace=function(t,e){if(t instanceof o&&"boolean"==typeof e){var i=t,r=(n=e)?s.selectcolorspaceforstroking:s.selectcolorspacefornonstroking;this.stream.write(i.toString()),this.stream.write(s.whiteSpace),this.stream.write(r),this.stream.write(s.newLine)}else{var i=t,n=e;this.setColorSpace(new o(i),n)}},t.prototype.modifyCtm=function(t){if(null==t)throw new Error("ArgumentNullException:matrix");this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.modifyCtm)},t.prototype.setFont=function(t,e,i){if("string"==typeof e)this.setFont(t,new o(e),i);else{if(null==t)throw new Error("ArgumentNullException:font");this.stream.write(e.toString()),this.stream.write(s.whiteSpace),this.stream.write(g.floatToString(i)),this.stream.write(s.whiteSpace),this.writeOperator(s.setFont)}},t.prototype.writeOperator=function(t){this.stream.write(t),this.stream.write(s.newLine)},t.prototype.checkTextParam=function(t){if(null==t)throw new Error("ArgumentNullException:text");if("string"==typeof t&&""===t)throw new Error("ArgumentException:The text can not be an empty string, text")},t.prototype.writeText=function(t,e){if(t instanceof P&&void 0===e)this.stream.write(t.pdfEncode());else{var i=void 0,r=void 0;e?(i=P.hexStringMark[0],r=P.hexStringMark[1]):(i=P.stringMark[0],r=P.stringMark[1]),this.stream.write(i),this.stream.write(t),this.stream.write(r)}},t.prototype.writePoint=function(t,e){if(t instanceof T&&void 0===e)this.writePoint(t.x,t.y);else{var i=t;this.stream.write(g.floatToString(i)),this.stream.write(s.whiteSpace),e=this.updateY(e),this.stream.write(g.floatToString(e)),this.stream.write(s.whiteSpace)}},t.prototype.updateY=function(t){return-t},t.prototype.write=function(t){var e="";e+=t,e+=s.newLine,this.writeOperator(e)},t.prototype.writeComment=function(t){if(!(null!=t&&t.length>0))throw new Error("Invalid comment");var e="";e+=s.comment,e+=s.whiteSpace,e+=t,this.writeOperator(e)},t.prototype.setColorAndSpace=function(t,e,i){t.isEmpty||(this.stream.write(t.toString(e,i)),this.stream.write(s.newLine))},t.prototype.setLineDashPattern=function(t,e){this.setLineDashPatternHelper(t,e)},t.prototype.setLineDashPatternHelper=function(t,e){var i="[";if(t.length>1)for(var r=0;r<t.length;r++)r===t.length-1?i+=t[r].toString():i+=t[r].toString()+" ";i+="] ",i+=e.toString(),i+=" "+s.setDashPattern,this.stream.write(i),this.stream.write(s.newLine)},t.prototype.setMiterLimit=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setMiterLimit)},t.prototype.setLineWidth=function(t){this.stream.write(g.floatToString(t)),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineWidth)},t.prototype.setLineCap=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineCapStyle)},t.prototype.setLineJoin=function(t){this.stream.write(t.toString()),this.stream.write(s.whiteSpace),this.writeOperator(s.setLineJoinStyle)},Object.defineProperty(t.prototype,"position",{get:function(){return this.stream.position},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){var t=0;if(0!==this.stream.data.length&&-1!==this.stream.data.length)for(var e=0;e<this.stream.data.length;e++)t+=this.stream.data[e].length;return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.appendBezierSegment=function(t,e,i,r,n,o){t instanceof T&&e instanceof T&&i instanceof T?(this.writePoint(t.x,t.y),this.writePoint(e.x,e.y),this.writePoint(i.x,i.y)):(this.writePoint(t,e),this.writePoint(i,r),this.writePoint(n,o)),this.writeOperator(s.appendbeziercurve)},t.prototype.setColourWithPattern=function(t,e,i){if(null!=t){var r=t.length,n=0;for(n=0;n<r;++n)this.stream.write(t[n].toString()),this.stream.write(s.whiteSpace)}null!=e&&(this.stream.write(e.toString()),this.stream.write(s.whiteSpace)),i?this.writeOperator(s.setColorAndPatternStroking):this.writeOperator(s.setColorAndPattern)},t}(),Q=function(){function e(e,i){this.pdfColor=new L(0,0,0),this.dashOffsetValue=0,this.penDashPattern=[0],this.pdfDashStyle=t.PdfDashStyle.Solid,this.pdfLineCap=0,this.pdfLineJoin=0,this.penWidth=1,this.internalMiterLimit=0,this.colorSpace=t.PdfColorSpace.Rgb,e instanceof R?this.setBrush(e):e instanceof L&&(this.color=e),"number"==typeof i&&(this.width=i)}return Object.defineProperty(e.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashOffset",{get:function(){return void 0===this.dashOffsetValue||null==this.dashOffsetValue?0:this.dashOffsetValue},set:function(t){this.dashOffsetValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashPattern",{get:function(){return this.penDashPattern},set:function(t){this.penDashPattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashStyle",{get:function(){return this.pdfDashStyle},set:function(e){if(this.pdfDashStyle!==e)switch(this.pdfDashStyle=e,this.pdfDashStyle){case t.PdfDashStyle.Custom:break;case t.PdfDashStyle.Dash:this.penDashPattern=[3,1];break;case t.PdfDashStyle.Dot:this.penDashPattern=[1,1];break;case t.PdfDashStyle.DashDot:this.penDashPattern=[3,1,1,1];break;case t.PdfDashStyle.DashDotDot:this.penDashPattern=[3,1,1,1,1,1];break;case t.PdfDashStyle.Solid:break;default:this.pdfDashStyle=t.PdfDashStyle.Solid,this.penDashPattern=[0]}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineCap",{get:function(){return this.pdfLineCap},set:function(t){this.pdfLineCap=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineJoin",{get:function(){return this.pdfLineJoin},set:function(t){this.pdfLineJoin=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"miterLimit",{get:function(){return this.internalMiterLimit},set:function(t){this.internalMiterLimit=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.penWidth},set:function(t){this.penWidth=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return this},e.prototype.setBrush=function(t){var e=t;null!=e&&e instanceof A&&(this.color=e.color,this.pdfBrush=e),this.color=e.color,this.pdfBrush=e},e.prototype.monitorChanges=function(t,e,i,r,n,o){r=!0,this.dashControl(t,r,e),e.setLineWidth(this.width),e.setLineJoin(this.lineJoin),e.setLineCap(this.lineCap);var s=this.miterLimit;s>0&&e.setMiterLimit(s);this.pdfBrush;return e.setColorAndSpace(this.color,n,!0),!0},e.prototype.dashControl=function(t,e,i){e=!0;var r=this.width,n=this.getPattern();return i.setLineDashPattern(n,this.dashOffset*r),e},e.prototype.getPattern=function(){for(var t=this.dashPattern,e=0;e<t.length;++e)t[e]*=this.width;return t},e}(),tt=function(){function t(t){this.radDegFactor=180/Math.PI,this.transformationMatrix=void 0===t?new et(1,0,0,1,0,0):new et(1,0,0,-1,0,0)}return Object.defineProperty(t.prototype,"matrix",{get:function(){return this.transformationMatrix},set:function(t){this.transformationMatrix=t},enumerable:!0,configurable:!0}),t.prototype.translate=function(t,e){this.transformationMatrix.translate(t,e)},t.prototype.scale=function(t,e){this.transformationMatrix.elements[0]=t,this.transformationMatrix.elements[3]=e},t.prototype.rotate=function(t){t=t*Math.PI/180,this.transformationMatrix.elements[0]=Math.cos(t),this.transformationMatrix.elements[1]=Math.sin(t),this.transformationMatrix.elements[2]=-Math.sin(t),this.transformationMatrix.elements[3]=Math.cos(t)},t.prototype.toString=function(){for(var t="",e=0,i=this.transformationMatrix.elements.length;e<i;e++){this.matrix.elements[e];t+=g.floatToString(this.transformationMatrix.elements[e]),t+=" "}return t},t.prototype.multiply=function(t){this.transformationMatrix.multiply(t.matrix)},t.degreesToRadians=function(t){return this.degRadFactor*t},t.prototype.radiansToDegrees=function(t){return this.radDegFactor*t},t.prototype.clone=function(){return this},t.degRadFactor=Math.PI/180,t}(),et=function(){function t(t,e,i,r,n,o){void 0===t?this.metrixElements=[]:"number"==typeof t?(this.metrixElements=[],this.metrixElements.push(t),this.metrixElements.push(e),this.metrixElements.push(i),this.metrixElements.push(r),this.metrixElements.push(n),this.metrixElements.push(o)):this.metrixElements=t}return Object.defineProperty(t.prototype,"elements",{get:function(){return this.metrixElements},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){return this.metrixElements[4]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return this.metrixElements[5]},enumerable:!0,configurable:!0}),t.prototype.translate=function(t,e){this.metrixElements[4]=t,this.metrixElements[5]=e},t.prototype.transform=function(t){var e=t.x,i=t.y,r=e*this.elements[0]+i*this.elements[2]+this.offsetX,n=e*this.elements[1]+i*this.elements[3]+this.offsetY;return new T(r,n)},t.prototype.multiply=function(t){var e=[];e.push(this.elements[0]*t.elements[0]+this.elements[1]*t.elements[2]),e[1]=this.elements[0]*t.elements[1]+this.elements[1]*t.elements[3],e[2]=this.elements[2]*t.elements[0]+this.elements[3]*t.elements[2],e[3]=this.elements[2]*t.elements[1]+this.elements[3]*t.elements[3],e[4]=this.offsetX*t.elements[0]+this.offsetY*t.elements[2]+t.offsetX,e[5]=this.offsetX*t.elements[1]+this.offsetY*t.elements[3]+t.offsetY;for(var i=0;i<e.length;i++)this.elements[i]=e[i]},t.prototype.dispose=function(){this.metrixElements=null},t.prototype.clone=function(){return new t(this.metrixElements)},t}(),it=function(){function t(){this.pdf="PDF",this.text="Text",this.imageB="ImageB",this.imageC="ImageC",this.imageI="ImageI"}return t}(),rt=function(){function t(){this.mKeys=[],this.mValues=[]}return t.prototype.size=function(){return this.mKeys.length},t.prototype.add=function(t,e){if(void 0===t||null===t||void 0===e||null===e)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(t)<0)return this.mKeys.push(t),this.mValues.push(e),1;throw new RangeError("An item with the same key has already been added.")},t.prototype.keys=function(){return this.mKeys},t.prototype.values=function(){return this.mValues},t.prototype.getValue=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var e=this.mKeys.indexOf(t);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[e]},t.prototype.setValue=function(t,e){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(t);i<0?(this.mKeys.push(t),this.mValues.push(e)):this.mValues[i]=e},t.prototype.remove=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");var e=this.mKeys.indexOf(t);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mKeys.splice(e,1),this.mValues.splice(e,1),!0},t.prototype.containsKey=function(t){if(void 0===t||null===t)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(t)<0)},t.prototype.clear=function(){this.mKeys=[],this.mValues=[]},t}(),nt=function(){function t(t,e,i){this.dictionary=new h,this.dictionaryProperties=new a,this.dictionary.items.setValue(this.dictionaryProperties.CA,new g(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new g(e)),this.dictionary.items.setValue(this.dictionaryProperties.BM,new o(i.toString()))}return Object.defineProperty(t.prototype,"element",{get:function(){return this.dictionary},enumerable:!0,configurable:!0}),t}(),ot=function(){function t(){this.automaticFieldsInformation=[]}return Object.defineProperty(t.prototype,"automaticFields",{get:function(){return this.automaticFieldsInformation},enumerable:!0,configurable:!0}),t.prototype.add=function(t){return this.automaticFields.push(t)},t}(),st=function(){function t(){}return t.prototype.drawHelper=function(t,e,i){var r=0!==e||0!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},t}(),at=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ht=function(t){function e(){var e=t.call(this)||this;return e.internalBounds=new k(0,0,0,0),e.internalTemplateSize=new j(0,0),e}return at(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.internalBounds},set:function(t){this.internalBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return new j(this.bounds.width,this.bounds.height)},set:function(t){this.bounds.width=t.width,this.bounds.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return new T(this.bounds.x,this.bounds.y)},set:function(t){this.bounds.x=t.x,this.bounds.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.internalFont},set:function(t){this.internalFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.internalBrush},set:function(t){this.internalBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pen",{get:function(){return this.internalPen},set:function(t){this.internalPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.internalStringFormat},set:function(t){this.internalStringFormat=t},enumerable:!0,configurable:!0}),e.prototype.performDrawHelper=function(t,e,i,r){if(0===this.bounds.height||0===this.bounds.width){var n=this.getValue(t);this.internalTemplateSize=this.getFont().measureString(n,this.size,this.stringFormat)}},e.prototype.draw=function(t,e,i){if(void 0===e){var r=new T(0,0);this.draw(t,r)}else if(e instanceof T)this.draw(t,e.x,e.y);else{this.drawHelper(t,e,i);var n=new lt(this,new T(e,i));t.automaticFields.add(n)}},e.prototype.getSize=function(){return 0===this.bounds.height||0===this.bounds.width?this.internalTemplateSize:this.size},e.prototype.drawInternal=function(t){},e.prototype.getBrush=function(){return void 0===this.internalBrush||null==this.internalBrush?new A(new L(0,0,0)):this.internalBrush},e.prototype.getFont=function(){return void 0===this.internalFont||null==this.internalFont?Ce.defaultFont:this.internalFont},e.prototype.getPageFromGraphics=function(t){if(void 0!==t.page&&null!==t.page)return e=t.page;var e=t.currentPage;return e},e}(st),lt=function(){function t(e,i,r,n){this.pageNumberFieldLocation=new T,this.pageNumberField=null,this.scaleX=1,this.scaleY=1,void 0===i&&e instanceof t?(this.pageNumberField=e.field,this.pageNumberFieldLocation=e.location,this.scaleX=e.scalingX,this.scaleY=e.scalingY):void 0===r&&i instanceof T&&e instanceof ht?(this.pageNumberField=e,this.pageNumberFieldLocation=i):(this.pageNumberField=e,this.pageNumberFieldLocation=i,this.scaleX=r,this.scaleY=n)}return Object.defineProperty(t.prototype,"location",{get:function(){return this.pageNumberFieldLocation},set:function(t){this.pageNumberFieldLocation=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"field",{get:function(){return this.pageNumberField},set:function(t){this.pageNumberField=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scalingX",{get:function(){return this.scaleX},set:function(t){this.scaleX=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scalingY",{get:function(){return this.scaleY},set:function(t){this.scaleY=t},enumerable:!0,configurable:!0}),t}(),ut=function(){function t(t){this.mPosition=0,this.buffer=new Uint8Array(t),this.dataView=new DataView(this.buffer.buffer)}return Object.defineProperty(t.prototype,"position",{get:function(){return this.mPosition},set:function(t){this.mPosition=t},enumerable:!0,configurable:!0}),t.prototype.read=function(t,e,i){for(var r=e;r<i;r++){var n=this.position;t.buffer[r]=this.readByte(n),this.position++}},t.prototype.getBuffer=function(t){return this.buffer[t]},t.prototype.writeFromBase64String=function(t){var e=this.encodedString(t);this.buffer=e},t.prototype.encodedString=function(t){var e,i,r,n,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,h=0,l=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;t.charAt(t.length-1)===s.charAt(64)&&l--;for(var u=new Uint8Array(0|l);a<t.length;)e=s.indexOf(t.charAt(a++))<<2|(n=s.indexOf(t.charAt(a++)))>>4,i=(15&n)<<4|(o=s.indexOf(t.charAt(a++)))>>2,r=(3&o)<<6|s.indexOf(t.charAt(a++)),u[h++]=e,u[h++]=i,u[h++]=r;return u},t.prototype.readByte=function(t){return this.buffer[t]},Object.defineProperty(t.prototype,"internalBuffer",{get:function(){return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.buffer.byteLength},enumerable:!0,configurable:!0}),t.prototype.readNextTwoBytes=function(t){var e=t.readByte(this.position);return this.position++,e<<=8,e|=t.readByte(this.position),this.position++,e},t}(),ct=function(){function t(t){this.currentPosition=-1,this.value=t}return Object.defineProperty(t.prototype,"status",{get:function(){return this.objectStatus},set:function(t){this.objectStatus=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isSaving",{get:function(){return this.saving},set:function(t){this.saving=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"objectCollectionIndex",{get:function(){return this.index},set:function(t){this.index=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.currentPosition},set:function(t){this.currentPosition=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clonedObject",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.save=function(t){t.write(this.boolToStr(this.value))},t.prototype.clone=function(e){return new t(this.value)},t.prototype.boolToStr=function(t){return t?"true":"false"},t}();!function(t){t[t.Unknown=0]="Unknown",t[t.Bmp=1]="Bmp",t[t.Emf=2]="Emf",t[t.Gif=3]="Gif",t[t.Jpeg=4]="Jpeg",t[t.Png=5]="Png",t[t.Wmf=6]="Wmf",t[t.Icon=7]="Icon"}(t.ImageFormat||(t.ImageFormat={}));var pt=function(){function e(e){this.sof1Marker=193,this.sof2Marker=194,this.sof3Marker=195,this.sof5Marker=197,this.sof6Marker=198,this.sof7Marker=199,this.sof9Marker=201,this.sof10Marker=202,this.sof11Marker=203,this.sof13Marker=205,this.sof14Marker=206,this.sof15Marker=207,this.mFormat=t.ImageFormat.Unknown,this.mbitsPerComponent=8,this.dictionaryProperties=new a,this.mStream=e,this.initialize()}return Object.defineProperty(e.prototype,"height",{get:function(){return this.mHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.mWidth},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bitsPerComponent",{get:function(){return this.mbitsPerComponent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.mImageData.count},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageData",{get:function(){return this.mImageData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageDataAsNumberArray",{get:function(){return this.mImageData.internalBuffer.buffer},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.mFormat===t.ImageFormat.Unknown&&this.checkIfJpeg()&&(this.mFormat=t.ImageFormat.Jpeg,this.parseJpegImage()),this.reset(),this.mImageData=new ut(this.mStream.count),this.mStream.read(this.mImageData,0,this.mImageData.count)},e.prototype.reset=function(){this.mStream.position=0},e.prototype.parseJpegImage=function(){this.reset();var t=new ut(this.mStream.count);this.mStream.read(t,0,t.count);for(var e=4,i=!1,r=256*t.getBuffer(e)+t.getBuffer(e+1);e<t.count;){if(!((e+=r)<t.count)){i=!0;break}if(192===t.getBuffer(e+1))return this.mHeight=256*t.getBuffer(e+5)+t.getBuffer(e+6),void(this.mWidth=256*t.getBuffer(e+7)+t.getBuffer(e+8));e+=2,r=256*t.getBuffer(e)+t.getBuffer(e+1)}i&&(this.mStream.position=0,this.skip(this.mStream,2),this.readExceededJPGImage(this.mStream))},Object.defineProperty(e.prototype,"format",{get:function(){return this.mFormat},enumerable:!0,configurable:!0}),e.prototype.checkIfJpeg=function(){this.reset();for(var t=0;t<e.mJpegHeader.length;t++){if(e.mJpegHeader[t]!==this.mStream.readByte(t))return!1;this.mStream.position++}return!0},e.prototype.getImageDictionary=function(){if(this.mFormat===t.ImageFormat.Jpeg){this.imageData.internalBuffer.length;this.imageStream=new b,this.imageStream.isImage=!0;for(var e="",i="",r=0;r<this.imageDataAsNumberArray.byteLength;r++)e+=String.fromCharCode(null,this.mStream.readByte(r));for(r=0;r<e.length;r++)r%2!=0&&(i+=e[r]);return this.imageStream.data=[i],this.imageStream.compress=!1,this.imageStream.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.xObject)),this.imageStream.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.image)),this.imageStream.items.setValue(this.dictionaryProperties.width,new g(this.width)),this.imageStream.items.setValue(this.dictionaryProperties.height,new g(this.height)),this.imageStream.items.setValue(this.dictionaryProperties.bitsPerComponent,new g(this.bitsPerComponent)),this.imageStream.items.setValue(this.dictionaryProperties.filter,new o(this.dictionaryProperties.dctdecode)),this.imageStream.items.setValue(this.dictionaryProperties.colorSpace,new o(this.getColorSpace())),this.imageStream.items.setValue(this.dictionaryProperties.decodeParms,this.getDecodeParams()),this.imageStream}return this.imageStream},e.prototype.getColorSpace=function(){return this.dictionaryProperties.deviceRgb},e.prototype.getDecodeParams=function(){var t=new h;return t.items.setValue(this.dictionaryProperties.columns,new g(this.width)),t.items.setValue(this.dictionaryProperties.blackIs1,new ct(!0)),t.items.setValue(this.dictionaryProperties.k,new g(-1)),t.items.setValue(this.dictionaryProperties.predictor,new g(15)),t.items.setValue(this.dictionaryProperties.bitsPerComponent,new g(this.bitsPerComponent)),t},e.prototype.readExceededJPGImage=function(t){this.mStream=t;for(var e=!0;e;)switch(this.getMarker(t)){case this.sof1Marker:case this.sof2Marker:case this.sof3Marker:case this.sof5Marker:case this.sof6Marker:case this.sof7Marker:case this.sof9Marker:case this.sof10Marker:case this.sof11Marker:case this.sof13Marker:case this.sof14Marker:case this.sof15Marker:t.position+=3,this.mHeight=this.mStream.readNextTwoBytes(t),this.mWidth=this.mStream.readNextTwoBytes(t),e=!1;break;default:this.skipStream(t)}},e.prototype.skip=function(t,e){this.mStream=t;var i=new ut(e);this.mStream.read(i,0,i.count)},e.prototype.getMarker=function(t){var e=32;for(e=t.readByte(this.mStream.position),t.position++;255!==e;)e=t.readByte(this.mStream.position),t.position++;do{e=t.readByte(this.mStream.position),t.position++}while(255===e);return e},e.prototype.skipStream=function(t){var e=this.mStream.readNextTwoBytes(t)-2;e>0&&(t.position+=e)},e.mPngHeader=[137,80,78,71,13,10,26,10],e.mJpegHeader=[255,216],e.GIF_HEADER="G,I,F,8",e.BMP_HEADER="B,M",e}(),dt=function(){function t(t){this.updateProportionsHelper(t)}return t.prototype.convertUnits=function(t,e,i){return this.convertFromPixels(this.convertToPixels(t,e),i)},t.prototype.convertToPixels=function(t,e){var i=e;return t*this.proportions[i]},t.prototype.convertFromPixels=function(t,e){var i=e;return t/this.proportions[i]},t.prototype.updateProportionsHelper=function(t){this.proportions=[t/2.54,t/6,1,t/72,t,t/300,t/25.4]},t.horizontalResolution=96,t.verticalResolution=96,t}(),ft=function(){function e(){}return Object.defineProperty(e.prototype,"width",{get:function(){return this.imageWidth},set:function(t){this.imageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.imageHeight},set:function(t){this.imageHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{set:function(t){this.width=t.width,this.height=t.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"physicalDimension",{get:function(){return this.imagePhysicalDimension=this.getPointSize(this.width,this.height,this.horizontalResolution,this.verticalResolution),new j(this.width,this.height)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.imageStream},enumerable:!0,configurable:!0}),e.prototype.getPointSize=function(e,i,r,n){if(void 0===r){var o=dt.horizontalResolution,s=dt.verticalResolution;return c=this.getPointSize(e,i,o,s)}var a=new dt(r),h=new dt(n),l=a.convertUnits(e,t.PdfGraphicsUnit.Pixel,t.PdfGraphicsUnit.Point),u=h.convertUnits(i,t.PdfGraphicsUnit.Pixel,t.PdfGraphicsUnit.Point),c=new j(l,u);return c},e}(),gt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mt=function(t){function e(e){var i=t.call(this)||this;return i.imageStatus=!0,i.dictionaryProperties=new a,i.loadImage(e),i}return gt(e,t),e.prototype.loadImage=function(t){this.initializeAsync(t)},e.prototype.initializeAsync=function(t){var e=new ut(t.length);e.writeFromBase64String(t),this.decoder=new pt(e),this.height=this.decoder.height,this.width=this.decoder.width,this.bitsPerComponent=this.decoder.bitsPerComponent},e.prototype.save=function(){this.imageStatus=!0,this.imageStream=this.decoder.getImageDictionary()},e}(ft),yt=function(){function t(){}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.offset===this.length&&this.length===this.checksum&&0===this.checksum},enumerable:!0,configurable:!0}),t}(),bt=function(){function t(){}return t}(),wt=function(){function t(){}return t}(),St=function(){function t(){}return t}(),Pt=function(){function t(){}return Object.defineProperty(t.prototype,"isItalic",{get:function(){return 0!=(2&this.macStyle)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBold",{get:function(){return 0!=(1&this.macStyle)},enumerable:!0,configurable:!0}),t}(),vt=function(){function t(){}return t}(),Ct=function(){function t(){}return t}(),Bt=function(){function t(){}return t}(),Ot=function(){function t(){}return t}(),xt=function(){function t(){}return t}(),Lt=function(){function t(){}return t}(),Tt=function(){function t(){}return Object.defineProperty(t.prototype,"empty",{get:function(){return this.index===this.width&&this.width===this.charCode&&0===this.charCode},enumerable:!0,configurable:!0}),t.prototype.compareTo=function(t){var e=t;return this.index-e.index},t}(),jt=function(){function t(){}return t}(),kt=function(){function t(){}return t}(),Vt=function(){function t(){}return t}(),Rt=function(){function t(){}return t}(),Nt=function(){function t(){}return t}(),At=function(){function t(t){this.int32Size=4,this.int16Size=2,this.int64Size=8,this.bufferLength=t,this.buffer=[]}return Object.defineProperty(t.prototype,"data",{get:function(){if(this.buffer.length<this.bufferLength)for(var t=this.bufferLength-this.buffer.length,e=0;e<t;e++)this.buffer.push(0);return this.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return void 0!==this.internalPosition&&null!==this.internalPosition||(this.internalPosition=0),this.internalPosition},enumerable:!0,configurable:!0}),t.prototype.writeShort=function(t){var e=[(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeInt=function(t){var e=[(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeUInt=function(t){var e=[(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t];this.flush(e)},t.prototype.writeString=function(t){if(null==t)throw new Error("Argument Null Exception : value");for(var e=[],i=0;i<t.length;i++)e.push(t.charCodeAt(i));this.flush(e)},t.prototype.writeBytes=function(t){this.flush(t)},t.prototype.flush=function(t){if(null===t)throw new Error("Argument Null Exception : buff");for(var e=this.position,i=0;i<t.length;i++)this.buffer[e]=t[i],e++;this.internalPosition+=t.length},t}(),Dt=function(){function e(t){this.int32Size=4,this.isTtcFont=!1,this.isMacTtf=!1,this.metricsName="",this.isMacTTF=!1,this.missedGlyphs=0,this.tableNames=["cvt ","fpgm","glyf","head","hhea","hmtx","loca","maxp","prep"],this.entrySelectors=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4],this.fontData=t,this.initialize()}return Object.defineProperty(e.prototype,"macintosh",{get:function(){return null!==this.macintoshDictionary&&void 0!==this.macintoshDictionary||(this.macintoshDictionary=new n),this.macintoshDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"microsoft",{get:function(){return null!==this.microsoftDictionary&&void 0!==this.microsoftDictionary||(this.microsoftDictionary=new n),this.microsoftDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"macintoshGlyphs",{get:function(){return null!==this.internalMacintoshGlyphs&&void 0!==this.internalMacintoshGlyphs||(this.internalMacintoshGlyphs=new n),this.internalMacintoshGlyphs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"microsoftGlyphs",{get:function(){return null!==this.internalMicrosoftGlyphs&&void 0!==this.internalMicrosoftGlyphs||(this.internalMicrosoftGlyphs=new n),this.internalMicrosoftGlyphs},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){void 0===this.metrics&&(this.metrics=new Pt),this.readFontDictionary();var t=this.readNameTable(),e=this.readHeadTable();this.initializeFontName(t),this.metrics.macStyle=e.macStyle},e.prototype.readFontDictionary=function(){this.offset=0;this.checkPreambula();var t=this.readInt16(this.offset);this.readInt16(this.offset),this.readInt16(this.offset),this.readInt16(this.offset);void 0===this.tableDirectory&&(this.tableDirectory=new n);for(var e=0;e<t;++e){var i=new yt,r=this.readString(this.int32Size);i.checksum=this.readInt32(this.offset),i.offset=this.readInt32(this.offset),i.length=this.readInt32(this.offset),this.tableDirectory.setValue(r,i)}this.lowestPosition=this.offset,this.isTtcFont||this.fixOffsets()},e.prototype.fixOffsets=function(){for(var t=Number.MAX_VALUE,e=this.tableDirectory.keys(),i=0;i<e.length;i++){var r=(a=this.tableDirectory.getValue(e[i])).offset;if(t>r&&(t=r)<=this.lowestPosition)break}var o=t-this.lowestPosition;if(0!==o){for(var s=new n,i=0;i<e.length;i++){var a=this.tableDirectory.getValue(e[i]);a.offset-=o,s.setValue(e[i],a)}this.tableDirectory=s}},e.prototype.checkPreambula=function(){var t=this.readInt32(this.offset);if(this.isMacTtf=1953658213===t,65536!==t&&1953658213!==t&&1330926671!==t){if(this.isTtcFont=!0,this.offset=0,"ttcf"!==this.readString(4))throw new Error("Can not read TTF font data");if(this.offset+=4,this.readInt32(this.offset)<0)throw new Error("Can not read TTF font data");this.offset=this.readInt32(this.offset),t=this.readInt32(this.offset)}return t},e.prototype.readNameTable=function(){var t=this.getTable("name");this.offset=t.offset;var e=new bt;e.formatSelector=this.readUInt16(this.offset),e.recordsCount=this.readUInt16(this.offset),e.offset=this.readUInt16(this.offset),e.nameRecords=[];for(var i=this.offset,r=0;r<e.recordsCount;r++){this.offset=i;var n=new wt;n.platformID=this.readUInt16(this.offset),n.encodingID=this.readUInt16(this.offset),n.languageID=this.readUInt16(this.offset),n.nameID=this.readUInt16(this.offset),n.length=this.readUInt16(this.offset),n.offset=this.readUInt16(this.offset),this.offset=t.offset+e.offset+n.offset;var o=0===n.platformID||3===n.platformID;n.name=this.readString(n.length,o),e.nameRecords[r]=n,i+=12}return e},e.prototype.readHeadTable=function(){var t=this.getTable("head");this.offset=t.offset;var e=new St;return e.version=this.readFixed(this.offset),e.fontRevision=this.readFixed(this.offset),e.checkSumAdjustment=this.readUInt32(this.offset),e.magicNumber=this.readUInt32(this.offset),e.flags=this.readUInt16(this.offset),e.unitsPerEm=this.readUInt16(this.offset),e.created=this.readInt64(this.offset),e.modified=this.readInt64(this.offset),e.xMin=this.readInt16(this.offset),e.yMin=this.readInt16(this.offset),e.xMax=this.readInt16(this.offset),e.yMax=this.readInt16(this.offset),e.macStyle=this.readUInt16(this.offset),e.lowestReadableSize=this.readUInt16(this.offset),e.fontDirectionHint=this.readInt16(this.offset),e.indexToLocalFormat=this.readInt16(this.offset),e.glyphDataFormat=this.readInt16(this.offset),e},e.prototype.readHorizontalHeaderTable=function(){var t=this.getTable("hhea");this.offset=t.offset;var e=new vt;return e.version=this.readFixed(this.offset),e.ascender=this.readInt16(this.offset),e.descender=this.readInt16(this.offset),e.lineGap=this.readInt16(this.offset),e.advanceWidthMax=this.readUInt16(this.offset),e.minLeftSideBearing=this.readInt16(this.offset),e.minRightSideBearing=this.readInt16(this.offset),e.xMaxExtent=this.readInt16(this.offset),e.caretSlopeRise=this.readInt16(this.offset),e.caretSlopeRun=this.readInt16(this.offset),this.offset+=10,e.metricDataFormat=this.readInt16(this.offset),e.numberOfHMetrics=this.readUInt16(this.offset),e},e.prototype.readOS2Table=function(){var t=this.getTable("OS/2");this.offset=t.offset;var e=new Ct;return e.version=this.readUInt16(this.offset),e.xAvgCharWidth=this.readInt16(this.offset),e.usWeightClass=this.readUInt16(this.offset),e.usWidthClass=this.readUInt16(this.offset),e.fsType=this.readInt16(this.offset),e.ySubscriptXSize=this.readInt16(this.offset),e.ySubscriptYSize=this.readInt16(this.offset),e.ySubscriptXOffset=this.readInt16(this.offset),e.ySubscriptYOffset=this.readInt16(this.offset),e.ySuperscriptXSize=this.readInt16(this.offset),e.ySuperscriptYSize=this.readInt16(this.offset),e.ySuperscriptXOffset=this.readInt16(this.offset),e.ySuperscriptYOffset=this.readInt16(this.offset),e.yStrikeoutSize=this.readInt16(this.offset),e.yStrikeoutPosition=this.readInt16(this.offset),e.sFamilyClass=this.readInt16(this.offset),e.panose=this.readBytes(10),e.ulUnicodeRange1=this.readUInt32(this.offset),e.ulUnicodeRange2=this.readUInt32(this.offset),e.ulUnicodeRange3=this.readUInt32(this.offset),e.ulUnicodeRange4=this.readUInt32(this.offset),e.vendorIdentifier=this.readBytes(4),e.fsSelection=this.readUInt16(this.offset),e.usFirstCharIndex=this.readUInt16(this.offset),e.usLastCharIndex=this.readUInt16(this.offset),e.sTypoAscender=this.readInt16(this.offset),e.sTypoDescender=this.readInt16(this.offset),e.sTypoLineGap=this.readInt16(this.offset),e.usWinAscent=this.readUInt16(this.offset),e.usWinDescent=this.readUInt16(this.offset),e.ulCodePageRange1=this.readUInt32(this.offset),e.ulCodePageRange2=this.readUInt32(this.offset),e.version>1?(e.sxHeight=this.readInt16(this.offset),e.sCapHeight=this.readInt16(this.offset),e.usDefaultChar=this.readUInt16(this.offset),e.usBreakChar=this.readUInt16(this.offset),e.usMaxContext=this.readUInt16(this.offset)):(e.sxHeight=0,e.sCapHeight=0,e.usDefaultChar=0,e.usBreakChar=0,e.usMaxContext=0),e},e.prototype.readPostTable=function(){var t=this.getTable("post");this.offset=t.offset;var e=new Bt;return e.formatType=this.readFixed(this.offset),e.italicAngle=this.readFixed(this.offset),e.underlinePosition=this.readInt16(this.offset),e.underlineThickness=this.readInt16(this.offset),e.isFixedPitch=this.readUInt32(this.offset),e.minType42=this.readUInt32(this.offset),e.maxType42=this.readUInt32(this.offset),e.minType1=this.readUInt32(this.offset),e.maxType1=this.readUInt32(this.offset),e},e.prototype.readWidthTable=function(t,e){var i=this.getTable("hmtx");this.offset=i.offset;for(var r=[],n=0;n<t;n++){var o=new Ot;o.advanceWidth=this.readUInt16(this.offset),o.lsb=this.readInt16(this.offset);var s=1e3*o.advanceWidth/e;r.push(Math.floor(s))}return r},e.prototype.readCmapTable=function(){var t=this.getTable("cmap");this.offset=t.offset;var e=new Lt;e.version=this.readUInt16(this.offset),e.tablesCount=this.readUInt16(this.offset);for(var i=this.offset,r=[],n=0;n<e.tablesCount;n++){this.offset=i;var o=new xt;o.platformID=this.readUInt16(this.offset),o.encodingID=this.readUInt16(this.offset),o.offset=this.readUInt32(this.offset),i=this.offset,this.readCmapSubTable(o),r[n]=o}return r},e.prototype.readCmapSubTable=function(e){var i=this.getTable("cmap");this.offset=i.offset+e.offset;var r=this.readUInt16(this.offset),n=this.getCmapEncoding(e.platformID,e.encodingID);n===t.TtfCmapEncoding.Macintosh?t.TtfPlatformID.Macintosh:t.TtfPlatformID.Microsoft;if(n!==t.TtfCmapEncoding.Unknown)switch(r){case t.TtfCmapFormat.Apple:this.readAppleCmapTable(e,n);break;case t.TtfCmapFormat.Microsoft:this.readMicrosoftCmapTable(e,n);break;case t.TtfCmapFormat.Trimmed:this.readTrimmedCmapTable(e,n)}},e.prototype.readAppleCmapTable=function(t,e){var i=this.getTable("cmap");this.offset=i.offset+t.offset;var r=new kt;r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),null!==this.maxMacIndex&&void 0!==this.maxMacIndex||(this.maxMacIndex=0);for(var n=0;n<256;++n){var o=new Tt;o.index=this.readByte(this.offset),o.width=this.getWidth(o.index),o.charCode=n,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},e.prototype.readMicrosoftCmapTable=function(e,i){var r=this.getTable("cmap");this.offset=r.offset+e.offset;var n=i===t.TtfCmapEncoding.Unicode?this.microsoft:this.macintosh,o=new Vt;o.format=this.readUInt16(this.offset),o.length=this.readUInt16(this.offset),o.version=this.readUInt16(this.offset),o.segCountX2=this.readUInt16(this.offset),o.searchRange=this.readUInt16(this.offset),o.entrySelector=this.readUInt16(this.offset),o.rangeShift=this.readUInt16(this.offset);var s=o.segCountX2/2;o.endCount=this.readUshortArray(s),o.reservedPad=this.readUInt16(this.offset),o.startCount=this.readUshortArray(s),o.idDelta=this.readUshortArray(s),o.idRangeOffset=this.readUshortArray(s);var a=o.length/2-8-4*s;o.glyphID=this.readUshortArray(a);for(var h=0,l=0,u=0;u<s;u++)for(var c=o.startCount[u];c<=o.endCount[u]&&65535!==c;c++){if(0===o.idRangeOffset[u])h=c+o.idDelta[u]&65535;else{if((l=u+o.idRangeOffset[u]/2-s+c-o.startCount[u])>=o.glyphID.length)continue;h=o.glyphID[l]+o.idDelta[u]&65535}var p=new Tt;p.index=h,p.width=this.getWidth(p.index);var d=i===t.TtfCmapEncoding.Symbol&&61440==(65280&c)?255&c:c;p.charCode=d,n.setValue(d,p),this.addGlyph(p,i)}},e.prototype.readTrimmedCmapTable=function(t,e){var i=this.getTable("cmap");this.offset=i.offset+t.offset;var r=new Rt;r.format=this.readUInt16(this.offset),r.length=this.readUInt16(this.offset),r.version=this.readUInt16(this.offset),r.firstCode=this.readUInt16(this.offset),r.entryCount=this.readUInt16(this.offset);for(var n=0;n<r.entryCount;++n){var o=new Tt;o.index=this.readUInt16(this.offset),o.width=this.getWidth(o.index),o.charCode=n+r.firstCode,this.macintosh.setValue(n,o),this.addGlyph(o,e),this.maxMacIndex=Math.max(n,this.maxMacIndex)}},e.prototype.initializeFontName=function(t){for(var e=0;e<t.recordsCount;e++){var i=t.nameRecords[e];if(1===i.nameID?this.metrics.fontFamily=i.name:6===i.nameID&&(this.metrics.postScriptName=i.name),null!==this.metrics.fontFamily&&void 0!==this.metrics.fontFamily&&null!==this.metrics.postScriptName&&void 0!==this.metrics.postScriptName)break}},e.prototype.getTable=function(t){var e,i=new yt;return this.tableDirectory.containsKey(t)&&(e=this.tableDirectory.getValue(t)),null!==e&&void 0!==e&&(i=e),i},e.prototype.getWidth=function(t){return t=t<this.width.length?t:this.width.length-1,this.width[t]},e.prototype.getCmapEncoding=function(e,i){var r=t.TtfCmapEncoding.Unknown;return e==t.TtfPlatformID.Microsoft&&i==t.TtfMicrosoftEncodingID.Undefined?r=t.TtfCmapEncoding.Symbol:e==t.TtfPlatformID.Microsoft&&i==t.TtfMicrosoftEncodingID.Unicode?r=t.TtfCmapEncoding.Unicode:e==t.TtfPlatformID.Macintosh&&i==t.TtfMacintoshEncodingID.Roman&&(r=t.TtfCmapEncoding.Macintosh),r},e.prototype.addGlyph=function(e,i){var r=null;switch(i){case t.TtfCmapEncoding.Unicode:r=this.microsoftGlyphs;break;case t.TtfCmapEncoding.Macintosh:case t.TtfCmapEncoding.Symbol:r=this.macintoshGlyphs}r.setValue(e.index,e)},e.prototype.initializeMetrics=function(e,i,r,n,o,s){this.initializeFontName(e);for(var a=!1,h=0;h<s.length;h++){var l=s[h];if(this.getCmapEncoding(l.platformID,l.encodingID)===t.TtfCmapEncoding.Symbol){a=!0;break}}this.metrics.isSymbol=a,this.metrics.macStyle=i.macStyle,this.metrics.isFixedPitch=0!==o.isFixedPitch,this.metrics.italicAngle=o.italicAngle;var u=1e3/i.unitsPerEm;this.metrics.winAscent=n.sTypoAscender*u,this.metrics.macAscent=r.ascender*u,this.metrics.capHeight=0!==n.sCapHeight?n.sCapHeight:.7*i.unitsPerEm*u,this.metrics.winDescent=n.sTypoDescender*u,this.metrics.macDescent=r.descender*u,this.metrics.leading=(n.sTypoAscender-n.sTypoDescender+n.sTypoLineGap)*u,this.metrics.lineGap=Math.ceil(r.lineGap*u);var c=i.xMin*u,p=Math.ceil(this.metrics.macAscent+this.metrics.lineGap),d=i.xMax*u,f=this.metrics.macDescent;this.metrics.fontBox=new V(c,p,d,f),this.metrics.stemV=80,this.metrics.widthTable=this.updateWidth(),this.metrics.contains=this.tableDirectory.containsKey("CFF"),this.metrics.subScriptSizeFactor=i.unitsPerEm/n.ySubscriptYSize,this.metrics.superscriptSizeFactor=i.unitsPerEm/n.ySuperscriptYSize},e.prototype.updateWidth=function(){var t=[];if(this.metrics.isSymbol)for(n=0;n<256;n++){var e=this.getGlyph(String.fromCharCode(n));t[n]=e.empty?0:e.width}else for(var i=[],r=String.fromCharCode(32),n=0;n<256;n++){i[0]=n;var o=this.getString(i,0,i.length),s=o.length>0?o[0]:"?";(e=this.getGlyph(s)).empty?(e=this.getGlyph(r),t[n]=e.empty?0:e.width):t[n]=e.width}return t},e.prototype.getDefaultGlyph=function(){return this.getGlyph(M.whiteSpace)},e.prototype.getString=function(t,e,i){for(var r="",n=0;n<i;n++)r+=String.fromCharCode(t[n+e]);return r},e.prototype.readLocaTable=function(t){var e=this.getTable("loca");this.offset=e.offset;var i=new jt,r=null;if(t){n=e.length/2;r=[];for(o=0;o<n;o++)r[o]=2*this.readUInt16(this.offset)}else{var n=e.length/4;r=[];for(var o=0;o<n;o++)r[o]=this.readUInt32(this.offset)}return i.offsets=r,i},e.prototype.updateGlyphChars=function(t,e){t.containsKey(0)||t.setValue(0,0);for(var i=new n,r=t.keys(),o=0;o<r.length;o++)i.setValue(r[o],t.getValue(r[o]));for(o=0;o<r.length;o++){var s=r[o];this.processCompositeGlyph(t,s,e)}},e.prototype.processCompositeGlyph=function(e,i,r){if(i<r.offsets.length-1){var n=r.offsets[i];if(n!==r.offsets[i+1]){var o=this.getTable("glyf");this.offset=o.offset+n;var s=new Nt;if(s.numberOfContours=this.readInt16(this.offset),s.xMin=this.readInt16(this.offset),s.yMin=this.readInt16(this.offset),s.xMax=this.readInt16(this.offset),s.yMax=this.readInt16(this.offset),s.numberOfContours<0)for(var a=0;;){var h=this.readUInt16(this.offset),l=this.readUInt16(this.offset);if(e.containsKey(l)||e.setValue(l,0),0==(h&t.TtfCompositeGlyphFlags.MoreComponents))break;a=0!=(h&t.TtfCompositeGlyphFlags.Arg1And2AreWords)?4:2,0!=(h&t.TtfCompositeGlyphFlags.WeHaveScale)?a+=2:0!=(h&t.TtfCompositeGlyphFlags.WeHaveAnXyScale)?a+=4:0!=(h&t.TtfCompositeGlyphFlags.WeHaveTwoByTwo)&&(a+=8),this.offset+=a}}}},e.prototype.generateGlyphTable=function(t,e,i,r){i=[];var n=t.keys();n.sort(function(t,e){return t-e});for(var o=0,s=0;s<n.length;s++){var a=n[s];e.offsets.length>0&&(o+=e.offsets[a+1]-e.offsets[a])}var h=this.align(o);r=[];for(s=0;s<h;s++)r.push(0);for(var l=0,u=0,c=this.getTable("glyf"),s=0;s<e.offsets.length;s++)if(i.push(l),u<n.length&&n[u]===s){++u,i[s]=l;var p=e.offsets[s],d=e.offsets[s+1]-p;d>0&&(this.offset=c.offset+p,r=this.read(r,l,d).buffer,l+=d)}return{glyphTableSize:o,newLocaTable:i,newGlyphTable:r}},e.prototype.updateLocaTable=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTable");for(var r=e?2*t.length:4*t.length,n=this.align(r),o=new At(n),s=0;s<t.length;s++){var a=t[s];e?(a/=2,o.writeShort(a)):o.writeInt(a)}return{newLocaUpdated:o.data,newLocaSize:r}},e.prototype.align=function(t){return t+3&-4},e.prototype.getFontProgram=function(t,e,i,r){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");this.tableNames;var n=this.getFontProgramLength(t,e,0),o=n.fontProgramLength,s=n.numTables,a=new At(o);a.writeInt(65536),a.writeShort(s);var h=this.entrySelectors[s];return a.writeShort(16*(1<<(31&h))),a.writeShort(h),a.writeShort(16*(s-(1<<(31&h)))),this.writeCheckSums(a,s,t,e,i,r),this.writeGlyphs(a,t,e),a.data},e.prototype.getFontProgramLength=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : newLocaTableOut");if(null===e)throw new Error("Argument Null Exception : newGlyphTable");i=2;for(var r=this.tableNames,n=0,o=0;o<r.length;o++){var s=r[o];if("glyf"!==s&&"loca"!==s){var a=this.getTable(s);a.empty||(++i,n+=this.align(a.length))}}return n+=t.length,n+=e.length,n+=16*i+12,{fontProgramLength:n,numTables:i}},e.prototype.writeCheckSums=function(t,e,i,r,n,o){if(null===t)throw new Error("Argument Null Exception : writer");if(null===i)throw new Error("Argument Null Exception : newLocaTableOut");if(null===r)throw new Error("Argument Null Exception : newGlyphTable");for(var s=this.tableNames,a=16*e+12,h=0,l=0;l<s.length;l++){var u=s[l],c=this.getTable(u);if(!c.empty){if(t.writeString(u),"glyf"===u){p=this.calculateCheckSum(r);t.writeInt(p),h=n}else if("loca"===u){var p=this.calculateCheckSum(i);t.writeInt(p),h=o}else t.writeInt(c.checksum),h=c.length;t.writeUInt(a),t.writeUInt(h),a+=this.align(h)}}},e.prototype.calculateCheckSum=function(t){if(null===t)throw new Error("Argument Null Exception : bytes");for(var e=0,i=0,r=0,n=0,o=0,s=0;s<(t.length+1)/4;s++)o+=255&t[e++],n+=255&t[e++],r+=255&t[e++],i+=255&t[e++];var a=i;return a+=r<<8,a+=n<<16,a+=o<<24},e.prototype.writeGlyphs=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : writer");if(null===e)throw new Error("Argument Null Exception : newLocaTableOut");if(null===i)throw new Error("Argument Null Exception : newGlyphTable");for(var r=this.tableNames,n=0;n<r.length;n++){var o=r[n],s=this.getTable(o);if(!s.empty)if("glyf"===o)t.writeBytes(i);else if("loca"===o)t.writeBytes(e);else{for(var a=this.align(s.length),h=[],l=0;l<a;l++)h.push(0);this.offset=s.offset;var u=this.read(h,0,s.length);t.writeBytes(u.buffer)}}},e.prototype.setOffset=function(t){this.offset=t},e.prototype.createInternals=function(){this.metrics=new Pt;var t=this.readNameTable(),e=this.readHeadTable();this.bIsLocaShort=0===e.indexToLocalFormat;var i=this.readHorizontalHeaderTable(),r=this.readOS2Table(),n=this.readPostTable();this.width=this.readWidthTable(i.numberOfHMetrics,e.unitsPerEm);var o=this.readCmapTable();this.initializeMetrics(t,e,i,r,n,o)},e.prototype.getGlyph=function(t){if("number"==typeof t){var e=null;return this.metrics.isSymbol||null==this.microsoftGlyphs?this.metrics.isSymbol&&null!=this.macintoshGlyphs&&this.macintoshGlyphs.containsKey(t)&&(e=this.macintoshGlyphs.getValue(t)):this.microsoftGlyphs.containsKey(t)&&(e=this.microsoftGlyphs.getValue(t)),n=null!=e?e:this.getDefaultGlyph()}var i=null,r=t.charCodeAt(0);this.metrics.isSymbol||null===this.microsoft?(this.metrics.isSymbol&&null!==this.macintosh||this.isMacTTF)&&(0!==this.maxMacIndex?r%=this.maxMacIndex+1:r=61440==(65280&r)?255&r:r,this.macintosh.containsKey(r)&&(i=this.macintosh.getValue(r),this.isFontPresent=!0)):this.microsoft.containsKey(r)?(i=this.microsoft.getValue(r),r!==M.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!0)):r!==M.whiteSpace.charCodeAt(0)&&(this.isFontPresent=!1),t===M.whiteSpace&&null===i&&(i=new Tt);var n=null!==i?i:this.getDefaultGlyph();return n},e.prototype.getGlyphChars=function(t){if(null===t||void 0===t)throw new Error("Argument Null Exception : chars");for(var e=new n,i=t.keys(),r=0;r<i.length;r++){var o=i[r],s=this.getGlyph(o);s.empty||e.setValue(s.index,o.charCodeAt(0))}return e},e.prototype.getAllGlyphs=function(){for(var t=[],e=new Tt,i=0,r=0;r<this.width.length;r++){var n=this.width[r];e.index=i,e.width=n,t.push(e),i++}return t},e.prototype.readFontProgram=function(t){var e=this.getGlyphChars(t),i=this.readLocaTable(this.bIsLocaShort);e.size()<t.size()&&(this.missedGlyphs=t.size()-e.size()),this.updateGlyphChars(e,i);var r=this.generateGlyphTable(e,i,null,null),n=r.glyphTableSize,o=r.newLocaTable,s=r.newGlyphTable,a=this.updateLocaTable(o,this.bIsLocaShort,null),h=a.newLocaSize,l=a.newLocaUpdated;return this.getFontProgram(l,s,n,h)},e.prototype.convertString=function(t){if(null===t)throw new Error("Argument Null Exception : text");for(var e="",i=0;i<t.length;i++){var r=t[i],n=this.getGlyph(r);n.empty||(e+=String.fromCharCode(n.index))}return e},e.prototype.getCharWidth=function(t){var e=this.getGlyph(t);return(e=e.empty?this.getDefaultGlyph():e).empty?0:e.width},e.prototype.readString=function(t,e){if(void 0===e)return this.readString(t,!1);var i="";if(e)for(r=0;r<t;r++)r%2!=0&&(i+=String.fromCharCode(this.fontData[this.offset])),this.offset+=1;else for(var r=0;r<t;r++)i+=String.fromCharCode(this.fontData[this.offset]),this.offset+=1;return i},e.prototype.readFixed=function(t){return this.readInt16(t)+this.readInt16(t+2)/16384},e.prototype.readInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],n=this.fontData[t];return this.offset+=4,e+(i<<8)+(r<<16)+(n<<24)},e.prototype.readUInt32=function(t){var e=this.fontData[t+3],i=this.fontData[t+2],r=this.fontData[t+1],n=this.fontData[t];return this.offset+=4,e|i<<8|r<<16|n<<24},e.prototype.readInt16=function(t){var e=(this.fontData[t]<<8)+this.fontData[t+1];return e=32768&e?e-65536:e,this.offset+=2,e},e.prototype.readInt64=function(t){var e=this.readInt32(t+4),i=4294967296*this.readInt32(t)+e;return e<0&&(i+=4294967296),i},e.prototype.readUInt16=function(t){var e=this.fontData[t]<<8|this.fontData[t+1];return this.offset+=2,e},e.prototype.readUshortArray=function(t){for(var e=[],i=0;i<t;i++)e[i]=this.readUInt16(this.offset);return e},e.prototype.readBytes=function(t){for(var e=[],i=0;i<t;i++)e.push(this.fontData[this.offset]),this.offset+=1;return e},e.prototype.readByte=function(t){var e=this.fontData[t];return this.offset+=1,e},e.prototype.read=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : buffer");var r=0,n=0;do{for(var o=0;o<i-r&&this.offset+o<this.fontData.length;o++)t[e+o]=this.fontData[this.offset+o];n=i-r,this.offset+=n,r+=n}while(r<i);return{buffer:t,written:r}},e}(),Mt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),It=function(){function e(){this.lineGap=0}return e.prototype.getAscent=function(t){return this.ascent*G.charSizeMultiplier*this.getSize(t)},e.prototype.getDescent=function(t){return this.descent*G.charSizeMultiplier*this.getSize(t)},e.prototype.getLineGap=function(t){return this.lineGap*G.charSizeMultiplier*this.getSize(t)},e.prototype.getHeight=function(t){for(var e=["cambria","candara","constantia","corbel","cariadings"],i=[],r=0;r<e.length;r++){var n=e[r];i.push(n)}return this.getDescent(t)<0?this.getAscent(t)-this.getDescent(t)+this.getLineGap(t):this.getAscent(t)+this.getDescent(t)+this.getLineGap(t)},e.prototype.getSize=function(e){var i=this.size;if(null!=e)switch(e.subSuperScript){case t.PdfSubSuperScript.SubScript:i/=this.subScriptSizeFactor;break;case t.PdfSubSuperScript.SuperScript:i/=this.superscriptSizeFactor}return i},e.prototype.clone=function(){var t=this;return t.widthTable=Ft.clone(),t},Object.defineProperty(e.prototype,"widthTable",{get:function(){return this.internalWidthTable},set:function(t){this.internalWidthTable=t},enumerable:!0,configurable:!0}),e}(),Ft=function(){function t(){}return t.clone=function(){return null},t}(),Et=function(t){function e(e){var i=t.call(this)||this;if(null==e)throw new Error("ArgumentNullException:widths");return i.widths=e,i}return Mt(e,t),e.prototype.items=function(t){if(t<0||t>=this.widths.length)throw new Error("ArgumentOutOfRangeException:index, The character is not supported by the font.");return this.widths[t]},Object.defineProperty(e.prototype,"length",{get:function(){return this.widths.length},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=this;return t.widths=this.widths,t},e.prototype.toArray=function(){return new m(this.widths)},e}(Ft),Gt=function(){function e(t,e){if(this.nameString="ABCDEFGHIJKLMNOPQRSTUVWXYZ",this.dictionaryProperties=new a,this.isCompress=!1,this.isEmbedFont=!1,this.cmapPrefix="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap"+s.newLine+"/CIDSystemInfo << /Registry (Adobe)/Ordering (UCS)/Supplement 0>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange"+s.newLine,this.cmapEndCodespaceRange="endcodespacerange"+s.newLine,this.cmapBeginRange="beginbfrange"+s.newLine,this.cmapEndRange="endbfrange"+s.newLine,this.cmapSuffix="endbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend end"+s.newLine,null===t||void 0===t)throw new Error("ArgumentNullException:base64String");this.fontSize=e,this.fontString=t,this.Initialize()}return e.prototype.getCharWidth=function(t){return this.ttfReader.getCharWidth(t)},e.prototype.getLineWidth=function(t){for(var e=0,i=0,r=t.length;i<r;i++){var n=t[i];e+=this.getCharWidth(n)}return e},e.prototype.Initialize=function(){var t=new ut(this.fontString.length);t.writeFromBase64String(this.fontString),this.fontData=t.internalBuffer,this.ttfReader=new Dt(this.fontData),this.ttfMetrics=this.ttfReader.metrics},e.prototype.createInternals=function(){this.fontDictionary=new h,this.fontProgram=new b,this.cmap=new b,this.descendantFont=new h,this.metrics=new It,this.ttfReader.createInternals(),this.ttfMetrics=this.ttfReader.metrics,this.initializeMetrics(),this.subsetName=this.getFontName(),this.createDescendantFont(),this.createCmap(),this.createFontDictionary(),this.createFontProgram()},e.prototype.getInternals=function(){return this.fontDictionary},e.prototype.initializeMetrics=function(){var t=this.ttfReader.metrics;this.metrics.ascent=t.macAscent,this.metrics.descent=t.macDescent,this.metrics.height=t.macAscent-t.macDescent+t.lineGap,this.metrics.name=t.fontFamily,this.metrics.postScriptName=t.postScriptName,this.metrics.size=this.fontSize,this.metrics.widthTable=new Et(t.widthTable),this.metrics.lineGap=t.lineGap,this.metrics.subScriptSizeFactor=t.subScriptSizeFactor,this.metrics.superscriptSizeFactor=t.superscriptSizeFactor,this.metrics.isBold=t.isBold},e.prototype.getFontName=function(){for(var t,e="",i=0;i<6;i++){var r=Math.floor(26*Math.random())+0;e+=this.nameString[r]}return e+="+",e+=this.ttfReader.metrics.postScriptName,t=e.toString(),t=this.formatName(t)},e.prototype.formatName=function(t){var e=t.replace("(","#28");return e=e.replace(")","#29"),e=e.replace("[","#5B"),e=e.replace("]","#5D"),e=e.replace("<","#3C"),e=e.replace(">","#3E"),e=e.replace("{","#7B"),e=e.replace("}","#7D"),e=e.replace("/","#2F"),(e=e.replace("%","#25")).replace(" ","#20")},e.prototype.createDescendantFont=function(){this.descendantFont.isFont=!0,this.descendantFont.descendantFontBeginSave=new u(this),this.descendantFont.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.descendantFont.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.cIDFontType2)),this.descendantFont.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.descendantFont.items.setValue(this.dictionaryProperties.cIDToGIDMap,new o(this.dictionaryProperties.identity)),this.descendantFont.items.setValue(this.dictionaryProperties.dw,new g(1e3)),this.fontDescriptor=this.createFontDescriptor(),this.descendantFont.items.setValue(this.dictionaryProperties.fontDescriptor,new C(this.fontDescriptor));var t=this.createSystemInfo();this.descendantFont.items.setValue(this.dictionaryProperties.cIDSystemInfo,t)},e.prototype.createFontDescriptor=function(){var t=new h,e=this.ttfReader.metrics;return t.isFont=!0,t.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.fontDescriptor)),t.items.setValue(this.dictionaryProperties.fontName,new o(this.subsetName)),t.items.setValue(this.dictionaryProperties.flags,new g(this.getDescriptorFlags())),t.items.setValue(this.dictionaryProperties.fontBBox,m.fromRectangle(this.getBoundBox())),t.items.setValue(this.dictionaryProperties.missingWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.stemV,new g(e.stemV)),t.items.setValue(this.dictionaryProperties.italicAngle,new g(e.italicAngle)),t.items.setValue(this.dictionaryProperties.capHeight,new g(e.capHeight)),t.items.setValue(this.dictionaryProperties.ascent,new g(e.winAscent)),t.items.setValue(this.dictionaryProperties.descent,new g(e.winDescent)),t.items.setValue(this.dictionaryProperties.leading,new g(e.leading)),t.items.setValue(this.dictionaryProperties.avgWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.fontFile2,new C(this.fontProgram)),t.items.setValue(this.dictionaryProperties.maxWidth,new g(e.widthTable[32])),t.items.setValue(this.dictionaryProperties.xHeight,new g(0)),t.items.setValue(this.dictionaryProperties.stemH,new g(0)),t},e.prototype.createCmap=function(){this.cmap.cmapBeginSave=new w(this)},e.prototype.createFontDictionary=function(){this.fontDictionary.isFont=!0,this.fontDictionary.fontDictionaryBeginSave=new c(this),this.fontDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),this.fontDictionary.items.setValue(this.dictionaryProperties.baseFont,new o(this.subsetName)),this.fontDictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type0)),this.fontDictionary.items.setValue(this.dictionaryProperties.encoding,new o(this.dictionaryProperties.identityH));var t=new m,e=new C(this.descendantFont);t.isFont=!0,t.add(e),this.fontDictionary.items.setValue(this.dictionaryProperties.descendantFonts,t)},e.prototype.createFontProgram=function(){this.fontProgram.fontProgramBeginSave=new S(this)},e.prototype.createSystemInfo=function(){var t=new h;return t.items.setValue(this.dictionaryProperties.registry,new P("Adobe")),t.items.setValue(this.dictionaryProperties.ordering,new P(this.dictionaryProperties.identity)),t.items.setValue(this.dictionaryProperties.supplement,new g(0)),t},e.prototype.descendantFontBeginSave=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){var t=this.getDescendantWidth();null!==t&&this.descendantFont.items.setValue(this.dictionaryProperties.w,t)}},e.prototype.cmapBeginSave=function(){this.generateCmap()},e.prototype.fontDictionaryBeginSave=function(){null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0&&!this.fontDictionary.containsKey(this.dictionaryProperties.toUnicode)&&this.fontDictionary.items.setValue(this.dictionaryProperties.toUnicode,new C(this.cmap))},e.prototype.fontProgramBeginSave=function(){this.isCompress=!0,this.generateFontProgram()},e.prototype.getDescendantWidth=function(){var t=new m;if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){for(var e=[],i=this.usedChars.keys(),r=0;r<i.length;r++){var n=i[r];(l=this.ttfReader.getGlyph(n)).empty||e.push(l)}e.sort(function(t,e){return t.index-e.index});for(var o=0,s=0,a=!1,h=new m,r=0;r<e.length;r++){var l=e[r];a||(a=!0,o=l.index,s=l.index-1),(s+1!==l.index||r+1===e.length)&&e.length>1&&(t.add(new g(o)),0!==r&&t.add(h),o=l.index,h=new m),h.add(new g(l.width)),r+1===e.length&&(t.add(new g(o)),t.add(h)),s=l.index}}return t},e.prototype.generateCmap=function(){if(null!==this.usedChars&&void 0!==this.usedChars&&this.usedChars.size()>0){var t=this.ttfReader.getGlyphChars(this.usedChars);if(t.size()>0){var e=t.keys().sort(),i=e[0],r=e[e.length-1],n=this.toHexString(i,!1)+this.toHexString(r,!1)+s.newLine,o="";o+=this.cmapPrefix,o+=n,o+=this.cmapEndCodespaceRange;for(var a=0,h=0;h<e.length;h++){0===a&&(0!==h&&(o+=this.cmapEndRange),o+=a=Math.min(100,e.length-h),o+=s.whiteSpace,o+=this.cmapBeginRange),a-=1;var l=e[h];o+=this.toHexString(l,!0)+this.toHexString(l,!0)+this.toHexString(t.getValue(l),!0)+"\n"}o+=this.cmapSuffix,this.cmap.clearStream(),this.cmap.isFont=!0,this.cmap.write(o)}}},e.prototype.generateFontProgram=function(){var t=null;this.usedChars=null===this.usedChars||void 0===this.usedChars?new n:this.usedChars,this.ttfReader.setOffset(0),t=this.ttfReader.readFontProgram(this.usedChars),this.fontProgram.clearStream(),this.fontProgram.isFont=!0,this.fontProgram.writeBytes(t)},e.prototype.getDescriptorFlags=function(){var e=0,i=this.ttfReader.metrics;return i.isFixedPitch&&(e|=t.FontDescriptorFlags.FixedPitch),i.isSymbol?e|=t.FontDescriptorFlags.Symbolic:e|=t.FontDescriptorFlags.Nonsymbolic,i.isItalic&&(e|=t.FontDescriptorFlags.Italic),i.isBold&&(e|=t.FontDescriptorFlags.ForceBold),e},e.prototype.getBoundBox=function(){var t=this.ttfReader.metrics.fontBox,e=Math.abs(t.right-t.left),i=Math.abs(t.top-t.bottom);return new k(t.left,t.bottom,e,i)},e.prototype.toHexString=function(t,e){var i=t.toString(16);return e&&(i=i.toUpperCase()),"<0000".substring(0,5-i.length)+i+">"},e.prototype.setSymbols=function(t){if(null===t)throw new Error("Argument Null Exception : text");null!==this.usedChars&&void 0!==this.usedChars||(this.usedChars=new n);for(var e=0;e<t.length;e++){var i=t[e];this.usedChars.setValue(i,String.fromCharCode(0))}!1===this.isEmbedFont&&this.getDescendantWidth()},e}(),zt=function(){function t(){this.arabicCharTable=[["ء","ﺀ"],["آ","ﺁ","ﺂ"],["أ","ﺃ","ﺄ"],["ؤ","ﺅ","ﺆ"],["إ","ﺇ","ﺈ"],["ئ","ﺉ","ﺊ","ﺋ","ﺌ"],["ا","ﺍ","ﺎ"],["ب","ﺏ","ﺐ","ﺑ","ﺒ"],["ة","ﺓ","ﺔ"],["ت","ﺕ","ﺖ","ﺗ","ﺘ"],["ث","ﺙ","ﺚ","ﺛ","ﺜ"],["ج","ﺝ","ﺞ","ﺟ","ﺠ"],["ح","ﺡ","ﺢ","ﺣ","ﺤ"],["خ","ﺥ","ﺦ","ﺧ","ﺨ"],["د","ﺩ","ﺪ"],["ذ","ﺫ","ﺬ"],["ر","ﺭ","ﺮ"],["ز","ﺯ","ﺰ"],["س","ﺱ","ﺲ","ﺳ","ﺴ"],["ش","ﺵ","ﺶ","ﺷ","ﺸ"],["ص","ﺹ","ﺺ","ﺻ","ﺼ"],["ض","ﺽ","ﺾ","ﺿ","ﻀ"],["ط","ﻁ","ﻂ","ﻃ","ﻄ"],["ظ","ﻅ","ﻆ","ﻇ","ﻈ"],["ع","ﻉ","ﻊ","ﻋ","ﻌ"],["غ","ﻍ","ﻎ","ﻏ","ﻐ"],["ـ","ـ","ـ","ـ","ـ"],["ف","ﻑ","ﻒ","ﻓ","ﻔ"],["ق","ﻕ","ﻖ","ﻗ","ﻘ"],["ك","ﻙ","ﻚ","ﻛ","ﻜ"],["ل","ﻝ","ﻞ","ﻟ","ﻠ"],["م","ﻡ","ﻢ","ﻣ","ﻤ"],["ن","ﻥ","ﻦ","ﻧ","ﻨ"],["ه","ﻩ","ﻪ","ﻫ","ﻬ"],["و","ﻭ","ﻮ"],["ى","ﻯ","ﻰ","ﯨ","ﯩ"],["ي","ﻱ","ﻲ","ﻳ","ﻴ"],["ٱ","ﭐ","ﭑ"],["ٹ","ﭦ","ﭧ","ﭨ","ﭩ"],["ٺ","ﭞ","ﭟ","ﭠ","ﭡ"],["ٻ","ﭒ","ﭓ","ﭔ","ﭕ"],["پ","ﭖ","ﭗ","ﭘ","ﭙ"],["ٿ","ﭢ","ﭣ","ﭤ","ﭥ"],["ڀ","ﭚ","ﭛ","ﭜ","ﭝ"],["ڃ","ﭶ","ﭷ","ﭸ","ﭹ"],["ڄ","ﭲ","ﭳ","ﭴ","ﭵ"],["چ","ﭺ","ﭻ","ﭼ","ﭽ"],["ڇ","ﭾ","ﭿ","ﮀ","ﮁ"],["ڈ","ﮈ","ﮉ"],["ڌ","ﮄ","ﮅ"],["ڍ","ﮂ","ﮃ"],["ڎ","ﮆ","ﮇ"],["ڑ","ﮌ","ﮍ"],["ژ","ﮊ","ﮋ"],["ڤ","ﭪ","ﭫ","ﭬ","ﭭ"],["ڦ","ﭮ","ﭯ","ﭰ","ﭱ"],["ک","ﮎ","ﮏ","ﮐ","ﮑ"],["ڭ","ﯓ","ﯔ","ﯕ","ﯖ"],["گ","ﮒ","ﮓ","ﮔ","ﮕ"],["ڱ","ﮚ","ﮛ","ﮜ","ﮝ"],["ڳ","ﮖ","ﮗ","ﮘ","ﮙ"],["ں","ﮞ","ﮟ"],["ڻ","ﮠ","ﮡ","ﮢ","ﮣ"],["ھ","ﮪ","ﮫ","ﮬ","ﮭ"],["ۀ","ﮤ","ﮥ"],["ہ","ﮦ","ﮧ","ﮨ","ﮩ"],["ۅ","ﯠ","ﯡ"],["ۆ","ﯙ","ﯚ"],["ۇ","ﯗ","ﯘ"],["ۈ","ﯛ","ﯜ"],["ۉ","ﯢ","ﯣ"],["ۋ","ﯞ","ﯟ"],["ی","ﯼ","ﯽ","ﯾ","ﯿ"],["ې","ﯤ","ﯥ","ﯦ","ﯧ"],["ے","ﮮ","ﮯ"],["ۓ","ﮰ","ﮱ"]],this.alef="ا",this.alefHamza="أ",this.alefHamzaBelow="إ",this.alefMadda="آ",this.lam="ل",this.hamza="ء",this.zeroWidthJoiner="",this.hamzaAbove="ٔ",this.hamzaBelow="ٕ",this.wawHamza="ؤ",this.yehHamza="ئ",this.waw="و",this.alefMaksura="ى",this.yeh="ي",this.farsiYeh="ی",this.shadda="ّ",this.madda="ٓ",this.lwa="ﻻ",this.lwawh="ﻷ",this.lwawhb="ﻹ",this.lwawm="ﻵ",this.bwhb="ۓ",this.fathatan="ً",this.superScriptalef="ٰ",this.vowel=1,this.arabicMapTable=new n;for(var t=0;t<this.arabicCharTable.length;t++)this.arabicMapTable.setValue(this.arabicCharTable[t][0],this.arabicCharTable[t])}return t.prototype.getCharacterShape=function(t,e){if(t>=this.hamza&&t<=this.bwhb){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t)[e+1]}else if(t>=this.lwawm&&t<=this.lwa)return t;return t},t.prototype.shape=function(t,e){for(var i="",r="",n=0;n<t.length;n++){var o=t[n];o>=""&&o<="ۿ"?r+=o:(r.length>0&&(i+=s=this.doShape(r.toString(),0),r=""),i+=o)}if(r.length>0){var s=this.doShape(r.toString(),0);i+=s}return i.toString()},t.prototype.doShape=function(t,e){for(var i="",r=0,n=0,o="",s=new Wt,a=new Wt;n<t.length;)if(o=t[n++],0===this.ligature(o,a)){var h=this.getShapeCount(o);r=1===h?0:2,s.Shapes>2&&(r+=1),r%=a.Shapes,a.Value=this.getCharacterShape(a.Value,r),i=this.append(i,s,e),s=a,(a=new Wt).Value=o,a.Shapes=h,a.Ligature++}return r=s.Shapes>2?1:0,r%=a.Shapes,a.Value=this.getCharacterShape(a.Value,r),i=this.append(i,s,e),(i=this.append(i,a,e)).toString()},t.prototype.append=function(t,e,i){return""!==e.Value&&(t+=e.Value,e.Ligature-=1,""!==e.Type&&(0==(i&this.vowel)?(t+=e.Type,e.Ligature-=1):e.Ligature-=1),""!==e.vowel&&(0==(i&this.vowel)?(t+=e.vowel,e.Ligature-=1):e.Ligature-=1)),t},t.prototype.ligature=function(t,e){if(""!==e.Value){var i=0;if(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef){if(i=1,""!==e.vowel&&t!==this.shadda&&(i=2),t===this.shadda){if(null!=e.Type)return 0;e.Type=this.shadda}else t===this.hamzaBelow?e.Value===this.alef?(e.Value=this.alefHamzaBelow,i=2):t===this.lwa?(e.Value=this.lwawhb,i=2):e.Type=this.hamzaBelow:t===this.hamzaAbove?e.Value===this.alef?(e.Value=this.alefHamza,i=2):e.Value===this.lwa?(e.Value=this.lwawh,i=2):e.Value===this.waw?(e.Value=this.wawHamza,i=2):e.Value===this.yeh||e.Value===this.alefMaksura||e.Value===this.farsiYeh?(e.Value=this.yehHamza,i=2):e.Type=this.hamzaAbove:t===this.madda?e.Value===this.alef&&(e.Value=this.alefMadda,i=2):e.vowel=t;return 1===i&&e.Ligature++,i}return""!==e.vowel?0:(e.Value===this.lam&&(t===this.alef?(e.Value=this.lwa,e.Shapes=2,i=3):t===this.alefHamza?(e.Value=this.lwawh,e.Shapes=2,i=3):t===this.alefHamzaBelow?(e.Value=this.lwawhb,e.Shapes=2,i=3):t===this.alefMadda&&(e.Value=this.lwawm,e.Shapes=2,i=3)),i)}return 0},t.prototype.getShapeCount=function(t){if(t>=this.hamza&&t<=this.bwhb&&!(t>=this.fathatan&&t<=this.hamzaBelow||t===this.superScriptalef)){if(this.arabicMapTable.getValue(t))return this.arabicMapTable.getValue(t).length-1}else if(t===this.zeroWidthJoiner)return 4;return 1},t}(),Wt=function(){function t(){this.shapeValue="",this.shapeType="",this.shapeVowel="",this.shapeLigature=0,this.shapeShapes=1}return Object.defineProperty(t.prototype,"Value",{get:function(){return this.shapeValue},set:function(t){this.shapeValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Type",{get:function(){return this.shapeType},set:function(t){this.shapeType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vowel",{get:function(){return this.shapeVowel},set:function(t){this.shapeVowel=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Ligature",{get:function(){return this.shapeLigature},set:function(t){this.shapeLigature=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Shapes",{get:function(){return this.shapeShapes},set:function(t){this.shapeShapes=t},enumerable:!0,configurable:!0}),t}(),Ht=function(){function t(){this.indexes=[],this.indexLevels=[],this.mirroringShapeCharacters=new n,this.update()}return t.prototype.doMirrorShaping=function(t){for(var e=[],i=0;i<t.length;i++)1==(1&this.indexLevels[i])&&this.mirroringShapeCharacters.containsKey(t[i].charCodeAt(0))?e[i]=String.fromCharCode(this.mirroringShapeCharacters.getValue(t[i].charCodeAt(0))):e[i]=t[i].toString();for(var r="",n=0;n<e.length;n++)r+=e[n];return r},t.prototype.getLogicalToVisualString=function(t,e){var i=new _t;this.indexLevels=i.getVisualOrder(t,e),this.setDefaultIndexLevel(),this.doOrder(0,this.indexLevels.length-1);for(var r=this.doMirrorShaping(t),n="",o=0;o<this.indexes.length;o++)n+=r[this.indexes[o]];return n.toString()},t.prototype.setDefaultIndexLevel=function(){for(var t=0;t<this.indexLevels.length;t++)this.indexes[t]=t},t.prototype.doOrder=function(t,e){for(var i=this.indexLevels[t],r=i,n=i,o=i,s=t+1;s<=e;++s){var a=this.indexLevels[s];a>i?i=a:a<r&&(r=a),n&=a,o|=a}if(0!=(1&o)){if(1==(1&n))return void this.reArrange(t,e+1);for(r|=1;i>=r;){for(var h=t;;){for(;h<=e&&!(this.indexLevels[h]>=i);)h+=1;if(h>e)break;for(var l=h+1;l<=e&&!(this.indexLevels[l]<i);)l+=1;this.reArrange(h,l),h=l+1}i-=1}}},t.prototype.reArrange=function(t,e){var i=(t+e)/2;for(--e;t<i;++t,--e){var r=this.indexes[t];this.indexes[t]=this.indexes[e],this.indexes[e]=r}},t.prototype.update=function(){this.mirroringShapeCharacters.setValue(40,41),this.mirroringShapeCharacters.setValue(41,40),this.mirroringShapeCharacters.setValue(60,62),this.mirroringShapeCharacters.setValue(62,60),this.mirroringShapeCharacters.setValue(91,93),this.mirroringShapeCharacters.setValue(93,91),this.mirroringShapeCharacters.setValue(123,125),this.mirroringShapeCharacters.setValue(125,123),this.mirroringShapeCharacters.setValue(171,187),this.mirroringShapeCharacters.setValue(187,171),this.mirroringShapeCharacters.setValue(8249,8250),this.mirroringShapeCharacters.setValue(8250,8249),this.mirroringShapeCharacters.setValue(8261,8262),this.mirroringShapeCharacters.setValue(8262,8261),this.mirroringShapeCharacters.setValue(8317,8318),this.mirroringShapeCharacters.setValue(8318,8317),this.mirroringShapeCharacters.setValue(8333,8334),this.mirroringShapeCharacters.setValue(8334,8333),this.mirroringShapeCharacters.setValue(8712,8715),this.mirroringShapeCharacters.setValue(8713,8716),this.mirroringShapeCharacters.setValue(8714,8717),this.mirroringShapeCharacters.setValue(8715,8712),this.mirroringShapeCharacters.setValue(8716,8713),this.mirroringShapeCharacters.setValue(8717,8714),this.mirroringShapeCharacters.setValue(8725,10741),this.mirroringShapeCharacters.setValue(8764,8765),this.mirroringShapeCharacters.setValue(8765,8764),this.mirroringShapeCharacters.setValue(8771,8909),this.mirroringShapeCharacters.setValue(8786,8787),this.mirroringShapeCharacters.setValue(8787,8786),this.mirroringShapeCharacters.setValue(8788,8789),this.mirroringShapeCharacters.setValue(8789,8788),this.mirroringShapeCharacters.setValue(8804,8805),this.mirroringShapeCharacters.setValue(8805,8804),this.mirroringShapeCharacters.setValue(8806,8807),this.mirroringShapeCharacters.setValue(8807,8806),this.mirroringShapeCharacters.setValue(8808,8809),this.mirroringShapeCharacters.setValue(8809,8808),this.mirroringShapeCharacters.setValue(8810,8811),this.mirroringShapeCharacters.setValue(8811,8810),this.mirroringShapeCharacters.setValue(8814,8815),this.mirroringShapeCharacters.setValue(8815,8814),this.mirroringShapeCharacters.setValue(8816,8817),this.mirroringShapeCharacters.setValue(8817,8816),this.mirroringShapeCharacters.setValue(8818,8819),this.mirroringShapeCharacters.setValue(8819,8818),this.mirroringShapeCharacters.setValue(8820,8821),this.mirroringShapeCharacters.setValue(8821,8820),this.mirroringShapeCharacters.setValue(8822,8823),this.mirroringShapeCharacters.setValue(8823,8822),this.mirroringShapeCharacters.setValue(8824,8825),this.mirroringShapeCharacters.setValue(8825,8824),this.mirroringShapeCharacters.setValue(8826,8827),this.mirroringShapeCharacters.setValue(8827,8826),this.mirroringShapeCharacters.setValue(8828,8829),this.mirroringShapeCharacters.setValue(8829,8828),this.mirroringShapeCharacters.setValue(8830,8831),this.mirroringShapeCharacters.setValue(8831,8830),this.mirroringShapeCharacters.setValue(8832,8833),this.mirroringShapeCharacters.setValue(8833,8832),this.mirroringShapeCharacters.setValue(8834,8835),this.mirroringShapeCharacters.setValue(8835,8834),this.mirroringShapeCharacters.setValue(8836,8837),this.mirroringShapeCharacters.setValue(8837,8836),this.mirroringShapeCharacters.setValue(8838,8839),this.mirroringShapeCharacters.setValue(8839,8838),this.mirroringShapeCharacters.setValue(8840,8841),this.mirroringShapeCharacters.setValue(8841,8840),this.mirroringShapeCharacters.setValue(8842,8843),this.mirroringShapeCharacters.setValue(8843,8842),this.mirroringShapeCharacters.setValue(8847,8848),this.mirroringShapeCharacters.setValue(8848,8847),this.mirroringShapeCharacters.setValue(8849,8850),this.mirroringShapeCharacters.setValue(8850,8849),this.mirroringShapeCharacters.setValue(8856,10680),this.mirroringShapeCharacters.setValue(8866,8867),this.mirroringShapeCharacters.setValue(8867,8866),this.mirroringShapeCharacters.setValue(8870,10974),this.mirroringShapeCharacters.setValue(8872,10980),this.mirroringShapeCharacters.setValue(8873,10979),this.mirroringShapeCharacters.setValue(8875,10981),this.mirroringShapeCharacters.setValue(8880,8881),this.mirroringShapeCharacters.setValue(8881,8880),this.mirroringShapeCharacters.setValue(8882,8883),this.mirroringShapeCharacters.setValue(8883,8882),this.mirroringShapeCharacters.setValue(8884,8885),this.mirroringShapeCharacters.setValue(8885,8884),this.mirroringShapeCharacters.setValue(8886,8887),this.mirroringShapeCharacters.setValue(8887,8886),this.mirroringShapeCharacters.setValue(8905,8906),this.mirroringShapeCharacters.setValue(8906,8905),this.mirroringShapeCharacters.setValue(8907,8908),this.mirroringShapeCharacters.setValue(8908,8907),this.mirroringShapeCharacters.setValue(8909,8771),this.mirroringShapeCharacters.setValue(8912,8913),this.mirroringShapeCharacters.setValue(8913,8912),this.mirroringShapeCharacters.setValue(8918,8919),this.mirroringShapeCharacters.setValue(8919,8918),this.mirroringShapeCharacters.setValue(8920,8921),this.mirroringShapeCharacters.setValue(8921,8920),this.mirroringShapeCharacters.setValue(8922,8923),this.mirroringShapeCharacters.setValue(8923,8922),this.mirroringShapeCharacters.setValue(8924,8925),this.mirroringShapeCharacters.setValue(8925,8924),this.mirroringShapeCharacters.setValue(8926,8927),this.mirroringShapeCharacters.setValue(8927,8926),this.mirroringShapeCharacters.setValue(8928,8929),this.mirroringShapeCharacters.setValue(8929,8928),this.mirroringShapeCharacters.setValue(8930,8931),this.mirroringShapeCharacters.setValue(8931,8930),this.mirroringShapeCharacters.setValue(8932,8933),this.mirroringShapeCharacters.setValue(8933,8932),this.mirroringShapeCharacters.setValue(8934,8935),this.mirroringShapeCharacters.setValue(8935,8934),this.mirroringShapeCharacters.setValue(8936,8937),this.mirroringShapeCharacters.setValue(8937,8936),this.mirroringShapeCharacters.setValue(8938,8939),this.mirroringShapeCharacters.setValue(8939,8938),this.mirroringShapeCharacters.setValue(8940,8941),this.mirroringShapeCharacters.setValue(8941,8940),this.mirroringShapeCharacters.setValue(8944,8945),this.mirroringShapeCharacters.setValue(8945,8944),this.mirroringShapeCharacters.setValue(8946,8954),this.mirroringShapeCharacters.setValue(8947,8955),this.mirroringShapeCharacters.setValue(8948,8956),this.mirroringShapeCharacters.setValue(8950,8957),this.mirroringShapeCharacters.setValue(8951,8958),this.mirroringShapeCharacters.setValue(8954,8946),this.mirroringShapeCharacters.setValue(8955,8947),this.mirroringShapeCharacters.setValue(8956,8948),this.mirroringShapeCharacters.setValue(8957,8950),this.mirroringShapeCharacters.setValue(8958,8951),this.mirroringShapeCharacters.setValue(8968,8969),this.mirroringShapeCharacters.setValue(8969,8968),this.mirroringShapeCharacters.setValue(8970,8971),this.mirroringShapeCharacters.setValue(8971,8970),this.mirroringShapeCharacters.setValue(9001,9002),this.mirroringShapeCharacters.setValue(9002,9001),this.mirroringShapeCharacters.setValue(10088,10089),this.mirroringShapeCharacters.setValue(10089,10088),this.mirroringShapeCharacters.setValue(10090,10091),this.mirroringShapeCharacters.setValue(10091,10090),this.mirroringShapeCharacters.setValue(10092,10093),this.mirroringShapeCharacters.setValue(10093,10092),this.mirroringShapeCharacters.setValue(10094,10095),this.mirroringShapeCharacters.setValue(10095,10094),this.mirroringShapeCharacters.setValue(10096,10097),this.mirroringShapeCharacters.setValue(10097,10096),this.mirroringShapeCharacters.setValue(10098,10099),this.mirroringShapeCharacters.setValue(10099,10098),this.mirroringShapeCharacters.setValue(10100,10101),this.mirroringShapeCharacters.setValue(10101,10100),this.mirroringShapeCharacters.setValue(10197,10198),this.mirroringShapeCharacters.setValue(10198,10197),this.mirroringShapeCharacters.setValue(10205,10206),this.mirroringShapeCharacters.setValue(10206,10205),this.mirroringShapeCharacters.setValue(10210,10211),this.mirroringShapeCharacters.setValue(10211,10210),this.mirroringShapeCharacters.setValue(10212,10213),this.mirroringShapeCharacters.setValue(10213,10212),this.mirroringShapeCharacters.setValue(10214,10215),this.mirroringShapeCharacters.setValue(10215,10214),this.mirroringShapeCharacters.setValue(10216,10217),this.mirroringShapeCharacters.setValue(10217,10216),this.mirroringShapeCharacters.setValue(10218,10219),this.mirroringShapeCharacters.setValue(10219,10218),this.mirroringShapeCharacters.setValue(10627,10628),this.mirroringShapeCharacters.setValue(10628,10627),this.mirroringShapeCharacters.setValue(10629,10630),this.mirroringShapeCharacters.setValue(10630,10629),this.mirroringShapeCharacters.setValue(10631,10632),this.mirroringShapeCharacters.setValue(10632,10631),this.mirroringShapeCharacters.setValue(10633,10634),this.mirroringShapeCharacters.setValue(10634,10633),this.mirroringShapeCharacters.setValue(10635,10636),this.mirroringShapeCharacters.setValue(10636,10635),this.mirroringShapeCharacters.setValue(10637,10640),this.mirroringShapeCharacters.setValue(10638,10639),this.mirroringShapeCharacters.setValue(10639,10638),this.mirroringShapeCharacters.setValue(10640,10637),this.mirroringShapeCharacters.setValue(10641,10642),this.mirroringShapeCharacters.setValue(10642,10641),this.mirroringShapeCharacters.setValue(10643,10644),this.mirroringShapeCharacters.setValue(10644,10643),this.mirroringShapeCharacters.setValue(10645,10646),this.mirroringShapeCharacters.setValue(10646,10645),this.mirroringShapeCharacters.setValue(10647,10648),this.mirroringShapeCharacters.setValue(10648,10647),this.mirroringShapeCharacters.setValue(10680,8856),this.mirroringShapeCharacters.setValue(10688,10689),this.mirroringShapeCharacters.setValue(10689,10688),this.mirroringShapeCharacters.setValue(10692,10693),this.mirroringShapeCharacters.setValue(10693,10692),this.mirroringShapeCharacters.setValue(10703,10704),this.mirroringShapeCharacters.setValue(10704,10703),this.mirroringShapeCharacters.setValue(10705,10706),this.mirroringShapeCharacters.setValue(10706,10705),this.mirroringShapeCharacters.setValue(10708,10709),this.mirroringShapeCharacters.setValue(10709,10708),this.mirroringShapeCharacters.setValue(10712,10713),this.mirroringShapeCharacters.setValue(10713,10712),this.mirroringShapeCharacters.setValue(10714,10715),this.mirroringShapeCharacters.setValue(10715,10714),this.mirroringShapeCharacters.setValue(10741,8725),this.mirroringShapeCharacters.setValue(10744,10745),this.mirroringShapeCharacters.setValue(10745,10744),this.mirroringShapeCharacters.setValue(10748,10749),this.mirroringShapeCharacters.setValue(10749,10748),this.mirroringShapeCharacters.setValue(10795,10796),this.mirroringShapeCharacters.setValue(10796,10795),this.mirroringShapeCharacters.setValue(10797,10796),this.mirroringShapeCharacters.setValue(10798,10797),this.mirroringShapeCharacters.setValue(10804,10805),this.mirroringShapeCharacters.setValue(10805,10804),this.mirroringShapeCharacters.setValue(10812,10813),this.mirroringShapeCharacters.setValue(10813,10812),this.mirroringShapeCharacters.setValue(10852,10853),this.mirroringShapeCharacters.setValue(10853,10852),this.mirroringShapeCharacters.setValue(10873,10874),this.mirroringShapeCharacters.setValue(10874,10873),this.mirroringShapeCharacters.setValue(10877,10878),this.mirroringShapeCharacters.setValue(10878,10877),this.mirroringShapeCharacters.setValue(10879,10880),this.mirroringShapeCharacters.setValue(10880,10879),this.mirroringShapeCharacters.setValue(10881,10882),this.mirroringShapeCharacters.setValue(10882,10881),this.mirroringShapeCharacters.setValue(10883,10884),this.mirroringShapeCharacters.setValue(10884,10883),this.mirroringShapeCharacters.setValue(10891,10892),this.mirroringShapeCharacters.setValue(10892,10891),this.mirroringShapeCharacters.setValue(10897,10898),this.mirroringShapeCharacters.setValue(10898,10897),this.mirroringShapeCharacters.setValue(10899,10900),this.mirroringShapeCharacters.setValue(10900,10899),this.mirroringShapeCharacters.setValue(10901,10902),this.mirroringShapeCharacters.setValue(10902,10901),this.mirroringShapeCharacters.setValue(10903,10904),this.mirroringShapeCharacters.setValue(10904,10903),this.mirroringShapeCharacters.setValue(10905,10906),this.mirroringShapeCharacters.setValue(10906,10905),this.mirroringShapeCharacters.setValue(10907,10908),this.mirroringShapeCharacters.setValue(10908,10907),this.mirroringShapeCharacters.setValue(10913,10914),this.mirroringShapeCharacters.setValue(10914,10913),this.mirroringShapeCharacters.setValue(10918,10919),this.mirroringShapeCharacters.setValue(10919,10918),this.mirroringShapeCharacters.setValue(10920,10921),this.mirroringShapeCharacters.setValue(10921,10920),this.mirroringShapeCharacters.setValue(10922,10923),this.mirroringShapeCharacters.setValue(10923,10922),this.mirroringShapeCharacters.setValue(10924,10925),this.mirroringShapeCharacters.setValue(10925,10924),this.mirroringShapeCharacters.setValue(10927,10928),this.mirroringShapeCharacters.setValue(10928,10927),this.mirroringShapeCharacters.setValue(10931,10932),this.mirroringShapeCharacters.setValue(10932,10931),this.mirroringShapeCharacters.setValue(10939,10940),this.mirroringShapeCharacters.setValue(10940,10939),this.mirroringShapeCharacters.setValue(10941,10942),this.mirroringShapeCharacters.setValue(10942,10941),this.mirroringShapeCharacters.setValue(10943,10944),this.mirroringShapeCharacters.setValue(10944,10943),this.mirroringShapeCharacters.setValue(10945,10946),this.mirroringShapeCharacters.setValue(10946,10945),this.mirroringShapeCharacters.setValue(10947,10948),this.mirroringShapeCharacters.setValue(10948,10947),this.mirroringShapeCharacters.setValue(10949,10950),this.mirroringShapeCharacters.setValue(10950,10949),this.mirroringShapeCharacters.setValue(10957,10958),this.mirroringShapeCharacters.setValue(10958,10957),this.mirroringShapeCharacters.setValue(10959,10960),this.mirroringShapeCharacters.setValue(10960,10959),this.mirroringShapeCharacters.setValue(10961,10962),this.mirroringShapeCharacters.setValue(10962,10961),this.mirroringShapeCharacters.setValue(10963,10964),this.mirroringShapeCharacters.setValue(10964,10963),this.mirroringShapeCharacters.setValue(10965,10966),this.mirroringShapeCharacters.setValue(10966,10965),this.mirroringShapeCharacters.setValue(10974,8870),this.mirroringShapeCharacters.setValue(10979,8873),this.mirroringShapeCharacters.setValue(10980,8872),this.mirroringShapeCharacters.setValue(10981,8875),this.mirroringShapeCharacters.setValue(10988,10989),this.mirroringShapeCharacters.setValue(10989,10988),this.mirroringShapeCharacters.setValue(10999,11e3),this.mirroringShapeCharacters.setValue(11e3,10999),this.mirroringShapeCharacters.setValue(11001,11002),this.mirroringShapeCharacters.setValue(11002,11001),this.mirroringShapeCharacters.setValue(12296,12297),this.mirroringShapeCharacters.setValue(12297,12296),this.mirroringShapeCharacters.setValue(12298,12299),this.mirroringShapeCharacters.setValue(12299,12298),this.mirroringShapeCharacters.setValue(12300,12301),this.mirroringShapeCharacters.setValue(12301,12300),this.mirroringShapeCharacters.setValue(12302,12303),this.mirroringShapeCharacters.setValue(12303,12302),this.mirroringShapeCharacters.setValue(12304,12305),this.mirroringShapeCharacters.setValue(12305,12304),this.mirroringShapeCharacters.setValue(12308,12309),this.mirroringShapeCharacters.setValue(12309,12308),this.mirroringShapeCharacters.setValue(12310,12311),this.mirroringShapeCharacters.setValue(12311,12310),this.mirroringShapeCharacters.setValue(12312,12313),this.mirroringShapeCharacters.setValue(12313,12312),this.mirroringShapeCharacters.setValue(12314,12315),this.mirroringShapeCharacters.setValue(12315,12314),this.mirroringShapeCharacters.setValue(65288,65289),this.mirroringShapeCharacters.setValue(65289,65288),this.mirroringShapeCharacters.setValue(65308,65310),this.mirroringShapeCharacters.setValue(65310,65308),this.mirroringShapeCharacters.setValue(65339,65341),this.mirroringShapeCharacters.setValue(65341,65339),this.mirroringShapeCharacters.setValue(65371,65373),this.mirroringShapeCharacters.setValue(65373,65371),this.mirroringShapeCharacters.setValue(65375,65376),this.mirroringShapeCharacters.setValue(65376,65375),this.mirroringShapeCharacters.setValue(65378,65379),this.mirroringShapeCharacters.setValue(65379,65378)},t}(),_t=function(){function t(){this.types=[],this.textOrder=-1,this.rtlCharacterTypes=new Array(65536),this.L=0,this.LRE=1,this.LRO=2,this.R=3,this.AL=4,this.RLE=5,this.RLO=6,this.PDF=7,this.EN=8,this.ES=9,this.ET=10,this.AN=11,this.CS=12,this.NSM=13,this.BN=14,this.B=15,this.S=16,this.WS=17,this.ON=18,this.charTypes=[this.L,this.EN,this.BN,this.ES,this.ES,this.S,this.ET,this.ET,this.B,this.AN,this.AN,this.S,this.CS,this.CS,this.WS,this.NSM,this.NSM,this.B,this.BN,27,this.BN,28,30,this.B,31,31,this.S,32,32,this.WS,33,34,this.ON,35,37,this.ET,38,42,this.ON,43,43,this.ET,44,44,this.CS,45,45,this.ET,46,46,this.CS,47,47,this.CS,48,57,this.EN,58,58,this.CS,59,64,this.ON,65,90,this.L,91,96,this.ON,97,122,this.L,123,126,this.ON,127,132,this.BN,133,133,this.B,134,159,this.BN,160,160,this.CS,161,161,this.ON,162,165,this.ET,166,169,this.ON,170,170,this.L,171,175,this.ON,176,177,this.ET,178,179,this.EN,180,180,this.ON,181,181,this.L,182,184,this.ON,185,185,this.EN,186,186,this.L,187,191,this.ON,192,214,this.L,215,215,this.ON,216,246,this.L,247,247,this.ON,248,696,this.L,697,698,this.ON,699,705,this.L,706,719,this.ON,720,721,this.L,722,735,this.ON,736,740,this.L,741,749,this.ON,750,750,this.L,751,767,this.ON,768,855,this.NSM,856,860,this.L,861,879,this.NSM,880,883,this.L,884,885,this.ON,886,893,this.L,894,894,this.ON,895,899,this.L,900,901,this.ON,902,902,this.L,903,903,this.ON,904,1013,this.L,1014,1014,this.ON,1015,1154,this.L,1155,1158,this.NSM,1159,1159,this.L,1160,1161,this.NSM,1162,1417,this.L,1418,1418,this.ON,1419,1424,this.L,1425,1441,this.NSM,1442,1442,this.L,1443,1465,this.NSM,1466,1466,this.L,1467,1469,this.NSM,1470,1470,this.R,1471,1471,this.NSM,1472,1472,this.R,1473,1474,this.NSM,1475,1475,this.R,1476,1476,this.NSM,1477,1487,this.L,1488,1514,this.R,1515,1519,this.L,1520,1524,this.R,1525,1535,this.L,1536,1539,this.AL,1540,1547,this.L,1548,1548,this.CS,1549,1549,this.AL,1550,1551,this.ON,1552,1557,this.NSM,1558,1562,this.L,1563,1563,this.AL,1564,1566,this.L,1567,1567,this.AL,1568,1568,this.L,1569,1594,this.AL,1595,1599,this.L,1600,1610,this.AL,1611,1624,this.NSM,1625,1631,this.L,1632,1641,this.AN,1642,1642,this.ET,1643,1644,this.AN,1645,1647,this.AL,1648,1648,this.NSM,1649,1749,this.AL,1750,1756,this.NSM,1757,1757,this.AL,1758,1764,this.NSM,1765,1766,this.AL,1767,1768,this.NSM,1769,1769,this.ON,1770,1773,this.NSM,1774,1775,this.AL,1776,1785,this.EN,1786,1805,this.AL,1806,1806,this.L,1807,1807,this.BN,1808,1808,this.AL,1809,1809,this.NSM,1810,1839,this.AL,1840,1866,this.NSM,1867,1868,this.L,1869,1871,this.AL,1872,1919,this.L,1920,1957,this.AL,1958,1968,this.NSM,1969,1969,this.AL,1970,2304,this.L,2305,2306,this.NSM,2307,2363,this.L,2364,2364,this.NSM,2365,2368,this.L,2369,2376,this.NSM,2377,2380,this.L,2381,2381,this.NSM,2382,2384,this.L,2385,2388,this.NSM,2389,2401,this.L,2402,2403,this.NSM,2404,2432,this.L,2433,2433,this.NSM,2434,2491,this.L,2492,2492,this.NSM,2493,2496,this.L,2497,2500,this.NSM,2501,2508,this.L,2509,2509,this.NSM,2510,2529,this.L,2530,2531,this.NSM,2532,2545,this.L,2546,2547,this.ET,2548,2560,this.L,2561,2562,this.NSM,2563,2619,this.L,2620,2620,this.NSM,2621,2624,this.L,2625,2626,this.NSM,2627,2630,this.L,2631,2632,this.NSM,2633,2634,this.L,2635,2637,this.NSM,2638,2671,this.L,2672,2673,this.NSM,2674,2688,this.L,2689,2690,this.NSM,2691,2747,this.L,2748,2748,this.NSM,2749,2752,this.L,2753,2757,this.NSM,2758,2758,this.L,2759,2760,this.NSM,2761,2764,this.L,2765,2765,this.NSM,2766,2785,this.L,2786,2787,this.NSM,2788,2800,this.L,2801,2801,this.ET,2802,2816,this.L,2817,2817,this.NSM,2818,2875,this.L,2876,2876,this.NSM,2877,2878,this.L,2879,2879,this.NSM,2880,2880,this.L,2881,2883,this.NSM,2884,2892,this.L,2893,2893,this.NSM,2894,2901,this.L,2902,2902,this.NSM,2903,2945,this.L,2946,2946,this.NSM,2947,3007,this.L,3008,3008,this.NSM,3009,3020,this.L,3021,3021,this.NSM,3022,3058,this.L,3059,3064,this.ON,3065,3065,this.ET,3066,3066,this.ON,3067,3133,this.L,3134,3136,this.NSM,3137,3141,this.L,3142,3144,this.NSM,3145,3145,this.L,3146,3149,this.NSM,3150,3156,this.L,3157,3158,this.NSM,3159,3259,this.L,3260,3260,this.NSM,3261,3275,this.L,3276,3277,this.NSM,3278,3392,this.L,3393,3395,this.NSM,3396,3404,this.L,3405,3405,this.NSM,3406,3529,this.L,3530,3530,this.NSM,3531,3537,this.L,3538,3540,this.NSM,3541,3541,this.L,3542,3542,this.NSM,3543,3632,this.L,3633,3633,this.NSM,3634,3635,this.L,3636,3642,this.NSM,3643,3646,this.L,3647,3647,this.ET,3648,3654,this.L,3655,3662,this.NSM,3663,3760,this.L,3761,3761,this.NSM,3762,3763,this.L,3764,3769,this.NSM,3770,3770,this.L,3771,3772,this.NSM,3773,3783,this.L,3784,3789,this.NSM,3790,3863,this.L,3864,3865,this.NSM,3866,3892,this.L,3893,3893,this.NSM,3894,3894,this.L,3895,3895,this.NSM,3896,3896,this.L,3897,3897,this.NSM,3898,3901,this.ON,3902,3952,this.L,3953,3966,this.NSM,3967,3967,this.L,3968,3972,this.NSM,3973,3973,this.L,3974,3975,this.NSM,3976,3983,this.L,3984,3991,this.NSM,3992,3992,this.L,3993,4028,this.NSM,4029,4037,this.L,4038,4038,this.NSM,4039,4140,this.L,4141,4144,this.NSM,4145,4145,this.L,4146,4146,this.NSM,4147,4149,this.L,4150,4151,this.NSM,4152,4152,this.L,4153,4153,this.NSM,4154,4183,this.L,4184,4185,this.NSM,4186,5759,this.L,5760,5760,this.WS,5761,5786,this.L,5787,5788,this.ON,5789,5905,this.L,5906,5908,this.NSM,5909,5937,this.L,5938,5940,this.NSM,5941,5969,this.L,5970,5971,this.NSM,5972,6001,this.L,6002,6003,this.NSM,6004,6070,this.L,6071,6077,this.NSM,6078,6085,this.L,6086,6086,this.NSM,6087,6088,this.L,6089,6099,this.NSM,6100,6106,this.L,6107,6107,this.ET,6108,6108,this.L,6109,6109,this.NSM,6110,6127,this.L,6128,6137,this.ON,6138,6143,this.L,6144,6154,this.ON,6155,6157,this.NSM,6158,6158,this.WS,6159,6312,this.L,6313,6313,this.NSM,6314,6431,this.L,6432,6434,this.NSM,6435,6438,this.L,6439,6443,this.NSM,6444,6449,this.L,6450,6450,this.NSM,6451,6456,this.L,6457,6459,this.NSM,6460,6463,this.L,6464,6464,this.ON,6465,6467,this.L,6468,6469,this.ON,6470,6623,this.L,6624,6655,this.ON,6656,8124,this.L,8125,8125,this.ON,8126,8126,this.L,8127,8129,this.ON,8130,8140,this.L,8141,8143,this.ON,8144,8156,this.L,8157,8159,this.ON,8160,8172,this.L,8173,8175,this.ON,8176,8188,this.L,8189,8190,this.ON,8191,8191,this.L,8192,8202,this.WS,8203,8205,this.BN,8206,8206,this.L,8207,8207,this.R,8208,8231,this.ON,8232,8232,this.WS,8233,8233,this.B,8234,8234,this.LRE,8235,8235,this.RLE,8236,8236,this.PDF,8237,8237,this.LRO,8238,8238,this.RLO,8239,8239,this.WS,8240,8244,this.ET,8245,8276,this.ON,8277,8278,this.L,8279,8279,this.ON,8280,8286,this.L,8287,8287,this.WS,8288,8291,this.BN,8292,8297,this.L,8298,8303,this.BN,8304,8304,this.EN,8305,8307,this.L,8308,8313,this.EN,8314,8315,this.ET,8316,8318,this.ON,8319,8319,this.L,8320,8329,this.EN,8330,8331,this.ET,8332,8334,this.ON,8335,8351,this.L,8352,8369,this.ET,8370,8399,this.L,8400,8426,this.NSM,8427,8447,this.L,8448,8449,this.ON,8450,8450,this.L,8451,8454,this.ON,8455,8455,this.L,8456,8457,this.ON,8458,8467,this.L,8468,8468,this.ON,8469,8469,this.L,8470,8472,this.ON,8473,8477,this.L,8478,8483,this.ON,8484,8484,this.L,8485,8485,this.ON,8486,8486,this.L,8487,8487,this.ON,8488,8488,this.L,8489,8489,this.ON,8490,8493,this.L,8494,8494,this.ET,8495,8497,this.L,8498,8498,this.ON,8499,8505,this.L,8506,8507,this.ON,8508,8511,this.L,8512,8516,this.ON,8517,8521,this.L,8522,8523,this.ON,8524,8530,this.L,8531,8543,this.ON,8544,8591,this.L,8592,8721,this.ON,8722,8723,this.ET,8724,9013,this.ON,9014,9082,this.L,9083,9108,this.ON,9109,9109,this.L,9110,9168,this.ON,9169,9215,this.L,9216,9254,this.ON,9255,9279,this.L,9280,9290,this.ON,9291,9311,this.L,9312,9371,this.EN,9372,9449,this.L,9450,9450,this.EN,9451,9751,this.ON,9752,9752,this.L,9753,9853,this.ON,9854,9855,this.L,9856,9873,this.ON,9874,9887,this.L,9888,9889,this.ON,9890,9984,this.L,9985,9988,this.ON,9989,9989,this.L,9990,9993,this.ON,9994,9995,this.L,9996,10023,this.ON,10024,10024,this.L,10025,10059,this.ON,10060,10060,this.L,10061,10061,this.ON,10062,10062,this.L,10063,10066,this.ON,10067,10069,this.L,10070,10070,this.ON,10071,10071,this.L,10072,10078,this.ON,10079,10080,this.L,10081,10132,this.ON,10133,10135,this.L,10136,10159,this.ON,10160,10160,this.L,10161,10174,this.ON,10175,10191,this.L,10192,10219,this.ON,10220,10223,this.L,10224,11021,this.ON,11022,11903,this.L,11904,11929,this.ON,11930,11930,this.L,11931,12019,this.ON,12020,12031,this.L,12032,12245,this.ON,12246,12271,this.L,12272,12283,this.ON,12284,12287,this.L,12288,12288,this.WS,12289,12292,this.ON,12293,12295,this.L,12296,12320,this.ON,12321,12329,this.L,12330,12335,this.NSM,12336,12336,this.ON,12337,12341,this.L,12342,12343,this.ON,12344,12348,this.L,12349,12351,this.ON,12352,12440,this.L,12441,12442,this.NSM,12443,12444,this.ON,12445,12447,this.L,12448,12448,this.ON,12449,12538,this.L,12539,12539,this.ON,12540,12828,this.L,12829,12830,this.ON,12831,12879,this.L,12880,12895,this.ON,12896,12923,this.L,12924,12925,this.ON,12926,12976,this.L,12977,12991,this.ON,12992,13003,this.L,13004,13007,this.ON,13008,13174,this.L,13175,13178,this.ON,13179,13277,this.L,13278,13279,this.ON,13280,13310,this.L,13311,13311,this.ON,13312,19903,this.L,19904,19967,this.ON,19968,42127,this.L,42128,42182,this.ON,42183,64284,this.L,64285,64285,this.R,64286,64286,this.NSM,64287,64296,this.R,64297,64297,this.ET,64298,64310,this.R,64311,64311,this.L,64312,64316,this.R,64317,64317,this.L,64318,64318,this.R,64319,64319,this.L,64320,64321,this.R,64322,64322,this.L,64323,64324,this.R,64325,64325,this.L,64326,64335,this.R,64336,64433,this.AL,64434,64466,this.L,64467,64829,this.AL,64830,64831,this.ON,64832,64847,this.L,64848,64911,this.AL,64912,64913,this.L,64914,64967,this.AL,64968,65007,this.L,65008,65020,this.AL,65021,65021,this.ON,65022,65023,this.L,65024,65039,this.NSM,65040,65055,this.L,65056,65059,this.NSM,65060,65071,this.L,65072,65103,this.ON,65104,65104,this.CS,65105,65105,this.ON,65106,65106,this.CS,65107,65107,this.L,65108,65108,this.ON,65109,65109,this.CS,65110,65118,this.ON,65119,65119,this.ET,65120,65121,this.ON,65122,65123,this.ET,65124,65126,this.ON,65127,65127,this.L,65128,65128,this.ON,65129,65130,this.ET,65131,65131,this.ON,65132,65135,this.L,65136,65140,this.AL,65141,65141,this.L,65142,65276,this.AL,65277,65278,this.L,65279,65279,this.BN,65280,65280,this.L,65281,65282,this.ON,65283,65285,this.ET,65286,65290,this.ON,65291,65291,this.ET,65292,65292,this.CS,65293,65293,this.ET,65294,65294,this.CS,65295,65295,this.ES,65296,65305,this.EN,65306,65306,this.CS,65307,65312,this.ON,65313,65338,this.L,65339,65344,this.ON,65345,65370,this.L,65371,65381,this.ON,65382,65503,this.L,65504,65505,this.ET,65506,65508,this.ON,65509,65510,this.ET,65511,65511,this.L,65512,65518,this.ON,65519,65528,this.L,65529,65531,this.BN,65532,65533,this.ON,65534,65535,this.L];for(var t=0;t<this.charTypes.length;++t)for(var e=this.charTypes[t],i=this.charTypes[++t],r=this.charTypes[++t];e<=i;)this.rtlCharacterTypes[e++]=r}return t.prototype.getVisualOrder=function(t,e){this.types=this.getCharacterCode(t),this.textOrder=e?this.LRE:this.L,this.doVisualOrder();for(var i=[],r=0;r<this.levels.length;r++)i[r]=this.levels[r];return i},t.prototype.getCharacterCode=function(t){for(var e=[],i=0;i<t.length;i++)e[i]=this.rtlCharacterTypes[t[i].charCodeAt(0)];return e},t.prototype.setDefaultLevels=function(){for(var t=0;t<this.length;t++)this.levels[t]=this.textOrder},t.prototype.setLevels=function(){this.setDefaultLevels();for(var t=0;t<this.length;++t){var e=this.levels[t];0!=(128&e)&&(e&=127,this.result[t]=0==(1&e)?this.L:this.R),this.levels[t]=e}},t.prototype.updateLevels=function(t,e,i){if(0==(1&e))for(r=t;r<i;++r)this.result[r]===this.R?this.levels[r]+=1:this.result[r]!==this.L&&(this.levels[r]+=2);else for(var r=t;r<i;++r)this.result[r]!==this.R&&(this.levels[r]+=1)},t.prototype.doVisualOrder=function(){this.length=this.types.length,this.result=this.types,this.levels=[],this.setLevels(),this.length=this.getEmbeddedCharactersLength();for(var t=this.textOrder,e=0;e<this.length;){for(var i=this.levels[e],r=0==(1&Math.max(t,i))?this.L:this.R,n=e+1;n<this.length&&this.levels[n]===i;)++n;var o=n<this.length?this.levels[n]:this.textOrder,s=0==(1&Math.max(o,i))?this.L:this.R;this.checkNSM(e,n,i,r,s),this.updateLevels(e,i,n),t=i,e=n}this.checkEmbeddedCharacters(this.length)},t.prototype.getEmbeddedCharactersLength=function(){for(var t=0,e=0;e<this.length;++e)this.types[e]!==this.LRE&&this.types[e]!==this.RLE&&this.types[e]!==this.LRO&&this.types[e]!==this.RLO&&this.types[e]!==this.PDF&&this.types[e]!==this.BN&&(this.result[t]=this.result[e],this.levels[t]=this.levels[e],t++);return t},t.prototype.checkEmbeddedCharacters=function(t){for(e=this.types.length-1;e>=0;--e)this.types[e]===this.LRE||this.types[e]===this.RLE||this.types[e]===this.LRO||this.types[e]===this.RLO||this.types[e]===this.PDF||this.types[e]===this.BN?(this.result[e]=this.types[e],this.levels[e]=-1):(t-=1,this.result[e]=this.result[t],this.levels[e]=this.levels[t]);for(var e=0;e<this.types.length;e++)-1===this.levels[e]&&(this.levels[e]=0===e?this.textOrder:this.levels[e-1])},t.prototype.checkNSM=function(t,e,i,r,n){for(var o=r,s=t;s<e;++s)this.result[s]===this.NSM?this.result[s]=o:o=this.result[s];this.checkEuropeanDigits(t,e,i,r,n)},t.prototype.checkEuropeanDigits=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN)for(var s=o-1;s>=t;--s)if(this.result[s]===this.L||this.result[s]===this.R||this.result[s]===this.AL){this.result[s]===this.AL&&(this.result[o]=this.AN);break}this.checkArabicCharacters(t,e,i,r,n)},t.prototype.checkArabicCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]===this.AL&&(this.result[o]=this.R);this.checkEuropeanNumberSeparator(t,e,i,r,n)},t.prototype.checkEuropeanNumberSeparator=function(t,e,i,r,n){for(var o=t+1;o<e-1;++o)if(this.result[o]===this.ES||this.result[o]===this.CS){var s=this.result[o-1],a=this.result[o+1];s===this.EN&&a===this.EN?this.result[o]=this.EN:this.result[o]===this.CS&&s===this.AN&&a===this.AN&&(this.result[o]=this.AN)}this.checkEuropeanNumberTerminator(t,e,i,r,n)},t.prototype.checkEuropeanNumberTerminator=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.ET){var s=o,a=[];a.push(this.ET);var h=this.getLength(s,e,a),l=s===t?r:this.result[s-1];if(l!==this.EN&&(l=h===e?n:this.result[h]),l===this.EN)for(var u=s;u<h;++u)this.result[u]=this.EN;o=h}this.checkOtherNeutrals(t,e,i,r,n)},t.prototype.checkOtherNeutrals=function(t,e,i,r,n){for(var o=t;o<e;++o)this.result[o]!==this.ES&&this.result[o]!==this.ET&&this.result[o]!==this.CS||(this.result[o]=this.ON);this.checkOtherCharacters(t,e,i,r,n)},t.prototype.checkOtherCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.EN){for(var s=r,a=o-1;a>=t;--a)if(this.result[a]===this.L||this.result[a]===this.R){s=this.result[a];break}s===this.L&&(this.result[o]=this.L)}this.checkCommanCharacters(t,e,i,r,n)},t.prototype.getLength=function(t,e,i){for(--t;++t<e;){for(var r=this.result[t],n=0;n<i.length;++n)r===i[n]&&(t=this.getLength(++t,e,i));return t}return e},t.prototype.checkCommanCharacters=function(t,e,i,r,n){for(var o=t;o<e;++o)if(this.result[o]===this.WS||this.result[o]===this.ON||this.result[o]===this.B||this.result[o]===this.S){var s=o,a=[this.B,this.S,this.WS,this.ON],h=this.getLength(s,e,a),l=0,u=0,c=0;s===t?l=r:(l=this.result[s-1])===this.AN?l=this.R:l===this.EN&&(l=this.R),h===e?u=n:(u=this.result[h])===this.AN?u=this.R:u===this.EN&&(u=this.R),c=l===u?l:0==(1&i)?this.L:this.R;for(var p=s;p<h;++p)this.result[p]=c;o=h}},t}(),Kt=function(){function e(){this.openBracket="(",this.closeBracket=")"}return e.prototype.layout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");var o=[];return e.Unicode?o=this.customLayout(t,i,n,e,r):(o=[])[0]=t,o},e.prototype.splitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customSplitLayout(t,e,i,r,n)},e.prototype.getGlyphIndex=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");if(r=null,0===t.length)return{success:!1,glyphs:r};var o=(new zt).shape(t,0),s=e.fontInternal.ttfReader;r=new Uint16Array(o.length);for(var a=0,h=0,l=o.length;h<l;h++){var u=o[h],c=s.getGlyph(u);null!==c&&void 0!==c&&(r[a++]=c.index)}return{success:!0,glyphs:r}},e.prototype.customLayout=function(e,i,r,n,o){if(null===o||void 0===o){if(null==e)throw new Error("ArgumentNullException : line");h=null;return null!==r&&void 0!==r&&r.textDirection!==t.PdfTextDirection.None&&(h=(new Ht).getLogicalToVisualString(e,i)),h}if(null==e)throw new Error("ArgumentNullException : line");if(null==n)throw new Error("ArgumentNullException : font");var s=null;if(null!==r&&void 0!==r&&r.textDirection!==t.PdfTextDirection.None){var a=(new zt).shape(e,0);s=this.customLayout(a,i,r)}var h=[];if(o){for(var l=s.split(""),u=l.length,c=0;c<u;c++)l[c]=this.addChars(n,l[c]);h=l}else(h=[])[0]=this.addChars(n,s);return h},e.prototype.addChars=function(t,e){var i=e;if(null==t)throw new Error("ArgumentNullException : font");if(null==i)throw new Error("ArgumentNullException : line");var r=i,n=t.fontInternal.ttfReader;t.setSymbols(r),r=n.convertString(r);var o=P.toUnicodeArray(r,!1);return r=P.byteToString(o)},e.prototype.customSplitLayout=function(t,e,i,r,n){if(null==t)throw new Error("ArgumentNullException : line");if(null==e)throw new Error("ArgumentNullException : font");return this.customLayout(t,i,n).split("")},e}();!function(t){t[t.Paginate=0]="Paginate",t[t.OnePage=1]="OnePage"}(t.PdfLayoutType||(t.PdfLayoutType={})),function(t){t[t.FitPage=0]="FitPage",t[t.FitElement=1]="FitElement",t[t.FitColumnsToPage=2]="FitColumnsToPage"}(t.PdfLayoutBreakType||(t.PdfLayoutBreakType={})),function(t){t[t.Start=0]="Start",t[t.Line=1]="Line",t[t.Bezier3=3]="Bezier3",t[t.Bezier=3]="Bezier",t[t.PathTypeMask=7]="PathTypeMask",t[t.DashMode=16]="DashMode",t[t.PathMarker=32]="PathMarker",t[t.CloseSubpath=128]="CloseSubpath"}(t.PathPointType||(t.PathPointType={}));var Ut=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qt=function(e){function i(i){var r=e.call(this)||this;return r.mbackground=new L(255,255,255),r.mbStroking=!1,r.mfunction=null,r.dictionaryProperties=new a,r.mpatternDictionary=new h,r.mpatternDictionary.items.setValue(r.dictionaryProperties.type,new o(r.dictionaryProperties.pattern)),r.mpatternDictionary.items.setValue(r.dictionaryProperties.patternType,new g(2)),r.shading=i,r.colorSpace=t.PdfColorSpace.Rgb,r}return Ut(i,e),Object.defineProperty(i.prototype,"background",{get:function(){return this.mbackground},set:function(t){this.mbackground=t;var e=this.shading;t.isEmpty?e.remove(this.dictionaryProperties.background):e.items.setValue(this.dictionaryProperties.background,t.toArray(this.colorSpace))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"antiAlias",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.antiAlias).value},set:function(t){var e=this.shading,i=e.items.getValue(this.dictionaryProperties.antiAlias);null==i&&void 0===i?(i=new ct(t),e.items.setValue(this.dictionaryProperties.antiAlias,i)):i.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"function",{get:function(){return this.mfunction},set:function(t){this.mfunction=t,null!=t&&void 0!==t?this.shading.items.setValue(this.dictionaryProperties.function,new C(this.mfunction)):this.shading.remove(this.dictionaryProperties.function)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bBox",{get:function(){return this.shading.items.getValue(this.dictionaryProperties.bBox)},set:function(t){var e=this.shading;null==t&&void 0===t?e.remove(this.dictionaryProperties.bBox):e.items.setValue(this.dictionaryProperties.bBox,t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"colorSpace",{get:function(){return this.mcolorSpace},set:function(t){var e=this.shading.items.getValue(this.dictionaryProperties.colorSpace);if(t!==this.mcolorSpace||null==e){this.mcolorSpace=t;var i=this.colorSpaceToDeviceName(t);this.shading.items.setValue(this.dictionaryProperties.colorSpace,new o(i))}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stroking",{get:function(){return this.mbStroking},set:function(t){this.mbStroking=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"patternDictionary",{get:function(){return null==this.mpatternDictionary&&(this.mpatternDictionary=new h),this.mpatternDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"shading",{get:function(){return this.mshading},set:function(t){if(null==t)throw new Error("ArgumentNullException : Shading");t!==this.mshading&&(this.mshading=t,this.patternDictionary.items.setValue(this.dictionaryProperties.shading,new C(this.mshading)))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"matrix",{get:function(){return this.mmatrix},set:function(t){if(null==t)throw new Error("ArgumentNullException : Matrix");if(t!==this.mmatrix){this.mmatrix=t.clone();var e=new m(this.mmatrix.matrix.elements);this.mpatternDictionary.items.setValue(this.dictionaryProperties.matrix,e)}},enumerable:!0,configurable:!0}),i.prototype.monitorChanges=function(t,e,r,n,o){var s=!1;if(t instanceof i){this.colorSpace!==o&&(this.colorSpace=o,this.resetFunction()),e.setColorSpace("Pattern",this.mbStroking);var a=r.getResources().getName(this);e.setColourWithPattern(null,a,this.mbStroking),s=!0}return s},i.prototype.resetChanges=function(t){},i.prototype.colorSpaceToDeviceName=function(e){var i;switch(e){case t.PdfColorSpace.Rgb:i="DeviceRGB"}return i},i.prototype.resetPatternDictionary=function(t){this.mpatternDictionary=t},i.prototype.cloneAntiAliasingValue=function(t){if(null==t)throw new Error("ArgumentNullException : brush");var e=this.shading.items.getValue(this.dictionaryProperties.antiAlias);null!=e&&t.shading.items.setValue(this.dictionaryProperties.antiAlias,new ct(e.value))},i.prototype.cloneBackgroundValue=function(t){var e=this.background;e.isEmpty||(t.background=e)},Object.defineProperty(i.prototype,"element",{get:function(){return this.patternDictionary},enumerable:!0,configurable:!0}),i}(R),Yt=function(){function t(t,e){if(this.dictionaryProperties=new a,this.writeTransformation=!0,void 0===t);else if(t instanceof j&&void 0===e){this.content=new b;var i=new j(t.width,t.height);this.setSize(i),this.initialize()}else this.content=new b,this.setSize(new j(t,e)),this.initialize()}return Object.defineProperty(t.prototype,"size",{get:function(){return this.templateSize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.size.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"graphics",{get:function(){if(null==this.pdfGraphics||void 0===this.pdfGraphics){var t=new ee(this),e=new te(this.size,t,this.content);this.pdfGraphics=e,this.pdfGraphics.initializeCoordinates()}return this.pdfGraphics},enumerable:!0,configurable:!0}),t.prototype.getResources=function(){return null==this.resources&&(this.resources=new Jt,this.content.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},t.prototype.initialize=function(){this.addType(),this.addSubType()},t.prototype.addType=function(){var t=new o(this.dictionaryProperties.xObject);this.content.items.setValue(this.dictionaryProperties.type,t)},t.prototype.addSubType=function(){var t=new o(this.dictionaryProperties.form);this.content.items.setValue(this.dictionaryProperties.subtype,t)},t.prototype.reset=function(t){void 0===t?(null!=this.resources&&(this.resources=null,this.content.remove(this.dictionaryProperties.resources)),null!=this.graphics&&this.graphics.reset(this.size)):(this.setSize(t),this.reset())},t.prototype.setSize=function(t){var e=new k(new T(0,0),t),i=m.fromRectangle(e);this.content.items.setValue(this.dictionaryProperties.bBox,i),this.templateSize=t},Object.defineProperty(t.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),t}(),Xt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jt=function(t){function e(e){var i=t.call(this,e)||this;return i.properties=new h,i}return Xt(e,t),Object.defineProperty(e.prototype,"names",{get:function(){return this.getNames()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"document",{get:function(){return this.pdfDocument},set:function(t){this.pdfDocument=t},enumerable:!0,configurable:!0}),e.prototype.getName=function(t){var e=t.element,i=null;if(this.names.containsKey(e)&&(i=this.names.getValue(e)),null==i){var r=this.generateName();i=new o(r),this.names.setValue(e,i),t instanceof G?this.add(t,i):t instanceof Yt?this.add(t,i):t instanceof qt||t instanceof Qt?this.add(t,i):t instanceof nt?this.add(t,i):(t instanceof ft||t instanceof mt)&&this.add(t,i)}return i},e.prototype.getNames=function(){null==this.pdfNames&&(this.pdfNames=new rt);var t=this.items.getValue(this.dictionaryProperties.font);if(null!=t){q.dereference(t)}return this.pdfNames},e.prototype.requireProcedureSet=function(t){if(null==t)throw new Error("ArgumentNullException:procedureSetName");var e=this.items.getValue(this.dictionaryProperties.procset);null==e&&(e=new m,this.items.setValue(this.dictionaryProperties.procset,e));var i=new o(t);e.contains(i)||e.add(i)},e.prototype.removeFont=function(t){for(var e=null,i=this.pdfNames.keys(),r=0;r<this.pdfNames.size();r++)if(this.pdfNames.getValue(i[r])===new o(t)){e=i[r];break}null!=e&&this.pdfNames.remove(e)},e.prototype.generateName=function(){return Zt.getNewGuidString()},e.prototype.add=function(t,e){if(t instanceof G){var i=null,r=this.items.getValue(this.dictionaryProperties.font);if(null!=r){f=r;i=r,i=r}else i=new h,this.items.setValue(this.dictionaryProperties.font,i);i.items.setValue(e.value,new C(t.element))}else if(t instanceof Yt){a=void 0;null==(a=this.items.getValue(this.dictionaryProperties.xObject))&&(a=new h,this.items.setValue(this.dictionaryProperties.xObject,a)),a.items.setValue(e.value,new C(t.element))}else if(t instanceof R){if((t instanceof qt||t instanceof Qt)&&null!=(o=t.element)){var n=this.items.getValue(this.dictionaryProperties.pattern);null==n&&(n=new h,this.items.setValue(this.dictionaryProperties.pattern,n)),n.items.setValue(e.value,new C(o))}}else if(t instanceof nt){var o=t.element,s=null;null==(s=this.items.getValue(this.dictionaryProperties.extGState))&&(s=new h,this.items.setValue(this.dictionaryProperties.extGState,s)),s.items.setValue(e.value,new C(o))}else{var a=this.Dictionary.items.getValue(this.dictionaryProperties.xObject),l=void 0;void 0!==this.pdfDocument&&(l=this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.getValue(this.dictionaryProperties.xObject));this.Dictionary.items.values();var u=!1,c=void 0;if(void 0===this.pdfDocument||void 0!==typeof l&&null!=l){if(void 0!==this.pdfDocument)for(var p=l.items.values(),d=0;d<p.length;d++)void 0!==p[d]&&void 0!==p[d].element&&p[d].element.data[0]===t.element.data[0]&&(c=p[d],u=!0)}else l=new h,this.pdfDocument.sections.element.items.getValue(this.dictionaryProperties.resources).items.setValue(this.dictionaryProperties.xObject,l);if(null==a&&(a=new h,this.Dictionary.items.setValue(this.dictionaryProperties.xObject,a)),u&&void 0!==c)a.items.setValue(e.value,c);else{var f=new C(t.element);a.items.setValue(e.value,f),void 0!==this.pdfDocument&&l.items.setValue(e.value,f)}}},e}(h),Zt=function(){function t(){}return t.getNewGuidString=function(){return"aaaaaaaa-aaaa-4aaa-baaa-aaaaaaaaaaaa".replace(/[ab]/g,function(t){var e=16*Math.random()|0;return("a"===t?e:3&e|8).toString(16)})},t}(),$t=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qt=function(t){function e(e,i){var r=t.call(this)||this;r.mStroking=!1,r.mLocation=new T(0,0),r.mDictionaryProperties=new a;var n=null;return e instanceof V?n=e:e instanceof j&&(n=new V(0,0,e.width,e.height)),null!==i&&i instanceof ce&&(r.mPage=i),r.brushStream=new b,r.mResources=new Jt,r.brushStream.items.setValue(r.mDictionaryProperties.resources,r.mResources),r.setBox(n),r.setObligatoryFields(),null!==i&&i instanceof ce&&(r.mPage=i,r.graphics.colorSpace=i.document.colorSpace),r}return $t(e,t),e.prototype.initialize=function(t,e,i,r){this.mPage=e,this.mLocation=i,this.mTransformationMatrix=r,this.tempBrushStream=this.brushStream,this.brushStream=new b;var n=new Jt;return this.brushStream.items.setValue(this.mDictionaryProperties.resources,n),this.setBox(t),this.setObligatoryFields(),this},Object.defineProperty(e.prototype,"location",{get:function(){return this.mLocation},set:function(t){this.mLocation=t},enumerable:!0,configurable:!0}),e.prototype.setObligatoryFields=function(){if(this.brushStream.items.setValue(this.mDictionaryProperties.patternType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.paintType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.tilingType,new g(1)),this.brushStream.items.setValue(this.mDictionaryProperties.xStep,new g(this.mBox.right-this.mBox.left)),this.brushStream.items.setValue(this.mDictionaryProperties.yStep,new g(this.mBox.bottom-this.mBox.top)),null!=this.mPage&&null!=this.mLocation)if(null==this.mTransformationMatrix&&void 0===this.mTransformationMatrix){t=this.mPage.size.height%this.rectangle.size.height-this.mLocation.y;this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m([1,0,0,1,this.mLocation.x,t]))}else{var t=0,e=this.mTransformationMatrix.matrix.elements;t=this.mPage.size.height>this.rectangle.size.height?this.mTransformationMatrix.matrix.offsetY-this.mPage.size.height%this.rectangle.size.height:this.mPage.size.height%this.rectangle.size.height+this.mTransformationMatrix.matrix.offsetY,this.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m([e[0],e[1],e[2],e[3],e[4],t]))}},e.prototype.setBox=function(t){this.mBox=t;var e=new k(this.mBox.left,this.mBox.top,this.mBox.right,this.mBox.bottom);this.brushStream.items.setValue(this.mDictionaryProperties.bBox,m.fromRectangle(e))},Object.defineProperty(e.prototype,"rectangle",{get:function(){return this.mBox},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.mBox.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){if(null==this.mGraphics&&void 0===this.mGraphics){var t=new ee(this),e=new te(this.size,t,this.brushStream);this.mGraphics=e,this.mResources=this.getResources(),this.mGraphics.initializeCoordinates()}return this.mGraphics},enumerable:!0,configurable:!0}),e.prototype.getResources=function(){return this.mResources},Object.defineProperty(e.prototype,"stroking",{get:function(){return this.mStroking},set:function(t){this.mStroking=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=this.initialize(this.rectangle,this.mPage,this.location,this.mTransformationMatrix);return null!=this.mTransformationMatrix&&null!=this.mTransformationMatrix.matrix&&t.brushStream.items.setValue(this.mDictionaryProperties.matrix,new m(this.mTransformationMatrix.matrix.elements)),t.brushStream.data=this.tempBrushStream.data,t.mResources=new Jt(this.mResources),t.brushStream.items.setValue(this.mDictionaryProperties.resources,t.mResources),t},e.prototype.monitorChanges=function(t,i,r,n,o){var s=!1;if(t!==this){i.setColorSpace("Pattern",this.mStroking);var a=r.getResources().getName(this);i.setColourWithPattern(null,a,this.mStroking),s=!0}else if(t instanceof e){i.setColorSpace("Pattern",this.mStroking);var h=r.getResources().getName(this);i.setColourWithPattern(null,h,this.mStroking),s=!0}return s},e.prototype.resetChanges=function(t){},Object.defineProperty(e.prototype,"element",{get:function(){return this.brushStream},enumerable:!0,configurable:!0}),e}(R),te=function(){function e(e,i,r){this.currentColorSpace=t.PdfColorSpace.Rgb,this.previousTextRenderingMode=t.TextRenderingMode.Fill,this.previousCharacterSpacing=0,this.previousWordSpacing=0,this.previousTextScaling=100,this.procedureSets=new it,this.isNormalRender=!0,this.isUseFontSize=!1,this.isItalic=!1,this.isEmfTextScaled=!1,this.isEmf=!1,this.isEmfPlus=!1,this.isBaselineFormat=!0,this.emfScalingFactor=new j(0,0),this.colorSpaceChanged=!1,this.dictionaryProperties=new a,this.isOverloadWithPosition=!1,this.isPointOverload=!1,this.currentColorSpaces=["RGB","CMYK","GrayScale","Indexed"],this.isImageOptimized=!1,this.graphicsState=[],this.istransparencySet=!1,this.internalAutomaticFields=null,this.startCutIndex=-1,this.getResources=i,this.canvasSize=e,this.pdfStreamWriter=r instanceof $?r:new $(r),this.initialize()}return Object.defineProperty(e.prototype,"stringLayoutResult",{get:function(){return this.pdfStringLayoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.canvasSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mediaBoxUpperRightBound",{get:function(){return void 0===this.internalMediaBoxUpperRightBound&&(this.internalMediaBoxUpperRightBound=0),this.internalMediaBoxUpperRightBound},set:function(t){this.internalMediaBoxUpperRightBound=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clientSize",{get:function(){return new j(this.clipBounds.width,this.clipBounds.height)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.currentColorSpace},set:function(t){this.currentColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"streamWriter",{get:function(){return this.pdfStreamWriter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matrix",{get:function(){return null==this.transformationMatrix&&(this.transformationMatrix=new tt),this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layer",{get:function(){return this.pageLayer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pageLayer.page},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"automaticFields",{get:function(){return null!=this.internalAutomaticFields&&void 0!==this.internalAutomaticFields||(this.internalAutomaticFields=new ot),this.internalAutomaticFields},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.bStateSaved=!1,this.currentPen=null,this.currentBrush=null,this.currentFont=null,this.currentColorSpace=t.PdfColorSpace.Rgb,this.bCSInitialized=!1,this.transformationMatrix=null,this.previousTextRenderingMode=-1,this.previousCharacterSpacing=-1,this.previousWordSpacing=-1,this.previousTextScaling=-100,this.currentStringFormat=null,this.clipBounds=new k(new T(0,0),this.size),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)},e.prototype.drawPdfTemplate=function(t,e,i){if(void 0===i){if(null==t)throw Error("ArgumentNullException-template");this.drawPdfTemplate(t,e,t.size)}else{if(null==t)throw Error("ArgumentNullException-template");var r=t.width>0?i.width/t.width:1,n=t.height>0?i.height/t.height:1,o=!(1===r&&1===n),s=this.save(),a=new tt;null!=this.pageLayer&&this.getTranslateTransform(e.x,e.y+i.height,a),o&&this.getScaleTransform(r,n,a),this.pdfStreamWriter.modifyCtm(a);var h=this.getResources.getResources().getName(t);this.pdfStreamWriter.executeObject(h),this.restore(s);var l=t.graphics;if(null!=l)for(var u=0;u<l.automaticFields.automaticFields.length;u++){var c=l.automaticFields.automaticFields[u],p=new T(c.location.x+e.x,c.location.y+e.y),d=0==t.size.width?0:i.width/t.size.width,f=0==t.size.height?0:i.height/t.size.height;this.automaticFields.add(new lt(c.field,p,d,f)),this.page.dictionary.modify()}this.getResources.getResources().requireProcedureSet(this.procedureSets.imageB),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageC),this.getResources.getResources().requireProcedureSet(this.procedureSets.imageI),this.getResources.getResources().requireProcedureSet(this.procedureSets.text)}},e.prototype.drawString=function(t,e,i,r,n,o,s,a,h){if("string"==typeof t&&e instanceof G&&(i instanceof Q||null===i)&&(r instanceof R||null===r)&&"number"==typeof n&&"number"==typeof o&&(s instanceof D||null===s)&&void 0===a)this.isOverloadWithPosition=!0,this.drawString(t,e,i,r,n,o,this.clientSize.width-n,0,s);else{var l=i,u=r,c=n,p=o,d=s,f=a,g=h,m=(new I).layout(t,e,g,new j(d,f),this.isOverloadWithPosition,this.clientSize);if(!m.empty){var y=this.checkCorrectLayoutRectangle(m.actualSize,c,p,g);d<=0&&(c=y.x,d=y.width),f<=0&&(p=y.y,f=y.height),this.drawStringLayoutResult(m,e,l,u,new k(c,p,d,f),g),this.isEmfTextScaled=!1,this.emfScalingFactor=new j(0,0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),this.isNormalRender=!0,this.pdfStringLayoutResult=m,this.isUseFontSize=!1}},e.prototype.drawLine=function(t,e,i,r,n){if(e instanceof T){var o=e,s=i;this.drawLine(t,o.x,o.y,s.x,s.y)}else{var o=e,s=i,a=r,h=n;this.stateControl(t,null,null);var l=this.streamWriter;l.beginPath(o,s),l.appendLineSegment(a,h),l.strokePath(),this.getResources.getResources().requireProcedureSet(this.procedureSets.pdf)}},e.prototype.drawRectangle=function(t,e,i,r,n,o){if(t instanceof Q&&"number"==typeof e){s=i;this.drawRectangle(t,null,e,s,r,n)}else if(t instanceof R&&"number"==typeof e){s=i;this.drawRectangle(null,t,e,s,r,n)}else{var s=i,a=r,h=n,l=o;if(e instanceof Qt){this.bCSInitialized=!1;var u=this.matrix.matrix.offsetX+s,c=void 0;c=null!=this.layer&&null!=this.layer.page?this.layer.page.size.height-this.matrix.matrix.offsetY+a:this.clientSize.height-this.matrix.matrix.offsetY+a,e.location=new T(u,c),e.graphics.colorSpace=this.colorSpace}else e instanceof qt&&(e.colorSpace=this.colorSpace);e instanceof A&&e.color.isEmpty&&(e=null);var p=t,d=e;this.stateControl(p,d,null),this.streamWriter.appendRectangle(s,a,h,l),this.drawPathHelper(p,d,!1)}},e.prototype.drawPathHelper=function(e,i,r,n){if("boolean"==typeof r){var o=r;this.drawPathHelper(e,i,t.PdfFillMode.Winding,o)}else{var s=null!=e,a=null!=i,h=(o=r)===t.PdfFillMode.Alternate;s&&a?this.streamWriter.fillStrokePath(h):s||a?s?this.streamWriter.strokePath():this.streamWriter.fillPath(h):this.streamWriter.endPath()}},e.prototype.drawImage=function(t,e,i,r,n){if("number"==typeof e&&"number"==typeof i&&void 0===r){var o=t.physicalDimension;this.drawImage(t,e,i,o.width,o.height)}else{var a=e,h=i,l=n;t.save();var u=new tt;this.getTranslateTransform(a,h+l,u),this.getScaleTransform(r,n,u),this.pdfStreamWriter.write("q"),this.pdfStreamWriter.modifyCtm(u);var c=this.getResources.getResources();void 0!==this.pageLayer&&null!=this.page&&(c.document=this.page.document);var p=c.getName(t);void 0!==this.pageLayer&&this.page.setResources(c),this.pdfStreamWriter.executeObject(p),this.pdfStreamWriter.write(s.restoreState),this.pdfStreamWriter.write(s.newLine);var d=this.getResources.getResources();d.requireProcedureSet(this.procedureSets.imageB),d.requireProcedureSet(this.procedureSets.imageC),d.requireProcedureSet(this.procedureSets.imageI),d.requireProcedureSet(this.procedureSets.text)}},e.prototype.getLineBounds=function(t,e,i,r,n){var o;if(!e.empty&&t<e.lineCount&&t>=0){var s=e.lines[t],a=this.getTextVerticalAlignShift(e.actualSize.height,r.height,n)+r.y+e.lineHeight*t,h=s.width,l=this.getHorizontalAlignShift(h,r.width,n),u=this.getLineIndent(s,n,r,0===t);l+=this.rightToLeft(n)?0:u;var c=r.x+l,p=this.shouldJustify(s,r.width,n)?r.width-u:h-u,d=e.lineHeight;o=new k(c,a,p,d)}else o=new k(0,0,0,0);return o},e.prototype.checkCorrectLayoutRectangle=function(e,i,r,n){var o=new k(i,r,e.width,e.width);if(null!=n){switch(n.alignment){case t.PdfTextAlignment.Center:o.x-=o.width/2;break;case t.PdfTextAlignment.Right:o.x-=o.width}switch(n.lineAlignment){case t.PdfVerticalAlignment.Middle:o.y-=o.height/2;break;case t.PdfVerticalAlignment.Bottom:o.y-=o.height}}return o},e.prototype.setLayer=function(t){this.pageLayer=t;var e=t.page;null!=e&&void 0!==e&&(e.beginSave=this.pageSave)},e.prototype.pageSave=function(t){if(null!=t.graphics.automaticFields)for(var e=0;e<t.graphics.automaticFields.automaticFields.length;e++){var i=t.graphics.automaticFields.automaticFields[e];i.field.performDraw(t.graphics,i.location,i.scalingX,i.scalingY)}},e.prototype.drawStringLayoutResult=function(e,i,r,n,o,s){if(e.empty)throw new Error("ArgumentNullException:result");this.applyStringSettings(i,r,n,s,o);var a=null!=s?s.horizontalScalingFactor:100;a===this.previousTextScaling||this.isEmfTextScaled||(this.pdfStreamWriter.setTextScaling(a),this.previousTextScaling=a);var h=null==s||0===s.lineSpacing?i.height:s.lineSpacing+i.height,l=0;l=null!=s&&s.subSuperScript===t.PdfSubSuperScript.SubScript?h-(i.height+i.metrics.getDescent(s)):h-i.metrics.getAscent(s),this.shift=l,this.pdfStreamWriter.startNextLine(o.x,o.y-l),this.pdfStreamWriter.setLeading(+h);for(var u=0,c="",p=0;p<e.lines.length;p++)if(u+=e.lineHeight,o.y+u>this.clientSize.height){this.startCutIndex=p;break}for(var d=this.startCutIndex;d<e.lines.length&&d>=0;d++)c+=e.lines[d].text;var f=new k(o.x,o.y,o.width,o.height);this.drawLayoutResult(e,i,s,o),this.underlineStrikeoutText(r,n,e,i,f,s),this.isEmfPlus=!1,this.isUseFontSize=!1,-1!==this.startCutIndex&&this.getNextPage().graphics.drawString(c,i,r,n,o.x,0,o.width,0,s)},e.prototype.getNextPage=function(){var t=this.currentPage.section,e=t.indexOf(this.currentPage);return e===t.count-1?t.add():t.getPages()[e+1]},e.prototype.setClip=function(e,i){void 0===i?this.setClip(e,t.PdfFillMode.Winding):(this.pdfStreamWriter.appendRectangle(e),this.pdfStreamWriter.clipPath(i===t.PdfFillMode.Alternate))},e.prototype.applyStringSettings=function(t,e,i,r,n){i instanceof Qt?(this.bCSInitialized=!1,i.graphics.colorSpace=this.colorSpace):i instanceof qt&&(this.bCSInitialized=!1,i.colorSpace=this.colorSpace);var o=this.getTextRenderingMode(e,i,r);this.stateControl(e,i,t,r),this.pdfStreamWriter.beginText(),o!==this.previousTextRenderingMode&&(this.pdfStreamWriter.setTextRenderingMode(o),this.previousTextRenderingMode=o);var s=null!=r?r.characterSpacing:0;s===this.previousCharacterSpacing||this.isEmfTextScaled||(this.pdfStreamWriter.setCharacterSpacing(s),this.previousCharacterSpacing=s);var a=null!=r?r.wordSpacing:0;a!==this.previousWordSpacing&&(this.pdfStreamWriter.setWordSpacing(a),this.previousWordSpacing=a)},e.prototype.getTextVerticalAlignShift=function(e,i,r){var n=0;if(i>=0&&null!=r&&r.lineAlignment!==t.PdfVerticalAlignment.Top)switch(r.lineAlignment){case t.PdfVerticalAlignment.Middle:n=(i-e)/2;break;case t.PdfVerticalAlignment.Bottom:n=i-e}return n},e.prototype.drawLayoutResult=function(t,e,i,r){var n=this.getTextVerticalAlignShift(t.actualSize.height,r.height,i);0!==n&&this.pdfStreamWriter.startNextLine(0,n);for(var o=e,s=null!=o&&o.isUnicode,a=(null!=o&&o.isEmbedFont,t.lines),h=0,l=a.length;h<l&&h!==this.startCutIndex;h++){var u=a[h],c=(u.text,u.width),p=this.getHorizontalAlignShift(c,r.width,i),d=this.getLineIndent(u,i,r,0===h);0===(p+=this.rightToLeft(i)?0:d)||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(p,0),s?this.drawUnicodeLine(u,r,e,i):this.drawAsciiLine(u,r,e,i),0===p||this.isEmfTextScaled||this.pdfStreamWriter.startNextLine(-p,0),this.isOverloadWithPosition&&a.length>1&&(this.pdfStreamWriter.startNextLine(-r.x,0),r.x=0,r.width=this.clientSize.width,this.isOverloadWithPosition=!1,this.isPointOverload=!0)}this.getResources.getResources().requireProcedureSet(this.procedureSets.text),0!==n&&this.pdfStreamWriter.startNextLine(0,-(n-t.lineHeight)),this.pdfStreamWriter.endText()},e.prototype.drawAsciiLine=function(t,e,i,r){this.justifyLine(t,e.width,r);var n="";if(-1!==t.text.indexOf("(")||-1!==t.text.indexOf(")"))for(var o=0;o<t.text.length;o++)"("===t.text[o]?n+="\\(":")"===t.text[o]?n+="\\)":n+=t.text[o];""===n&&(n=t.text);var s="("+n+")";this.pdfStreamWriter.showNextLineText(new P(s))},e.prototype.drawUnicodeLine=function(e,i,r,n){var o=e.text,s=(e.width,null!==n&&void 0!==n&&n.rightToLeft),a=null!==n&&void 0!==n&&(0!==n.wordSpacing||n.alignment===t.PdfTextAlignment.Justify),h=r,l=this.justifyLine(e,i.width,n),u=new Kt;if(s||null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None){var c=null,p=null!==n&&void 0!==n&&n.alignment===t.PdfTextAlignment.Right,d=null;d=(c=null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None?u.layout(o,h,n.textDirection===t.PdfTextDirection.RightToLeft,a,n):u.layout(o,h,p,a,n)).length>1?null!==n&&void 0!==n&&n.textDirection!==t.PdfTextDirection.None?u.splitLayout(o,h,n.textDirection===t.PdfTextDirection.RightToLeft,a,n):u.splitLayout(o,h,p,a,n):[o],this.drawUnicodeBlocks(c,d,h,n,l)}else if(a){var f=this.breakUnicodeLine(o,h,null),c=f.tokens,d=f.words;this.drawUnicodeBlocks(c,d,h,n,l)}else{var g=this.convertToUnicode(o,h),m=this.getUnicodeString(g);this.streamWriter.showNextLineText(m)}},e.prototype.drawUnicodeBlocks=function(t,e,i,r,n){if(null==t)throw new Error("Argument Null Exception : blocks");if(null==e)throw new Error("Argument Null Exception : words");if(null==i)throw new Error("Argument Null Exception : font");this.streamWriter.startNextLine();var o=0,s=0,a=0,h=0;try{null!==r&&void 0!==r&&(a=r.firstLineIndent,h=r.paragraphIndent,r.firstLineIndent=0,r.paragraphIndent=0);var l=i.getCharWidth(M.whiteSpace,r)+n,u=null!=r?r.characterSpacing:0;l+=u+(null!==r&&void 0!==r&&0===n?r.wordSpacing:0);for(var c=0;c<t.length;c++){var p=t[c],d=e[c],f=0;if(0!==o&&this.streamWriter.startNextLine(o,0),d.length>0){f+=i.measureString(d,r).width,f+=u;var g=this.getUnicodeString(p);this.streamWriter.showText(g)}c!==t.length-1&&(s+=o=f+l)}s>0&&this.streamWriter.startNextLine(-s,0)}finally{null!==r&&void 0!==r&&(r.firstLineIndent=a,r.paragraphIndent=h)}},e.prototype.breakUnicodeLine=function(t,e,i){if(null===t)throw new Error("Argument Null Exception : line");i=t.split(null);for(var r=[],n=0;n<i.length;n++){var o=i[n],s=this.convertToUnicode(o,e);r[n]=s}return{tokens:r,words:i}},e.prototype.getUnicodeString=function(e){if(null===e)throw new Error("Argument Null Exception : token");var i=new P(e);return i.converted=!0,i.encode=t.InternalEnum.ForceEncoding.Ascii,i},e.prototype.convertToUnicode=function(t,e){var i=null;if(null==t)throw new Error("Argument Null Exception : text");if(null==e)throw new Error("Argument Null Exception : ttfFont");if(e.fontInternal instanceof Gt){var r=e.fontInternal.ttfReader;e.setSymbols(t),i=r.convertString(t);var n=P.toUnicodeArray(i,!1);i=P.byteToString(n)}return i},e.prototype.justifyLine=function(t,e,i){var r=t.text,n=t.width,o=this.shouldJustify(t,e,i),s=null!=i&&0!==i.wordSpacing,a=M.spaces,h=M.getCharsCount(r,a),l=0;return o?(s&&(n-=h*i.wordSpacing),l=(e-n)/h,this.pdfStreamWriter.setWordSpacing(l)):s?this.pdfStreamWriter.setWordSpacing(i.wordSpacing):this.pdfStreamWriter.setWordSpacing(0),l},e.prototype.reset=function(t){this.canvasSize=t,this.streamWriter.clear(),this.initialize(),this.initializeCoordinates()},e.prototype.shouldJustify=function(e,i,r){var n=e.text,o=e.width,s=null!=r&&r.alignment===t.PdfTextAlignment.Justify,a=i>=0&&o<i,h=M.spaces,l=M.getCharsCount(n,h)>0&&n[0]!==M.whiteSpace,u=(e.lineType&t.LineType.LayoutBreak)>0;return s&&a&&l&&(u||r.alignment===t.PdfTextAlignment.Justify)},e.prototype.underlineStrikeoutText=function(t,e,i,r,n,o){if(r.underline||r.strikeout){var s=this.createUnderlineStikeoutPen(t,e,r,o);if(null!=s){var a=this.getTextVerticalAlignShift(i.actualSize.height,n.height,o),h=0;h=n.y+a+r.metrics.getAscent(o)+1.5*s.width;for(var l=n.y+a+r.metrics.getHeight(o)/2+1.5*s.width,u=i.lines,c=0,p=i.lineCount;c<p;c++){var d=u[c],f=(d.text,d.width),g=this.getHorizontalAlignShift(f,n.width,o),m=this.getLineIndent(d,o,n,0===c);g+=this.rightToLeft(o)?0:m;var y=n.x+g,b=this.shouldJustify(d,n.width,o)?y+n.width-m:y+f-m;if(r.underline){w=h;this.drawLine(s,y,w,b,w),h+=i.lineHeight}if(r.strikeout){var w=l;this.drawLine(s,y,w,b,w),l+=i.lineHeight}this.isPointOverload&&u.length>1&&(n.x=0,n.width=this.clientSize.width)}this.isPointOverload=!1}}},e.prototype.createUnderlineStikeoutPen=function(t,e,i,r){var n=i.metrics.getSize(r)/20,o=null;return null!=t?o=new Q(t.color,n):null!=e&&(o=new Q(e,n)),o},e.prototype.getTextRenderingMode=function(e,i,r){var n=t.TextRenderingMode.None;return n=null!=e&&null!=i?t.TextRenderingMode.FillStroke:null!=e?t.TextRenderingMode.Stroke:t.TextRenderingMode.Fill,null!=r&&r.clipPath&&(n|=t.TextRenderingMode.ClipFlag),n},e.prototype.getLineIndent=function(e,i,r,n){var o=0,s=(e.lineType&t.LineType.FirstParagraphLine)>0;return null!=i&&s&&(o=n?i.firstLineIndent:i.paragraphIndent,o=r.width>0?Math.min(r.width,o):o),o},e.prototype.getHorizontalAlignShift=function(e,i,r){var n=0;if(i>=0&&null!=r&&r.alignment!==t.PdfTextAlignment.Left)switch(r.alignment){case t.PdfTextAlignment.Center:n=(i-e)/2;break;case t.PdfTextAlignment.Right:n=i-e}return n},e.prototype.rightToLeft=function(e){var i=null!==e&&void 0!==e&&e.rightToLeft;return null!==e&&void 0!==e&&e.textDirection!==t.PdfTextDirection.None&&void 0!==e.textDirection&&(i=!0),i},e.prototype.stateControl=function(t,e,i,r){if(void 0===r)this.stateControl(t,e,i,null);else{e instanceof qt&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),e instanceof Qt&&(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace);null!==e?(void 0!==this.pageLayer&&null!=this.pageLayer&&!1===this.colorSpaceChanged&&(this.lastDocumentCS=this.pageLayer.page.document.colorSpace,this.lastGraphicsCS=this.pageLayer.page.graphics.colorSpace,this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace,this.colorSpaceChanged=!0),this.initCurrentColorSpace(this.currentColorSpace)):null!=t&&(void 0!==this.pageLayer&&null!=this.pageLayer&&(this.colorSpace=this.pageLayer.page.document.colorSpace,this.currentColorSpace=this.pageLayer.page.document.colorSpace),this.initCurrentColorSpace(this.currentColorSpace)),this.penControl(t,!1),this.brushControl(e,!1),this.fontControl(i,r,!1)}},e.prototype.initCurrentColorSpace=function(e){this.getResources.getResources();this.bCSInitialized||(this.currentColorSpace!=t.PdfColorSpace.GrayScale?(this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!0),this.pdfStreamWriter.setColorSpace("Device"+this.currentColorSpaces[this.currentColorSpace],!1),this.bCSInitialized=!0):(this.pdfStreamWriter.setColorSpace("DeviceGray",!0),this.pdfStreamWriter.setColorSpace("DeviceGray",!1),this.bCSInitialized=!0))},e.prototype.penControl=function(t,e){null!=t&&(this.currentPen=t,t.monitorChanges(this.currentPen,this.pdfStreamWriter,this.getResources,e,this.colorSpace,this.matrix.clone()),this.currentPen=t.clone())},e.prototype.brushControl=function(t,e){if(null!=t&&void 0!==t){var i=t.clone(),r=i;if(!(null===r||void 0===r||t instanceof A||t instanceof Qt)){var n=r.matrix,o=this.matrix.clone();null!=n&&(n.multiply(o),o=n),r.matrix=o}this.currentBrush=r,i.monitorChanges(this.currentBrush,this.pdfStreamWriter,this.getResources,e,this.colorSpace),this.currentBrush=t,t=null}},e.prototype.fontControl=function(e,i,r){if(null!=e){var n=null!=i?i.subSuperScript:t.PdfSubSuperScript.None,o=null!=this.currentStringFormat?this.currentStringFormat.subSuperScript:t.PdfSubSuperScript.None;if(r||e!==this.currentFont||n!==o){var s=this.getResources.getResources();this.currentFont=e,this.currentStringFormat=i;var a=e.metrics.getSize(i);this.isEmfTextScaled=!1;var h=s.getName(e);this.pdfStreamWriter.setFont(e,h,a)}}},e.prototype.setTransparency=function(e,i,r){if(void 0===i)this.istransparencySet=!0,this.setTransparency(e,e,t.PdfBlendMode.Normal);else if("number"==typeof i&&void 0===r)this.setTransparency(e,i,t.PdfBlendMode.Normal);else{null==this.trasparencies&&(this.trasparencies=new rt);var n=null,o=new re(e,i,r);this.trasparencies.containsKey(o)&&(n=this.trasparencies.getValue(o)),null==n&&(n=new nt(e,i,r),this.trasparencies.setValue(o,n));var s=this.getResources.getResources().getName(n);this.streamWriter.setGraphicsState(s)}},e.prototype.clipTranslateMargins=function(t,e,i,r,n,o){if(t instanceof k&&void 0===e)this.clipBounds=t,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(t),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t.x,t.y);else if("number"==typeof t){var s=new k(i,r,this.size.width-i-n,this.size.height-r-o);this.clipBounds=s,this.pdfStreamWriter.writeComment("Clip margins."),this.pdfStreamWriter.appendRectangle(s),this.pdfStreamWriter.closePath(),this.pdfStreamWriter.clipPath(!1),this.pdfStreamWriter.writeComment("Translate co-ordinate system."),this.translateTransform(t,e)}},e.prototype.updateY=function(t){return-t},e.prototype.translateTransform=function(t,e){var i=new tt;this.getTranslateTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},e.prototype.getTranslateTransform=function(t,e,i){return i.translate(t,this.updateY(e)),i},e.prototype.scaleTransform=function(t,e){var i=new tt;this.getScaleTransform(t,e,i),this.pdfStreamWriter.modifyCtm(i),this.matrix.multiply(i)},e.prototype.getScaleTransform=function(t,e,i){return null==i&&(i=new tt),i.scale(t,e),i},e.prototype.rotateTransform=function(t){var e=new tt;this.getRotateTransform(t,e),this.pdfStreamWriter.modifyCtm(e),this.matrix.multiply(e)},e.prototype.initializeCoordinates=function(){this.pdfStreamWriter.writeComment("Change co-ordinate system to left/top."),this.mediaBoxUpperRightBound!==-this.size.height&&null==this.cropBox&&(this.mediaBoxUpperRightBound===this.size.height||0===this.mediaBoxUpperRightBound?this.translateTransform(0,this.updateY(this.size.height)):this.translateTransform(0,this.updateY(this.mediaBoxUpperRightBound)))},e.prototype.getRotateTransform=function(t,e){return null!=e&&void 0!==e||(e=new tt),e.rotate(this.updateY(t)),e},e.prototype.save=function(){var t=new ie(this,this.matrix.clone());return t.brush=this.currentBrush,t.pen=this.currentPen,t.font=this.currentFont,t.colorSpace=this.currentColorSpace,t.characterSpacing=this.previousCharacterSpacing,t.wordSpacing=this.previousWordSpacing,t.textScaling=this.previousTextScaling,t.textRenderingMode=this.previousTextRenderingMode,this.graphicsState.push(t),this.pdfStreamWriter.saveGraphicsState(),t},e.prototype.restore=function(t){if(void 0===t)this.graphicsState.length>0&&this.doRestoreState();else if(-1!==this.graphicsState.indexOf(t))for(;0!==this.graphicsState.length&&this.doRestoreState()!==t;);},e.prototype.doRestoreState=function(){var t=this.graphicsState.pop();return this.transformationMatrix=t.matrix,this.currentBrush=t.brush,this.currentPen=t.pen,this.currentFont=t.font,this.currentColorSpace=t.colorSpace,this.previousCharacterSpacing=t.characterSpacing,this.previousWordSpacing=t.wordSpacing,this.previousTextScaling=t.textScaling,this.previousTextRenderingMode=t.textRenderingMode,this.pdfStreamWriter.restoreGraphicsState(),t},e.prototype.drawPath=function(t,e,i){e instanceof Qt?(this.bCSInitialized=!1,e.graphics.colorSpace=this.colorSpace):e instanceof qt&&(this.bCSInitialized=!1,e.colorSpace=this.colorSpace),this.stateControl(t,e,null),this.buildUpPath(i.pathPoints,i.pathTypes),this.drawPathHelper(t,e,i.fillMode,!1)},e.prototype.drawArc=function(t,e,i,r,n,o,s){e instanceof k?this.drawArc(t,e.x,e.y,e.width,e.height,i,r):0!==s&&(this.stateControl(t,null,null),this.constructArcPath(e,i,e+r,i+n,o,s),this.drawPathHelper(t,null,!1))},e.prototype.buildUpPath=function(i,r){for(var n=i.length,o=0;o<n;++o){var s=0,a=i[o];switch(r[o]&e.pathTypesValuesMask){case t.PathPointType.Start:this.pdfStreamWriter.beginPath(a.x,a.y);break;case t.PathPointType.Bezier3:var h=new T(0,0),l=new T(0,0),u=this.getBezierPoints(i,r,o,h,l);this.pdfStreamWriter.appendBezierSegment(a,u.p2,u.p3),o=u.i;break;case t.PathPointType.Line:this.pdfStreamWriter.appendLineSegment(a);break;default:throw new Error("ArithmeticException - Incorrect path formation.")}s=r[o],this.checkFlags(s)}},e.prototype.getBezierPoints=function(i,r,n,o,s){if(++n,(r[n]&e.pathTypesValuesMask)!==t.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");if(o=i[n],++n,(r[n]&e.pathTypesValuesMask)!==t.PathPointType.Bezier3)throw new Error("ArgumentException : errorMsg");return s=i[n],{i:n,p2:o,p3:s}},e.prototype.checkFlags=function(e){(e&t.PathPointType.CloseSubpath)===t.PathPointType.CloseSubpath&&this.pdfStreamWriter.closePath()},e.prototype.constructArcPath=function(t,e,i,r,n,o){var s=this.getBezierArc(t,e,i,r,n,o);if(0!==s.length){var a=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];this.pdfStreamWriter.beginPath(a[0],a[1]);var h=0;for(h=0;h<s.length;h+=8)a=[s[h],s[h+1],s[h+2],s[h+3],s[h+4],s[h+5],s[h+6],s[h+7]],this.pdfStreamWriter.appendBezierSegment(a[2],a[3],a[4],a[5],a[6],a[7])}},e.prototype.getBezierArc=function(t,e,i,r,n,o){if(t>i){s=void 0;s=t,t=i,i=s}if(r>e){var s=void 0;s=e,e=r,r=s}var a,h;Math.abs(o)<=90?(a=o,h=1):a=o/(h=Math.ceil(Math.abs(o)/90));for(var l=(t+i)/2,u=(e+r)/2,c=(i-t)/2,p=(r-e)/2,d=a*(Math.PI/360),f=Math.abs(4/3*(1-Math.cos(d))/Math.sin(d)),g=[],m=0;m<h;m++){var y=(n+m*a)*(Math.PI/180),b=(n+(m+1)*a)*(Math.PI/180),w=Math.cos(y),S=Math.cos(b),P=Math.sin(y),v=Math.sin(b);a>0?g.push(l+c*w,u-p*P,l+c*(w-f*P),u-p*(P+f*w),l+c*(S+f*v),u-p*(v-f*S),l+c*S,u-p*v):g.push(l+c*w,u-p*P,l+c*(w+f*P),u-p*(P-f*w),l+c*(S-f*v),u-p*(v+f*S),l+c*S,u-p*v)}return g},e.pathTypesValuesMask=15,e.transparencyObject=!1,e}(),ee=function(){function t(t){this.sender=t}return t.prototype.getResources=function(){return this.sender.getResources()},t}(),ie=function(){function e(e,i){this.internalTextRenderingMode=t.TextRenderingMode.Fill,this.internalCharacterSpacing=0,this.internalWordSpacing=0,this.internalTextScaling=100,this.pdfColorSpace=t.PdfColorSpace.Rgb,void 0!==e&&(this.pdfGraphics=e,this.transformationMatrix=i)}return Object.defineProperty(e.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matrix",{get:function(){return this.transformationMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterSpacing",{get:function(){return this.internalCharacterSpacing},set:function(t){this.internalCharacterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wordSpacing",{get:function(){return this.internalWordSpacing},set:function(t){this.internalWordSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textScaling",{get:function(){return this.internalTextScaling},set:function(t){this.internalTextScaling=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textRenderingMode",{get:function(){return this.internalTextRenderingMode},set:function(t){this.internalTextRenderingMode=t},enumerable:!0,configurable:!0}),e}(),re=function(){function t(t,e,i){this.alphaPen=t,this.alphaBrush=e,this.blendMode=i}return t}(),ne=function(){function e(e,i){if(this.pdfColorSpace=t.PdfColorSpace.Rgb,this.isVisible=!0,this.sublayer=!1,this.contentLength=0,this.dictionaryProperties=new a,null===e)throw new Error("ArgumentNullException:page");if(this.pdfPage=e,this.clipPageTemplates=!0,void 0===i)this.content=new b;else if(i instanceof b||null===i){if(null===i)throw new Error("ArgumentNullException:stream");this.content=i}else this.content=new b,this.clipPageTemplates=i}return Object.defineProperty(e.prototype,"colorSpace",{get:function(){return this.pdfColorSpace},set:function(t){this.pdfColorSpace=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layerId",{get:function(){return this.layerid},set:function(t){this.layerid=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.layerName},set:function(t){this.layerName=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this.isVisible},set:function(t){this.isVisible=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){return null==this.pdfGraphics&&this.initializeGraphics(this.page),this.pdfGraphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layers",{get:function(){return null==this.layer?(this.layer=new ae(this.page),this.layer.sublayer=!0,this.layer):this.layer},enumerable:!0,configurable:!0}),e.prototype.add=function(){var t=new e(this.pdfPage);return t.name="",t},e.prototype.sign=function(t){return 0===t?0:t>0?1:-1},e.prototype.initializeGraphics=function(t){var e=t,i=new ee(this.page);if(this.pdfGraphics=new te(t.size,i,this.content),this.pdfGraphics.mediaBoxUpperRightBound=0,null!=e){var r=e.section.parent;null!=r&&(this.pdfGraphics.colorSpace=r.document.colorSpace,this.colorSpace=r.document.colorSpace)}var n=this.sign(t.origin.y)===this.sign(t.origin.x);(t.origin.x>=0&&t.origin.y>=0||!n)&&this.pdfGraphics.initializeCoordinates();var o=e.section.getActualBounds(e,!0),s=e.section.pageSettings.margins;this.clipPageTemplates?t.origin.x>=0&&t.origin.y>=0&&this.pdfGraphics.clipTranslateMargins(o):this.graphics.clipTranslateMargins(o.x,o.y,s.left,s.top,s.right,s.bottom),this.pdfGraphics.setLayer(this)},Object.defineProperty(e.prototype,"element",{get:function(){return this.content},enumerable:!0,configurable:!0}),e}(),oe=function(){function t(){}return Object.defineProperty(t.prototype,"count",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"list",{get:function(){return void 0===this.collection&&(this.collection=[]),this.collection},enumerable:!0,configurable:!0}),t}(),se=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ae=function(t){function e(e){var i=t.call(this)||this;if(i.parentLayerCount=0,i.sublayer=!1,i.optionalContent=new h,e instanceof he){i.page=e;var r=e;i.parseLayers(r)}return i}return se(e,t),e.prototype.items=function(t,e){if("number"==typeof t&&void 0===e)return this.list[t];if(null==e)throw new Error("ArgumentNullException: layer");if(e.page!==this.page)throw new Error("ArgumentException: The layer belongs to another page")},e.prototype.add=function(t,e){if(void 0===t){var i=new ne(this.page);return i.name="",this.add(i),i}if(t instanceof ne){var r=this.list.push(t);return this.addLayer(r,t),r}return 0},e.prototype.addLayer=function(t,e){var i=new C(e);this.page.contents.add(i)},e.prototype.insert=function(t,e){for(var i=[],r=this.list.length,n=t;n<r;n++)i.push(this.list.pop());this.list.push(e);for(n=0;n<i.length;n++)this.list.push(i[n]);this.insertLayer(t,e)},e.prototype.insertLayer=function(t,e){if(null==e)throw new Error("ArgumentNullException:layer");var i=new C(e);this.page.contents.insert(t,i)},e.prototype.parseLayers=function(t){var e=this.page.contents;this.page.getResources();t.crossTable;var i=new b,r=new b,n=[];n.push("q"),i.data=n,e.insert(0,new C(i)),(n=[]).push("Q"),r.data=n,e.insert(e.count,new C(r))},e.prototype.indexOf=function(t){if(null==t)throw new Error("ArgumentNullException: layer");return this.list.indexOf(t)},e}(oe),he=function(){function t(t){this.defLayerIndex=-1,this.modified=!1,this.dictionaryProperties=new a,this.pageDictionary=t}return Object.defineProperty(t.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.pageDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultLayer",{get:function(){var t=this.layers,e=this.defaultLayerIndex;return t.items(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultLayerIndex",{get:function(){if(0===this.layerCollection.count||-1===this.defLayerIndex){var t=this.layerCollection.add();this.defLayerIndex=this.layerCollection.indexOf(t)}return this.defLayerIndex},set:function(t){if(t<0||t>this.layers.count-1)throw new Error("ArgumentOutOfRangeException : value, Index can not be less 0 and greater Layers.Count - 1");this.defLayerIndex=t,this.modified=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layers",{get:function(){return null!=this.layerCollection&&void 0!==this.layerCollection||(this.layerCollection=new ae(this)),this.layerCollection},enumerable:!0,configurable:!0}),t.prototype.getResources=function(){return null==this.resources&&(this.resources=new Jt,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources)),this.resources},Object.defineProperty(t.prototype,"contents",{get:function(){var t=this.pageDictionary.items.getValue(this.dictionaryProperties.contents);return null==t&&(t=new m,this.pageDictionary.items.setValue(this.dictionaryProperties.contents,t)),t},enumerable:!0,configurable:!0}),t.prototype.setResources=function(t){this.resources=t,this.dictionary.items.setValue(this.dictionaryProperties.resources,this.resources),this.modified=!0},t}(),le=function(){function e(t){this.alreadyExistsAnnotationError="This annotatation had been already added to page",this.missingAnnotationException="Annotation is not contained in collection.",this.dictionaryProperties=new a,this.internalAnnotations=new m,this.lists=[],void 0!==t&&(this.page=t)}return Object.defineProperty(e.prototype,"annotations",{get:function(){return this.internalAnnotations},set:function(t){this.internalAnnotations=t},enumerable:!0,configurable:!0}),e.prototype.add=function(t){this.doAdd(t)},e.prototype.doAdd=function(t){if(void 0===t.destination)return t.setPage(this.page),this.internalAnnotations.add(new C(t)),this.lists.push(t);var e=(new I).layout(t.text,t.font,t.stringFormat,new j(t.bounds.width,0),!1,new j(0,0)),i=t.bounds.y;if(1===e.lines.length){n=t.font.measureString(e.lines[0].text);t.bounds=new k(new T(t.bounds.x,i),n),t.text=e.lines[0].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,t.bounds.y,t.bounds.width,t.bounds.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new C(t)),this.lists.push(t)}else for(var r=0;r<e.lines.length;r++){var n=t.font.measureString(e.lines[r].text);if(0===r)t.bounds=new k(t.bounds.x,i,n.width,n.height),t.text=e.lines[r].text,this.page.graphics.drawString(t.text,t.font,null,t.brush,t.bounds.x,i,n.width,n.height,null),t.setPage(this.page),this.setColor(t),this.internalAnnotations.add(new C(t)),this.lists.push(t),i+=t.bounds.height;else{var o=t.clone();o.bounds=new k(new T(t.bounds.x,i),n),o.text=e.lines[r].text,this.page.graphics.drawString(o.text,o.font,null,o.brush,o.bounds.x,o.bounds.y,o.bounds.width,o.bounds.height,null),o.setPage(this.page),this.setColor(o),this.internalAnnotations.add(new C(o)),this.lists.push(o),i+=o.bounds.height}}},e.prototype.setColor=function(e){var i=t.PdfColorSpace.Rgb,r=e.color.toArray(i);e.dictionary.items.setValue(this.dictionaryProperties.c,r)},Object.defineProperty(e.prototype,"element",{get:function(){return this.internalAnnotations},enumerable:!0,configurable:!0}),e}(),ue=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ce=function(t){function e(){var e=t.call(this,new h)||this;return e.annotationCollection=null,e.beginSave=null,e.initialize(),e}return ue(e,t),Object.defineProperty(e.prototype,"document",{get:function(){return null!==this.section&&null!==this.section.parent?this.section.parent.document:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){var t=this.defaultLayer.graphics;return t.currentPage=this,t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"crossTable",{get:function(){if(null===this.section)throw new Error("PdfDocumentException : Page is not created");return null===this.section.parent?this.section.parentDocument.crossTable:this.section.parent.document.crossTable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.section.pageSettings.size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"origin",{get:function(){return this.section.pageSettings.origin},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"annotations",{get:function(){return null==this.annotationCollection&&(this.annotationCollection=new le(this),this.dictionary.items.setValue(this.dictionaryProperties.annots,this.annotationCollection.element),this.annotationCollection.annotations=this.dictionary.items.getValue(this.dictionaryProperties.annots)),this.annotationCollection},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.dictionary.items.setValue(this.dictionaryProperties.type,new o("Page")),this.dictionary.pageBeginDrawTemplate=new f(this)},e.prototype.setSection=function(t){this.section=t,this.dictionary.items.setValue(this.dictionaryProperties.parent,new C(t))},e.prototype.resetProgress=function(){this.isProgressOn=!1},e.prototype.getClientSize=function(){var t=this.section.getActualBounds(this,!0);return new j(t.width,t.height)},e.prototype.pageBeginSave=function(){var t=this.document;void 0!==typeof t&&null!=t&&this.drawPageTemplates(t),null!=this.beginSave&&void 0!==this.beginSave&&this.beginSave(this)},e.prototype.drawPageTemplates=function(t){if(this.section.containsTemplates(t,this,!1)){var e=new ne(this,!1);if(this.layers.insert(0,e),this.section.drawTemplates(this,e,t,!1),null!==e.graphics&&void 0!==e.graphics)for(var i=0;i<e.graphics.automaticFields.automaticFields.length;i++){var r=e.graphics.automaticFields.automaticFields[i];r.field.performDraw(e.graphics,r.location,r.scalingX,r.scalingY)}}if(this.section.containsTemplates(t,this,!0)){var n=new ne(this,!1);this.layers.add(n),this.section.drawTemplates(this,n,t,!0)}},e}(he),pe=function(){function t(t){this.pdfPage=void 0!==t?t:null}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),t}(),de=function(){function t(t){if(this.pdfSection=null,null==t)throw Error('ArgumentNullException("section")');this.section=t}return Object.defineProperty(t.prototype,"section",{get:function(){return this.pdfSection},set:function(t){this.pdfSection=t},enumerable:!0,configurable:!0}),t.prototype.contains=function(t){return this.section.contains(t)},t.prototype.remove=function(t){this.section.remove(t)},t.prototype.add=function(){return this.section.add()},t}(),fe=function(){function e(){}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftTemplate},set:function(e){this.leftTemplate=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topTemplate},set:function(e){this.topTemplate=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightTemplate},set:function(e){this.rightTemplate=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomTemplate},set:function(e){this.bottomTemplate=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenLeft",{get:function(){return this.evenLeft},set:function(e){this.evenLeft=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenTop",{get:function(){return this.evenTop},set:function(e){this.evenTop=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenRight",{get:function(){return this.evenRight},set:function(e){this.evenRight=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EvenBottom",{get:function(){return this.evenBottom},set:function(e){this.evenBottom=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddLeft",{get:function(){return this.oddLeft},set:function(e){this.oddLeft=this.checkElement(e,t.TemplateType.Left)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddTop",{get:function(){return this.oddTop},set:function(e){this.oddTop=this.checkElement(e,t.TemplateType.Top)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddRight",{get:function(){return this.oddRight},set:function(e){this.oddRight=this.checkElement(e,t.TemplateType.Right)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OddBottom",{get:function(){return this.oddBottom},set:function(e){this.oddBottom=this.checkElement(e,t.TemplateType.Bottom)},enumerable:!0,configurable:!0}),e.prototype.getLeft=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenLeft?this.EvenLeft:this.left:null!=this.OddLeft?this.OddLeft:this.left},e.prototype.getTop=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenTop?this.EvenTop:this.top:null!=this.OddTop?this.OddTop:this.top},e.prototype.getRight=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenRight?this.EvenRight:this.right:null!=this.OddRight?this.OddRight:this.right},e.prototype.getBottom=function(t){if(null==t)throw new Error("ArgumentNullException:page");return this.isEven(t)?null!=this.EvenBottom?this.EvenBottom:this.bottom:null!=this.OddBottom?this.OddBottom:this.bottom},e.prototype.isEven=function(t){var e=t.section.document.pages;return(e.pageCollectionIndex.containsKey(t)?e.pageCollectionIndex.getValue(t)+1:e.indexOf(t)+1)%2==0},e.prototype.checkElement=function(e,i){if(null!=e){if(void 0!==e.type&&e.type!==t.TemplateType.None)throw new Error("NotSupportedException:Can not reassign the template element. Please, create new one.");e.type=i}return e},e}(),ge=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),me=function(t){function e(){var e=t.call(this)||this;return e.leftValue=e.topValue=e.rightValue=e.bottomValue=e.stampValue=!0,e}return ge(e,t),Object.defineProperty(e.prototype,"applyDocumentLeftTemplate",{get:function(){return this.leftValue},set:function(t){this.leftValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentTopTemplate",{get:function(){return this.topValue},set:function(t){this.topValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentRightTemplate",{get:function(){return this.rightValue},set:function(t){this.rightValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentBottomTemplate",{get:function(){return this.bottomValue},set:function(t){this.bottomValue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyDocumentStamps",{get:function(){return this.stampValue},set:function(t){this.stampValue=t},enumerable:!0,configurable:!0}),e}(fe),ye=function(){function t(t,e){this.pageAdded=new pe,this.pdfPages=[],this.dictionaryProperties=new a,this.pdfDocument=t,void 0===e?(this.settings=t.pageSettings.clone(),this.initialSettings=this.settings.clone()):(this.settings=e.clone(),this.initialSettings=this.settings.clone()),this.initialize()}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.sectionCollection},set:function(t){this.sectionCollection=t,this.section.items.setValue(this.dictionaryProperties.parent,new C(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentDocument",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageSettings",{get:function(){return this.settings},set:function(t){if(null==t)throw Error("Value can not be null.");this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.section},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.pagesReferences.count},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new me),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.sectionCollection.document},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pages",{get:function(){return null!=this.pagesCollection&&void 0!==this.pagesCollection||(this.pagesCollection=new de(this)),this.pagesCollection},enumerable:!0,configurable:!0}),t.prototype.getPages=function(){return this.pdfPages},t.prototype.pointToNativePdf=function(t,e){var i=this.getActualBounds(t,!0);return e.x+=i.x,e.y=this.pageSettings.height-e.y,e},t.prototype.setPageSettings=function(t){this.settings=t,this.state.orientation=t.orientation,this.state.rotate=t.rotate,this.state.size=t.size,this.state.origin=t.origin},t.prototype.initialize=function(){this.pagesReferences=new m,this.section=new h,this.state=new be(this.pdfDocument),this.section.sectionBeginSave=new d(this,this.state),this.pageCount=new g(0),this.section.items.setValue(this.dictionaryProperties.count,this.pageCount),this.section.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.pages)),this.section.items.setValue(this.dictionaryProperties.kids,this.pagesReferences)},t.prototype.containsTemplates=function(t,e,i){var r=this.getDocumentTemplates(t,e,i),n=this.getSectionTemplates(e,i);return r.length>0||n.length>0},t.prototype.getDocumentTemplates=function(t,e,i){var r=[];return this.template.applyDocumentTopTemplate&&null!=t.template.getTop(e)&&(!t.template.getTop(e).foreground&&!i||t.template.getTop(e).foreground&&i)&&r.push(t.template.getTop(e)),this.template.applyDocumentBottomTemplate&&null!=t.template.getBottom(e)&&(!t.template.getBottom(e).foreground&&!i||t.template.getBottom(e).foreground&&i)&&r.push(t.template.getBottom(e)),this.template.applyDocumentLeftTemplate&&null!=t.template.getLeft(e)&&(!t.template.getLeft(e).foreground&&!i||t.template.getLeft(e).foreground&&i)&&r.push(t.template.getLeft(e)),this.template.applyDocumentRightTemplate&&null!=t.template.getRight(e)&&(!t.template.getRight(e).foreground&&!i||t.template.getRight(e).foreground&&i)&&r.push(t.template.getRight(e)),r},t.prototype.getSectionTemplates=function(t,e){var i=[];if(null!=this.template.getTop(t)&&(!(r=this.template.getTop(t)).foreground&&!e||r.foreground&&e)&&i.push(r),null!=this.template.getBottom(t)&&(!(r=this.template.getBottom(t)).foreground&&!e||r.foreground&&e)&&i.push(r),null!=this.template.getLeft(t)&&(!(r=this.template.getLeft(t)).foreground&&!e||r.foreground&&e)&&i.push(r),null!=this.template.getRight(t)){var r=this.template.getRight(t);(!r.foreground&&!e||r.foreground&&e)&&i.push(r)}return i},t.prototype.add=function(t){if(void 0===t){var e=new ce;return this.add(e),e}var i=this.checkPresence(t);this.pdfPages.push(t),this.pagesReferences.add(i),t.setSection(this),t.resetProgress(),this.pageAddedMethod(t)},t.prototype.checkPresence=function(t){for(var e=new C(t),i=!1,r=this.parent,n=0;n<r.section.length;n++){var o=r.section[n];i=i||o.contains(t)}return e},t.prototype.contains=function(t){return 0<=this.indexOf(t)},t.prototype.indexOf=function(t){for(var e=0;e<this.pdfPages.length;e++)if(this.pdfPages[e]===t)return this.pdfPages.indexOf(t);var i=new C(t);return this.pagesReferences.indexOf(i)},t.prototype.pageAddedMethod=function(t){var e=new pe(t);this.onPageAdded(e),this.parent.document.pages.onPageAdded(e),this.pageCount.intValue=this.count},t.prototype.onPageAdded=function(t){},t.prototype.getActualBounds=function(t,e,i){if(t instanceof ce&&"boolean"==typeof e){var r=this.parent.document;return this.getActualBounds(r,t,e)}t=t,e=e,i=i;var n=new k(0,0,0,0);n.height=i?this.pageSettings.size.height:this.pageSettings.getActualSize().height,n.width=i?this.pageSettings.size.width:this.pageSettings.getActualSize().width;var o=this.getLeftIndentWidth(t,e,i),s=this.getTopIndentHeight(t,e,i),a=this.getRightIndentWidth(t,e,i),h=this.getBottomIndentHeight(t,e,i);return n.x+=o,n.y+=s,n.width-=o+a,n.height-=s+h,n},t.prototype.getLeftIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.left:0,n=null!=this.template.getLeft(e)?this.template.getLeft(e).width:0,o=null!=t.template.getLeft(e)?t.template.getLeft(e).width:0;return r+=this.template.applyDocumentLeftTemplate?Math.max(n,o):n},t.prototype.getTopIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.top:0,n=null!=this.template.getTop(e)?this.template.getTop(e).height:0,o=null!=t.template.getTop(e)?t.template.getTop(e).height:0;return r+=this.template.applyDocumentTopTemplate?Math.max(n,o):n},t.prototype.getRightIndentWidth=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.right:0,n=null!=this.template.getRight(e)?this.template.getRight(e).width:0,o=null!=t.template.getRight(e)?t.template.getRight(e).width:0;return r+=this.template.applyDocumentRightTemplate?Math.max(n,o):n},t.prototype.getBottomIndentHeight=function(t,e,i){if(null==t)throw new Error("ArgumentNullException:document");if(null==e)throw new Error("ArgumentNullException:page");var r=i?this.pageSettings.margins.bottom:0,n=null!=this.template.getBottom(e)?this.template.getBottom(e).height:0,o=null!=t.template.getBottom(e)?t.template.getBottom(e).height:0;return r+=this.template.applyDocumentBottomTemplate?Math.max(n,o):n},t.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');var e=this.pdfPages.indexOf(t);this.pagesReferences.removeAt(e);for(var i=[],r=0;r<e;r++)i.push(this.pdfPages[r]);for(r=e+1;r<this.pdfPages.length;r++)i.push(this.pdfPages[r]);this.pdfPages=i},t.prototype.applyPageSettings=function(t,e,i){var r=new k(i.origin,i.size);t.items.setValue(this.dictionaryProperties.mediaBox,m.fromRectangle(r));var n=0;n=we.rotateFactor*i.rotate;var o=new g(n);t.items.setValue(this.dictionaryProperties.rotate,o)},t.prototype.beginSave=function(t,e){var i=e.document;this.applyPageSettings(this.section,i.pageSettings,t)},t.prototype.drawTemplates=function(t,e,i,r){var n=this.getDocumentTemplates(i,t,r),o=this.getSectionTemplates(t,r);this.drawTemplatesHelper(e,i,n),this.drawTemplatesHelper(e,i,o)},t.prototype.drawTemplatesHelper=function(t,e,i){if(null!=i&&i.length>0)for(var r=i.length,n=0;n<r;n++)i[n].draw(t,e)},t}(),be=function(){function t(t){this.pageOrientation=t.pageSettings.orientation,this.pageRotate=t.pageSettings.rotate,this.pageSize=t.pageSettings.size,this.pageOrigin=t.pageSettings.origin}return Object.defineProperty(t.prototype,"orientation",{get:function(){return this.pageOrientation},set:function(t){this.pageOrientation=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this.pageRotate},set:function(t){this.pageRotate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.pageSize},set:function(t){this.pageSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"origin",{get:function(){return this.pageOrigin},set:function(t){this.pageOrigin=t},enumerable:!0,configurable:!0}),t}(),we=function(){function t(t){this.sections=[],this.dictionaryProperties=new a,this.pdfDocument=t.clone(),this.initialize()}return Object.defineProperty(t.prototype,"section",{get:function(){return this.sections},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"document",{get:function(){return this.pdfDocument},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.sections.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.pages},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){this.sectionCount=new g(0),this.sectionCollection=new m,this.pages=new h,this.pages.beginSave=new l(this),this.pages.items.setValue(this.dictionaryProperties.type,new o("Pages")),this.pages.items.setValue(this.dictionaryProperties.kids,this.sectionCollection),this.pages.items.setValue(this.dictionaryProperties.count,this.sectionCount),this.pages.items.setValue(this.dictionaryProperties.resources,new h),this.setPageSettings(this.pages,this.pdfDocument.pageSettings)},t.prototype.pdfSectionCollection=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException()");return this.sections[t]},t.prototype.setPageSettings=function(t,e){var i=new k(new T,e.size);t.items.setValue(this.dictionaryProperties.mediaBox,m.fromRectangle(i))},t.prototype.add=function(t){if(void 0===t){var e=new ye(this.pdfDocument);return this.add(e),e}var i=this.checkSection(t);return this.sections.push(t),t.parent=this,this.sectionCollection.add(i),this.sections.indexOf(t)},t.prototype.checkSection=function(t){var e=new C(t);this.sectionCollection.contains(e);return e},t.prototype.countPages=function(){var t=0;return this.sections.forEach(function(e){return t+=e.count}),t},t.prototype.beginSave=function(){this.sectionCount.intValue=this.countPages()},t.rotateFactor=90,t}(),Se=function(){function t(t){this.pdfPageCollectionIndex=new n,this.document=t}return Object.defineProperty(t.prototype,"count",{get:function(){return this.countPages()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageCollectionIndex",{get:function(){return this.pdfPageCollectionIndex},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if(void 0===t){var e=new ce;return this.add(e),e}this.getLastSection().add(t)},t.prototype.getLastSection=function(){var t=this.document.sections;return 0===t.section.length&&t.add(),t.section[t.section.length-1]},t.prototype.onPageAdded=function(t){},t.prototype.countPages=function(){for(var t=this.document.sections,e=0,i=0;i<t.section.length;i++)e+=t.section[i].count;return e},t.prototype.getPageByIndex=function(t){return this.getPage(t)},t.prototype.getPage=function(t){if(t<0||t>=this.count)throw Error('ArgumentOutOfRangeException("index", "Value can not be less 0")');for(var e=null,i=0,r=0,n=0,o=this.document.sections.count,s=0;s<o;s++){var a=this.document.sections.section[s];if(r=a.count,n=t-i,t>=i&&n<r){e=a.getPages()[n];break}i+=r}return e},t.prototype.indexOf=function(t){var e=-1;if(null==t)throw new Error("ArgumentNullException: page");for(var i=0,r=0,n=this.document.sections.count;r<n;r++){var o=this.document.sections.pdfSectionCollection(r);if((e=o.indexOf(t))>=0){e+=i;break}e=-1,i+=o.count}return e},t.prototype.remove=function(t){if(null==t)throw Error('ArgumentNullException("page")');for(var e=null,i=0,r=this.document.sections.count;i<r;i++)if((e=this.document.sections.pdfSectionCollection(i)).pages.contains(t)){e.pages.remove(t);break}return e},t}(),Pe=function(){function t(){this.referenceObjects=[],this.pdfFontCollection=new n}return t.prototype.search=function(t){var e=null,i=this.getGroup(t);return null==i?i=this.createNewGroup():i.length>0&&(e=i[0]),i.push(t),e},t.prototype.createNewGroup=function(){var t=[];return this.referenceObjects.push(t),t},t.prototype.getGroup=function(t){var e=null;if(null!==t)for(var i=this.referenceObjects.length,r=0;r<i;r++){if(this.referenceObjects.length>0){var n=this.referenceObjects[r];if(n.length>0){var o=n[0];if(t.equalsTo(o)){e=n;break}}else this.removeGroup(n)}i=this.referenceObjects.length}return e},t.prototype.removeGroup=function(t){if(null!==t){var e=this.referenceObjects.indexOf(t);this.referenceObjects.slice(e,e+1)}},t.prototype.destroy=function(){this.pdfFontCollection=void 0,this.referenceObjects=void 0},t}(),ve=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ce=function(e){function i(t){var r=e.call(this)||this;r.defaultMargin=40,r.streamWriter=null,r.document=r;var n=!1;void 0===t?(i.cacheCollection=new Pe,n=!1):n=t;var o=new W;r.setMainObjectCollection(o);var s=new q;s.isMerging=n,s.document=r,r.setCrossTable(s);var a=new U;return r.setCatalog(a),o.add(a),a.position=-1,r.sectionCollection=new we(r),r.documentPageCollection=new Se(r),a.pages=r.sectionCollection,r}return ve(i,e),Object.defineProperty(i,"defaultFont",{get:function(){return null==this.defaultStandardFont&&(this.defaultStandardFont=new xe(t.PdfFontFamily.Helvetica,8)),this.defaultStandardFont},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sections",{get:function(){return this.sectionCollection},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pageSettings",{get:function(){return null==this.settings&&(this.settings=new Z(this.defaultMargin)),this.settings},set:function(t){this.settings=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pages",{get:function(){return this.documentPageCollection},enumerable:!0,configurable:!0}),Object.defineProperty(i,"cache",{get:function(){return void 0===i.cacheCollection||null==i.cacheCollection?new Pe:i.cacheCollection},set:function(t){this.cacheCollection=t},enumerable:!0,configurable:!0}),Object.defineProperty(i,"enableCache",{get:function(){return this.isCacheEnabled},set:function(t){this.isCacheEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"colorSpace",{get:function(){return this.pdfColorSpace===t.PdfColorSpace.Rgb||this.pdfColorSpace===t.PdfColorSpace.Cmyk||this.pdfColorSpace===t.PdfColorSpace.GrayScale?this.pdfColorSpace:t.PdfColorSpace.Rgb},set:function(e){e===t.PdfColorSpace.Rgb||e===t.PdfColorSpace.Cmyk||e===t.PdfColorSpace.GrayScale?this.pdfColorSpace=e:this.pdfColorSpace=t.PdfColorSpace.Rgb},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"template",{get:function(){return null==this.pageTemplate&&(this.pageTemplate=new fe),this.pageTemplate},set:function(t){this.pageTemplate=t},enumerable:!0,configurable:!0}),i.prototype.docSave=function(t,e,i){if(this.checkPagesPresence(),null===t)throw new Error("ArgumentNullException : stream");this.streamWriter=t;var r=new z(t);if(r.document=this,"boolean"==typeof e&&void 0===i)return this.crossTable.save(r);this.crossTable.save(r,e)},i.prototype.checkPagesPresence=function(){0===this.pages.count&&this.pages.add()},i.prototype.destroy=function(){this.catalog=void 0,this.colorSpace=void 0,this.currentSavingObj=void 0,this.documentPageCollection=void 0,this.isStreamCopied=void 0,this.pageSettings=void 0,this.pageTemplate=void 0,this.pdfColorSpace=void 0,this.sectionCollection=void 0,i.cache.destroy(),this.crossTable.pdfObjects.destroy(),i.cache=void 0,this.streamWriter.destroy()},i.defaultStandardFont=null,i.isCacheEnabled=!0,i}(_),Be=function(){function e(){}return e.getMetrics=function(e,i,r){var n=null;switch(e){case t.PdfFontFamily.Helvetica:n=this.getHelveticaMetrics(e,i,r);break;case t.PdfFontFamily.Courier:n=this.getCourierMetrics(e,i,r);break;case t.PdfFontFamily.TimesRoman:n=this.getTimesMetrics(e,i,r);break;case t.PdfFontFamily.Symbol:n=this.getSymbolMetrics(e,i,r);break;case t.PdfFontFamily.ZapfDingbats:n=this.getZapfDingbatsMetrics(e,i,r);break;default:n=this.getHelveticaMetrics(t.PdfFontFamily.Helvetica,i,r)}return n.name=e.toString(),n.subScriptSizeFactor=this.subSuperScriptFactor,n.superscriptSizeFactor=this.subSuperScriptFactor,n},e.getHelveticaMetrics=function(e,i,r){var n=new It;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.helveticaBoldItalicAscent,n.descent=this.helveticaBoldItalicDescent,n.postScriptName=this.helveticaBoldItalicName,n.size=r,n.widthTable=new Et(this.arialBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.helveticaBoldAscent,n.descent=this.helveticaBoldDescent,n.postScriptName=this.helveticaBoldName,n.size=r,n.widthTable=new Et(this.arialBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.helveticaItalicAscent,n.descent=this.helveticaItalicDescent,n.postScriptName=this.helveticaItalicName,n.size=r,n.widthTable=new Et(this.arialWidth),n.height=n.ascent-n.descent):(n.ascent=this.helveticaAscent,n.descent=this.helveticaDescent,n.postScriptName=this.helveticaName,n.size=r,n.widthTable=new Et(this.arialWidth),n.height=n.ascent-n.descent),n},e.getCourierMetrics=function(e,i,r){var n=new It;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.courierBoldItalicAscent,n.descent=this.courierBoldItalicDescent,n.postScriptName=this.courierBoldItalicName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.courierBoldAscent,n.descent=this.courierBoldDescent,n.postScriptName=this.courierBoldName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.courierItalicAscent,n.descent=this.courierItalicDescent,n.postScriptName=this.courierItalicName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent):(n.ascent=this.courierAscent,n.descent=this.courierDescent,n.postScriptName=this.courierName,n.size=r,n.widthTable=new Et(this.fixedWidth),n.height=n.ascent-n.descent),n},e.getTimesMetrics=function(e,i,r){var n=new It;return(i&t.PdfFontStyle.Bold)>0&&(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.timesBoldItalicAscent,n.descent=this.timesBoldItalicDescent,n.postScriptName=this.timesBoldItalicName,n.size=r,n.widthTable=new Et(this.timesRomanBoldItalicWidths),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Bold)>0?(n.ascent=this.timesBoldAscent,n.descent=this.timesBoldDescent,n.postScriptName=this.timesBoldName,n.size=r,n.widthTable=new Et(this.timesRomanBoldWidth),n.height=n.ascent-n.descent):(i&t.PdfFontStyle.Italic)>0?(n.ascent=this.timesItalicAscent,n.descent=this.timesItalicDescent,n.postScriptName=this.timesItalicName,n.size=r,n.widthTable=new Et(this.timesRomanItalicWidth),n.height=n.ascent-n.descent):(n.ascent=this.timesAscent,n.descent=this.timesDescent,n.postScriptName=this.timesName,n.size=r,n.widthTable=new Et(this.timesRomanWidth),n.height=n.ascent-n.descent),n},e.getSymbolMetrics=function(t,e,i){var r=new It;return r.ascent=this.symbolAscent,r.descent=this.symbolDescent,r.postScriptName=this.symbolName,r.size=i,r.widthTable=new Et(this.symbolWidth),r.height=r.ascent-r.descent,r},e.getZapfDingbatsMetrics=function(t,e,i){var r=new It;return r.ascent=this.zapfDingbatsAscent,r.descent=this.zapfDingbatsDescent,r.postScriptName=this.zapfDingbatsName,r.size=i,r.widthTable=new Et(this.zapfDingbatsWidth),r.height=r.ascent-r.descent,r},e.subSuperScriptFactor=1.52,e.helveticaAscent=931,e.helveticaDescent=-225,e.helveticaName="Helvetica",e.helveticaBoldAscent=962,e.helveticaBoldDescent=-228,e.helveticaBoldName="Helvetica-Bold",e.helveticaItalicAscent=931,e.helveticaItalicDescent=-225,e.helveticaItalicName="Helvetica-Oblique",e.helveticaBoldItalicAscent=962,e.helveticaBoldItalicDescent=-228,e.helveticaBoldItalicName="Helvetica-BoldOblique",e.courierAscent=805,e.courierDescent=-250,e.courierName="Courier",e.courierBoldAscent=801,e.courierBoldDescent=-250,e.courierBoldName="Courier-Bold",e.courierItalicAscent=805,e.courierItalicDescent=-250,e.courierItalicName="Courier-Oblique",e.courierBoldItalicAscent=801,e.courierBoldItalicDescent=-250,e.courierBoldItalicName="Courier-BoldOblique",e.timesAscent=898,e.timesDescent=-218,e.timesName="Times-Roman",e.timesBoldAscent=935,e.timesBoldDescent=-218,e.timesBoldName="Times-Bold",e.timesItalicAscent=883,e.timesItalicDescent=-217,e.timesItalicName="Times-Italic",e.timesBoldItalicAscent=921,e.timesBoldItalicDescent=-218,e.timesBoldItalicName="Times-BoldItalic",e.symbolAscent=1010,e.symbolDescent=-293,e.symbolName="Symbol",e.zapfDingbatsAscent=820,e.zapfDingbatsDescent=-143,e.zapfDingbatsName="ZapfDingbats",e.arialWidth=[278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,0,556,0,222,556,333,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,222,222,333,333,350,556,1e3,333,1e3,500,333,944,0,500,667,0,333,556,556,556,556,260,556,333,737,370,556,584,0,737,333,400,584,333,333,333,556,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,584,611,556,556,556,556,500,556,500],e.arialBoldWidth=[278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,0,556,0,278,556,500,1e3,556,556,333,1e3,667,333,1e3,0,611,0,0,278,278,500,500,350,556,1e3,333,1e3,556,333,944,0,500,667,0,333,556,556,556,556,280,556,333,737,370,556,584,0,737,333,400,584,333,333,333,611,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,584,611,611,611,611,611,556,611,556],e.fixedWidth=[600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600],e.timesRomanWidth=[250,333,408,500,500,833,778,180,333,333,500,564,250,333,250,278,500,500,500,500,500,500,500,500,500,500,278,278,564,564,564,444,921,722,667,667,722,611,556,722,722,333,389,722,611,889,722,722,556,722,667,556,611,722,722,944,722,722,611,333,278,333,469,500,333,444,500,444,500,444,333,500,500,278,278,500,278,778,500,500,500,500,333,389,278,500,500,722,500,500,444,480,200,480,541,0,500,0,333,500,444,1e3,500,500,333,1e3,556,333,889,0,611,0,0,333,333,444,444,350,500,1e3,333,980,389,333,722,0,444,722,0,333,500,500,500,500,200,500,333,760,276,500,564,0,760,333,400,564,300,300,333,500,453,250,333,300,310,500,750,750,750,444,722,722,722,722,722,722,889,667,611,611,611,611,333,333,333,333,722,722,722,722,722,722,722,564,722,722,722,722,722,722,556,500,444,444,444,444,444,444,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,564,500,500,500,500,500,500,500,500],e.timesRomanBoldWidth=[250,333,555,500,500,1e3,833,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,930,722,667,722,722,667,611,778,778,389,500,778,667,944,722,778,611,778,722,556,667,722,722,1e3,722,722,667,333,278,333,581,500,333,500,556,444,556,444,333,500,556,278,333,556,278,833,556,500,556,556,444,389,333,556,500,722,500,500,444,394,220,394,520,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,1e3,0,667,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,444,722,0,333,500,500,500,500,220,500,333,747,300,500,570,0,747,333,400,570,300,300,333,556,540,250,333,300,330,500,750,750,750,500,722,722,722,722,722,722,1e3,722,667,667,667,667,389,389,389,389,722,722,778,778,778,778,778,570,778,722,722,722,722,722,611,556,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,500,556,500],e.timesRomanItalicWidth=[250,333,420,500,500,833,778,214,333,333,500,675,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,675,675,675,500,920,611,611,667,722,611,611,722,722,333,444,667,556,833,667,722,611,722,611,500,556,722,611,833,611,556,556,389,278,389,422,500,333,500,500,444,500,444,278,500,500,278,278,444,278,722,500,500,500,500,389,389,278,500,444,667,444,444,389,400,275,400,541,0,500,0,333,500,556,889,500,500,333,1e3,500,333,944,0,556,0,0,333,333,556,556,350,500,889,333,980,389,333,667,0,389,556,0,389,500,500,500,500,275,500,333,760,276,500,675,0,760,333,400,675,300,300,333,500,523,250,333,300,310,500,750,750,750,500,611,611,611,611,611,611,889,667,611,611,611,611,333,333,333,333,722,667,722,722,722,722,722,675,722,722,722,722,722,556,611,500,500,500,500,500,500,500,667,444,444,444,444,444,278,278,278,278,500,500,500,500,500,500,500,675,500,500,500,500,500,444,500,444],e.timesRomanBoldItalicWidths=[250,389,555,500,500,833,778,278,333,333,500,570,250,333,250,278,500,500,500,500,500,500,500,500,500,500,333,333,570,570,570,500,832,667,667,667,722,667,667,722,778,389,500,667,611,889,722,722,611,722,667,556,611,722,667,889,667,611,611,333,278,333,570,500,333,500,500,444,500,444,333,500,556,278,278,500,278,778,556,500,500,500,389,389,278,556,444,667,500,444,389,348,220,348,570,0,500,0,333,500,500,1e3,500,500,333,1e3,556,333,944,0,611,0,0,333,333,500,500,350,500,1e3,333,1e3,389,333,722,0,389,611,0,389,500,500,500,500,220,500,333,747,266,500,606,0,747,333,400,570,300,300,333,576,500,250,333,300,300,500,750,750,750,500,667,667,667,667,667,667,944,667,667,667,667,667,389,389,389,389,722,722,722,722,722,722,722,570,722,722,722,722,722,611,611,500,500,500,500,500,500,500,722,444,444,444,444,444,278,278,278,278,500,556,500,500,500,500,500,570,500,556,556,556,556,444,500,444],e.symbolWidth=[250,333,713,500,549,833,778,439,333,333,500,549,250,549,250,278,500,500,500,500,500,500,500,500,500,500,278,278,549,549,549,444,549,722,667,722,612,611,763,603,722,333,631,722,686,889,722,722,768,741,556,592,611,690,439,768,645,795,611,333,863,333,658,500,500,631,549,549,494,439,521,411,603,329,603,549,549,576,521,549,549,521,549,603,439,576,713,686,493,686,494,480,200,480,549,750,620,247,549,167,713,500,753,753,753,753,1042,987,603,987,603,400,549,411,549,549,713,494,460,549,549,549,549,1e3,603,1e3,658,823,686,795,987,768,768,823,768,768,713,713,713,713,713,713,713,768,713,790,790,890,823,549,250,713,603,603,1042,987,603,987,603,494,329,790,790,786,713,384,384,384,384,384,384,494,494,494,494,329,274,686,686,686,384,384,384,384,384,384,494,494,494,-1],e.zapfDingbatsWidth=[278,974,961,974,980,719,789,790,791,690,960,939,549,855,911,933,911,945,974,755,846,762,761,571,677,763,760,759,754,494,552,537,577,692,786,788,788,790,793,794,816,823,789,841,823,833,816,831,923,744,723,749,790,792,695,776,768,792,759,707,708,682,701,826,815,789,789,707,687,696,689,786,787,713,791,785,791,873,761,762,762,759,759,892,892,788,784,438,138,277,415,392,392,668,668,390,390,317,317,276,276,509,509,410,410,234,234,334,334,732,544,544,910,667,760,760,776,595,694,626,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,788,894,838,1016,458,748,924,748,918,927,928,928,834,873,828,924,924,917,930,931,463,883,836,836,867,867,696,696,874,874,760,946,771,865,771,888,967,888,831,873,927,970,918],e}(),Oe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xe=function(e){function i(r,n,o){var s=e.call(this,n,void 0===o?r instanceof i?r.style:t.PdfFontStyle.Regular:o)||this;return s.dictionaryProperties=new a,s.encodings=["Unknown","StandardEncoding","MacRomanEncoding","MacExpertEncoding","WinAnsiEncoding","PDFDocEncoding","IdentityH"],s.pdfFontFamily=void 0===r?t.PdfFontFamily.Helvetica:r instanceof i?r.fontFamily:r,s.checkStyle(),s.initializeInternals(),s}return Oe(i,e),Object.defineProperty(i.prototype,"fontFamily",{get:function(){return this.pdfFontFamily},enumerable:!0,configurable:!0}),i.prototype.checkStyle=function(){if(this.fontFamily===t.PdfFontFamily.Symbol||this.fontFamily===t.PdfFontFamily.ZapfDingbats){var e=this.style;e&=~(t.PdfFontStyle.Bold|t.PdfFontStyle.Italic),this.setStyle(e)}},i.prototype.getLineWidth=function(t,e){if(null==t)throw new Error("ArgumentNullException:line");for(var r=0,n=(this.name,0),o=(t=i.convert(t)).length;n<o;n++){var s=t[n];r+=this.getCharWidthInternal(s,e)}var a=this.metrics.getSize(e);return r*=G.charSizeMultiplier*a,r=this.applyFormatSettings(t,e,r)},i.prototype.equalsToFont=function(e){var i=!1,r=e;if(null!=r){var n=this.fontFamily===r.fontFamily,o=~(t.PdfFontStyle.Underline|t.PdfFontStyle.Strikeout),s=(this.style&o)==(r.style&o);i=n&&s}return i},i.prototype.initializeInternals=function(){Ce.cache.search(this);var t=null,e=Be.getMetrics(this.pdfFontFamily,this.style,this.size);this.metrics=e,t=this.createInternals(),this.setInternals(t)},i.prototype.createInternals=function(){var e=new h;if(e.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.font)),e.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.type1)),e.items.setValue(this.dictionaryProperties.baseFont,new o(this.metrics.postScriptName)),this.fontFamily!==t.PdfFontFamily.Symbol&&this.fontFamily!==t.PdfFontFamily.ZapfDingbats){var i=this.encodings[t.FontEncoding.WinAnsiEncoding];e.items.setValue(this.dictionaryProperties.encoding,new o(i))}return e},i.prototype.getCharWidthInternal=function(t,e){var r=0;return r=t.charCodeAt(0),"0"!==this.name&&"1"!==this.name&&"2"!==this.name&&"3"!==this.name&&"4"!==this.name||(r-=i.charOffset),r=r>=0&&128!==r?r:0,this.metrics.widthTable.items(r)},i.convert=function(t){return t},i.charOffset=32,i}(G),Le=function(){function e(e){this.dictionaryProperties=new a,this.pdfColor=new L(255,255,255),this.rectangle=new k(0,0,0,0),this.pdfPage=null,this.textBrush=new A(new L(0,0,0)),this.textFont=new xe(t.PdfFontFamily.TimesRoman,10),this.format=new D(t.PdfTextAlignment.Left),this.content="",this.pdfDictionary=new h,this.internalColor=new L,this.darkness=1,void 0===e?this.initialize():(this.initialize(),this.bounds=e)}return Object.defineProperty(e.prototype,"color",{get:function(){return this.pdfColor},set:function(t){this.pdfColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"innerColor",{get:function(){return this.internalColor},set:function(t){this.internalColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.rectangle},set:function(t){this.rectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.textFont},set:function(t){this.textFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"brush",{get:function(){return this.textBrush},set:function(t){this.textBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.content},set:function(t){this.content=t,this.dictionary.items.setValue(this.dictionaryProperties.contents,new P(this.content))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dictionary",{get:function(){return this.pdfDictionary},set:function(t){this.pdfDictionary=t},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){this.pdfDictionary.annotationBeginSave=new p(this),this.pdfDictionary.items.setValue(this.dictionaryProperties.type,new o(this.dictionaryProperties.annot))},e.prototype.setPage=function(t){this.pdfPage=t,this.pdfDictionary.items.setValue(this.dictionaryProperties.p,new C(this.pdfPage))},e.prototype.beginSave=function(){this.save()},e.prototype.save=function(){var t=new k(this.rectangle.x,this.rectangle.y,this.rectangle.width,this.rectangle.height),e=this.pdfPage.section,i=t.height,r=e.pointToNativePdf(this.page,new T(t.x,t.y));t.x=r.x,t.width=r.x+t.width,t.y=r.y-this.page.document.pageSettings.margins.top,t.height=t.y-i,this.pdfDictionary.items.setValue(this.dictionaryProperties.rect,m.fromRectangle(t)),this.dictionary.items.setValue(this.dictionaryProperties.ca,new g(this.darkness))},Object.defineProperty(e.prototype,"element",{get:function(){return this.pdfDictionary},enumerable:!0,configurable:!0}),e}(),Te=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),je=function(t){function e(e){return t.call(this,e)||this}return Te(e,t),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link))},e}(Le),ke=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ve=function(t){function e(e){var i=t.call(this,e)||this;return i.pdfAction=null,i}return ke(e,t),e.prototype.getSetAction=function(t){if(void 0===t)return this.pdfAction;this.pdfAction=t},e}(je),Re=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ne=function(t){function e(e,i){var r=t.call(this,e)||this;return r.pdfDestination=null,void 0!==i&&(r.destination=i),r}return Re(e,t),Object.defineProperty(e.prototype,"destination",{get:function(){return this.pdfDestination},set:function(t){this.pdfDestination=t},enumerable:!0,configurable:!0}),e.prototype.save=function(){t.prototype.save.call(this),null!=this.pdfDestination&&this.dictionary.items.setValue(this.dictionaryProperties.dest,this.pdfDestination.element)},e.prototype.clone=function(){var t=new e(this.bounds,this.destination);return t.color=this.color,t.brush=this.brush,t.destination=this.destination,t.font=this.font,t},e}(je),Ae=function(){function t(t){this.layoutElement=t}return Object.defineProperty(t.prototype,"elements",{get:function(){return this.layoutElement},enumerable:!0,configurable:!0}),t.prototype.getElement=function(){return this.layoutElement},t.prototype.layout=function(t){return this.layoutInternal(t)},t.prototype.Layouter=function(t){return this.layoutInternal(t)},t.prototype.getNextPage=function(t){return t.section.add()},t.prototype.getPaginateBounds=function(t){if(null==t)throw new Error("ArgumentNullException : param");return t.format.usePaginateBounds?t.format.paginateBounds:new k(t.bounds.x,0,t.bounds.width,t.bounds.height)},t}(),De=function(){function t(t){void 0===t||(this.break=t.break,this.layout=t.layout,this.paginateBounds=t.paginateBounds,this.boundsSet=t.usePaginateBounds)}return Object.defineProperty(t.prototype,"layout",{get:function(){return this.layoutType},set:function(t){this.layoutType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"break",{get:function(){return this.breakType},set:function(t){this.breakType=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paginateBounds",{get:function(){return void 0===this.layoutPaginateBounds&&null==this.layoutPaginateBounds&&(this.layoutPaginateBounds=new k(0,0,0,0)),this.layoutPaginateBounds},set:function(t){this.layoutPaginateBounds=t,this.boundsSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"usePaginateBounds",{get:function(){return this.boundsSet},enumerable:!0,configurable:!0}),t}(),Me=function(){function t(){}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return new k(this.layoutBounds.x,this.layoutBounds.y,this.layoutBounds.width,this.layoutBounds.height)},set:function(t){this.layoutBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return this.layoutFormat},set:function(t){this.layoutFormat=t},enumerable:!0,configurable:!0}),t}(),Ie=function(){function t(t,e){this.pdfPage=t,this.layoutBounds=e}return Object.defineProperty(t.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.layoutBounds},enumerable:!0,configurable:!0}),t}(),Fe=function(){function e(){var e=new Q(new L(0,0,0));e.dashStyle=t.PdfDashStyle.Solid;var i=new Q(new L(0,0,0));i.dashStyle=t.PdfDashStyle.Solid;var r=new Q(new L(0,0,0));r.dashStyle=t.PdfDashStyle.Solid;var n=new Q(new L(0,0,0));n.dashStyle=t.PdfDashStyle.Solid,this.leftPen=e,this.rightPen=i,this.topPen=r,this.bottomPen=n}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftPen},set:function(t){this.leftPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightPen},set:function(t){this.rightPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topPen},set:function(t){this.topPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomPen},set:function(t){this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"all",{set:function(t){this.leftPen=this.rightPen=this.topPen=this.bottomPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(e,"default",{get:function(){return new e},enumerable:!0,configurable:!0}),e}(),Ee=function(){function t(t,e,i,r){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===t?(this.leftPad=this.rightPad=5.76,this.bottomPad=this.topPad=.5):(this.leftPad=t,this.rightPad=e,this.topPad=i,this.bottomPad=r,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.leftPad},set:function(t){this.leftPad=t,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.rightPad},set:function(t){this.rightPad=t,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.topPad},set:function(t){this.topPad=t,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.bottomPad},set:function(t){this.bottomPad=t,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"all",{set:function(t){this.leftPad=this.rightPad=this.topPad=this.bottomPad=t,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),t}(),Ge=function(){function t(){}return Object.defineProperty(t.prototype,"raiseBeginPageLayout",{get:function(){return void 0!==this.beginPageLayout},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"raiseEndPageLayout",{get:function(){return void 0!==this.endPageLayout},enumerable:!0,configurable:!0}),t.prototype.onBeginPageLayout=function(t){this.beginPageLayout&&this.beginPageLayout(this,t)},t.prototype.onEndPageLayout=function(t){this.endPageLayout&&this.endPageLayout(this,t)},t.prototype.drawHelper=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof De||null==r)){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}if(e instanceof k&&void 0!==e.width&&"boolean"==typeof i)return this.bEmbedFonts=i,this.drawHelper(t,e,null);var s=new Me,a=e,h=i;if(s.page=t,s.bounds=a,null!=s){var l=s.bounds.x,u=s.bounds.y;0===s.bounds.x&&(l=Fe.default.right.width/2),0===s.bounds.y&&(u=Fe.default.top.width/2);var c=new k(l,u,s.bounds.width,s.bounds.height);s.bounds=c}return s.format=null!=h?h:new De,this.layout(s)},t}(),ze=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),We=function(e){function i(t){return e.call(this,t)||this}return ze(i,e),Object.defineProperty(i.prototype,"element",{get:function(){return e.prototype.getElement.call(this)},enumerable:!0,configurable:!0}),i.prototype.layoutInternal=function(t){this.format=null!==this.element.stringFormat&&void 0!==this.element.stringFormat?this.element.stringFormat:null;var e=t.page,i=t.bounds,r=this.element.value,n=null,o=new He;for(o.page=e,o.remainder=r;;){o=this.layoutOnPage(r,e,i,t),n=this.getLayoutResult(o);break}return n},i.prototype.getLayoutResult=function(t){return new _e(t.page,t.bounds,t.remainder,t.lastLineBounds)},i.prototype.layoutOnPage=function(e,i,r,n){var o=new He;o.remainder=e,o.page=i,r=this.checkCorrectBounds(i,r);var s=(new I).layout(e,this.element.font,this.format,r,i.getClientSize().height,!1,new j(0,0)),a=null==s.remainder,h=(n.format.break===t.PdfLayoutBreakType.FitElement||s.empty,i.graphics),l=this.element.getBrush();this.element instanceof Je&&(l.color=new L(0,0,255)),h.drawStringLayoutResult(s,this.element.font,this.element.pen,l,r,this.format);s.lines[s.lineCount-1];return o.lastLineBounds=h.getLineBounds(s.lineCount-1,s,this.element.font,r,this.format),o.bounds=this.getTextPageBounds(i,r,s),o.remainder=s.remainder,o.end=a,o},i.prototype.checkCorrectBounds=function(t,e){var i=t.graphics.clientSize;return e.height=e.height>0?e.height:i.height-e.y,e},i.prototype.getTextPageBounds=function(t,e,i){var r=i.actualSize,n=e.x,o=e.y,s=e.width>0?e.width:r.width,a=r.height;n=t.graphics.checkCorrectLayoutRectangle(r,e.x,e.y,this.format).x;var h=t.graphics.getTextVerticalAlignShift(r.height,e.height,this.format);return new k(n,o+=h,s,a)},i}(Ae),He=function(){function t(){}return t}(),_e=function(t){function e(e,i,r,n){var o=t.call(this,e,i)||this;return o.remainderText=r,o.lastLineTextBounds=n,o}return ze(e,t),Object.defineProperty(e.prototype,"remainder",{get:function(){return this.remainderText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastLineBounds",{get:function(){return this.lastLineTextBounds},enumerable:!0,configurable:!0}),e}(Ie),Ke=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ue=function(e){function i(t,i,r,n,o){var s=e.call(this)||this;return s.content="",s.elementValue="",s.hasPointOverload=!1,s.isPdfTextElement=!1,void 0===t||("string"==typeof t&&void 0===i?(s.content=t,s.elementValue=t):"string"==typeof t&&i instanceof G&&void 0===r?(s.content=t,s.elementValue=t,s.pdfFont=i):"string"==typeof t&&i instanceof G&&r instanceof Q&&void 0===n?(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfPen=r):"string"==typeof t&&i instanceof G&&r instanceof R&&void 0===n?(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfBrush=r):(s.content=t,s.elementValue=t,s.pdfFont=i,s.pdfPen=r,s.pdfBrush=n,s.format=o)),s}return Ke(i,e),Object.defineProperty(i.prototype,"text",{get:function(){return this.content},set:function(t){this.elementValue=t,this.content=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this.elementValue},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pen",{get:function(){return this.pdfPen},set:function(t){this.pdfPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"brush",{get:function(){return this.pdfBrush},set:function(t){this.pdfBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"font",{get:function(){return this.pdfFont},set:function(t){this.pdfFont=t,this.pdfFont instanceof xe&&null!=this.content?this.elementValue=xe.convert(this.content):this.elementValue=this.content},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),i.prototype.getBrush=function(){return null==this.pdfBrush||void 0===this.pdfBrush?new A(new L(0,0,0)):this.pdfBrush},i.prototype.layout=function(t){return new We(this).layout(t)},i.prototype.drawText=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.hasPointOverload=!0,this.drawText(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawText(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof De)return this.hasPointOverload=!0,this.drawText(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof De||null==r)){this.hasPointOverload=!0;var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawText(t,o,r)}if(e instanceof k&&void 0!==e.width&&"boolean"==typeof i)return this.drawText(t,e,null);var s=new I;if(this.hasPointOverload){var a=s.layout(this.value,this.font,this.stringFormat,new j(t.graphics.clientSize.width-e.x,0),!0,t.graphics.clientSize),h=void 0,l=e,u=i;if((f=new Me).page=t,f.bounds=l,f.format=null!=u?u:new De,a.lines.length>1){if(this.text=a.layoutLines[0].text,f.bounds.y<=f.page.graphics.clientSize.height){g=new T(f.bounds.x,f.bounds.y);h=this.layout(f);for(var c=new k(0,h.bounds.y+a.lineHeight,t.graphics.clientSize.width,a.lineHeight),p=1;p<a.lines.length;p++)if(f.page=h.page,f.bounds=new k(new T(c.x,c.y),new j(c.width,c.height)),this.text=a.layoutLines[p].text,c.y+a.lineHeight>h.page.graphics.clientSize.height&&(f.page=f.page.graphics.getNextPage(),c=g.y>h.page.graphics.clientSize.height-h.bounds.height?new k(0,h.bounds.height,h.page.graphics.clientSize.width,a.lineHeight):new k(0,0,h.page.graphics.clientSize.width,a.lineHeight),f.bounds=c),h=this.layout(f),p!==a.lines.length-1)c=new k(0,h.bounds.y+a.lineHeight,h.page.graphics.clientSize.width,a.lineHeight);else{m=this.font.measureString(this.text,this.format).width;h=this.calculateResultBounds(h,m,h.page.graphics.clientSize.width,0)}}return h}y=this.font.measureString(this.text,this.format);return f.bounds.y<=f.page.graphics.clientSize.height&&(h=this.layout(f),h=this.calculateResultBounds(h,y.width,h.page.graphics.clientSize.width,0)),h}var h=s.layout(this.value,this.font,this.stringFormat,new j(e.width,0),!1,t.graphics.clientSize),d=void 0,f=new Me,l=e,u=i;if(f.page=t,f.bounds=l,f.format=null!=u?u:new De,h.lines.length>1){if(this.text=h.layoutLines[0].text,f.bounds.y<=f.page.graphics.clientSize.height){var g=new T(f.bounds.x,f.bounds.y);d=this.layout(f);for(var c=new k(l.x,d.bounds.y+h.lineHeight,l.width,h.lineHeight),p=1;p<h.lines.length;p++)if(f.page=d.page,f.bounds=new k(c.x,c.y,c.width,c.height),this.text=h.layoutLines[p].text,c.y+h.lineHeight>d.page.graphics.clientSize.height&&(f.page=f.page.graphics.getNextPage(),c=g.y>d.page.graphics.clientSize.height-d.bounds.height?new k(l.x,h.lineHeight,l.width,h.lineHeight):new k(l.x,0,l.width,h.lineHeight),f.bounds=c),d=this.layout(f),p!==h.lines.length-1)c=new k(l.x,d.bounds.y+h.lineHeight,l.width,h.lineHeight);else{var m=this.font.measureString(this.text,this.format).width;d=this.calculateResultBounds(d,m,l.width,l.x)}}return d}var y=this.font.measureString(this.text,this.format);return f.bounds.y<=f.page.graphics.clientSize.height&&(d=this.layout(f),d=this.calculateResultBounds(d,y.width,l.width,l.x)),d},i.prototype.calculateResultBounds=function(e,i,r,n){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Center?(e.bounds.x=n+(r-i)/2,e.bounds.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Right?(e.bounds.x=n+(r-i),e.bounds.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Justify?(e.bounds.x=n,e.bounds.width=r):(e.bounds.width=n,e.bounds.width=i),e},i}(Ge),qe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ye=function(t){function e(e,i){var r=t.call(this,e)||this;return void 0!==i&&(r.uri=i),r}return qe(e,t),Object.defineProperty(e.prototype,"uriAction",{get:function(){return void 0===this.pdfUriAction&&(this.pdfUriAction=new x),this.pdfUriAction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uri",{get:function(){return this.uriAction.uri},set:function(t){this.uriAction.uri!==t&&(this.uriAction.uri=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"action",{get:function(){return this.getSetAction()},set:function(t){this.getSetAction(t),this.uriAction.next=t},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){t.prototype.initialize.call(this),this.dictionary.items.setValue(this.dictionaryProperties.subtype,new o(this.dictionaryProperties.link));this.uriAction.element;this.dictionary.items.setValue(this.dictionaryProperties.a,this.uriAction.element)},e}(Ve),Xe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Je=function(e){function i(){var t=e.call(this)||this;t.uniformResourceLocator="",t.uriAnnotation=null,t.recalculateBounds=!1,t.defaultBorder=new m;for(var i=0;i<3;i++)t.defaultBorder.add(new g(0));return t}return Xe(i,e),Object.defineProperty(i.prototype,"url",{get:function(){return this.uniformResourceLocator},set:function(t){if(0===t.length)throw new Error("ArgumentException : Url - string can not be empty");this.uniformResourceLocator=t},enumerable:!0,configurable:!0}),i.prototype.draw=function(e,i){if(e instanceof ce){var r=new I,n=this.font.style;if(i instanceof T){if(this.recalculateBounds=!0,this.font.style=t.PdfFontStyle.Underline,1===(h=r.layout(this.value,this.font,this.stringFormat,new j(e.graphics.clientSize.width-i.x,0),!0,e.graphics.clientSize)).lines.length){var o=this.font.measureString(this.value),s=new k(i,o);s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,i.x),this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation);a=this.drawText(e,i);return this.font.style=n,a}var a=this.drawMultipleLineWithPoint(h,e,i);return this.font.style=n,a}var h=r.layout(this.value,this.font,this.stringFormat,new j(i.width,0),!1,new j(0,0));if(this.font.style=t.PdfFontStyle.Underline,1===h.lines.length){var o=this.font.measureString(this.value),s=new k(new T(i.x,i.y),o);s=this.calculateBounds(s,o.width,i.width,i.x),this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation);l=this.drawText(e,i);return this.font.style=n,l}var l=this.drawMultipleLineWithBounds(h,e,i);return this.font.style=n,l}var u=new ce;return u=e.page,this.draw(u,i)},i.prototype.drawMultipleLineWithPoint=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new k(i,o);if(0!==n&&(s.x=0),this.text=t.lines[n].text,s.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),s=new k(0,0,e.graphics.clientSize.width,o.height),i.y=0}s=this.calculateBounds(s,o.width,e.graphics.clientSize.width,s.x),this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=0!==n?this.drawText(e,new T(0,s.y)):this.drawText(e,s.x,s.y),i.y+=o.height}return r},i.prototype.drawMultipleLineWithBounds=function(t,e,i){for(var r,n=0;n<t.layoutLines.length;n++){var o=this.font.measureString(t.lines[n].text),s=new k(new T(i.x,i.y),o);if(s=this.calculateBounds(s,o.width,i.width,i.x),this.text=t.lines[n].text,i.y+o.height>e.graphics.clientSize.height){if(0===n)break;e=e.graphics.getNextPage(),i=new k(i.x,0,i.width,o.height),s.y=0}this.uriAnnotation=new Ye(s,this.url),this.uriAnnotation.dictionary.items.setValue("Border",this.defaultBorder),e.annotations.add(this.uriAnnotation),r=this.drawText(e,i),i.y+=o.height}return r},i.prototype.calculateBounds=function(e,i,r,n){return null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Center?(e.x=n+(r-i)/2,e.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Right?(e.x=n+(r-i),e.width=i):null!=this.stringFormat&&void 0!==this.stringFormat&&this.stringFormat.alignment===t.PdfTextAlignment.Justify?(e.x=n,e.width=r):(e.width=n,e.width=i),e},i}(Ue),Ze=function(){function e(){}return e.convert=function(e,i){var r="";switch(i){case t.PdfNumberStyle.None:r="";break;case t.PdfNumberStyle.Numeric:r=e.toString();break;case t.PdfNumberStyle.LowerLatin:r=this.arabicToLetter(e).toLowerCase();break;case t.PdfNumberStyle.LowerRoman:r=this.arabicToRoman(e).toLowerCase();break;case t.PdfNumberStyle.UpperLatin:r=this.arabicToLetter(e);break;case t.PdfNumberStyle.UpperRoman:r=this.arabicToRoman(e)}return r},e.arabicToRoman=function(t){var e="",i=this.generateNumber(t,1e3,"M");e+=i.returnValue,t=i.intArabic;var r=this.generateNumber(t,900,"CM");e+=r.returnValue,t=r.intArabic;var n=this.generateNumber(t,500,"D");e+=n.returnValue,t=n.intArabic;var o=this.generateNumber(t,400,"CD");e+=o.returnValue,t=o.intArabic;var s=this.generateNumber(t,100,"C");e+=s.returnValue,t=s.intArabic;var a=this.generateNumber(t,90,"XC");e+=a.returnValue,t=a.intArabic;var h=this.generateNumber(t,50,"L");e+=h.returnValue,t=h.intArabic;var l=this.generateNumber(t,40,"XL");e+=l.returnValue,t=l.intArabic;var u=this.generateNumber(t,10,"X");e+=u.returnValue,t=u.intArabic;var c=this.generateNumber(t,9,"IX");e+=c.returnValue,t=c.intArabic;var p=this.generateNumber(t,5,"V");e+=p.returnValue,t=p.intArabic;var d=this.generateNumber(t,4,"IV");e+=d.returnValue,t=d.intArabic;var f=this.generateNumber(t,1,"I");return e+=f.returnValue,t=f.intArabic,e.toString()},e.arabicToLetter=function(t){for(var e=this.convertToLetter(t),i="";e.length>0;){var r=e.pop();i=this.appendChar(i,r)}return i.toString()},e.generateNumber=function(t,e,i){for(var r="";t>=e;)t-=e,r+=i;return{returnValue:r.toString(),intArabic:t}},e.convertToLetter=function(t){if(t<=0)throw Error("ArgumentOutOfRangeException-arabic, Value can not be less 0");for(var e=[];t>this.letterLimit;){var i=t%this.letterLimit;0===i?(t=t/this.letterLimit-1,i=this.letterLimit):t/=this.letterLimit,e.push(i)}return e.push(t),e},e.appendChar=function(t,i){return t+=String.fromCharCode(e.acsiiStartIndex+i)},e.letterLimit=26,e.acsiiStartIndex=64,e}(),$e=function(){function t(t,e){this.pdfTemplate=null,this.content="",void 0===t||(this.template=t,this.value=e)}return Object.defineProperty(t.prototype,"template",{get:function(){return this.pdfTemplate},set:function(t){this.pdfTemplate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.content},set:function(t){this.content=t},enumerable:!0,configurable:!0}),t}(),Qe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ti=function(t){function e(){var e=t.call(this)||this;return e.list=new rt,e}return Qe(e,t),e.prototype.performDraw=function(e,i,r,n){t.prototype.performDrawHelper.call(this,e,i,r,n);var o=this.getValue(e),s=new Yt(this.getSize());this.list.setValue(e,new $e(s,o));var a=this.getSize();s.graphics.drawString(o,this.getFont(),this.pen,this.getBrush(),0,0,a.width,a.height,this.stringFormat);var h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(s,h,new j(s.width*r,s.height*n))},e}(ht),ei=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ii=function(e){function i(i,r){var n=e.call(this)||this;return n.internalNumberStyle=t.PdfNumberStyle.Numeric,void 0===r?n.font=i:r instanceof R?(n.font=i,n.brush=r):(n.font=i,n.bounds=r),n}return ei(i,e),Object.defineProperty(i.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),i.prototype.getValue=function(t){var e=this.getPageFromGraphics(t);return this.internalGetValue(e)},i.prototype.internalGetValue=function(t){var e=t.document.pages.indexOf(t)+1;return Ze.convert(e,this.numberStyle)},i}(ti),ri=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ni=function(t){function e(e,i,r){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];var s=t.call(this)||this;return s.internalAutomaticFields=null,s.internalText="",s.font=e,s.brush=i,s.text=r,s.automaticFields=n,s}return ri(e,t),Object.defineProperty(e.prototype,"text",{get:function(){return this.internalText},set:function(t){this.internalText=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"automaticFields",{get:function(){return this.internalAutomaticFields},set:function(t){this.internalAutomaticFields=t},enumerable:!0,configurable:!0}),e.prototype.getValue=function(t){var e=this.text.toString();if(void 0!==this.automaticFields&&null!=this.automaticFields&&this.automaticFields.length>0)for(var i=0;i<this.automaticFields.length;i++){var r=this.automaticFields[i];e=e.replace("{"+i+"}",r.getValue(t))}return e},e}(ti),oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),si=function(t){function e(){var e=t.call(this)||this;return e.list=new rt,e.painterGraphics=[],e}return oi(e,t),e.prototype.performDraw=function(e,i,r,n){t.prototype.performDrawHelper.call(this,e,i,r,n);var o=this.getPageFromGraphics(e).document,s=this.getValue(e);if(this.list.containsKey(o)){var a=this.list.getValue(o),h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(a.template,h,new j(a.template.width*r,a.template.height*n)),this.painterGraphics.push(e)}else{var l=this.getSize(),u=new Yt(l);this.list.setValue(o,new $e(u,s)),u.graphics.drawString(s,this.getFont(),this.pen,this.getBrush(),0,0,l.width,l.height,this.stringFormat);h=new T(i.x+this.location.x,i.y+this.location.y);e.drawPdfTemplate(u,h,new j(u.width*r,u.height*n)),this.painterGraphics.push(e)}},e}(ht),ai=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hi=function(e){function i(i,r){var n=e.call(this)||this;return n.internalNumberStyle=t.PdfNumberStyle.Numeric,void 0===r?n.font=i:r instanceof R?(n.font=i,n.brush=r):(n.font=i,n.bounds=r),n}return ai(i,e),Object.defineProperty(i.prototype,"numberStyle",{get:function(){return this.internalNumberStyle},set:function(t){this.internalNumberStyle=t},enumerable:!0,configurable:!0}),i.prototype.getValue=function(t){var e=this.getPageFromGraphics(t).section.parent.document.pages.count;return Ze.convert(e,this.numberStyle)},i}(si);!function(t){t[t.Location=0]="Location",t[t.FitToPage=1]="FitToPage",t[t.FitR=2]="FitR"}(t.PdfDestinationMode||(t.PdfDestinationMode={}));var li,ui=function(){function e(e,i){this.dictionaryProperties=new a,this.destinationMode=t.PdfDestinationMode.Location,this.zoomFactor=0,this.destinationLocation=new T(0,0),this.bounds=new k,this.array=new m;t.PdfPageRotateAngle.RotateAngle0;this.destinationLocation=new T(0,this.destinationLocation.y),this.pdfPage=e,i instanceof T?this.destinationLocation=i:this.bounds=i}return Object.defineProperty(e.prototype,"zoom",{get:function(){return this.zoomFactor},set:function(t){this.zoomFactor=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},set:function(t){this.pdfPage=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this.destinationMode},set:function(t){this.destinationMode=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return this.destinationLocation},set:function(t){this.destinationLocation=t,this.initializePrimitive()},enumerable:!0,configurable:!0}),e.prototype.pointToNativePdf=function(t,e){return t.section.pointToNativePdf(t,e)},e.prototype.initializePrimitive=function(){switch(this.array.clear(),this.array.add(new C(this.pdfPage)),this.destinationMode){case t.PdfDestinationMode.Location:var e=this.pdfPage,i=new T;i=this.pointToNativePdf(e,this.destinationLocation),this.array.add(new o(this.dictionaryProperties.xyz)),this.array.add(new g(i.x)),this.array.add(new g(i.y)),this.array.add(new g(this.zoomFactor));break;case t.PdfDestinationMode.FitToPage:this.array.add(new o(this.dictionaryProperties.fit))}},Object.defineProperty(e.prototype,"element",{get:function(){return this.initializePrimitive(),this.array},enumerable:!0,configurable:!0}),e}(),ci=function(){function t(t){this.mDictionary=null,this.mDictionaryProperties=new a,this.mDictionary=t}return Object.defineProperty(t.prototype,"domain",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.domain)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.domain,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){return this.mDictionary.items.getValue(this.mDictionaryProperties.range)},set:function(t){this.mDictionary.items.setValue(this.mDictionaryProperties.range,t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dictionary",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.mDictionary},enumerable:!0,configurable:!0}),t}(),pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),di=function(t){function e(e,i,r,n){var o=t.call(this,new b)||this;return void 0===e?o.dictionary.items.setValue(o.mDictionaryProperties.functionType,new g(0)):(o.dictionary.items.setValue(o.mDictionaryProperties.functionType,new g(0)),o.checkParams(e,i,r,n),o.setDomainAndRange(e,i),o.setSizeAndValues(r,n)),o}return pi(e,t),e.prototype.checkParams=function(t,e,i,r){e.length,t.length,r.length},e.prototype.setDomainAndRange=function(t,e){this.domain=new m(t),this.range=new m(e)},e.prototype.setSizeAndValues=function(t,e){var i=this.dictionary;this.dictionary.items.setValue(this.mDictionaryProperties.size,new m(t)),this.dictionary.items.setValue(this.mDictionaryProperties.bitsPerSample,new g(8)),i.writeBytes(e)},e}(ci);!function(t){t[t.None=0]="None",t[t.Start=1]="Start",t[t.End=2]="End",t[t.Both=3]="Both"}(li||(li={}));var fi;!function(t){t[t.BackwardDiagonal=0]="BackwardDiagonal",t[t.ForwardDiagonal=1]="ForwardDiagonal",t[t.Horizontal=2]="Horizontal",t[t.Vertical=3]="Vertical"}(fi||(fi={}));var gi;!function(t){t[t.Function=1]="Function",t[t.Axial=2]="Axial",t[t.Radial=3]="Radial"}(gi||(gi={}));var mi;!function(t){t[t.ActiveBorder=1]="ActiveBorder",t[t.ActiveCaption=2]="ActiveCaption",t[t.ActiveCaptionText=3]="ActiveCaptionText",t[t.AppWorkspace=4]="AppWorkspace",t[t.Control=5]="Control",t[t.ControlDark=6]="ControlDark",t[t.ControlDarkDark=7]="ControlDarkDark",t[t.ControlLight=8]="ControlLight",t[t.ControlLightLight=9]="ControlLightLight",t[t.ControlText=10]="ControlText",t[t.Desktop=11]="Desktop",t[t.GrayText=12]="GrayText",t[t.Highlight=13]="Highlight",t[t.HighlightText=14]="HighlightText",t[t.HotTrack=15]="HotTrack",t[t.InactiveBorder=16]="InactiveBorder",t[t.InactiveCaption=17]="InactiveCaption",t[t.InactiveCaptionText=18]="InactiveCaptionText",t[t.Info=19]="Info",t[t.InfoText=20]="InfoText",t[t.Menu=21]="Menu",t[t.MenuText=22]="MenuText",t[t.ScrollBar=23]="ScrollBar",t[t.Window=24]="Window",t[t.WindowFrame=25]="WindowFrame",t[t.WindowText=26]="WindowText",t[t.Transparent=27]="Transparent",t[t.AliceBlue=28]="AliceBlue",t[t.AntiqueWhite=29]="AntiqueWhite",t[t.Aqua=30]="Aqua",t[t.Aquamarine=31]="Aquamarine",t[t.Azure=32]="Azure",t[t.Beige=33]="Beige",t[t.Bisque=34]="Bisque",t[t.Black=35]="Black",t[t.BlanchedAlmond=36]="BlanchedAlmond",t[t.Blue=37]="Blue",t[t.BlueViolet=38]="BlueViolet",t[t.Brown=39]="Brown",t[t.BurlyWood=40]="BurlyWood",t[t.CadetBlue=41]="CadetBlue",t[t.Chartreuse=42]="Chartreuse",t[t.Chocolate=43]="Chocolate",t[t.Coral=44]="Coral",t[t.CornflowerBlue=45]="CornflowerBlue",t[t.Cornsilk=46]="Cornsilk",t[t.Crimson=47]="Crimson",t[t.Cyan=48]="Cyan",t[t.DarkBlue=49]="DarkBlue",t[t.DarkCyan=50]="DarkCyan",t[t.DarkGoldenrod=51]="DarkGoldenrod",t[t.DarkGray=52]="DarkGray",t[t.DarkGreen=53]="DarkGreen",t[t.DarkKhaki=54]="DarkKhaki",t[t.DarkMagenta=55]="DarkMagenta",t[t.DarkOliveGreen=56]="DarkOliveGreen",t[t.DarkOrange=57]="DarkOrange",t[t.DarkOrchid=58]="DarkOrchid",t[t.DarkRed=59]="DarkRed",t[t.DarkSalmon=60]="DarkSalmon",t[t.DarkSeaGreen=61]="DarkSeaGreen",t[t.DarkSlateBlue=62]="DarkSlateBlue",t[t.DarkSlateGray=63]="DarkSlateGray",t[t.DarkTurquoise=64]="DarkTurquoise",t[t.DarkViolet=65]="DarkViolet",t[t.DeepPink=66]="DeepPink",t[t.DeepSkyBlue=67]="DeepSkyBlue",t[t.DimGray=68]="DimGray",t[t.DodgerBlue=69]="DodgerBlue",t[t.Firebrick=70]="Firebrick",t[t.FloralWhite=71]="FloralWhite",t[t.ForestGreen=72]="ForestGreen",t[t.Fuchsia=73]="Fuchsia",t[t.Gainsboro=74]="Gainsboro",t[t.GhostWhite=75]="GhostWhite",t[t.Gold=76]="Gold",t[t.Goldenrod=77]="Goldenrod",t[t.Gray=78]="Gray",t[t.Green=79]="Green",t[t.GreenYellow=80]="GreenYellow",t[t.Honeydew=81]="Honeydew",t[t.HotPink=82]="HotPink",t[t.IndianRed=83]="IndianRed",t[t.Indigo=84]="Indigo",t[t.Ivory=85]="Ivory",t[t.Khaki=86]="Khaki",t[t.Lavender=87]="Lavender",t[t.LavenderBlush=88]="LavenderBlush",t[t.LawnGreen=89]="LawnGreen",t[t.LemonChiffon=90]="LemonChiffon",t[t.LightBlue=91]="LightBlue",t[t.LightCoral=92]="LightCoral",t[t.LightCyan=93]="LightCyan",t[t.LightGoldenrodYellow=94]="LightGoldenrodYellow",t[t.LightGray=95]="LightGray",t[t.LightGreen=96]="LightGreen",t[t.LightPink=97]="LightPink",t[t.LightSalmon=98]="LightSalmon",t[t.LightSeaGreen=99]="LightSeaGreen",t[t.LightSkyBlue=100]="LightSkyBlue",t[t.LightSlateGray=101]="LightSlateGray",t[t.LightSteelBlue=102]="LightSteelBlue",t[t.LightYellow=103]="LightYellow",t[t.Lime=104]="Lime",t[t.LimeGreen=105]="LimeGreen",t[t.Linen=106]="Linen",t[t.Magenta=107]="Magenta",t[t.Maroon=108]="Maroon",t[t.MediumAquamarine=109]="MediumAquamarine",t[t.MediumBlue=110]="MediumBlue",t[t.MediumOrchid=111]="MediumOrchid",t[t.MediumPurple=112]="MediumPurple",t[t.MediumSeaGreen=113]="MediumSeaGreen",t[t.MediumSlateBlue=114]="MediumSlateBlue",t[t.MediumSpringGreen=115]="MediumSpringGreen",t[t.MediumTurquoise=116]="MediumTurquoise",t[t.MediumVioletRed=117]="MediumVioletRed",t[t.MidnightBlue=118]="MidnightBlue",t[t.MintCream=119]="MintCream",t[t.MistyRose=120]="MistyRose",t[t.Moccasin=121]="Moccasin",t[t.NavajoWhite=122]="NavajoWhite",t[t.Navy=123]="Navy",t[t.OldLace=124]="OldLace",t[t.Olive=125]="Olive",t[t.OliveDrab=126]="OliveDrab",t[t.Orange=127]="Orange",t[t.OrangeRed=128]="OrangeRed",t[t.Orchid=129]="Orchid",t[t.PaleGoldenrod=130]="PaleGoldenrod",t[t.PaleGreen=131]="PaleGreen",t[t.PaleTurquoise=132]="PaleTurquoise",t[t.PaleVioletRed=133]="PaleVioletRed",t[t.PapayaWhip=134]="PapayaWhip",t[t.PeachPuff=135]="PeachPuff",t[t.Peru=136]="Peru",t[t.Pink=137]="Pink",t[t.Plum=138]="Plum",t[t.PowderBlue=139]="PowderBlue",t[t.Purple=140]="Purple",t[t.Red=141]="Red",t[t.RosyBrown=142]="RosyBrown",t[t.RoyalBlue=143]="RoyalBlue",t[t.SaddleBrown=144]="SaddleBrown",t[t.Salmon=145]="Salmon",t[t.SandyBrown=146]="SandyBrown",t[t.SeaGreen=147]="SeaGreen",t[t.SeaShell=148]="SeaShell",t[t.Sienna=149]="Sienna",t[t.Silver=150]="Silver",t[t.SkyBlue=151]="SkyBlue",t[t.SlateBlue=152]="SlateBlue",t[t.SlateGray=153]="SlateGray",t[t.Snow=154]="Snow",t[t.SpringGreen=155]="SpringGreen",t[t.SteelBlue=156]="SteelBlue",t[t.Tan=157]="Tan",t[t.Teal=158]="Teal",t[t.Thistle=159]="Thistle",t[t.Tomato=160]="Tomato",t[t.Turquoise=161]="Turquoise",t[t.Violet=162]="Violet",t[t.Wheat=163]="Wheat",t[t.White=164]="White",t[t.WhiteSmoke=165]="WhiteSmoke",t[t.Yellow=166]="Yellow",t[t.YellowGreen=167]="YellowGreen",t[t.ButtonFace=168]="ButtonFace",t[t.ButtonHighlight=169]="ButtonHighlight",t[t.ButtonShadow=170]="ButtonShadow",t[t.GradientActiveCaption=171]="GradientActiveCaption",t[t.GradientInactiveCaption=172]="GradientInactiveCaption",t[t.MenuBar=173]="MenuBar",t[t.MenuHighlight=174]="MenuHighlight"}(mi||(mi={}));var yi=function(){function t(){}return Object.defineProperty(t,"AliceBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.AliceBlue)&&(t=this.sBrushes.getValue(mi.AliceBlue)),null==t&&(t=this.getBrush(mi.AliceBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"AntiqueWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.AntiqueWhite)&&(t=this.sBrushes.getValue(mi.AntiqueWhite)),null==t&&(t=this.getBrush(mi.AntiqueWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Aqua",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Aqua)&&(t=this.sBrushes.getValue(mi.Aqua)),null==t&&(t=this.getBrush(mi.Aqua)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Aquamarine",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Aquamarine)&&(t=this.sBrushes.getValue(mi.Aquamarine)),null==t&&(t=this.getBrush(mi.Aquamarine)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Azure",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Azure)&&(t=this.sBrushes.getValue(mi.Azure)),null==t&&(t=this.getBrush(mi.Azure)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Beige",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Beige)&&(t=this.sBrushes.getValue(mi.Beige)),null==t&&(t=this.getBrush(mi.Beige)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Bisque",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Bisque)&&(t=this.sBrushes.getValue(mi.Bisque)),null==t&&(t=this.getBrush(mi.Bisque)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Black",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Black)&&(t=this.sBrushes.getValue(mi.Black)),null==t&&(t=this.getBrush(mi.Black)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BlanchedAlmond",{get:function(){var t=null;return this.sBrushes.containsKey(mi.BlanchedAlmond)&&(t=this.sBrushes.getValue(mi.BlanchedAlmond)),null==t&&(t=this.getBrush(mi.BlanchedAlmond)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Blue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Blue)&&(t=this.sBrushes.getValue(mi.Blue)),null==t&&(t=this.getBrush(mi.Blue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BlueViolet",{get:function(){var t=null;return this.sBrushes.containsKey(mi.BlueViolet)&&(t=this.sBrushes.getValue(mi.BlueViolet)),null==t&&(t=this.getBrush(mi.BlueViolet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Brown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Brown)&&(t=this.sBrushes.getValue(mi.Brown)),null==t&&(t=this.getBrush(mi.Brown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BurlyWood",{get:function(){var t=null;return this.sBrushes.containsKey(mi.BurlyWood)&&(t=this.sBrushes.getValue(mi.BurlyWood)),null==t&&(t=this.getBrush(mi.BurlyWood)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"CadetBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.CadetBlue)&&(t=this.sBrushes.getValue(mi.CadetBlue)),null==t&&(t=this.getBrush(mi.CadetBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Chartreuse",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Chartreuse)&&(t=this.sBrushes.getValue(mi.Chartreuse)),null==t&&(t=this.getBrush(mi.Chartreuse)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Chocolate",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Chocolate)&&(t=this.sBrushes.getValue(mi.Chocolate)),null==t&&(t=this.getBrush(mi.Chocolate)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Coral",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Coral)&&(t=this.sBrushes.getValue(mi.Coral)),null==t&&(t=this.getBrush(mi.Coral)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"CornflowerBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.CornflowerBlue)&&(t=this.sBrushes.getValue(mi.CornflowerBlue)),null==t&&(t=this.getBrush(mi.CornflowerBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Cornsilk",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Cornsilk)&&(t=this.sBrushes.getValue(mi.Cornsilk)),null==t&&(t=this.getBrush(mi.Cornsilk)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Crimson",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Crimson)&&(t=this.sBrushes.getValue(mi.Crimson)),null==t&&(t=this.getBrush(mi.Crimson)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Cyan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Cyan)&&(t=this.sBrushes.getValue(mi.Cyan)),null==t&&(t=this.getBrush(mi.Cyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkBlue)&&(t=this.sBrushes.getValue(mi.DarkBlue)),null==t&&(t=this.getBrush(mi.DarkBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkCyan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkCyan)&&(t=this.sBrushes.getValue(mi.DarkCyan)),null==t&&(t=this.getBrush(mi.DarkCyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGoldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkGoldenrod)&&(t=this.sBrushes.getValue(mi.DarkGoldenrod)),null==t&&(t=this.getBrush(mi.DarkGoldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkGray)&&(t=this.sBrushes.getValue(mi.DarkGray)),null==t&&(t=this.getBrush(mi.DarkGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkGreen)&&(t=this.sBrushes.getValue(mi.DarkGreen)),null==t&&(t=this.getBrush(mi.DarkGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkKhaki",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkKhaki)&&(t=this.sBrushes.getValue(mi.DarkKhaki)),null==t&&(t=this.getBrush(mi.DarkKhaki)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkMagenta",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkMagenta)&&(t=this.sBrushes.getValue(mi.DarkMagenta)),null==t&&(t=this.getBrush(mi.DarkMagenta)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOliveGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkOliveGreen)&&(t=this.sBrushes.getValue(mi.DarkOliveGreen)),null==t&&(t=this.getBrush(mi.DarkOliveGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOrange",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkOrange)&&(t=this.sBrushes.getValue(mi.DarkOrange)),null==t&&(t=this.getBrush(mi.DarkOrange)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkOrchid",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkOrchid)&&(t=this.sBrushes.getValue(mi.DarkOrchid)),null==t&&(t=this.getBrush(mi.DarkOrchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkRed)&&(t=this.sBrushes.getValue(mi.DarkRed)),null==t&&(t=this.getBrush(mi.DarkRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSalmon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSalmon)&&(t=this.sBrushes.getValue(mi.DarkSalmon)),null==t&&(t=this.getBrush(mi.DarkSalmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSeaGreen)&&(t=this.sBrushes.getValue(mi.DarkSeaGreen)),null==t&&(t=this.getBrush(mi.DarkSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSlateBlue)&&(t=this.sBrushes.getValue(mi.DarkSlateBlue)),null==t&&(t=this.getBrush(mi.DarkSlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkSlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkSlateGray)&&(t=this.sBrushes.getValue(mi.DarkSlateGray)),null==t&&(t=this.getBrush(mi.DarkSlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkTurquoise)&&(t=this.sBrushes.getValue(mi.DarkTurquoise)),null==t&&(t=this.getBrush(mi.DarkTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DarkViolet",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DarkViolet)&&(t=this.sBrushes.getValue(mi.DarkViolet)),null==t&&(t=this.getBrush(mi.DarkViolet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DeepPink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DeepPink)&&(t=this.sBrushes.getValue(mi.DeepPink)),null==t&&(t=this.getBrush(mi.DeepPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DeepSkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DeepSkyBlue)&&(t=this.sBrushes.getValue(mi.DeepSkyBlue)),null==t&&(t=this.getBrush(mi.DeepSkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DimGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DimGray)&&(t=this.sBrushes.getValue(mi.DimGray)),null==t&&(t=this.getBrush(mi.DimGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"DodgerBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.DodgerBlue)&&(t=this.sBrushes.getValue(mi.DodgerBlue)),null==t&&(t=this.getBrush(mi.DodgerBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Firebrick",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Firebrick)&&(t=this.sBrushes.getValue(mi.Firebrick)),null==t&&(t=this.getBrush(mi.Firebrick)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"FloralWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.FloralWhite)&&(t=this.sBrushes.getValue(mi.FloralWhite)),null==t&&(t=this.getBrush(mi.FloralWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ForestGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.ForestGreen)&&(t=this.sBrushes.getValue(mi.ForestGreen)),null==t&&(t=this.getBrush(mi.ForestGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Fuchsia",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Fuchsia)&&(t=this.sBrushes.getValue(mi.Fuchsia)),null==t&&(t=this.getBrush(mi.Fuchsia)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gainsboro",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Gainsboro)&&(t=this.sBrushes.getValue(mi.Gainsboro)),null==t&&(t=this.getBrush(mi.Gainsboro)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"GhostWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.GhostWhite)&&(t=this.sBrushes.getValue(mi.GhostWhite)),null==t&&(t=this.getBrush(mi.GhostWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gold",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Gold)&&(t=this.sBrushes.getValue(mi.Gold)),null==t&&(t=this.getBrush(mi.Gold)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Goldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Goldenrod)&&(t=this.sBrushes.getValue(mi.Goldenrod)),null==t&&(t=this.getBrush(mi.Goldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Gray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Gray)&&(t=this.sBrushes.getValue(mi.Gray)),null==t&&(t=this.getBrush(mi.Gray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Green",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Green)&&(t=this.sBrushes.getValue(mi.Green)),null==t&&(t=this.getBrush(mi.Green)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"GreenYellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.GreenYellow)&&(t=this.sBrushes.getValue(mi.GreenYellow)),null==t&&(t=this.getBrush(mi.GreenYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Honeydew",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Honeydew)&&(t=this.sBrushes.getValue(mi.Honeydew)),null==t&&(t=this.getBrush(mi.Honeydew)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"HotPink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.HotPink)&&(t=this.sBrushes.getValue(mi.HotPink)),null==t&&(t=this.getBrush(mi.HotPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"IndianRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.IndianRed)&&(t=this.sBrushes.getValue(mi.IndianRed)),null==t&&(t=this.getBrush(mi.IndianRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Indigo",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Indigo)&&(t=this.sBrushes.getValue(mi.Indigo)),null==t&&(t=this.getBrush(mi.Indigo)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Ivory",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Ivory)&&(t=this.sBrushes.getValue(mi.Ivory)),null==t&&(t=this.getBrush(mi.Ivory)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Khaki",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Khaki)&&(t=this.sBrushes.getValue(mi.Khaki)),null==t&&(t=this.getBrush(mi.Khaki)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Lavender",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Lavender)&&(t=this.sBrushes.getValue(mi.Lavender)),null==t&&(t=this.getBrush(mi.Lavender)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LavenderBlush",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LavenderBlush)&&(t=this.sBrushes.getValue(mi.LavenderBlush)),null==t&&(t=this.getBrush(mi.LavenderBlush)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LawnGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LawnGreen)&&(t=this.sBrushes.getValue(mi.LawnGreen)),null==t&&(t=this.getBrush(mi.LawnGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LemonChiffon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LemonChiffon)&&(t=this.sBrushes.getValue(mi.LemonChiffon)),null==t&&(t=this.getBrush(mi.LemonChiffon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightBlue)&&(t=this.sBrushes.getValue(mi.LightBlue)),null==t&&(t=this.getBrush(mi.LightBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightCoral",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightCoral)&&(t=this.sBrushes.getValue(mi.LightCoral)),null==t&&(t=this.getBrush(mi.LightCoral)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightCyan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightCyan)&&(t=this.sBrushes.getValue(mi.LightCyan)),null==t&&(t=this.getBrush(mi.LightCyan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGoldenrodYellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightGoldenrodYellow)&&(t=this.sBrushes.getValue(mi.LightGoldenrodYellow)),null==t&&(t=this.getBrush(mi.LightGoldenrodYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightGray)&&(t=this.sBrushes.getValue(mi.LightGray)),null==t&&(t=this.getBrush(mi.LightGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightGreen)&&(t=this.sBrushes.getValue(mi.LightGreen)),null==t&&(t=this.getBrush(mi.LightGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightPink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightPink)&&(t=this.sBrushes.getValue(mi.LightPink)),null==t&&(t=this.getBrush(mi.LightPink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSalmon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSalmon)&&(t=this.sBrushes.getValue(mi.LightSalmon)),null==t&&(t=this.getBrush(mi.LightSalmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSeaGreen)&&(t=this.sBrushes.getValue(mi.LightSeaGreen)),null==t&&(t=this.getBrush(mi.LightSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSkyBlue)&&(t=this.sBrushes.getValue(mi.LightSkyBlue)),null==t&&(t=this.getBrush(mi.LightSkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSlateGray)&&(t=this.sBrushes.getValue(mi.LightSlateGray)),null==t&&(t=this.getBrush(mi.LightSlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightSteelBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightSteelBlue)&&(t=this.sBrushes.getValue(mi.LightSteelBlue)),null==t&&(t=this.getBrush(mi.LightSteelBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightYellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LightYellow)&&(t=this.sBrushes.getValue(mi.LightYellow)),null==t&&(t=this.getBrush(mi.LightYellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Lime",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Lime)&&(t=this.sBrushes.getValue(mi.Lime)),null==t&&(t=this.getBrush(mi.Lime)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LimeGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.LimeGreen)&&(t=this.sBrushes.getValue(mi.LimeGreen)),null==t&&(t=this.getBrush(mi.LimeGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Linen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Linen)&&(t=this.sBrushes.getValue(mi.Linen)),null==t&&(t=this.getBrush(mi.Linen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Magenta",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Magenta)&&(t=this.sBrushes.getValue(mi.Magenta)),null==t&&(t=this.getBrush(mi.Magenta)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Maroon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Maroon)&&(t=this.sBrushes.getValue(mi.Maroon)),null==t&&(t=this.getBrush(mi.Maroon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumAquamarine",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumAquamarine)&&(t=this.sBrushes.getValue(mi.MediumAquamarine)),null==t&&(t=this.getBrush(mi.MediumAquamarine)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumBlue)&&(t=this.sBrushes.getValue(mi.MediumBlue)),null==t&&(t=this.getBrush(mi.MediumBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumOrchid",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumOrchid)&&(t=this.sBrushes.getValue(mi.MediumOrchid)),null==t&&(t=this.getBrush(mi.MediumOrchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumPurple",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumPurple)&&(t=this.sBrushes.getValue(mi.MediumPurple)),null==t&&(t=this.getBrush(mi.MediumPurple)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumSeaGreen)&&(t=this.sBrushes.getValue(mi.MediumSeaGreen)),null==t&&(t=this.getBrush(mi.MediumSeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumSlateBlue)&&(t=this.sBrushes.getValue(mi.MediumSlateBlue)),null==t&&(t=this.getBrush(mi.MediumSlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumSpringGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumSpringGreen)&&(t=this.sBrushes.getValue(mi.MediumSpringGreen)),null==t&&(t=this.getBrush(mi.MediumSpringGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumTurquoise)&&(t=this.sBrushes.getValue(mi.MediumTurquoise)),null==t&&(t=this.getBrush(mi.MediumTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MediumVioletRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MediumVioletRed)&&(t=this.sBrushes.getValue(mi.MediumVioletRed)),null==t&&(t=this.getBrush(mi.MediumVioletRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MidnightBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MidnightBlue)&&(t=this.sBrushes.getValue(mi.MidnightBlue)),null==t&&(t=this.getBrush(mi.MidnightBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MintCream",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MintCream)&&(t=this.sBrushes.getValue(mi.MintCream)),null==t&&(t=this.getBrush(mi.MintCream)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MistyRose",{get:function(){var t=null;return this.sBrushes.containsKey(mi.MistyRose)&&(t=this.sBrushes.getValue(mi.MistyRose)),null==t&&(t=this.getBrush(mi.MistyRose)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Moccasin",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Moccasin)&&(t=this.sBrushes.getValue(mi.Moccasin)),null==t&&(t=this.getBrush(mi.Moccasin)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"NavajoWhite",{get:function(){var t=null;return this.sBrushes.containsKey(mi.NavajoWhite)&&(t=this.sBrushes.getValue(mi.NavajoWhite)),null==t&&(t=this.getBrush(mi.NavajoWhite)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Navy",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Navy)&&(t=this.sBrushes.getValue(mi.Navy)),null==t&&(t=this.getBrush(mi.Navy)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OldLace",{get:function(){var t=null;return this.sBrushes.containsKey(mi.OldLace)&&(t=this.sBrushes.getValue(mi.OldLace)),null==t&&(t=this.getBrush(mi.OldLace)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Olive",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Olive)&&(t=this.sBrushes.getValue(mi.Olive)),null==t&&(t=this.getBrush(mi.Olive)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OliveDrab",{get:function(){var t=null;return this.sBrushes.containsKey(mi.OliveDrab)&&(t=this.sBrushes.getValue(mi.OliveDrab)),null==t&&(t=this.getBrush(mi.OliveDrab)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Orange",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Orange)&&(t=this.sBrushes.getValue(mi.Orange)),null==t&&(t=this.getBrush(mi.Orange)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OrangeRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.OrangeRed)&&(t=this.sBrushes.getValue(mi.OrangeRed)),null==t&&(t=this.getBrush(mi.OrangeRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Orchid",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Orchid)&&(t=this.sBrushes.getValue(mi.Orchid)),null==t&&(t=this.getBrush(mi.Orchid)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleGoldenrod",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleGoldenrod)&&(t=this.sBrushes.getValue(mi.PaleGoldenrod)),null==t&&(t=this.getBrush(mi.PaleGoldenrod)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleGreen)&&(t=this.sBrushes.getValue(mi.PaleGreen)),null==t&&(t=this.getBrush(mi.PaleGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleTurquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleTurquoise)&&(t=this.sBrushes.getValue(mi.PaleTurquoise)),null==t&&(t=this.getBrush(mi.PaleTurquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PaleVioletRed",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PaleVioletRed)&&(t=this.sBrushes.getValue(mi.PaleVioletRed)),null==t&&(t=this.getBrush(mi.PaleVioletRed)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PapayaWhip",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PapayaWhip)&&(t=this.sBrushes.getValue(mi.PapayaWhip)),null==t&&(t=this.getBrush(mi.PapayaWhip)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PeachPuff",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PeachPuff)&&(t=this.sBrushes.getValue(mi.PeachPuff)),null==t&&(t=this.getBrush(mi.PeachPuff)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Peru",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Peru)&&(t=this.sBrushes.getValue(mi.Peru)),null==t&&(t=this.getBrush(mi.Peru)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Pink",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Pink)&&(t=this.sBrushes.getValue(mi.Pink)),null==t&&(t=this.getBrush(mi.Pink)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Plum",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Plum)&&(t=this.sBrushes.getValue(mi.Plum)),null==t&&(t=this.getBrush(mi.Plum)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"PowderBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.PowderBlue)&&(t=this.sBrushes.getValue(mi.PowderBlue)),null==t&&(t=this.getBrush(mi.PowderBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Purple",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Purple)&&(t=this.sBrushes.getValue(mi.Purple)),null==t&&(t=this.getBrush(mi.Purple)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Red",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Red)&&(t=this.sBrushes.getValue(mi.Red)),null==t&&(t=this.getBrush(mi.Red)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RosyBrown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.RosyBrown)&&(t=this.sBrushes.getValue(mi.RosyBrown)),null==t&&(t=this.getBrush(mi.RosyBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RoyalBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.RoyalBlue)&&(t=this.sBrushes.getValue(mi.RoyalBlue)),null==t&&(t=this.getBrush(mi.RoyalBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SaddleBrown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SaddleBrown)&&(t=this.sBrushes.getValue(mi.SaddleBrown)),null==t&&(t=this.getBrush(mi.SaddleBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Salmon",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Salmon)&&(t=this.sBrushes.getValue(mi.Salmon)),null==t&&(t=this.getBrush(mi.Salmon)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SandyBrown",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SandyBrown)&&(t=this.sBrushes.getValue(mi.SandyBrown)),null==t&&(t=this.getBrush(mi.SandyBrown)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SeaGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SeaGreen)&&(t=this.sBrushes.getValue(mi.SeaGreen)),null==t&&(t=this.getBrush(mi.SeaGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SeaShell",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SeaShell)&&(t=this.sBrushes.getValue(mi.SeaShell)),null==t&&(t=this.getBrush(mi.SeaShell)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Sienna",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Sienna)&&(t=this.sBrushes.getValue(mi.Sienna)),null==t&&(t=this.getBrush(mi.Sienna)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Silver",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Silver)&&(t=this.sBrushes.getValue(mi.Silver)),null==t&&(t=this.getBrush(mi.Silver)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SkyBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SkyBlue)&&(t=this.sBrushes.getValue(mi.SkyBlue)),null==t&&(t=this.getBrush(mi.SkyBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SlateBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SlateBlue)&&(t=this.sBrushes.getValue(mi.SlateBlue)),null==t&&(t=this.getBrush(mi.SlateBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SlateGray",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SlateGray)&&(t=this.sBrushes.getValue(mi.SlateGray)),null==t&&(t=this.getBrush(mi.SlateGray)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Snow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Snow)&&(t=this.sBrushes.getValue(mi.Snow)),null==t&&(t=this.getBrush(mi.Snow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SpringGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SpringGreen)&&(t=this.sBrushes.getValue(mi.SpringGreen)),null==t&&(t=this.getBrush(mi.SpringGreen)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SteelBlue",{get:function(){var t=null;return this.sBrushes.containsKey(mi.SteelBlue)&&(t=this.sBrushes.getValue(mi.SteelBlue)),null==t&&(t=this.getBrush(mi.SteelBlue)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Tan",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Tan)&&(t=this.sBrushes.getValue(mi.Tan)),null==t&&(t=this.getBrush(mi.Tan)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Teal",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Teal)&&(t=this.sBrushes.getValue(mi.Teal)),null==t&&(t=this.getBrush(mi.Teal)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Thistle",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Thistle)&&(t=this.sBrushes.getValue(mi.Thistle)),null==t&&(t=this.getBrush(mi.Thistle)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Tomato",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Tomato)&&(t=this.sBrushes.getValue(mi.Tomato)),null==t&&(t=this.getBrush(mi.Tomato)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Transparent",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Transparent)&&(t=this.sBrushes.getValue(mi.Transparent)),null==t&&(t=this.getBrush(mi.Transparent)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Turquoise",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Turquoise)&&(t=this.sBrushes.getValue(mi.Turquoise)),null==t&&(t=this.getBrush(mi.Turquoise)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Violet",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Violet)&&(t=this.sBrushes.getValue(mi.Violet)),null==t&&(t=this.getBrush(mi.Violet)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Wheat",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Wheat)&&(t=this.sBrushes.getValue(mi.Wheat)),null==t&&(t=this.getBrush(mi.Wheat)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"White",{get:function(){var t=null;return this.sBrushes.containsKey(mi.White)&&(t=this.sBrushes.getValue(mi.White)),null==t&&(t=this.getBrush(mi.White)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WhiteSmoke",{get:function(){var t=null;return this.sBrushes.containsKey(mi.WhiteSmoke)&&(t=this.sBrushes.getValue(mi.WhiteSmoke)),null==t&&(t=this.getBrush(mi.WhiteSmoke)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"Yellow",{get:function(){var t=null;return this.sBrushes.containsKey(mi.Yellow)&&(t=this.sBrushes.getValue(mi.Yellow)),null==t&&(t=this.getBrush(mi.Yellow)),t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"YellowGreen",{get:function(){var t=null;return this.sBrushes.containsKey(mi.YellowGreen)&&(t=this.sBrushes.getValue(mi.YellowGreen)),null==t&&(t=this.getBrush(mi.YellowGreen)),t},enumerable:!0,configurable:!0}),t.getBrush=function(t){var e=this.getColorValue(t),i=new A(e);return this.sBrushes.setValue(t,i),i},t.getColorValue=function(t){var e=new L;switch(t){case mi.Transparent:e=new L(0,255,255,255);break;case mi.AliceBlue:e=new L(255,240,248,255);break;case mi.AntiqueWhite:e=new L(255,250,235,215);break;case mi.Aqua:e=new L(255,0,255,255);break;case mi.Aquamarine:e=new L(255,127,255,212);break;case mi.Azure:e=new L(255,240,255,255);break;case mi.Beige:e=new L(255,245,245,220);break;case mi.Bisque:e=new L(255,255,228,196);break;case mi.Black:e=new L(255,0,0,0);break;case mi.BlanchedAlmond:e=new L(255,255,235,205);break;case mi.Blue:e=new L(255,0,0,255);break;case mi.BlueViolet:e=new L(255,138,43,226);break;case mi.Brown:e=new L(255,165,42,42);break;case mi.BurlyWood:e=new L(255,222,184,135);break;case mi.CadetBlue:e=new L(255,95,158,160);break;case mi.Chartreuse:e=new L(255,127,255,0);break;case mi.Chocolate:e=new L(255,210,105,30);break;case mi.Coral:e=new L(255,255,127,80);break;case mi.CornflowerBlue:e=new L(255,100,149,237);break;case mi.Cornsilk:e=new L(255,255,248,220);break;case mi.Crimson:e=new L(255,220,20,60);break;case mi.Cyan:e=new L(255,0,255,255);break;case mi.DarkBlue:e=new L(255,0,0,139);break;case mi.DarkCyan:e=new L(255,0,139,139);break;case mi.DarkGoldenrod:e=new L(255,184,134,11);break;case mi.DarkGray:e=new L(255,169,169,169);break;case mi.DarkGreen:e=new L(255,0,100,0);break;case mi.DarkKhaki:e=new L(255,189,183,107);break;case mi.DarkMagenta:e=new L(255,139,0,139);break;case mi.DarkOliveGreen:e=new L(255,85,107,47);break;case mi.DarkOrange:e=new L(255,255,140,0);break;case mi.DarkOrchid:e=new L(255,153,50,204);break;case mi.DarkRed:e=new L(255,139,0,0);break;case mi.DarkSalmon:e=new L(255,233,150,122);break;case mi.DarkSeaGreen:e=new L(255,143,188,139);break;case mi.DarkSlateBlue:e=new L(255,72,61,139);break;case mi.DarkSlateGray:e=new L(255,47,79,79);break;case mi.DarkTurquoise:e=new L(255,0,206,209);break;case mi.DarkViolet:e=new L(255,148,0,211);break;case mi.DeepPink:e=new L(255,255,20,147);break;case mi.DeepSkyBlue:e=new L(255,0,191,255);break;case mi.DimGray:e=new L(255,105,105,105);break;case mi.DodgerBlue:e=new L(255,30,144,255);break;case mi.Firebrick:e=new L(255,178,34,34);break;case mi.FloralWhite:e=new L(255,255,250,240);break;case mi.ForestGreen:e=new L(255,34,139,34);break;case mi.Fuchsia:e=new L(255,255,0,255);break;case mi.Gainsboro:e=new L(255,220,220,220);break;case mi.GhostWhite:e=new L(255,248,248,255);break;case mi.Gold:e=new L(255,255,215,0);break;case mi.Goldenrod:e=new L(255,218,165,32);break;case mi.Gray:e=new L(255,128,128,128);break;case mi.Green:e=new L(255,0,128,0);break;case mi.GreenYellow:e=new L(255,173,255,47);break;case mi.Honeydew:e=new L(255,240,255,240);break;case mi.HotPink:e=new L(255,255,105,180);break;case mi.IndianRed:e=new L(255,205,92,92);break;case mi.Indigo:e=new L(255,75,0,130);break;case mi.Ivory:e=new L(255,255,255,240);break;case mi.Khaki:e=new L(255,240,230,140);break;case mi.Lavender:e=new L(255,230,230,250);break;case mi.LavenderBlush:e=new L(255,255,240,245);break;case mi.LawnGreen:e=new L(255,124,252,0);break;case mi.LemonChiffon:e=new L(255,255,250,205);break;case mi.LightBlue:e=new L(255,173,216,230);break;case mi.LightCoral:e=new L(255,240,128,128);break;case mi.LightCyan:e=new L(255,224,255,255);break;case mi.LightGoldenrodYellow:e=new L(255,250,250,210);break;case mi.LightGreen:e=new L(255,144,238,144);break;case mi.LightGray:e=new L(255,211,211,211);break;case mi.LightPink:e=new L(255,255,182,193);break;case mi.LightSalmon:e=new L(255,255,160,122);break;case mi.LightSeaGreen:e=new L(255,32,178,170);break;case mi.LightSkyBlue:e=new L(255,135,206,250);break;case mi.LightSlateGray:e=new L(255,119,136,153);break;case mi.LightSteelBlue:e=new L(255,176,196,222);break;case mi.LightYellow:e=new L(255,255,255,224);break;case mi.Lime:e=new L(255,0,255,0);break;case mi.LimeGreen:e=new L(255,50,205,50);break;case mi.Linen:e=new L(255,250,240,230);break;case mi.Magenta:e=new L(255,255,0,255);break;case mi.Maroon:e=new L(255,128,0,0);break;case mi.MediumAquamarine:e=new L(255,102,205,170);break;case mi.MediumBlue:e=new L(255,0,0,205);break;case mi.MediumOrchid:e=new L(255,186,85,211);break;case mi.MediumPurple:e=new L(255,147,112,219);break;case mi.MediumSeaGreen:e=new L(255,60,179,113);break;case mi.MediumSlateBlue:e=new L(255,123,104,238);break;case mi.MediumSpringGreen:e=new L(255,0,250,154);break;case mi.MediumTurquoise:e=new L(255,72,209,204);break;case mi.MediumVioletRed:e=new L(255,199,21,133);break;case mi.MidnightBlue:e=new L(255,25,25,112);break;case mi.MintCream:e=new L(255,245,255,250);break;case mi.MistyRose:e=new L(255,255,228,225);break;case mi.Moccasin:e=new L(255,255,228,181);break;case mi.NavajoWhite:e=new L(255,255,222,173);break;case mi.Navy:e=new L(255,0,0,128);break;case mi.OldLace:e=new L(255,253,245,230);break;case mi.Olive:e=new L(255,128,128,0);break;case mi.OliveDrab:e=new L(255,107,142,35);break;case mi.Orange:e=new L(255,255,165,0);break;case mi.OrangeRed:e=new L(255,255,69,0);break;case mi.Orchid:e=new L(255,218,112,214);break;case mi.PaleGoldenrod:e=new L(255,238,232,170);break;case mi.PaleGreen:e=new L(255,152,251,152);break;case mi.PaleTurquoise:e=new L(255,175,238,238);break;case mi.PaleVioletRed:e=new L(255,219,112,147);break;case mi.PapayaWhip:e=new L(255,255,239,213);break;case mi.PeachPuff:e=new L(255,255,218,185);break;case mi.Peru:e=new L(255,205,133,63);break;case mi.Pink:e=new L(255,255,192,203);break;case mi.Plum:e=new L(255,221,160,221);break;case mi.PowderBlue:e=new L(255,176,224,230);break;case mi.Purple:e=new L(255,128,0,128);break;case mi.Red:e=new L(255,255,0,0);break;case mi.RosyBrown:e=new L(255,188,143,143);break;case mi.RoyalBlue:e=new L(255,65,105,225);break;case mi.SaddleBrown:e=new L(255,139,69,19);break;case mi.Salmon:e=new L(255,250,128,114);break;case mi.SandyBrown:e=new L(255,244,164,96);break;case mi.SeaGreen:e=new L(255,46,139,87);break;case mi.SeaShell:e=new L(255,255,245,238);break;case mi.Sienna:e=new L(255,160,82,45);break;case mi.Silver:e=new L(255,192,192,192);break;case mi.SkyBlue:e=new L(255,135,206,235);break;case mi.SlateBlue:e=new L(255,106,90,205);break;case mi.SlateGray:e=new L(255,112,128,144);break;case mi.Snow:e=new L(255,255,250,250);break;case mi.SpringGreen:e=new L(255,0,255,127);break;case mi.SteelBlue:e=new L(255,70,130,180);break;case mi.Tan:e=new L(255,210,180,140);break;case mi.Teal:e=new L(255,0,128,128);break;case mi.Thistle:e=new L(255,216,191,216);break;case mi.Tomato:e=new L(255,255,99,71);break;case mi.Turquoise:e=new L(255,64,224,208);break;case mi.Violet:e=new L(255,238,130,238);break;case mi.Wheat:e=new L(255,245,222,179);break;case mi.White:e=new L(255,255,255,255);break;case mi.WhiteSmoke:e=new L(255,245,245,245);break;case mi.Yellow:e=new L(255,255,255,0);break;case mi.YellowGreen:e=new L(255,154,205,50)}return e},t.sBrushes=new n,t}(),bi=function(){function e(t){this.precision=1e3}return Object.defineProperty(e.prototype,"factors",{get:function(){return this.mFactors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Factors");this.mFactors=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"positions",{get:function(){return this.mPositions},set:function(t){for(var e=t,i=0;i<e.length;i++)(e[i]<0||e[i]>1)&&(e[i]=0);this.mPositions=e,this.mPositions=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this.mCount},enumerable:!0,configurable:!0}),e.prototype.generateColorBlend=function(t,e){if(null==t)throw new Error("ArgumentNullException : colours");null==this.positions&&(this.positions=[0]);var i=new Si(this.count),r=this.positions,n=null;if(1===r.length)(r=[3])[0]=0,r[1]=this.positions[0],r[2]=1,(n=new Array(3))[0]=t[0],n[1]=t[0],n[2]=t[1];else{var o=t[0],s=t[1];n=new Array(this.count);var a=0,h=this.count;for(a=0;a<h;++a)n[a]=this.interpolate(this.mFactors[a],o,s,e)}return i.positions=r,i.colors=n,i},e.prototype.clonePdfBlend=function(){var t=this;return null!=this.mFactors&&(t.factors=this.mFactors),null!=this.positions&&(t.positions=this.positions),t},e.prototype.gcd=function(t,e){if("number"==typeof t&&"number"==typeof e&&void 0!==e){if(t<0||t>1)throw new Error("ArgumentOutOfRangeException : u");if(e<0||e>1)throw new Error("ArgumentOutOfRangeException : v");var i=Math.max(1,t*this.precision),r=Math.max(1,e*this.precision);return this.gcdInt(i,r)/this.precision}var n=t;if(null==n)throw new Error("ArgumentNullException : values");if(n.length<1)throw new Error("ArgumentException : Not enough values in the array. - values");var o=n[0];if(n.length>1)for(var s=n.length,a=1;a<s&&(o=this.gcd(n[a],o))!==1/this.precision;++a);return o},e.prototype.gcdInt=function(t,e){if(t<=0)throw new Error("ArgumentOutOfRangeException"+t+"The arguments cannot be less or equal to zero.");if(e<=0)throw new Error("ArgumentOutOfRangeException"+e+"The arguments cannot be less or equal to zero.");if(1===t||1===e)return 1;for(var i=0;this.isEven(t,e);)++i,t>>=1,e>>=1;for(;(1&t)<=0;)t>>=1;do{for(;(1&e)<=0;)e>>=1;if(t>e){var r=e;e=t,t=r}e-=t}while(0!==e);return t<<i},e.prototype.isEven=function(t,e){if("number"==typeof e&&void 0!==e){var i=!0;return i=i&&(1&t)<=0,i=i&&(1&e)<=0}return(1&t)<=0},e.prototype.interpolate=function(e,i,r,n){if(i instanceof L){var o=new L;switch(n){case t.PdfColorSpace.Rgb:var s=this.interpolate(e,i.red,r.red),a=this.interpolate(e,i.green,r.green),h=this.interpolate(e,i.blue,r.blue);o=new L(s,a,h);break;case t.PdfColorSpace.GrayScale:var l=this.interpolate(e,i.gray,r.gray);o=new L(l);break;case t.PdfColorSpace.Cmyk:var u=this.interpolate(e,i.c,r.c),c=this.interpolate(e,i.m,r.m),p=this.interpolate(e,i.y,r.y),d=this.interpolate(e,i.k,r.k);o=new L(u,c,p,d)}return o}return 0===e?i:1===e?r:i+(r-i)/1*(e-0)},e}(),wi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Si=function(e){function i(t){var i=e.call(this)||this;return"number"==typeof t&&(i=e.call(this,t)||this),i}return wi(i,e),Object.defineProperty(i.prototype,"colors",{get:function(){return this.mcolors},set:function(t){if(null==t)throw new Error("ArgumentNullException : Colors");this.mcolors=t},enumerable:!0,configurable:!0}),i.prototype.getFunction=function(t){var e=[0,1],i=this.getColorComponentsCount(t),r=this.getMaxComponentValue(t),n=this.setRange(i,r),o=null;if(null==this.mbrush&&void 0===this.mbrush){var s=[1],a=void 0,h=1;if(2===this.positions.length)a=2;else{var l=this.positions,u=this.getIntervals(l),c=this.gcd(u);h=c,a=1/c+1}s[0]=a;var p=this.getSamplesValues(t,a,r,h);return o=new di(e,n,s,p)}return o},i.prototype.cloneColorBlend=function(){var t=this;return null!=this.mcolors&&void 0!==this.mcolors&&(t.colors=this.mcolors),null!=this.positions&&void 0!==this.positions&&(t.positions=this.positions),t},i.prototype.setRange=function(t,e){for(var i=[2*t],r=0;r<t;++r)i[2*r]=0,i[2*r+1]=1;return i},i.prototype.getColorComponentsCount=function(e){var i=0;switch(e){case t.PdfColorSpace.Rgb:i=3;break;case t.PdfColorSpace.Cmyk:i=4;break;case t.PdfColorSpace.GrayScale:i=1;break;default:throw new Error("ArgumentException - Unsupported color space: "+e+" colorSpace")}return i},i.prototype.getSamplesValues=function(e,i,r,n){var o;switch(e){case t.PdfColorSpace.GrayScale:o=this.getGrayscaleSamples(i,r,n);break;case t.PdfColorSpace.Cmyk:o=this.getCmykSamples(i,r,n);break;case t.PdfColorSpace.Rgb:o=this.getRgbSamples(i,r,n);break;default:throw new Error("ArgumentException - Unsupported color space: "+e+" colorSpace")}return o},i.prototype.getGrayscaleSamples=function(e,i,r){for(var n=[2*e],o=0;o<e;++o)this.getNextColor(o,r,t.PdfColorSpace.GrayScale);return n},i.prototype.getRgbSamples=function(e,i,r){for(var n=[3*e],o=0;o<e;++o){var s=this.getNextColor(o,r,t.PdfColorSpace.Rgb),a=3*o;n[a]=s.r,n[a+1]=s.g,n[a+2]=s.b}return n},i.prototype.getCmykSamples=function(e,i,r){for(var n=[4*e],o=0;o<e;o++){var s=this.getNextColor(o,r,t.PdfColorSpace.Cmyk),a=4*o;n[a]=s.c*i,n[a+1]=s.m*i,n[a+2]=s.y*i,n[a+3]=s.k*i}return n},i.prototype.getNextColor=function(t,e,i){var r,n,o,s=e*t,a=this.getIndices(s,n,r);if((n=a.indexLow)===(r=a.indexHi))o=this.mcolors[n];else{var h=this.positions[n],l=this.positions[r],u=this.mcolors[n],c=this.mcolors[r],p=(s-h)/(l-h);o=this.interpolate(p,u,c,i)}return o},i.prototype.getIndices=function(t,e,i){var r=this.positions;e=0,i=0;for(var n=0;n<this.mcolors.length;++n){var o=r[n];if(o===t){i=n,e=n;break}if(o>t){i=n;break}e=n,i=n}return{indexLow:e,indexHi:i}},i.prototype.getMaxComponentValue=function(e){var i=0;switch(e){case t.PdfColorSpace.Cmyk:case t.PdfColorSpace.Rgb:i=255;break;case t.PdfColorSpace.GrayScale:i=65535;break;default:throw new Error("ArgumentException - Unsupported color space: "+e+"colorSpace")}return i},i.prototype.getIntervals=function(t){for(var e=t.length,i=[e-1],r=t[0],n=1;n<e;++n){var o=t[n];i[n-1]=o-r,r=o}return i},i}(bi),Pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vi=function(e){function i(t,i,r,n){var o=e.call(this,new h)||this;if(o.mDictionaryProperties=new a,t instanceof T&&i instanceof T&&r instanceof L&&n instanceof L)o.initialize(r,n),o.mPointStart=t,o.mPointEnd=i,o.setPoints(o.mPointStart,o.mPointEnd);else if(t instanceof V)if(o.initialize(i,r),n===fi.BackwardDiagonal||n===fi.ForwardDiagonal||n===fi.Horizontal||n===fi.Vertical){switch(o.mBoundaries=t,n){case fi.BackwardDiagonal:o.mPointStart=new T(t.right,t.top),o.mPointEnd=new T(t.left,t.bottom);break;case fi.ForwardDiagonal:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.bottom);break;case fi.Horizontal:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.top);break;case fi.Vertical:o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.left,t.bottom);break;default:throw new Error("ArgumentException -- Unsupported linear gradient mode: "+n+" mode")}o.setPoints(o.mPointStart,o.mPointEnd)}else if("number"==typeof n&&void 0!==n){if(o.mBoundaries=t,0===(n%=360))o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.right,t.top);else if(90===n)o.mPointStart=new T(t.left,t.top),o.mPointEnd=new T(t.left,t.bottom);else if(180===n)o.mPointEnd=new T(t.left,t.top),o.mPointStart=new T(t.right,t.top);else if(270===n)o.mPointEnd=new T(t.left,t.top),o.mPointStart=new T(t.left,t.bottom);else{var s=n*(Math.PI/180),l=Math.tan(s),u=o.mBoundaries.left+(o.mBoundaries.right-o.mBoundaries.left)/2,c=o.mBoundaries.top+(o.mBoundaries.bottom-o.mBoundaries.top)/2,p=new T(u,c);c=l*(u=o.mBoundaries.width/(2*Math.cos(s))),u+=p.x,c+=p.y;var d=new T(u,c),f=o.subPoints(d,p),g=o.choosePoint(n),m=o.mulPoints(o.subPoints(g,p),f)/o.mulPoints(f,f);o.mPointEnd=o.addPoints(p,o.mulPoint(f,m)),o.mPointStart=o.addPoints(p,o.mulPoint(f,-1*m))}o.setPoints(o.mPointEnd,o.mPointStart)}return o}return Pi(i,e),i.prototype.initialize=function(t,e){this.mColours=[t,e],this.mColourBlend=new Si(2),this.mColourBlend.positions=[0,1],this.mColourBlend.colors=this.mColours,this.initShading()},Object.defineProperty(i.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColours)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"interpolationColors",{get:function(){return this.mColourBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColours=null,this.mColourBlend=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linearColors",{get:function(){return this.mColours},set:function(t){if(null==t)throw new Error("ArgumentNullException : LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small - LinearColors");null==this.mColours&&void 0===this.mColours?this.mColours=[t[0],t[1]]:(this.mColours[0]=t[0],this.mColours[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlend=new Si(2),this.mColourBlend.colors=this.mColours,this.mColourBlend.positions=[0,1]):this.mColourBlend=this.mBlend.generateColorBlend(this.mColours,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rectangle",{get:function(){return this.mBoundaries},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"extend",{get:function(){var t=li.None,e=this.shading.items.getValue(this.mDictionaryProperties.extend);if(null!=e){var i=e.items(0),r=e.items(1);i.value&&(t|=li.Start),r.value&&(t|=li.End)}return t},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r?(e=new ct(!1),i=new ct(!1),(r=new m).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),i=r.items(1))},enumerable:!0,configurable:!0}),i.prototype.addPoints=function(t,e){var i=t.x+e.x,r=t.y+e.y;return new T(i,r)},i.prototype.subPoints=function(t,e){var i=t.x-e.x,r=t.y-e.y;return new T(i,r)},i.prototype.mulPoints=function(t,e){return t.x*e.x+t.y*e.y},i.prototype.mulPoint=function(t,e){return t.x=t.x*e,t.y=t.y*e,t},i.prototype.choosePoint=function(t){var e=new T(0,0);if(t<90&&t>0)e=new T(this.mBoundaries.right,this.mBoundaries.bottom);else if(t<180&&t>90)e=new T(this.mBoundaries.left,this.mBoundaries.bottom);else if(t<270&&t>180)e=new T(this.mBoundaries.left,this.mBoundaries.top);else{if(!(t>270))throw new Error("PdfException - Internal error.");e=new T(this.mBoundaries.right,this.mBoundaries.top)}return e},i.prototype.setPoints=function(t,e){var i=new m;i.add(new g(t.x)),i.add(new g(this.updateY(t.y))),i.add(new g(e.x)),i.add(new g(this.updateY(e.y))),this.shading.items.setValue(this.mDictionaryProperties.coords,i)},i.prototype.updateY=function(t){return 0!==t?-t:t},i.prototype.initShading=function(){this.colorSpace=t.PdfColorSpace.Rgb,this.function=this.mColourBlend.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new g(gi.Axial))},i.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new h(this.patternDictionary)),t.shading=new h,t.initShading(),t.setPoints(t.mPointStart,t.mPointEnd),null!==t&&t instanceof i&&null!=this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!=this.mColours&&void 0!==this.mColours&&(t.mColours=this.mColours),null!=this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!=this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},i.prototype.resetFunction=function(){this.function=this.mColourBlend.getFunction(this.colorSpace)},i}(qt),Ci=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bi=function(e){function i(t,i,r,n,o,s){var l=e.call(this,new h)||this;if(l.mDictionaryProperties=new a,l.initialize(o,s),i<0)throw new Error("ArgumentOutOfRangeException : radiusStart - The radius cannot be less then zero.");if(n<0)throw new Error("ArgumentOutOfRangeException : radiusEnd - The radius cannpt be less then zero.");return l.mPointEnd=r,l.mPointStart=t,l.mRadiusStart=i,l.mRadiusEnd=n,l.setPoints(l.mPointStart,l.mPointEnd,l.mRadiusStart,l.mRadiusEnd),l}return Ci(i,e),i.prototype.initialize=function(t,e){this.mColour=[t,e],this.mColourBlends=new Si(2),this.mColourBlends.positions=[0,1],this.mColourBlends.colors=this.mColour,this.initShading()},Object.defineProperty(i.prototype,"blend",{get:function(){return this.mBlend},set:function(t){if(null==t)throw new Error("ArgumentNullException : Blend");if(null==this.mColour&&void 0===this.mColour)throw new Error("NotSupportedException : There is no starting and ending colours specified.");this.mBlend=t,this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"interpolationColors",{get:function(){return this.mColourBlends},set:function(t){if(null==t)throw new Error("ArgumentNullException : InterpolationColors");this.mBlend=null,this.mColour=null,this.mColourBlends=t,this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linearColors",{get:function(){return this.mColour},set:function(t){if(null==t)throw new Error("ArgumentNullException : radial LinearColors");if(t.length<2)throw new Error("ArgumentException : The array is too small LinearColors");null==this.mColour&&void 0===this.mColour?this.mColour=[t[0],t[1]]:(this.mColour[0]=t[0],this.mColour[1]=t[1]),null==this.mBlend&&void 0===this.mBlend?(this.mColourBlends=new Si(2),this.mColourBlends.colors=this.mColour,this.mColourBlends.positions=[0,1]):this.mColourBlends=this.mBlend.generateColorBlend(this.mColour,this.colorSpace),this.resetFunction()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rectangle",{get:function(){return this.mBoundaries},set:function(t){this.mBoundaries=t,this.bBox=m.fromRectangle(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"extend",{get:function(){var t=li.None,e=this.shading.items.getValue(this.mDictionaryProperties.extend);if(null!==e&&void 0!==e){var i=e.items(0),r=e.items(1);i.value&&(t|=li.Start),r.value&&(t|=li.End)}return t},set:function(t){var e,i,r=this.shading.items.getValue(this.mDictionaryProperties.extend);null==r&&void 0===r?(e=new ct(!1),i=new ct(!1),(r=new m).add(e),r.add(i),this.shading.items.setValue(this.mDictionaryProperties.extend,r)):(e=r.items(0),i=r.items(1))},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t,e,i,r){var n=new m;n.add(new g(t.x)),n.add(new g(this.updateY(t.y))),n.add(new g(i)),n.add(new g(e.x)),n.add(new g(this.updateY(e.y))),i!==r?n.add(new g(r)):n.add(new g(0)),this.shading.items.setValue(this.mDictionaryProperties.coords,n)},i.prototype.updateY=function(t){return 0!==t?-t:t},i.prototype.initShading=function(){this.colorSpace=t.PdfColorSpace.Rgb,this.function=this.mColourBlends.getFunction(this.colorSpace),this.shading.items.setValue(this.mDictionaryProperties.shadingType,new g(gi.Radial))},i.prototype.clone=function(){var t=this;return t.resetPatternDictionary(new h(this.patternDictionary)),t.shading=new h,t.initShading(),t.setPoints(this.mPointStart,this.mPointEnd,this.mRadiusStart,this.mRadiusEnd),t instanceof i&&null!==this.matrix&&void 0!==this.matrix&&(t.matrix=this.matrix.clone()),null!==this.mColour&&void 0!==this.mColour&&(t.mColour=this.mColour),null!==this.blend&&void 0!==this.blend?t.blend=this.blend.clonePdfBlend():null!==this.interpolationColors&&void 0!==this.interpolationColors&&(t.interpolationColors=this.interpolationColors.cloneColorBlend()),t.extend=this.extend,this.cloneBackgroundValue(t),this.cloneAntiAliasingValue(t),t},i.prototype.resetFunction=function(){this.function=this.mColourBlends.getFunction(this.colorSpace)},i}(qt);!function(t){t[t.Overlap=0]="Overlap",t[t.Inside=1]="Inside"}(t.PdfBorderOverlapStyle||(t.PdfBorderOverlapStyle={}));var Oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xi=function(){function t(){}return Object.defineProperty(t.prototype,"backgroundBrush",{get:function(){return this.gridBackgroundBrush},set:function(t){this.gridBackgroundBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textBrush",{get:function(){return this.gridTextBrush},set:function(t){this.gridTextBrush=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textPen",{get:function(){return this.gridTextPen},set:function(t){this.gridTextPen=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.gridFont},set:function(t){this.gridFont=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this.gridBackgroundImage},set:function(t){this.gridBackgroundImage=t},enumerable:!0,configurable:!0}),t}(),Li=function(e){function i(){var i=e.call(this)||this;return i.gridBorderOverlapStyle=t.PdfBorderOverlapStyle.Overlap,i.bAllowHorizontalOverflow=!1,i.gridHorizontalOverflowType=t.PdfHorizontalOverflowType.LastPage,i}return Oi(i,e),Object.defineProperty(i.prototype,"cellSpacing",{get:function(){return void 0===this.gridCellSpacing&&(this.gridCellSpacing=0),this.gridCellSpacing},set:function(t){this.gridCellSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"horizontalOverflowType",{get:function(){return this.gridHorizontalOverflowType},set:function(t){this.gridHorizontalOverflowType=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowHorizontalOverflow",{get:function(){return this.bAllowHorizontalOverflow},set:function(t){this.bAllowHorizontalOverflow=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"cellPadding",{get:function(){return void 0===this.gridCellPadding&&(this.gridCellPadding=new Ee),this.gridCellPadding},set:function(t){void 0===this.gridCellPadding?(this.gridCellPadding=new Ee,this.gridCellPadding=t):this.gridCellPadding=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"borderOverlapStyle",{get:function(){return this.gridBorderOverlapStyle},set:function(t){this.gridBorderOverlapStyle=t},enumerable:!0,configurable:!0}),i}(xi),Ti=function(t){function e(){var e=t.call(this)||this;return e.gridCellBorders=Fe.default,e}return Oi(e,t),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"borders",{get:function(){return this.gridCellBorders},set:function(t){this.gridCellBorders=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellPadding",{get:function(){return this.gridCellPadding},set:function(t){null!=this.gridCellPadding&&void 0!==this.gridCellPadding||(this.gridCellPadding=new Ee),this.gridCellPadding=t},enumerable:!0,configurable:!0}),e}(xi),ji=function(){function t(){}return Object.defineProperty(t.prototype,"backgroundBrush",{get:function(){return this.gridRowBackgroundBrush},enumerable:!0,configurable:!0}),t.prototype.setBackgroundBrush=function(t){if(this.gridRowBackgroundBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.backgroundBrush=t},Object.defineProperty(t.prototype,"textBrush",{get:function(){return this.gridRowTextBrush},enumerable:!0,configurable:!0}),t.prototype.setTextBrush=function(t){if(this.gridRowTextBrush=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textBrush=t},Object.defineProperty(t.prototype,"textPen",{get:function(){return this.gridRowTextPen},enumerable:!0,configurable:!0}),t.prototype.setTextPen=function(t){if(this.gridRowTextPen=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.textPen=t},Object.defineProperty(t.prototype,"font",{get:function(){return this.gridRowFont},enumerable:!0,configurable:!0}),t.prototype.setFont=function(t){if(this.gridRowFont=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.font=t},Object.defineProperty(t.prototype,"border",{get:function(){return void 0===this.gridRowBorder&&this.setBorder(new Fe),this.gridRowBorder},enumerable:!0,configurable:!0}),t.prototype.setBorder=function(t){if(this.gridRowBorder=t,void 0!==this.parent)for(var e=0;e<this.parent.cells.count;e++)this.parent.cells.getCell(e).style.borders=t},t.prototype.setParent=function(t){this.parent=t},Object.defineProperty(t.prototype,"backgroundImage",{get:function(){return this.gridRowBackgroundImage},enumerable:!0,configurable:!0}),t}();!function(t){t[t.NextPage=0]="NextPage",t[t.LastPage=1]="LastPage"}(t.PdfHorizontalOverflowType||(t.PdfHorizontalOverflowType={}));var ki=function(){function e(t){this.cellWidth=0,this.cellHeight=0,this.tempval=0,this.fontSpilt=!1,this.finsh=!0,this.rowSpanRemainingHeight=0,this.hasRowSpan=!1,this.hasColSpan=!1,this.isFinish=!0,this.present=!1,this.gridRowSpan=1,this.colSpan=1,void 0!==t&&(this.gridRow=t)}return Object.defineProperty(e.prototype,"isCellMergeContinue",{get:function(){return this.internalIsCellMergeContinue},set:function(t){this.internalIsCellMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRowMergeContinue",{get:function(){return this.internalIsRowMergeContinue},set:function(t){this.internalIsRowMergeContinue=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCellMergeStart",{get:function(){return this.internalIsCellMergeStart},set:function(t){this.internalIsCellMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRowMergeStart",{get:function(){return this.internalIsRowMergeStart},set:function(t){this.internalIsRowMergeStart=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"remainingString",{get:function(){return this.remaining},set:function(t){this.remaining=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"FinishedDrawingCell",{get:function(){return this.isFinish},set:function(t){this.isFinish=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stringFormat",{get:function(){return null==this.format&&(this.format=new D),this.format},set:function(t){this.format=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"row",{get:function(){return this.gridRow},set:function(t){this.gridRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.objectValue},set:function(t){if(this.objectValue=t,this.objectValue instanceof Fi){this.row.grid.isSingleGrid=!1,this.objectValue.ParentCell=this,this.objectValue.isChildGrid=!0;for(var e=this.row.grid.rows.count,i=0;i<e;i++)for(var r=this.row.grid.rows.getRow(i),n=r.cells.count,o=0;o<n;o++)r.cells.getCell(o).parent=this}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpan",{get:function(){return this.gridRowSpan},set:function(t){if(t<1)throw new Error("ArgumentException : Invalid span specified, must be greater than or equal to 1");this.gridRowSpan=t,this.row.rowSpanExists=!0,this.row.grid.hasRowSpanSpan=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return null==this.cellStyle&&(this.cellStyle=new Ti),this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(t){this.cellHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpan",{get:function(){return this.colSpan},set:function(t){if(t<1)throw Error("Invalid span specified, must be greater than or equal to 1");this.colSpan=t,this.row.columnSpanExists=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return(0===this.cellWidth||this.row.grid.isComplete)&&(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(t){this.cellWidth=t},enumerable:!0,configurable:!0}),e.prototype.measureWidth=function(){var t=0,e=new I;if("string"==typeof this.objectValue)t+=e.layout(this.objectValue,this.getTextFont(),this.stringFormat,new j(Number.MAX_VALUE,Number.MAX_VALUE),!1,new j(0,0)).actualSize.width,t+=2*(this.style.borders.left.width+this.style.borders.right.width);else if(this.objectValue instanceof Fi)t=this.objectValue.size.width;else if(this.objectValue instanceof ft||this.objectValue instanceof mt)t+=this.objectValue.width;else if(this.objectValue instanceof Je){var i=this.objectValue;t+=e.layout(i.text,i.font,i.stringFormat,new j(0,0),!1,new j(0,0)).actualSize.width,t+=2*(this.style.borders.left.width+this.style.borders.right.width)}return this.objectValue instanceof Fi?null!=this.style.cellPadding||void 0!==this.style.cellPadding?(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(t+=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(t+=this.style.cellPadding.right)):(void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(t+=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(t+=this.row.grid.style.cellPadding.right)):null!=this.style.cellPadding?t+=this.style.cellPadding.left+this.style.cellPadding.right:t+=this.row.grid.style.cellPadding.left+this.row.grid.style.cellPadding.right,t+=this.row.grid.style.cellSpacing},e.prototype.drawCellBackground=function(t,e){var i=this.getBackgroundBrush();if(null!=i&&(t.save(),t.drawRectangle(i,e.x,e.y,e.width,e.height),t.restore()),null!=this.style.backgroundImage){this.getBackgroundImage();t.drawImage(this.style.backgroundImage,e.x,e.y,e.width,e.height)}},e.prototype.adjustContentLayoutArea=function(t){var e=new k(t.x,t.y,t.width,t.height);return this.objectValue instanceof Fi?(null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.gridRow.grid.style.cellPadding.left&&this.gridRow.grid.style.cellPadding.hasLeftPad&&(e.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,e.width-=this.gridRow.grid.style.cellPadding.left),void 0!==this.gridRow.grid.style.cellPadding.top&&this.gridRow.grid.style.cellPadding.hasTopPad&&(e.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,e.height-=this.gridRow.grid.style.cellPadding.top),void 0!==this.gridRow.grid.style.cellPadding.right&&this.gridRow.grid.style.cellPadding.hasRightPad&&(e.width-=this.gridRow.grid.style.cellPadding.right),void 0!==this.gridRow.grid.style.cellPadding.bottom&&this.gridRow.grid.style.cellPadding.hasBottomPad&&(e.height-=this.gridRow.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(e.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,e.width-=this.style.cellPadding.left),void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(e.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,e.height-=this.style.cellPadding.top),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(e.width-=this.style.cellPadding.right),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(e.height-=this.style.cellPadding.bottom)),e.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):void 0===this.style.cellPadding||null==this.style.cellPadding?(e.x+=this.gridRow.grid.style.cellPadding.left+this.cellStyle.borders.left.width,e.y+=this.gridRow.grid.style.cellPadding.top+this.cellStyle.borders.top.width,e.width-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left,e.height-=this.gridRow.grid.style.cellPadding.bottom+this.gridRow.grid.style.cellPadding.top,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width):(e.x+=this.style.cellPadding.left+this.cellStyle.borders.left.width,e.y+=this.style.cellPadding.top+this.cellStyle.borders.top.width,e.width-=this.style.cellPadding.right+this.style.cellPadding.left,e.width-=this.cellStyle.borders.left.width+this.cellStyle.borders.right.width,e.height-=this.style.cellPadding.bottom+this.style.cellPadding.top,e.height-=this.cellStyle.borders.top.width+this.cellStyle.borders.bottom.width,1===this.rowSpan&&(e.width-=this.style.borders.left.width)),e},e.prototype.draw=function(e,i,r){var n=null;if(this.internalIsCellMergeContinue||this.internalIsRowMergeContinue){if(!this.internalIsCellMergeContinue||!this.row.grid.style.allowHorizontalOverflow)return n;if(this.row.rowOverflowIndex>0&&this.row.cells.indexOf(this)!=this.row.rowOverflowIndex+1||0==this.row.rowOverflowIndex&&this.internalIsCellMergeContinue)return n}i=this.adjustOuterLayoutArea(i,e),this.drawCellBackground(e,i);var o=this.getTextPen(),s=this.getTextBrush();void 0===o&&void 0===s&&(s=new A(new L(0,0,0)));var a=this.getTextFont(),h=this.getStringFormat(),l=i;if(l.height>=e.clientSize.height&&this.row.grid.allowRowBreakAcrossPages&&(l.height-=l.y),l=this.adjustContentLayoutArea(l),"string"==typeof this.objectValue||"string"==typeof this.remaining){var u=void 0,c=void 0;if(c=l.height<a.height?new k(l.x,l.y,l.width,a.height):l,l.height<a.height&&this.row.grid.isChildGrid&&null!=this.row.grid.ParentCell){var p=c.height-this.row.grid.ParentCell.row.grid.style.cellPadding.bottom-this.row.grid.style.cellPadding.bottom;-1!=this.row.grid.splitChildRowIndex&&(this.fontSpilt=!0,this.row.rowFontSplit=!0),p>0&&p<a.height&&(c.height=p)}0!=this.gridRow.grid.style.cellSpacing&&(c.width-=this.gridRow.grid.style.cellSpacing,i.width-=this.gridRow.grid.style.cellSpacing),this.isFinish?(u=""===this.remaining?this.remaining:this.objectValue,e.drawString(u,a,o,s,c.x,c.y,c.width,c.height,h),-1==this.row.grid.splitChildRowIndex||this.row.grid.isChildGrid||void 0!==this.remaining||(this.remaining="")):(void 0!==this.remaining&&null!==this.remaining||(this.remaining=""),this.row.repeatFlag&&e.drawString(this.remaining,a,o,s,c.x,c.y,c.width,c.height,h),this.isFinish=!0),n=e.stringLayoutResult}else if(this.objectValue instanceof Fi){var d=this.objectValue;d.isChildGrid=!0,d.ParentCell=this;var f=void 0;f=l,0!=this.gridRow.grid.style.cellSpacing&&(i.width-=this.gridRow.grid.style.cellSpacing);var g=new Gi(d),m=new Wi;null!=this.row.grid.LayoutFormat?m=this.row.grid.LayoutFormat:m.layout=t.PdfLayoutType.Paginate;var y=new Me;if(null!=e.layer){y.page=e.page,y.bounds=f,y.format=m,d.setSpan(),d.checkSpan();var b=g.Layouter(y);this.value=d,-1!==this.row.grid.splitChildRowIndex&&(this.height=this.row.rowBreakHeightValue),y.page!=b.page&&(b.bounds.height=this.row.rowBreakHeightValue,0==this.row.rowBreakHeight?this.row.NestedGridLayoutResult=b:this.row.rowBreakHeight=this.row.rowBreakHeightValue)}}else if(this.objectValue instanceof ft||this.objectValue instanceof mt){var w=void 0;w=this.objectValue.width<=l.width?new k(l.x,l.y,this.objectValue.width,l.height):l,e.drawImage(this.objectValue,w.x,w.y,w.width,w.height)}else this.objectValue instanceof Je?this.objectValue.draw(e.currentPage,l):void 0===this.objectValue&&(this.objectValue="",e.drawString(this.objectValue,a,o,s,l.x,l.y,l.width,l.height,h),null!=this.style.cellPadding&&0==this.style.cellPadding.bottom&&0==this.style.cellPadding.left&&0==this.style.cellPadding.right&&0==this.style.cellPadding.top&&(i.width-=this.style.borders.left.width+this.style.borders.right.width),0!=this.gridRow.grid.style.cellSpacing&&(i.width-=this.gridRow.grid.style.cellSpacing));return null!=this.style.borders&&(this.fontSpilt?-1!=this.row.grid.ParentCell.row.grid.splitChildRowIndex&&(this.row.rowFontSplit=!1,this.drawCellBorders(e,i)):this.drawCellBorders(e,i)),n},e.prototype.drawCellBorders=function(e,i){this.row.grid.style.borderOverlapStyle===t.PdfBorderOverlapStyle.Inside&&(i.x+=this.style.borders.left.width,i.y+=this.style.borders.top.width,i.width-=this.style.borders.right.width,i.height-=this.style.borders.bottom.width);var r=new T(i.x,i.y+i.height),n=new T(i.x,i.y),o=this.cellStyle.borders.left;this.cellStyle.borders.left.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x+i.width,i.y),n=new T(i.x+i.width,i.y+i.height),o=this.cellStyle.borders.right,i.x+i.width>e.clientSize.width-o.width/2&&(r=new T(e.clientSize.width-o.width/2,i.y),n=new T(e.clientSize.width-o.width/2,i.y+i.height)),this.cellStyle.borders.right.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x,i.y),n=new T(i.x+i.width,i.y),o=this.cellStyle.borders.top,this.cellStyle.borders.top.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n),r=new T(i.x+i.width,i.y+i.height),n=new T(i.x,i.y+i.height),o=this.cellStyle.borders.bottom,i.y+i.height>e.clientSize.height-o.width/2&&(r=new T(i.x+i.width,e.clientSize.height-o.width/2),n=new T(i.x,e.clientSize.height-o.width/2)),this.cellStyle.borders.bottom.dashStyle===t.PdfDashStyle.Solid&&(o.lineCap=t.PdfLineCap.Square),0!==o.width&&e.drawLine(o,r,n)},e.prototype.adjustOuterLayoutArea=function(t,e){var i=!1,r=this.row.grid.style.cellSpacing;r>0&&(t=new k(t.x+r,t.y+r,t.width-r,t.height-r));var n=this.row.cells.indexOf(this);if(this.columnSpan>1||this.row.rowOverflowIndex>0&&n==this.row.rowOverflowIndex+1&&this.isCellMergeContinue){if(1==(l=this.columnSpan)&&this.isCellMergeContinue)for(var o=n+1;o<this.row.grid.columns.count&&this.row.cells.getCell(o).isCellMergeContinue;o++)l++;for(var s=0,a=n;a<n+l;a++){if(this.row.grid.style.allowHorizontalOverflow){var h=this.row.grid.size.width<e.clientSize.width?this.row.grid.size.width:e.clientSize.width;if((this.row.grid.size.width>e.clientSize.width?t.x+s+this.row.grid.columns.getColumn(a).width:s+this.row.grid.columns.getColumn(a).width)>h)break}s+=this.row.grid.columns.getColumn(a).width}s-=this.row.grid.style.cellSpacing,t.width=s}if(this.rowSpan>1||this.row.rowSpanExists){var l=this.rowSpan,u=this.row.grid.rows.rowCollection.indexOf(this.row);-1==u&&-1!=(u=this.row.grid.headers.indexOf(this.row))&&(i=!0);for(var c=0,a=u;a<u+l;a++){c+=i?this.row.grid.headers.getHeader(a).height:this.row.grid.rows.getRow(a).height;var p=this.row.grid.rows.getRow(a);this.row.grid.rows.rowCollection.indexOf(p)}this.row.cells.indexOf(this);c-=this.row.grid.style.cellSpacing,t.height=c,this.row.rowMergeComplete||(t.height=c)}return t},e.prototype.getTextFont=function(){return void 0!==this.style.font&&null!=this.style.font?this.style.font:void 0!==this.row.style.font&&null!=this.row.style.font?this.row.style.font:void 0!==this.row.grid.style.font&&null!=this.row.grid.style.font?this.row.grid.style.font:Ce.defaultFont},e.prototype.getTextBrush=function(){return void 0!==this.style.textBrush&&null!=this.style.textBrush?this.style.textBrush:void 0!==this.row.style.textBrush&&null!=this.row.style.textBrush?this.row.style.textBrush:this.row.grid.style.textBrush},e.prototype.getTextPen=function(){return void 0!==this.style.textPen&&null!=this.style.textPen?this.style.textPen:void 0!==this.row.style.textPen&&null!=this.row.style.textPen?this.row.style.textPen:this.row.grid.style.textPen},e.prototype.getBackgroundBrush=function(){return void 0!==this.style.backgroundBrush&&null!=this.style.backgroundBrush?this.style.backgroundBrush:void 0!==this.row.style.backgroundBrush&&null!=this.row.style.backgroundBrush?this.row.style.backgroundBrush:this.row.grid.style.backgroundBrush},e.prototype.getBackgroundImage=function(){return void 0!==this.style.backgroundImage&&null!=this.style.backgroundImage?this.style.backgroundImage:void 0!==this.row.style.backgroundImage&&null!=this.row.style.backgroundImage?this.row.style.backgroundImage:this.row.grid.style.backgroundImage},e.prototype.getStringFormat=function(){return void 0!==this.style.stringFormat&&null!=this.style.stringFormat?this.style.stringFormat:this.stringFormat},e.prototype.measureHeight=function(){var t=this.calculateWidth();null==this.style.cellPadding||void 0===this.style.cellPadding?t-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(t-=this.style.cellPadding.right+this.style.cellPadding.left,t-=this.style.borders.left.width+this.style.borders.right.width);var e=0,i=new I;if("string"==typeof this.objectValue||"string"==typeof this.remaining){var r=this.objectValue;this.isFinish||(r=null!==this.remaining&&""!==this.remaining&&void 0!==this.remaining?this.remaining:this.objectValue);n=this.row.cells.indexOf(this);0!=this.gridRow.grid.style.cellSpacing&&(t-=2*this.gridRow.grid.style.cellSpacing),this.row.cells.getCell(n).hasColSpan||this.row.cells.getCell(n).hasRowSpan||(this.gridRow.grid.isChildGrid?(t<0?(this.tempval=t,null==this.style.cellPadding||void 0===this.style.cellPadding?this.tempval+=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(this.tempval+=this.style.cellPadding.right+this.style.cellPadding.left,this.tempval+=this.style.borders.left.width+this.style.borders.right.width)):this.tempval=t,e+=i.layout(r,this.getTextFont(),this.stringFormat,new j(this.tempval,0),!1,new j(0,0)).actualSize.height):e+=i.layout(r,this.getTextFont(),this.stringFormat,new j(t,0),!1,new j(0,0)).actualSize.height),e+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}else if(this.objectValue instanceof Fi){var n=this.row.cells.indexOf(this),o=0;null!=this.style.cellPadding||void 0!==this.style.cellPadding?(o=this.calculateWidth(),void 0!==this.style.cellPadding.left&&this.style.cellPadding.hasLeftPad&&(o-=this.style.cellPadding.left),void 0!==this.style.cellPadding.right&&this.style.cellPadding.hasRightPad&&(o-=this.style.cellPadding.right)):null!=this.row.grid.style.cellPadding||void 0!==this.row.grid.style.cellPadding?(o=this.calculateWidth(),void 0!==this.row.grid.style.cellPadding.left&&this.row.grid.style.cellPadding.hasLeftPad&&(o-=this.row.grid.style.cellPadding.left),void 0!==this.row.grid.style.cellPadding.right&&this.row.grid.style.cellPadding.hasRightPad&&(o-=this.row.grid.style.cellPadding.right)):o=this.calculateWidth(),this.objectValue.tempWidth=o,this.row.cells.getCell(n).hasColSpan||this.row.cells.getCell(n).hasRowSpan?e+=2*(this.style.borders.top.width+this.style.borders.bottom.width):e=this.objectValue.size.height,0!==this.gridRow.grid.style.cellSpacing&&(t-=2*this.gridRow.grid.style.cellSpacing),null==this.style.cellPadding&&void 0===this.style.cellPadding||(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(e+=this.row.grid.style.cellPadding.top),this.row.grid.style.cellPadding.hasBottomPad&&void 0!==this.row.grid.style.cellPadding.bottom&&(e+=this.row.grid.style.cellPadding.bottom)),e+=this.objectValue.style.cellSpacing}else if(this.objectValue instanceof ft||this.objectValue instanceof mt)e+=this.objectValue.height;else if(this.objectValue instanceof Je){var s=this.objectValue;e+=i.layout(s.text,s.font,s.stringFormat,new j(t,0),!1,new j(0,0)).actualSize.height,e+=2*(this.style.borders.top.width+this.style.borders.bottom.width)}else void 0===this.objectValue&&(null==this.style.cellPadding||void 0===this.style.cellPadding?t-=this.gridRow.grid.style.cellPadding.right+this.gridRow.grid.style.cellPadding.left:(t-=this.style.cellPadding.right+this.style.cellPadding.left,t-=this.style.borders.left.width+this.style.borders.right.width),e+=2*(this.style.borders.top.width+this.style.borders.bottom.width));return this.objectValue instanceof Fi?null==this.style.cellPadding||void 0===this.style.cellPadding?(void 0!==this.row.grid.style.cellPadding.top&&this.row.grid.style.cellPadding.hasTopPad&&(e+=this.row.grid.style.cellPadding.top),void 0!==this.row.grid.style.cellPadding.bottom&&this.row.grid.style.cellPadding.hasBottomPad&&(e+=this.row.grid.style.cellPadding.bottom)):(void 0!==this.style.cellPadding.top&&this.style.cellPadding.hasTopPad&&(e+=this.style.cellPadding.top),void 0!==this.style.cellPadding.bottom&&this.style.cellPadding.hasBottomPad&&(e+=this.style.cellPadding.bottom)):null==this.style.cellPadding||void 0===this.style.cellPadding?e+=this.row.grid.style.cellPadding.top+this.row.grid.style.cellPadding.bottom:e+=this.style.cellPadding.top+this.style.cellPadding.bottom,e+=this.row.grid.style.cellSpacing},e.prototype.calculateWidth=function(){var t=this.row.cells.indexOf(this),e=(this.row.grid.rows.rowCollection.indexOf(this.row),this.columnSpan),i=0;if(1===e)for(r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width;else if(e>1)for(var r=0;r<e;r++)i+=this.row.grid.columns.getColumn(t+r).width,r+1<e&&(this.row.cells.getCell(t+r+1).hasColSpan=!0);if(null!=this.parent&&this.parent.row.width>0&&this.row.grid.isChildGrid&&null!=this.parent&&this.row.width>this.parent.row.width){i=0;for(var n=0;n<this.parent.columnSpan;n++)i+=this.parent.row.grid.columns.getColumn(n).width;i/=this.row.cells.count}return i},e}(),Vi=function(){function t(t){this.cells=[],this.gridRow=t}return t.prototype.getCell=function(t){if(t<0||t>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if(void 0===t){var e=new ki;return this.add(e),t}t.row=this.gridRow,this.cells.push(t)},t.prototype.indexOf=function(t){return this.cells.indexOf(t)},t}(),Ri=function(){function t(t){this.columnWidth=0,this.grid=t}return Object.defineProperty(t.prototype,"width",{get:function(){return this.columnWidth},set:function(t){this.isCustomWidth=!0,this.columnWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return null==this.stringFormat&&(this.stringFormat=new D),this.stringFormat},set:function(t){this.stringFormat=t},enumerable:!0,configurable:!0}),t}(),Ni=function(){function t(t){this.internalColumns=[],this.columnWidth=0,this.grid=t,this.internalColumns=[]}return t.prototype.add=function(t){for(var e=0;e<t;e++){this.internalColumns.push(new Ri(this.grid));for(var i=0;i<this.grid.rows.count;i++){var r=this.grid.rows.getRow(i),n=new ki;n.value="",r.cells.add(n)}}},Object.defineProperty(t.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),0===this.grid.initialWidth||this.columnWidth===this.grid.initialWidth||this.grid.style.allowHorizontalOverflow||(this.columnWidth=this.grid.initialWidth,this.grid.isPageWidth=!0),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),t.prototype.getColumn=function(t){if(t>=0&&t<=this.columns.length)return this.columns[t];throw Error("can not get the column from the index: "+t)},t.prototype.measureColumnsWidth=function(){var t=0;this.grid.measureColumnsWidth();for(var e=0,i=this.internalColumns.length;e<i;e++)t+=this.internalColumns[e].width;return t},t.prototype.getDefaultWidths=function(t){for(var e=[],i=this.count,r=0;r<this.count;r++)this.grid.isPageWidth&&t>=0&&!this.internalColumns[r].isCustomWidth?this.internalColumns[r].width=0:(e[r]=this.internalColumns[r].width,this.internalColumns[r].width>0&&this.internalColumns[r].isCustomWidth?(t-=this.internalColumns[r].width,i--):e[r]=0);for(r=0;r<this.count;r++){var n=t/i;e[r]<=0&&(e[r]=n)}return e},t}(),Ai=function(){function t(t){this.gridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this.isrowFinish=!1,this.isRowSpanRowHeightSet=!1,this.noOfPageCount=0,this.isRowHeightSet=!1,this.isPageBreakRowSpanApplied=!1,this.isRowMergeComplete=!0,this.repeatFlag=!1,this.rowFontSplit=!1,this.pdfGrid=t}return Object.defineProperty(t.prototype,"rowSpanExists",{get:function(){return this.bRowSpanExists},set:function(t){this.bRowSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cells",{get:function(){return null==this.gridCells&&(this.gridCells=new Vi(this)),this.gridCells},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"grid",{get:function(){return this.pdfGrid},set:function(t){this.pdfGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return void 0===this.rowStyle&&(this.rowStyle=new ji,this.rowStyle.setParent(this)),this.rowStyle},set:function(t){this.rowStyle=t;for(var e=0;e<this.cells.count;e++)this.cells.getCell(e).style.borders=t.border,void 0!==t.font&&(this.cells.getCell(e).style.font=t.font),void 0!==t.backgroundBrush&&(this.cells.getCell(e).style.backgroundBrush=t.backgroundBrush),void 0!==t.backgroundImage&&(this.cells.getCell(e).style.backgroundImage=t.backgroundImage),void 0!==t.textBrush&&(this.cells.getCell(e).style.textBrush=t.textBrush),void 0!==t.textPen&&(this.cells.getCell(e).style.textPen=t.textPen)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowBreakHeight",{get:function(){return void 0===this.gridRowBreakHeight&&(this.gridRowBreakHeight=0),this.gridRowBreakHeight},set:function(t){this.gridRowBreakHeight=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowOverflowIndex",{get:function(){return this.gridRowOverflowIndex},set:function(t){this.gridRowOverflowIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.isRowHeightSet||(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(t){this.rowHeight=t,this.isRowHeightSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 0!==this.rowWidth&&void 0!==this.rowWidth||(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NestedGridLayoutResult",{get:function(){return this.gridResult},set:function(t){this.gridResult=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnSpanExists",{get:function(){return this.bColumnSpanExists},set:function(t){this.bColumnSpanExists=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowMergeComplete",{get:function(){return this.isRowMergeComplete},set:function(t){this.isRowMergeComplete=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowIndex",{get:function(){return this.grid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),t.prototype.measureHeight=function(){var t,e=0,i=0;t=this.cells.getCell(0).rowSpan>1?0:this.cells.getCell(0).height;for(var r=0;r<this.cells.count;r++){var n=this.cells.getCell(r);if(n.rowSpanRemainingHeight>e&&(e=n.rowSpanRemainingHeight),this.rowMergeComplete=!1,n.rowSpan>1){for(var o=r,s=this.grid.rows.rowCollection.indexOf(this),a=0;a<n.rowSpan;a++)a+1<n.rowSpan&&(this.grid.rows.getRow(s+a+1).cells.getCell(o).hasRowSpan=!0);i<n.height&&(i=n.height)}else t=Math.max(t,n.height)}return i>t&&(t=i),0===t?t=i:e>0&&(t+=e),t},t.prototype.measureWidth=function(){for(var t=0,e=0;e<this.grid.columns.count;e++)t+=this.grid.columns.getColumn(e).width;return t},t}(),Di=function(){function t(t){this.rows=[],this.grid=t}return Object.defineProperty(t.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),t.prototype.addRow=function(t){if(void 0===t){var e=new Ai(this.grid);return this.addRow(e),e}if(t.style.setBackgroundBrush(this.grid.style.backgroundBrush),t.style.setFont(this.grid.style.font),t.style.setTextBrush(this.grid.style.textBrush),t.style.setTextPen(this.grid.style.textPen),0===t.cells.count)for(var i=0;i<this.grid.columns.count;i++)t.cells.add(new ki);this.rows.push(t)},t.prototype.getRow=function(t){return this.rows[t]},t}(),Mi=function(){function t(t){this.rows=[],this.grid=t,this.rows=[]}return t.prototype.getHeader=function(t){return this.rows[t]},Object.defineProperty(t.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),t.prototype.add=function(t){if("number"==typeof t){for(var e=void 0,i=0;i<t;i++){e=new Ai(this.grid);for(var r=0;r<this.grid.columns.count;r++)e.cells.add(new ki);this.rows.push(e)}return this.rows}this.rows.push(t)},t.prototype.indexOf=function(t){return this.rows.indexOf(t)},t}(),Ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fi=function(t){function e(){var e=t.call(this)||this;return e.gridSize=new j(0,0),e.isGridSplit=!1,e.isRearranged=!1,e.pageBounds=new k,e.listOfNavigatePages=[],e.parentCellIndex=0,e.tempWidth=0,e.breakRow=!0,e.splitChildRowIndex=-1,e.hasRowSpanSpan=!1,e.hasColumnSpan=!1,e.isSingleGrid=!0,e}return Ii(e,t),Object.defineProperty(e.prototype,"raiseBeginCellDraw",{get:function(){return void 0!==this.beginCellDraw&&null!==typeof this.beginCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"raiseEndCellDraw",{get:function(){return void 0!==this.endCellDraw&&null!==typeof this.endCellDraw},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"repeatHeader",{get:function(){return null!=this.bRepeatHeader&&void 0!==this.bRepeatHeader||(this.bRepeatHeader=!1),this.bRepeatHeader},set:function(t){this.bRepeatHeader=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowRowBreakAcrossPages",{get:function(){return this.breakRow},set:function(t){this.breakRow=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return null!=this.gridColumns&&void 0!==this.gridColumns||(this.gridColumns=new Ni(this)),this.gridColumns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return null==this.gridRows&&(this.gridRows=new Di(this)),this.gridRows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return null!=this.gridHeaders&&void 0!==this.gridHeaders||(this.gridHeaders=new Mi(this)),this.gridHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialWidth",{get:function(){return this.gridInitialWidth},set:function(t){this.gridInitialWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return null==this.gridStyle&&(this.gridStyle=new Li),this.gridStyle},set:function(t){null==this.gridStyle&&(this.gridStyle=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPageWidth",{get:function(){return this.ispageWidth},set:function(t){this.ispageWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isChildGrid",{get:function(){return this.ischildGrid},set:function(t){this.ischildGrid=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return 0!==this.gridSize.width&&void 0!==this.gridSize.width||0!==this.gridSize.height||(this.gridSize=this.measure()),this.gridSize},set:function(t){this.gridSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ParentCell",{get:function(){return this.parentCell},set:function(t){this.parentCell=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"LayoutFormat",{get:function(){return this.layoutFormat},enumerable:!0,configurable:!0}),e.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if(e instanceof T&&void 0===e.width&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&"number"==typeof i&&(r instanceof De||null==r)){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return e instanceof k&&void 0!==e.width&&"boolean"==typeof i?this.drawHelper(t,e,null):this.drawHelper(t,e,i)},e.prototype.measure=function(){for(var t=0,e=this.columns.width,i=0;i<this.headers.count;i++)t+=(r=this.headers.getHeader(i)).height;for(i=0;i<this.rows.count;i++){var r=this.rows.getRow(i);t+=r.height}return new j(e,t)},e.prototype.onBeginCellDraw=function(t){this.raiseBeginCellDraw&&this.beginCellDraw(this,t)},e.prototype.onEndCellDraw=function(t){this.raiseEndCellDraw&&this.endCellDraw(this,t)},e.prototype.layout=function(t){if(0!==this.rows.count){var e=this.rows.getRow(0).cells.getCell(0).style;if(null!=e.borders&&(null!=e.borders.left&&1!==e.borders.left.width||null!=e.borders.top&&1!==e.borders.top.width)){var i=e.borders.left.width/2,r=e.borders.top.width/2;if(t.bounds.x===Fe.default.right.width/2&&t.bounds.y===Fe.default.right.width/2){var n=new k(i,r,this.gridSize.width,this.gridSize.height);t.bounds=n}}}return this.setSpan(),this.checkSpan(),this.layoutFormat=t.format,this.gridLocation=t.bounds,new Gi(this).Layouter(t)},e.prototype.setSpan=function(){for(var t=1,e=1,i=0,r=0,n=0,o=this.headers.count,s=0;s<o;s++){var a=this.headers.getHeader(s);n=0;for(var h=a.cells.count,l=0;l<h;l++){var u=a.cells.getCell(l);if(n=Math.max(n,u.rowSpan),!u.isCellMergeContinue&&!u.isRowMergeContinue&&(u.columnSpan>1||u.rowSpan>1)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.headers.count)throw new Error("Invalid span specified at Header "+l.toString()+" column "+s.toString());if(u.columnSpan>1&&u.rowSpan>1){for(t=u.columnSpan,e=u.rowSpan,i=l,r=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;t>1;)i++,a.cells.getCell(i).isCellMergeContinue=!0,a.cells.getCell(i).isRowMergeContinue=!0,a.cells.getCell(i).rowSpan=e,t--;for(i=l,t=u.columnSpan;e>1;){for(r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,e--;t>1;)i++,this.headers.getHeader(r).cells.getCell(i).isCellMergeContinue=!0,this.headers.getHeader(r).cells.getCell(i).isRowMergeContinue=!0,t--;t=u.columnSpan,i=l}}else if(u.columnSpan>1&&1===u.rowSpan)for(t=u.columnSpan,i=l,u.isCellMergeStart=!0;t>1;)i++,a.cells.getCell(i).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&u.rowSpan>1)for(e=u.rowSpan,r=s;e>1;)r++,this.headers.getHeader(r).cells.getCell(l).isRowMergeContinue=!0,e--}}a.maximumRowSpan=n}},e.prototype.checkSpan=function(){var t,e,i=1,r=0,n=0;if(t=i=1,e=n=0,this.hasRowSpanSpan||this.hasColumnSpan)for(var o=this.rows.count,s=0;s<o;s++){var a=this.rows.getRow(s);r=0;for(var h=a.cells.count,l=0;l<h;l++){var u=a.cells.getCell(l);if(r=Math.max(r,u.rowSpan),!u.isCellMergeContinue&&!u.isRowMergeContinue&&(u.columnSpan>1||u.rowSpan>1)){if(u.columnSpan+l>a.cells.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.rowSpan+s>this.rows.count)throw new Error("Invalid span specified at row "+l.toString()+" column "+s.toString());if(u.columnSpan>1&&u.rowSpan>1){for(t=u.columnSpan,i=u.rowSpan,e=l,n=s,u.isCellMergeStart=!0,u.isRowMergeStart=!0;t>1;)e++,a.cells.getCell(e).isCellMergeContinue=!0,a.cells.getCell(e).isRowMergeContinue=!0,t--;for(e=l,t=u.columnSpan;i>1;){for(n++,this.rows.getRow(n).cells.getCell(l).isRowMergeContinue=!0,this.rows.getRow(n).cells.getCell(e).isRowMergeContinue=!0,i--;t>1;)e++,this.rows.getRow(n).cells.getCell(e).isCellMergeContinue=!0,this.rows.getRow(n).cells.getCell(e).isRowMergeContinue=!0,t--;t=u.columnSpan,e=l}}else if(u.columnSpan>1&&1===u.rowSpan)for(t=u.columnSpan,e=l,u.isCellMergeStart=!0;t>1;)e++,a.cells.getCell(e).isCellMergeContinue=!0,t--;else if(1===u.columnSpan&&u.rowSpan>1)for(i=u.rowSpan,n=s;i>1;)n++,this.rows.getRow(n).cells.getCell(l).isRowMergeContinue=!0,i--}}a.maximumRowSpan=r}},e.prototype.measureColumnsWidth=function(t){if(void 0!==t){this.isPageWidth=!1;for(var e=this.columns.getDefaultWidths(t.width-t.x),i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).columnWidth=e[i],this.tempWidth=e[i];if(null!=this.ParentCell&&0==this.style.allowHorizontalOverflow&&0==this.ParentCell.row.grid.style.allowHorizontalOverflow){var n=0,o=0,s=this.columns.count,a=0;null==this.ParentCell.style.cellPadding&&void 0===this.ParentCell.style.cellPadding||(void 0!==this.ParentCell.style.cellPadding.left&&this.ParentCell.style.cellPadding.hasLeftPad&&(n+=this.ParentCell.style.cellPadding.left),void 0!==this.ParentCell.style.cellPadding.right&&this.ParentCell.style.cellPadding.hasRightPad&&(n+=this.ParentCell.style.cellPadding.right));for(i=0;i<this.ParentCell.columnSpan;i++)o+=this.ParentCell.row.grid.columns.getColumn(this.parentCellIndex+i).width;for(d=0;d<this.columns.count;d++)this.gridColumns.getColumn(d).width>0&&this.gridColumns.getColumn(d).isCustomWidth&&(o-=this.gridColumns.getColumn(d).width,s--);if(null==this.ParentCell.row.grid.style.cellPadding&&void 0===this.ParentCell.row.grid.style.cellPadding||(void 0!==this.ParentCell.row.grid.style.cellPadding.top&&this.ParentCell.row.grid.style.cellPadding.hasTopPad&&(n+=this.ParentCell.row.grid.style.cellPadding.top),void 0!==this.ParentCell.row.grid.style.cellPadding.bottom&&this.ParentCell.row.grid.style.cellPadding.hasBottomPad&&(n+=this.ParentCell.row.grid.style.cellPadding.bottom)),0!=this.ParentCell.row.grid.style.cellSpacing&&(o-=2*this.ParentCell.row.grid.style.cellSpacing),o>n&&(a=(o-n)/s,this.tempWidth=a,null!=this.ParentCell))for(d=0;d<this.columns.count;d++)this.columns.getColumn(d).isCustomWidth||(this.columns.getColumn(d).columnWidth=a)}}else{for(var e=[this.columns.count],h=0;h<this.columns.count;h++)e[h]=0;var l=0;if((void 0===this.isChildGrid&&void 0!==this.gridLocation||null===this.isChildGrid&&void 0!==this.gridLocation)&&(this.initialWidth=this.gridLocation.width),this.headers.count>0)for(var u=this.headers.getHeader(0).cells.count,c=this.headers.count,i=0;i<u;i++){l=0;for(d=0;d<c;d++){f=Math.min(this.initialWidth,this.headers.getHeader(d).cells.getCell(i).width);l=Math.max(l,f)}e[i]=l}l=0;for(var i=0,p=this.columns.count;i<p;i++){for(var d=0,c=this.rows.count;d<c;d++)if(1==this.rows.getRow(d).cells.getCell(i).columnSpan&&!this.rows.getRow(d).cells.getCell(i).isCellMergeContinue||null!=this.rows.getRow(d).cells.getCell(i).value){if(null!=this.rows.getRow(d).cells.getCell(i).value&&!this.rows.getRow(d).grid.style.allowHorizontalOverflow)this.rows.getRow(d).grid.style.cellPadding.right,this.rows.getRow(d).grid.style.cellPadding.left,this.rows.getRow(d).cells.getCell(i).style.borders.left.width;var f=0;f=this.initialWidth>0?Math.min(this.initialWidth,this.rows.getRow(d).cells.getCell(i).width):this.rows.getRow(d).cells.getCell(i).width,l=Math.max(e[i],Math.max(l,f)),l=Math.max(this.columns.getColumn(i).width,l)}0!=this.rows.count&&(e[i]=l),l=0}for(var i=0,g=this.rows.count;i<g;i++)for(var d=0,m=this.columns.count;d<m;d++)if(this.rows.getRow(i).cells.getCell(d).columnSpan>1)for(var y=e[d],b=1;b<this.rows.getRow(i).cells.getCell(d).columnSpan;b++)y+=e[d+b];for(var i=0,r=this.columns.count;i<r;i++)this.columns.getColumn(i).width<=0?this.columns.getColumn(i).columnWidth=e[i]:this.columns.getColumn(i).width>0&&!this.columns.getColumn(i).isCustomWidth&&(this.columns.getColumn(i).columnWidth=e[i]);var n=0,w=0,S=this.columns.count,P=0;w=this.tempWidth;for(d=0;d<this.columns.count;d++)this.gridColumns.getColumn(d).width>0&&this.gridColumns.getColumn(d).isCustomWidth&&(w-=this.gridColumns.getColumn(d).width,S--);if(w>0&&0!=this.ParentCell.row.grid.style.cellSpacing&&(w-=2*this.ParentCell.row.grid.style.cellSpacing),w>n&&(P=w/S,null!=this.ParentCell))for(d=0;d<this.columns.count;d++)this.columns.getColumn(d).isCustomWidth||(this.columns.getColumn(d).columnWidth=P)}},e}(Ge),Ei=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gi=function(e){function i(t){var i=e.call(this,t)||this;return i.gridInitialWidth=0,i.gridSize=new j(0,0),i.parentCellIndex=0,i.tempWidth=0,i.childheight=0,i.isChildGrid=!1,i.hasRowSpanSpan=!1,i.isRearranged=!1,i.pageBounds=new k,i.listOfNavigatePages=[],i.flag=!0,i.columnRanges=[],i.currentLocation=new T(0,0),i.breakRow=!0,i.isOverloadWithPosition=!1,i}return Ei(i,e),Object.defineProperty(i.prototype,"Grid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),i.prototype.getFormat=function(t){return t},i.prototype.layoutInternal=function(e){var i=this.getFormat(e.format);if(this.gridLayoutFormat=this.getFormat(e.format),this.currentPage=e.page,null===this.currentPage)throw Error("Can not set page as null");this.currentPage.getClientSize().height,this.currentPage.getClientSize().width;this.currentPageBounds=this.currentPage.getClientSize(),this.currentGraphics=this.currentPage.graphics;var r=0;if(r=this.currentGraphics.page.section.indexOf(this.currentGraphics.page),this.listOfNavigatePages.push(r),null!=i&&i.break===t.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new k(new T(e.bounds.x,e.bounds.y),new j(this.Grid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new k(new T(e.bounds.x,e.bounds.y),this.currentGraphics.clientSize),0!==this.Grid.rows.count)this.currentBounds.width=e.bounds.width>0?e.bounds.width:this.currentBounds.width-this.Grid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2;else{if(0===this.Grid.headers.count)throw Error("Please add row or header into grid");this.currentBounds.width=e.bounds.width}if(this.startLocation=new T(e.bounds.x,e.bounds.y),e.bounds.height>0&&!this.Grid.isChildGrid&&(this.currentBounds.height=e.bounds.height),this.Grid.isChildGrid||(this.hType=this.Grid.style.horizontalOverflowType),this.Grid.style.allowHorizontalOverflow?(this.Grid.measureColumnsWidth(),this.determineColumnDrawRanges()):(this.columnRanges=[],this.Grid.measureColumnsWidth(this.currentBounds),this.columnRanges.push([0,this.Grid.columns.count-1])),this.Grid.hasRowSpanSpan)for(var n=0;n<this.Grid.rows.count;n++)-1===this.Grid.rows.getRow(n).height||this.Grid.rows.getRow(n).isRowHeightSet||(this.Grid.rows.getRow(n).isRowHeightSet=!0);return this.layoutOnPage(e)},i.prototype.determineColumnDrawRanges=function(){for(var t=0,e=0,i=0,r=this.currentGraphics.clientSize.width-this.currentBounds.x,n=0;n<this.Grid.columns.count;n++)if((i+=this.Grid.columns.getColumn(n).width)>=r){for(var o=0,s=t;s<=n&&!((o+=this.Grid.columns.getColumn(s).width)>r);s++)e=s;this.columnRanges.push([t,e]),i=(e=t=e+1)<=n?this.Grid.columns.getColumn(n).width:0}this.columnRanges.push([t,this.Grid.columns.count-1])},i.prototype.layoutOnPage=function(e){this.pageBounds.x=e.bounds.x,this.pageBounds.y=e.bounds.y,this.pageBounds.height=e.bounds.height;for(var r=this.getFormat(e.format),n=null,o=new rt,s=e.page,a=[],h=0;h<this.columnRanges.length;h++){var l=this.columnRanges[h];this.cellStartIndex=l[0],this.cellEndIndex=l[1];var u=this.raiseBeforePageLayout(this.currentPage,this.currentBounds,this.currentRowIndex);this.currentBounds=u.currentBounds,this.currentRowIndex=u.currentRowIndex;for(var c=0;c<this.Grid.headers.count;c++)m=this.Grid.headers.getHeader(c),this.currentBounds.y,this.drawRow(m);var p=0,d=(this.Grid.rows.count,void 0),f=!0;a=[];for(var g=0;g<this.Grid.rows.count;g++){var m=this.Grid.rows.getRow(g);p++,this.currentRowIndex=p-1;var y=this.currentBounds.y;s=this.currentPage,i.repeatRowIndex=-1,f&&m.grid.isChildGrid&&(f=!1);var b=null;if(-1==this.Grid.splitChildRowIndex)b=this.drawRow(m),m.isrowFinish=!0;else{if(!(m.grid.ParentCell.row.grid.isGridSplit&&this.Grid.splitChildRowIndex<=m.rowIndex)){if(m.isrowFinish)continue;break}b=this.drawRow(m),m.isrowFinish=!0}for(a.push(b.bounds.width),y===this.currentBounds.y?(d=!0,i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(m)):(d=!1,i.repeatRowIndex=-1);!b.isFinish&&null!=s;){var w=this.getLayoutResult();if(this.raisePageLayouted(w).cancel||d)break;if(this.Grid.allowRowBreakAcrossPages){this.currentPage=this.getNextPageformat(r),y=this.currentBounds.y;var S=new T(Fe.default.right.width/2,Fe.default.top.width/2);if(0===r.paginateBounds.x&&0===r.paginateBounds.y&&0===r.paginateBounds.width&&0===r.paginateBounds.height&&this.startLocation.x===S.x&&this.startLocation.y===S.y&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y),this.Grid.isChildGrid&&null!=m.grid.ParentCell&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&m.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top<this.currentBounds.height&&(this.currentBounds.y=this.Grid.ParentCell.row.grid.style.cellPadding.top),null!=m.grid.ParentCell){m.grid.ParentCell.row.isRowBreaksNextPage=!0,m.grid.ParentCell.row.rowBreakHeightValue=m.rowBreakHeight+this.Grid.ParentCell.row.grid.style.cellPadding.top+this.Grid.ParentCell.row.grid.style.cellPadding.bottom;for(var P=m.rowIndex+1;P<m.grid.rows.count;P++)m.grid.ParentCell.row.rowBreakHeightValue+=m.grid.rows.getRow(P).height}if(m.grid.isChildGrid){m.isrowFinish=!1,m.grid.splitChildRowIndex=m.rowIndex,m.grid.ParentCell.row.grid.splitChildRowIndex=m.grid.ParentCell.row.rowIndex,m.grid.ParentCell.row.grid.isGridSplit&&(m.grid.ParentCell.row.noOfPageCount+=1,m.grid.ParentCell.row.grid.isGridSplit=!1);break}if(m.noOfPageCount<1){if(-1!=m.grid.splitChildRowIndex&&(m.grid.isGridSplit=!0),null!=m.style.border&&(null!=m.style.border.left&&1!==m.style.border.left.width||null!=m.style.border.top&&1!==m.style.border.top.width)){var v=m.style.border.left.width/2,C=m.style.border.top.width/2;if(this.currentBounds.x===Fe.default.right.width/2&&this.currentBounds.y===Fe.default.right.width/2){var B=new k(v,C,this.currentBounds.width,this.currentBounds.height);this.currentBounds=B}}if(this.Grid.repeatHeader)for(var O=0;O<this.Grid.headers.count;O++){var x=this.Grid.headers.getHeader(O);this.drawRow(x)}if(b=this.drawRow(m),m.noOfPageCount>=1){m.rowBreakHeightValue;for(var L=0;L<m.noOfPageCount;L++){var V=this.getLayoutResult();if(this.raisePageLayouted(V),this.currentPage=this.getNextPageformat(r),y=this.currentBounds.y,-1!=m.grid.splitChildRowIndex&&(m.grid.isGridSplit=!0),this.currentBounds.y=.5,this.Grid.repeatHeader)for(var R=0;R<this.Grid.headers.count;R++){D=this.Grid.headers.getHeader(R);this.drawRow(D)}this.drawRow(m)}}m.grid.splitChildRowIndex=-1,m.grid.isGridSplit=!1,b.isFinish=!0;for(var N=0;N<m.cells.count;N++)m.cells.getCell(N).value instanceof Fi&&(m.cells.getCell(N).value.splitChildRowIndex=-1)}}}if(!b.isFinish&&null!==s&&r.layout!==t.PdfLayoutType.OnePage&&d){if(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageformat(r),null!==e.format&&!e.format.usePaginateBounds&&null!==e.bounds&&e.bounds.height>0&&!this.Grid.isChildGrid&&(this.currentBounds.height=e.bounds.height),null!==e.format&&!e.format.usePaginateBounds&&null!==e.bounds&&e.bounds.y>0&&!this.Grid.isChildGrid&&(this.currentBounds.y=e.bounds.y),this.startLocation.y=this.currentBounds.y,r.paginateBounds.x===r.paginateBounds.y&&r.paginateBounds.y===r.paginateBounds.height&&r.paginateBounds.height===r.paginateBounds.width&&0===r.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x),this.currentBounds.x===Fe.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.Grid.repeatHeader)for(var A=0;A<this.Grid.headers.count;A++){var D=this.Grid.headers.getHeader(A);this.drawRow(D)}this.drawRow(m),null===this.currentPage||o.containsKey(this.currentPage)||o.add(this.currentPage,l)}if(null!=m.NestedGridLayoutResult){this.currentPage=m.NestedGridLayoutResult.page,this.currentGraphics=this.currentPage.graphics,this.startLocation=new T(m.NestedGridLayoutResult.bounds.x,m.NestedGridLayoutResult.bounds.y);var M=this.ReCalculateHeight(m,m.NestedGridLayoutResult.bounds.height);if(this.currentBounds.y=M,s!=this.currentPage){for(var I=this.currentPage.section,F=I.indexOf(s)+1,E=I.indexOf(this.currentPage),G=F;G<E+1;G++){var z=this.currentPage.graphics,W=new T(r.paginateBounds.x,r.paginateBounds.y),H=G==E?m.NestedGridLayoutResult.bounds.height-e.bounds.y:this.currentBounds.height-W.y;H<=z.clientSize.height&&(H+=e.bounds.y),W.y=null==r?.5:r.paginateBounds.y;for(Z=0;Z<m.cells.count;Z++){var _=m.cells.getCell(Z),K=0,U=0;if(_.value instanceof Fi)for(var q=0;q<_.value.columns.count;q++)U+=_.value.columns.getColumn(q).columnWidth;else U=_.width;K=Math.max(U,m.grid.columns.getColumn(Z).width),_.drawCellBorders(z,new k(W,new j(K,H))),W.x+=K,Z+=_.columnSpan-1}}s=this.currentPage}}}var Y=!1,X=0;a.length>0&&(X=a[0]);for(var J=[[1,2]],Z=0;Z<this.Grid.rows.count;Z++)if(-1!=this.cellEndIndex&&this.Grid.rows.getRow(Z).cells.getCell(this.cellEndIndex).value instanceof Fi){var $=this.Grid.rows.getRow(Z).cells.getCell(this.cellEndIndex).value;this.rowLayoutBoundsWidth=$.rowLayoutBoundsWidth,Y=!0}if(!Y&&a.length>0){for(Z=0;Z<p-1;Z++)X<a[Z]&&(X=a[Z]);this.rowLayoutBoundsWidth=X}else this.rowLayoutBoundsWidth=J[0][1];if(this.columnRanges.indexOf(l)<this.columnRanges.length-1&&null!=s&&r.layout!=t.PdfLayoutType.OnePage)if(this.Grid.isChildGrid,0!=J[0][0]){this.currentPage.section.indexOf(this.currentPage);this.currentGraphics=this.currentPage.graphics,this.currentBounds=new k(new T(0,0),this.currentPage.getClientSize());this.currentGraphics.page.section.indexOf(this.currentGraphics.page)}else this.currentPage=this.getNextPageformat(r);this.columnRanges.length-1!==h&&this.columnRanges.length>1&&r.layout!==t.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageformat(r),r.paginateBounds.x===r.paginateBounds.y&&r.paginateBounds.y===r.paginateBounds.height&&r.paginateBounds.height===r.paginateBounds.width&&0===r.paginateBounds.width&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y))}return n=this.getLayoutResult(),this.Grid.style.allowHorizontalOverflow&&this.Grid.style.horizontalOverflowType==t.PdfHorizontalOverflowType.NextPage&&this.reArrangePages(o),this.raisePageLayouted(n),n},i.prototype.getNextPageformat=function(t){var e=this.currentPage.section,i=null,r=e.indexOf(this.currentPage);this.flag=!1,i=r===e.count-1?e.add():e.getPages()[r+1],this.currentGraphics=i.graphics;var n=this.currentGraphics.page.section.indexOf(this.currentGraphics.page);return-1===this.listOfNavigatePages.indexOf(n)&&this.listOfNavigatePages.push(n),this.currentBounds=new k(new T(0,0),i.getClientSize()),i},i.prototype.CheckIfDefaultFormat=function(t){var e=new D;return t.alignment===e.alignment&&t.characterSpacing===e.characterSpacing&&t.clipPath===e.clipPath&&t.firstLineIndent===e.firstLineIndent&&t.horizontalScalingFactor===e.horizontalScalingFactor&&t.lineAlignment===e.lineAlignment&&t.lineLimit===e.lineLimit&&t.lineSpacing===e.lineSpacing&&t.measureTrailingSpaces===e.measureTrailingSpaces&&t.noClip===e.noClip&&t.paragraphIndent===e.paragraphIndent&&t.rightToLeft===e.rightToLeft&&t.subSuperScript===e.subSuperScript&&t.wordSpacing===e.wordSpacing&&t.wordWrap===e.wordWrap},i.prototype.RaiseBeforeCellDraw=function(t,e,i,r,n,o){var s=null;return this.Grid.raiseBeginCellDraw&&(s=new _i(t,e,i,r,n,o),this.Grid.onBeginCellDraw(s),o=s.style),o},i.prototype.raiseAfterCellDraw=function(t,e,i,r,n,o){var s=null;this.Grid.raiseEndCellDraw&&(s=new Ki(t,e,i,r,n,o),this.Grid.onEndCellDraw(s))},i.prototype.reArrangePages=function(t){for(var e=this.currentPage.document,i=[],r=t.keys(),n=(t.values(),0);n<r.length;n++)(a=r[n]).section=null,i.push(a),e.pages.remove(a);for(n=0;n<t.size();n++)for(var o=n,s=t.size()/this.columnRanges.length;o<t.size();o+=s){var a=i[o];-1===e.pages.indexOf(a)&&e.pages.add(a)}},i.prototype.getLayoutResult=function(){if(this.Grid.isChildGrid&&this.Grid.allowRowBreakAcrossPages)for(var t=0;t<this.Grid.rows.count;t++){var e=this.Grid.rows.getRow(t);e.rowBreakHeight>0&&e.repeatFlag&&(this.startLocation.y=this.currentPage.origin.y)}var i;return this.isChanged||(i=new k(this.startLocation,new j(this.currentBounds.width,this.currentBounds.y-this.startLocation.y))),new zi(this.currentPage,i)},i.prototype.ReCalculateHeight=function(t,e){for(var i=0,r=this.cellStartIndex;r<=this.cellEndIndex;r++)null!==t.cells.getCell(r).remainingString&&""!==t.cells.getCell(r).remainingString&&void 0!==t.cells.getCell(r).remainingString&&(i=Math.max(i,t.cells.getCell(r).measureHeight()));return Math.max(e,i)},i.prototype.raiseBeforePageLayout=function(t,e,i){var r=!1;if(this.Grid.raiseBeginPageLayout){var n=new Xi(e,t,i);this.Grid.onBeginPageLayout(n),r=n.cancel,e=n.bounds,i=n.startRowIndex}return{returnValue:r,currentBounds:e,currentRowIndex:i}},i.prototype.raisePageLayouted=function(t){var e=new Ji(t);return this.Grid.raiseEndPageLayout&&this.Grid.onEndPageLayout(e),e},i.prototype.drawRow=function(e,r,n){if(void 0===r){var o=new Zi,s=0,a=new j(0,0),h=!1;if(e.rowSpanExists){var l=0,u=this.Grid.rows.rowCollection.indexOf(e);-1===u&&-1!==(u=this.Grid.headers.indexOf(e))&&(h=!0);for(f=0;f<e.cells.count;f++){var c=e.cells.getCell(f);l=Math.max(l,c.rowSpan)}for(f=u;f<u+l;f++)s+=h?this.Grid.headers.getHeader(f).height:this.Grid.rows.getRow(f).height}var p=e.rowBreakHeight>0?e.rowBreakHeight:e.height;return this.Grid.isChildGrid&&null!=this.Grid.ParentCell?this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentPageBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+p>this.currentBounds.height||this.currentBounds.y+this.Grid.ParentCell.row.grid.style.cellPadding.bottom+s>this.currentPageBounds.height?(this.Grid.ParentCell.row.grid.LayoutFormat.break===t.PdfLayoutBreakType.FitPage&&(i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(e),this.Grid.splitChildRowIndex=this.Grid.rows.rowCollection.indexOf(e)),i.repeatRowIndex>-1&&i.repeatRowIndex===e.rowIndex&&this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,o.bounds=this.currentBounds,this.drawRowWithBreak(o,e,p),e.repeatFlag=!0,e.repeatRowNumber=i.repeatRowIndex)):(o.isFinish=!0,e.grid.ParentCell.row.rowBreakHeightValue>0?e.repeatFlag=!0:(e.repeatFlag=!1,p=e.height),this.Grid.isChildGrid&&e.rowBreakHeight>0&&null!=this.Grid.ParentCell.row.grid.style.cellPadding&&(p+=this.Grid.ParentCell.row.grid.style.cellPadding.bottom),this.drawRow(e,o,p)):p>this.currentPageBounds.height?this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,this.drawRowWithBreak(o,e,p),e.isrowFinish=!0,e.repeatFlag=!0,-1!==e.grid.splitChildRowIndex&&(o.isFinish=!1)):this.currentBounds.y+p>this.currentPageBounds.height||this.currentBounds.y+p>this.currentBounds.height+this.startLocation.y||this.currentBounds.y+s>this.currentPageBounds.height?(this.Grid.LayoutFormat.break===t.PdfLayoutBreakType.FitPage&&(i.repeatRowIndex=this.Grid.rows.rowCollection.indexOf(e)),i.repeatRowIndex>-1&&i.repeatRowIndex===e.rowIndex?this.Grid.allowRowBreakAcrossPages&&(o.isFinish=!0,this.drawRowWithBreak(o,e,p),e.repeatFlag=!0,e.repeatRowNumber=i.repeatRowIndex,-1!==e.grid.splitChildRowIndex&&(o.isFinish=!1)):o.isFinish=!1):(o.isFinish=!0,this.drawRow(e,o,p),e.repeatFlag=!1),o}var d=new T(this.currentBounds.x,this.currentBounds.y);r.bounds=new k(d,new j(0,0)),n=this.ReCalculateHeight(e,n);for(var f=this.cellStartIndex;f<=this.cellEndIndex;f++){var g=f>this.cellEndIndex+1&&e.cells.getCell(f).columnSpan>1;if(!g)for(var m=1;m<e.cells.getCell(f).columnSpan;m++)e.cells.getCell(f+m).isCellMergeContinue=!0;a=new j(this.Grid.columns.getColumn(f).width,n);!this.CheckIfDefaultFormat(this.Grid.columns.getColumn(f).format)&&this.CheckIfDefaultFormat(e.cells.getCell(f).stringFormat)&&(e.cells.getCell(f).stringFormat=this.Grid.columns.getColumn(f).format);var y=e.cells.getCell(f).style,b="string"==typeof e.cells.getCell(f).value&&null!==e.cells.getCell(f).value?e.cells.getCell(f).value:"";e.cells.getCell(f).style=this.RaiseBeforeCellDraw(this.currentGraphics,this.currentRowIndex,f,new k(d,a),b,y),e.cells.getCell(f).value instanceof Fi&&((S=e.cells.getCell(f).value).parentCellIndex=f);var w=e.cells.getCell(f).draw(this.currentGraphics,new k(d,a),g);if(e.grid.style.allowHorizontalOverflow&&(e.cells.getCell(f).columnSpan>this.cellEndIndex||f+e.cells.getCell(f).columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),e.grid.style.allowHorizontalOverflow&&e.rowOverflowIndex>0&&(e.cells.getCell(f).columnSpan>this.cellEndIndex||f+e.cells.getCell(f).columnSpan>this.cellEndIndex+1)&&e.cells.getCell(f).columnSpan-this.cellEndIndex+f-1>0&&(e.cells.getCell(e.rowOverflowIndex+1).value=null!==w&&void 0!==w.remainder?w.remainder:"",e.cells.getCell(e.rowOverflowIndex+1).stringFormat=e.cells.getCell(f).stringFormat,e.cells.getCell(e.rowOverflowIndex+1).style=e.cells.getCell(f).style,e.cells.getCell(e.rowOverflowIndex+1).columnSpan=e.cells.getCell(f).columnSpan-this.cellEndIndex+f-1),b="string"==typeof e.cells.getCell(f).value&&null!==e.cells.getCell(f).value?e.cells.getCell(f).value:"",g||this.raiseAfterCellDraw(this.currentGraphics,this.currentRowIndex,f,new k(d,a),b,e.cells.getCell(f).style),e.cells.getCell(f).value instanceof Fi){var S=e.cells.getCell(f).value;this.Grid.columns.getColumn(f).width>=this.currentGraphics.clientSize.width?(d.x=S.rowLayoutBoundsWidth,d.x+=S.style.cellSpacing):d.x+=this.Grid.columns.getColumn(f).width}else d.x+=this.Grid.columns.getColumn(f).width}e.rowMergeComplete&&!e.isRowHeightSet||(this.currentBounds.y+=n),r.bounds=new k(new T(r.bounds.x,r.bounds.y),new j(d.x,d.y))},i.prototype.drawRowWithBreak=function(t,e,i){var r=new T(this.currentBounds.x,this.currentBounds.y);e.grid.isChildGrid&&e.grid.allowRowBreakAcrossPages&&this.startLocation.x!==this.currentBounds.x&&(r.x=this.startLocation.x),t.bounds=new k(r,new j(0,0)),this.gridHeight=e.rowBreakHeight>0?this.currentPageBounds.height:0,e.grid.style.cellPadding.top+this.currentBounds.y+e.grid.style.cellPadding.bottom<this.currentPageBounds.height&&(e.rowBreakHeight=this.currentBounds.y+i-this.currentPageBounds.height);for(o=0;o<e.cells.count;o++){var n=e.cells.getCell(o);n.measureHeight()===i&&n.value instanceof Fi&&(e.rowBreakHeight=0)}for(var o=this.cellStartIndex;o<=this.cellEndIndex;o++){var s=e.cells.getCell(o).columnSpan+o>this.cellEndIndex+1&&e.cells.getCell(o).columnSpan>1,a=new j(this.Grid.columns.getColumn(o).width,this.gridHeight>0?this.gridHeight:this.currentPageBounds.height),h=e.cells.getCell(o).style;e.cells.getCell(o).style=h;var l=null;if(l=e.cells.getCell(o).draw(this.currentGraphics,new k(r,a),s),e.rowBreakHeight>0&&null!=l&&(e.cells.getCell(o).FinishedDrawingCell=!1,e.cells.getCell(o).remainingString=null==l.remainder?" ":l.remainder,e.grid.isChildGrid&&(e.rowBreakHeight=i-l.actualSize.height)),t.isFinish=t.isFinish?e.cells.getCell(o).FinishedDrawingCell:t.isFinish,e.cells.getCell(o).value instanceof Fi){var u=e.cells.getCell(o).value;this.rowBreakPageHeightCellIndex=o,this.Grid.columns.getColumn(o).width>=this.currentGraphics.clientSize.width?(r.x=this.rowLayoutBoundsWidth,r.x+=u.style.cellSpacing):r.x+=this.Grid.columns.getColumn(o).width}else r.x+=this.Grid.columns.getColumn(o).width}this.currentBounds.y+=this.gridHeight>0?this.gridHeight:i,t.bounds=new k(new T(t.bounds.x,t.bounds.y),new j(r.x,r.y))},i.repeatRowIndex=-1,i}(Ae),zi=function(t){function e(e,i){return t.call(this,e,i)||this}return Ei(e,t),e}(Ie),Wi=function(t){function e(e){return t.call(this,e)||this}return Ei(e,t),e}(De),Hi=function(){function t(t,e,i,r,n){this.gridRowIndex=e,this.gridCellIndex=i,this.internalValue=n,this.gridBounds=r,this.pdfGraphics=t}return Object.defineProperty(t.prototype,"rowIndex",{get:function(){return this.gridRowIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cellIndex",{get:function(){return this.gridCellIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.internalValue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.gridBounds},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"graphics",{get:function(){return this.pdfGraphics},enumerable:!0,configurable:!0}),t}(),_i=function(t){function e(e,i,r,n,o,s){var a=t.call(this,e,i,r,n,o)||this;return a.style=s,a}return Ei(e,t),Object.defineProperty(e.prototype,"skip",{get:function(){return this.bSkip},set:function(t){this.bSkip=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this.cellStyle},set:function(t){this.cellStyle=t},enumerable:!0,configurable:!0}),e}(Hi),Ki=function(t){function e(e,i,r,n,o,s){var a=t.call(this,e,i,r,n,o)||this;return a.cellStyle=s,a}return Ei(e,t),Object.defineProperty(e.prototype,"style",{get:function(){return this.cellStyle},enumerable:!0,configurable:!0}),e}(Hi),Ui=function(){function t(){}return Object.defineProperty(t.prototype,"cancel",{get:function(){return this.isCancel},set:function(t){this.isCancel=t},enumerable:!0,configurable:!0}),t}(),qi=function(t){function e(e,i){var r=t.call(this)||this;return r.bounds=e,r.pdfPage=i,r}return Ei(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.cellBounds},set:function(t){this.cellBounds=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"page",{get:function(){return this.pdfPage},enumerable:!0,configurable:!0}),e}(Ui),Yi=function(t){function e(e){var i=t.call(this)||this;return i.layoutResult=e,i}return Ei(e,t),Object.defineProperty(e.prototype,"result",{get:function(){return this.layoutResult},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextPage",{get:function(){return this.nextPdfPage},set:function(t){this.nextPdfPage=t},enumerable:!0,configurable:!0}),e}(Ui),Xi=function(t){function e(e,i,r){var n=t.call(this,e,i)||this;return n.startRow=r,n}return Ei(e,t),Object.defineProperty(e.prototype,"startRowIndex",{get:function(){return this.startRow},enumerable:!0,configurable:!0}),e}(qi),Ji=function(t){function e(e){return t.call(this,e)||this}return Ei(e,t),e}(Yi),Zi=function(){function t(){this.layoutedBounds=new k(0,0,0,0)}return Object.defineProperty(t.prototype,"isFinish",{get:function(){return this.bIsFinished},set:function(t){this.bIsFinished=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.layoutedBounds},set:function(t){this.layoutedBounds=t},enumerable:!0,configurable:!0}),t}(),$i=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qi=function(e){function i(t){var i=e.call(this,t)||this;return i.olderPdfForm=0,i.shapeBounds=new k,i.totalPageSize=0,i}return $i(i,e),Object.defineProperty(i.prototype,"element",{get:function(){return this.elements},enumerable:!0,configurable:!0}),i.prototype.layoutInternal=function(t){var e=t.page,i=t.bounds,r=this.element.getBounds();r.x=0,r.y=0;var n=this.shapeBounds.x===this.shapeBounds.y&&this.shapeBounds.y===this.shapeBounds.width&&this.shapeBounds.width===this.shapeBounds.height&&0===this.shapeBounds.height;this.isPdfGrid&&!n&&(r=this.shapeBounds);var o=null,s=new tr;for(s.page=e;;){var a=this.raiseBeforePageLayout(e,i);i=a.currentBounds;var h=null;if(a.cancel||(s=this.layoutOnPage(e,i,r,t),h=this.raiseEndPageLayout(s),a.cancel=null!==h&&h.cancel),s.end||a.cancel){o=this.getLayoutResult(s);break}if(i=this.getPaginateBounds(t),r=this.getNextShapeBounds(r,s),e=null===h||null===h.nextPage?this.getNextPage(e):h.nextPage,this.isPdfGrid){o=this.getLayoutResult(s);break}}return o},i.prototype.raiseBeforePageLayout=function(t,e){var i=!1;if(this.element.raiseBeginPageLayout){var r=new qi(e,t);this.element.onBeginPageLayout(r),i=r.cancel,e=r.bounds}return{currentBounds:e,cancel:i}},i.prototype.raiseEndPageLayout=function(t){var e=null;if(this.element.raiseEndPageLayout){var i=this.getLayoutResult(t);e=new Yi(i),this.element.onEndPageLayout(e)}return e},i.prototype.getLayoutResult=function(t){return new Ie(t.page,t.bounds)},i.prototype.getNextShapeBounds=function(t,e){var i=e.bounds;return t.y=t.y+i.height,t.height=t.height-i.height,t},i.prototype.layoutOnPage=function(e,i,r,n){var o=new tr;i=this.checkCorrectCurrentBounds(e,i,n);var s=this.fitsToBounds(i,r),a=!1;if(!(n.format.break===t.PdfLayoutBreakType.FitElement&&!s&&e===n.page)){var h=this.getDrawBounds(i,r);this.drawShape(e.graphics,i,h),o.bounds=this.getPageResultBounds(i,r),a=i.height>=r.height}return o.end=a||n.format.layout===t.PdfLayoutType.OnePage,o.page=e,o},i.prototype.getDrawBounds=function(t,e){var i=t;return i.y=i.y-e.y,i.height=i.height+e.y,i},i.prototype.drawShape=function(t,e,i){var r=t.save();try{t.setClip(e),this.element.drawGraphicsHelper(t,new T(i.x,i.y))}finally{t.restore(r)}},i.prototype.checkCorrectCurrentBounds=function(t,e,i){var r=t.graphics.clientSize;return e.width=e.width>0?e.width:r.width-e.x,e.height=e.height>0?e.height:r.height-e.y,this.isPdfGrid&&(e.height=e.height-this.bottomCellPadding),e},i.prototype.getPageResultBounds=function(t,e){var i=t;return i.height=Math.min(i.height,e.height),i},i.prototype.fitsToBounds=function(t,e){return e.height<=t.height},i.index=0,i.splitDiff=0,i.last=!1,i.borderWidth=0,i}(Ae),tr=function(){function t(){}return t}(),er=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ir=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return er(e,t),e.prototype.getBounds=function(){return this.getBoundsInternal()},e.prototype.drawGraphicsHelper=function(t,e){if(null==t)throw new Error("ArgumentNullException :graphics");this.drawShapeHelper(t,e.x,e.y)},e.prototype.drawShapeHelper=function(t,e,i){var r=.5!==e||.5!==i,n=null;r&&(n=t.save(),t.translateTransform(e,i)),this.drawInternal(t),r&&t.restore(n)},e.prototype.layout=function(t){return new Qi(this).layout(t)},e}(Ge),rr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nr=function(t){function e(e){var i=t.call(this)||this;return void 0!==e&&(i.mpen=e),i}return rr(e,t),Object.defineProperty(e.prototype,"pen",{get:function(){return this.mpen},set:function(t){this.mpen=t},enumerable:!0,configurable:!0}),e}(ir),or=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sr=function(t){function e(e,i){var r=t.call(this)||this;return r.mbrush=null,void 0===e||(e instanceof Q?r=t.call(this,e)||this:r.mbrush=i),r}return or(e,t),Object.defineProperty(e.prototype,"brush",{get:function(){return this.mbrush},set:function(t){this.mbrush=t},enumerable:!0,configurable:!0}),e.prototype.obtainPen=function(){return null==this.mbrush&&null==this.pen?new Q(new L(0,0,0)):this.pen},e}(nr),ar=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hr=function(e){function i(i,r,n,o){var s=e.call(this)||this;return s.mpoints=null,s.mpathTypes=null,s.mStartFigure=!0,s.mfillMode=t.PdfFillMode.Alternate,s.isBeziers3=!1,s.isXps=!1,void 0===i||(i instanceof Q?(s=e.call(this,i)||this,r instanceof R?(s=e.call(this,i,r)||this).fillMode=n:null!==r&&void 0!==r&&null!==n&&void 0!==n&&s.addPath(r,n)):i instanceof R?(s=e.call(this,i)||this,null!==r&&void 0!==r&&(s.fillMode=r),null!==n&&void 0!==n&&null!==o&&void 0!==o&&s.addPath(n,o)):s.addPath(i,r)),s}return ar(i,e),Object.defineProperty(i.prototype,"fillMode",{get:function(){return this.mfillMode},set:function(t){this.mfillMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pathPoints",{get:function(){return this.points},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pathTypes",{get:function(){return this.types},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pointCount",{get:function(){var t=0;return null!=this.mpoints&&(t=this.mpoints.length),t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lastPoint",{get:function(){return this.getLastPoint()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return null==this.mpoints&&(this.mpoints=[]),this.mpoints},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"types",{get:function(){return null==this.mpathTypes&&(this.mpathTypes=[]),this.mpathTypes},enumerable:!0,configurable:!0}),i.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof T&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&(r instanceof De||null==r)&&"number"==typeof i){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return this.drawHelper(t,e,i)},i.prototype.addArc=function(e,i,r,n,o,s){if(e instanceof k)this.addArc(e.x,e.y,e.width,e.height,i,r);else for(var a=this.getBezierArcPoints(e,i,i+r,i+n,o,s),h=0;h<a.length;h+=8){var l=[a[h],a[h+1],a[h+2],a[h+3],a[h+4],a[h+5],a[h+6],a[h+7]];this.addPoints(l,t.PathPointType.Bezier3)}},i.prototype.addBezier=function(e,i,r,n,o,s,a,h){if(e instanceof T&&i instanceof T&&r instanceof T&&n instanceof T)this.addBezier(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y);else{var l=[];l.push(e),l.push(i),l.push(r),l.push(n),l.push(o),l.push(s),l.push(a),l.push(h),this.addPoints(l,t.PathPointType.Bezier3)}},i.prototype.addEllipse=function(t,e,i,r){t instanceof k?this.addEllipse(t.x,t.y,t.width,t.height):(this.startFigure(),this.addArc(t,e,i,r,0,360),this.closeFigure())},i.prototype.addLine=function(e,i,r,n){if(e instanceof T&&i instanceof T)this.addLine(e.x,e.y,i.x,i.y);else{var o=[];o.push(e),o.push(i),o.push(r),o.push(n),this.addPoints(o,t.PathPointType.Line)}},i.prototype.addPath=function(t,e){if(t instanceof i)this.addPath(t.pathPoints,t.pathTypes);else{if(null==t)throw new Error("ArgumentNullException:pathPoints");if(null==e)throw new Error("ArgumentNullException:pathTypes");if(t.length!==e.length)throw new Error("The argument arrays should be of equal length.")}},i.prototype.addPie=function(e,i,r,n,o,s){e instanceof k?this.addPie(e.x,e.y,e.width,e.height,i,r):(this.startFigure(),this.addArc(e,i,r,n,o,s),this.addPoint(new T(e+r/2,i+n/2),t.PathPointType.Line),this.closeFigure())},i.prototype.addPolygon=function(e){e.length;var i=[];this.startFigure();for(var r=0;r<e.length;r++)i.push(e[r].x),i.push(e[r].y);this.addPoints(i,t.PathPointType.Line),this.closeFigure()},i.prototype.addRectangle=function(e,i,r,n){if(e instanceof k)this.addRectangle(e.x,e.y,e.width,e.height);else{var o=[];this.startFigure(),o.push(e),o.push(i),o.push(e+r),o.push(i),o.push(e+r),o.push(i+n),o.push(e),o.push(i+n),this.addPoints(o,t.PathPointType.Line),this.closeFigure()}},i.prototype.startFigure=function(){this.mStartFigure=!0},i.prototype.closeAllFigures=function(){for(var e=this.pathPoints[0],i=0;i<this.mpathTypes.length;i++){var r=this.types[i],n=!1;0!==i&&r===t.PathPointType.Start?(this.closeFigure(i-1),n=!0):i===this.mpathTypes.length-1&&!n&&this.isXps&&e.x===this.pathPoints[i].y&&this.closeFigure(i)}},i.prototype.getLastPoint=function(){var t=new T(0,0),e=this.pointCount;return e>0&&null!=this.mpoints&&(t.x=this.mpoints[e-1].x,t.y=this.mpoints[e-1].y),t},i.prototype.getBezierArcPoints=function(t,e,i,r,n,o){if(t>i){s=void 0;s=t,t=i,i=s}if(r>e){var s=void 0;s=e,e=r,r=s}var a,h;Math.abs(o)<=90?(a=o,h=1):a=o/(h=Math.ceil(Math.abs(o)/90));for(var l=(t+i)/2,u=(e+r)/2,c=(i-t)/2,p=(r-e)/2,d=a*(Math.PI/360),f=Math.abs(4/3*(1-Math.cos(d))/Math.sin(d)),g=[],m=0;m<h;m++){var y=(n+m*a)*(Math.PI/180),b=(n+(m+1)*a)*(Math.PI/180),w=Math.cos(y),S=Math.cos(b),P=Math.sin(y),v=Math.sin(b);a>0?g.push(l+c*w,u-p*P,l+c*(w-f*P),u-p*(P+f*w),l+c*(S+f*v),u-p*(v-f*S),l+c*S,u-p*v):g.push(l+c*w,u-p*P,l+c*(w+f*P),u-p*(P-f*w),l+c*(S-f*v),u-p*(v+f*S),l+c*S,u-p*v)}return g},i.prototype.getBoundsInternal=function(){var t=this.pathPoints,e=new k(0,0,0,0);if(t.length>0){for(var i=t[0].x,r=t[0].x,n=t[0].y,o=t[0].y,s=1;s<t.length;s++){var a=t[s];i=Math.min(a.x,i),r=Math.max(a.x,r),n=Math.min(a.y,n),o=Math.max(a.y,o)}e=new k(i,n,r-i,o-n)}return e},i.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException :graphics");t.drawPath(this.obtainPen(),this.brush,this)},i.prototype.addPoints=function(e,i,r,n){if(void 0===r&&void 0===n)this.addPoints(e,i,0,e.length);else for(var o=r;o<n;o++){var s=new T(e[o],e[o+1]);o===r?this.pointCount<=0||this.mStartFigure?(this.addPoint(s,t.PathPointType.Start),this.mStartFigure=!1):s.x===this.lastPoint.x||s.y===this.lastPoint.y||this.isBeziers3?s.x!==this.lastPoint.x&&s.y!==this.lastPoint.y&&this.addPoint(s,t.PathPointType.Bezier3):this.addPoint(s,t.PathPointType.Line):this.addPoint(s,i),o++}},i.prototype.addPoint=function(t,e){this.points.push(t),this.types.push(e)},i.prototype.closeFigure=function(e){if(void 0===e)this.pointCount>0&&this.closeFigure(this.pointCount-1),this.startFigure();else{if(e<0)throw new Error("IndexOutOfRangeException()");var i=this.types[e];i|=t.PathPointType.CloseSubpath,this.types[e]=i}},i}(sr),lr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ur=function(t){function e(e,i,r,n,o,s){var a=t.call(this)||this;return a.bounds=new k(0,0,0,0),void 0===e||(e instanceof Q?(a=t.call(this,e,i)||this).bounds=r instanceof k?r:new k(r,n,o,s):a.bounds=e instanceof k?e:new k(e,i,r,n)),a}return lr(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this.bounds.x},set:function(t){this.bounds.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.bounds.y},set:function(t){this.bounds.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.bounds.width},set:function(t){this.bounds.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.bounds.height},set:function(t){this.bounds.height=t},enumerable:!0,configurable:!0}),e.prototype.getBoundsInternal=function(){return this.bounds},e}(sr),cr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pr=function(t){function e(e,i,r,n,o,s,a,h){var l=t.call(this)||this;return l.startAngle=0,l.sweepAngle=0,void 0===e||(e instanceof k&&void 0!==i&&void 0!==r?((l=t.call(this,e)||this).startAngle=i,l.sweepAngle=r):e instanceof Q?r instanceof k?((l=t.call(this,e,i,r)||this).startAngle=n,l.sweepAngle=o):((l=t.call(this,e,i,r,n,o,s)||this).startAngle=a,l.sweepAngle=h):((l=t.call(this,e,i,r,n)||this).startAngle=o,l.sweepAngle=s)),l}return cr(e,t),e}(ur),dr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fr=function(t){function e(e,i,r,n,o,s,a){var h=this;return void 0===e?h=t.call(this)||this:e instanceof k?h=t.call(this,e,i,r)||this:e instanceof Q?i instanceof k?h=t.call(this,e,null,i,r,n)||this:void 0===s&&void 0===a?h=t.call(this,e,null,0,0,i,r,n,o)||this:void 0!==s&&void 0!==a&&(h=t.call(this,e,null,i,r,n,o,s,a)||this):void 0!==e&&void 0===o&&void 0===s?h=t.call(this,0,0,e,i,r,n)||this:void 0!==e&&void 0!==o&&void 0!==s&&(h=t.call(this,e,i,r,n,o,s)||this),h}return dr(e,t),e.prototype.draw=function(t,e,i,r){if(e instanceof T&&void 0===e.width&&void 0===i)return this.drawHelper(t,e.x,e.y);if(e instanceof k&&void 0!==e.width&&void 0===i)return this.drawHelper(t,e,null);if("number"==typeof e&&"number"==typeof i&&void 0===r)return this.drawHelper(t,e,i,null);if(e instanceof T&&i instanceof De)return this.drawHelper(t,e.x,e.y,i);if("number"==typeof e&&(r instanceof De||null==r)&&"number"==typeof i){var n=t.graphics.clientSize.width-e,o=new k(e,i,n,0);return this.drawHelper(t,o,r)}return this.drawHelper(t,e,i)},e.prototype.drawInternal=function(t){if(null==t)throw new Error("ArgumentNullException : graphics");t.drawArc(this.obtainPen(),this.bounds,this.startAngle,this.sweepAngle)},e}(pr),gr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mr=function(e){function i(i,r,n){var o=e.call(this,r)||this;return o.isEmbedFont=!1,o.isUnicode=!0,void 0!==n?o.createFontInternal(i,n):o.createFontInternal(i,t.PdfFontStyle.Regular),o}return gr(i,e),i.prototype.equalsToFont=function(t){return!1},i.prototype.getLineWidth=function(e,i){var r=0;r=null!==i&&void 0!==i&&i.textDirection!==t.PdfTextDirection.None?this.getUnicodeLineWidth(e,r,i).width:this.fontInternal.getLineWidth(e);var n=this.metrics.getSize(i);return r*=G.charSizeMultiplier*n,r=this.applyFormatSettings(e,i,r)},i.prototype.getCharWidth=function(t,e){var i=this.fontInternal.getCharWidth(t);return i*=.001*this.metrics.getSize(e)},i.prototype.createFontInternal=function(t,e){this.fontInternal=new Gt(t,this.size),this.calculateStyle(e),this.initializeInternals()},i.prototype.calculateStyle=function(e){var i=this.fontInternal.ttfMetrics.macStyle;0!=(e&t.PdfFontStyle.Underline)&&(i|=t.PdfFontStyle.Underline),0!=(e&t.PdfFontStyle.Strikeout)&&(i|=t.PdfFontStyle.Strikeout),this.setStyle(i)},i.prototype.initializeInternals=function(){var t=null;Ce.enableCache&&(t=Ce.cache.search(this));var e=null;if(null!==t&&void 0!==t){e=t.getInternals();var i=t.metrics;(i=i.clone()).size=this.size,this.metrics=i,this.fontInternal=t.fontInternal}else null==t&&(this.fontInternal instanceof Gt&&(this.fontInternal.isEmbed=this.isEmbedFont),this.fontInternal.createInternals(),e=this.fontInternal.getInternals(),this.metrics=this.fontInternal.metrics);this.metrics.isUnicodeFont=!0,this.setInternals(e)},i.prototype.setSymbols=function(t){var e=this.fontInternal;null!=e&&e.setSymbols(t)},Object.defineProperty(i.prototype,"Unicode",{get:function(){return this.isUnicode},enumerable:!0,configurable:!0}),i.prototype.getUnicodeLineWidth=function(e,i,r){i=0;var n=null,o=(new Kt).getGlyphIndex(e,this,r.textDirection===t.PdfTextDirection.RightToLeft,n,!0),s=o.success;if(n=o.glyphs,s&&null!==n)for(var a=this.fontInternal.ttfReader,h=0,l=n.length;h<l;h++){var u=n[h],c=a.getGlyph(u);null!==c&&void 0!==c&&(i+=c.width)}return{success:s,width:i}},i}(G),yr=function(){function e(t,e,i,r,n){t instanceof k&&void 0===e?this.InitiateBounds(t.x,t.y,t.width,t.height,null):t instanceof k&&e instanceof ce&&void 0===i?this.InitiateBounds(t.x,t.y,t.width,t.height,e):t instanceof T&&e instanceof j&&void 0===i?this.InitiateBounds(t.x,t.y,e.width,e.height,null):t instanceof T&&e instanceof j&&i instanceof ce&&void 0===r?this.InitiateBounds(t.x,t.y,e.width,e.height,i):t instanceof j&&void 0===e?this.InitiateBounds(0,0,t.width,t.height,null):"number"==typeof t&&"number"==typeof e&&void 0===i?this.InitiateBounds(0,0,t,e,null):"number"==typeof t&&"number"==typeof e&&i instanceof ce&&void 0===r?this.InitiateBounds(0,0,t,e,i):this.InitiateBounds(t,e,i,r,null)}return Object.defineProperty(e.prototype,"dock",{get:function(){return this.dockStyle},set:function(t){this.dockStyle=t,this.resetAlignment()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this.alignmentStyle},set:function(t){this.setAlignment(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"foreground",{get:function(){return this.isForeground},set:function(t){this.isForeground=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return!this.isForeground},set:function(t){this.isForeground=!t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"location",{get:function(){return this.currentLocation},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"x",{get:function(){return void 0!==this.currentLocation?this.currentLocation.x:0},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation.x=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return void 0!==this.currentLocation?this.currentLocation.y:0},set:function(e){this.type===t.TemplateType.None&&(this.currentLocation.y=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.template.size},set:function(e){this.type===t.TemplateType.None&&this.template.reset(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.template.width},set:function(e){if(this.template.width!==e&&this.type===t.TemplateType.None){var i=this.template.size;i.width=e,this.template.reset(i)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.template.height},set:function(e){if(this.template.height!==e&&this.type===t.TemplateType.None){var i=this.template.size;i.height=e,this.template.reset(i)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){return this.template.graphics},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"template",{get:function(){return this.pdfTemplate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.templateType},set:function(t){this.updateDocking(t),this.templateType=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new k(new T(this.x,this.y),this.size)},set:function(e){this.type===t.TemplateType.None&&(this.location=new T(e.x,e.y),this.size=new j(e.width,e.height))},enumerable:!0,configurable:!0}),e.prototype.InitiateBounds=function(t,e,i,r,n){this.x=t,this.y=e,this.pdfTemplate=new Yt(i,r)},e.prototype.updateDocking=function(e){if(e!==t.TemplateType.None){switch(e){case t.TemplateType.Top:this.dock=t.PdfDockStyle.Top;break;case t.TemplateType.Bottom:this.dock=t.PdfDockStyle.Bottom;break;case t.TemplateType.Left:this.dock=t.PdfDockStyle.Left;break;case t.TemplateType.Right:this.dock=t.PdfDockStyle.Right}this.resetAlignment()}},e.prototype.resetAlignment=function(){this.alignment=t.PdfAlignmentStyle.None},e.prototype.setAlignment=function(e){if(this.dock===t.PdfDockStyle.None)this.alignmentStyle=e;else{var i=!1;switch(this.dock){case t.PdfDockStyle.Left:i=e===t.PdfAlignmentStyle.TopLeft||e===t.PdfAlignmentStyle.MiddleLeft||e===t.PdfAlignmentStyle.BottomLeft||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Top:i=e===t.PdfAlignmentStyle.TopLeft||e===t.PdfAlignmentStyle.TopCenter||e===t.PdfAlignmentStyle.TopRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Right:i=e===t.PdfAlignmentStyle.TopRight||e===t.PdfAlignmentStyle.MiddleRight||e===t.PdfAlignmentStyle.BottomRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Bottom:i=e===t.PdfAlignmentStyle.BottomLeft||e===t.PdfAlignmentStyle.BottomCenter||e===t.PdfAlignmentStyle.BottomRight||e===t.PdfAlignmentStyle.None;break;case t.PdfDockStyle.Fill:i=e===t.PdfAlignmentStyle.MiddleCenter||e===t.PdfAlignmentStyle.None}i&&(this.alignmentStyle=e)}},e.prototype.draw=function(t,e){var i=t.page,r=this.calculateBounds(i,e);-0===r.x&&(r.x=0),t.graphics.drawPdfTemplate(this.template,new T(r.x,r.y),new j(r.width,r.height))},e.prototype.calculateBounds=function(e,i){var r=this.bounds;return this.alignmentStyle!==t.PdfAlignmentStyle.None?r=this.getAlignmentBounds(e,i):this.dockStyle!==t.PdfDockStyle.None&&(r=this.getDockBounds(e,i)),r},e.prototype.getAlignmentBounds=function(e,i){this.bounds;return this.type===t.TemplateType.None?this.getSimpleAlignmentBounds(e,i):this.getTemplateAlignmentBounds(e,i)},e.prototype.getSimpleAlignmentBounds=function(e,i){var r=this.bounds,n=e.section.getActualBounds(i,e,!1),o=this.x,s=this.y;switch(this.alignmentStyle){case t.PdfAlignmentStyle.TopLeft:o=0,s=0;break;case t.PdfAlignmentStyle.TopCenter:o=(n.width-this.width)/2,s=0;break;case t.PdfAlignmentStyle.TopRight:o=n.width-this.width,s=0;break;case t.PdfAlignmentStyle.MiddleLeft:o=0,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleCenter:o=(n.width-this.width)/2,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleRight:o=n.width-this.width,s=(n.height-this.height)/2;break;case t.PdfAlignmentStyle.BottomLeft:o=0,s=n.height-this.height;break;case t.PdfAlignmentStyle.BottomCenter:o=(n.width-this.width)/2,s=n.height-this.height;break;case t.PdfAlignmentStyle.BottomRight:o=n.width-this.width,s=n.height-this.height}return r.x=o,r.y=s,r},e.prototype.getTemplateAlignmentBounds=function(e,i){var r=this.bounds,n=e.section,o=n.getActualBounds(i,e,!1),s=this.x,a=this.y;switch(this.alignmentStyle){case t.PdfAlignmentStyle.TopLeft:this.type===t.TemplateType.Left?(s=-o.x,a=0):this.type===t.TemplateType.Top&&(s=-o.x,a=-o.y);break;case t.PdfAlignmentStyle.TopCenter:s=(o.width-this.width)/2,a=-o.y;break;case t.PdfAlignmentStyle.TopRight:this.type===t.TemplateType.Right?(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=0):this.type===t.TemplateType.Top&&(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=-o.y);break;case t.PdfAlignmentStyle.MiddleLeft:s=-o.x,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleCenter:s=(o.width-this.width)/2,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.MiddleRight:s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=(o.height-this.height)/2;break;case t.PdfAlignmentStyle.BottomLeft:this.type===t.TemplateType.Left?(s=-o.x,a=o.height-this.height):this.type===t.TemplateType.Bottom&&(s=-o.x,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height);break;case t.PdfAlignmentStyle.BottomCenter:s=(o.width-this.width)/2,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height;break;case t.PdfAlignmentStyle.BottomRight:this.type===t.TemplateType.Right?(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=o.height-this.height):this.type===t.TemplateType.Bottom&&(s=o.width+n.getRightIndentWidth(i,e,!1)-this.width,a=o.height+n.getBottomIndentHeight(i,e,!1)-this.height)}return r.x=s,r.y=a,r},e.prototype.getDockBounds=function(e,i){this.bounds;return this.type===t.TemplateType.None?this.getSimpleDockBounds(e,i):this.getTemplateDockBounds(e,i)},e.prototype.getSimpleDockBounds=function(e,i){this.bounds;var r=e.section.getActualBounds(i,e,!1),n=this.x,o=this.y,s=this.width,a=this.height;switch(this.dockStyle){case t.PdfDockStyle.Left:n=0,o=0,s=this.width,a=r.height;break;case t.PdfDockStyle.Top:n=0,o=0,s=r.width,a=this.height;break;case t.PdfDockStyle.Right:n=r.width-this.width,o=0,s=this.width,a=r.height;break;case t.PdfDockStyle.Bottom:n=0,o=r.height-this.height,s=r.width,a=this.height;break;case t.PdfDockStyle.Fill:n=0,n=0,s=r.width,a=r.height}return new k(n,o,s,a)},e.prototype.getTemplateDockBounds=function(e,i){this.bounds;var r=e.section,n=r.getActualBounds(i,e,!1),o=r.pageSettings.getActualSize(),s=this.x,a=this.y,h=this.width,l=this.height;switch(this.dockStyle){case t.PdfDockStyle.Left:s=-n.x,a=0,h=this.width,l=n.height;break;case t.PdfDockStyle.Top:s=-n.x,a=-n.y,h=o.width,l=this.height,n.height<0&&(a=-n.y+o.height);break;case t.PdfDockStyle.Right:s=n.width+r.getRightIndentWidth(i,e,!1)-this.width,a=0,h=this.width,l=n.height;break;case t.PdfDockStyle.Bottom:s=-n.x,a=n.height+r.getBottomIndentHeight(i,e,!1)-this.height,h=o.width,l=this.height,n.height<0&&(a-=o.height);break;case t.PdfDockStyle.Fill:s=0,s=0,h=n.width,l=n.height}return new k(s,a,h,l)},e}();return t.PdfAction=B,t.PdfUriAction=x,t.PdfActionLinkAnnotation=Ve,t.PdfAnnotation=Le,t.PdfAnnotationCollection=le,t.PdfDocumentLinkAnnotation=Ne,t.PdfLinkAnnotation=je,t.PdfTextWebLink=Je,t.PdfUriAnnotation=Ye,t.Dictionary=n,t.defaultToString=r,t.PdfCatalog=U,t.PdfDocument=Ce,t.PdfDocumentBase=_,t.PdfDocumentTemplate=fe,t.PdfPageNumberField=ii,t.PdfCompositeField=ni,t.PdfPageCountField=hi,t.PointF=T,t.SizeF=j,t.RectangleF=k,t.Rectangle=V,t.PdfCacheCollection=Pe,t.PdfCollection=oe,t.PdfDestination=ui,t.PdfFunction=ci,t.PdfSampledFunction=di,t.ProcedureSets=it,t.PdfColor=L,t.PdfGraphics=te,t.GetResourceEventHandler=ee,t.PdfGraphicsState=ie,t.PdfMargins=J,t.PdfPen=Q,t.PdfResources=Jt,t.Guid=Zt,t.PdfTransformationMatrix=tt,t.Matrix=et,t.PdfBrush=R,t.PdfBrushes=yi,t.PdfSolidBrush=A,t.PdfLinearGradientBrush=vi,t.PdfRadialGradientBrush=Bi,t.PdfTilingBrush=Qt,t.PdfGradientBrush=qt,t.PdfColorBlend=Si,t.PdfBlend=bi,t.PdfTemplate=Yt,t.PdfLayoutElement=Ge,t.PdfPath=hr,t.PdfArc=fr,t.PdfTextElement=Ue,t.ElementLayouter=Ae,t.PdfLayoutFormat=De,t.PdfLayoutParams=Me,t.PdfLayoutResult=Ie,t.TextLayouter=We,t.TextPageLayoutResult=He,t.PdfTextLayoutResult=_e,t.PdfFont=G,t.PdfFontMetrics=It,t.WidthTable=Ft,t.StandardWidthTable=Et,t.PdfStandardFont=xe,t.PdfStandardFontMetricsFactory=Be,t.PdfStringFormat=D,t.PdfStringLayouter=I,t.PdfStringLayoutResult=F,t.LineInfo=E,t.StringTokenizer=M,t.PdfTrueTypeFont=mr,t.RtlRenderer=Kt,t.ArabicShapeRenderer=zt,t.ArabicShape=Wt,t.Bidi=Ht,t.RtlCharacters=_t,t.ByteArray=ut,t.ImageDecoder=pt,t.PdfBitmap=mt,t.PdfImage=ft,t.PdfTransparency=nt,t.PdfCrossTable=q,t.RegisteredObject=Y,t.DictionaryProperties=a,t.PdfMainObjectCollection=W,t.ObjectInfo=H,t.Operators=s,t.PdfStreamWriter=$,t.PdfWriter=z,t.PageAddedEventArgs=pe,t.PdfDocumentPageCollection=Se,t.PdfPage=ce,t.PdfPageBase=he,t.PdfPageLayer=ne,t.PdfPageLayerCollection=ae,t.PdfPageSettings=Z,t.PdfPageSize=X,t.PdfPageTemplateElement=yr,t.PdfSection=ye,t.PageSettingsState=be,t.PdfSectionCollection=we,t.PdfSectionPageCollection=de,t.PdfSectionTemplate=me,t.PdfArray=m,t.PdfDictionary=h,t.SaveSectionCollectionEventHandler=l,t.SaveDescendantFontEventHandler=u,t.SaveFontDictionaryEventHandler=c,t.SaveAnnotationEventHandler=p,t.SaveSectionEventHandler=d,t.SaveTemplateEventHandler=f,t.PdfName=o,t.PdfNumber=g,t.PdfReference=v,t.PdfReferenceHolder=C,t.PdfStream=b,t.SaveCmapEventHandler=w,t.SaveFontProgramEventHandler=S,t.PdfString=P,t.PdfGridStyleBase=xi,t.PdfGridStyle=Li,t.PdfGridCellStyle=Ti,t.PdfGridRowStyle=ji,t.PdfBorders=Fe,t.PdfPaddings=Ee,t.PdfGridLayouter=Gi,t.PdfGridLayoutResult=zi,t.PdfGridLayoutFormat=Wi,t.GridCellEventArgs=Hi,t.PdfGridBeginCellDrawEventArgs=_i,t.PdfGridEndCellDrawEventArgs=Ki,t.PdfCancelEventArgs=Ui,t.BeginPageLayoutEventArgs=qi,t.EndPageLayoutEventArgs=Yi,t.PdfGridBeginPageLayoutEventArgs=Xi,t.PdfGridEndPageLayoutEventArgs=Ji,t.RowLayoutResult=Zi,t.PdfGrid=Fi,t.PdfGridColumn=Ri,t.PdfGridColumnCollection=Ni,t.PdfGridRow=Ai,t.PdfGridRowCollection=Di,t.PdfGridHeaderCollection=Mi,t.PdfGridCell=ki,t.PdfGridCellCollection=Vi,t}({},ej.compression,ej.fileutils),this.ejs=ej;
- /*!
- * filename: ej2-documenteditor.min.js
- * version : 19.2.46
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.documenteditor=function(e,t,i,n,r,o,s,a,l,d,h,c,p,g){"use strict";var u=function(){function e(){this.keysInternal=[],this.valuesInternal=[]}return Object.defineProperty(e.prototype,"length",{get:function(){return this.keysInternal.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keys",{get:function(){return this.keysInternal},enumerable:!0,configurable:!0}),e.prototype.add=function(e,i){if(t.isNullOrUndefined(e))throw new ReferenceError("Provided key or value is not valid.");return this.keysInternal.indexOf(e)<0&&(this.keysInternal.push(e),this.valuesInternal.push(i)),1},e.prototype.get=function(e){if(t.isNullOrUndefined(e))throw new ReferenceError("Provided key is not valid.");var i=this.keysInternal.indexOf(e);return i<0||i>this.keysInternal.length-1?void 0:this.valuesInternal[i]},e.prototype.set=function(e,i){if(t.isNullOrUndefined(e))throw new ReferenceError("Provided key is not valid.");var n=this.keysInternal.indexOf(e);if(n<0||n>this.keysInternal.length-1)throw new RangeError("No item with the specified key has been added.");this.valuesInternal[n]=i},e.prototype.remove=function(e){if(t.isNullOrUndefined(e))throw new ReferenceError("Provided key is not valid.");var i=this.keysInternal.indexOf(e);if(i<0||i>this.keysInternal.length-1)throw new RangeError("No item with the specified key has been added.");return this.keysInternal.splice(i,1),this.valuesInternal.splice(i,1),!0},e.prototype.containsKey=function(e){if(t.isNullOrUndefined(e))throw new ReferenceError("Provided key is not valid.");var i=this.keysInternal.indexOf(e);return!(i<0||i>this.keysInternal.length-1)},e.prototype.clear=function(){this.keysInternal=[],this.valuesInternal=[]},e.prototype.destroy=function(){this.clear(),this.keysInternal=void 0,this.valuesInternal=void 0},e}(),m=function(){function e(e){this.referenceCount=0,this.uniqueFormatType=e,this.propertiesHash=new u}return e.prototype.isEqual=function(e,t,i){var n=!1;switch(this.uniqueFormatType){case 1:n=this.isBorderEqual(e,t,i);break;case 2:n=this.isCharacterFormatEqual(e,t,i);break;case 3:n=this.isParagraphFormatEqual(e,t,i);break;case 4:n=this.isCellFormatEqual(e,t,i);break;case 5:n=this.isShadingEqual(e,t,i);break;case 6:n=this.isRowFormatEqual(e,t,i);break;case 7:n=this.isListFormatEqual(e,t,i);break;case 8:n=this.isTableFormatEqual(e,t,i);break;case 9:n=this.isListLevelEqual(e,t,i);break;case 10:n=this.isSectionFormatEqual(e,t,i)}return n},e.prototype.isNotEqual=function(i,n,r,o,s){var a=void 0,l=e.getPropertyType(s,i);this.propertiesHash.containsKey(l)&&(a=this.propertiesHash.get(l));var d=void 0;return i===r?d=o:n.containsKey(l)&&(d=n.get(l)),!(a===d||!t.isNullOrUndefined(a)&&!t.isNullOrUndefined(d)&&a===d)},e.getPropertyType=function(e,t){var i=0;switch(e){case 1:i=this.getBorderPropertyType(t);break;case 2:i=this.getCharacterFormatPropertyType(t);break;case 3:i=this.getParaFormatPropertyType(t);break;case 4:i=this.getCellFormatPropertyType(t);break;case 5:i=this.getShadingPropertyType(t);break;case 6:i=this.getRowFormatType(t);break;case 7:i=this.getListFormatType(t);break;case 8:i=this.getTableFormatType(t);break;case 9:i=this.getListLevelType(t);break;case 10:i=this.getSectionFormatType(t)}return i},e.getRowFormatType=function(e){return"allowBreakAcrossPages"===e?1:"isHeader"===e?2:"height"===e?3:"heightType"===e?4:"gridBefore"===e?5:"gridBeforeWidth"===e?6:"gridBeforeWidthType"===e?7:"gridAfter"===e?8:"gridAfterWidth"===e?9:"gridAfterWidthType"===e?10:"leftMargin"===e?11:"topMargin"===e?12:"bottomMargin"===e?13:"rightMargin"===e?14:"leftIndent"===e?15:0},e.getListFormatType=function(e){return"listId"===e?1:"listLevelNumber"===e?2:0},e.getTableFormatType=function(e){return"leftMargin"===e?1:"rightMargin"===e?2:"topMargin"===e?3:"bottomMargin"===e?4:"cellSpacing"===e?5:"leftIndent"===e?6:"tableAlignment"===e?7:"preferredWidth"===e?8:"preferredWidthType"===e?9:"bidi"===e?10:"allowAutoFit"===e?11:"horizontalPositionAbs"===e?12:"horizontalPosition"===e?13:0},e.getListLevelType=function(e){return"listLevelPattern"===e?1:"startAt"===e?2:"followCharacter"===e?3:"numberFormat"===e?4:"restartLevel"===e?5:0},e.getShadingPropertyType=function(e){return"backgroundColor"===e?1:"foregroundColor"===e?2:"textureStyle"===e?3:0},e.getCellFormatPropertyType=function(e){return"leftMargin"===e?1:"rightMargin"===e?2:"topMargin"===e?3:"bottomMargin"===e?4:"columnSpan"===e?5:"rowSpan"===e?6:"verticalAlignment"===e?7:"preferredWidthType"===e?8:"preferredWidth"===e?9:"cellWidth"===e?10:0},e.getBorderPropertyType=function(e){return"color"===e?1:"lineStyle"===e?2:"lineWidth"===e?3:"shadow"===e?4:"space"===e?5:"hasNoneStyle"===e?6:0},e.getCharacterFormatPropertyType=function(e){return"fontColor"===e?1:"fontFamily"===e?2:"fontSize"===e?3:"bold"===e?4:"italic"===e?5:"underline"===e?6:"strikethrough"===e?7:"baselineAlignment"===e?8:"highlightColor"===e?9:"bidi"===e?10:"bdo"===e?11:"boldBidi"===e?12:"italicBidi"===e?13:"fontFamilyBidi"===e?14:"fontSizeBidi"===e?15:"allCaps"===e?16:0},e.getParaFormatPropertyType=function(e){return"leftIndent"===e?1:"rightIndent"===e?2:"firstLineIndent"===e?3:"textAlignment"===e?4:"beforeSpacing"===e?5:"afterSpacing"===e?6:"lineSpacing"===e?7:"lineSpacingType"===e?8:"outlineLevel"===e?9:"bidi"===e?10:"contextualSpacing"===e?11:0},e.getSectionFormatType=function(e){return"headerDistance"===e?1:"footerDistance"===e?2:"differentFirstPage"===e?3:"differentOddAndEvenPages"===e?4:"pageWidth"===e?5:"pageHeight"===e?6:"leftMargin"===e?7:"topMargin"===e?8:"rightMargin"===e?9:"bottomMargin"===e?10:"bidi"===e?11:"restartPageNumbering"===e?12:"pageStartingNumber"===e?13:"endnoteNumberFormat"===e?14:"endnotePosition"===e?15:"footNoteNumberFormat"===e?16:"footnotePosition"===e?17:"restartIndexForEndnotes"===e?18:"restartIndexForFootnotes"===e?19:"initialFootNoteNumber"===e?20:"initialEndNoteNumber"===e?21:0},e.prototype.isBorderEqual=function(e,t,i){return!this.isNotEqual("color",e,t,i,1)&&(!this.isNotEqual("lineStyle",e,t,i,1)&&(!this.isNotEqual("lineWidth",e,t,i,1)&&(!this.isNotEqual("shadow",e,t,i,1)&&(!this.isNotEqual("space",e,t,i,1)&&!this.isNotEqual("hasNoneStyle",e,t,i,1)))))},e.prototype.isCharacterFormatEqual=function(e,t,i){return!this.isNotEqual("fontColor",e,t,i,2)&&(!this.isNotEqual("fontFamily",e,t,i,2)&&(!this.isNotEqual("fontSize",e,t,i,2)&&(!this.isNotEqual("bold",e,t,i,2)&&(!this.isNotEqual("italic",e,t,i,2)&&(!this.isNotEqual("underline",e,t,i,2)&&(!this.isNotEqual("strikethrough",e,t,i,2)&&(!this.isNotEqual("baselineAlignment",e,t,i,2)&&(!this.isNotEqual("highlightColor",e,t,i,2)&&(!this.isNotEqual("bidi",e,t,i,2)&&(!this.isNotEqual("bdo",e,t,i,2)&&(!this.isNotEqual("fontColor",e,t,i,2)&&(!this.isNotEqual("fontFamilyBidi",e,t,i,2)&&(!this.isNotEqual("fontSizeBidi",e,t,i,2)&&(!this.isNotEqual("boldBidi",e,t,i,2)&&(!this.isNotEqual("italicBidi",e,t,i,2)&&!this.isNotEqual("allCaps",e,t,i,2))))))))))))))))},e.prototype.isParagraphFormatEqual=function(e,t,i){return!this.isNotEqual("leftIndent",e,t,i,3)&&(!this.isNotEqual("rightIndent",e,t,i,3)&&(!this.isNotEqual("firstLineIndent",e,t,i,3)&&(!this.isNotEqual("textAlignment",e,t,i,3)&&(!this.isNotEqual("beforeSpacing",e,t,i,3)&&(!this.isNotEqual("afterSpacing",e,t,i,3)&&(!this.isNotEqual("lineSpacing",e,t,i,3)&&(!this.isNotEqual("lineSpacingType",e,t,i,3)&&(!this.isNotEqual("outlineLevel",e,t,i,3)&&(!this.isNotEqual("bidi",e,t,i,3)&&!this.isNotEqual("contextualSpacing",e,t,i,3))))))))))},e.prototype.isCellFormatEqual=function(e,t,i){return!this.isNotEqual("leftMargin",e,t,i,4)&&(!this.isNotEqual("rightMargin",e,t,i,4)&&(!this.isNotEqual("topMargin",e,t,i,4)&&(!this.isNotEqual("bottomMargin",e,t,i,4)&&(!this.isNotEqual("columnSpan",e,t,i,4)&&(!this.isNotEqual("rowSpan",e,t,i,4)&&(!this.isNotEqual("verticalAlignment",e,t,i,4)&&(!this.isNotEqual("preferredWidthType",e,t,i,4)&&(!this.isNotEqual("preferredWidth",e,t,i,4)&&!this.isNotEqual("cellWidth",e,t,i,4)))))))))},e.prototype.isShadingEqual=function(e,t,i){return!this.isNotEqual("backgroundColor",e,t,i,5)&&(!this.isNotEqual("foregroundColor",e,t,i,5)&&!this.isNotEqual("textureStyle",e,t,i,5))},e.prototype.isRowFormatEqual=function(e,t,i){return!this.isNotEqual("allowBreakAcrossPages",e,t,i,6)&&(!this.isNotEqual("isHeader",e,t,i,6)&&(!this.isNotEqual("height",e,t,i,6)&&(!this.isNotEqual("heightType",e,t,i,6)&&(!this.isNotEqual("gridBefore",e,t,i,6)&&(!this.isNotEqual("gridBeforeWidth",e,t,i,6)&&(!this.isNotEqual("gridBeforeWidthType",e,t,i,6)&&(!this.isNotEqual("gridAfter",e,t,i,6)&&(!this.isNotEqual("gridAfterWidth",e,t,i,6)&&(!this.isNotEqual("gridAfterWidthType",e,t,i,6)&&(!this.isNotEqual("leftMargin",e,t,i,6)&&(!this.isNotEqual("topMargin",e,t,i,6)&&(!this.isNotEqual("bottomMargin",e,t,i,6)&&(!this.isNotEqual("rightMargin",e,t,i,6)&&!this.isNotEqual("leftIndent",e,t,i,6))))))))))))))},e.prototype.isListFormatEqual=function(e,t,i){return!this.isNotEqual("listId",e,t,i,7)&&!this.isNotEqual("listLevelNumber",e,t,i,7)},e.prototype.isTableFormatEqual=function(e,t,i){return!this.isNotEqual("leftMargin",e,t,i,8)&&(!this.isNotEqual("rightMargin",e,t,i,8)&&(!this.isNotEqual("topMargin",e,t,i,8)&&(!this.isNotEqual("bottomMargin",e,t,i,8)&&(!this.isNotEqual("cellSpacing",e,t,i,8)&&(!this.isNotEqual("leftIndent",e,t,i,8)&&(!this.isNotEqual("tableAlignment",e,t,i,8)&&(!this.isNotEqual("preferredWidth",e,t,i,8)&&(!this.isNotEqual("preferredWidthType",e,t,i,8)&&(!this.isNotEqual("bidi",e,t,i,8)&&(!this.isNotEqual("allowAutoFit",e,t,i,8)&&(!this.isNotEqual("horizontalPositionAbs",e,t,i,8)&&!this.isNotEqual("horizontalPosition",e,t,i,8))))))))))))},e.prototype.isListLevelEqual=function(e,t,i){return!this.isNotEqual("listLevelPattern",e,t,i,9)&&(!this.isNotEqual("startAt",e,t,i,9)&&(!this.isNotEqual("followCharacter",e,t,i,9)&&(!this.isNotEqual("numberFormat",e,t,i,9)&&!this.isNotEqual("restartLevel",e,t,i,9))))},e.prototype.isSectionFormatEqual=function(e,t,i){return!this.isNotEqual("headerDistance",e,t,i,10)&&(!this.isNotEqual("footerDistance",e,t,i,10)&&(!this.isNotEqual("differentFirstPage",e,t,i,10)&&(!this.isNotEqual("differentOddAndEvenPages",e,t,i,10)&&(!this.isNotEqual("pageWidth",e,t,i,10)&&(!this.isNotEqual("pageHeight",e,t,i,10)&&(!this.isNotEqual("leftMargin",e,t,i,10)&&(!this.isNotEqual("topMargin",e,t,i,10)&&(!this.isNotEqual("rightMargin",e,t,i,10)&&(!this.isNotEqual("bottomMargin",e,t,i,10)&&(!this.isNotEqual("bidi",e,t,i,10)&&(!this.isNotEqual("restartPageNumbering",e,t,i,10)&&(!this.isNotEqual("pageStartingNumber",e,t,i,10)&&(!this.isNotEqual("endnoteNumberFormat",e,t,i,10)&&(!this.isNotEqual("endnotePosition",e,t,i,10)&&(!this.isNotEqual("footNoteNumberFormat",e,t,i,10)&&(!this.isNotEqual("footnotePosition",e,t,i,10)&&(!this.isNotEqual("restartIndexForEndnotes",e,t,i,10)&&(!this.isNotEqual("restartIndexForFootnotes",e,t,i,10)&&(!this.isNotEqual("initialFootNoteNumber",e,t,i,10)&&!this.isNotEqual("initialEndNoteNumber",e,t,i,10))))))))))))))))))))},e.prototype.cloneItems=function(t,i,n,r){for(var o=e.getPropertyType(r,i),s=t.propertiesHash.keys,a=0;a<s.length;a++)s[a]===o?this.propertiesHash.add(o,n):this.propertiesHash.add(s[a],t.propertiesHash.get(s[a]));t.propertiesHash.containsKey(o)||this.propertiesHash.add(o,n)},e.prototype.mergeProperties=function(e){for(var t=e.cloneProperties(),i=this.propertiesHash.keys,n=0;n<i.length;n++)t.containsKey(i[n])||t.add(i[n],this.propertiesHash.get(i[n]));return t},e.prototype.cloneProperties=function(){for(var e=new u,t=this.propertiesHash.keys,i=0;i<t.length;i++)e.add(t[i],this.propertiesHash.get(t[i]));return e},e.prototype.destroy=function(){t.isNullOrUndefined(this.propertiesHash)||this.propertiesHash.destroy(),this.propertiesHash=void 0,this.referenceCount=void 0,this.uniqueFormatType=void 0},e}(),f=function(){function e(){this.items=[]}return e.prototype.addUniqueFormat=function(e,i){for(var n=void 0,r=0;r<this.items.length;r++)if(this.items[r].isEqual(e,void 0,void 0)){n=this.items[r];break}return t.isNullOrUndefined(n)?((n=new m(i)).propertiesHash=e,n.referenceCount=1,this.items.push(n)):n.referenceCount++,n},e.prototype.updateUniqueFormat=function(e,i,n){for(var r=void 0,o=0;o<this.items.length;o++)if(this.items[o].isEqual(e.propertiesHash,i,n)){r=this.items[o];break}return t.isNullOrUndefined(r)?((r=new m(e.uniqueFormatType)).cloneItems(e,i,n,e.uniqueFormatType),r.referenceCount=1,this.items.push(r)):r.referenceCount++,this.remove(e),e=void 0,r},e.prototype.remove=function(e){--e.referenceCount<=0&&(this.items.splice(this.items.indexOf(e),1),e.destroy(),e=void 0)},e.prototype.clear=function(){if(t.isNullOrUndefined(this.items))for(var e=0;e<this.items.length;e++)this.items[e].destroy();this.items=[]},e.prototype.destroy=function(){this.clear(),this.items=void 0},e}(),v=function(){function e(){this.mode=!0}return e.prototype.send=function(e){var t=this;this.xmlHttpRequest=new XMLHttpRequest,this.xmlHttpRequest.onreadystatechange=function(){t.stateChange(t)},this.xmlHttpRequest.onerror=function(){t.error(t)},this.mode?this.sendRequest(e):setTimeout(function(){t.sendRequest(e)})},e.prototype.sendRequest=function(e){this.xmlHttpRequest.open("POST",this.url,!0),this.contentType&&this.xmlHttpRequest.setRequestHeader("Content-Type",this.contentType),this.setCustomAjaxHeaders(),this.responseType&&(this.xmlHttpRequest.responseType=this.responseType);var t=e instanceof FormData?e:JSON.stringify(e);this.xmlHttpRequest.send(t)},e.prototype.stateChange=function(e){if(4===e.xmlHttpRequest.readyState&&200===e.xmlHttpRequest.status){var t=void 0,i={name:"onSuccess",data:t=this.responseType?e.xmlHttpRequest.response:e.xmlHttpRequest.responseText,readyState:e.xmlHttpRequest.readyState,status:e.xmlHttpRequest.status};e.successHandler(i)}else if(4===e.xmlHttpRequest.readyState&&200!==e.xmlHttpRequest.status){i={name:"onFailure",status:e.xmlHttpRequest.status,statusText:e.xmlHttpRequest.statusText,url:e.url};e.failureHandler(i)}},e.prototype.error=function(e){var t={name:"onError",status:this.xmlHttpRequest.status,statusText:this.xmlHttpRequest.statusText};e.errorHandler(t)},e.prototype.successHandler=function(e){return this.onSuccess&&this.onSuccess(e),e},e.prototype.failureHandler=function(e){return this.onFailure&&this.onFailure(e),e},e.prototype.errorHandler=function(e){return this.onError&&this.onError(e),e},e.prototype.setCustomAjaxHeaders=function(){for(var e=0;e<this.customHeaders.length;e++)for(var t=this.customHeaders[e],i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];this.xmlHttpRequest.setRequestHeader(r,t[r])}},e}(),y="afterFormFieldFill",b="beforeFormFieldFill",w="keyDown",C=function(){function e(){}return e.prototype.getModuleName=function(){return"Print"},e.prototype.print=function(e,t){this.printWindow(e,navigator.userAgent,t)},e.prototype.printWindow=function(e,i,n){var r=this.getPageHeight(e.pages),o=this.getPageWidth(e.pages),s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.overflow="scroll",this.generatePrintContent(e,s),t.isNullOrUndefined(n)&&(n=window.open("","print","height=452,width=1024,tabbar=no")),-1!==i.indexOf("Chrome")||-1!==i.indexOf("Firefox")?(n.document.write("<!DOCTYPE html>"),n.document.write("<html moznomarginboxes mozdisallowselectionprint><head><style>html, body { height: 100 %; } img { height: 100 %; width: 100 %; display: block;}img { box-sizing: border-box; }br, button { display: none; }@page{ margin: 0cm; size:"+o.toString()+"px "+r.toString()+"px; }@media print{ body { margin: 0cm; }</style></head> <body><center>")):n.document.write("<html><head><style>@page{margin:0;size:"+o.toString()+"px "+r.toString()+"px;}</style></head><body><center>"),n.document.write(s.innerHTML+"</center><script> (function() { window.ready = true; })(); <\/script></body></html>"),s=void 0,n.document.close(),n.focus();var a=setInterval(function(){n.ready&&(n.print(),n.close(),clearInterval(a))},500)},e.prototype.exportAsImage=function(e,i,n){var r;if(!t.isNullOrUndefined(i)&&i<=e.pages.length&&i>=1){var o=e.pages[i-1],s=o.boundingRectangle.height,a=o.boundingRectangle.width;e.render.isPrinting=!0,e.render.renderWidgets(o,0,0,0,0);var l=e.render.pageCanvas.toDataURL(n,1);e.render.isPrinting=!1,(r=new Image).src=l,r.setAttribute("style","margin:0px;display:block;width:"+a.toString()+"px;height:"+s.toString()+"px;")}return r},e.prototype.generateDoumentImages=function(e,i){var n;if(!t.isNullOrUndefined(i)&&i<=e.pages.length&&i>=1){var r=e.pages[i-1],o=r.boundingRectangle.height,s=r.boundingRectangle.width;e.render.isPrinting=!0,e.render.renderWidgets(r,0,0,0,0);var a=e.render.pageCanvas.toDataURL("image/jpeg");e.render.isPrinting=!1,(n=new Image).src=a,n.setAttribute("style","margin:0px;display:block;width:"+s.toString()+"px;height:"+o.toString()+"px;")}return n},e.prototype.generatePrintContent=function(e,t){for(var i="",n=0;n<e.pages.length;n++){var r=e.pages[n],o=r.boundingRectangle.height,s=r.boundingRectangle.width;e.render.isPrinting=!0,e.render.renderWidgets(r,0,0,0,0);var a=e.render.pageCanvas.toDataURL();e.render.isPrinting=!1,i+="<div><img src="+a+' style="margin:0px;display:block;width: '+s.toString()+"px; height:"+o.toString()+'px; "/></div><br/>'}t.innerHTML=i},e.prototype.getPageWidth=function(e){for(var t=0,i=0;i<e.length;i++)t<e[i].boundingRectangle.width&&(t=e[i].boundingRectangle.width);return t},e.prototype.getPageHeight=function(e){for(var t=0,i=0;i<e.length;i++)t<e[i].boundingRectangle.height&&(t=e[i].boundingRectangle.height);return t},e.prototype.destroy=function(){},e}(),x=function(){function e(e){this.uniqueSectionFormat=void 0,this.ownerBase=e}return Object.defineProperty(e.prototype,"headerDistance",{get:function(){return this.getPropertyValue("headerDistance")},set:function(e){this.setPropertyValue("headerDistance",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footerDistance",{get:function(){return this.getPropertyValue("footerDistance")},set:function(e){this.setPropertyValue("footerDistance",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"differentFirstPage",{get:function(){return this.getPropertyValue("differentFirstPage")},set:function(e){this.setPropertyValue("differentFirstPage",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"differentOddAndEvenPages",{get:function(){return this.getPropertyValue("differentOddAndEvenPages")},set:function(e){this.setPropertyValue("differentOddAndEvenPages",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageHeight",{get:function(){return this.getPropertyValue("pageHeight")},set:function(e){this.setPropertyValue("pageHeight",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageWidth",{get:function(){return this.getPropertyValue("pageWidth")},set:function(e){this.setPropertyValue("pageWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartPageNumbering",{get:function(){return this.getPropertyValue("restartPageNumbering")},set:function(e){this.setPropertyValue("restartPageNumbering",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageStartingNumber",{get:function(){return this.getPropertyValue("pageStartingNumber")},set:function(e){this.setPropertyValue("pageStartingNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endnoteNumberFormat",{get:function(){return this.getPropertyValue("endnoteNumberFormat")},set:function(e){this.setPropertyValue("endnoteNumberFormat",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartIndexForEndnotes",{get:function(){return this.getPropertyValue("restartIndexForEndnotes")},set:function(e){this.setPropertyValue("restartIndexForEndnotes",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartIndexForFootnotes",{get:function(){return this.getPropertyValue("restartIndexForFootnotes")},set:function(e){this.setPropertyValue("restartIndexForFootnotes",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footNoteNumberFormat",{get:function(){return this.getPropertyValue("footNoteNumberFormat")},set:function(e){this.setPropertyValue("footNoteNumberFormat",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialFootNoteNumber",{get:function(){return this.getPropertyValue("initialFootNoteNumber")},set:function(e){this.setPropertyValue("initialFootNoteNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialEndNoteNumber",{get:function(){return this.getPropertyValue("initialEndNoteNumber")},set:function(e){this.setPropertyValue("initialEndNoteNumber",e)},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.isNullOrUndefined(this.uniqueSectionFormat)||e.uniqueSectionFormats.remove(this.uniqueSectionFormat),this.uniqueSectionFormat=void 0},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueSectionFormat)){var i=m.getPropertyType(this.uniqueSectionFormat.uniqueFormatType,e);return this.uniqueSectionFormat.propertiesHash.containsKey(i)}return!1},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"headerDistance":case"footerDistance":t=36;break;case"differentFirstPage":case"differentOddAndEvenPages":t=!1;break;case"pageWidth":t=612;break;case"pageHeight":t=792;break;case"leftMargin":case"topMargin":case"rightMargin":case"bottomMargin":t=72;break;case"bidi":case"restartPageNumbering":t=!1;break;case"pageStartingNumber":t=1;break;case"footnotePosition":t="PrintAtBottomOfPage";break;case"endnoteNumberFormat":t="LowerCaseRoman";break;case"endnotePosition":t="DisplayEndOfDocument";break;case"restartIndexForEndnotes":case"restartIndexForFootnotes":t="DoNotRestart";break;case"footNoteNumberFormat":t="Arabic";break;case"initialFootNoteNumber":case"initialEndNoteNumber":t=1}return t},e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var n=m.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueSectionFormat)&&this.uniqueSectionFormat.propertiesHash.containsKey(n))return this.uniqueSectionFormat.propertiesHash.get(n)}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,n){if((t.isNullOrUndefined(n)||""===n)&&(n=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueSectionFormat))this.initializeUniqueSectionFormat(i,n);else{var r=m.getPropertyType(this.uniqueSectionFormat.uniqueFormatType,i);if(this.uniqueSectionFormat.propertiesHash.containsKey(r)&&this.uniqueSectionFormat.propertiesHash.get(r)===n)return;this.uniqueSectionFormat=e.uniqueSectionFormats.updateUniqueFormat(this.uniqueSectionFormat,i,n)}},e.prototype.initializeUniqueSectionFormat=function(t,i){var n=new u;this.addUniqueSectionFormat("headerDistance",t,i,n),this.addUniqueSectionFormat("footerDistance",t,i,n),this.addUniqueSectionFormat("differentFirstPage",t,i,n),this.addUniqueSectionFormat("differentOddAndEvenPages",t,i,n),this.addUniqueSectionFormat("pageWidth",t,i,n),this.addUniqueSectionFormat("pageHeight",t,i,n),this.addUniqueSectionFormat("leftMargin",t,i,n),this.addUniqueSectionFormat("topMargin",t,i,n),this.addUniqueSectionFormat("rightMargin",t,i,n),this.addUniqueSectionFormat("bottomMargin",t,i,n),this.addUniqueSectionFormat("bidi",t,i,n),this.addUniqueSectionFormat("restartPageNumbering",t,i,n),this.addUniqueSectionFormat("pageStartingNumber",t,i,n),this.addUniqueSectionFormat("endnoteNumberFormat",t,i,n),this.addUniqueSectionFormat("endnotePosition",t,i,n),this.addUniqueSectionFormat("footNoteNumberFormat",t,i,n),this.addUniqueSectionFormat("footnotePosition",t,i,n),this.addUniqueSectionFormat("restartIndexForEndnotes",t,i,n),this.addUniqueSectionFormat("restartIndexForFootnotes",t,i,n),this.addUniqueSectionFormat("initialFootNoteNumber",t,i,n),this.addUniqueSectionFormat("initialEndNoteNumber",t,i,n),this.uniqueSectionFormat=e.uniqueSectionFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.addUniqueSectionFormat=function(t,i,n,r){var o=m.getPropertyType(e.uniqueFormatType,t);t===i?r.add(o,n):r.add(o,e.getPropertyDefaultValue(t))},e.prototype.copyFormat=function(e,i){i&&(i.isUndoing||i.isRedoing)?this.uniqueSectionFormat=e.uniqueSectionFormat:t.isNullOrUndefined(e)||!t.isNullOrUndefined(e.uniqueSectionFormat)&&e.uniqueSectionFormat.propertiesHash&&this.updateUniqueSectionFormat(e)},e.prototype.updateUniqueSectionFormat=function(i){var n=void 0;this.uniqueSectionFormat&&(n=this.uniqueSectionFormat.mergeProperties(i.uniqueSectionFormat),0===this.uniqueSectionFormat.referenceCount&&(e.uniqueSectionFormats.remove(this.uniqueSectionFormat),this.uniqueSectionFormat=void 0)),this.uniqueSectionFormat=new m(e.uniqueFormatType),t.isNullOrUndefined(n)&&(n=this.uniqueSectionFormat.mergeProperties(i.uniqueSectionFormat)),this.uniqueSectionFormat=e.uniqueSectionFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.cloneFormat=function(){var t=new e;return t.uniqueSectionFormat=this.uniqueSectionFormat,t},e.clear=function(){this.uniqueSectionFormats.clear()},e.uniqueSectionFormats=new f,e.uniqueFormatType=10,e}(),F=function(){function e(){}return e.prototype.destroy=function(){t.isNullOrUndefined(this.overrideListLevel)||this.overrideListLevel.destroy(),this.levelNumber=void 0,this.startAt=void 0,this.overrideListLevel=void 0},e.prototype.clone=function(){var i=new e;return i.startAt=this.startAt,i.levelNumber=this.levelNumber,t.isNullOrUndefined(this.overrideListLevel)||(i.overrideListLevel=this.overrideListLevel.clone(i)),i},e}(),P=function(){function e(){this.listId=-1,this.sourceListId=-1,this.abstractListId=-1,this.abstractList=void 0,this.levelOverrides=[]}return e.prototype.getListLevel=function(e){var i=this.getLevelOverride(e);return t.isNullOrUndefined(i)||t.isNullOrUndefined(i.overrideListLevel)?this.abstractList.levels[e]:i.overrideListLevel},e.prototype.getLevelOverride=function(e){for(var t=0;t<this.levelOverrides.length;t++)if(this.levelOverrides[t]instanceof F){var i=this.levelOverrides[t];if(i.levelNumber===e)return i}},e.prototype.destroy=function(){t.isNullOrUndefined(this.levelOverrides)||(this.levelOverrides=[]),this.abstractListId=void 0,this.listId=void 0,this.sourceListId=void 0,this.levelOverrides=void 0},e.prototype.mergeList=function(e){t.isNullOrUndefined(this.abstractListId)||-1===this.abstractListId||(this.abstractListId=e.abstractListId),t.isNullOrUndefined(this.listId)||-1===this.listId||(this.listId=e.listId),t.isNullOrUndefined(this.sourceListId)||-1===this.sourceListId||(this.sourceListId=e.sourceListId),t.isNullOrUndefined(this.levelOverrides)||0===this.levelOverrides.length||(this.levelOverrides=e.levelOverrides)},e.prototype.clone=function(){for(var t=new e,i=0;i<this.levelOverrides.length;i++)t.levelOverrides.push(this.levelOverrides[i].clone());return t},e}(),T=function(){function e(e){this.uniqueListFormat=void 0,this.ownerBase=void 0,this.baseStyle=void 0,this.list=void 0,this.ownerBase=e}return Object.defineProperty(e.prototype,"listId",{get:function(){return this.getPropertyValue("listId")},set:function(e){this.setPropertyValue("listId",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listLevelNumber",{get:function(){return this.getPropertyValue("listLevelNumber")},set:function(e){this.setPropertyValue("listLevelNumber",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listLevel",{get:function(){var e=void 0;if(t.isNullOrUndefined(this.list))for(var i=this.baseStyle;!t.isNullOrUndefined(i);){if(i.paragraphFormat.listFormat.list){e=i.paragraphFormat.listFormat.list;break}i=i.basedOn}else e=this.list;return t.isNullOrUndefined(e)?void 0:e.getListLevel(this.listLevelNumber)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){r=m.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueListFormat)&&this.uniqueListFormat.propertiesHash.containsKey(r))return this.uniqueListFormat.propertiesHash.get(r)}else if(this.baseStyle instanceof U){for(var n=this.baseStyle;!t.isNullOrUndefined(n)&&!n.paragraphFormat.listFormat.hasValue(i);)n=n.basedOn;if(!t.isNullOrUndefined(n)){var r=m.getPropertyType(e.uniqueFormatType,i);return n.paragraphFormat.listFormat.uniqueListFormat.propertiesHash.get(r)}}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,n){if((t.isNullOrUndefined(n)||""===n)&&(n=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueListFormat))this.initializeUniqueListFormat(i,n);else{var r=m.getPropertyType(this.uniqueListFormat.uniqueFormatType,i);if(this.uniqueListFormat.propertiesHash.containsKey(r)&&this.uniqueListFormat.propertiesHash.get(r)===n)return;this.uniqueListFormat=e.uniqueListFormats.updateUniqueFormat(this.uniqueListFormat,i,n)}},e.prototype.initializeUniqueListFormat=function(t,i){var n=new u;this.addUniqueListFormat("listId",t,i,n),this.addUniqueListFormat("listLevelNumber",t,i,n),this.uniqueListFormat=e.uniqueListFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.addUniqueListFormat=function(t,i,n,r){var o=m.getPropertyType(e.uniqueFormatType,t);t===i&&r.add(o,n)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"listId":t=-1;break;case"listLevelNumber":t=0}return t},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.uniqueListFormat)||(this.listId=e.listId,this.listLevelNumber=e.listLevelNumber),t.isNullOrUndefined(e.baseStyle)||(this.baseStyle=e.baseStyle),t.isNullOrUndefined(e.list)||(this.list=e.list))},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueListFormat)){var i=m.getPropertyType(this.uniqueListFormat.uniqueFormatType,e);return this.uniqueListFormat.propertiesHash.containsKey(i)}return!1},e.prototype.clearFormat=function(){t.isNullOrUndefined(this.uniqueListFormat)||0!==this.uniqueListFormat.referenceCount||e.uniqueListFormats.remove(this.uniqueListFormat),this.uniqueListFormat=void 0,this.list=void 0},e.prototype.destroy=function(){this.clearFormat()},e.clear=function(){this.uniqueListFormats.clear()},e.prototype.applyStyle=function(e){this.baseStyle=e},e.prototype.getValue=function(e){return this.hasValue(e)?this.getPropertyValue(e):void 0},e.prototype.mergeFormat=function(e){t.isNullOrUndefined(this.getValue("listId"))&&(this.listId=e.getValue("listId")),t.isNullOrUndefined(this.getValue("listLevelNumber"))&&(this.listLevelNumber=e.getValue("listLevelNumber")),t.isNullOrUndefined(e.list)||(t.isNullOrUndefined(this.list)&&(this.list=new P),this.list.mergeList(e.list))},e.prototype.cloneListFormat=function(){var t=new e(void 0);return t.list=this.list,t.listId=this.listId,t.baseStyle=this.baseStyle,t.listLevelNumber=this.listLevelNumber,t.uniqueListFormat=this.uniqueListFormat,t},e.uniqueListFormats=new f,e.uniqueFormatType=7,e}(),S=function(){function e(){}return Object.defineProperty(e.prototype,"position",{get:function(){return this.positionIn},set:function(e){this.positionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"deletePosition",{get:function(){return this.deletePositionIn},set:function(e){this.deletePositionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabJustification",{get:function(){return this.justification},set:function(e){this.justification=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabLeader",{get:function(){return this.leader},set:function(e){this.leader=e},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.position=void 0,this.deletePosition=void 0,this.tabJustification=void 0,this.leader=void 0},e}(),I=function(){function e(e){this.uniqueParagraphFormat=void 0,this.ownerBase=void 0,this.baseStyle=void 0,this.tabs=void 0,this.ownerBase=e,this.listFormat=new T(this),this.tabs=[]}return e.prototype.getUpdatedTabs=function(){var e=[];if(!t.isNullOrUndefined(this.baseStyle)){for(var i=this.baseStyle,n=new u;!t.isNullOrUndefined(i);){for(var r=0,o=i.paragraphFormat.tabs;r<o.length;r++){var s=o[r];n.containsKey(s.position)||n.add(s.position,s)}i=i.basedOn}for(var a=0,l=n.keys;a<l.length;a++){var d=l[a];this.hasTabStop(parseFloat(d.toFixed(4)))||e.push(n.get(d))}e=(e=e.concat(this.tabs.filter(function(e){return 0!==e.position&&0===e.deletePosition}))).sort(function(e,t){return e.position-t.position})}return e},e.prototype.hasTabStop=function(e){for(var t=0;t<this.tabs.length;t++)if(parseFloat(this.tabs[t].position.toFixed(4))===e||parseFloat(this.tabs[t].deletePosition.toFixed(4))===e)return!0;return!1},Object.defineProperty(e.prototype,"leftIndent",{get:function(){return this.getPropertyValue("leftIndent")},set:function(e){this.setPropertyValue("leftIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightIndent",{get:function(){return this.getPropertyValue("rightIndent")},set:function(e){this.setPropertyValue("rightIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLineIndent",{get:function(){return this.getPropertyValue("firstLineIndent")},set:function(e){this.setPropertyValue("firstLineIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"beforeSpacing",{get:function(){return this.getPropertyValue("beforeSpacing")},set:function(e){this.setPropertyValue("beforeSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"afterSpacing",{get:function(){return this.getPropertyValue("afterSpacing")},set:function(e){this.setPropertyValue("afterSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacing",{get:function(){return this.getPropertyValue("lineSpacing")},set:function(e){this.setPropertyValue("lineSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacingType",{get:function(){return this.getPropertyValue("lineSpacingType")},set:function(e){this.setPropertyValue("lineSpacingType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textAlignment",{get:function(){return this.getPropertyValue("textAlignment")},set:function(e){this.setPropertyValue("textAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outlineLevel",{get:function(){return this.getPropertyValue("outlineLevel")},set:function(e){this.setPropertyValue("outlineLevel",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.bidi!==e&&("Left"===this.textAlignment?this.textAlignment="Right":"Right"===this.textAlignment&&(this.textAlignment="Left")),this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contextualSpacing",{get:function(){return this.getPropertyValue("contextualSpacing")},set:function(e){this.setPropertyValue("contextualSpacing",e)},enumerable:!0,configurable:!0}),e.prototype.getListFormatParagraphFormat=function(i){var n=this.getListPargaraphFormat(i);if(!t.isNullOrUndefined(n))return n.uniqueParagraphFormat.propertiesHash.get(m.getPropertyType(e.uniqueFormatType,i))},e.prototype.getListPargaraphFormat=function(i){if(this.listFormat.listId>-1&&this.listFormat.listLevelNumber>-1){var n=this.listFormat.listLevel,r=m.getPropertyType(e.uniqueFormatType,i);return t.isNullOrUndefined(n)||t.isNullOrUndefined(n.paragraphFormat.uniqueParagraphFormat)||!n.paragraphFormat.uniqueParagraphFormat.propertiesHash.containsKey(r)?void 0:n.paragraphFormat}},e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){a=m.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueParagraphFormat)&&this.uniqueParagraphFormat.propertiesHash.containsKey(a))return this.uniqueParagraphFormat.propertiesHash.get(a)}else{var n=this.getListFormatParagraphFormat(i);if(this.baseStyle instanceof U){for(var r=this,o=this.baseStyle;!t.isNullOrUndefined(o);){var s=void 0;if(this.listFormat.hasValue("listId")||(s=o.paragraphFormat.getListPargaraphFormat(i)),o.paragraphFormat.hasValue(i)){r=o.paragraphFormat;break}if(!t.isNullOrUndefined(s)&&s.hasValue(i)){r=s;break}o=o.basedOn}if(!t.isNullOrUndefined(o)){if(!t.isNullOrUndefined(n)&&-1!==this.listFormat.listId&&-1===r.listFormat.listId||!t.isNullOrUndefined(n)&&this.listFormat.listId!==r.listFormat.listId)return n;var a=m.getPropertyType(e.uniqueFormatType,i);return r.uniqueParagraphFormat.propertiesHash.get(a)}}if(!t.isNullOrUndefined(n))return n}return this.getDefaultValue(i)},e.prototype.getDefaultValue=function(i){var n=m.getPropertyType(e.uniqueFormatType,i),r=this.documentParagraphFormat(),o=!0;if(this.ownerBase&&this.ownerBase instanceof we&&(o=this.ownerBase.containerWidget instanceof fe||this.ownerBase.containerWidget instanceof Pe),o&&!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.uniqueParagraphFormat)){var s=r.uniqueParagraphFormat.propertiesHash.get(n);if(!t.isNullOrUndefined(s))return s}return e.getPropertyDefaultValue(i)},e.prototype.documentParagraphFormat=function(){var e;if(!t.isNullOrUndefined(this.ownerBase)){var i=this.ownerBase.bodyWidget;t.isNullOrUndefined(i)||t.isNullOrUndefined(i.page)||(e=i.page.documentHelper.paragraphFormat)}return e},e.prototype.setPropertyValue=function(i,n){if((t.isNullOrUndefined(n)||""===n)&&(n=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueParagraphFormat))this.initializeUniqueParagraphFormat(i,n);else{var r=m.getPropertyType(this.uniqueParagraphFormat.uniqueFormatType,i);if(this.uniqueParagraphFormat.propertiesHash.containsKey(r)&&this.uniqueParagraphFormat.propertiesHash.get(r)===n)return;this.uniqueParagraphFormat=e.uniqueParagraphFormats.updateUniqueFormat(this.uniqueParagraphFormat,i,n)}},e.prototype.initializeUniqueParagraphFormat=function(t,i){var n=new u;this.addUniqueParaFormat("leftIndent",t,i,n),this.addUniqueParaFormat("rightIndent",t,i,n),this.addUniqueParaFormat("firstLineIndent",t,i,n),this.addUniqueParaFormat("textAlignment",t,i,n),this.addUniqueParaFormat("beforeSpacing",t,i,n),this.addUniqueParaFormat("afterSpacing",t,i,n),this.addUniqueParaFormat("lineSpacing",t,i,n),this.addUniqueParaFormat("lineSpacingType",t,i,n),this.addUniqueParaFormat("outlineLevel",t,i,n),this.addUniqueParaFormat("bidi",t,i,n),this.addUniqueParaFormat("contextualSpacing",t,i,n),this.uniqueParagraphFormat=e.uniqueParagraphFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.addUniqueParaFormat=function(t,i,n,r){var o=m.getPropertyType(e.uniqueFormatType,t);t===i&&r.add(o,n)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"leftIndent":case"rightIndent":case"firstLineIndent":t=0;break;case"textAlignment":t="Left";break;case"beforeSpacing":case"afterSpacing":t=0;break;case"lineSpacing":t=1;break;case"lineSpacingType":t="Multiple";break;case"styleName":t="Normal";break;case"outlineLevel":t="BodyText";break;case"bidi":case"contextualSpacing":t=!1}return t},e.prototype.clearFormat=function(){t.isNullOrUndefined(this.listFormat)||this.listFormat.clearFormat(),t.isNullOrUndefined(this.uniqueParagraphFormat)||0!==this.uniqueParagraphFormat.referenceCount||e.uniqueParagraphFormats.remove(this.uniqueParagraphFormat),this.uniqueParagraphFormat=void 0,this.baseStyle=void 0},e.prototype.destroy=function(){if(this.clearFormat(),t.isNullOrUndefined(this.listFormat)||this.listFormat.destroy(),this.listFormat=void 0,void 0!==this.tabs){for(var e=0;e<this.tabs.length;e++)this.tabs[e].destroy();this.tabs=void 0}},e.prototype.copyFormat=function(e){if(!t.isNullOrUndefined(e)&&(t.isNullOrUndefined(e.uniqueParagraphFormat)||this.updateUniqueParagraphFormat(e),t.isNullOrUndefined(e.listFormat)||this.listFormat.copyFormat(e.listFormat),t.isNullOrUndefined(e.baseStyle)||(this.baseStyle=e.baseStyle),!t.isNullOrUndefined(e.tabs)))for(var i=0;i<e.tabs.length;i++)this.tabs[i]=e.tabs[i]},e.prototype.updateUniqueParagraphFormat=function(i){var n=void 0;this.uniqueParagraphFormat&&(n=this.uniqueParagraphFormat.mergeProperties(i.uniqueParagraphFormat),0===this.uniqueParagraphFormat.referenceCount&&(e.uniqueParagraphFormats.remove(this.uniqueParagraphFormat),this.uniqueParagraphFormat=void 0)),this.uniqueParagraphFormat=new m(e.uniqueFormatType),t.isNullOrUndefined(n)&&(n=this.uniqueParagraphFormat.mergeProperties(i.uniqueParagraphFormat)),this.uniqueParagraphFormat=e.uniqueParagraphFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.cloneFormat=function(){var i=new e(void 0);return i.uniqueParagraphFormat=this.uniqueParagraphFormat,i.baseStyle=this.baseStyle,t.isNullOrUndefined(this.listFormat)?i.listFormat=void 0:i.listFormat=this.listFormat.cloneListFormat(),i},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueParagraphFormat)&&!t.isNullOrUndefined(this.uniqueParagraphFormat.propertiesHash)){var i=m.getPropertyType(this.uniqueParagraphFormat.uniqueFormatType,e);return this.uniqueParagraphFormat.propertiesHash.containsKey(i)}return!1},e.clear=function(){this.uniqueParagraphFormats.clear()},e.prototype.applyStyle=function(e){this.baseStyle=e,this.listFormat.applyStyle(this.baseStyle)},e.prototype.getValue=function(e){return this.hasValue(e)?this.getPropertyValue(e):void 0},e.prototype.mergeFormat=function(e,i){i=!t.isNullOrUndefined(i)&&i,t.isNullOrUndefined(this.getValue("leftIndent"))&&(this.leftIndent=e.getValue("leftIndent")),t.isNullOrUndefined(this.getValue("rightIndent"))&&(this.rightIndent=e.getValue("rightIndent")),t.isNullOrUndefined(this.getValue("firstLineIndent"))&&(this.firstLineIndent=e.getValue("firstLineIndent")),t.isNullOrUndefined(this.getValue("beforeSpacing"))&&(this.beforeSpacing=e.getValue("beforeSpacing")),t.isNullOrUndefined(this.getValue("afterSpacing"))&&(this.afterSpacing=e.getValue("afterSpacing")),t.isNullOrUndefined(this.getValue("lineSpacing"))&&(this.lineSpacing=e.getValue("lineSpacing")),t.isNullOrUndefined(this.getValue("lineSpacingType"))&&(this.lineSpacingType=e.getValue("lineSpacingType")),t.isNullOrUndefined(this.getValue("textAlignment"))&&(this.textAlignment=e.getValue("textAlignment")),t.isNullOrUndefined(this.getValue("outlineLevel"))&&(this.outlineLevel=e.getValue("outlineLevel")),!i&&t.isNullOrUndefined(this.getValue("bidi"))&&(this.bidi=e.getValue("bidi")),t.isNullOrUndefined(this.getValue("contextualSpacing"))&&(this.contextualSpacing=e.getValue("contextualSpacing")),t.isNullOrUndefined(this.listFormat)&&this.listFormat.mergeFormat(e.listFormat)},e.uniqueParagraphFormats=new f,e.uniqueFormatType=3,e}(),N=function(){function e(e){this.uniqueBorderFormat=void 0,this.ownerBase=void 0,this.ownerBase=e}return Object.defineProperty(e.prototype,"color",{get:function(){return this.getPropertyValue("color")},set:function(e){this.setPropertyValue("color",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineStyle",{get:function(){return this.getPropertyValue("lineStyle")},set:function(e){this.setPropertyValue("lineStyle",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return this.getPropertyValue("lineWidth")},set:function(e){this.setPropertyValue("lineWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadow",{get:function(){return this.getPropertyValue("shadow")},set:function(e){this.setPropertyValue("shadow",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"space",{get:function(){return this.getPropertyValue("space")},set:function(e){this.setPropertyValue("space",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNoneStyle",{get:function(){return this.getPropertyValue("hasNoneStyle")},set:function(e){this.setPropertyValue("hasNoneStyle",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isBorderDefined",{get:function(){return"None"!==this.lineStyle||this.hasNoneStyle&&this.hasValue("hasNoneStyle")},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var n=m.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueBorderFormat)){var r=this.uniqueBorderFormat.propertiesHash.get(n);if(!t.isNullOrUndefined(r))return r}}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,n){if((t.isNullOrUndefined(n)||""===n)&&(n=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueBorderFormat))this.initializeUniqueBorder(i,n);else{var r=m.getPropertyType(this.uniqueBorderFormat.uniqueFormatType,i);if(this.uniqueBorderFormat.propertiesHash.containsKey(r)&&this.uniqueBorderFormat.propertiesHash.get(r)===n)return;this.uniqueBorderFormat=e.uniqueBorderFormats.updateUniqueFormat(this.uniqueBorderFormat,i,n)}},e.prototype.initializeUniqueBorder=function(t,i){var n=new u;this.addUniqueBorderFormat("color",t,i,n),this.addUniqueBorderFormat("lineStyle",t,i,n),this.addUniqueBorderFormat("lineWidth",t,i,n),this.addUniqueBorderFormat("shadow",t,i,n),this.addUniqueBorderFormat("space",t,i,n),this.addUniqueBorderFormat("hasNoneStyle",t,i,n),this.uniqueBorderFormat=e.uniqueBorderFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.addUniqueBorderFormat=function(t,i,n,r){var o=m.getPropertyType(e.uniqueFormatType,t);t===i&&r.add(o,n)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"color":t="#000000";break;case"lineStyle":t="None";break;case"lineWidth":t=0;break;case"shadow":t=!1;break;case"space":t=0;break;case"hasNoneStyle":t=!1}return t},e.prototype.getLineWidth=function(){switch(this.lineStyle){case"None":case"Cleared":return 0;case"Triple":case"Double":case"ThinThickSmallGap":case"ThickThinSmallGap":case"ThinThickThinSmallGap":case"ThinThickMediumGap":case"ThickThinMediumGap":case"ThinThickThinMediumGap":case"ThinThickLargeGap":case"ThickThinLargeGap":case"ThinThickThinLargeGap":case"Emboss3D":case"Engrave3D":for(var e=this.getBorderLineWidthArray(this.lineStyle,this.lineWidth),t=0,i=0;i<e.length;i++)t+=e[i];return t;case"Single":case"DashLargeGap":case"DashSmallGap":case"Dot":case"DashDot":case"DashDotDot":case"Thick":return this.lineWidth;case"SingleWavy":return 1.5===this.lineWidth?3:2.5;case"DoubleWavy":return 6.75;case"DashDotStroked":case"Outset":return this.lineWidth}return this.lineWidth},e.prototype.getBorderLineWidthArray=function(e,t){var i=[t];switch(e){case"Double":i=[1,1,1];break;case"ThinThickSmallGap":i=[1,-.75,-.75];break;case"ThickThinSmallGap":i=[-.75,-.75,1];break;case"ThinThickMediumGap":i=[1,.5,.5];break;case"ThickThinMediumGap":i=[.5,.5,1];break;case"ThinThickLargeGap":i=[-1.5,1,-.75];break;case"ThickThinLargeGap":i=[-.75,1,-1.5];break;case"Triple":i=[1,1,1,1,1];break;case"ThinThickThinSmallGap":i=[-.75,-.75,1,-.75,-.75];break;case"ThinThickThinMediumGap":i=[.5,.5,1,.5,.5];break;case"ThinThickThinLargeGap":i=[-.75,1,-1.5,1,-.75];break;case"Emboss3D":case"Engrave3D":i=[.25,0,1,0,.25]}if(1===i.length)return[t];for(var n=0;n<i.length;n++)i[n]>=0?i[n]=i[n]*t:i[n]=Math.abs(i[n]);return i},e.prototype.getBorderWeight=function(){var e=0,t=this.getNumberOfLines(),i=this.getBorderNumber();switch(this.lineStyle){case"Single":case"DashSmallGap":case"DashDot":case"DashDotDot":case"Double":case"Triple":case"ThinThickSmallGap":case"ThickThinSmallGap":case"ThinThickThinSmallGap":case"ThinThickMediumGap":case"ThickThinMediumGap":case"ThinThickThinMediumGap":case"ThinThickLargeGap":case"ThickThinLargeGap":case"ThinThickThinLargeGap":case"SingleWavy":case"DoubleWavy":case"DashDotStroked":case"Emboss3D":case"Engrave3D":case"Outset":case"Inset":case"Thick":e=t*i;break;case"Dot":case"DashLargeGap":e=1}return e},e.prototype.getBorderNumber=function(){var e=0;switch(this.lineStyle){case"Single":e=1;break;case"Thick":e=2;break;case"Double":e=3;break;case"Dot":e=4;break;case"DashLargeGap":e=5;break;case"DashDot":e=6;break;case"DashDotDot":e=7;break;case"Triple":e=8;break;case"ThinThickSmallGap":e=9;break;case"ThickThinSmallGap":e=10;break;case"ThinThickThinSmallGap":e=11;break;case"ThinThickMediumGap":e=12;break;case"ThickThinMediumGap":e=13;break;case"ThinThickThinMediumGap":e=14;break;case"ThinThickLargeGap":e=15;break;case"ThickThinLargeGap":e=16;break;case"ThinThickThinLargeGap":e=17;break;case"SingleWavy":e=18;break;case"DoubleWavy":e=19;break;case"DashSmallGap":e=20;break;case"DashDotStroked":e=21;break;case"Emboss3D":e=22;break;case"Engrave3D":e=23;break;case"Outset":e=24;break;case"Inset":e=25}return e},e.prototype.getNumberOfLines=function(){var e=0;switch(this.lineStyle){case"Single":case"Dot":case"DashSmallGap":case"DashLargeGap":case"DashDot":case"DashDotDot":e=1;break;case"Double":e=3;break;case"Triple":e=5;break;case"ThinThickSmallGap":case"ThickThinSmallGap":e=3;break;case"ThinThickThinSmallGap":e=5;break;case"ThinThickMediumGap":case"ThickThinMediumGap":e=3;break;case"ThinThickThinMediumGap":e=5;break;case"ThinThickLargeGap":case"ThickThinLargeGap":e=3;break;case"ThinThickThinLargeGap":e=5;break;case"SingleWavy":e=1;break;case"DoubleWavy":e=2;break;case"DashDotStroked":e=1;break;case"Emboss3D":case"Engrave3D":e=3;break;case"Outset":case"Inset":case"Thick":e=1}return e},e.prototype.getPrecedence=function(){var e=0;switch(this.lineStyle){case"Single":e=1;break;case"Thick":e=2;break;case"Double":e=3;break;case"Dot":e=4;break;case"DashLargeGap":e=5;break;case"DashDot":e=6;break;case"DashDotDot":e=7;break;case"Triple":e=8;break;case"ThinThickSmallGap":e=9;break;case"ThickThinSmallGap":e=10;break;case"ThinThickThinSmallGap":e=11;break;case"ThinThickMediumGap":e=12;break;case"ThickThinMediumGap":e=13;break;case"ThinThickThinMediumGap":e=14;break;case"ThinThickLargeGap":e=15;break;case"ThickThinLargeGap":e=16;break;case"ThinThickThinLargeGap":e=17;break;case"SingleWavy":e=18;break;case"DoubleWavy":e=19;break;case"DashSmallGap":e=20;break;case"DashDotStroked":e=21;break;case"Emboss3D":e=22;break;case"Engrave3D":e=23;break;case"Outset":e=24;break;case"Inset":e=25}return e},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueBorderFormat)){var i=m.getPropertyType(this.uniqueBorderFormat.uniqueFormatType,e);return this.uniqueBorderFormat.propertiesHash.containsKey(i)}return!1},e.prototype.cloneFormat=function(){var t=new e(void 0);return t.color=this.color,t.lineStyle=this.lineStyle,t.lineWidth=this.lineWidth,t.shadow=this.shadow,t.space=this.space,t},e.prototype.destroy=function(){t.isNullOrUndefined(this.uniqueBorderFormat)||e.uniqueBorderFormats.remove(this.uniqueBorderFormat),this.uniqueBorderFormat=void 0},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.uniqueBorderFormat)||(e.hasValue("color")&&(this.color=e.color),e.hasValue("lineStyle")&&(this.lineStyle=e.lineStyle),e.hasValue("lineWidth")&&(this.lineWidth=e.lineWidth),e.hasValue("shadow")&&(this.shadow=e.shadow),e.hasValue("space")&&(this.space=e.space))},e.clear=function(){this.uniqueBorderFormats.clear()},e.uniqueBorderFormats=new f,e.uniqueFormatType=1,e}(),E=function(){function e(e){this.leftIn=new N(this),this.rightIn=new N(this),this.topIn=new N(this),this.bottomIn=new N(this),this.horizontalIn=new N(this),this.verticalIn=new N(this),this.diagonalUpIn=new N(this),this.diagonalDownIn=new N(this),this.lineWidthIn=0,this.ownerBase=e}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftIn},set:function(e){this.leftIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightIn},set:function(e){this.rightIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.topIn},set:function(e){this.topIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.bottomIn},set:function(e){this.bottomIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontal",{get:function(){return this.horizontalIn},set:function(e){this.horizontalIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vertical",{get:function(){return this.verticalIn},set:function(e){this.verticalIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"diagonalUp",{get:function(){return this.diagonalUpIn},set:function(e){this.diagonalUpIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"diagonalDown",{get:function(){return this.diagonalDownIn},set:function(e){this.diagonalDownIn=e},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.isNullOrUndefined(this.left)||this.left.destroy(),t.isNullOrUndefined(this.top)||this.top.destroy(),t.isNullOrUndefined(this.bottom)||this.bottom.destroy(),t.isNullOrUndefined(this.right)||this.right.destroy(),t.isNullOrUndefined(this.horizontal)||this.horizontal.destroy(),t.isNullOrUndefined(this.vertical)||this.vertical.destroy(),t.isNullOrUndefined(this.diagonalDown)||this.diagonalDown.destroy(),t.isNullOrUndefined(this.diagonalUp)||this.diagonalUp.destroy(),this.topIn=void 0,this.bottomIn=void 0,this.leftIn=void 0,this.rightIn=void 0,this.horizontalIn=void 0,this.verticalIn=void 0,this.diagonalDownIn=void 0,this.diagonalUpIn=void 0,this.lineWidthIn=void 0,this.valueIn=void 0},e.prototype.cloneFormat=function(){var i=new e(void 0);return i.top=t.isNullOrUndefined(this.top)?void 0:this.top.cloneFormat(),i.bottom=t.isNullOrUndefined(this.bottom)?void 0:this.bottom.cloneFormat(),i.left=t.isNullOrUndefined(this.left)?void 0:this.left.cloneFormat(),i.right=t.isNullOrUndefined(this.right)?void 0:this.right.cloneFormat(),i.horizontal=t.isNullOrUndefined(this.horizontal)?void 0:this.horizontal.cloneFormat(),i.vertical=t.isNullOrUndefined(this.vertical)?void 0:this.vertical.cloneFormat(),i.diagonalUp=t.isNullOrUndefined(this.diagonalUp)?void 0:this.diagonalUp.cloneFormat(),i.diagonalDown=t.isNullOrUndefined(this.diagonalDown)?void 0:this.diagonalDown.cloneFormat(),i},e.prototype.copyFormat=function(e){!t.isNullOrUndefined(e.left)&&e.left instanceof N&&(this.left=new N(this),this.left.copyFormat(e.left)),!t.isNullOrUndefined(e.right)&&e.right instanceof N&&(this.right=new N(this),this.right.copyFormat(e.right)),!t.isNullOrUndefined(e.top)&&e.top instanceof N&&(this.top=new N(this),this.top.copyFormat(e.top)),!t.isNullOrUndefined(e.bottom)&&e.bottom instanceof N&&(this.bottom=new N(this),this.bottom.copyFormat(e.bottom)),!t.isNullOrUndefined(e.horizontal)&&e.horizontal instanceof N&&(this.horizontal=new N(this),this.horizontal.copyFormat(e.horizontal)),!t.isNullOrUndefined(e.vertical)&&e.vertical instanceof N&&(this.vertical=new N(this),this.vertical.copyFormat(e.vertical)),!t.isNullOrUndefined(e.diagonalDown)&&e.diagonalDown instanceof N&&(this.diagonalDown=new N(this),this.diagonalDown.copyFormat(e.diagonalDown)),!t.isNullOrUndefined(e.diagonalUp)&&e.diagonalUp instanceof N&&(this.diagonalUp=new N(this),this.diagonalUp.copyFormat(e.diagonalUp))},e}(),H=function(){function e(e){this.uniqueRowFormat=void 0,this.borders=new E(this),this.ownerBase=void 0,this.beforeWidth=0,this.afterWidth=0,this.revisions=[],this.removedIds=[],this.ownerBase=e}return Object.defineProperty(e.prototype,"gridBefore",{get:function(){return this.getPropertyValue("gridBefore")},set:function(e){this.setPropertyValue("gridBefore",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridBeforeWidth",{get:function(){return this.getPropertyValue("gridBeforeWidth")},set:function(e){this.setPropertyValue("gridBeforeWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridBeforeWidthType",{get:function(){return this.getPropertyValue("gridBeforeWidthType")},set:function(e){this.setPropertyValue("gridBeforeWidthType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridAfter",{get:function(){return this.getPropertyValue("gridAfter")},set:function(e){this.setPropertyValue("gridAfter",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridAfterWidth",{get:function(){return this.getPropertyValue("gridAfterWidth")},set:function(e){this.setPropertyValue("gridAfterWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gridAfterWidthType",{get:function(){return this.getPropertyValue("gridAfterWidthType")},set:function(e){this.setPropertyValue("gridAfterWidthType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowBreakAcrossPages",{get:function(){return this.getPropertyValue("allowBreakAcrossPages")},set:function(e){this.setPropertyValue("allowBreakAcrossPages",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHeader",{get:function(){return this.getPropertyValue("isHeader")},set:function(e){this.setPropertyValue("isHeader",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.getPropertyValue("height")},set:function(e){0!==e||"AtLeast"!==this.heightType&&"Exactly"!==this.heightType?"Auto"===this.heightType&&(e=0):e=1,this.setPropertyValue("height",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"heightType",{get:function(){return this.getPropertyValue("heightType")},set:function(e){this.height="AtLeast"===e||"Exactly"===e?1:0,this.setPropertyValue("heightType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftIndent",{get:function(){return this.getPropertyValue("leftIndent")},set:function(e){this.setPropertyValue("leftIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var n=m.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueRowFormat)&&this.uniqueRowFormat.propertiesHash.containsKey(n))return this.uniqueRowFormat.propertiesHash.get(n)}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,n){if((t.isNullOrUndefined(n)||""===n)&&(n=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueRowFormat))this.initializeUniqueRowFormat(i,n);else{var r=m.getPropertyType(this.uniqueRowFormat.uniqueFormatType,i);if(this.uniqueRowFormat.propertiesHash.containsKey(r)&&this.uniqueRowFormat.propertiesHash.get(r)===n)return;this.uniqueRowFormat=e.uniqueRowFormats.updateUniqueFormat(this.uniqueRowFormat,i,n)}},e.prototype.initializeUniqueRowFormat=function(t,i){var n=new u;this.addUniqueRowFormat("allowBreakAcrossPages",t,i,n),this.addUniqueRowFormat("isHeader",t,i,n),this.addUniqueRowFormat("height",t,i,n),this.addUniqueRowFormat("heightType",t,i,n),this.addUniqueRowFormat("gridBefore",t,i,n),this.addUniqueRowFormat("gridBeforeWidth",t,i,n),this.addUniqueRowFormat("gridBeforeWidthType",t,i,n),this.addUniqueRowFormat("gridAfter",t,i,n),this.addUniqueRowFormat("gridAfterWidth",t,i,n),this.addUniqueRowFormat("gridgridAfterWidth",t,i,n),this.addUniqueRowFormat("gridBeforeWidthType",t,i,n),this.addUniqueRowFormat("leftMargin",t,i,n),this.addUniqueRowFormat("rightMargin",t,i,n),this.addUniqueRowFormat("topMargin",t,i,n),this.addUniqueRowFormat("bottomMargin",t,i,n),this.addUniqueRowFormat("leftIndent",t,i,n),this.uniqueRowFormat=e.uniqueRowFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.addUniqueRowFormat=function(t,i,n,r){var o=m.getPropertyType(e.uniqueFormatType,t);t===i&&r.add(o,n)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"allowBreakAcrossPages":t=!0;break;case"isHeader":t=!1;break;case"height":t=0;break;case"heightType":t="Auto";break;case"gridBefore":case"gridBeforeWidth":t=0;break;case"gridBeforeWidthType":t="Point";break;case"gridAfter":case"gridAfterWidth":t=0;break;case"gridAfterWidthType":t="Point";break;case"leftMargin":case"topMargin":case"bottomMargin":case"rightMargin":t=void 0;break;case"leftIndent":t=0}return t},e.prototype.containsMargins=function(){return!(t.isNullOrUndefined(this.leftMargin)&&t.isNullOrUndefined(this.rightMargin)&&t.isNullOrUndefined(this.bottomMargin)&&t.isNullOrUndefined(this.topMargin))},e.prototype.cloneFormat=function(){var t=new e;return t.allowBreakAcrossPages=this.allowBreakAcrossPages,t.heightType=this.heightType,t.height=this.height,t.isHeader=this.isHeader,t.gridBefore=this.gridBefore,t.gridBeforeWidth=this.gridBeforeWidth,t.gridBeforeWidthType=this.gridBeforeWidthType,t.gridAfter=this.gridAfter,t.gridAfterWidth=this.gridAfterWidth,t.gridAfterWidthType=this.gridAfterWidthType,t.leftMargin=this.leftMargin,t.rightMargin=this.rightMargin,t.topMargin=this.topMargin,t.bottomMargin=this.bottomMargin,t.leftIndent=this.leftIndent,this.revisions.length>0?t.removedIds=W.cloneRevisions(this.revisions):t.removedIds=this.removedIds.slice(),t},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueRowFormat)){var i=m.getPropertyType(this.uniqueRowFormat.uniqueFormatType,e);return this.uniqueRowFormat.propertiesHash.containsKey(i)}return!1},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.uniqueRowFormat)||(this.allowBreakAcrossPages=e.allowBreakAcrossPages,this.isHeader=e.isHeader,this.heightType=e.heightType,this.height=e.height,this.gridBefore=e.gridBefore,this.gridBeforeWidth=e.gridBeforeWidth,this.gridBeforeWidthType=e.gridBeforeWidthType,this.gridAfter=e.gridAfter,this.gridAfterWidth=e.gridAfterWidth,this.gridAfterWidthType=e.gridAfterWidthType,this.leftMargin=e.leftMargin,this.topMargin=e.topMargin,this.rightMargin=e.rightMargin,this.bottomMargin=e.bottomMargin,this.leftIndent=e.leftIndent),t.isNullOrUndefined(e.borders)||(this.borders=new E(this),this.borders.ownerBase=e,this.borders.copyFormat(e.borders)),e.revisions.length>0?this.removedIds=W.cloneRevisions(e.revisions):this.removedIds=e.removedIds.slice())},e.prototype.destroy=function(){t.isNullOrUndefined(this.borders)||this.borders.destroy(),t.isNullOrUndefined(this.uniqueRowFormat)||e.uniqueRowFormats.remove(this.uniqueRowFormat),this.beforeWidth=void 0,this.afterWidth=void 0,this.borders=void 0,this.uniqueRowFormat=void 0},e.clear=function(){this.uniqueRowFormats.clear()},e.uniqueRowFormats=new f,e.uniqueFormatType=6,e}(),W=function(){function e(e,t,i){this.author=null,this.date=null,this.range=[],this.revisionID="",this.isContentRemoved=!1,this.isTableRevision=!1,this.canSkipTableItems=!1,this.skipUnLinkElement=!1,this.author=t,this.date=i,this.owner=e}return e.prototype.handleAcceptReject=function(e){this.owner.selection.selectRevision(this);var t=this.owner.selection,i=t.start,n=t.end;t.start.isExistBefore(t.end)||(i=t.end,n=t.start);var r=t.getParagraphInfo(i);if(this.owner.editor.initHistory(e?"Accept Change":"Reject Change"),"Deletion"===this.revisionType?(r=t.getParagraphInfo(this.owner.selection.start),t.editPosition=this.owner.selection.getHierarchicalIndex(r.paragraph,r.offset.toString())):t.editPosition=this.owner.selection.getHierarchicalIndex(r.paragraph,r.offset.toString()),this.owner.editor.updateInsertPosition(),this.isContentRemoved=!1,this.canSkipTableItems=!1,this.skipUnLinkElement=!1,"Insertion"===this.revisionType||"Deletion"===this.revisionType||"MoveFrom"===this.revisionType||"MoveTo"===this.revisionType)for(var o=0;this.range.length>0&&(this.range[o]instanceof Se||this.range[o]instanceof k||this.range[o]instanceof H);)this.unlinkRangeItem(this.range[o],this,e)?o++:o=0;if(this.isTableRevision=!1,this.isContentRemoved){var s=t.getTextPosBasedOnLogicalIndex(t.editPosition);this.owner.selection.selectContent(s,!0),this.owner.editor.updateEndPosition()}else t.selectRange(i,n),this.owner.editor.updateHistoryPosition(n,!1);if(this.owner.editorHistory&&"BackSpace"!==this.owner.editorHistory.currentBaseHistoryInfo.action&&this.owner.editorHistory.currentBaseHistoryInfo.removedNodes.reverse(),this.owner.editorHistory){this.owner.trackChangesPane.isTrackingPageBreak&&(this.owner.editorHistory.currentBaseHistoryInfo.action="TrackingPageBreak");var a=this.owner.editorHistory;!a.currentHistoryInfo||"Accept All"!==a.currentHistoryInfo.action&&"Reject All"!==a.currentHistoryInfo.action||this.owner.documentHelper.blockToShift&&this.owner.documentHelper.layout.shiftLayoutedItems(!1),a.updateHistory()}this.owner.editor.reLayout(this.owner.selection)},e.prototype.accept=function(){this.handleAcceptReject(!0)},e.prototype.reject=function(){this.handleAcceptReject(!1)},e.prototype.unlinkRangeItem=function(e,i,n){if(this.isTableRevision)return this.removeRangeRevisionForItem(e),0===i.range.length&&this.owner.revisions.remove(i),!1;var r=!t.isNullOrUndefined(n)&&("MoveFrom"===i.revisionType||"Deletion"===i.revisionType)&&n||("Insertion"===i.revisionType||"MoveTo"===i.revisionType)&&!n;if(this.owner.selection.isTOC()){if(r)this.owner.editor.deleteSelectedContents(this.owner.selection,!0),0===i.range.length&&this.owner.revisions.remove(i),this.isContentRemoved=!0,this.owner.editorHistory.currentBaseHistoryInfo.action="BackSpace";else{for(;this.range.length>0;){var o=this.range[0];this.removeRangeRevisionForItem(o),0===i.range.length&&this.owner.revisions.remove(i)}this.owner.editor.addRemovedNodes(this.revisionID),this.owner.editorHistory.currentBaseHistoryInfo.action="AcceptTOC"}return!1}if(e instanceof Se&&!this.canSkipTableItems)if(r){if(this.skipeElementRemoval(e))return this.skipUnLinkElement=!0,!0;this.owner.editor.addRemovedNodes(e.clone())}else this.owner.editorHistory.currentBaseHistoryInfo.action="ClearRevisions",this.updateRevisionID();else if(!this.canSkipTableItems&&e instanceof k&&!r)this.owner.editorHistory.currentBaseHistoryInfo.action="ClearRevisions",this.updateRevisionID();else if(e instanceof H&&!r){this.isTableRevision=!0;var s=e.ownerBase.ownerTable,a=e.ownerBase;this.owner.editorHistory.currentBaseHistoryInfo.action="RemoveRowTrack",this.owner.editor.cloneTableToHistoryInfo(s)}if(r=r&&!this.canSkipTableItems,e instanceof Se&&r){var l=e.line.paragraph;this.removeRevisionItemsFromRange(e),this.removeItem(e),this.isContentRemoved=!0,this.owner.documentHelper.layout.reLayoutParagraph(l,0,0)}else if(e instanceof k&&r){if(this.isContentRemoved=!0,this.skipUnLinkElement=!1,this.removeRevisionItemsFromRange(e),1===i.range.length)this.owner.editor.deleteSelectedContents(this.owner.selection,!0);else{this.owner.editor.deleteSelectedContents(this.owner.selection,!0);var d=i.range.indexOf(e);for(i.range.splice(d,1);this.range.length>0;)this.removeRangeRevisionForItem(this.range[0])}this.owner.editorHistory.currentBaseHistoryInfo.action="BackSpace"}else if(e instanceof H&&r){var s=e.ownerBase.ownerTable,a=e.ownerBase;this.removeRevisionItemsFromRange(e),this.owner.editorHistory.currentBaseHistoryInfo.action="DeleteCells",this.owner.editor.cloneTableToHistoryInfo(s),this.owner.editor.removeDeletedCellRevision(a),this.isContentRemoved=!0,s.removeChild(s.childWidgets.indexOf(a)),this.canSkipTableItems=!0,a.destroy(),0===s.childWidgets.length?(this.owner.selection.editPosition=this.owner.selection.getHierarchicalIndex(s,"0"),this.owner.editor.removeBlock(s),s.destroy()):this.owner.editor.updateTable(s)}return e instanceof H&&r||this.skipUnLinkElement||this.removeRangeRevisionForItem(e),0===i.range.length&&this.owner.revisions.remove(i),!1},e.prototype.updateRevisionID=function(){for(this.owner.editor.addRemovedNodes(this.revisionID);this.range.length>0;)this.removeRangeRevisionForItem(this.range[0])},e.prototype.removeRevisionItemsFromRange=function(e){if(e.revisions.length>0)for(var t=0;t<e.revisions.length;t++){var i=e.revisions[t];if(this.revisionID!==i.revisionID){var n=i.range.indexOf(e);e.revisions[t].range.splice(n,1)}0===i.range.length&&this.owner.revisions.remove(i)}},e.prototype.removeRangeRevisionForItem=function(e){var t=e.revisions.indexOf(this);if(t>=0){e.revisions.splice(t,1);var i=this.range.indexOf(e);this.range.splice(i,1)}},e.prototype.skipeElementRemoval=function(e){var t=e.paragraph;if(t.characterFormat.revisions.length>0)for(var i=0;i<t.characterFormat.revisions.length;i++)if(t.characterFormat.revisions[i].range.indexOf(e)>=0)return!0;return!1},e.prototype.removeRevisionFromRow=function(e){this.owner.editor.unlinkRangeFromRevision(e.rowFormat);for(var t=0;t<e.childWidgets.length;t++){var i=e.childWidgets[t];this.owner.editor.removeRevisionForCell(i,!1)}},e.prototype.removeItem=function(e){var t=e.line.paragraph;this.owner.editor.unLinkFieldCharacter(e);var i=e.line.children.indexOf(e);e.line.children.splice(i,1),this.owner.editor.removeEmptyLine(t)},e.prototype.canSkipCloning=function(){return!(t.isNullOrUndefined(this.owner)||!this.owner.editorHistory||!this.owner.editorHistory.currentBaseHistoryInfo||"DeleteCells"!==this.owner.editorHistory.currentBaseHistoryInfo.action)},e.prototype.clone=function(){if(this.canSkipCloning())return this;var t=new e(void 0,this.author,this.date);return t.revisionID=this.revisionID,t.revisionType=this.revisionType,t},e.cloneRevisions=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i].revisionID);return t},e}(),O=function(){function e(e){this.changes=[],this.owner=e}return e.prototype.get=function(e){if(e>=this.changes.length||e<0)throw new ReferenceError("Provided index is not within the range");return this.changes[e]},Object.defineProperty(e.prototype,"length",{get:function(){return this.changes.length},enumerable:!0,configurable:!0}),e.prototype.remove=function(e){t.isNullOrUndefined(e)||this.changes.indexOf(e)<0||this.changes.splice(this.changes.indexOf(e),1)},e.prototype.acceptAll=function(){this.owner.isReadOnly||this.handleRevisionCollection(!0)},e.prototype.rejectAll=function(){this.owner.isReadOnly||this.handleRevisionCollection(!1)},e.prototype.handleRevisionCollection=function(e,t){var i=this.owner.selection,n=i.start,r=i.end;i.start.isExistBefore(i.end)||(n=i.end,r=i.start),n=n.clone(),r=r.clone(),e?this.owner.editor.initComplexHistory("Accept All"):this.owner.editor.initComplexHistory("Reject All");for(var o=t||this.changes;o.length>0;)e?o[0].accept():o[0].reject(),t&&o.splice(0,1);var s=i.getTextPosBasedOnLogicalIndex(i.editPosition);this.owner.selection.selectContent(s,!0),this.owner.editorHistory&&this.owner.editorHistory.updateComplexHistory(),this.owner.editor.reLayout(this.owner.selection,!1)},e.prototype.destroy=function(){this.changes=[]},e}(),k=function(){function e(e){this.uniqueCharacterFormat=void 0,this.ownerBase=void 0,this.baseCharStyle=void 0,this.removedIds=[],this.revisions=[],this.ownerBase=e}return Object.defineProperty(e.prototype,"bold",{get:function(){return this.getPropertyValue("bold")},set:function(e){this.setPropertyValue("bold",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"italic",{get:function(){return this.getPropertyValue("italic")},set:function(e){this.setPropertyValue("italic",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this.getPropertyValue("fontSize")},set:function(e){this.setPropertyValue("fontSize",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontFamily",{get:function(){return this.getPropertyValue("fontFamily")},set:function(e){this.setPropertyValue("fontFamily",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{get:function(){return this.getPropertyValue("underline")},set:function(e){this.setPropertyValue("underline",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strikethrough",{get:function(){return this.getPropertyValue("strikethrough")},set:function(e){this.setPropertyValue("strikethrough",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"baselineAlignment",{get:function(){return this.getPropertyValue("baselineAlignment")},set:function(e){this.setPropertyValue("baselineAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"highlightColor",{get:function(){return this.getPropertyValue("highlightColor")},set:function(e){this.setPropertyValue("highlightColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontColor",{get:function(){return this.getPropertyValue("fontColor")},set:function(e){this.setPropertyValue("fontColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bdo",{get:function(){return this.getPropertyValue("bdo")},set:function(e){this.setPropertyValue("bdo",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"boldBidi",{get:function(){return this.getPropertyValue("boldBidi")},set:function(e){this.setPropertyValue("boldBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"italicBidi",{get:function(){return this.getPropertyValue("italicBidi")},set:function(e){this.setPropertyValue("italicBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontSizeBidi",{get:function(){return this.getPropertyValue("fontSizeBidi")},set:function(e){this.setPropertyValue("fontSizeBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontFamilyBidi",{get:function(){return this.getPropertyValue("fontFamilyBidi")},set:function(e){this.setPropertyValue("fontFamilyBidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allCaps",{get:function(){return this.getPropertyValue("allCaps")},set:function(e){this.setPropertyValue("allCaps",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var n=m.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueCharacterFormat)&&this.uniqueCharacterFormat.propertiesHash.containsKey(n))return this.uniqueCharacterFormat.propertiesHash.get(n)}else{var r=this.checkCharacterStyle(i);if(!t.isNullOrUndefined(r))return r;if(!t.isNullOrUndefined(this.baseCharStyle)){var o=this.ownerBase.paragraph,s=this.ownerBase.line;if(!t.isNullOrUndefined(o)&&!t.isNullOrUndefined(s))for(var a=s.children.length,l=0;l<a;l++){var d=this.ownerBase.line.children[l];if(d instanceof Oe){var h=d.text;h.startsWith("HYPERLINK")&&-1!==h.indexOf("_Toc")&&(this.baseCharStyle=this.ownerBase.paragraph.paragraphFormat.baseStyle)}}}var c=this.checkBaseStyle(i);if(!t.isNullOrUndefined(c))return c}return this.getDefaultValue(i)},e.prototype.getDefaultValue=function(i){var n=m.getPropertyType(e.uniqueFormatType,i),r=this.documentCharacterFormat();return t.isNullOrUndefined(r)||t.isNullOrUndefined(r.uniqueCharacterFormat)||!r.uniqueCharacterFormat.propertiesHash.containsKey(n)?e.getPropertyDefaultValue(i):r.uniqueCharacterFormat.propertiesHash.get(n)},e.prototype.documentCharacterFormat=function(){var e;return t.isNullOrUndefined(this.ownerBase)||(t.isNullOrUndefined(this.ownerBase.paragraph)||t.isNullOrUndefined(this.ownerBase.paragraph.bodyWidget)?t.isNullOrUndefined(this.ownerBase.bodyWidget)||(e=this.ownerBase.bodyWidget.page.documentHelper.characterFormat):e=this.ownerBase.paragraph.bodyWidget.page.documentHelper.characterFormat),e},e.prototype.checkBaseStyle=function(i){var n;for(t.isNullOrUndefined(this.ownerBase)||(t.isNullOrUndefined(this.ownerBase.paragraph)?this.ownerBase instanceof we&&!t.isNullOrUndefined(this.ownerBase.paragraphFormat)?n=this.ownerBase.paragraphFormat.baseStyle:t.isNullOrUndefined(this.ownerBase instanceof U)||(n=this.ownerBase.basedOn):n=this.ownerBase.paragraph.paragraphFormat.baseStyle);!t.isNullOrUndefined(n)&&!n.characterFormat.hasValue(i);)n=n.basedOn;if(!t.isNullOrUndefined(n)){var r=m.getPropertyType(e.uniqueFormatType,i);return n.characterFormat.uniqueCharacterFormat.propertiesHash.get(r)}},e.prototype.checkCharacterStyle=function(i){var n=this.baseCharStyle;if(!t.isNullOrUndefined(n))for(;!t.isNullOrUndefined(n)&&"Default Paragraph Font"!==n.name;){if(n.characterFormat.hasValue(i)){var r=m.getPropertyType(e.uniqueFormatType,i);return n.characterFormat.uniqueCharacterFormat.propertiesHash.get(r)}n=n.basedOn}},e.prototype.setPropertyValue=function(i,n){if((t.isNullOrUndefined(n)||""===n)&&(n=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueCharacterFormat))this.initializeUniqueCharacterFormat(i,n);else{var r=m.getPropertyType(this.uniqueCharacterFormat.uniqueFormatType,i);if(this.uniqueCharacterFormat.propertiesHash.containsKey(r)&&this.uniqueCharacterFormat.propertiesHash.get(r)===n)return;this.uniqueCharacterFormat=e.uniqueCharacterFormats.updateUniqueFormat(this.uniqueCharacterFormat,i,n)}},e.prototype.initializeUniqueCharacterFormat=function(t,i){var n=new u;this.addUniqueCharacterFormat("fontColor",t,i,n),this.addUniqueCharacterFormat("fontFamily",t,i,n),this.addUniqueCharacterFormat("fontSize",t,i,n),this.addUniqueCharacterFormat("bold",t,i,n),this.addUniqueCharacterFormat("italic",t,i,n),this.addUniqueCharacterFormat("underline",t,i,n),this.addUniqueCharacterFormat("strikethrough",t,i,n),this.addUniqueCharacterFormat("baselineAlignment",t,i,n),this.addUniqueCharacterFormat("highlightColor",t,i,n),this.addUniqueCharacterFormat("styleName",t,i,n),this.addUniqueCharacterFormat("bidi",t,i,n),this.addUniqueCharacterFormat("bdo",t,i,n),this.addUniqueCharacterFormat("fontFamilyBidi",t,i,n),this.addUniqueCharacterFormat("fontSizeBidi",t,i,n),this.addUniqueCharacterFormat("boldBidi",t,i,n),this.addUniqueCharacterFormat("italicBidi",t,i,n),this.addUniqueCharacterFormat("allCaps",t,i,n),this.uniqueCharacterFormat=e.uniqueCharacterFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.addUniqueCharacterFormat=function(t,i,n,r){var o=m.getPropertyType(e.uniqueFormatType,t);t===i&&r.add(o,n)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"bold":case"italic":t=!1;break;case"fontSize":t=11;break;case"underline":case"strikethrough":t="None";break;case"baselineAlignment":t="Normal";break;case"highlightColor":t="NoColor";break;case"fontColor":t="empty";break;case"fontFamily":t="Calibri";break;case"styleName":t="Default Paragraph Font";break;case"bidi":t=!1;break;case"bdo":t="None";break;case"boldBidi":case"italicBidi":t=!1;break;case"fontSizeBidi":t=11;break;case"fontFamilyBidi":t="Calibri";break;case"allCaps":t=!1}return t},e.prototype.isEqualFormat=function(e){return this.fontSize===e.fontSize&&this.fontFamily===e.fontFamily&&this.bold===e.bold&&this.italic===e.italic&&this.baselineAlignment===e.baselineAlignment&&this.underline===e.underline&&this.fontColor===e.fontColor&&this.strikethrough===e.strikethrough&&this.highlightColor===e.highlightColor&&this.bidi===e.bidi&&this.bdo===e.bdo&&this.allCaps===e.allCaps},e.prototype.isSameFormat=function(e){return this.baseCharStyle===e.baseCharStyle&&this.uniqueCharacterFormat===e.uniqueCharacterFormat},e.prototype.cloneFormat=function(){var t=new e(void 0);return t.uniqueCharacterFormat=this.uniqueCharacterFormat,t.baseCharStyle=this.baseCharStyle,this.revisions.length>0?t.removedIds=W.cloneRevisions(this.revisions):t.removedIds=this.removedIds.slice(),t},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueCharacterFormat)&&!t.isNullOrUndefined(this.uniqueCharacterFormat.propertiesHash)){var i=m.getPropertyType(this.uniqueCharacterFormat.uniqueFormatType,e);return this.uniqueCharacterFormat.propertiesHash.containsKey(i)}return!1},e.prototype.clearFormat=function(){t.isNullOrUndefined(this.uniqueCharacterFormat)||0!==this.uniqueCharacterFormat.referenceCount||e.uniqueCharacterFormats.remove(this.uniqueCharacterFormat),this.uniqueCharacterFormat=void 0,this.baseCharStyle=void 0},e.prototype.destroy=function(){this.clearFormat()},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(!t.isNullOrUndefined(e.uniqueCharacterFormat)&&e.uniqueCharacterFormat.propertiesHash&&this.updateUniqueCharacterFormat(e),t.isNullOrUndefined(e.baseCharStyle)||(this.baseCharStyle=e.baseCharStyle),e.revisions.length>0?this.removedIds=W.cloneRevisions(e.revisions):this.removedIds=e.removedIds.slice())},e.prototype.updateUniqueCharacterFormat=function(i){var n=void 0;this.uniqueCharacterFormat&&(n=this.uniqueCharacterFormat.mergeProperties(i.uniqueCharacterFormat),0===this.uniqueCharacterFormat.referenceCount&&(e.uniqueCharacterFormats.remove(this.uniqueCharacterFormat),this.uniqueCharacterFormat=void 0)),this.uniqueCharacterFormat=new m(e.uniqueFormatType),t.isNullOrUndefined(n)&&(n=this.uniqueCharacterFormat.mergeProperties(i.uniqueCharacterFormat)),this.uniqueCharacterFormat=e.uniqueCharacterFormats.addUniqueFormat(n,e.uniqueFormatType)},e.clear=function(){this.uniqueCharacterFormats.clear()},e.prototype.applyStyle=function(e){this.baseCharStyle=e},e.prototype.getValue=function(e){return this.hasValue(e)?this.getPropertyValue(e):void 0},e.prototype.mergeFormat=function(e){t.isNullOrUndefined(this.getValue("bold"))&&(this.bold=e.getValue("bold")),t.isNullOrUndefined(this.getValue("italic"))&&(this.italic=e.getValue("italic")),t.isNullOrUndefined(this.getValue("fontSize"))&&(this.fontSize=e.getValue("fontSize")),t.isNullOrUndefined(this.getValue("fontFamily"))&&(this.fontFamily=e.getValue("fontFamily")),t.isNullOrUndefined(this.getValue("underline"))&&(this.underline=e.getValue("underline")),t.isNullOrUndefined(this.getValue("strikethrough"))&&(this.strikethrough=e.getValue("strikethrough")),t.isNullOrUndefined(this.getValue("baselineAlignment"))&&(this.baselineAlignment=e.getValue("baselineAlignment")),t.isNullOrUndefined(this.getValue("highlightColor"))&&(this.highlightColor=e.getValue("highlightColor")),t.isNullOrUndefined(this.getValue("fontColor"))&&(this.fontColor=e.getValue("fontColor")),t.isNullOrUndefined(this.getValue("bidi"))&&(this.bidi=e.getValue("bidi")),t.isNullOrUndefined(this.getValue("bdo"))&&(this.bdo=e.getValue("bdo")),t.isNullOrUndefined(this.getValue("allCaps"))&&(this.allCaps=e.getValue("allCaps"))},e.uniqueCharacterFormats=new f,e.uniqueFormatType=2,e}(),L=function(){function e(){}return e.insert=function(e,t,i){return t>=0?[e.slice(0,t)+i+e.slice(t)].join(""):i+this},e.remove=function(e,t){return 0===t?e.substring(t+1,e.length):e.substring(0,t)+e.substring(t+1,e.length)},e.indexOfAny=function(e,i){for(var n=void 0,r=0;r<i.length;r++){var o=e.indexOf(i[r]);-1!==o&&t.isNullOrUndefined(n)?n=o:-1!==o&&o<n&&(n=o)}return t.isNullOrUndefined(n)?-1:n},e.lastIndexOfAny=function(e,t){for(var i=e.length-1;i>=0;i--)for(var n=0;n<=t.length-1;n++)if(e[i]===t[n])return i;return-1},e.addCssStyle=function(e){var t=document.createElement("style");t.style.cssText?t.style.cssText=e:t.appendChild(document.createTextNode(e)),document.getElementsByTagName("head")[0].appendChild(t)},e.getHighlightColorCode=function(e){var t="#ffffff";switch(e){case"Yellow":t="#ffff00";break;case"BrightGreen":t="#00ff00";break;case"Turquoise":t="#00ffff";break;case"Pink":t="#ff00ff";break;case"Blue":t="#0000ff";break;case"Red":t="#ff0000";break;case"DarkBlue":t="#000080";break;case"Teal":t="#008080";break;case"Green":t="#008000";break;case"Violet":t="#800080";break;case"DarkRed":t="#800000";break;case"DarkYellow":t="#808000";break;case"Gray50":t="#808080";break;case"Gray25":t="#c0c0c0";break;case"Black":t="#000000"}return t},e.isVeryDark=function(e){var t=e.substring(1);return(299*parseInt(t.substr(0,2),16)+587*parseInt(t.substr(2,2),16)+114*parseInt(t.substr(4,2),16))/1e3<=60},e.getColor=function(e){return e.length>0&&"#"===e[0]&&e.length>7?e.substr(0,7):e},e.convertPointToPixel=function(t){return e.round(96*t/72,5)},e.convertPixelToPoint=function(t){return e.round(72*t/96,5)},e.isLinkedFieldCharacter=function(e){return e instanceof Ie&&0===e.fieldType?!t.isNullOrUndefined(e.fieldEnd):e instanceof Ie&&2===e.fieldType?!t.isNullOrUndefined(e.fieldBegin)&&!t.isNullOrUndefined(e.fieldEnd):!t.isNullOrUndefined(e.fieldBegin)},e.removeSpace=function(e){if(!t.isNullOrUndefined(e)&&0!==e.length)for(var i=0;i<e.length;i++)" "===e.charAt(i)&&(e=e.replace(" ",""));return e},e.trimStart=function(e){var t=0;for(t;t<e.length&&" "===e[t];t++);return e.substring(t,e.length)},e.trimEnd=function(e){var t=e.length-1;for(t;t>=0&&" "===e[t];t--);return e.substring(0,t+1)},e.endsWith=function(e){return!t.isNullOrUndefined(e)&&0!==e.length&&" "===e[e.length-1]},e.addSpace=function(e){var t="";if(e>0)for(var i=0;i<e;i++)t+=" ";return t},e.writeCharacterFormat=function(e,i,n){e.bold=i?n.bold:n.getValue("bold"),e.italic=i?n.italic:n.getValue("italic"),e.fontSize=i?this.toWriteInline(n,"fontSize"):n.getValue("fontSize"),e.fontFamily=i?this.toWriteInline(n,"fontFamily"):n.getValue("fontFamily"),e.underline=i?n.underline:n.getValue("underline"),e.strikethrough=i?n.strikethrough:n.getValue("strikethrough"),e.baselineAlignment=i?n.baselineAlignment:n.getValue("baselineAlignment"),e.highlightColor=i?n.highlightColor:n.getValue("highlightColor"),e.fontColor=i?this.toWriteInline(n,"fontColor"):n.getValue("fontColor"),e.styleName=t.isNullOrUndefined(n.baseCharStyle)?void 0:n.baseCharStyle.name,e.bidi=i?n.bidi:n.getValue("bidi"),e.bdo=i?n.bdo:n.getValue("bdo"),e.boldBidi=i?n.boldBidi:n.getValue("boldBidi"),e.italicBidi=i?n.italicBidi:n.getValue("italicBidi"),e.fontSizeBidi=i?n.fontSizeBidi:n.getValue("fontSizeBidi"),e.fontFamilyBidi=i?n.fontFamilyBidi:n.getValue("fontFamilyBidi"),e.allCaps=i?n.allCaps:n.getValue("allCaps")},e.toWriteInline=function(e,i){return!t.isNullOrUndefined(e.ownerBase)&&e.ownerBase instanceof Se?e.hasValue(i)?e[i]:e.getValue(i):e[i]},e.round=function(e,t){for(var i=e,n=0;n<t;n++)i*=10;i=Math.round(i);for(n=0;n<t;n++)i/=10;return i},e.reverseString=function(e){return t.isNullOrUndefined(e)||""===e||(e=e.split("").reverse().join("")),e},e.formatClippedString=function(e){var t="",i="";return this.startsWith(e,"data:image/bmp;base64,")?(t=".bmp",i=e.replace("data:image/bmp;base64,","")):this.startsWith(e,"data:image/x-emf;base64,")?(t=".emf",i=e.replace("data:image/x-emf;base64,","")):this.startsWith(e,"data:image/exif;base64,")?(t=".exif",i=e.replace("data:image/exif;base64,","")):this.startsWith(e,"data:image/gif;base64,")?(t=".gif",i=e.replace("data:image/gif;base64,","")):this.startsWith(e,"data:image/icon;base64,")?(t=".ico",i=e.replace("data:image/icon;base64,","")):this.startsWith(e,"data:image/jpeg;base64,")?(t=".jpeg",i=e.replace("data:image/jpeg;base64,","")):this.startsWith(e,"data:image/jpg;base64,")?(t=".jpg",i=e.replace("data:image/jpg;base64,","")):this.startsWith(e,"data:image/png;base64,")?(t=".png",i=e.replace("data:image/png;base64,","")):this.startsWith(e,"data:image/tiff;base64,")?(t=".tif",i=e.replace("data:image/tiff;base64,","")):this.startsWith(e,"data:image/x-wmf;base64,")?(t=".wmf",i=e.replace("data:image/x-wmf;base64,","")):t=".jpeg",{extension:t,formatClippedString:i}},e.startsWith=function(e,t){return t.length>0&&e.substring(0,t.length)===t},e.formatText=function(e,t){var i=t;switch(e.toLowerCase()){case"uppercase":i=t.toUpperCase();break;case"lowercase":i=t.toLowerCase();break;case"firstlower":i=this.lowerFirstChar(t);break;case"firstcapital":i=this.capitaliseFirst(t,"FirstCapital");break;case"titlecase":i=this.capitaliseFirst(t,"Titlecase")}return i},e.formatNumber=function(e,i){var n=new t.Internationalization;i=i.split(".")[0];var r=n.parseNumber(i);if("NaN"===i.toString())return"";""===e&&(e="0");var o={format:e};return n.formatNumber(r,o)},e.formatDate=function(e,i){var n=new t.Internationalization,r=new Date(i);if(isNaN(r.getDate()))return"";if(""===e)return i;-1!==e.indexOf("am/pm")&&(e=e.replace(/am\/pm/gi,"a"));var o={format:e};return n.formatDate(r,o)},e.capitaliseFirst=function(e,t,i){var n="";if("Titlecase"===t){for(var r=i?e.split(i):e.split(" "),o=0;o<r.length;o++)n+=i?r[o].charAt(0).toUpperCase()+r[o].slice(1,r[o].length):this.capitaliseFirstInternal(r[o]),r.length>=0&&!i&&(n+=" ");i||(n=this.capitaliseFirst(n,"Titlecase","\r"))}else"FirstCapital"===t&&(n=this.capitaliseFirstInternal(e));return n},e.lowerFirstChar=function(e){return e.charAt(0).toLowerCase()+e.slice(1,e.length)},e.capitaliseFirstInternal=function(e){return e.charAt(0).toUpperCase()+e.slice(1,e.length).toLowerCase()},e.getModifiedDate=function(e){var t=new Date(e);return t.toLocaleDateString([],{year:"numeric",month:"long",day:"numeric"})+" "+t.toLocaleTimeString([],{hour:"numeric",minute:"numeric"})},e.wordBefore="\\b",e.wordAfter="\\b",e.wordSplitCharacters=[" ",",",".",":",";","<",">","=","+","-","_","{","}","[","]","`","~","!","@","#","$","%","^","&","*","(",")",'"',"?","/","|","\\","”"," ","،","؟","؛","’","‘"],e}(),R=function(){function e(e,t){this.xIn=0,this.yIn=0,this.xIn=e,this.yIn=t}return Object.defineProperty(e.prototype,"x",{get:function(){return this.xIn},set:function(e){this.xIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.yIn},set:function(e){this.yIn=e},enumerable:!0,configurable:!0}),e.prototype.copy=function(e){this.xIn=e.xIn,this.yIn=e.yIn},e.prototype.destroy=function(){this.xIn=void 0,this.yIn=void 0},e}(),B=function(){function e(){this.keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}return e.prototype.encodeString=function(e){var t,i,n,r,o,s,a,l="",d=0;for(e=this.unicodeEncode(e);d<e.length;)r=(t=e.charCodeAt(d++))>>2,o=(3&t)<<4|(i=e.charCodeAt(d++))>>4,s=(15&i)<<2|(n=e.charCodeAt(d++))>>6,a=63&n,isNaN(i)?s=a=64:isNaN(n)&&(a=64),l=l+this.keyStr.charAt(r)+this.keyStr.charAt(o)+this.keyStr.charAt(s)+this.keyStr.charAt(a);return l},e.prototype.unicodeEncode=function(e){for(var t=e.replace(/\r\n/g,"\n"),i="",n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?i+=String.fromCharCode(r):r>127&&r<2048?(i+=String.fromCharCode(r>>6|192),i+=String.fromCharCode(63&r|128)):(i+=String.fromCharCode(r>>12|224),i+=String.fromCharCode(r>>6&63|128),i+=String.fromCharCode(63&r|128))}return i},e.prototype.decodeString=function(e){var t,i,n,r,o,s,a=0,l=0,d=3*(e=e.replace(/[^A-Za-z0-9+\/=]/g,"")).length/4;if(e.charAt(e.length-1)===this.keyStr.charAt(64)&&d--,e.charAt(e.length-2)===this.keyStr.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var h=new Uint8Array(0|d);a<e.length;)t=this.keyStr.indexOf(e.charAt(a++))<<2|(r=this.keyStr.indexOf(e.charAt(a++)))>>4,i=(15&r)<<4|(o=this.keyStr.indexOf(e.charAt(a++)))>>2,n=(3&o)<<6|(s=this.keyStr.indexOf(e.charAt(a++))),h[l++]=t,64!==o&&(h[l++]=i),64!==s&&(h[l++]=n);return h},e}(),D=function(){function e(e,t){this.x=0,this.width=0,this.x=e,this.width=t}return Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),e}(),A=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),M=function(){function e(){}return e}(),U=function(e){function t(t){var i=e.call(this)||this;return i.ownerBase=t,i.paragraphFormat=new I(i),i.characterFormat=new k(i),i}return A(t,e),t.prototype.destroy=function(){this.characterFormat.destroy(),this.paragraphFormat.destroy()},t.prototype.copyStyle=function(e){this.name=e.name,this.ownerBase=e.ownerBase,this.type=e.type,this.next=e.next,this.basedOn=e.basedOn,this.link=e.link,this.characterFormat.copyFormat(e.characterFormat),this.paragraphFormat.copyFormat(e.paragraphFormat)},t}(M),z=function(e){function t(t){var i=e.call(this)||this;return i.ownerBase=t,i.characterFormat=new k(i),i}return A(t,e),t.prototype.destroy=function(){this.characterFormat.destroy()},t.prototype.copyStyle=function(e){this.name=e.name,this.ownerBase=e.ownerBase,this.type=e.type,this.next=e.next,this.basedOn=e.basedOn,this.characterFormat.copyFormat(e.characterFormat)},t}(M),V=function(){function e(){this.collection=[]}return Object.defineProperty(e.prototype,"length",{get:function(){return this.collection.length},enumerable:!0,configurable:!0}),e.prototype.remove=function(e){this.collection=this.collection.filter(function(t){return t.name!==e.name})},e.prototype.push=function(e){return null!=e&&void 0!==e&&this.collection.push(e),1},e.prototype.getItem=function(e){return this.collection.length>e?this.collection[e]:null},e.prototype.indexOf=function(e){return this.collection.indexOf(e)},e.prototype.contains=function(e){var t=this.collection.indexOf(e);return t>-1&&t<this.collection.length},e.prototype.clear=function(){for(;this.collection.length>0;)this.collection.pop()},e.prototype.findByName=function(e,i){for(var n,r=0,o=this.collection;r<o.length;r++){var s=o[r];s.name===e&&(n=s,t.isNullOrUndefined(i)||s.type!==i||(n=s))}return n},e.prototype.getStyleNames=function(e){return this.collection.filter(function(t){return t.type===e}).map(function(e){return e.name})},e.prototype.getStyles=function(e){for(var t=[],i=0,n=this.collection.filter(function(t){return t.type===e}).map(function(e){return e});i<n.length;i++){var r=n[i],o={},s={};s.characterFormat={},L.writeCharacterFormat(s.characterFormat,!0,r.characterFormat),o.name=r.name,o.style=JSON.stringify(s),t.push(o)}return t},e}(),_=function(){function e(e){this.uniqueShadingFormat=void 0,this.ownerBase=void 0,this.ownerBase=e}return Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this.getPropertyValue("backgroundColor")},set:function(e){this.setPropertyValue("backgroundColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"foregroundColor",{get:function(){return this.getPropertyValue("foregroundColor")},set:function(e){this.setPropertyValue("foregroundColor",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureStyle",{get:function(){return this.getPropertyValue("textureStyle")},set:function(e){this.setPropertyValue("textureStyle",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var n=m.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueShadingFormat)&&this.uniqueShadingFormat.propertiesHash.containsKey(n))return this.uniqueShadingFormat.propertiesHash.get(n)}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,n){if((t.isNullOrUndefined(n)||""===n)&&(n=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueShadingFormat))this.initializeUniqueShading(i,n);else{var r=m.getPropertyType(this.uniqueShadingFormat.uniqueFormatType,i);if(this.uniqueShadingFormat.propertiesHash.containsKey(r)&&this.uniqueShadingFormat.propertiesHash.get(r)===n)return;this.uniqueShadingFormat=e.uniqueShadingFormats.updateUniqueFormat(this.uniqueShadingFormat,i,n)}},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"backgroundColor":case"foregroundColor":t="empty";break;case"textureStyle":t="TextureNone"}return t},e.prototype.initializeUniqueShading=function(t,i){var n=new u;this.addUniqueShading("backgroundColor",t,i,n),this.addUniqueShading("foregroundColor",t,i,n),this.addUniqueShading("textureStyle",t,i,n),this.uniqueShadingFormat=e.uniqueShadingFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.addUniqueShading=function(t,i,n,r){var o=m.getPropertyType(e.uniqueFormatType,t);t===i?r.add(o,n):r.add(o,e.getPropertyDefaultValue(t))},e.prototype.destroy=function(){t.isNullOrUndefined(this.uniqueShadingFormat)||e.uniqueShadingFormats.remove(this.uniqueShadingFormat),this.uniqueShadingFormat=void 0},e.prototype.cloneFormat=function(){var t=new e(void 0);return t.backgroundColor=this.backgroundColor,t.foregroundColor=this.foregroundColor,t.textureStyle=this.textureStyle,t},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.uniqueShadingFormat)||(this.backgroundColor=e.backgroundColor,this.foregroundColor=e.foregroundColor,this.textureStyle=e.textureStyle)},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueShadingFormat)){var i=m.getPropertyType(this.uniqueShadingFormat.uniqueFormatType,e);return this.uniqueShadingFormat.propertiesHash.containsKey(i)}return!1},e.clear=function(){this.uniqueShadingFormats.clear()},e.uniqueShadingFormats=new f,e.uniqueFormatType=5,e}(),j=function(){function e(e){this.uniqueTableFormat=void 0,this.borders=new E(this),this.shading=new _(this),this.ownerBase=void 0,this.ownerBase=e,this.assignTableMarginValue(5.4,0,5.4,0)}return Object.defineProperty(e.prototype,"allowAutoFit",{get:function(){return this.getPropertyValue("allowAutoFit")},set:function(e){this.setPropertyValue("allowAutoFit",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellSpacing",{get:function(){return this.getPropertyValue("cellSpacing")},set:function(e){if(e<0||e>264.6)throw new RangeError("The measurement must be between 0 px and 264.6 px.");this.setPropertyValue("cellSpacing",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tableAlignment",{get:function(){return this.getPropertyValue("tableAlignment")},set:function(e){this.setPropertyValue("tableAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftIndent",{get:function(){return this.getPropertyValue("leftIndent")},set:function(e){if(e<-1440||e>1440)throw new RangeError("The measurement must be between -1440 px and 1440 px.");this.setPropertyValue("leftIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidth",{get:function(){return this.getPropertyValue("preferredWidth")},set:function(e){this.setPropertyValue("preferredWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidthType",{get:function(){return this.getPropertyValue("preferredWidthType")},set:function(e){this.setPropertyValue("preferredWidthType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bidi",{get:function(){return this.getPropertyValue("bidi")},set:function(e){this.setPropertyValue("bidi",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalPositionAbs",{get:function(){return this.getPropertyValue("horizontalPositionAbs")},set:function(e){this.setPropertyValue("horizontalPositionAbs",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalPosition",{get:function(){return this.getPropertyValue("horizontalPosition")},set:function(e){this.setPropertyValue("horizontalPosition",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var n=m.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueTableFormat)&&this.uniqueTableFormat.propertiesHash.containsKey(n))return this.uniqueTableFormat.propertiesHash.get(n)}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,n){if((t.isNullOrUndefined(n)||""===n)&&(n=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueTableFormat))this.initializeUniqueTableFormat(i,n);else{var r=m.getPropertyType(this.uniqueTableFormat.uniqueFormatType,i);if(this.uniqueTableFormat.propertiesHash.containsKey(r)&&this.uniqueTableFormat.propertiesHash.get(r)===n)return;this.uniqueTableFormat=e.uniqueTableFormats.updateUniqueFormat(this.uniqueTableFormat,i,n)}},e.prototype.initializeUniqueTableFormat=function(t,i){var n=new u;this.addUniqueTableFormat("allowAutoFit",t,i,n),this.addUniqueTableFormat("cellSpacing",t,i,n),this.addUniqueTableFormat("leftMargin",t,i,n),this.addUniqueTableFormat("topMargin",t,i,n),this.addUniqueTableFormat("bottomMargin",t,i,n),this.addUniqueTableFormat("rightMargin",t,i,n),this.addUniqueTableFormat("leftIndent",t,i,n),this.addUniqueTableFormat("tableAlignment",t,i,n),this.addUniqueTableFormat("preferredWidth",t,i,n),this.addUniqueTableFormat("preferredWidthType",t,i,n),this.addUniqueTableFormat("bidi",t,i,n),this.addUniqueTableFormat("horizontalPositionAbs",t,i,n),this.addUniqueTableFormat("horizontalPosition",t,i,n),this.uniqueTableFormat=e.uniqueTableFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.addUniqueTableFormat=function(t,i,n,r){var o;o=m.getPropertyType(e.uniqueFormatType,t),t===i&&r.add(o,n)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"allowAutoFit":t=!1;break;case"cellSpacing":t=0;break;case"leftMargin":t=5.4;break;case"topMargin":case"bottomMargin":t=0;break;case"rightMargin":t=5.4;break;case"leftIndent":t=0;break;case"tableAlignment":t="Left";break;case"preferredWidth":t=0;break;case"preferredWidthType":t="Point";break;case"bidi":t=!1;break;case"horizontalPositionAbs":t=null;break;case"horizontalPosition":t=0}return t},e.prototype.assignTableMarginValue=function(e,t,i,n){this.leftMargin=e,this.topMargin=t,this.rightMargin=i,this.bottomMargin=n},e.prototype.initializeTableBorders=function(){this.borders.left.lineStyle="Single",this.borders.left.lineWidth=.5,this.borders.right.lineStyle="Single",this.borders.right.lineWidth=.5,this.borders.top.lineStyle="Single",this.borders.top.lineWidth=.5,this.borders.bottom.lineStyle="Single",this.borders.bottom.lineWidth=.5,this.borders.horizontal.lineStyle="Single",this.borders.horizontal.lineWidth=.5,this.borders.vertical.lineStyle="Single",this.borders.vertical.lineWidth=.5},e.prototype.destroy=function(){t.isNullOrUndefined(this.borders)||this.borders.destroy(),t.isNullOrUndefined(this.shading)||this.shading.destroy(),t.isNullOrUndefined(this.uniqueTableFormat)||e.uniqueTableFormats.remove(this.uniqueTableFormat),this.uniqueTableFormat=void 0,this.borders=void 0,this.shading=void 0},e.prototype.cloneFormat=function(){var i=new e(void 0);return i.leftIndent=this.leftIndent,i.tableAlignment=this.tableAlignment,i.cellSpacing=this.cellSpacing,i.leftMargin=this.leftMargin,i.rightMargin=this.rightMargin,i.topMargin=this.topMargin,i.bottomMargin=this.bottomMargin,i.preferredWidth=this.preferredWidth,i.preferredWidthType=this.preferredWidthType,i.horizontalPositionAbs=this.horizontalPositionAbs,i.horizontalPosition=this.horizontalPosition,i.borders=t.isNullOrUndefined(this.borders)?void 0:this.borders.cloneFormat(),i.shading=t.isNullOrUndefined(this.shading)?void 0:this.shading.cloneFormat(),i.bidi=this.bidi,i.allowAutoFit=this.allowAutoFit,i},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueTableFormat)){var i=m.getPropertyType(this.uniqueTableFormat.uniqueFormatType,e);return this.uniqueTableFormat.propertiesHash.containsKey(i)}return!1},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.uniqueTableFormat)||(this.cellSpacing=e.cellSpacing,this.leftMargin=e.leftMargin,this.topMargin=e.topMargin,this.rightMargin=e.rightMargin,this.bottomMargin=e.bottomMargin,this.leftIndent=e.leftIndent,this.tableAlignment=e.tableAlignment,this.preferredWidth=e.preferredWidth,this.preferredWidthType=e.preferredWidthType,this.bidi=e.bidi,this.allowAutoFit=e.allowAutoFit,this.horizontalPosition=e.horizontalPosition,this.horizontalPositionAbs=e.horizontalPositionAbs),t.isNullOrUndefined(e.borders)||(this.borders=new E(this),this.borders.copyFormat(e.borders)),t.isNullOrUndefined(e.shading)||(this.shading=new _(this),this.shading.copyFormat(e.shading)))},e.clear=function(){this.uniqueTableFormats.clear()},e.uniqueTableFormats=new f,e.uniqueFormatType=8,e}(),q=function(){function e(e){this.uniqueCellFormat=void 0,this.borders=new E(this),this.shading=new _(this),this.ownerBase=e,this.borders=new E(this),this.shading=new _(this)}return Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.getPropertyValue("leftMargin")},set:function(e){this.setPropertyValue("leftMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.getPropertyValue("rightMargin")},set:function(e){this.setPropertyValue("rightMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.getPropertyValue("topMargin")},set:function(e){this.setPropertyValue("topMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.getPropertyValue("bottomMargin")},set:function(e){this.setPropertyValue("bottomMargin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellWidth",{get:function(){return this.getPropertyValue("cellWidth")},set:function(e){this.setPropertyValue("cellWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columnSpan",{get:function(){return this.getPropertyValue("columnSpan")},set:function(e){this.setPropertyValue("columnSpan",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowSpan",{get:function(){return this.getPropertyValue("rowSpan")},set:function(e){this.setPropertyValue("rowSpan",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidth",{get:function(){return this.getPropertyValue("preferredWidth")},set:function(e){this.setPropertyValue("preferredWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalAlignment",{get:function(){return this.getPropertyValue("verticalAlignment")},set:function(e){this.setPropertyValue("verticalAlignment",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidthType",{get:function(){return this.getPropertyValue("preferredWidthType")},set:function(e){this.setPropertyValue("preferredWidthType",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){if(this.hasValue(i)){var n=m.getPropertyType(e.uniqueFormatType,i);if(!t.isNullOrUndefined(this.uniqueCellFormat)&&this.uniqueCellFormat.propertiesHash.containsKey(n))return this.uniqueCellFormat.propertiesHash.get(n)}return e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,n){if((t.isNullOrUndefined(n)||""===n)&&(n=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueCellFormat))this.initializeUniqueCellFormat(i,n);else{var r=m.getPropertyType(this.uniqueCellFormat.uniqueFormatType,i);if(this.uniqueCellFormat.propertiesHash.containsKey(r)&&this.uniqueCellFormat.propertiesHash.get(r)===n)return;this.uniqueCellFormat=e.uniqueCellFormats.updateUniqueFormat(this.uniqueCellFormat,i,n)}},e.prototype.initializeUniqueCellFormat=function(t,i){var n=new u;this.addUniqueCellFormat("leftMargin",t,i,n),this.addUniqueCellFormat("topMargin",t,i,n),this.addUniqueCellFormat("bottomMargin",t,i,n),this.addUniqueCellFormat("rightMargin",t,i,n),this.addUniqueCellFormat("cellWidth",t,i,n),this.addUniqueCellFormat("columnSpan",t,i,n),this.addUniqueCellFormat("rowSpan",t,i,n),this.addUniqueCellFormat("preferredWidth",t,i,n),this.addUniqueCellFormat("verticalAlignment",t,i,n),this.addUniqueCellFormat("preferredWidthType",t,i,n),this.uniqueCellFormat=e.uniqueCellFormats.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.addUniqueCellFormat=function(t,i,n,r){var o=m.getPropertyType(e.uniqueFormatType,t);t===i&&r.add(o,n)},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"leftMargin":case"topMargin":case"bottomMargin":case"rightMargin":t=void 0;break;case"cellWidth":t=0;break;case"columnSpan":case"rowSpan":t=1;break;case"preferredWidth":t=0;break;case"verticalAlignment":t="Top";break;case"preferredWidthType":t="Point"}return t},e.prototype.containsMargins=function(){return!(t.isNullOrUndefined(this.leftMargin)&&t.isNullOrUndefined(this.rightMargin)&&t.isNullOrUndefined(this.bottomMargin)&&t.isNullOrUndefined(this.topMargin))},e.prototype.destroy=function(){t.isNullOrUndefined(this.borders)||this.borders.destroy(),t.isNullOrUndefined(this.shading)||this.shading.destroy(),t.isNullOrUndefined(this.uniqueCellFormat)||e.uniqueCellFormats.remove(this.uniqueCellFormat),this.uniqueCellFormat=void 0,this.borders=void 0,this.shading=void 0},e.prototype.cloneFormat=function(){var i=new e(void 0);return i.verticalAlignment=this.verticalAlignment,i.leftMargin=this.leftMargin,i.rightMargin=this.rightMargin,i.topMargin=this.topMargin,i.bottomMargin=this.bottomMargin,i.preferredWidth=this.preferredWidth,i.preferredWidthType=this.preferredWidthType,i.cellWidth=this.cellWidth,i.borders=t.isNullOrUndefined(this.borders)?void 0:this.borders.cloneFormat(),i.shading=t.isNullOrUndefined(this.shading)?void 0:this.shading.cloneFormat(),i},e.prototype.hasValue=function(e){if(!t.isNullOrUndefined(this.uniqueCellFormat)){var i=m.getPropertyType(this.uniqueCellFormat.uniqueFormatType,e);return this.uniqueCellFormat.propertiesHash.containsKey(i)}return!1},e.prototype.copyFormat=function(e){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.uniqueCellFormat)||(this.cellWidth=e.cellWidth,this.leftMargin=e.leftMargin,this.topMargin=e.topMargin,this.rightMargin=e.rightMargin,this.bottomMargin=e.bottomMargin,this.preferredWidth=e.preferredWidth,this.columnSpan=e.columnSpan,this.rowSpan=e.rowSpan,this.preferredWidthType=e.preferredWidthType,this.verticalAlignment=e.verticalAlignment),t.isNullOrUndefined(e.shading)||(this.shading=new _(this),this.shading.copyFormat(e.shading)),t.isNullOrUndefined(e.borders)||(this.borders=new E(this),this.borders.copyFormat(e.borders)))},e.clear=function(){this.uniqueCellFormats.clear()},e.uniqueCellFormats=new f,e.uniqueFormatType=4,e}(),G=function(){function e(){this.abstractListIdIn=-1,this.levels=[]}return Object.defineProperty(e.prototype,"abstractListId",{get:function(){return this.abstractListIdIn},set:function(e){this.abstractListIdIn=e},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.levels)){for(var e=0;e<this.levels.length;e++){var i=this.levels[e];i.destroy(),this.levels.splice(this.levels.indexOf(i),1),e--}this.levels=[]}this.levels=void 0},e.prototype.clone=function(){for(var t=new e,i=0;i<this.levels.length;i++)t.levels.push(this.levels[i].clone(t));return t},e}(),K=function(){function e(e){this.uniqueListLevel=void 0,this.paragraphFormat=void 0,this.characterFormat=void 0,this.ownerBase=e,this.characterFormat=new k(void 0),this.paragraphFormat=new I(void 0)}return Object.defineProperty(e.prototype,"listLevelPattern",{get:function(){return this.getPropertyValue("listLevelPattern")},set:function(e){this.setPropertyValue("listLevelPattern",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"followCharacter",{get:function(){return this.getPropertyValue("followCharacter")},set:function(e){this.setPropertyValue("followCharacter",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startAt",{get:function(){return this.getPropertyValue("startAt")},set:function(e){this.setPropertyValue("startAt",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numberFormat",{get:function(){return this.getPropertyValue("numberFormat")},set:function(e){this.setPropertyValue("numberFormat",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartLevel",{get:function(){return this.getPropertyValue("restartLevel")},set:function(e){this.setPropertyValue("restartLevel",e)},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(i){var n=m.getPropertyType(e.uniqueFormatType,i);return!t.isNullOrUndefined(this.uniqueListLevel)&&this.uniqueListLevel.propertiesHash.containsKey(n)?this.uniqueListLevel.propertiesHash.get(n):e.getPropertyDefaultValue(i)},e.prototype.setPropertyValue=function(i,n){if((t.isNullOrUndefined(n)||""===n)&&(n=e.getPropertyDefaultValue(i)),t.isNullOrUndefined(this.uniqueListLevel))this.initializeUniqueWListLevel(i,n);else{var r=m.getPropertyType(this.uniqueListLevel.uniqueFormatType,i);if(this.uniqueListLevel.propertiesHash.containsKey(r)&&this.uniqueListLevel.propertiesHash.get(r)===n)return;this.uniqueListLevel=e.uniqueListLevels.updateUniqueFormat(this.uniqueListLevel,i,n)}},e.prototype.initializeUniqueWListLevel=function(t,i){var n=new u;this.addUniqueWListLevel("listLevelPattern",t,i,n),this.addUniqueWListLevel("startAt",t,i,n),this.addUniqueWListLevel("followCharacter",t,i,n),this.addUniqueWListLevel("numberFormat",t,i,n),this.addUniqueWListLevel("restartLevel",t,i,n),this.uniqueListLevel=e.uniqueListLevels.addUniqueFormat(n,e.uniqueFormatType)},e.prototype.addUniqueWListLevel=function(t,i,n,r){var o;o=m.getPropertyType(e.uniqueFormatType,t),t===i?r.add(o,n):r.add(o,e.getPropertyDefaultValue(t))},e.getPropertyDefaultValue=function(e){var t=void 0;switch(e){case"listLevelPattern":t="Arabic";break;case"startAt":t=0;break;case"followCharacter":t="Tab";break;case"numberFormat":t="";break;case"restartLevel":t=0}return t},e.prototype.destroy=function(){t.isNullOrUndefined(this.characterFormat)||this.characterFormat.destroy(),t.isNullOrUndefined(this.paragraphFormat)||this.paragraphFormat.destroy(),t.isNullOrUndefined(this.uniqueListLevel)||e.uniqueListLevels.remove(this.uniqueListLevel),this.uniqueListLevel=void 0,this.characterFormat=void 0,this.paragraphFormat=void 0},e.clear=function(){this.uniqueListLevels.clear()},e.prototype.clone=function(t){var i=new e(t);return i.paragraphFormat=this.paragraphFormat.cloneFormat(),i.characterFormat=this.characterFormat.cloneFormat(),this.uniqueListLevel&&(i.uniqueListLevel=this.uniqueListLevel,i.uniqueListLevel.referenceCount++),i},e.dotBullet="",e.squareBullet="",e.arrowBullet="➤",e.circleBullet=" ",e.uniqueListLevels=new f,e.uniqueFormatType=9,e}(),X=function(){function e(e){this.islayoutFootnote=!1,this.allowLayout=!0,this.footHeight=0,this.footnoteHeight=0,this.isTableFootNote=!1,this.isRelayout=!1,this.isInitialLoad=!0,this.fieldBegin=void 0,this.maxTextHeight=0,this.maxBaseline=0,this.maxTextBaseline=0,this.isFieldCode=!1,this.isRtlFieldCode=!1,this.isRTLLayout=!1,this.currentCell=void 0,this.isFootnoteContentChanged=!1,this.isEndnoteContentChanged=!1,this.isLayoutWhole=!1,this.isBidiReLayout=!1,this.defaultTabWidthPixel=48,this.isRelayoutFootnote=!1,this.isRelayoutOverlap=!1,this.isWrapText=!1,this.isYPositionUpdated=!1,this.isXPositionUpdated=!1,this.hasFloatingElement=!1,this.isFootNoteLayoutStart=!1,this.wrapPosition=[],this.documentHelper=e}return e.prototype.isSameStyle=function(e,i){var n=void 0;return i?e.nextWidget instanceof we&&(n=e.nextWidget):e.previousWidget instanceof we&&(n=e.previousWidget),!t.isNullOrUndefined(n)&&(e.paragraphFormat.baseStyle===n.paragraphFormat.baseStyle&&e.paragraphFormat.contextualSpacing)},Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.layout=function(){},e.prototype.destroy=function(){this.documentHelper=void 0,this.value=void 0,this.allowLayout=void 0,this.isInitialLoad=void 0,this.fieldBegin=void 0,this.maxTextHeight=void 0,this.maxBaseline=void 0,this.maxTextBaseline=void 0,this.isFieldCode=void 0,this.footnoteHeight=void 0},e.prototype.layoutItems=function(e,t){for(var i,n=this,r=0;r<e.length;r++){var o=e[r],s=this.documentHelper.pages[this.documentHelper.pages.length-1];if(r>0&&e[r-1].lastChild.isEndsWithPageBreak&&0===s.bodyWidgets[0].childWidgets.length&&this.documentHelper.pages.splice(this.documentHelper.pages.length-1,1),i=this.viewer.createNewPage(o),this.addBodyWidget(this.viewer.clientActiveArea,o),this.documentHelper.pages.length>1){for(var a=0,l=0;l<this.documentHelper.pages.length;l++){var d=this.documentHelper.pages[l];if(d.sectionIndex>o.index||d===i)break;a++}a<this.documentHelper.pages.length-1&&this.documentHelper.insertPage(a,i)}this.layoutSection(o,0)}t||this.layoutComments(this.documentHelper.comments),this.updateFieldElements(),"Pages"===this.documentHelper.owner.layoutType&&this.layoutEndNoteElement(),setTimeout(function(){n.documentHelper&&(n.documentHelper.isScrollHandler=!0,n.documentHelper.owner.isSpellCheck&&n.documentHelper.owner.spellChecker.enableOptimizedSpellCheck&&(n.documentHelper.triggerElementsOnLoading=!0),n.documentHelper.clearContent(),n.viewer.updateScrollBars(),n.documentHelper.isScrollHandler=!1,n.isInitialLoad=!1)},50)},e.prototype.layoutComments=function(e){t.isNullOrUndefined(e)||this.viewer.owner.commentReviewPane.layoutComments()},e.prototype.layoutSection=function(e,i){var n,r,o=e.firstChild;do{o instanceof xe&&"Auto"===o.tableFormat.preferredWidthType&&!o.tableFormat.allowAutoFit&&o.calculateGrid(),this.viewer.updateClientAreaForBlock(o,!0),n=this.layoutBlock(o,i),i=0,this.viewer.updateClientAreaForBlock(o,!1),r&&t.isNullOrUndefined(r.nextWidget)&&r.bodyWidget&&r.bodyWidget.page.footnoteWidget&&this.layoutfootNote(r.bodyWidget.page.footnoteWidget),r=o,o=n,t.isNullOrUndefined(o)&&r.bodyWidget.page.footnoteWidget&&this.layoutfootNote(r.bodyWidget.page.footnoteWidget)}while(o)},e.prototype.layoutHeaderFooter=function(e,t,i){var n=t.getCurrentPageHeaderFooter(e,!0);if(n){var r=n.clone();r.page=i,this.updateRevisionsToHeaderFooter(r,i),t.updateHFClientArea(e.sectionFormat,!0),i.headerWidget=this.layoutHeaderFooterItems(t,r),this.updateHeaderFooterToParent(r)}if(n=t.getCurrentPageHeaderFooter(e,!1)){var o=n.clone();o.page=i,t.updateHFClientArea(e.sectionFormat,!1),this.updateRevisionsToHeaderFooter(o,i),i.footerWidget=this.layoutHeaderFooterItems(t,o),this.updateHeaderFooterToParent(o)}},e.prototype.updateHeaderFooterToParent=function(e){var t=e.page.sectionIndex,i=this.viewer.getHeaderFooter(e.headerFooterType),n=e.clone();this.documentHelper.headersFooters[t][i]=n;for(var r=0;r<n.childWidgets.length;r++){var o=n.childWidgets[r];o instanceof xe&&this.clearTableWidget(o,!1,!0)}return n},e.prototype.updateRevisionsToHeaderFooter=function(e,t){var i=e.childWidgets;if(e instanceof ve&&i.length>0)for(var n=0;n<i.length;n++)if(i[n].childWidgets.length>0)for(var r=i[n].childWidgets,o=0;o<r.length;o++){var s=r[o].children;if(s)for(var a=0;a<s.length;a++)if(s[a].removedIds.length>0)for(var l=s[a].removedIds,d=0;d<l.length;d++){var h=this.documentHelper.revisionsInternal.get(l[d]);s[a].revisions[d]=h,this.updateRevisionRange(h,t)}}},e.prototype.updateRevisionRange=function(e,t){for(var i=0;i<e.range.length;i++){var n=e.range[i];n.line.paragraph.bodyWidget.page||(n.line.paragraph.bodyWidget.page=t)}},e.prototype.linkFieldInHeaderFooter=function(e){var t=e.firstChild;do{t instanceof we?this.linkFieldInParagraph(t):this.linkFieldInTable(t)}while(t=t.nextWidget)},e.prototype.linkFieldInParagraph=function(e){for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],n=0;n<i.children.length;n++){var r=i.children[n];if(r instanceof Ie&&(0!==r.fieldType||0===r.fieldType&&-1===this.documentHelper.fields.indexOf(r))&&r.linkFieldCharacter(this.documentHelper),r instanceof Be&&r.fieldBegin!==r.previousElement.fieldBegin&&(r.fieldBegin=r.previousElement.fieldBegin),r instanceof Ke){var o=r.textFrame.firstChild;do{o instanceof we?this.linkFieldInParagraph(o):this.linkFieldInTable(o)}while(o=o.nextWidget)}}},e.prototype.linkFieldInTable=function(e){for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],n=0;n<i.childWidgets.length;n++)for(var r=i.childWidgets[n],o=0;o<r.childWidgets.length;o++){var s=r.childWidgets[o];s instanceof we?this.linkFieldInParagraph(s):this.linkFieldInTable(s)}},e.prototype.layoutHeaderFooterItems=function(e,t){if(this.viewer.updateClientAreaLocation(t,e.clientActiveArea),0===t.childWidgets.length){var i=new we,n=new Te(i);i.childWidgets.push(n),t.childWidgets.push(i),i.containerWidget=t}this.linkFieldInHeaderFooter(t);for(var r=0;r<t.childWidgets.length;r++){var o=t.childWidgets[r];o instanceof xe&&"Auto"===o.tableFormat.preferredWidthType&&!o.tableFormat.allowAutoFit&&!o.isGridUpdated&&o.calculateGrid(),e.updateClientAreaForBlock(o,!0),this.layoutBlock(o,0),e.updateClientAreaForBlock(o,!1)}var s=t.headerFooterType;return"OddFooter"!==s&&"EvenFooter"!==s&&"FirstPageFooter"!==s||this.shiftChildLocation(e.clientArea.y-e.clientActiveArea.y,t),t},e.prototype.shiftChildLocation=function(e,t){var i=t.y+e,n=t.page.boundingRectangle.height-t.page.boundingRectangle.height/100*40;e=(i=Math.max(i,n))-t.y;for(var r=t.y=i,o=0;o<t.childWidgets.length;o++){var s=t.childWidgets[o];if(s instanceof we){var a=s.childWidgets[0];s.x=s.x,s.y=0===o?s.y+e:r,r+=s.height;for(var l=0;l<a.children.length;l++){var d=a.children[l];d instanceof Ke&&(d.y=s.y+d.verticalPosition)}}else this.shiftChildLocationForTableWidget(s,e),r+=s.height}},e.prototype.shiftChildLocationForTableWidget=function(e,t){e.y=e.y+t;for(var i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];n instanceof Fe&&this.shiftChildLocationForTableRowWidget(n,t)}},e.prototype.shiftChildLocationForTableRowWidget=function(e,t){e.y=e.y+t;for(var i=0;i<e.childWidgets.length;i++)this.shiftChildLocationForTableCellWidget(e.childWidgets[i],t)},e.prototype.shiftChildLocationForTableCellWidget=function(e,t){e.y=e.y+t;for(var i=0;i<e.childWidgets.length;i++)e.childWidgets[i]instanceof we?(e.childWidgets[i].x=e.childWidgets[i].x,e.childWidgets[i].y=e.childWidgets[i].y+t):this.shiftChildLocationForTableWidget(e.childWidgets[i],t)},e.prototype.layoutBlock=function(e,t){var i;if(e instanceof we){i=this.layoutParagraph(e,t);var n=this.checkAndRelayoutPreviousOverlappingBlock(e);n&&(i=n)}else e.calculateGrid(),e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0,i=this.layoutTable(e,t),this.checkAndRelayoutPreviousOverlappingBlock(e),this.updateTableYPositionBasedonTextWrap(i);return i.nextRenderedWidget},e.prototype.updateTableYPositionBasedonTextWrap=function(e){var i=this;if(!t.isNullOrUndefined(e.bodyWidget)){var n=e.y,r=new ce(e.x,e.y,e.width,e.height);e.bodyWidget.floatingElements.forEach(function(t){if(t instanceof Ke&&!t.paragraph.isInsideTable){var o=new ce(t.x,t.y,t.width,t.height);if(("TopAndBottom"===t.textWrappingStyle||"Square"===t.textWrappingStyle)&&r.isIntersecting(o)){e.y=t.y+t.height+t.distanceBottom,i.updateChildLocationForTable(e.y,e);var s=e.y-n;i.viewer.cutFromTop(i.viewer.clientActiveArea.y+s)}}})}},e.prototype.checkAndRelayoutPreviousOverlappingBlock=function(e){if(!(e.containerWidget instanceof Xe||this.isRelayoutOverlap)){var t=e.previousWidget;if(e instanceof we)if(e.floatingElements.length>0)for(var i=0;i<e.floatingElements.length;i++){var n=e.floatingElements[i];if("InFrontOfText"!==n.textWrappingStyle&&"Behind"!==n.textWrappingStyle){for(var r=new ce(n.x,n.y,n.width,n.height);t;){if(t instanceof we){var o=new ce(t.x,t.y,t.width,t.height);r.isIntersecting(o)&&this.startOverlapWidget!==t&&(this.startOverlapWidget=t,this.endOverlapWidget=e)}t=t.previousWidget}t=e.previousWidget}}else{var s=e.getSplitWidgets();if(s)return s[s.length-1]}else{var a=e;if(!a.wrapTextAround)return a;for(var l=new ce(a.x,a.y,a.getTableCellWidth(),a.height);t;){if(t instanceof we){var d=new ce(t.x,t.y,t.width,t.height);l.isIntersecting(d)&&this.startOverlapWidget!==t&&(this.startOverlapWidget=t,this.endOverlapWidget=e)}t=t.previousWidget}t=e.previousWidget}this.startOverlapWidget&&(this.isRelayoutOverlap=!0,this.layoutStartEndBlocks(this.startOverlapWidget,e),this.isRelayoutOverlap=!1),this.startOverlapWidget=void 0,this.endOverlapWidget=void 0}return e},e.prototype.addParagraphWidget=function(e,i){if(!i.isEmpty()||t.isNullOrUndefined(i.paragraphFormat)||"Center"!==i.paragraphFormat.textAlignment&&"Right"!==i.paragraphFormat.textAlignment||-1!==i.paragraphFormat.listFormat.listId)i.width=e.width,i.x=e.x,i.y=e.y;else{var n=this.documentHelper.textHelper.getParagraphMarkWidth(i.characterFormat),r=e.x;"Center"===i.paragraphFormat.textAlignment?r+=(e.width-n)/2:r+=e.width-n,i.width=n,i.x=r,i.y=e.y}return i},e.prototype.addLineWidget=function(e){var t=void 0;return t=new Te(e),t.width=e.width,e.childWidgets.push(t),t.paragraph=e,t},e.prototype.isFirstElementWithPageBreak=function(e){var t=!1;if(this.viewer instanceof le){var i=e.childWidgets[0];if(i)for(var n=i.children[0];n;){if(!(n instanceof Ae&&n.name.indexOf("_")>=0)){n instanceof Oe&&"\f"===n.text&&(t=!0);break}n=n.nextElement}}return t},e.prototype.layoutfootNote=function(e){if("Pages"===this.documentHelper.owner.layoutType){var t=this.viewer.clientActiveArea,i=this.viewer.clientArea;"Footnote"===e.footNoteType&&this.viewer.updateFootnoteClientArea(e.sectionFormat,e);var n=void 0;this.isRelayoutFootnote=!1,this.viewer.clientActiveArea.y=this.viewer.clientActiveArea.y-e.page.footerWidget.height+e.page.bodyWidgets[0].sectionFormat.footerDistance;for(var r=0;r<e.childWidgets.length;r++)(n=e.childWidgets[r]).index=r,n.containerWidget=e,this.viewer.updateClientAreaForBlock(n,!0),this.layoutBlock(n,0),0===r&&(e.y=n.y),this.viewer.updateClientAreaForBlock(n,!1);this.viewer.clientActiveArea=t,this.viewer.clientArea=i,e.page.bodyWidgets[0].lastChild instanceof xe&&e.page.bodyWidgets[0].lastChild.y+e.page.bodyWidgets[0].lastChild.height>e.y&&this.reLayoutTable(e.page.bodyWidgets[0].lastChild,!0)}return e},e.prototype.layoutParagraph=function(e,i){this.addParagraphWidget(this.viewer.clientActiveArea,e);var n=!0;if(this.isFirstElementWithPageBreak(e)||(this.layoutListItems(e),n=!1),e.isEmpty())this.layoutEmptyLineWidget(e,!0);else{var r=i<e.childWidgets.length?e.childWidgets[i]:void 0;for(this.isRelayoutOverlap||e.containerWidget instanceof Xe||this.layoutFloatElements(e);r instanceof Te;){if(e!==r.paragraph&&0===r.indexInOwner&&n&&this.layoutListItems(r.paragraph),r.isFirstLine()&&t.isNullOrUndefined(this.fieldBegin)&&!t.isNullOrUndefined(e.paragraphFormat)){var o=-L.convertPointToPixel(e.paragraphFormat.firstLineIndent);this.viewer.updateClientWidth(o)}r.marginTop=0,e=(r=this.layoutLine(r,0)).paragraph,r=r.nextLine}}return this.updateWidgetToPage(this.viewer,e),e.isLayouted=!0,e},e.prototype.clearLineMeasures=function(){this.maxBaseline=0,this.maxTextBaseline=0,this.maxTextHeight=0},e.prototype.layoutFloatElements=function(e){var t=this;e.floatingElements.forEach(function(e){e instanceof Ge&&(t.isRelayoutOverlap||t.layoutShape(e))})},e.prototype.layoutShape=function(e){if("Inline"!==e.textWrappingStyle){var t=this.getFloatingItemPoints(e);e.x=t.x,e.y=t.y;var i=e.paragraph.bodyWidget;-1===i.floatingElements.indexOf(e)&&(i.floatingElements.push(e),i.floatingElements.sort(function(e,t){return e.y-t.y})),-1===e.paragraph.floatingElements.indexOf(e)&&e.paragraph.floatingElements.push(e)}var n=this.viewer.clientArea,r=this.viewer.clientActiveArea;if(e instanceof Ke){var o=e.textFrame.childWidgets;this.viewer.updateClientAreaForTextBoxShape(e,!0);for(var s=0;s<o.length;s++){var a=o[s];this.viewer.updateClientAreaForBlock(a,!0),a instanceof xe&&this.clearTableWidget(a,!0,!0),this.layoutBlock(a,0),this.viewer.updateClientAreaForBlock(a,!1)}}this.viewer.clientActiveArea=r,this.viewer.clientArea=n},e.prototype.moveElementFromNextLine=function(e){for(var t=e.nextLine;t instanceof Te;){if(t.children.length>0){var i=t.children.splice(0,1)[0];e.children.push(i),i.line=e;break}1===t.paragraph.childWidgets.length?t.paragraph.destroy():t.paragraph.childWidgets.splice(t.paragraph.childWidgets.indexOf(t),1),t=e.nextLine}},e.prototype.layoutLine=function(e,i){var n=e.paragraph;0===e.children.length&&this.moveElementFromNextLine(e);var r=e.children[i];for(this.clearLineMeasures(),e.marginTop=0;r instanceof Se;){if(r.padding.left=0,this.layoutElement(r,n),e=r.line,r instanceof Oe){var o=r;!t.isNullOrUndefined(o.errorCollection)&&o.errorCollection.length>0&&(o.ischangeDetected=!0)}this.isRTLLayout?(r=void 0,this.isRTLLayout=!1):this.hasFloatingElement?this.hasFloatingElement=!1:r=r.nextElement}return e},e.prototype.layoutElement=function(e,i){var n=e.line,r="",o=e.indexInOwner;if(e instanceof Ie)return 0===e.fieldType&&(-1===this.documentHelper.fields.indexOf(e)&&this.documentHelper.fields.push(e),t.isNullOrUndefined(e.formFieldData)||-1!==this.documentHelper.formFields.indexOf(e)||this.documentHelper.formFields.push(e)),this.layoutFieldCharacters(e),void(e.line.isLastLine()&&t.isNullOrUndefined(e.nextNode)&&!this.isFieldCode?(2!==e.fieldType&&t.isNullOrUndefined(e.fieldSeparator)&&this.layoutEmptyLineWidget(i,!1,e.line),this.moveToNextLine(n)):t.isNullOrUndefined(e.nextElement)&&this.viewer.clientActiveArea.width>0&&!e.line.isLastLine()?(this.moveElementFromNextLine(n),e.line.isLastLine()&&t.isNullOrUndefined(e.nextNode)&&!this.isFieldCode&&(2!==e.fieldType&&t.isNullOrUndefined(e.fieldSeparator)&&this.layoutEmptyLineWidget(i,!1,e.line),this.moveToNextLine(n))):t.isNullOrUndefined(e.nextElement)&&0===this.viewer.clientActiveArea.width&&(this.moveToNextLine(n),n.paragraph.lastChild===n&&!t.isNullOrUndefined(n.nextLine)&&this.viewer.clientActiveArea.height>=0&&this.moveFromNextPage(n)));if(e instanceof Qe||this.isFieldCode||e instanceof Ae||e instanceof $e||e instanceof et||e instanceof Me||e instanceof Ge&&"Inline"!==e.textWrappingStyle){if(e instanceof Ae)if(0!==e.bookmarkType||this.documentHelper.bookmarks.containsKey(e.name))if(1===e.bookmarkType&&this.documentHelper.bookmarks.containsKey(e.name)){var s=this.documentHelper.bookmarks.get(e.name);(t.isNullOrUndefined(s.reference)||t.isNullOrUndefined(s.reference.paragraph.bodyWidget))&&(s.reference=e,e.reference=s)}else 0===e.bookmarkType&&this.documentHelper.bookmarks.containsKey(e.name)&&t.isNullOrUndefined(e.reference)&&this.documentHelper.bookmarks.remove(e.name);else this.documentHelper.bookmarks.add(e.name,e);if(e instanceof Me&&-1===this.documentHelper.contentControlCollection.indexOf(e))if(0===e.type)this.documentHelper.contentControlCollection.push(e);else if(1===e.type)for(var a=e.paragraph.bodyWidget.page,l=0;l<this.documentHelper.contentControlCollection.length;l++){var d=this.documentHelper.contentControlCollection[l],h=d.line.paragraph.isInHeaderFooter;h&&e.contentControlProperties===d.contentControlProperties&&a===d.line.paragraph.bodyWidget.page?(e.reference=d,d.reference=e):h||e.contentControlProperties!==d.contentControlProperties||(e.reference=d,d.reference=e)}return t.isNullOrUndefined(e.nextElement)&&this.viewer.clientActiveArea.width>0&&!e.line.isLastLine()&&this.moveElementFromNextLine(n),void(e.line.isLastLine()&&t.isNullOrUndefined(e.nextElement)&&(this.hasValidElement(n.paragraph)?this.moveToNextLine(n):this.layoutEmptyLineWidget(n.paragraph,!1,n,!1)))}var c=e.width;if(e instanceof Be&&!this.isTocField(e.fieldBegin))""!==(r=this.documentHelper.getFieldResult(e.fieldBegin,e.paragraph.bodyWidget.page))?e.text=r:r=e.text;else if(e instanceof Le)""!==(r=this.startAt(e,r))&&(e.text=r);else if(e instanceof Oe){if(this.checkAndSplitTabOrLineBreakCharacter(e.text,e),e.text.length>1&&e.line.paragraph.bidi){var p=this.splitTextByConsecutiveLtrAndRtl(e);this.updateSplittedText(e,p)}r=e.text}if(e instanceof Oe&&(c=this.documentHelper.textHelper.getTextSize(e,e.characterFormat),"\t"===e.text&&(e.width=this.getTabWidth(i,this.viewer,o,n,e))),t.isNullOrUndefined(i.containerWidget)||!(i.bodyWidget.floatingElements.length>0)||e instanceof Ke||i.containerWidget instanceof Xe||this.adjustPosition(e,e.line.paragraph.bodyWidget),this.viewer instanceof le&&(e instanceof Ke&&"Inline"===e.textWrappingStyle||!(e instanceof Ke))&&this.viewer.clientActiveArea.height<e.height&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y&&(!(e instanceof Oe&&"\f"!==e.text)&&e instanceof Oe||this.moveToNextPage(this.viewer,n),e instanceof Be&&this.updateFieldText(e),!e.previousElement||!(e.previousElement instanceof Ke&&"Inline"===e.previousElement.textWrappingStyle)&&e.previousElement instanceof Ke||this.cutClientWidth(e.previousElement)),e instanceof Ke&&"Inline"===e.textWrappingStyle&&this.layoutShape(e),e instanceof Le&&(!e.isLayout||this.isLayoutWhole)&&"Pages"===this.documentHelper.owner.layoutType&&this.layoutFootEndNoteElement(e),e instanceof Ze&&(0!==e.top&&!t.isNullOrUndefined(e.top)||0!==e.bottom&&!t.isNullOrUndefined(e.bottom)||0!==e.left&&!t.isNullOrUndefined(e.left)||0!==e.right&&!t.isNullOrUndefined(e.right))&&this.cropPosition(e),parseFloat(c.toFixed(4))<=parseFloat(this.viewer.clientActiveArea.width.toFixed(4))||!this.viewer.textWrap)this.addElementToLine(i,e),t.isNullOrUndefined(e.nextElement)&&this.viewer.clientActiveArea.width>0&&!e.line.isLastLine()?this.moveElementFromNextLine(n):!e.line.isLastLine()&&t.isNullOrUndefined(e.nextElement)&&0===this.viewer.clientActiveArea.width&&(this.moveToNextLine(n),n.paragraph.lastChild===n&&this.viewer.clientActiveArea.height>=0&&this.moveFromNextPage(n));else if(e instanceof Oe)if("\t"===e.text){var g=e.line;this.addSplittedLineWidget(g,g.children.indexOf(e)-1),this.moveToNextLine(g),e.width=this.getTabWidth(i,this.viewer,o,e.line,e),this.addElementToLine(i,e)}else do{n=e.line,this.splitTextForClientArea(n,e,e.text,e.width,e.characterFormat),this.checkLineWidgetWithClientArea(n,e),e instanceof Be&&this.updateFieldText(e)}while(e.line!==n&&this.cutClientWidth(e));else do{n=e.line,this.splitElementForClientArea(i,e),this.checkLineWidgetWithClientArea(n,e),e instanceof Be&&this.updateFieldText(e)}while(e.line!==n&&this.cutClientWidth(e));if("\v"===r||"\f"===r){var u=n.children.indexOf(e);u>-1&&this.addSplittedLineWidget(n,u)}if(e.line.isLastLine()&&t.isNullOrUndefined(e.nextElement)||"\v"===r||"\f"===r){if(this.isXPositionUpdated)return void(this.isXPositionUpdated=!1);this.moveToNextLine(e.line),"\v"===r&&t.isNullOrUndefined(e.nextNode)?this.layoutEmptyLineWidget(i,!0,n,!0):"\f"===r&&this.viewer instanceof le&&(t.isNullOrUndefined(e.nextNode)?this.moveToNextPage(this.viewer,e.line,!0):t.isNullOrUndefined(e.line.nextLine)||this.moveToNextPage(this.viewer,e.line.nextLine,!1))}this.isXPositionUpdated=!1},e.prototype.adjustPosition=function(e,t){var i=this.viewer.clientActiveArea,n=this.viewer.clientActiveArea.x,r=this.viewer.clientActiveArea.y,o=this.viewer.clientActiveArea.width,s=this.adjustClientAreaBasedOnTextWrap(e,new ce(i.x,i.y,i.width,i.height));this.viewer.clientActiveArea.width=s.width;var a=this.viewer.clientActiveArea.x-n;if(e.padding.left=a,o!==this.viewer.clientActiveArea.width){var l=new D(this.viewer.clientActiveArea.x,this.viewer.clientActiveArea.width);this.updateWrapPosition(l)}0===this.viewer.clientActiveArea.width&&(this.isWrapText=!1),this.isYPositionUpdated&&(e.line.isFirstLine()?e.line.paragraph.y+=this.viewer.clientActiveArea.y-r:e.line.marginTop+=this.viewer.clientActiveArea.y-r,this.isYPositionUpdated=!1)},e.prototype.updateWrapPosition=function(e){for(var t=0;t<this.wrapPosition.length;t++){var i=this.wrapPosition[t];if(!(Math.abs(i.right-e.right)>1))return}this.wrapPosition.push(e)},e.prototype.isFirstitemInPage=function(e,t){return!e.line.paragraph.isInHeaderFooter&&Math.round(t)===this.viewer.clientArea.y},e.prototype.isTextFitBelow=function(e,t,i){return!1},e.prototype.isNeedToWrapForSquareTightAndThrough=function(e,t,i,n,r,o,s,a,l,d,h,c,p){return e.floatingElements.length>0&&i!==a&&n!==a&&"Inline"!==r&&"Behind"!==r&&"TopAndBottom"!==r&&"InFrontOfText"!==r&&(Math.round(h.y+p)>Math.round(o.y)||this.isTextFitBelow(o,h.y+p,l))&&Math.round(h.y)<Math.round(o.y+o.height)&&!(s&&(d||t instanceof Ze&&"Inline"!==t.textWrappingStyle&&t.allowOverlap))},e.prototype.isNeedToWrapForSquareTightAndThroughForTable=function(e,t,i,n,r,o,s,a,l,d,h,c,p){return e.floatingElements.length>0&&i!==a&&n!==a&&"Inline"!==r&&"Behind"!==r&&"TopAndBottom"!==r&&"InFrontOfText"!==r&&Math.round(h.y+p)>=Math.round(o.y)&&Math.round(h.y)<Math.round(o.y+o.height)&&!(s&&d)},e.prototype.isNeedToWrapLeafWidget=function(e,t){return e.bodyWidget.floatingElements.length>0&&!0&&(!e.isInHeaderFooter||e.associatedCell)&&!(t instanceof Ze)},e.prototype.getMinWidth=function(e,t,i,n){var r=e.text,o=r.split(" ");""!==r&&""===r.trim()&&e&&e.line.paragraph&&e.previousNode&&e.nextNode&&e.line.paragraph.isEmpty&&(o=[""]);var s=this.documentHelper.textHelper.measureText(o[0],e.characterFormat).Width,a=this.getNextSibling(e);if(1===o.length&&a){var l=a.text;s+=this.getNextTextRangeWidth(a,l,t,i,n)}return s},e.prototype.getNextTextRangeWidth=function(e,t,i,n,r){for(var o=e,s=new ce(0,0,0,0),a=this.isNextSibligSizeNeedToBeMeasure(s,e,r,i,n);a&&this.isLeafWidgetNextSiblingIsTextRange(o)&&i+s.width<r.width&&(o=this.getNextSibling(o),this.isNextSibligSizeNeedToBeMeasure(s,o,r,i,n));)t+=o.text;return s.width},e.prototype.isLeafWidgetNextSiblingIsTextRange=function(e){var t=this.getNextSibling(e);return!!(t&&t instanceof Oe)},e.prototype.isNextSibligSizeNeedToBeMeasure=function(e,t,i,n,r){var o=null,s=t;if(s){if(-1!==(o=s.text).indexOf(" ")||-1!==o.indexOf("-")||-1!==o.indexOf("_")&&n+e.width+this.documentHelper.textHelper.measureText(o.split("-")[0],s.characterFormat).Width<i.width||"\t"===s.text){var a=s.width;return o!==o.split(" ")[0]&&(a=this.documentHelper.textHelper.measureText(o.split(" ")[0],s.characterFormat).Width),n+e.width+a>i.width&&o.indexOf("-")&&o!==o.split("-")[0]+"-"&&(a=this.documentHelper.textHelper.measureText(o.split("-")[0]+"-",s.characterFormat).Width),e.width+=a,!1}if(s.text.length>0){var l=this.documentHelper.textHelper.measureText(s.text,s.characterFormat);e.height+=l.Height,e.width+=l.Width}}return!0},e.prototype.isNeedDoIntermediateWrapping=function(e,t,i,n,r,o,s,a,l){return e>l&&((Math.round(i.width)<=Math.round(a)||i.width<n&&s.paragraph.isInsideTable)&&"Left"!==t&&"Largest"!==t||"Right"===t||i.width<e&&"Largest"===t)||(Math.round(o.x-r.x+r.leftIndent)<l||s instanceof Oe&&this.isFloatingItemOnLeft(i,a,o))&&("Left"!==t||e<l)},e.prototype.isFloatingItemOnLeft=function(e,t,i){return!1},e.prototype.getNextSibling=function(e){e.line.paragraph;for(var t=e.nextNode,i=!1;t;){if(t instanceof Ie||t instanceof Ae||i||t instanceof Qe)t instanceof Ie&&(0===t.fieldType?i=!0:2===t.fieldType&&(i=!1));else if(t instanceof Oe)break;t=t.nextNode}return t},e.prototype.adjustClientAreaBasedOnTextWrap=function(e,i){var n=e.line.paragraph,r=n.bodyWidget,o=this.viewer,s=i.y;this.isFirstitemInPage(e,s);if(t.isNullOrUndefined(n.previousWidget),this.isNeedToWrapLeafWidget(n,e)){var a=o.clientArea;r.floatingElements.sort(function(e,t){return e.y-t.y}),r.floatingElements.sort(function(e,t){return e.x-t.x});for(var l=0;l<r.floatingElements.length;l++){var d=r.floatingElements[l],h=!1;if(h=d instanceof Ge?d.allowOverlap:d.positioning.allowOverlap,(!(n.isInsideTable&&d instanceof xe)||d.isInsideTable)&&!(this.isRelayout&&!this.isRelayoutOverlap&&this.viewer.documentHelper.selection.isExistAfter(d instanceof xe?d:d.line.paragraph,e.line.paragraph)||this.isRelayout&&this.isRelayoutOverlap&&this.viewer.documentHelper.selection.isExistAfter(d instanceof xe?d:d.line.paragraph,this.endOverlapWidget))){d.x;var c=0,p=0,g=0,u=0,m=0;d instanceof Ge?(c=d.distanceLeft,p=d.distanceTop,g=d.distanceRight,u=d.distanceBottom,m=d.width):m=d.getTableCellWidth();var f=new ce(d.x-c,d.y-p,m+c+g,d.height+p+u),v=d instanceof xe?"Square":d.textWrappingStyle,y=d instanceof xe?"Both":d.textWrappingType;o.clientArea.y,d.height;if(!(a.x>f.right+18||a.right<f.x-18)&&this.isNeedToWrapForSquareTightAndThrough(r,e,-1,-1,v,f,h,1,d,!1,i,e.width,e.height)){var b=0,w=0,C=0,x=L.convertPointToPixel(e.paragraph.paragraphFormat.firstLineIndent),F=L.convertPointToPixel(n.paragraphFormat.leftIndent);x=0===e.indexInOwner&&e.line.isFirstLine()&&x>0?x:0;var P=e,T=d instanceof xe?d.containerWidget:d.line.paragraph.containerWidget,S=!1;if(e.line.paragraph){i.x>=f.x&&"Left"!==y&&(b=n.paragraphFormat.rightIndent),i.x<f.x&&"Right"!==y&&(w=F);var I=n.paragraphFormat.listFormat,N=this.getListLevel(I.list,I.listLevelNumber);i.x===a.x+F&&I&&I.baseStyle&&N&&0!==N.paragraphFormat.leftIndent&&(C=F,S=!0)}if(i.x>=f.x&&i.x<f.right&&"Left"!==y){i.width=i.width-(f.right-i.x)-b,this.isWrapText=!0;if(Math.round(i.width)<18||i.width<e.width&&"\t"===e.text||f.x<n.x+F){i.width=this.viewer.clientArea.right-f.right-(S?C:0);W=0;if(W=P?this.getMinWidth(e,e.width,e.height,i):e.width,Math.round(i.width)<18||i.width<W){if(f.x-(n.x+n.leftIndent)>18&&this.viewer.clientArea.right-f.right>18)i.width=0;else{k=0;this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height-=f.bottom+k-i.y,i.y=f.bottom+k}this.viewer.updateClientAreaForTextWrap(i),this.isWrapText=!1}else{E=i.x;if(i.x=f.right+(S?C:0)+x,i.width-=x,"Square"===v&&i.width<0&&e.width>0){k=0;this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height-=f.bottom+k-i.y,i.y=f.bottom+k,i.x=E}this.viewer.updateClientAreaForTextWrap(i)}}else{var E=i.x;if(i.x=f.right+(S?C:0)+x,i.width=this.viewer.clientArea.right-f.right-(S?C:0)-x,"Square"===v&&i.width<0&&e.width>0){k=0;this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height-=f.bottom+k-i.y,i.y=f.bottom+k,i.x=E}this.isWrapText=!0,this.viewer.updateClientAreaForTextWrap(i)}}else if(f.x>=i.x&&i.right>f.x){i.width=f.x-i.x-b;var H=this.viewer.clientArea.right-f.right;H=H>0?H:0,this.isWrapText=!0;var W=0;if(W=P?this.getMinWidth(P,e.width,e.height,i):e.width,this.isNeedDoIntermediateWrapping(H,y,i,e.width,e.paragraph,f,e,W,18)){if(i.width=H,this.isWrapText=!0,(i.x+W>f.x||"Right"===y)&&(i.x=f.right,(i.width>W||"Right"===y)&&this.viewer.updateClientAreaForTextWrap(i)),i.width<18&&!(W<H&&"Tight"===v)||i.width<W&&Math.round(i.right)===Math.round(this.viewer.clientArea.right)&&"Both"===y){var O=f;if(Math.round(i.x)===Math.round(r.sectionFormat.leftMargin+n.paragraphFormat.leftIndent)){k=0;i.y=O.bottom+k,this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height=i.height-(O.height+k),this.viewer.updateClientAreaForTextWrap(i),this.isWrapText=!1}else if(Math.round(i.right)>=Math.round(this.viewer.clientArea.right)&&"Both"===y){var k=0;i.y=O.bottom+k,i.width=this.viewer.clientArea.width,i.height=i.height-(O.height+k),i.x=this.viewer.clientArea.x+w,this.viewer.updateClientAreaForTextWrap(i),this.isYPositionUpdated=!0,this.isWrapText=!1}else i.width=0,this.viewer.updateClientAreaForTextWrap(i)}}else e.line.isFirstLine()&&0===e.indexInOwner&&"Square"===v&&Math.round(i.width)<=Math.round(W)&&n.containerWidget===T?(i.x=a.x,i.y=f.bottom,i.width=a.width,i.height-=f.bottom-i.y,this.isYPositionUpdated=!0):Math.round(i.width)<=Math.round(W)&&Math.round(i.x-w)!==Math.round(this.viewer.clientArea.x)&&(i.width=0),this.viewer.updateClientAreaForTextWrap(i)}"Both"!==y&&(this.isWrapText=!1)}}}}return i},e.prototype.adjustClientAreaBasedOnTextWrapForTable=function(e,i){if(t.isNullOrUndefined(e.containerWidget)||t.isNullOrUndefined(e.bodyWidget))return i;var n=e.bodyWidget,r=this.viewer;i.y,t.isNullOrUndefined(e.previousWidget);if(n.floatingElements.length>0){var o=r.clientActiveArea;n.floatingElements.sort(function(e,t){return e.y-t.y}),n.floatingElements.sort(function(e,t){return e.x-t.x});for(var s=0;s<n.floatingElements.length;s++){var a=n.floatingElements[s],l=!1;if(l=a instanceof Ge?a.allowOverlap:a.positioning.allowOverlap,!(e.isInsideTable&&a instanceof xe)||a.isInsideTable){var d=e.getTableCellWidth(),h=a instanceof Ge,c=h?a.distanceLeft:a.positioning.distanceLeft,p=h?a.distanceTop:a.positioning.distanceTop,g=h?a.distanceRight:a.positioning.distanceRight,u=h?a.distanceBottom:a.positioning.distanceBottom,m=h?a.width:a.getTableCellWidth(),f=new ce(a.x-c,a.y-p,m+c+g,a.height+p+u),v=a instanceof xe?"Square":a.textWrappingStyle,y=a instanceof xe?"Both":a.textWrappingType;if(!(o.x>f.right+18||o.right<f.x-18)&&this.isNeedToWrapForSquareTightAndThroughForTable(n,e,-1,-1,v,f,l,1,a,!1,i,d,e.height)&&i.x>=f.x&&i.x<f.right&&"Left"!==y){i.width=i.width-(f.right-i.x),this.isWrapText=!0;if(Math.round(i.width)<18||i.width<d||f.x<e.x){i.width=this.viewer.clientArea.right-f.right;var b=d;if(Math.round(i.width)<18||i.width<b){if(f.x-e.x>18&&this.viewer.clientArea.right-f.right>18)i.width=0;else{C=0;this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height-=f.bottom+C-i.y,i.y=f.bottom+C}this.viewer.updateClientAreaForTextWrap(i),this.isWrapText=!1}else{w=i.x;if(i.x=f.right,"Square"===v&&i.width<0&&d>0){this.isYPositionUpdated=!0,i.height-=f.bottom+0-i.y,i.width=this.viewer.clientArea.width,i.y=f.bottom+0,i.x=w}this.viewer.updateClientAreaForTextWrap(i)}}else{var w=i.x;if(i.x=f.right,i.width=this.viewer.clientArea.right-f.right,"Square"===v&&i.width<0&&d>0){var C=0;this.isYPositionUpdated=!0,i.width=this.viewer.clientArea.width,i.height-=f.bottom+C-i.y,i.y=f.bottom+C,i.x=w}this.viewer.updateClientAreaForTextWrap(i)}}}}}return i},e.prototype.startAt=function(e,t){return"Footnote"===e.footnoteType?(this.startat=e.paragraph.bodyWidget.sectionFormat.initialFootNoteNumber,t=this.getFootEndNote(e.paragraph.bodyWidget.sectionFormat.footNoteNumberFormat,this.documentHelper.footnoteCollection.indexOf(e)+this.startat)):(this.startat=e.paragraph.bodyWidget.sectionFormat.initialEndNoteNumber,t=this.getFootEndNote(e.paragraph.bodyWidget.sectionFormat.endnoteNumberFormat,this.documentHelper.endnoteCollection.indexOf(e)+this.startat)),t},e.prototype.layoutFootEndNoteElement=function(e){this.isFootnoteContentChanged=!0;this.documentHelper.footnoteCollection.length;var t,i=this.documentHelper.footnoteCollection.indexOf(e),n=1;this.islayoutFootnote=!0;var r,o=new ce(this.viewer.clientArea.x,this.viewer.clientArea.y,this.viewer.clientArea.width,this.viewer.clientArea.height),s=new ce(this.viewer.clientActiveArea.x,this.viewer.clientActiveArea.y,this.viewer.clientActiveArea.width,this.viewer.clientActiveArea.height),a=e.paragraph.bodyWidget,l=!1,d=0;if(a.page.footnoteWidget)for(var h=0;h<a.page.footnoteWidget.childWidgets.length;h++){n=a.page.footnoteWidget.childWidgets.length;var c=this.documentHelper.footnoteCollection.indexOf(a.page.footnoteWidget.childWidgets[h].footNoteReference);if(c>i&&c-i==1){n=h;break}}if(e.isLayout=!0,"Footnote"===e.footnoteType){if(a.page.footnoteWidget&&a.page.footnoteWidget instanceof be)t=a.page.footnoteWidget;else{l=!0,(t=new be).footNoteType="Footnote",t.page=a.page;var p=new we;p.characterFormat=new k,p.paragraphFormat=new I,p.index=0;var g=new Te(p);p.childWidgets.push(g),t.childWidgets.push(p),d=this.documentHelper.textHelper.getParagraphMarkSize(p.characterFormat).Height}this.isFootNoteLayoutStart=!0;for(var u=0;u<e.blocks.length;u++){var m=e.blocks[u];this.isLayoutWhole&&(m.containerWidget=void 0),this.viewer.updateClientAreaForBlock(m,!0),m instanceof xe&&this.clearTableWidget(m,!0,!0),this.layoutBlock(m,0),d+=m.height,m.y=0,this.viewer.updateClientAreaForBlock(m,!1)}this.isFootNoteLayoutStart=!1,r=!1,d<=s.height&&(e.blocks.forEach(function(e){t.childWidgets.splice(n,0,e),n++}),l&&(a.page.footnoteWidget=t),t.height+=d,r=!0),this.viewer.clientActiveArea=s,r&&(this.viewer.clientActiveArea.height-=d,this.footnoteHeight+=d),this.viewer.clientArea=o}return r},e.prototype.layoutEndNoteElement=function(){var e=this.documentHelper.pages.length;if(this.documentHelper.endnoteCollection.length>0){for(var t=void 0,i=void 0,n=void 0,r=this.documentHelper.pages[e-1].bodyWidgets[0],o=0;o<this.documentHelper.endnoteCollection.length;o++){if(t=this.documentHelper.endnoteCollection[o],r.page.endnoteWidget instanceof be&&"Endnote"===r.page.endnoteWidget.footNoteType)i=r.page.endnoteWidget;else{n=!0,(i=new be).footNoteType="Endnote",i.page=r.page;var s=new we;s.characterFormat=new k,s.paragraphFormat=new I,s.index=0;var a=new Te(s);s.childWidgets.push(a),i.childWidgets.push(s)}for(var l=0;l<t.blocks.length;l++){var d=t.blocks[l];i.childWidgets.push(d)}n&&(r.page.endnoteWidget=i),i.height+=0}this.layoutfootNote(i)}},e.prototype.hasValidElement=function(e){var i=e.firstChild;if(i&&!t.isNullOrUndefined(this.documentHelper.selection))for(var n=i.children[0];n;){if(n instanceof Ie&&(n=this.documentHelper.selection.getNextValidElementForField(n),!t.isNullOrUndefined(n)&&!n.line.paragraph.equals(e)))return!1;if(n instanceof Oe||n instanceof Ze)return!0;t.isNullOrUndefined(n)||(n=n.nextNode)}return!1},e.prototype.updateFieldText=function(e){var t=this.documentHelper.getFieldResult(e.fieldBegin,e.paragraph.bodyWidget.page);""!==t&&(e.text=t,this.documentHelper.textHelper.getTextSize(e,e.characterFormat))},e.prototype.checkLineWidgetWithClientArea=function(e,i){(e!==i.line||i.line===e&&t.isNullOrUndefined(i.nextElement)&&!i.line.isLastLine())&&(this.moveToNextLine(e),e!==i.line&&(this.isRTLLayout=!1)),i.line!==e&&this.viewer instanceof le&&this.viewer.clientActiveArea.height<i.height&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y?this.moveToNextPage(this.viewer,i.line):i.line===e&&t.isNullOrUndefined(i.nextElement)&&e.paragraph.lastChild===e&&!e.isLastLine()&&this.viewer.clientActiveArea.height>=0&&this.moveFromNextPage(e)},e.prototype.checkAndSplitTabOrLineBreakCharacter=function(e,t){var i=["\t","\v","\f"],n=L.indexOfAny(e,i);if(n>-1){var r=e[n];("\t"===r&&"\t"!==e||"\v"===r&&"\v"!==e||"\f"===r&&"\f"!==e)&&this.splitByLineBreakOrTab(this.viewer,t,n,r)}},e.prototype.splitTextByConsecutiveLtrAndRtl=function(e){for(var t=e.text,i=[],n=!1,r=[],o=-1,s="",a="",l="",d="",h=e.characterFormat.bidi,c=0;c<t.length;c++){var p=0,g=!1;h&&/^[0-9]+$/.test(t[c])?(d+=t[c],p=4):this.documentHelper.textHelper.containsSpecialCharAlone(t.charAt(c))?(p=2,(g=h||" "===t.charAt(c)&&""===l)&&(l+=t[c])):this.documentHelper.textHelper.isRTLText(t.charAt(c))?(n=!0,a+=t[c],p=1):s+=t[c],""!==d&&4!==p&&(i.push(d),r.push("Number"),d=""),""!==a&&1!==p&&(i.push(a),r.push("RTL"),a=""),""!==s&&0!==p&&(i.push(s),o=i.length-1,r.push("LTR"),s=""),""===l||2===p&&!g||(i.push(l),r.push("WordSplit"),l="")}if(""!==d?(i.push(d),r.push("Number")):""!==a?(i.push(a),r.push("RTL")):""!==s?(i.push(s),o=i.length-1,r.push("LTR")):""!==l&&(i.push(l),r.push("WordSplit")),n)for(c=1;c<i.length;c++)"WordSplit"===(u=r[c+0])&&1===i[c].length&&c+0+1<r.length&&"WordSplit"!==r[c+0-1]&&("Number"!==r[c+0-1]||this.isNumberNonReversingCharacter(i[c],h))&&r[c+0-1]===r[c+0+1]&&(i[c-1]=i[c-1]+i[c]+i[c+1],i.splice(c,1),i.splice(c,1),r.splice(c+0,1),r.splice(c+0,1),c--);else if(-1!==o)if(h)for(c=1;c<o;c++){var u=r[c+0];if("WordSplit"===u&&c<o&&"LTR"===r[c+0-1]){s="";for(m=c+1;m<=o;m++)s+=i[m],i.splice(m,1),r.splice(m+0),m--,o--;i[c-1]=i[c-1]+i[c]+s,i.splice(c,1),r.splice(c+0),c--,o--}}else(i=[]).push(t);else h||(i=[]).push(t);if(h)for(var m=1;m<i.length;m++){var f=r[m+0];"WordSplit"===f&&1===i[m].length&&m+0+1<r.length&&"WordSplit"!==r[m+0-1]&&("Number"!==r[m+0-1]||this.isNumberNonReversingCharacter(i[m],h))&&r[m+0-1]===r[m+0+1]?(i[m-1]=i[m-1]+i[m]+i[m+1],i.splice(m,1),i.splice(m,1),r.splice(m+0,1),r.splice(m+0),m--):"LTR"!==f||"Number"!==r[m+0-1]&&"LTR"!==r[m+0-1]||(i[m-1]=i[m-1]+i[m],r[m+0-1]="LTR",i.splice(m,1),r.splice(m+0,1),m--)}return i},e.prototype.isNumberNonReversingCharacter=function(e,t){return!(-1===",.:".indexOf(e[0])||"."===e[0]&&t)},e.prototype.updateSplittedText=function(e,t){var i="",n=e.line.children.indexOf(e);if(t.length>1)for(var r=0;r<t.length;r++)if(i=t[r],r>0){var o=new Oe;o.line=e.line,o.characterFormat.copyFormat(e.characterFormat),e.line.children.splice(n+r,0,o),e.revisions.length>0&&(this.updateRevisionForSpittedElement(e,o,!0),o.isMarkedForRevision=e.isMarkedForRevision),o.text=i}else e.text=i},e.prototype.moveFromNextPage=function(e){var t=e.nextLine;t&&-1===e.paragraph.childWidgets.indexOf(t)&&(t.paragraph.childWidgets.splice(t.indexInOwner,1),e.paragraph.childWidgets.push(t),t.paragraph=e.paragraph)},e.prototype.cutClientWidth=function(e){this.clearLineMeasures();var i=e.line;i.marginTop=0;for(var n=0,r=0;r<i.children.length;r++){var o=i.children[r];if(n+=o.width,e===o)break}var s=this.viewer.clientActiveArea.width-n<0,a=e.line.paragraph.bodyWidget;return a&&a.floatingElements.length>0?(this.hasFloatingElement=!0,this.isXPositionUpdated=!0,!1):(s?e.previousElement&&this.cutClientWidth(e.previousElement):(this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+n),"Justify"===e.line.paragraph.paragraphFormat.textAlignment&&e instanceof Oe&&this.splitTextElementWordByWord(e),t.isNullOrUndefined(e.nextElement)&&this.viewer.clientActiveArea.width>0&&!e.line.isLastLine()&&this.moveElementFromNextLine(i)),s)},e.prototype.layoutFieldCharacters=function(e){if(0===e.fieldType)!t.isNullOrUndefined(e.formFieldData)&&this.isInitialLoad&&this.checkAndUpdateFieldData(e),this.isFieldCode||t.isNullOrUndefined(e.fieldEnd)&&!e.hasFieldEnd||(this.documentHelper.fieldStacks.push(e),this.isFieldCode=!0,e.hasFieldEnd=!0);else if(this.documentHelper.fieldStacks.length>0)if(2===e.fieldType)(i=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1]).fieldSeparator!==e||t.isNullOrUndefined(i.fieldEnd)&&!i.hasFieldEnd||(this.isFieldCode=!1);else{var i=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1];e===i.fieldEnd&&(this.documentHelper.fieldStacks.pop(),this.isFieldCode=!1)}},e.prototype.checkAndUpdateFieldData=function(e){if(e.hasFieldEnd&&!t.isNullOrUndefined(e.fieldEnd)){if(t.isNullOrUndefined(e.fieldSeparator)){var i=new Ie(2);i.fieldBegin=e,i.fieldEnd=e.fieldEnd,i.line=e.line,e.line.children.splice(e.fieldEnd.indexInOwner,0,i),e.fieldSeparator=i,e.fieldEnd.fieldSeparator=i}var n=e.fieldEnd.previousNode;if(n instanceof Ie&&2===n.fieldType){var r=e.formFieldData;if(r instanceof He){var o=new Oe;o.line=e.line;a=e.line.children.indexOf(e.fieldEnd);e.line.children.splice(a,0,o),o.characterFormat.copyFormat(e.characterFormat),r.checked?o.text=String.fromCharCode(9745):o.text=String.fromCharCode(9744),"Auto"!==r.sizeType?o.characterFormat.fontSize=1.2*r.size:o.characterFormat.fontSize=1.2*o.characterFormat.fontSize}else if(r instanceof We){var s=new Oe;s.characterFormat.copyFormat(e.characterFormat),s.line=e.line,r.dropdownItems.length>0?s.text=r.dropdownItems[r.selectedIndex]:s.text=this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5);var a=e.line.children.indexOf(e.fieldEnd);e.line.children.splice(a,0,s)}}}},e.prototype.layoutEmptyLineWidget=function(e,i,n,r){var o=e.paragraphFormat,s=0,a=0;r=!t.isNullOrUndefined(r)&&r;var l,d=this.documentHelper.textHelper.getParagraphMarkSize(e.characterFormat).Height,h=this.getBeforeSpacing(e);if(e.childWidgets.length>0&&!r){if((l=e.childWidgets[0]).children.length>0){this.isBidiReLayout||!o.bidi&&!this.isContainsRtl(l)||this.reArrangeElementsForRtl(l,o.bidi);var c=l.isFirstLine(),p=l.isLastLine(),g=0;if(c&&(h=this.getBeforeSpacing(e),g=L.convertPointToPixel(o.firstLineIndent)),"Left"!==(P=o.textAlignment)&&this.viewer.textWrap&&("Justify"!==P||!p||"Justify"===P&&o.bidi)){var u=this.getSubWidth(l,"Justify"===P,a,g,p);s=u[0].subWidth,a=u[0].spaceCount}}}else l=i?this.addLineWidget(e):n;if(!t.isNullOrUndefined(e.containerWidget)&&e.bodyWidget.floatingElements.length>0&&!(e.containerWidget instanceof Xe)){var m=new Oe;m.line=l,l.children.push(m),m.text="¶",m.characterFormat=e.characterFormat,m.width=this.documentHelper.textHelper.getTextSize(m,m.characterFormat),this.adjustPosition(m,e.bodyWidget),e.x+=m.padding.left,l.children.splice(0,1)}this.viewer instanceof le&&this.viewer.clientActiveArea.height<h+d&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y&&this.moveToNextPage(this.viewer,l);var f=this.getLineSpacing(e,d);!isNaN(this.maxTextHeight)&&d<this.maxTextHeight&&(d=this.maxTextHeight);var v=0,y=0,b=0,w=d,C=e.paragraphFormat.lineSpacingType;"Multiple"===C?f>d?y+=f-d:v+=f-d:"Exactly"===C?v+=f-(v+w+y):f>v+w+y&&(v+=f-(v+w+y)),v+=h,y+=L.convertPointToPixel(this.getAfterSpacing(e));for(var x=0;x<l.children.length;x++){var F=l.children[x];if(0===x&&F instanceof Qe){var P=e.paragraphFormat.textAlignment;"Right"===P?b=s:"Center"===P&&(b=s/2),F.margin=new ge(b,v,0,y),F.line=l,l.height=v+w+y}}l.height=v+w+y,this.viewer.cutFromTop(this.viewer.clientActiveArea.y+l.height)},e.prototype.layoutListItems=function(e){this.isFieldCode||(!t.isNullOrUndefined(e.paragraphFormat)&&!t.isNullOrUndefined(e.paragraphFormat.listFormat)&&!t.isNullOrUndefined(this.documentHelper.getListById(e.paragraphFormat.listFormat.listId))&&e.paragraphFormat.listFormat.listLevelNumber>=0&&e.paragraphFormat.listFormat.listLevelNumber<9?(this.clearListElementBox(e),this.layoutList(e,this.documentHelper)):e.paragraphFormat.listFormat&&-1===e.paragraphFormat.listFormat.listId&&this.clearListElementBox(e))},e.prototype.layoutList=function(e,i){var n=i.getListById(e.paragraphFormat.listFormat.listId);this.viewer.updateClientWidth(-L.convertPointToPixel(e.paragraphFormat.firstLineIndent));var r=this.getListLevel(n,e.paragraphFormat.listFormat.listLevelNumber),o=e.childWidgets[0];t.isNullOrUndefined(o)&&(o=new Te(e),e.childWidgets.push(o));var s=new Qe(r,!1);if(s.line=o,"Bullet"===r.listLevelPattern?s.text=r.numberFormat:s.text=this.getListNumber(e.paragraphFormat.listFormat),this.documentHelper.isIosDevice){var a=s.text;(a=""===a?"●":" "===a?"○":a)!==s.text&&(s.text=a)}i.textHelper.updateTextSize(s,e);var l;if(this.viewer instanceof le&&this.viewer.clientActiveArea.height<s.height&&this.viewer.clientActiveArea.y!==this.viewer.clientArea.y&&(l=!0),this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+s.width),o.children.splice(0,0,s),"None"!==r.followCharacter){if(s=new Qe(r,!0),"Tab"===r.followCharacter){s.text="\t";var d=o.children.indexOf(s);s.width=this.getTabWidth(e,this.viewer,d,o,s)}else s.text=" ",i.textHelper.updateTextSize(s,e);this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+s.width),o.children.splice(1,0,s),s.line=o}if(l)return this.moveToNextPage(this.viewer,o),void this.cutClientWidth(s);"None"!==r.followCharacter&&this.viewer.updateClientWidth(L.convertPointToPixel(e.paragraphFormat.firstLineIndent))},e.prototype.addBodyWidget=function(e,t){var i;return i=t||new fe,i.width=e.width,i.x=e.x,i.y=e.y,i},e.prototype.addListLevels=function(e){for(var t=e.levels.length;t<9;t++){var i=new K(e),n=t%3;"Bullet"===e.levels[0].listLevelPattern?(i.listLevelPattern="Bullet",i.numberFormat=0===n?"":1===n?" ":"",i.characterFormat.fontFamily=""===i.numberFormat?"Wingdings":"Symbol"):(i.listLevelPattern=this.getListLevelPattern(n),i.numberFormat="%"+(t+1).toString()+".",i.startAt=1,i.restartLevel=t),i.paragraphFormat=new I(void 0),i.paragraphFormat.leftIndent=48*(t+1),i.paragraphFormat.firstLineIndent=-24,e.levels.push(i)}},e.prototype.addSplittedLineWidget=function(e,i,n){if(this.isWrapText)return void(t.isNullOrUndefined(n)||(e.children.splice(i+1,0,n),n.line=e));var r=e.paragraph,o=[],s=r.childWidgets.indexOf(e);t.isNullOrUndefined(n)||o.push(n);for(var a=void 0,l=i+1;l<e.children.length;l++)o.push(e.children[l]);if(o.length>0){a=s===r.childWidgets.length-1?new Te(r):r.childWidgets[s+1];for(var d=0;d<o.length;d++)o[d].line=a;e.children.splice(i+1,e.children.length-1),a.children=o.concat(a.children),-1===r.childWidgets.indexOf(a)&&r.childWidgets.splice(s+1,0,a)}},e.prototype.addElementToLine=function(e,t){t instanceof Ge&&"Inline"!==t.textWrappingStyle||(this.isWrapText&&(this.isWrapText=!1,this.viewer.clientActiveArea.width=this.viewer.clientArea.right-this.viewer.clientActiveArea.x),this.viewer.cutFromLeft(this.viewer.clientActiveArea.x+t.width)),"Justify"===e.paragraphFormat.textAlignment&&t instanceof Oe&&this.splitTextElementWordByWord(t)},e.prototype.splitElementForClientArea=function(e,t){if(t.line.children.length>0){var i=t.previousElement,n=t.indexInOwner;t.line.children.length>1&&i&&this.viewer.clientActiveArea.x!==this.viewer.clientArea.x&&(n-=1),this.addSplittedLineWidget(t.line,n)}},e.prototype.splitByWord=function(e,t,i,n,r,o){var s=this.getSplitIndexByWord(this.viewer.clientActiveArea.width,n,r,o);if(s>0&&s<i.length){var a=e.children.indexOf(i),l=new Oe;n=n.substring(s),l.text=n," "===n[0]&&(s+=n.length-(n=L.trimStart(n)).length),l.characterFormat.copyFormat(i.characterFormat),l.width=this.documentHelper.textHelper.getWidth(l.text,o),l.trimEndWidth=l.width,i.text=i.text.substr(0,s),i.width-=l.width,i.trimEndWidth=i.width,i.revisions.length>0&&(this.updateRevisionForSpittedElement(i,l,!0),l.isMarkedForRevision=i.isMarkedForRevision),l.height=i.height,l.baselineOffset=i.baselineOffset,this.splitErrorCollection(i,l),this.addSplittedLineWidget(e,a,l),this.addElementToLine(t,i),0===i.width&&e.children.splice(a,1)}},e.prototype.splitErrorCollection=function(e,t){if(e.errorCollection.length>0){for(var i=[],n=e.ignoreOnceItems,r=0;r<e.errorCollection.length;r++)i.push(e.errorCollection[r]);for(var o=0;o<e.errorCollection.length;o++){var s=e.text.indexOf(e.errorCollection[o].text),a=e.errorCollection[o];s<0?(i.splice(0,1),t.errorCollection.push(a)):t.text.indexOf(a.text)>0&&t.errorCollection.push(a)}t.ignoreOnceItems=n,e.ignoreOnceItems=[],e.errorCollection=i}},e.prototype.splitByCharacter=function(e,t,i,n,r){var o=e.paragraph,s=this.getTextSplitIndexByCharacter(this.viewer.clientArea.width,this.viewer.clientActiveArea.width,i,n,r),a=0;if(s<t.length&&(a=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(i.substring(0,s),r),i=i.substring(s)),a>this.viewer.clientActiveArea.width&&t.indexInOwner>0)return void this.addSplittedLineWidget(e,t.indexInOwner-1);var l=e.children.indexOf(t);if(s<t.length){var d=new Oe;d.text=i,d.errorCollection=t.errorCollection,t.text=t.text.substr(0,s),d.characterFormat.copyFormat(t.characterFormat),d.width=this.documentHelper.textHelper.getWidth(d.text,r),d.trimEndWidth=d.width,t.width-=d.width,t.trimEndWidth=t.width,d.height=t.height,d.baselineOffset=t.baselineOffset,e.children.splice(t.indexInOwner+1,0,d),t.revisions.length>0&&(this.updateRevisionForSpittedElement(t,d,s>0),d.isMarkedForRevision=t.isMarkedForRevision),this.addSplittedLineWidget(e,l),this.addElementToLine(o,t),0===t.width&&e.children.splice(l,1)}else this.addSplittedLineWidget(e,l),this.addElementToLine(o,t)},e.prototype.updateRevisionForSpittedElement=function(e,t,i,n){if(e.revisions.length>0)for(var r=0;r<e.revisions.length;r++){var o=e.revisions[r];if(i){t.revisions.push(o);var s=o.range.length-1;o.range[s]instanceof k?o.range.splice(s-1,0,t):(s=o.range.indexOf(e))<0?o.range.push(t):n?o.range.splice(s,0,t):o.range.splice(s+1,0,t)}else o.range.splice(o.range.length-1,1),o.range.push(t),t.revisions.push(o)}},e.prototype.splitTextElementWordByWord=function(e){var t=e.line,i=t.children.indexOf(e),n=i,r=e.padding.left;e.padding.left=0;var o,s=e.text;if(s.trim().indexOf(" ")>=0){t.children.splice(i,1),o=e.characterFormat;for(var a=e.length-L.trimStart(s).length;a<e.length&&0!==(a=this.getTextIndexAfterSpace(s,a))&&a!==e.length;)if(a<e.length){var l=new Oe,d=s.substring(0,a);" "===(s=s.substring(a)).substring(0,1)&&(a+=s.length-L.trimStart(s).length),l.text=d,l.characterFormat.copyFormat(e.characterFormat),l.line=t,l.width=this.documentHelper.textHelper.getWidth(l.text,o),l.trimEndWidth=l.width,l.height=e.height,l.baselineOffset=e.baselineOffset,t.children.splice(i,0,l),e.revisions.length>0&&(this.updateRevisionForSpittedElement(e,l,a>0,!0),l.isMarkedForRevision=e.isMarkedForRevision),e.text=s,e.width-=l.width,e.trimEndWidth=e.width,0===e.width&&-1!==t.children.indexOf(e)&&t.children.splice(t.children.indexOf(e),1),a=0,i++}e.text=s,t.children.splice(i,0,e)}t.children[n].padding.left=r},e.prototype.splitTextForClientArea=function(e,t,i,n,r){var o=e.paragraph,s=!0,a=-1;if(" "!==i.substring(0,1)){var l=n,d=0;if(d=L.trimEnd(i).indexOf(" ")+1,(a=d)>0&&(l=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(i.slice(0,a),r)),this.viewer.clientActiveArea.width<l&&(s=this.checkPreviousElement(e,e.children.indexOf(t),r)))return}else a=1;n<=this.viewer.clientActiveArea.width?this.addElementToLine(o,t):s&&(a>0||-1!==i.indexOf(" "))?this.splitByWord(e,o,t,i,n,r):this.splitByCharacter(e,t,i,n,r)},e.prototype.splitByLineBreakOrTab=function(e,t,i,n){var r=t.line.children.indexOf(t),o=t.text,s=o.substring(i),a="\t"===n?new De:new Oe;if(a.line=t.line,a.characterFormat.copyFormat(t.characterFormat),t.line.children.splice(r+1,0,a),i>0&&1===s.length)a.text=o.substring(i),t.text=o.substring(0,i);else if(i>0){a.text=n;var l=new Oe;l.line=t.line,l.text=o.substring(i+1),l.characterFormat.copyFormat(t.characterFormat),t.line.children.splice(r+2,0,l),t.text=o.substring(0,i)}else""!==s&&(a.text=o.substring(i+1),t.text=n)},e.prototype.moveToNextLine=function(e){var i=e.paragraph,n=i.paragraphFormat,r=e.isFirstLine(),o=e.isLastLine(),s=0,a=0,l=0,d=0,h=0,c=0;if(this.updateLineWidget(e),s=this.maxTextHeight,a=s-this.maxTextBaseline,r&&(d=this.getBeforeSpacing(i),c=L.convertPointToPixel(n.firstLineIndent)),o&&(l=L.convertPointToPixel(this.getAfterSpacing(i))),this.isBidiReLayout||!n.bidi&&!this.isContainsRtl(e)||(this.reArrangeElementsForRtl(e,n.bidi),this.isRTLLayout=!0),isNaN(this.maxTextHeight)){var p=this.documentHelper.textHelper.measureText("a",i.characterFormat);a=(s=p.Height)-p.BaselineOffset}else a=(s=this.maxTextHeight)-this.maxTextBaseline;h=this.getLineSpacing(i,s),"Exactly"===n.lineSpacingType&&h<a+this.maxBaseline&&(h=a+this.maxBaseline);var g,u=0,m=0,f=n.textAlignment;"Left"!==f&&this.viewer.textWrap&&("Justify"!==f||!o||"Justify"===f&&n.bidi)&&(u=(g=this.getSubWidth(e,"Justify"===f,m,c,o))[0].subWidth,m=g[0].spaceCount);for(var v=!1,y=0,b=n.lineSpacingType,w=!1,C=0;C<e.children.length;C++){var x=0,F=0,P=0,T=e.children[C];if(!t.isNullOrUndefined(g)&&w&&T.padding.left>0&&g.length>y+1){var S=u;"Justify"===f?S=u*g[y].spaceCount:"Center"===f&&(S=u/2),T.padding.left=T.padding.left-S;var I=g[++y];u=I.subWidth,m=I.spaceCount}if(!(T instanceof Ge&&"Inline"!==T.textWrappingStyle)){w=!0;var N=this.alignLineElements(T,x,F,a,v,u,f,m,C===e.children.length-1);x=N.topMargin,F=N.bottomMargin,v=N.addSubWidth,m=N.whiteSpaceCount,"Multiple"===b?h>s?F+=h-s:x+=h-s:"Exactly"===b?x+=h-(x+T.height+F):h>x+T.height+F&&(x+=h-(x+T.height+F)),x+=d,F+=l,(0===C||!(T instanceof Ge&&"Inline"!==T.textWrappingStyle)&&T.previousElement instanceof Ge&&"Inline"!==T.previousElement.textWrappingStyle||T.padding.left>0)&&(e.height=x+T.height+F,"Right"===f||"Justify"===f&&n.bidi&&o?P=u:"Center"===f&&(P=u/2)),T.margin=new ge(P,x,0,F),T.line=e}}this.checkInbetweenShapeOverlap(e),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+e.height),this.wrapPosition=[]},e.prototype.checkInbetweenShapeOverlap=function(e){var i=this;if(!(e.paragraph.containerWidget instanceof Xe)&&e.paragraph.bodyWidget){var n,r=this.getLineY(e),o=e.paragraph.isInsideTable;e.paragraph.bodyWidget.floatingElements.sort(function(e,t){return e.y-t.y}),e.paragraph.bodyWidget.floatingElements.forEach(function(s){if(!(o&&s.line&&!s.line.paragraph.isInsideTable||t.isNullOrUndefined(s.line))){var a=new ce(e.paragraph.x,i.viewer.clientActiveArea.y,e.paragraph.width,e.height),l=new ce(s.x,s.y-s.distanceTop,s.width,s.height);if(!(s.line&&i.isRelayout&&!i.isRelayoutOverlap&&i.viewer.documentHelper.selection.isExistAfter(s.line.paragraph,e.paragraph)||i.isRelayout&&i.isRelayoutOverlap&&i.viewer.documentHelper.selection.isExistAfter(s.line.paragraph,i.endOverlapWidget))){var d="TopAndBottom"===s.textWrappingStyle;n&&d&&n.y+n.height+n.distanceBottom+e.height>s.y-s.distanceTop&&n.y-n.distanceTop<s.y-s.distanceTop&&s.y+s.height+s.distanceBottom>n.y+n.height+n.distanceBottom?(n=s,e.marginTop=s.y+s.height+s.distanceBottom-r):d&&!n&&a.isIntersecting(l)&&(n=s,e.marginTop=s.y+s.height+s.distanceBottom-r)}}}),n?this.viewer.cutFromTop(n.y+n.height+n.distanceBottom):this.isRelayoutOverlap&&(e.marginTop=0)}},e.prototype.getLineY=function(e){var t=e.paragraph,i=t.y;if(!t.isEmpty())for(var n=t.firstChild;n!==e;)i=i+n.height+n.marginTop,n=n.nextLine;return i},e.prototype.updateLineWidget=function(e){for(var t=0;t<e.children.length;t++){var i=e.children[t];i instanceof Ge&&"Inline"!==i.textWrappingStyle||(i instanceof Oe||i instanceof Qe?(this.maxTextHeight<i.height&&(this.maxTextHeight=i.height,this.maxTextBaseline=i.baselineOffset),this.maxBaseline<this.maxTextBaseline&&(this.maxBaseline=this.maxTextBaseline)):this.maxBaseline<i.height&&(this.maxBaseline=i.height))}},e.prototype.moveToNextPage=function(e,i,n){if(!this.isFootNoteLayoutStart){this.isRelayoutOverlap&&this.endOverlapWidget!==i.paragraph&&(i=this.endOverlapWidget.childWidgets[0]);var r=i.paragraph;if(r&&!(r.containerWidget instanceof be)){var o=0;if(r instanceof be)return;t.isNullOrUndefined(i)||((o=r.childWidgets.indexOf(i))>0||n)&&(r.height=e.clientActiveArea.y-r.y),t.isNullOrUndefined(r.bodyWidget)||r.bodyWidget instanceof be||void 0===r.bodyWidget.page.footnoteWidget||this.layoutfootNote(r.bodyWidget.page.footnoteWidget);var s=this.moveBlocksToNextPage(r);if(this.viewer.updateClientArea(s.sectionFormat,s.page),this.viewer.updateClientAreaForBlock(r,!0),o>0){if(i.isLastLine()&&n)return;var a=void 0;a=s.firstChild instanceof we&&s.firstChild.equals(r)?s.firstChild:new we,(a=this.addParagraphWidget(this.viewer.clientActiveArea,a)).index=r.index;for(var l=0,d=o;d<r.childWidgets.length;d++){var h=r.childWidgets[d];h.paragraph=a,a.childWidgets.splice(l,0,h),h.paragraph=a,l++}a.paragraphFormat=r.paragraphFormat,a.characterFormat=r.characterFormat,r.childWidgets.splice(o),r=a}else n||r.containerWidget.removeChild(r.indexInOwner);if(!(n||(-1===s.childWidgets.indexOf(r)&&s.childWidgets.splice(0,0,r),r.containerWidget=s,this.viewer.updateClientAreaLocation(r,this.viewer.clientActiveArea),0!==o||i.children[0]instanceof Qe))){var c=-L.convertPointToPixel(r.paragraphFormat.firstLineIndent);this.viewer.updateClientWidth(c)}}if(this.isRelayoutOverlap&&this.endOverlapWidget){for(var p=this.endOverlapWidget.previousRenderedWidget,g=i.paragraph;g;)g.floatingElements.forEach(function(e){-1!==p.bodyWidget.floatingElements.indexOf(e)&&(p.bodyWidget.floatingElements.splice(p.bodyWidget.floatingElements.indexOf(e),1),i.paragraph.bodyWidget.floatingElements.push(e))}),g=g!==this.endOverlapWidget?g.nextWidget:void 0;this.layoutStartEndBlocks(this.startOverlapWidget,this.endOverlapWidget),this.startOverlapWidget=void 0,this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-this.endOverlapWidget.y,this.viewer.clientActiveArea.y=this.endOverlapWidget.y}}},e.prototype.layoutStartEndBlocks=function(e,t){var i=e;for(this.viewer.clientActiveArea.height=this.viewer.clientActiveArea.bottom-e.y,this.viewer.clientActiveArea.y=e.y;i;)i instanceof we?this.layoutParagraph(i,0):(this.clearTableWidget(i,!0,!0,!0),this.layoutTable(i,0)),i=i!==t?i.nextWidget:void 0},e.prototype.alignLineElements=function(e,i,n,r,o,s,a,l,d){if(e.width>0&&(e instanceof Oe||e instanceof Qe)){var h=e instanceof Oe?e:void 0,c=e instanceof Oe?h.baselineOffset:e.baselineOffset;if(i+=this.maxBaseline-c,n+=r-(e.height-c),!t.isNullOrUndefined(h)&&"Justify"===a&&l>0){var p=h.width,g=h.text;if(o||(o=(g=L.trimStart(g)).length>0),o){var u=g.length-L.removeSpace(g).length;d&&(u-=g.length-L.trimEnd(g).length),l<u&&(p=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(g,h.characterFormat),u=l),u>0&&(h.width=p+s*u,l-=u)}}}else o=!0,i+=this.maxBaseline-e.height,n+=r;return{topMargin:i,bottomMargin:n,addSubWidth:o,whiteSpaceCount:l}},e.prototype.updateWidgetToPage=function(e,i){if(i.isInsideTable){var n=i.associatedCell;if(i.height=e.clientActiveArea.y-i.y,t.isNullOrUndefined(i.associatedCell)||t.isNullOrUndefined(i.associatedCell.ownerRow)||t.isNullOrUndefined(i.associatedCell.ownerRow.rowFormat))return;"Exactly"===i.associatedCell.ownerRow.rowFormat.heightType?n.height=L.convertPointToPixel(i.associatedCell.ownerRow.rowFormat.height):[n].length<=1&&"AtLeast"===i.associatedCell.ownerRow.rowFormat.heightType?n.height=Math.max(L.convertPointToPixel(i.associatedCell.ownerRow.rowFormat.height),this.getCellContentHeight(n)):n.height=n.height+i.height,i.containerWidget=n}else(!i.isEndsWithPageBreak||e instanceof de)&&(i.height=e.clientActiveArea.y-i.y);this.isRelayoutFootnote&&i.bodyWidget instanceof be&&(i.isInsideTable||(i.containerWidget.height+=i.height),this.shiftFootnoteChildLocation(i.bodyWidget,this.viewer)),i.bodyWidget instanceof ve&&(i.isInsideTable||(i.containerWidget.height+=i.height),this.viewer.owner.enableHeaderAndFooter&&-1!==i.bodyWidget.headerFooterType.indexOf("Footer")&&this.shiftFooterChildLocation(i.bodyWidget,this.viewer)),e instanceof de&&i.containerWidget instanceof fe&&(i.containerWidget.height+=i.height)},e.prototype.shiftFooterChildLocation=function(e,i){var n=e.page.bodyWidgets[0].sectionFormat.pageHeight;if(-1!==e.headerFooterType.indexOf("Footer")){var r,o=e.page.bodyWidgets[0].sectionFormat.footerDistance,s=L.convertPointToPixel(n-o);e.y+e.height>s?r=s-(e.y+e.height):e.y+e.height<s&&(r=e.y+e.height-s),t.isNullOrUndefined(r)||(r=s-(e.y+e.height),this.shiftChildLocation(r,e),i.clientActiveArea.y+=r)}},e.prototype.shiftFootnoteChildLocation=function(e,i){var n,r=e.page.bodyWidgets[0].sectionFormat.pageHeight,o=(e.page.bodyWidgets[0].sectionFormat.footerDistance,e.page.bodyWidgets[0].sectionFormat.bottomMargin),s=L.convertPointToPixel(r-o);e.y+e.height>s?n=s-(e.y+e.height):e.y+e.height<s&&(n=e.y+e.height-s),t.isNullOrUndefined(n)||(n=s-(e.y+e.height),this.shiftChildLocation(n,e),i.clientActiveArea.y+=n)},e.prototype.checkPreviousElement=function(e,t,i){e.paragraph;for(var n=!1,r=0,o=t-1;o>=0;o--){var s=e.children[o];if(s instanceof Oe&&s.width>0){var a=s.text;if(r=o,a.length>0&&" "===a[a.length-1]){if(o===t-1)return this.addSplittedLineWidget(e,t-1),!0;n=!0;break}if("\t"===a)return!1;if(a.indexOf(" ")>=0){n=!0;var l=a.lastIndexOf(" ")+1,d=new Oe;d.text=a.substr(l),d.characterFormat.copyFormat(s.characterFormat),s.revisions.length>0&&(this.updateRevisionForSpittedElement(s,d,l>0),d.isMarkedForRevision=s.isMarkedForRevision),s.text=a.substr(0,l),this.documentHelper.textHelper.getTextSize(d,i),s.width-=d.width,s.height=d.height,0===s.width&&e.children.splice(o,1),e.children.splice(o+1,0,d);break}}else if(!(s instanceof Qe||s instanceof Ie||s instanceof Oe&&0===s.width)){r=o,n=!0;break}}if(n&&++r<e.children.length){for(var h=0,o=r;o<e.children.length;o++)h+=e.children[o].width,this.addSplittedLineWidget(e,o-1),o--;this.viewer.updateClientWidth(h)}return n},e.prototype.clearListElementBox=function(e){if(0!==e.childWidgets.length){var i=e.childWidgets[0];if(!t.isNullOrUndefined(i.children)){for(n=i.children.length-1;n>0&&i.children[n]instanceof Qe;n--)i.children.splice(n,1);for(var n=0;n<i.children.length&&i.children[n]instanceof Qe;n++)i.children.splice(n,1),n--}}},e.prototype.getListNumber=function(e,i){var n=this.documentHelper.getListById(e.listId),r=e.listLevelNumber,o=this.getListLevel(n,e.listLevelNumber),s=t.isNullOrUndefined(n.levelOverrides)?void 0:n.levelOverrides[r];if(!t.isNullOrUndefined(s)&&-1===this.documentHelper.renderedLevelOverrides.indexOf(s)&&t.isNullOrUndefined(s.overrideListLevel)&&(this.documentHelper.renderedLevelOverrides.push(s),this.documentHelper.renderedLists.containsKey(this.documentHelper.getAbstractListById(n.abstractListId)))){var a=this.documentHelper.renderedLists.get(this.documentHelper.getAbstractListById(n.abstractListId));a.containsKey(r)&&a.remove(r)}return t.isNullOrUndefined(i)&&this.updateListValues(n,r),this.getListText(n,r,o)},e.prototype.getListStartValue=function(e,i){var n=t.isNullOrUndefined(i.levelOverrides)?void 0:i.levelOverrides[e];if(!t.isNullOrUndefined(n)&&t.isNullOrUndefined(n.overrideListLevel))return n.startAt;var r=this.getListLevel(i,e);return t.isNullOrUndefined(r)?0:r.startAt},e.prototype.updateListValues=function(e,t){if(this.documentHelper.renderedLists.containsKey(this.documentHelper.getAbstractListById(e.abstractListId))){var i=this.documentHelper.renderedLists.get(this.documentHelper.getAbstractListById(e.abstractListId));if(i.containsKey(t)){r=i.get(t);i.set(t,r+1);for(n=t+1;n<this.documentHelper.getAbstractListById(e.abstractListId).levels.length;){s=this.getListLevel(e,n);i.containsKey(n)&&s.restartLevel>t&&i.remove(n),n++}}else{for(var n=t;!i.containsKey(n-1)&&n>0;){s=this.getListLevel(e,n-1);i.add(n-1,this.getListStartValue(n-1,e)),n--}var r=this.getListStartValue(t,e);i.add(t,r)}}else{var o=new u;this.documentHelper.renderedLists.add(this.documentHelper.getAbstractListById(e.abstractListId),o);for(var s=this.getListLevel(e,t),a=0;a<=t;a++)o.add(a,this.getListStartValue(a,e))}},e.prototype.getListText=function(e,i,n){var r=n.numberFormat;if(this.documentHelper.renderedLists.containsKey(this.documentHelper.getAbstractListById(e.abstractListId)))for(var o=this.documentHelper.renderedLists.get(this.documentHelper.getAbstractListById(e.abstractListId)),s=o.keys,a=0;a<s.length;a++){var l=s[a],d="%"+(l+1).toString(),h=this.getListLevel(e,l);if(r.match(d)&&r.match((i+1).toString())){if(l>i)return"";r=o.containsKey(l)&&!t.isNullOrUndefined(h)?r.replace(d,this.getListTextListLevel(h,o.get(l))):r.replace(d,"0")}else if(r.match(d)&&i>0)return h=this.getListLevel(e,s[i]),this.getListTextListLevel(h,o.get(i))+"."}return r},e.prototype.getAsLetter=function(e){var t=e/26,i=e%26;0===i&&(i=26,t--);for(var n=String.fromCharCode(64+i),r="";t>=0;)r+=n.toString(),t--;return r},e.prototype.getListTextListLevel=function(e,t){switch(e.listLevelPattern){case"UpRoman":return this.getAsRoman(t).toUpperCase();case"LowRoman":return this.getAsRoman(t).toLowerCase();case"UpLetter":return this.getAsLetter(t).toUpperCase();case"LowLetter":return this.getAsLetter(t).toLowerCase();case"Arabic":return t.toString();case"LeadingZero":return this.getAsLeadingZero(t);case"Number":case"OrdinalText":case"Ordinal":case"FarEast":case"Special":return t.toString();default:return""}},e.prototype.getFootEndNote=function(e,t){switch(e){case"UpperCaseRoman":return this.getAsRoman(t).toUpperCase();case"LowerCaseRoman":return this.getAsRoman(t).toLowerCase();case"UpperCaseLetter":return this.getAsLetter(t).toUpperCase();case"LowerCaseLetter":return this.getAsLetter(t).toLowerCase();default:return t.toString()}},e.prototype.generateNumber=function(e,t,i){for(var n="";e>=t;)e-=t,n+=i,this.value=e;return n.toString()},e.prototype.getAsLeadingZero=function(e){return e<10?"0"+e.toString():e.toString()},e.prototype.getAsRoman=function(e){var t="";return this.value=e,t+=this.generateNumber(this.value,1e3,"M"),t+=this.generateNumber(this.value,900,"CM"),t+=this.generateNumber(this.value,500,"D"),t+=this.generateNumber(this.value,400,"CD"),t+=this.generateNumber(this.value,100,"C"),t+=this.generateNumber(this.value,90,"XC"),t+=this.generateNumber(this.value,50,"L"),t+=this.generateNumber(this.value,40,"XL"),t+=this.generateNumber(this.value,10,"X"),t+=this.generateNumber(this.value,9,"IX"),t+=this.generateNumber(this.value,5,"V"),t+=this.generateNumber(this.value,4,"IV"),(t+=this.generateNumber(this.value,1,"I")).toString()},e.prototype.getListLevel=function(e,i){if(!t.isNullOrUndefined(e)){var n=this.documentHelper.getAbstractListById(e.abstractListId);!t.isNullOrUndefined(e)&&n.levels.length<=i&&i>=0&&i<9&&this.addListLevels(n);var r=void 0;if(!t.isNullOrUndefined(e.levelOverrides)&&!t.isNullOrUndefined(r=e.levelOverrides[i])&&!t.isNullOrUndefined(r.overrideListLevel))return r.overrideListLevel;if(!t.isNullOrUndefined(n)&&i>=0&&i<n.levels.length)return n.levels[i]}},e.prototype.getTabWidth=function(e,i,n,r,o){var s=o?this.documentHelper.textHelper.getTextSize(o,o.characterFormat):0,a=0,l=!1,d=e.paragraphFormat.getUpdatedTabs(),h=!1,c=e.bodyWidget.sectionFormat,p=L.convertPointToPixel(c.leftMargin);if(!t.isNullOrUndefined(e.paragraphFormat.listFormat.listLevel)&&!t.isNullOrUndefined(e.paragraphFormat.listFormat.listLevel.paragraphFormat)){var g=e.paragraphFormat.listFormat.listLevel.paragraphFormat;e.paragraphFormat.leftIndent!==g.leftIndent&&(h=!0)}var u=0,m=i.clientActiveArea.x,f=L.convertPointToPixel(e.paragraphFormat.firstLineIndent),v=L.convertPointToPixel(e.paragraphFormat.leftIndent);if(!t.isNullOrUndefined(o)&&r.isFirstLine()?(u=this.viewer.clientArea.x+f,h&&(m+=f)):u=this.viewer.clientArea.x,m<u||o instanceof Qe&&r.isFirstLine()&&v>0&&f<0)return i.clientArea.x-i.clientActiveArea.x;var y=i.clientActiveArea.x-(i.clientArea.x-L.convertPointToPixel(e.paragraphFormat.leftIndent)),b=L.convertPointToPixel(this.documentHelper.defaultTabWidth),w=!1;if(0===d.length&&(y>0&&b>Math.round(y)&&h||b===this.defaultTabWidthPixel&&b>Math.round(y)))return b-y;if(d.length>0)for(var C=0;C<d.length;C++){var x=d[C],F=L.convertPointToPixel(d[C].position);if(w=p+F+s>i.clientArea.x,Math.floor(y+s)<=F){if(l=!0,"Left"===x.tabJustification||"List"===x.tabJustification){a=F,o instanceof De&&(o.tabLeader=d[C].tabLeader,o.tabText="");break}var P=F-y,T=this.getRightTabWidth(o.indexInOwner+1,r,e);if(T<P)if("Right"===x.tabJustification){b=P-T;var S=L.convertPointToPixel(e.rightIndent),I=this.viewer.clientActiveArea.width+S-b;this.viewer.clientActiveArea.width+=S,I<0?b+=I-T:T>I&&(b-=T-I)}else b=P-T/2;else b="Center"===x.tabJustification&&T/2<P?P-T/2:"Right"===x.tabJustification?0:s;a=y,o instanceof De&&(o.tabLeader=d[C].tabLeader,o.tabText="");break}}if(!l){var N=100*Math.round(y)%(100*Math.round(b))/100;a=((Math.round(y)-N)/Math.round(b)+1)*b}return w&&v>0&&i.clientArea.x>m?i.clientArea.x-m:a-y>0?a-y:b},e.prototype.getRightTabWidth=function(e,t,i){for(var n=0,r=!1,o=t.children[e];o;){if(o instanceof Ie||o instanceof Ae||r?(o instanceof Ie&&(0===o.fieldType?r=!0:2===o.fieldType&&(r=!1)),o.width=0):o instanceof Oe&&this.documentHelper.textHelper.getTextSize(o,o.characterFormat),o instanceof Oe&&"\t"===o.text)return n;n+=o.width,o=o.nextNode}return n},e.prototype.getSplitIndexByWord=function(e,t,i,n){for(var r=0,o=t.length;r<o;){var s=this.getTextIndexAfterSpace(t,r);0!==s&&s!==o||(s=o-1);var a=i;if((s<o-1||s===o-1&&" "===t[s-1])&&r!==s&&(a=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(t.slice(0,s),n)),!(a<=e)){0===r&&" "===t[0]&&(r=this.getTextIndexAfterSpace(t,0));break}r=s}return r},e.prototype.getTextSplitIndexByCharacter=function(e,t,i,n,r){for(var o=i.length,s=0;s<o;s++){var a=n;if(s+1<o&&(a=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(i.substring(0,s+1),r)),a>t)return 0===s&&a>e?o>1&&" "===i[1]?this.getTextIndexAfterSpace(i,1):1:s}return 0},e.prototype.getSubWidth=function(e,t,i,n,r){var o=0,s=!0,a="";if(this.wrapPosition.length>0){var l=this.getSubWidthBasedOnTextWrap(e,t,i,n,r);if(l.length>0)return l}for(var d=e.children.length-1;d>=0;d--){var h=e.children[d];if(h.width>0&&h instanceof Oe){var c=h.text;a=c+a,!s||""===c.trim()&&"\t"!==c?s||(o+=h.width):(L.endsWith(c)?o+=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(c,h.characterFormat):o+=h.width,s=!1)}else{if(a="a"+a,s=!1,h instanceof Ge&&"Inline"!==h.textWrappingStyle)continue;o+=h.width}o=t?o:Math.round(o)}i=(a=a.trim()).length-L.removeSpace(a).length;var p=this.viewer.clientArea.width-n-o;return p<=0||0===i&&t&&!e.paragraph.paragraphFormat.bidi?(i=0,p=0):t&&(!r&&i>0?p/=i:i=0),[{subWidth:p,spaceCount:i}]},e.prototype.getSubWidthBasedOnTextWrap=function(e,i,n,r,o){for(var s=[],a=0,l="",d=this.wrapPosition.length-1,h=!0,c=e.children.length-1;c>=0;c--){var p=e.children[c];if(p.width>0&&p instanceof Oe){var g=p.text;l=g+l,!h||""===g.trim()&&"\t"!==g?h||(a+=p.width):(L.endsWith(g)?a+=this.documentHelper.textHelper.measureTextExcludingSpaceAtEnd(g,p.characterFormat):a+=p.width,h=!1)}else l="a"+l,h=!1,p instanceof Ge&&"Inline"!==p.textWrappingStyle||(a+=p.width);if((p.padding.left>0||0===c)&&d>=0){for(var u=this.wrapPosition[d--];u.width<=0&&d>=0;)u=this.wrapPosition[d--];var m=this.getSubWidthInfo(e,u.width,a,l,n,i,o);t.isNullOrUndefined(m)||(a=0,l="",s.unshift(m))}}return s},e.prototype.getSubWidthInfo=function(e,t,i,n,r,o,s){if(t>0){var a=t-i;r=(n=n.trim()).length-L.removeSpace(n).length;var l=a;return l<=0||0===r&&o&&!e.paragraph.paragraphFormat.bidi?(r=0,l=0):o&&(!s&&r>0?l/=r:r=0),{subWidth:l,spaceCount:r}}},e.prototype.getBeforeSpacing=function(e){var t=0;if(e.previousWidget instanceof we&&!this.documentHelper.dontUseHtmlParagraphAutoSpacing){var i=this.getAfterSpacing(e.previousWidget);i<e.paragraphFormat.beforeSpacing&&(t=e.paragraphFormat.beforeSpacing-i)}else t=e.paragraphFormat.beforeSpacing;return this.isSameStyle(e,!1)?0:L.convertPointToPixel(t)},e.prototype.getAfterSpacing=function(e){var t=e.paragraphFormat.afterSpacing;return this.isSameStyle(e,!0)?0:t},e.prototype.getLineSpacing=function(e,i){if(t.isNullOrUndefined(e.paragraphFormat))return 0;var n=0;switch(e.paragraphFormat.lineSpacingType){case"AtLeast":case"Exactly":n=e.paragraphFormat.lineSpacing;break;default:n=e.paragraphFormat.lineSpacing*i}return n},e.prototype.isParagraphFirstLine=function(e,i){var n=e;return!(!t.isNullOrUndefined(n.childWidgets)&&0!==n.childWidgets.indexOf(i))&&(!(i.children.length>0&&!t.isNullOrUndefined(e.previousWidget)&&e.previousWidget instanceof we)||i.paragraph.index!==e.previousWidget.index)},e.prototype.isParagraphLastLine=function(e){var t=e.line.paragraph,i=t.childWidgets[t.childWidgets.length-1],n=i.children[i.children.length-1];return e===n&&(n instanceof Ie||!(n instanceof Oe&&"\v"===n.text))},e.prototype.getTextIndexAfterSpace=function(e,t){var i=e.length,n=0,r=n=e.indexOf(" ",t)+1;if(0===r||r===i)return r;for(;" "===e[r]&&++r!==i;);return r},e.prototype.moveNextWidgetsToTable=function(e,t,i){var n=i?t[t.length-2]:t[t.length-1],r=n.indexInOwner,o=e[e.length-1];i&&(r+=1);for(var s=n.containerWidget.childWidgets.splice(r),a=0;a<s.length;a++)o.childWidgets.push(s[a]),s[a].containerWidget=o},e.prototype.addTableCellWidget=function(e,i,n,r){var o=0,s=0,a=0,l=n,d=0,h=r;t.isNullOrUndefined(e.cellFormat)||(e.cellFormat.containsMargins()?(a=t.isNullOrUndefined(e.cellFormat.leftMargin)?L.convertPointToPixel(e.ownerTable.tableFormat.leftMargin):L.convertPointToPixel(e.cellFormat.leftMargin),d=t.isNullOrUndefined(e.cellFormat.rightMargin)?L.convertPointToPixel(e.ownerTable.tableFormat.rightMargin):L.convertPointToPixel(e.cellFormat.rightMargin)):(a=0===e.columnIndex&&e.ownerRow.rowFormat.hasValue("leftMargin")?L.convertPointToPixel(e.ownerRow.rowFormat.leftMargin):L.convertPointToPixel(e.ownerTable.tableFormat.leftMargin),d=e.columnIndex===e.ownerTable.tableHolder.columns.length-1&&e.ownerRow.rowFormat.hasValue("rightMargin")?L.convertPointToPixel(e.ownerRow.rowFormat.rightMargin):L.convertPointToPixel(e.ownerTable.tableFormat.rightMargin))),e.margin=new ge(a,l,d,h);var c=e.cellFormat.cellWidth;c>e.cellFormat.preferredWidth&&0!==e.cellFormat.preferredWidth&&"Percent"!==e.cellFormat.preferredWidthType&&"Percent"!==e.ownerTable.tableFormat.preferredWidthType&&(c=e.cellFormat.preferredWidth),e.width=L.convertPointToPixel(c),t.isNullOrUndefined(e.previousWidget)||(o=e.previousWidget.columnIndex+e.previousWidget.cellFormat.columnSpan),s=t.isNullOrUndefined(e.ownerTable)||t.isNullOrUndefined(e.ownerTable.tableFormat)?0:L.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing);var p=0;o<e.columnIndex&&(p=L.convertPointToPixel(e.ownerTable.tableHolder.getPreviousSpannedCellWidth(o,e.columnIndex)),0===o&&(p-=s/2)),e.x=i.x+p+e.margin.left,e.y=i.y+e.margin.top+s,e.width=e.width-e.margin.left-e.margin.right,s>0&&(e.x+=s,1===e.ownerTable.tableHolder.columns.length?e.width-=2*s:0===e.columnIndex||e.columnIndex===e.ownerTable.tableHolder.columns.length-1?e.width-=2*s-s/2:e.width-=s);var g=L.convertPointToPixel(Pe.getCellLeftBorder(e).getLineWidth()),u=L.convertPointToPixel(Pe.getCellRightBorder(e).getLineWidth());e.leftBorderWidth=e.ownerTable.isBidiTable?u:g;var m="None"===e.cellFormat.borders.left.lineStyle,f="None"===e.cellFormat.borders.right.lineStyle;e.x+=m?e.leftBorderWidth>0?0:e.leftBorderWidth:0,e.width-=m?e.leftBorderWidth>0?0:e.leftBorderWidth:0;e.ownerTable.isBidiTable?e.cellIndex:(e.cellIndex,e.ownerRow.childWidgets.length);return(s>0||e.columnIndex===e.ownerTable.tableHolder.columns.length-1||e.columnIndex===e.containerWidget.childWidgets.length-1&&e.cellFormat.columnSpan>1)&&(e.rightBorderWidth=e.ownerTable.isBidiTable?g:u,e.ownerTable.tableFormat.allowAutoFit||(e.width-=e.rightBorderWidth)),e.margin.right+=f?0:e.rightBorderWidth,e},e.prototype.addWidgetToTable=function(e,i,n,r,o,s){var a=i[0],l=a.childWidgets.length,d=void 0,h=n.indexOf(r);if(h>0?d=n[h-1]:r.previousRenderedWidget instanceof Fe&&r.previousRenderedWidget.ownerTable.equals(r.ownerTable)&&(d=r.previousRenderedWidget),!t.isNullOrUndefined(d)){if(a=d.containerWidget,l=a.childWidgets.indexOf(d)+1,Math.round(r.y)!==Math.round(d.y+d.height)){var c=i.indexOf(a);c+1>=i.length&&this.addTableWidget(e.clientActiveArea,i,!0),l=(a=i[c+1]).childWidgets.length}h>0&&(l=0)}this.updateRowHeightBySpannedCell(a,r,l),this.updateRowHeightByCellSpacing(i,r,e),r.containerWidget&&r.containerWidget!==a&&-1!==r.containerWidget.childWidgets.indexOf(r)&&r.containerWidget.childWidgets.splice(r.containerWidget.childWidgets.indexOf(r),1),-1===a.childWidgets.indexOf(r)&&a.childWidgets.splice(l,0,r),r.containerWidget=a,a.height=a.height+r.height,a.isBidiTable&&r.shiftWidgetForRtlTable(this.viewer.clientArea,a,r),this.viewer instanceof le&&(t.isNullOrUndefined(a.containerWidget)||!(a.containerWidget.childWidgets.indexOf(a)>=0)||a.containerWidget instanceof ve||(a.containerWidget.height+=r.height)),this.updateHeightForRowWidget(e,!1,i,n,r,!1,o,s),e.cutFromTop(r.y+r.height)},e.prototype.updateRowHeightBySpannedCell=function(e,i,n){var r=1;if(0===e.childWidgets.length||0===n)return void this.updateRowHeight(i,i);for(s=0;s<i.childWidgets.length;s++){var o=i.childWidgets[s];r=t.isNullOrUndefined(o)||t.isNullOrUndefined(o.cellFormat)?r:o.cellFormat.rowSpan,this.updateSpannedRowCollection(r,i,o)}if(!t.isNullOrUndefined(i.ownerTable))for(var s=0;s<i.ownerTable.spannedRowCollection.length;s++)if(i.ownerTable.spannedRowCollection.keys[s]===i.index){for(var a=0;a<n;a++){var l=e.childWidgets[a];this.updateRowHeight(l,i)}i.ownerTable.spannedRowCollection.remove(i.ownerTable.spannedRowCollection.keys[s]);break}},e.prototype.updateRowHeight=function(e,i){for(var n=i.index,r=1,o=0;o<e.childWidgets.length;o++){var s=e.childWidgets[o];if(r=t.isNullOrUndefined(s)||t.isNullOrUndefined(s.cellFormat)?r:s.cellFormat.rowSpan,this.updateSpannedRowCollection(r,i,s),n-s.rowIndex==r-1){var a=s.y+s.height+s.margin.bottom-i.y;i.height<a&&(i.height=a)}}},e.prototype.updateSpannedRowCollection=function(e,i,n){e>1&&!t.isNullOrUndefined(i.ownerTable)&&(i.ownerTable.spannedRowCollection.containsKey(i.index+e-1)||i.ownerTable.spannedRowCollection.add(i.index+e-1,i.index))},e.prototype.updateRowHeightByCellSpacing=function(e,t,i){t.ownerTable.tableFormat.cellSpacing>0&&e.length>1&&t.y===i.clientArea.y&&i instanceof le&&(t.height=t.height-L.convertPointToPixel(t.ownerTable.tableFormat.cellSpacing)/2)},e.prototype.isRowSpanEnd=function(e,i){for(var n=e.index,r=1,o=0;o<this.documentHelper.splittedCellWidgets.length;o++){var s=this.documentHelper.splittedCellWidgets[o];if(r=t.isNullOrUndefined(s)||t.isNullOrUndefined(s.cellFormat)?r:s.cellFormat.rowSpan,n-s.rowIndex==r-1)return!0}return!1},e.prototype.isVerticalMergedCellContinue=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];if(t<n.columnIndex)return!0;t+=n.cellFormat.columnSpan}return t<e.ownerTable.tableHolder.columns.length},e.prototype.splitWidgets=function(e,t,i,n,r,o){if(this.isFirstLineFitForRow(t.clientArea.bottom,e)&&e.childWidgets.length>0){if(r=this.getSplittedWidgetForRow(t.clientArea.bottom,i,n,e),this.documentHelper.splittedCellWidgets.length>0||r!==e){if(o)for(var s=0;s<r.childWidgets.length;s++)r.childWidgets[s].rowIndex!==r.index&&(r.childWidgets.splice(s,1),s--);this.insertSplittedCellWidgets(t,i,r,e.index-1)}}else this.insertSplittedCellWidgets(t,i,r,e.index-1);return r},e.prototype.getSplittedWidgetForRow=function(e,i,n,r){for(var o=void 0,s=r.index,a=0;a<r.childWidgets.length;a++){var l=r.childWidgets[a],d=this.getSplittedWidget(e,!0,i,n,l);if(!t.isNullOrUndefined(d)){if(d===l)return r;-1!==r.childWidgets.indexOf(d)&&r.childWidgets.splice(r.childWidgets.indexOf(d),1),(0===a||r.height<l.height+l.margin.top+l.margin.bottom)&&(r.height=l.height+l.margin.top+l.margin.bottom),t.isNullOrUndefined(o)&&((o=new Fe).containerWidget=r.containerWidget,o.index=r.index,o.rowFormat=r.rowFormat,this.updateWidgetLocation(r,o),n.push(o));var h=1;h=t.isNullOrUndefined(d)||t.isNullOrUndefined(d.cellFormat)?h:d.cellFormat.rowSpan,s-d.rowIndex==h-1&&o.height<d.height+d.margin.top+d.margin.bottom?o.height=d.height+d.margin.top+d.margin.bottom:("Exactly"===r.rowFormat.heightType||"AtLeast"===r.rowFormat.heightType&&o.height<r.rowFormat.height)&&(o.height=r.rowFormat.height),o.childWidgets.push(d),d.containerWidget=o}}return o},e.prototype.updateWidgetsToTable=function(e,i,n){var r=this.getRowHeight(n,[n]),o=this.viewer,s=n.rowFormat.isHeader,a=void 0,l=n.rowFormat.allowBreakAcrossPages,d=n.rowFormat.heightType,h=0,c=0,p=n,g=!1;this.isTableFootNote?(this.footHeight=p.bodyWidget.page.footnoteWidget.height,this.isTableFootNote=!1):this.footHeight=0,n.ownerTable.continueHeader&&!s&&(n.ownerTable.continueHeader=!1);var u=n.ownerTable.isInsideTable,m=!1;for(h=t.isNullOrUndefined(n.ownerTable)||t.isNullOrUndefined(n.ownerTable.tableFormat)?0:L.convertPointToPixel(n.ownerTable.tableFormat.cellSpacing);c<i.length;){if(c=i.length,n.ownerTable.isInsideTable||0===this.documentHelper.splittedCellWidgets.length&&p.y+p.height+h+this.footnoteHeight<=o.clientArea.bottom)!this.isVerticalMergedCellContinue(n)||p.y!==o.clientArea.y&&p.y!==this.viewer.clientArea.y+p.ownerTable.headerHeight||this.insertSplittedCellWidgets(o,e,p,p.index-1),this.addWidgetToTable(o,e,i,p,void 0,u),this.documentHelper.splittedCellWidgets.length>0&&t.isNullOrUndefined(i[i.length-1].nextRow)&&(c--,m=!0),u=!1;else{if(u=!1,this.documentHelper.splittedCellWidgets.length>0&&p.y+p.height+this.footHeight<=o.clientArea.bottom&&!this.isRowSpanEnd(n,o)){!this.isVerticalMergedCellContinue(n)||p.y!==o.clientArea.y&&p.y!==this.viewer.clientArea.y+p.ownerTable.headerHeight||this.insertSplittedCellWidgets(o,e,p,p.indexInOwner-1),this.addWidgetToTable(o,e,i,p);continue}var f=p,v=e[e.length-1];if(r+p.y+this.footHeight>o.clientArea.bottom)if(!l||s&&n.ownerTable.continueHeader||"AtLeast"===d&&L.convertPointToPixel(n.rowFormat.height)<o.clientArea.bottom){if(("AtLeast"===d&&L.convertPointToPixel(n.rowFormat.height)<o.clientActiveArea.height&&l||"Exactly"!==d&&p.y===o.clientArea.y||"Auto"===d&&l)&&(f=this.splitWidgets(p,o,e,i,f,m)),"AtLeast"===d&&L.convertPointToPixel(n.rowFormat.height)>o.clientActiveArea.height&&l&&p.ownerTable.tableHolder.columns.length>this.getTotalColumnSpan(p)&&(f=p=this.splitWidgets(p,o,e,i,f,m)),"Exactly"===d&&p.y===o.clientArea.y&&(this.addWidgetToTable(o,e,i,p),c++),s&&n.ownerTable.continueHeader){n.ownerTable.header=!1,n.ownerTable.continueHeader=!1,n.ownerTable.headerHeight=0;S=void 0;if(o instanceof le&&(S=this.documentHelper.pages),!t.isNullOrUndefined(S))for(I=0;I<S.length;I++)S[I].repeatHeaderRowTableWidget&&(S[I].repeatHeaderRowTableWidget=!1)}}else"Auto"!==d&&"AtLeast"!==d||!l?"Exactly"===d&&p.y===o.clientArea.y&&(this.addWidgetToTable(o,e,i,p),c++):L.convertPointToPixel(n.rowFormat.height)>o.clientArea.bottom&&p.y!==o.clientArea.y||(f=this.splitWidgets(p,o,e,i,f,m));else{var y=!1;this.isVerticalMergedCellContinue(n)&&(l||(y=p.y===o.clientArea.y||p.y===this.viewer.clientArea.y+p.ownerTable.headerHeight))?y?this.insertSplittedCellWidgets(o,e,f,p.indexInOwner-1):f=this.splitWidgets(p,o,e,i,f,m):m&&!l&&(f=this.splitWidgets(p,o,e,i,f,m))}if(!t.isNullOrUndefined(f)){if(f!==p)this.addWidgetToTable(o,e,i,p,p.nextRow),this.updateWidgetsToPage(e,i,n.ownerTable,p.nextRow),e.indexOf(p.containerWidget)+1>=e.length&&this.addTableWidget(o.clientActiveArea,e,!0),p=f;else{if(n.index>0)if(this.updateWidgetsToPage(e,i,n.ownerTable,n),n.previousRenderedWidget instanceof Fe){var b=n.previousRenderedWidget;L.round(p.y,2)===L.round(b.y+b.height,2)?e.indexOf(b.containerWidget)+1>=e.length&&this.addTableWidget(o.clientActiveArea,e,!0):this.addTableWidget(o.clientActiveArea,e,!0)}else this.addTableWidget(o.clientActiveArea,e,!0);g=!0,c--}v=e[e.length-1];var w=void 0;w=e.length>1?e[e.length-2].containerWidget:n.ownerTable.previousRenderedWidget.containerWidget;t.isNullOrUndefined(w)||this.documentHelper.pages.indexOf(w.page);n.ownerTable.containerWidget.index;var C=void 0,x=void 0;x=g&&1===e.length?e[e.length-1]:e[e.length-2],C=this.moveBlocksToNextPage(x);var F=e[e.length-1];if(g&&0===n.index&&F.containerWidget&&-1!==F.containerWidget.childWidgets.indexOf(F)&&F.containerWidget.childWidgets.splice(F.containerWidget.childWidgets.indexOf(F),1),-1!==C.childWidgets.indexOf(F)&&C.childWidgets.splice(C.childWidgets.indexOf(F),1),C.childWidgets.unshift(F),F.containerWidget=C,(g&&n.index>0||i.length>1)&&this.moveNextWidgetsToTable(e,i,!g),g=!1,n.ownerTable.header&&p.height<o.clientArea.bottom){o instanceof le&&(o.documentHelper.currentRenderingPage.repeatHeaderRowTableWidget=!0),o.updateClientAreaForBlock(n.ownerTable,!0,e),f.x=f.x,f.y=v.y+n.ownerTable.headerHeight;P=h/2;this.updateChildLocationForRow(v.y+n.ownerTable.headerHeight-P,f)}else{o.updateClientAreaForBlock(n.ownerTable,!0,e),f.x=f.x,f.y=v.y;var P=h/2;this.updateChildLocationForRow(v.y-P,f)}}m=!1}if(s&&(n.ownerTable.continueHeader&&(n.ownerTable.header=!0,n.ownerTable.headerHeight=r+n.ownerTable.headerHeight),a=this.getHeader(n.ownerTable),!t.isNullOrUndefined(a)&&n.index===a.index)){var T=this.getHeaderHeight(n.ownerTable,n,i);if((T>n.ownerTable.headerHeight||T>n.ownerTable.headerHeight)&&(n.ownerTable.headerHeight=T),n.ownerTable.headerHeight>o.clientArea.height){n.ownerTable.header=!1,n.ownerTable.continueHeader=!1,n.ownerTable.headerHeight=0;for(var S=this.documentHelper.pages,I=0;I<S.length;I++)S[I].repeatHeaderRowTableWidget&&(S[I].repeatHeaderRowTableWidget=!1)}}e.length>2&&n.ownerTable.header&&p.height<o.clientActiveArea.bottom&&!o.documentHelper.currentRenderingPage.repeatHeaderRowTableWidget&&(o.documentHelper.currentRenderingPage.repeatHeaderRowTableWidget=!0)}},e.prototype.getHeader=function(e){var t=void 0,i=!0;e=e.getSplitWidgets()[0];for(var n=0;n<e.childWidgets.length;n++){var r=e.childWidgets[n];if(r.rowFormat.isHeader?t=r:i=!1,!i)break}return t},e.prototype.getHeaderHeight=function(e,t,i){var n=0;if(t.ownerTable.childWidgets.length>0&&e.childWidgets[0].rowFormat.isHeader)for(var r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];if(!o.rowFormat.isHeader)break;n+=this.getRowHeight(o,i)}return n},e.prototype.updateWidgetToRow=function(e){var i=e.ownerRow;if(e.containerWidget=i,!t.isNullOrUndefined(e.ownerRow)&&"Exactly"!==e.ownerRow.rowFormat.heightType&&L.convertPointToPixel(e.ownerRow.rowFormat.height)>0&&0===e.cellIndex&&(i.height=i.height+L.convertPointToPixel(e.ownerRow.rowFormat.height)),1===e.cellFormat.rowSpan){var n=e.height+e.margin.top+e.margin.bottom;i.height-L.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing)<n&&(i.height=n+L.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing))}},e.prototype.updateHeightForRowWidget=function(e,t,i,n,r,o,s,a){for(var l=0;l<r.childWidgets.length;l++){var d=0,h=void 0,c=1;if(c=(h=r.childWidgets[l]).cellFormat.rowSpan,d=L.convertPointToPixel(h.ownerTable.tableFormat.cellSpacing),c>1){var p=r.containerWidget.childWidgets.indexOf(r),g=p+c-1-(r.index-h.rowIndex);!a&&(e.clientArea.bottom<h.y+h.height+h.margin.bottom||g>=p+1)&&(1===n.length||n.length>=1&&r===n[n.length-1])&&this.splitSpannedCellWidget(h,i,n,e);var u=r;if(g>0)if(g<r.containerWidget.childWidgets.length){var m=r.containerWidget.childWidgets[g];m instanceof Fe&&(u=m)===s&&(u=r)}else u=r.containerWidget.childWidgets[r.containerWidget.childWidgets.length-1];h.y+h.height+h.margin.bottom<u.y+u.height?h.height=u.y+u.height-h.y-h.margin.bottom:o&&u&&0!==u.y&&0!==u.height&&h.y+h.height+h.margin.bottom>u.y+u.height&&(u.height=h.y+h.height+h.margin.bottom-u.y)}else d>0&&i.length>1&&r.y===e.clientArea.y&&e instanceof le&&(d/=2),h.height=r.height-h.margin.top-h.margin.bottom-d;this.updateHeightForCellWidget(e,i,n,h);for(var f=r.containerWidget;f.containerWidget instanceof ue;)f=f.containerWidget;var v=void 0;f instanceof fe&&(v=f.page),(e instanceof le&&-1!==e.visiblePages.indexOf(v)||t)&&this.updateCellVerticalPosition(h,!1,h.ownerTable.isInsideTable)}},e.prototype.updateHeightForCellWidget=function(e,t,i,n){for(var r=0;r<n.childWidgets.length;r++)n.childWidgets[r]instanceof xe&&this.updateHeightForTableWidget(t,i,n.childWidgets[r])},e.prototype.getRowHeight=function(e,t){var i=0;if("Exactly"===e.rowFormat.heightType)i=e.rowFormat.height;else{for(var n=0;n<t.length;n++)t[n]instanceof Fe&&(i=t[n].height+i);i=Math.max(i,e.rowFormat.height)}return i},e.prototype.splitSpannedCellWidget=function(e,i,n,r){var o=this.getSplittedWidget(r.clientArea.bottom,!1,i,n,e);t.isNullOrUndefined(o)||this.documentHelper.splittedCellWidgets.push(o)},e.prototype.insertSplittedCellWidgets=function(e,i,n,r){var o=n.x,s=0;s=L.convertPointToPixel(n.ownerTable.tableHolder.tableWidth);for(var a=0;a<n.childWidgets.length;a++){var l=n.childWidgets[a];if(Math.round(o)<Math.round(l.x-l.margin.left)){if(this.insertRowSpannedWidget(n,e,o,a)){a--;continue}var d=n.childWidgets.length;if(this.insertEmptySplittedCellWidget(n,i,o,a,r),d<n.childWidgets.length){if(0===a)break;a--;continue}}if(o+=l.margin.left+l.width+l.margin.right,a===n.childWidgets.length-1&&Math.round(o)<Math.round(n.x+s)){if(this.insertRowSpannedWidget(n,e,o,a+1))continue;this.insertEmptySplittedCellWidget(n,i,o,a+1,r)}else;}if((t.isNullOrUndefined(n.childWidgets)||0===n.childWidgets.length)&&this.documentHelper.splittedCellWidgets.length>0)for(var h=0;h<this.documentHelper.splittedCellWidgets.length;h++){var c=this.documentHelper.splittedCellWidgets[h];if(Math.round(o)<=Math.round(c.x-c.margin.left)){if(this.insertRowSpannedWidget(n,e,o,h)){h--;continue}var p=n.childWidgets.length;if(this.insertEmptySplittedCellWidget(n,i,o,h,r),p<n.childWidgets.length){h--;continue}}if(o+=c.margin.left+c.width+c.margin.right,h===n.childWidgets.length-1&&Math.round(o)<Math.round(n.x+s)){if(this.insertRowSpannedWidget(n,e,o,h+1))continue;this.insertEmptySplittedCellWidget(n,i,o,h+1,r)}else;}this.documentHelper.splittedCellWidgets.length>0&&(this.documentHelper.splittedCellWidgets=[])},e.prototype.insertRowSpannedWidget=function(e,t,i,n){var r=0;e.ownerTable.tableFormat.cellSpacing>0&&(r=L.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing));for(var o=0;o<this.documentHelper.splittedCellWidgets.length;o++){var s=this.documentHelper.splittedCellWidgets[o];if(Math.round(i)===Math.round(s.x-s.margin.left))return e.childWidgets.splice(n,0,s),s.containerWidget=e,s.y!==e.y+s.margin.top+r&&this.updateChildLocationForRow(e.y,e),this.documentHelper.splittedCellWidgets.splice(o,1),!0}return!1},e.prototype.insertEmptySplittedCellWidget=function(e,i,n,r,o){for(var s,a=i[i.length-1],l=i.length-1;l>=0;l--)for(var d=i[l],h=d.childWidgets.length-1;h>=0;h--){var c=d.childWidgets[h];if(c.index===o){s=c;break}}s&&(a=s.ownerTable,o=s.indexInOwner);for(var p=o;p>=0;p--)for(var g=a.childWidgets[p],u=g.x,l=0;l<g.childWidgets.length;l++){var m=1,f=g.childWidgets[l];if(Math.round(n)===Math.round(u)&&(m=t.isNullOrUndefined(f)||t.isNullOrUndefined(f.cellFormat)?m:f.cellFormat.rowSpan)>1){var v=this.createCellWidget(f);return e.childWidgets.splice(r,0,v),v.containerWidget=e,void this.updateChildLocationForRow(e.y,e)}u+=f.margin.left+f.width+f.margin.right}},e.prototype.getSplittedWidget=function(e,i,n,r,o){var s=void 0;if(o.y+o.height>e-o.margin.bottom)for(var a=0;a<o.childWidgets.length;a++)if(o.childWidgets[a]instanceof we){var l=o.childWidgets[a],d=this.getSplittedWidgetForPara(e-o.margin.bottom,l);if(!t.isNullOrUndefined(d)){if(0===a&&d===l)return o;-1!==o.childWidgets.indexOf(d)&&(o.childWidgets.splice(o.childWidgets.indexOf(d),1),a--),o.height-=d.height,t.isNullOrUndefined(s)&&(s=this.createCellWidget(o)),s.height+=d.height,s.childWidgets.push(d),d.containerWidget=s}}else{var h=o.childWidgets[a],c=[h];if(e-o.margin.bottom<h.y+h.height){var p=h.height,g=this.getSplittedWidgetForTable(e-o.margin.bottom,c,h);if(t.isNullOrUndefined(g)&&!h.childWidgets[0].rowFormat.allowBreakAcrossPages&&(g=h),!t.isNullOrUndefined(g)){if(0===a&&g===h)return o;-1!==o.childWidgets.indexOf(g)?(o.childWidgets.splice(o.childWidgets.indexOf(g),1),a--,o.height-=g.height):o.height-=p-h.height,t.isNullOrUndefined(s)&&(s=this.createCellWidget(o)),s.height+=g.height,s.childWidgets.push(g),g.containerWidget=s}}}return t.isNullOrUndefined(s)&&i&&(s=this.createCellWidget(o)),s},e.prototype.getListLevelPattern=function(e){switch(e){case 0:return"Arabic";case 1:return"LowLetter";case 2:return"LowRoman";case 3:return"UpLetter";case 4:return"UpRoman";case 5:return"Ordinal";case 6:return"Number";case 7:return"OrdinalText";case 8:return"LeadingZero";case 9:return"Bullet";case 10:return"FarEast";case 11:return"Special";default:return"None"}},e.prototype.createCellWidget=function(e){var t=new Pe;return t.cellFormat=e.cellFormat,t.index=e.index,t.rowIndex=e.rowIndex,t.columnIndex=e.columnIndex,t.containerWidget=e.containerWidget,this.updateWidgetLocation(e,t),t.margin=e.margin,t.leftBorderWidth=e.leftBorderWidth,t.rightBorderWidth=e.rightBorderWidth,t},e.prototype.createTableWidget=function(e){var t=new xe;return e.header&&(t.header=e.header,t.headerHeight=e.headerHeight),t.index=e.index,t.tableFormat=e.tableFormat,t.tableHolder=e.tableHolder,t.isGridUpdated=e.isGridUpdated,t},e.prototype.getSplittedWidgetForPara=function(e,i){for(var n=i.y,r=void 0,o=0;o<i.childWidgets.length;o++){var s=i.childWidgets[o];if(e<n+this.footHeight+s.height){if(0===o){if(s.paragraph.containerWidget instanceof Pe&&s.paragraph.containerWidget.y===i.y){n+=s.height;continue}r=i;break}-1!==i.childWidgets.indexOf(s)&&(i.childWidgets.splice(i.childWidgets.indexOf(s),1),o--),i.height-=s.height,t.isNullOrUndefined(r)?((r=new we).characterFormat=i.characterFormat,r.paragraphFormat=i.paragraphFormat,r.index=i.index,this.updateWidgetLocation(i,r),r.height=s.height):r.height+=s.height,r.childWidgets.push(s),s.paragraph=r}n+=s.height}return r},e.prototype.getSplittedWidgetForTable=function(e,i,n){for(var r=n.y,o=void 0,s=0;s<n.childWidgets.length;s++){var a=void 0,l=(a=n.childWidgets[s]).height;if(e<r+l||!t.isNullOrUndefined(o)){var d=void 0,h=!0;if(t.isNullOrUndefined(a)||t.isNullOrUndefined(a.rowFormat)||(h=a.rowFormat.allowBreakAcrossPages),h&&(d=t.isNullOrUndefined(o)&&this.isFirstLineFitForRow(e,a)?this.getSplittedWidgetForRow(e,i,[a],a):a),!t.isNullOrUndefined(d)){if(0===s&&d===a)return n;-1!==n.childWidgets.indexOf(d)?(n.childWidgets.splice(n.childWidgets.indexOf(d),1),s--,n.height-=d.height):n.height-=l-a.height,t.isNullOrUndefined(o)?(o=this.createTableWidget(n),this.updateWidgetLocation(n,o),o.height=d.height):o.height+=d.height,o.childWidgets.push(d),d.containerWidget=o}}r+=a.height}return o},e.prototype.isFirstLineFitForPara=function(e,i){var n=i.childWidgets[0],r=n.paragraph.containerWidget;if(this.documentHelper.isFirstLineFitInShiftWidgets){if(this.viewer.clientActiveArea.y===this.viewer.clientArea.y&&i.y+n.height+this.footHeight>=e)return!0}else if(r.ownerTable.isInsideTable){var o=void 0;if(r.containerWidget instanceof Fe&&r.containerWidget.containerWidget instanceof xe&&r.containerWidget.containerWidget.containerWidget instanceof Pe&&(o=r.containerWidget.containerWidget.containerWidget),!t.isNullOrUndefined(o)&&r.containerWidget.y===o.y&&i.y+n.height+this.footHeight>=e)return!0}else if(r.containerWidget.y===this.viewer.clientArea.y&&i.y+n.height+this.footHeight>=e)return!0;return i.y+n.height+this.footHeight<=e},e.prototype.isFirstLineFitForTable=function(e,i){var n=void 0,r=!1;return n=i.childWidgets[0],t.isNullOrUndefined(n)||(r=this.isFirstLineFitForRow(e,n)),r},e.prototype.isFirstLineFitForRow=function(e,t){for(var i=0;i<t.childWidgets.length;i++){var n=t.childWidgets[i];if(!this.isFirstLineFitForCell(e,n))return!1}return!0},e.prototype.isFirstLineFitForCell=function(e,t){if(0===t.childWidgets.length)return!0;if(t.childWidgets[0]instanceof we){var i=t.childWidgets[0],n=this.isFirstLineFitForPara(e-t.margin.bottom,i);return n&&i==t.childWidgets[t.childWidgets.length-1]&&t==t.containerWidget.lastChild?t.y+t.height<=e:n}var r=t.childWidgets[0];return this.isFirstLineFitForTable(e-t.margin.bottom,r)},e.prototype.updateWidgetLocation=function(e,t){t.x=e.x,t.y=e.y,t.width=e.width},e.prototype.updateChildLocationForTable=function(e,t){for(var i=0;i<t.childWidgets.length;i++){var n=t.childWidgets[i];n.y=e,this.updateChildLocationForRow(e,n),e+=n.height}},e.prototype.updateChildLocationForRow=function(e,t){var i=0;t.ownerTable.tableFormat.cellSpacing>0&&(i=L.convertPointToPixel(t.ownerTable.tableFormat.cellSpacing));for(var n=0;n<t.childWidgets.length;n++){var r=t.childWidgets[n];r.index=r.cellIndex,r.y=e+r.margin.top+i,this.updateChildLocationForCellOrShape(r.y,r)}},e.prototype.updateChildLocationForCellOrShape=function(e,i){var n=i;i instanceof Ke&&(n=i.textFrame);for(var r=0;r<n.childWidgets.length;r++){if(n.childWidgets[r].x=n.childWidgets[r].x,n.childWidgets[r].y=e,n.childWidgets[r]instanceof xe&&this.updateChildLocationForTable(e,n.childWidgets[r]),n.childWidgets[r]instanceof we)for(var o=n.childWidgets[r],s=0;s<o.childWidgets.length;s++)for(var a=o.childWidgets[0],l=0;l<a.children.length;l++)if(a.children[l]instanceof Le){if(!t.isNullOrUndefined(o.bodyWidget.page.footnoteWidget))return;o.bodyWidget.previousRenderedWidget;var d=o.bodyWidget.previousRenderedWidget,h=o.bodyWidget,c=this.getFootNoteWidgetsOf(o);this.moveFootNotesToPage(c,d,h),this.layoutfootNote(o.bodyWidget.page.footnoteWidget)}e+=n.childWidgets[r].height}},e.prototype.updateCellVerticalPosition=function(e,t,i){var n=e.ownerTable.containerWidget;if(n instanceof me||n instanceof Xe||i){var r=this.getDisplacement(e,t);this.updateCellContentVerticalPosition(e,r,t)}},e.prototype.updateCellContentVerticalPosition=function(e,t,i){if(0!==t)for(var n=e.y+t,r=0;r<e.childWidgets.length;r++){if(e.childWidgets[r]instanceof we){var o=e.childWidgets[r];o.y=n,this.updateShapeInsideCell(o,t)}else n=this.updateTableWidgetLocation(e.childWidgets[r],n,i);n+=e.childWidgets[r].height}},e.prototype.updateShapeInsideCell=function(e,t){for(var i=0;i<e.floatingElements.length;i++){var n=e.floatingElements[i];n.y+=t,n instanceof Ke&&this.updateChildLocationForCellOrShape(n.y,n)}},e.prototype.updateTableWidgetLocation=function(e,t,i){e.y=t+=e.topBorderWidth;for(var n=0;n<e.childWidgets.length;n++){var r=e.childWidgets[n];r.y=t;for(var o=0;o<r.childWidgets.length;o++){var s=r.childWidgets[o];s.y=t+s.margin.top+0,this.updateCellVerticalPosition(s,i,!0)}t+=r.height}return t},e.prototype.getDisplacement=function(e,i){var n=0,r=e.containerWidget,o=e.margin.top+e.margin.bottom;n=!t.isNullOrUndefined(e.cellFormat)&&e.cellFormat.rowSpan>1?e.height:(t.isNullOrUndefined(r)?0:r.height)-o;var s=this.getCellContentHeight(e,!0),a=0;return n>s&&(a=n-s,"Center"===e.cellFormat.verticalAlignment?a/=2:("Top"===e.cellFormat.verticalAlignment||i)&&(a=0)),a},e.prototype.getCellContentHeight=function(e,i){if(t.isNullOrUndefined(e.childWidgets))return 0;for(var n=0,r=e.y,o=0,s=0,a=!1,l=!1,d=0;d<e.childWidgets.length;d++)if(e.childWidgets[d]instanceof we){var h=e.childWidgets[d];n+=e.childWidgets[d].height;for(var c=0;c<h.floatingElements.length;c++){a=!0;var p=h.floatingElements[c];e.y+e.containerWidget.height>p.y+p.height&&p.y+p.height>s?(o=Math.abs(r-(p.y+p.height)),s=p.y+p.height,l=!1):l=!0}}else n+=e.childWidgets[d].height;return r+n>s&&(a=!1),i&&a?o:i&&l?e.ownerRow.height:n},e.prototype.getTableLeftBorder=function(e){if(t.isNullOrUndefined(e.left)){var i=new N(e);return i.lineStyle="Single",i.lineWidth=.66,i}return e.left},e.prototype.getTableRightBorder=function(e){if(t.isNullOrUndefined(e.right)){var i=new N(e);return i.lineStyle="Single",i.lineWidth=.66,i}return e.right},e.prototype.getTableTopBorder=function(e){if(t.isNullOrUndefined(e.top)){var i=new N(e);return i.lineStyle="Single",i.lineWidth=.66,i}return e.top},e.prototype.getTableBottomBorder=function(e){if(t.isNullOrUndefined(e.bottom)){var i=new N(e);return i.lineStyle="Single",i.lineWidth=.66,i}return e.bottom},e.prototype.getCellDiagonalUpBorder=function(e){var t=void 0;return t=e.cellFormat.borders,t.diagonalUp},e.prototype.getCellDiagonalDownBorder=function(e){var t=void 0;return t=e.cellFormat.borders,t.diagonalDown},e.prototype.getTableWidth=function(e){for(var t=0,i=0;i<e.childWidgets.length;i++){for(var n=e.childWidgets[i],r=0,o=0;o<n.childWidgets.length;o++){var s=n.childWidgets[o];r+=L.convertPointToPixel(s.cellFormat.cellWidth)}t<r&&(t=r)}return t},e.prototype.layoutNextItemsBlock=function(e,i,n){var r=e.bodyWidget.sectionIndex,o=e,s=o.getSplitWidgets(),a=s[s.length-1].nextRenderedWidget;(t.isNullOrUndefined(a)||this.documentHelper.blockToShift===o)&&(this.documentHelper.blockToShift=void 0);for(var l=!0;a instanceof ye&&a.bodyWidget.sectionIndex===r&&(t.isNullOrUndefined(n)||!n||a.isLayouted||!this.isInitialLoad);){var d=void 0,h=o.getSplitWidgets();d=h[h.length-1],o=a,this.documentHelper.blockToShift===o&&(this.documentHelper.blockToShift=void 0),l=!1;var c=void 0;if(c=o.getSplitWidgets()[0],0===this.documentHelper.fieldStacks.length&&!t.isNullOrUndefined(c)&&d.containerWidget===c.containerWidget&&L.round(c.y,2)===L.round(d.y+d.height,2)){t.isNullOrUndefined(this.documentHelper.blockToShift)?c.bodyWidget&&c.bodyWidget.floatingElements.length>0&&(this.documentHelper.blockToShift=o):this.documentHelper.blockToShift=o;break}if(l=!0,i.owner.isShiftingEnabled&&0===this.documentHelper.fieldStacks.length){this.documentHelper.blockToShift=o;break}!t.isNullOrUndefined(this.viewer.owner.editorModule)&&this.viewer.owner.editorModule.isInsertingTOC||(o=o.combineWidget(this.viewer),d.containerWidget!==o.containerWidget&&(!(d instanceof we)||d instanceof we&&!d.isEndsWithPageBreak)&&this.updateContainerWidget(o,d.containerWidget,d.indexInOwner+1,!1),o instanceof xe&&(this.clearTableWidget(o,!0,!0),o.isGridUpdated=!1),i.updateClientAreaForBlock(o,!0),this.viewer instanceof de&&(o.containerWidget.height-=o.height),this.documentHelper.layout.layoutBlock(o,0),i.updateClientAreaForBlock(o,!1)),a=(s=a.getSplitWidgets())[s.length-1].nextRenderedWidget}i.owner.isShiftingEnabled&&this.documentHelper.blockToShift===o||this.viewer.owner.editorModule.updateListItemsTillEnd(o,l)},e.prototype.updateClientAreaForLine=function(e){e.marginTop=0;var t=this.documentHelper.selection.getTop(e),i=this.viewer.clientArea.x;this.viewer.cutFromTop(t),this.viewer.cutFromLeft(i)},e.prototype.getParentTable=function(e){for(var t=e;t.containerWidget;){if(t.containerWidget instanceof me||t.containerWidget instanceof Xe)return t;t=t.containerWidget}},e.prototype.reLayoutParagraph=function(e,i,n,r,o){if(this.isRelayout=!0,r=!t.isNullOrUndefined(r)&&r,this.isRelayout=!0,this.documentHelper.blockToShift===e?(this.layoutBodyWidgetCollection(e.index,e.containerWidget,e,!1),this.isBidiReLayout=!0):this.isBidiReLayout&&(this.isBidiReLayout=!1),e.isInsideTable){if(this.isBidiReLayout=!0,this.reLayoutTable(e),this.isFootnoteContentChanged&&!t.isNullOrUndefined(e.bodyWidget)&&!t.isNullOrUndefined(e.bodyWidget.page.footnoteWidget)){var s=e.bodyWidget.page.footnoteWidget;this.layoutfootNote(s)}this.isBidiReLayout=!1}else this.reLayoutLine(e,i,r,o);e.bodyWidget instanceof ve&&-1!==e.bodyWidget.headerFooterType.indexOf("Footer")&&this.shiftFooterChildLocation(e.bodyWidget,this.viewer)},e.prototype.getParentRow=function(e){for(var t=e;null!==t.ownerTable&&t.ownerTable.isInsideTable;)t=t.ownerTable.associatedCell;return t.ownerRow},e.prototype.reLayoutRow=function(e){e instanceof we&&(e=e.associatedCell);var i=this.getParentRow(e).getSplitWidgets()[0];if(t.isNullOrUndefined(i)||i.ownerTable.tableFormat.allowAutoFit)this.currentCell=e,this.reLayoutTable(e),this.currentCell=void 0;else{for(var n=i.ownerTable.getSplitWidgets()[0].combineWidget(this.viewer),r=i;this.isVerticalMergedCellContinue(r);){var o=r.previousWidget;if(t.isNullOrUndefined(o))break;r=o}var s=n.containerWidget;this.viewer instanceof de&&(s.height-=n.height),!this.viewer.owner.enableHeaderAndFooter&&!e.isInHeaderFooter||s instanceof Xe?s instanceof Xe?this.viewer.updateClientAreaForTextBoxShape(s.containerShape,!0):this.viewer.updateClientArea(s.sectionFormat,s.page):(e.bodyWidget.isEmpty=!1,s.height-=n.height,this.viewer.updateHeaderFooterClientAreaWithTop(n.bodyWidget.sectionFormat,this.documentHelper.isBlockInHeader(n),s.page));var a=new ce(this.viewer.clientArea.x,this.viewer.clientArea.y,this.viewer.clientArea.width,this.viewer.clientArea.height),l=new ce(a.x,a.y,a.width,a.height);if(this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule){var d=this.documentHelper.selection.getFirstParagraphInFirstCell(n);this.viewer.owner.editorModule.updateWholeListItems(d)}this.viewer.updateClientAreaForBlock(n,!0),this.viewer.cutFromTop(r.y),this.viewer.clientActiveArea.height=Number.POSITIVE_INFINITY,n.height=0;do{if(this.clearRowWidget(i,!0,!0,!0),this.layoutRow([n],i,!0),r===i)break;r=r.nextRow}while(r&&r!==i);this.updateChildLocationForTable(n.y,n),this.viewer.clientArea=l,this.viewer.clientActiveArea=new ce(l.x,l.y,l.width,l.height),this.viewer.updateClientAreaForBlock(n,!0),n.x-=n.leftBorderWidth,n.y-=n.topBorderWidth,this.viewer.cutFromTop(n.y),this.shiftTableWidget(n,this.viewer,!0),this.layoutNextItemsBlock(n,this.viewer)}},e.prototype.reLayoutTable=function(e,t){var i=this.getParentTable(e),n=i.combineWidget(this.viewer),r=n.containerWidget;if(this.viewer instanceof de&&(r.height-=n.height),!this.viewer.owner.enableHeaderAndFooter&&!e.isInHeaderFooter||r instanceof Xe?r instanceof Xe?this.viewer.updateClientAreaForTextBoxShape(r.containerShape,!0):this.viewer.updateClientArea(r.sectionFormat,r.page):(e.bodyWidget.isEmpty=!1,r.height-=n.height,this.viewer.updateHeaderFooterClientAreaWithTop(i.bodyWidget.sectionFormat,this.documentHelper.isBlockInHeader(i),r.page)),this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule){var o=this.documentHelper.selection.getFirstParagraphInFirstCell(n);this.viewer.owner.editorModule.updateWholeListItems(o)}this.viewer.updateClientAreaForBlock(n,!0),n.x-=n.leftBorderWidth,n.y-=n.topBorderWidth,this.viewer.cutFromTop(n.y),this.clearTableWidget(n,!0,!0,!0),this.isBidiReLayout=!0,this.layoutBlock(n,0),this.viewer.updateClientAreaForBlock(n,!1),this.layoutNextItemsBlock(n,this.viewer,t)},e.prototype.clearTableWidget=function(e,t,i,n){e.height=0,n&&(e.isGridUpdated=!1),t&&(e.y=0,e.x=0);for(var r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];this.clearRowWidget(o,t,i,n)}},e.prototype.clearRowWidget=function(e,t,i,n){e.height=0,t&&(e.y=0,e.x=0);for(var r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];this.clearCellWidget(o,t,i,n)}},e.prototype.clearCellWidget=function(e,t,i,n){e.height=0,t&&(e.y=0,e.x=0);for(var r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];o instanceof we?i&&(o.height=0):this.clearTableWidget(o,t,i,n)}},e.prototype.layoutBodyWidgetCollection=function(e,i,n,r,o){if(!t.isNullOrUndefined(this.documentHelper.owner)&&this.documentHelper.owner.isLayoutEnabled)if(i instanceof me||i instanceof Xe){var s=this.checkAndGetBlock(i,e);if(t.isNullOrUndefined(s))return;if(this.viewer instanceof de&&(s.containerWidget.height-=s.height),i instanceof ve?(i.isEmpty=!1,this.viewer.updateHeaderFooterClientAreaWithTop(i.sectionFormat,-1!==i.headerFooterType.indexOf("Header"),i.page),s.containerWidget.height-=s.height):i instanceof Xe?this.viewer.updateClientAreaForTextBoxShape(i.containerShape,!0):i instanceof be?"Footnote"===i.footNoteType&&(this.isRelayoutFootnote=!0,this.viewer.updateClientArea(i.sectionFormat,i.page,!0),this.viewer.clientArea.height=Number.POSITIVE_INFINITY,this.viewer.clientActiveArea.height=Number.POSITIVE_INFINITY,s.containerWidget.height-=s.height,this.viewer.clientActiveArea.y=s.containerWidget.y):t.isNullOrUndefined(i.page.footnoteWidget)?this.viewer.updateClientArea(i.sectionFormat,i.page,!0):(i.page.footnoteWidget.footNoteType,this.viewer.updateClientArea(i.sectionFormat,i.page,!0)),e>0){var a=s.getSplitWidgets()[0].previousRenderedWidget;if(!(a instanceof we)||a instanceof we&&!a.isEndsWithPageBreak){if(this.viewer.cutFromTop(a.y+a.height),t.isNullOrUndefined(o)&&s.containerWidget!==a.containerWidget){var l=s.containerWidget,d=a.containerWidget,h=this.getFootNoteWidgetsOf(s);this.updateContainerWidget(s,d,a.indexInOwner+1,!1),this.moveFootNotesToPage(h,l,d)}}else a instanceof we&&a.isEndsWithPageBreak&&a.containerWidget===s.containerWidget&&this.moveBlocksToNextPage(a)}var c=void 0;(s=s.combineWidget(this.viewer))instanceof xe?(this.clearTableWidget(s,!0,!0),s.isGridUpdated=!1,c=this.documentHelper.selection.getFirstParagraphInFirstCell(s)):c=s,this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&this.viewer.owner.editorModule.updateWholeListItems(c),this.viewer.updateClientAreaForBlock(s,!0),this.documentHelper.layout.layoutBlock(s,0),this.viewer.updateClientAreaForBlock(s,!1),r?this.shiftNextWidgets(s):this.layoutNextItemsBlock(s,this.viewer)}else if(i instanceof Pe){var p=this.documentHelper.layout.getParentTable(i.ownerTable).getSplitWidgets()[0];this.reLayoutTable(i.ownerTable),this.layoutNextItemsBlock(p,this.viewer)}this.isRelayoutFootnote=!1},e.prototype.checkAndGetBlock=function(e,t){if(e instanceof Xe)return e.childWidgets[t];for(var i=e.index;e&&e.index===i;){if(e.childWidgets.length>0&&e.firstChild.index<=t&&e.lastChild.index>=t)for(var n=0;n<e.childWidgets.length;n++){var r=e.childWidgets[n];if(r.index===t)return r}if(!(e instanceof fe))break;e=e.nextRenderedWidget}},e.prototype.layoutTable=function(e,t){e.isBidiTable=e.bidi,e.isGridUpdated||(e.buildTableColumns(),e.isGridUpdated=!0);var i=[e];this.addTableWidget(this.viewer.clientActiveArea,i),this.viewer.updateClientAreaTopOrLeft(e,!0);var n,r,o=0;e.wrapTextAround?(n=this.viewer.clientActiveArea.clone(),r=this.viewer.clientArea.clone(),this.updateTableFloatPoints(e)):(this.adjustClientAreaBasedOnTextWrapForTable(e,this.viewer.clientActiveArea),this.isWrapText&&(o=this.viewer.clientActiveArea.x-this.viewer.clientArea.x,this.isWrapText=!1,e.x=this.viewer.clientActiveArea.x));var s=e.childWidgets[0].rowFormat.isHeader;e.childWidgets.length>0&&(e.header=s,e.continueHeader=s,e.headerHeight=0);for(var a=e.childWidgets[t];a;)a=(a=this.layoutRow(i,a)).nextRow;return this.updateWidgetsToPage(i,[],e),o>0&&(this.viewer.clientArea.x=this.viewer.clientArea.x-o),e.wrapTextAround&&e.bodyWidget&&(this.viewer.clientActiveArea=n.clone(),this.viewer.clientArea=r.clone(),e.bodyWidget.floatingElements.push(e)),i[i.length-1].isLayouted=!0,i[i.length-1]},e.prototype.addTableWidget=function(e,t,i){var n=t[t.length-1];return i&&(n=this.createTableWidget(n),t.push(n)),n.width=e.width,n.x=e.x,n.y=e.y,n.tableFormat.cellSpacing>0&&(n.height=n.height+L.convertPointToPixel(n.tableFormat.cellSpacing),n.isBidiTable?(n.leftBorderWidth=L.convertPointToPixel(this.getTableRightBorder(n.tableFormat.borders).getLineWidth()),n.rightBorderWidth=L.convertPointToPixel(this.getTableLeftBorder(n.tableFormat.borders).getLineWidth())):(n.leftBorderWidth=L.convertPointToPixel(this.getTableLeftBorder(n.tableFormat.borders).getLineWidth()),n.rightBorderWidth=L.convertPointToPixel(this.getTableRightBorder(n.tableFormat.borders).getLineWidth())),n.topBorderWidth=L.convertPointToPixel(this.getTableTopBorder(n.tableFormat.borders).getLineWidth()),n.bottomBorderWidth=L.convertPointToPixel(this.getTableBottomBorder(n.tableFormat.borders).getLineWidth()),n.x+=n.leftBorderWidth,n.y+=n.topBorderWidth,n.width-=n.leftBorderWidth,n.width-=n.rightBorderWidth,n.height+=n.bottomBorderWidth),n},e.prototype.updateWidgetsToPage=function(e,t,i,n){var r=this.viewer,o=e[e.length-1];if(!i.isInsideTable){for(var s=0;s<e.length;s++)this.updateHeightForTableWidget(e,t,e[s],n);o.childWidgets.length>0&&o.y!==o.childWidgets[0].y&&(o.y=o.childWidgets[0].y)}i.tableFormat.cellSpacing>0&&(o.y+o.height+L.convertPointToPixel(i.tableFormat.cellSpacing)>r.clientArea.bottom&&r instanceof de&&(o.height=o.height-L.convertPointToPixel(i.tableFormat.cellSpacing)/2),r.cutFromTop(o.y+o.height)),this.viewer instanceof de&&(i.containerWidget.height+=i.height),i.bodyWidget instanceof ve&&(i.containerWidget.height+=i.height,this.viewer.owner.enableHeaderAndFooter&&-1!==i.bodyWidget.headerFooterType.indexOf("Footer")&&this.shiftFooterChildLocation(i.bodyWidget,this.viewer))},e.prototype.updateHeightForTableWidget=function(e,t,i,n){for(var r=0;r<i.childWidgets.length;r++){var o=i.childWidgets[r];if(o===n)break;this.updateHeightForRowWidget(this.viewer,!0,e,t,o,!0,n)}},e.prototype.layoutRow=function(e,t,i){var n=this.viewer,r=[t];this.addTableRowWidget(n.clientActiveArea,r),n.updateClientAreaForRow(t,!0);for(var o=this.getMaxTopCellMargin(t),s=this.getMaxBottomCellMargin(t),a=0;a<t.childWidgets.length;a++){var l=t.childWidgets[a];this.layoutCell(l,o+t.topBorderWidth,s+t.bottomBorderWidth)}n.updateClientAreaForRow(t,!1);var d=[t];return i||this.updateWidgetsToTable(e,d,t),d[d.length-1]},e.prototype.getAdjacentRowCell=function(e,t,i,n){var r=[],o=e.ownerRow.ownerTable.childWidgets[n],s=!1;if(o){o.childWidgets[0].x>e.x&&0!==n&&(o=e.ownerRow.ownerTable.childWidgets[n-1],s=!0);for(var a=0;a<o.childWidgets.length;a++){var l=o.childWidgets[a],d=l.x-l.margin.left,h=l.x+l.width+l.margin.right;if((L.round(h,2)>L.round(t,2)&&L.round(h,2)<=L.round(i,2)||L.round(d,2)>=L.round(t,2)&&L.round(d,2)<L.round(i,2)||L.round(d,2)<=L.round(t,2)&&L.round(h,2)>=L.round(i,2))&&-1===r.indexOf(l)&&r.push(l),L.round(h,2)>=L.round(i,2)){if(!s)break;o=e.ownerRow.ownerTable.childWidgets[n],s=!1}a===o.childWidgets.length-1&&s&&(o=e.ownerRow.ownerTable.childWidgets[n],s=!1)}}return r},e.prototype.addTableRowWidget=function(e,i){var n=i[i.length-1];0===n.rowFormat.beforeWidth&&0===n.rowFormat.gridBeforeWidth||this.documentHelper.alignTablesRowByRow&&"Left"!==n.ownerTable.tableFormat.tableAlignment?n.x=e.x:n.x+=0!==n.rowFormat.beforeWidth?n.rowFormat.beforeWidth:n.rowFormat.gridBeforeWidth,n.y=e.y,n.width=e.width;var r=0;if(!t.isNullOrUndefined(n.ownerTable)&&!t.isNullOrUndefined(n.ownerTable.tableFormat)&&n.ownerTable.tableFormat.cellSpacing>0){n.height=n.height+L.convertPointToPixel(n.ownerTable.tableFormat.cellSpacing);for(var o=0;o<n.childWidgets.length;o++)if(!t.isNullOrUndefined(n.childWidgets[o].cellFormat)&&!t.isNullOrUndefined(n.childWidgets[o].cellFormat.borders)){var s=Pe.getCellBottomBorder(n.childWidgets[o]).getLineWidth();s>r&&(r=s)}if(n.bottomBorderWidth=L.convertPointToPixel(r),n.index>0&&!t.isNullOrUndefined(n.previousWidget)){var a=n.previousWidget;r=0;for(h=0;h<a.childWidgets.length;h++)if(!t.isNullOrUndefined(a.childWidgets[h].cellFormat)&&!t.isNullOrUndefined(a.childWidgets[h].cellFormat.borders)){var l=Pe.getCellBottomBorder(a.childWidgets[h]).getLineWidth();l>r&&(r=l)}n.topBorderWidth=L.convertPointToPixel(r)}}if(!t.isNullOrUndefined(n.childWidgets))for(h=0;h<n.childWidgets.length;h++)if(!t.isNullOrUndefined(n.childWidgets[h].cellFormat)&&!t.isNullOrUndefined(n.childWidgets[h].cellFormat.borders)){var d=Pe.getCellTopBorder(n.childWidgets[h]).getLineWidth();d>r&&(r=d)}if(n.topBorderWidth=L.convertPointToPixel(r),!t.isNullOrUndefined(n.ownerTable)&&!t.isNullOrUndefined(n.ownerTable.tableFormat)&&n.ownerTable.tableFormat.cellSpacing<=0&&n.rowIndex===n.ownerTable.childWidgets.length-1){for(var h=0;h<n.childWidgets.length;h++)if(!t.isNullOrUndefined(n.childWidgets[h].cellFormat)&&!t.isNullOrUndefined(n.childWidgets[h].cellFormat.borders)){var c=Pe.getCellBottomBorder(n.childWidgets[h]).getLineWidth();c>r&&(r=c)}n.bottomBorderWidth=L.convertPointToPixel(r)}return n},e.prototype.getMaxTopCellMargin=function(e){if(t.isNullOrUndefined(e.childWidgets))return 0;for(var i=0,n=0;n<e.childWidgets.length;n++){var r=e.childWidgets[n],o=0;(o=r.cellFormat.hasValue("topMargin")?L.convertPointToPixel(r.cellFormat.topMargin):e.rowFormat.hasValue("topMargin")?L.convertPointToPixel(e.rowFormat.topMargin):L.convertPointToPixel(e.ownerTable.tableFormat.topMargin))>i&&(i=o)}return i},e.prototype.getMaxBottomCellMargin=function(e){if(t.isNullOrUndefined(e.childWidgets))return 0;for(var i=0,n=0;n<e.childWidgets.length;n++){var r=e.childWidgets[n],o=0;(o=r.cellFormat.hasValue("bottomMargin")?L.convertPointToPixel(r.cellFormat.bottomMargin):e.rowFormat.hasValue("bottomMargin")?L.convertPointToPixel(e.rowFormat.bottomMargin):L.convertPointToPixel(e.ownerTable.tableFormat.bottomMargin))>i&&(i=o)}return i},e.prototype.layoutCell=function(e,i,n){var r=this.viewer;if(this.addTableCellWidget(e,r.clientActiveArea,i,n),this.updateTopBorders(e),r.updateClientAreaForCell(e,!0),0===e.childWidgets.length){var o=new we;o.characterFormat=new k,o.paragraphFormat=new I,o.index=0;var s=new Te(o);o.childWidgets.push(s),e.childWidgets.push(o)}for(var a=0;a<e.childWidgets.length;a++){var l=e.childWidgets[a];r.updateClientAreaForBlock(l,!0),l.containerWidget=e,this.layoutBlock(l,0),r.updateClientAreaForBlock(l,!1);for(var d=0;d<l.childWidgets.length;d++)if(l.childWidgets[d]instanceof Te)for(var h=l.childWidgets[d],c=0;c<h.children.length;c++){if(h.children[c]instanceof Le&&!t.isNullOrUndefined(e.bodyWidget.page.footnoteWidget)){this.footHeight=e.bodyWidget.page.footnoteWidget.height,this.isTableFootNote=!0;break}this.footHeight=0}}this.updateWidgetToRow(e),r.updateClientAreaForCell(e,!1)},e.prototype.updateTopBorders=function(e){if(e.updatedTopBorders=[],0===e.ownerTable.tableFormat.cellSpacing){var t=e.cellFormat.borders.top;(!t.isBorderDefined||t.isBorderDefined&&"None"===t.lineStyle&&0===t.lineWidth&&t.hasValue("color"))&&(t=e.ownerRow.rowFormat.borders.horizontal),t.isBorderDefined||(t=e.ownerRow.ownerTable.tableFormat.borders.horizontal);for(var i=e.x-e.margin.left,n=e.x+e.width+e.margin.right,r=this.getAdjacentRowCell(e,i,n,e.ownerRow.indexInOwner-1),o=0;o<r.length;o++){var s=r[o],a=s.cellFormat.borders.bottom;(!a.isBorderDefined||a.isBorderDefined&&"None"===a.lineStyle&&0===a.lineWidth&&a.hasValue("color"))&&(a=s.ownerRow.rowFormat.borders.horizontal),a.isBorderDefined||(a=s.ownerRow.ownerTable.tableFormat.borders.horizontal);var l=void 0;if(l="None"===t.lineStyle||"Cleared"===t.lineStyle?a:"Cleared"===a.lineStyle||"None"===a.lineStyle?t:e.getBorderBasedOnPriority(t,a)){var d=s.x-s.margin.left,h=s.x+s.width+s.margin.right,c=0;(c=L.round(h,2)===L.round(n,2)&&L.round(d,2)===L.round(i,2)?n-i:L.round(d,2)>=L.round(i,2)&&L.round(h,2)>=L.round(n,2)?n-d:L.round(d,2)>=L.round(i,2)&&L.round(h,2)<=L.round(n,2)?h-d:L.round(d,2)<=L.round(i,2)&&L.round(h,2)<=L.round(n,2)?h-i:(L.round(d,2)<=L.round(i,2)&&(L.round(h,2),L.round(n,2)),n-i))<0&&(c=0),e.updatedTopBorders.push({border:l,width:c})}}}},e.prototype.shiftLayoutedItems=function(e){if(t.isNullOrUndefined(this.documentHelper.blockToShift)||t.isNullOrUndefined(this.documentHelper.blockToShift.containerWidget))return void(this.documentHelper.blockToShift=void 0);var i=this.documentHelper.blockToShift,n=i.bodyWidget.index;this.reLayoutOrShiftWidgets(i,this.viewer);for(var r=!0,o=i.getSplitWidgets(),s=o[o.length-1].nextRenderedWidget;s instanceof ye&&s.bodyWidget.index===n;){var a=void 0,l=i.getSplitWidgets();a=l[l.length-1],r=!1;var d=void 0;if(l=(i=s).getSplitWidgets(),i instanceof we?d=l[0]:i instanceof xe&&(d=l[0]),a.containerWidget===d.containerWidget&&L.round(d.y,2)===L.round(this.viewer.clientActiveArea.y,2)&&t.isNullOrUndefined(d.nextWidget))break;t.isNullOrUndefined(a.floatingElements),r=!0,this.reLayoutOrShiftWidgets(i,this.viewer),s=(o=i.getSplitWidgets())[o.length-1].nextRenderedWidget}this.viewer.owner.editorModule&&this.viewer.owner.editorModule.updateListItemsTillEnd(i,r),this.documentHelper.blockToShift=void 0;var h=this.viewer;this.documentHelper.removeEmptyPages(),this.updateFieldElements(),this.documentHelper.owner.enableLockAndEdit&&e||h.updateScrollBars()},e.prototype.updateFieldElements=function(){for(var e=0;e<this.documentHelper.fields.length;e++){var i=this.documentHelper.fields[e];if(!t.isNullOrUndefined(this.documentHelper.selection)){var n=this.documentHelper.selection.getFieldCode(i);if(!t.isNullOrUndefined(n)&&(n.toLowerCase().match("numpages")||n.toLowerCase().match("sectionpages"))&&!t.isNullOrUndefined(i.fieldSeparator)){var r=i.fieldSeparator.nextNode;if(!t.isNullOrUndefined(r)){var o=r.text;r.text=this.documentHelper.pages.length.toString();var s=i.line.paragraph;if(!t.isNullOrUndefined(s.bodyWidget)&&!t.isNullOrUndefined(s.bodyWidget.page)&&o!==r.text){var a=s.childWidgets.indexOf(i.line),l=i.line.children.indexOf(r);this.reLayoutParagraph(s,a,l)}}}}}},e.prototype.reLayoutOrShiftWidgets=function(e,t){var i=e;this.isNeedToRelayout(e.bodyWidget)?(t.updateClientAreaForBlock(i,!0),i instanceof xe&&this.clearTableWidget(i,!0,!0,!0),this.layoutBlock(i,0),t.updateClientAreaForBlock(i,!1)):this.shiftWidgetsBlock(i,t),this.viewer.owner.editorModule&&this.viewer.owner.editorModule.updateRenderedListItems(i),!this.isRelayoutFootnote&&i.bodyWidget.page.footnoteWidget&&this.layoutfootNote(i.bodyWidget.page.footnoteWidget),i.bodyWidget instanceof be||this.isRelayoutFootnote||!i.bodyWidget.page.endnoteWidget||this.layoutfootNote(i.bodyWidget.page.endnoteWidget)},e.prototype.isNeedToRelayout=function(e){for(var t=0;t<e.floatingElements.length;t++){var i=e.floatingElements[t];return i instanceof xe||i instanceof Ge&&("Square"===i.textWrappingStyle||"TopAndBottom"===i.textWrappingStyle)}return!1},e.prototype.shiftWidgetsBlock=function(e,t){e instanceof we?this.shiftWidgetsForPara(e,t):e instanceof xe&&this.shiftWidgetsForTable(e,t)},e.prototype.shiftWidgetsForPara=function(e,i){if(!(e.height>i.clientArea.height+i.clientArea.y))for(var n=this.getBodyWidgetOfPreviousBlock(e,0),r=n.bodyWidget,o=n.index,s=void 0,a=0;a<e.getSplitWidgets().length;a++){var l=e.getSplitWidgets()[a];if(!t.isNullOrUndefined(s)){g=!!s.lastChild&&s.lastChild.isEndsWithPageBreak;if(this.shiftToPreviousWidget(l,i,s,g),(t.isNullOrUndefined(l.childWidgets)||0===l.childWidgets.length)&&!g){a--;continue}s=void 0,r!==l.containerWidget&&(r=l.containerWidget,g&&i.updateClientAreaByWidget(l))}var d=this.getFootNoteWidgetsOf(l);if(this.isFitInClientArea(l,i,d)){if(s=l,l.y=i.clientActiveArea.y,i.cutFromTop(i.clientActiveArea.y+l.height),!t.isNullOrUndefined(r)&&r!==l.containerWidget&&(o++,r.lastChild.isEndsWithPageBreak||this.updateContainerWidget(l,r,o,!0),d.length>0&&r.page.footnoteWidget))for(var h=0;h<d.length;h++)r.page.footnoteWidget.childWidgets.push(d[h]),r.page.footnoteWidget.height+=d[h].height;if(l.isEndsWithPageBreak&&this.viewer instanceof le){var c=this.createOrGetNextBodyWidget(r,this.viewer);c=this.moveBlocksToNextPage(l),i.updateClientArea(c.sectionFormat,c.page)}}else{var p=l.previousRenderedWidget,g=!1;p instanceof we&&p.isEndsWithPageBreak&&this.viewer instanceof le&&(g=!0);var u=this.splitWidget(l,i,r,o+1,g,d);s=void 0,r!==l.containerWidget&&(r=l.containerWidget,a--),o=r.childWidgets.indexOf(l),u&&(r=e.getSplitWidgets()[a+1].containerWidget)}}},e.prototype.getFootNotesOfBlock=function(e){var t=[];if(e.childWidgets.length>0)for(var i=0;i<this.documentHelper.footnoteCollection.length;i++)this.documentHelper.footnoteCollection[i].line.paragraph===e&&t.push(this.documentHelper.footnoteCollection[i]);return t},e.prototype.getFootNotesWidgetsInLine=function(e){for(var t=[],i=0;i<e.children.length;i++){var n=e.children[i];n instanceof Le&&t.push(n)}return this.getFootNoteWidgetsBy(e.paragraph,t)},e.prototype.getFootNoteWidgetsBy=function(e,i){var n=[];if(e.bodyWidget.page.footnoteWidget)for(r=0;r<e.bodyWidget.page.footnoteWidget.childWidgets.length;r++)for(o=0;o<i.length;o++)e.bodyWidget.page.footnoteWidget.childWidgets[r].footNoteReference===i[o]&&n.push(e.bodyWidget.page.footnoteWidget.childWidgets[r]);if(!t.isNullOrUndefined(e.previousRenderedWidget)&&e.previousRenderedWidget.bodyWidget.page.footnoteWidget)for(r=0;r<e.previousRenderedWidget.bodyWidget.page.footnoteWidget.childWidgets.length;r++)for(o=0;o<i.length;o++)e.previousRenderedWidget.bodyWidget.page.footnoteWidget.childWidgets[r].footNoteReference===i[o]&&n.push(e.previousRenderedWidget.bodyWidget.page.footnoteWidget.childWidgets[r]);else if(!t.isNullOrUndefined(e.bodyWidget.previousRenderedWidget)&&e.bodyWidget.previousRenderedWidget.page.footnoteWidget)for(var r=0;r<e.bodyWidget.previousRenderedWidget.page.footnoteWidget.childWidgets.length;r++)for(var o=0;o<i.length;o++)e.bodyWidget.previousRenderedWidget.page.footnoteWidget.childWidgets[r].footNoteReference===i[o]&&n.push(e.bodyWidget.previousRenderedWidget.page.footnoteWidget.childWidgets[r]);return n},e.prototype.getFootNoteWidgetsOf=function(e){var t=this.getFootNotesOfBlock(e),i=[];return t.length>0&&(i=this.getFootNoteWidgetsBy(e,t)),i},e.prototype.getFootNodeWidgetsToShiftToPage=function(e){for(var t,i=e.getSplitWidgets(),n=[],r=e.containerWidget,o=0;o<i.length;o++)for(var s=this.getFootNoteWidgetsOf(i[o]),a=0;a<s.length;a++)r!==(t=s[a].containerWidget)&&n.push(s[a]);return{footNoteWidgets:n,fromBodyWidget:t,toBodyWidget:r}},e.prototype.shiftTableWidget=function(e,t,i){void 0===i&&(i=!1);var n=[e];this.addTableWidget(this.viewer.clientActiveArea,n),this.viewer.updateClientAreaTopOrLeft(e,!0);for(var r=e.childWidgets[0];r;)r=(r=this.shiftRowWidget(n,r,i)).nextRow;return this.updateWidgetsToPage(n,[],e),n[n.length-1]},e.prototype.shiftRowWidget=function(e,t,i){void 0===i&&(i=!1);var n=this.viewer;i&&(t.height=0);var r=[t];this.addTableRowWidget(n.clientActiveArea,r),n.updateClientAreaForRow(t,!0);for(var o=0;o<t.childWidgets.length;o++){var s=t.childWidgets[o];i&&(s.height=0),this.shiftCellWidget(s,this.getMaxTopCellMargin(t)+t.topBorderWidth,this.getMaxBottomCellMargin(t)+t.bottomBorderWidth,i)}return n.updateClientAreaForRow(t,!1),this.updateWidgetsToTable(e,r,t),r[r.length-1]},e.prototype.shiftCellWidget=function(e,i,n,r){t.isNullOrUndefined(r)&&(r=!1);var o=this.viewer;this.addTableCellWidget(e,o.clientActiveArea,i,n),o.updateClientAreaForCell(e,!0);for(var s=0;s<e.childWidgets.length;s++){var a=e.childWidgets[s];o.updateClientAreaForBlock(a,!0),a instanceof we?this.shiftParagraphWidget(a):this.shiftTableWidget(a,o,r),o.updateClientAreaForBlock(a,!1)}this.updateWidgetToRow(e),o.updateClientAreaForCell(e,!1)},e.prototype.shiftParagraphWidget=function(e){this.addParagraphWidget(this.viewer.clientActiveArea,e),this.viewer.cutFromTop(this.viewer.clientActiveArea.y+e.height),t.isNullOrUndefined(e.floatingElements),this.updateWidgetToPage(this.viewer,e)},e.prototype.shiftWidgetsForTable=function(e,t){var i=this.getBodyWidgetOfPreviousBlock(e,0),n=i.bodyWidget,r=i.index,o=n.lastChild.lastChild.isEndsWithPageBreak;n!==e.containerWidget&&(o?t.updateClientArea(e.bodyWidget.sectionFormat,e.bodyWidget.page):this.updateContainerWidget(e,n,r+1,!0)),(e.isInHeaderFooter||this.viewer instanceof de)&&(e.containerWidget.height-=e.height),this.viewer.updateClientAreaForBlock(e,!0),this.updateVerticalPositionToTop(e,!0);var s=e.combineWidget(this.viewer);this.documentHelper.layout.updateChildLocationForTable(s.y,s),this.clearTableWidget(s,!0,!1),this.shiftTableWidget(s,this.viewer),this.updateVerticalPositionToTop(e,!1),this.viewer.updateClientAreaForBlock(e,!1)},e.prototype.updateVerticalPositionToTop=function(e,t){for(var i=0;i<e.getSplitWidgets().length;i++)for(var n=e.getSplitWidgets()[i],r=0;r<n.childWidgets.length;r++)for(var o=n.childWidgets[r],s=0;s<o.childWidgets.length;s++){var a=o.childWidgets[s];this.documentHelper.layout.updateCellVerticalPosition(a,t,!1)}},e.prototype.splitWidget=function(e,i,n,r,o,s){var a=e.childWidgets[0],l=this.getMaxElementHeight(a),d=e.getSplitWidgets(),h=e.containerWidget,c=this.getFootNotesWidgetsInLine(a);if(t.isNullOrUndefined(e.previousWidget)&&c.length>0){for(m=0;m<c.length;m++)l+=c[m].height;l+=e.bodyWidget.page.footnoteWidget.childWidgets[0].height}if(i.clientActiveArea.height>=l&&!o){var p=void 0,g=d.indexOf(e);if(g<d.length-1?h=(p=d[g+1]).containerWidget:((p=new we).index=e.index,p.characterFormat=e.characterFormat,p.paragraphFormat=e.paragraphFormat,p.width=e.width,p.x=e.x,p.y=e.y,d.push(p)),n!==e.containerWidget){var u=e.containerWidget;-1===e.childWidgets.indexOf(this.documentHelper.selection.start.currentWidget)&&-1===e.childWidgets.indexOf(this.documentHelper.selection.end.currentWidget)||(this.updateContainerWidget(e,n,r,!0),this.moveFootNotesToPage(s,u,n))}for(var m=e.childWidgets.length-1;m>0&&!this.isFitInClientArea(e,i,void 0);m--){var f=e.childWidgets[m];this.updateParagraphWidgetInternal(f,p,0)}if(t.isNullOrUndefined(p.containerWidget)&&p.childWidgets.length>0){var v=i.clientActiveArea.y,y=new ce(i.clientArea.x,i.clientArea.y,i.clientArea.width,i.clientArea.height),b=new ce(i.clientActiveArea.x,i.clientActiveArea.y,i.clientActiveArea.width,i.clientActiveArea.height);if((h=this.moveBlocksToNextPage(e)).childWidgets.splice(0,0,p),h.height+=p.height,p.containerWidget=h,h!=n&&(s=this.getFootNoteWidgetsOf(p),this.moveFootNotesToPage(s,n,h)),1===h.childWidgets.length&&h.firstChild instanceof we&&h.firstChild.equals(e))return e.y=v,!0;i.clientArea=y,i.clientActiveArea=b}}else h=this.createOrGetNextBodyWidget(n,this.viewer),e.containerWidget!==h&&(h=this.moveBlocksToNextPage(e),this.updateContainerWidget(e,h,0,!0),this.moveFootNotesToPage(s,n,h));return n===e.containerWidget?(e.y=i.clientActiveArea.y,i.cutFromTop(i.clientActiveArea.y+e.height)):i.updateClientArea(h.sectionFormat,h.page),!1},e.prototype.moveFootNotesToPage=function(e,t,i){if(e.length>0){for(var n=-1,r=void 0,o=0;o<e.length;o++)r=e[o],(n=t.page.footnoteWidget.childWidgets.indexOf(r))>=0&&(void 0===i.page.footnoteWidget&&this.addEmptyFootNoteToBody(i),t.page.footnoteWidget.childWidgets.splice(n,1),i.page.footnoteWidget.childWidgets.indexOf(r)<0&&(i.page.footnoteWidget.childWidgets.push(r),i.page.footnoteWidget.height+=r.height),t.page.footnoteWidget.height-=r.height);t.page.footnoteWidget&&1===t.page.footnoteWidget.childWidgets.length&&(t.page.footnoteWidget=void 0)}},e.prototype.addEmptyFootNoteToBody=function(e){var t=new be;t.footNoteType="Footnote",t.page=e.page;var i=new we;i.characterFormat=new k,i.paragraphFormat=new I,i.index=0;var n=new Te(i);i.childWidgets.push(n),t.childWidgets.push(i),t.height=this.documentHelper.textHelper.getParagraphMarkSize(i.characterFormat).Height,e.page.footnoteWidget=t},e.prototype.getMaxElementHeight=function(e){var t=0;if(0===e.children.length||1===e.children.length&&e.children[0]instanceof Qe||2===e.children.length&&e.children[0]instanceof Qe&&e.children[1]instanceof Qe){t=this.documentHelper.selection.getParagraphMarkSize(e.paragraph,0,0).height,t+=0,e.children.length>0&&t<(n=e.children[0]).margin.top+n.height&&(t=n.margin.top+n.height)}else for(var i=0;i<e.children.length;i++){var n=e.children[i];t<n.margin.top+n.height&&(t=n.margin.top+n.height)}return t},e.prototype.createOrGetNextBodyWidget=function(e,t){var i=void 0,n=0;n=this.documentHelper.pages.indexOf(e.page);var r=void 0,o=void 0;if(o=e.index,n===this.documentHelper.pages.length-1||this.documentHelper.pages[n+1].sectionIndex!==o){var s=new fe;s.sectionFormat=e.sectionFormat,s.index=e.index,r=t.createNewPage(s),this.documentHelper.pages[n+1].sectionIndex!==o&&this.documentHelper.insertPage(n+1,r),i=r.bodyWidgets[0]}else i=(r=this.documentHelper.pages[n+1]).bodyWidgets[0];return i},e.prototype.isFitInClientArea=function(e,i,n){var r=e.childWidgets[e.childWidgets.length-1],o=e.height,s=this.getMaxElementHeight(r);r.height>s&&(o-=r.height-s);var a=0;if(!t.isNullOrUndefined(n)&&n.length>0)for(var l=0;l<n.length;l++)a+=n[l].height;return i.clientActiveArea.height>=o+a},e.prototype.isLineInFootNote=function(e,t){for(var i=0;i<t.length;i++)if(t[i].line===e)return!0;return!1},e.prototype.shiftToPreviousWidget=function(e,i,n,r){var o=e.containerWidget,s=n.containerWidget,a=[],l=[];s!==o&&(a=this.getFootNotesOfBlock(e));for(var d=0;d<e.childWidgets.length;d++){var h=e.childWidgets[d],c=this.getMaxElementHeight(h);if(!(i.clientActiveArea.height>=c)||r){var p=n.containerWidget,g=this.createOrGetNextBodyWidget(p,i);e.containerWidget!==g&&(g=this.moveBlocksToNextPage(e)),p!==g&&((a=this.getFootNotesOfBlock(e)).length>0&&(l=l.concat(this.getFootNoteWidgetsBy(e,a)),s=g),this.updateContainerWidget(e,g,0,!0)),i.updateClientArea(o.sectionFormat,o.page);break}if(a.length>0&&this.isLineInFootNote(h,a)&&(l=l.concat(this.getFootNoteWidgetsBy(h.paragraph,a))),this.updateParagraphWidgetInternal(h,n,n.childWidgets.length),d--,i.cutFromTop(i.clientActiveArea.y+h.height),t.isNullOrUndefined(e.childWidgets))break}!t.isNullOrUndefined(l)&&l.length>0&&o!=s&&this.moveFootNotesToPage(l,o,s)},e.prototype.updateParagraphWidgetInternal=function(e,i,n){t.isNullOrUndefined(e.paragraph)||(e.paragraph.childWidgets.splice(e.paragraph.childWidgets.indexOf(e),1),e.paragraph.height-=e.height,t.isNullOrUndefined(e.paragraph.containerWidget)||(e.paragraph.containerWidget.height-=e.height),(t.isNullOrUndefined(e.paragraph.childWidgets)||0===e.paragraph.childWidgets.length)&&e.paragraph.destroyInternal(this.viewer)),i.childWidgets.splice(n,0,e),e.paragraph=i,i.height+=e.height,t.isNullOrUndefined(i.containerWidget)||(i.containerWidget.height+=e.height)},e.prototype.shiftNextWidgets=function(e){for(var t=e;t.nextWidget instanceof ye;)t=t.nextWidget,this.reLayoutOrShiftWidgets(t,this.viewer)},e.prototype.updateContainerWidget=function(e,i,n,r){if(!t.isNullOrUndefined(e.containerWidget)&&(e.containerWidget.childWidgets.splice(e.containerWidget.childWidgets.indexOf(e),1),e.containerWidget.height-=i.height,(t.isNullOrUndefined(e.containerWidget.childWidgets)||0===e.containerWidget.childWidgets.length)&&e.containerWidget instanceof fe&&e.containerWidget!==i&&r)){var o=e.containerWidget.page;this.documentHelper.pages[this.documentHelper.pages.length-1]===o&&-1!==this.viewer.visiblePages.indexOf(o)&&this.documentHelper.scrollToBottom(),(t.isNullOrUndefined(o.nextPage)||o.nextPage.bodyWidgets[0].index!==e.containerWidget.index)&&e.containerWidget.destroyInternal(this.viewer)}if(i.childWidgets.splice(n,0,e),e instanceof we&&!t.isNullOrUndefined(e.floatingElements))for(var s=0;s<e.floatingElements.length;s++){var a=e.floatingElements[s];"Inline"!==a.textWrappingStyle&&(i.floatingElements.push(a),e.bodyWidget.floatingElements.splice(e.bodyWidget.floatingElements.indexOf(a),1),i.floatingElements.sort(function(e,t){return e.y-t.y}))}i.height+=i.height,e.containerWidget=i},e.prototype.getBodyWidgetOfPreviousBlock=function(e,t){t=0;var i=void 0,n=e.previousRenderedWidget;return i=n&&n.containerWidget.equals(e.containerWidget)?n.containerWidget:e.containerWidget,t=n&&n.containerWidget.equals(e.containerWidget)?i.childWidgets.indexOf(n):e.containerWidget.childWidgets.indexOf(e),{bodyWidget:i,index:t}},e.prototype.moveBlocksToNextPage=function(e){var i=e.bodyWidget,n=i.page.index+1,r=void 0,o=void 0,s=!1;for(this.documentHelper.pages.length>n&&(0!==(r=this.documentHelper.pages[n]).bodyWidgets.length&&i.equals(r.bodyWidgets[0])?(o=r.bodyWidgets[0],this.viewer.updateClientArea(o.sectionFormat,o.page)):(r=void 0,s=!0)),t.isNullOrUndefined(r)&&(o=this.createSplitBody(i),r=this.viewer.createNewPage(o,n),s&&this.documentHelper.insertPage(n,r),this.clearLineMeasures());;){var a=void 0;a=i.lastChild instanceof be?i.lastChild.previousWidget:i.lastChild;var l=this.getFootNoteWidgetsOf(a);if(this.moveFootNotesToPage(l,i,o),e===a)break;i.childWidgets.splice(i.childWidgets.indexOf(a),1),o.childWidgets.splice(0,0,a),a.containerWidget=o,o.height+=a.height}return o},e.prototype.createSplitBody=function(e){var t=this.addBodyWidget(this.viewer.clientActiveArea);return t.sectionFormat=e.sectionFormat,t.index=e.index,t},e.prototype.reLayoutLine=function(e,i,n,r){this.isFootnoteContentChanged=!1,this.viewer.owner.isDocumentLoaded&&this.viewer.owner.editorModule&&this.viewer.owner.editorModule.updateWholeListItems(e);var o;if(o=e.paragraphFormat.listFormat&&-1!==e.paragraphFormat.listFormat.listId?e.getSplitWidgets()[0].firstChild:e.childWidgets[i],!this.isBidiReLayout&&(e.paragraphFormat.bidi||this.isContainsRtl(o)))for(var s=i<=0?0:i-1;s<e.childWidgets.length;s++)(!n&&(e.paragraphFormat.bidi&&this.isContainsRtl(o)||r)||s!==i)&&this.reArrangeElementsForRtl(e.childWidgets[s],e.paragraphFormat.bidi);var a=o.previousLine;t.isNullOrUndefined(a)&&(a=o);a.paragraph;var l=e.containerWidget;if(l.height-=e.height,!this.viewer.owner.enableHeaderAndFooter&&!e.isInHeaderFooter||l instanceof Xe?l instanceof Xe?this.viewer.updateClientAreaForTextBoxShape(l.containerShape,!0):this.viewer.updateClientArea(l.sectionFormat,l.page,!0):(e.bodyWidget.isEmpty=!1,this.viewer.updateHeaderFooterClientAreaWithTop(e.bodyWidget.sectionFormat,this.documentHelper.isBlockInHeader(e),l.page)),this.viewer.updateClientAreaForBlock(e,!0),e.containerWidget instanceof be){this.isRelayoutFootnote=!1;var d=e.height,h=e.y;return this.layoutParagraph(e,0),this.viewer.updateClientAreaForBlock(e,!1),e.containerWidget.height+=d,e.y=0,"Footnote"===e.containerWidget.footNoteType&&this.viewer.updateFootnoteClientArea(e.containerWidget.sectionFormat,e.containerWidget),this.viewer.cutFromTop(h),void this.layoutParagraph(e,0)}if(a.paragraph.isEmpty())this.viewer.cutFromTop(e.y),this.layoutParagraph(e,0);else{if(this.updateClientAreaForLine(a),this.layoutListItems(a.paragraph),a.isFirstLine()&&!t.isNullOrUndefined(e.paragraphFormat)){var c=-L.convertPointToPixel(e.paragraphFormat.firstLineIndent);this.viewer.updateClientWidth(c)}do{e=(a=this.layoutLine(a,0)).paragraph,a=a.nextLine}while(a);this.updateWidgetToPage(this.viewer,e),this.viewer.updateClientAreaForBlock(e,!1)}this.layoutNextItemsBlock(e,this.viewer);var p=e.getSplitWidgets()[0].previousRenderedWidget;if(!t.isNullOrUndefined(p)&&(!(p instanceof we)||p instanceof we&&!p.isEndsWithPageBreak)&&(this.viewer.cutFromTop(e.y+e.height),e.containerWidget!==p.containerWidget&&!t.isNullOrUndefined(p.containerWidget))){var g=e.containerWidget,u=p.containerWidget,m=this.getFootNoteWidgetsOf(e);this.moveFootNotesToPage(m,u,g)}var f,v=this.documentHelper.pages.length,y=this.documentHelper.pages[v-1].bodyWidgets[0];this.isFootnoteContentChanged&&!t.isNullOrUndefined(e.bodyWidget.page.footnoteWidget)&&(f=e.bodyWidget.page.footnoteWidget,this.layoutfootNote(f)),this.isEndnoteContentChanged&&!t.isNullOrUndefined(y.page.endnoteWidget)&&(f=y.page.endnoteWidget,this.viewer.cutFromTop(y.childWidgets[y.childWidgets.length-1].y+y.childWidgets[y.childWidgets.length-1].height),this.layoutfootNote(f))},e.prototype.isContainsRtl=function(e){for(var t=!1,i=0;i<e.children.length&&!(e.children[i]instanceof Oe&&(t=e.children[i].characterFormat.bidi||"RTL"===e.children[i].characterFormat.bdo||this.documentHelper.textHelper.isRTLText(e.children[i].text)));i++);return t},e.prototype.reArrangeElementsForRtl=function(e,i){if(0!==e.children.length){for(var n=!1,r=-1,o=[],s=0;s<e.children.length;s++){var a=e.children[s],l=void 0;a.characterFormat&&(l=a.characterFormat);var d=!1,h="",c=!1;if(a instanceof Ae)i?(n||0===a.bookmarkType&&a.nextElement&&a.nextElement.nextElement instanceof Oe&&this.documentHelper.textHelper.isRTLText(a.nextElement.nextElement.text)||1===a.bookmarkType&&a.nextElement instanceof Oe&&this.documentHelper.textHelper.isRTLText(a.nextElement.text)?o.splice(0,0,a):o.splice(n?r:r+1,0,a),r=o.indexOf(a)):o.push(a);else{if(a instanceof Oe){if(h=a.text,(c=this.documentHelper.textHelper.containsSpecialCharAlone(h.trim()))&&l.bidi&&i){h=L.reverseString(h);for(var p=0;p<h.length;p++){var g=this.documentHelper.textHelper.inverseCharacter(h.charAt(p));h=h.replace(h.charAt(p),g)}a.text=h}var u=a.nextElement;if(a instanceof Oe&&this.documentHelper.textHelper.containsNumberAlone(a.text.trim())){for(;u instanceof Oe&&""!==u.text.trim()&&(this.documentHelper.textHelper.containsNumberAlone(u.text.trim())||this.documentHelper.textHelper.containsSpecialCharAlone(u.text.trim()));)a.text=a.text+u.text,a.line.children.splice(a.line.children.indexOf(u),1),u=a.nextElement;a.width=this.documentHelper.textHelper.getTextSize(a,a.characterFormat)}}if(d=a instanceof Qe?i:this.documentHelper.textHelper.isRTLText(h)||l.bidi||"RTL"===l.bdo,(a instanceof Ie||this.isRtlFieldCode)&&(0===a.fieldType?this.isRtlFieldCode=!0:1===a.fieldType&&(this.isRtlFieldCode=!1),d=!1),!d&&!t.isNullOrUndefined(h)&&""!==h&&(""!==h&&""===h.trim()||c)){var m=e.children;l.bidi?n?d=!0:s+1<e.children.length&&e.children[s+1]instanceof Oe&&(h=m[s+1].text,d=this.documentHelper.textHelper.isRTLText(h)||m[s+1].characterFormat.bidi||"RTL"===m[s+1].characterFormat.bdo):n&&(d=!0)}a.isRightToLeft=d,d&&"LTR"!==l.bdo?n?o.splice(r,0,a):(i?o.splice(0,0,a):o.push(a),n=!0,r=o.indexOf(a)):n&&a instanceof Ze?l.bidi?o.splice(r+1,0,a):o.splice(r,0,a):(i?(n?o.splice(0,0,a):o.splice(r+1,0,a),r=o.indexOf(a)):o.push(a),n=!1)}}e.children=[],e.children=o}},e.prototype.shiftLayoutFloatingItems=function(e){for(var t=0;t<e.floatingElements.length;t++){var i=e.floatingElements[t],n=this.getFloatingItemPoints(i),r=n.y-i.y;if(i.x=n.x,i.y=n.y,i instanceof Ke)for(var o=0;o<i.textFrame.childWidgets.length;o++){var s=i.textFrame.childWidgets[o];s instanceof we?s.y=s.y+r:s instanceof xe&&this.shiftChildLocationForTableWidget(s,r)}}},e.prototype.getFloatingItemPoints=function(e){var t=e.line.paragraph,i=t.bodyWidget.sectionFormat,n=0,r=0;if(t){var o=L.convertPointToPixel(i.leftMargin),s=L.convertPointToPixel(i.rightMargin),a=L.convertPointToPixel(i.topMargin),l=i.bottomMargin>0?L.convertPointToPixel(i.bottomMargin):48,d=L.convertPointToPixel(i.headerDistance),h=L.convertPointToPixel(i.footerDistance),c=L.convertPointToPixel(i.pageWidth),p=L.convertPointToPixel(i.pageHeight),g=c-(o+s),u=p-a-l;a=t.isInHeaderFooter&&i.topMargin<=0?Math.abs(a)>0?Math.abs(a):L.convertPointToPixel(i.headerDistance)+t.height:a>0?a:48,!t.isInHeaderFooter&&a<this.viewer.clientArea.y&&(a=this.viewer.clientArea.y);var m="InFrontOfText",f=!1,v=e.verticalOrigin,y=e.horizontalOrigin,b=e.horizontalAlignment,w=e.verticalAlignment,C=e.verticalRelativePercent,x=(e.horizontalRelativePercent,e.height),F=e.width,P=e.verticalPosition,T=e.horizontalPosition,S=e.layoutInCell,I=void 0;if(e instanceof Ke&&(I=e.autoShapeType),t.isInsideTable&&S)f=!0,r=this.getVerticalPosition(e,P,v,m),n=this.getHorizontalPosition(e.width,e,b,y,T,m,t.associatedCell.cellFormat.cellWidth);else{switch(v){case"Page":case"TopMargin":switch(r=P,w){case"Top":r=P;break;case"Center":r="TopMargin"===v?(a-x)/2:(p-x)/2;break;case"Outside":case"Bottom":r="Page"===v&&"Bottom"===w?p-x:"TopMargin"===v?a-x:(t.bodyWidget.page.index+1)%2!=0?p-x-h/2:d/2;break;case"Inside":"Page"===v?r=(t.bodyWidget.page.index+1)%2==0?p-x-h/2:d/2:(t.bodyWidget.page.index+1)%2==0&&(r=(a-x)/2-d);break;case"None":r=Math.abs(C)<=1e3?p*(C/100):P}break;case"Line":switch(r=P,w){case"Inside":case"Top":r=this.viewer.clientActiveArea.y;break;case"Center":r=this.viewer.clientActiveArea.y-x/2;break;case"Outside":case"Bottom":r=this.viewer.clientActiveArea.y-x;break;case"None":r=Math.round(t.y)+P}break;case"BottomMargin":switch(r=P,w){case"Inside":case"Top":r=p-l;break;case"Center":r=p-l+(l-x)/2;break;case"Outside":case"Bottom":r=t.bodyWidget.page.index+1!==0&&"Outside"===w?p-l:p-x;break;case"None":r=p-l+P}break;case"InsideMargin":case"OutsideMargin":switch(r=P,w){case"Inside":r="InsideMargin"===v?"InsideMargin"===v&&t.bodyWidget.page.index+1===0?p-x:0:(t.bodyWidget.page.index+1)%2!=0?p-l:a-x;break;case"Top":r="InsideMargin"===v?(t.bodyWidget.page.index+1)%2==0?p-l:0:(t.bodyWidget.page.index+1)%2!=0?p-l:0;break;case"Center":r="OutsideMargin"===v?(t.bodyWidget.page.index+1)%2!=0?p-l+(l-x)/2:(a-x)/2:(t.bodyWidget.page.index+1)%2==0?p-l+(l-x)/2:(a-x)/2;break;case"Outside":r="InsideMargin"===v?(t.bodyWidget.page.index+1)%2==0?p-l:a-x:(t.bodyWidget.page.index+1)%2!=0?a-x:p-l;break;case"Bottom":r="OutsideMargin"===v?t.bodyWidget.page.index+1!==0?p-x:a-x:(t.bodyWidget.page.index+1)%2==0?p-x:a-x}break;case"Paragraph":r=Math.round(t.y)+0+P;break;case"Margin":switch(r=t.isInHeaderFooter&&d>a?d+t.height+P:a+P,w){case"Top":r=a;break;case"Center":r=a+(u-x)/2;break;case"Outside":case"Bottom":r=(t.bodyWidget.page.index+1)%2!=0?a+u-x:a;break;case"Inside":r=(t.bodyWidget.page.index+1)%2==0?a+u-x:a}break;default:r=this.viewer.clientArea.y-P}switch(y){case"Page":switch(n=T,b){case"Center":n=f?(t.associatedCell.cellFormat.cellWidth-F)/2:(c-F)/2;break;case"Left":n=0;break;case"Outside":case"Right":n=f?t.associatedCell.cellFormat.cellWidth-F:c-F;break;case"None":n=f?t.associatedCell.x+T:T}n<0&&f&&(n=t.associatedCell.x);break;case"Column":switch(n=this.viewer.clientActiveArea.x<t.x?t.x+T:"StraightConnector"===I||"Rectangle"===I?T+L.convertPointToPixel(i.leftMargin):t.x+T,b){case"Center":n=this.viewer.clientActiveArea.x+(this.viewer.clientActiveArea.width-F)/2;break;case"Left":n=this.viewer.clientActiveArea.x;break;case"Right":n=this.viewer.clientActiveArea.x+this.viewer.clientActiveArea.width-F}break;case"Margin":if(t.bodyWidget)switch(n=o+T,b){case"Center":n=o+(g-F)/2;break;case"Left":n=o;break;case"Outside":(t.bodyWidget.page.index+1)%2!=0&&(n=o+g-F);break;case"Right":n=o+g-F;break;case"Inside":(t.bodyWidget.page.index+1)%2==0&&(n=o+g-F)}else n=this.viewer.clientArea.x+T;break;case"Character":n="Right"===b||"Center"===b?this.getLeftMarginHorizPosition(o,b,T,F,m):this.viewer.clientArea.x+T;break;case"LeftMargin":n=this.getLeftMarginHorizPosition(o,b,T,F,m);break;case"RightMargin":n=this.getRightMarginHorizPosition(c,s,b,T,F,m);break;case"InsideMargin":n=(t.bodyWidget.page.index+1)%2==0?this.getRightMarginHorizPosition(c,s,b,T,F,m):this.getLeftMarginHorizPosition(o,b,T,F,m);break;case"OutsideMargin":n=(t.bodyWidget.page.index+1)%2==0?this.getLeftMarginHorizPosition(o,b,T,F,m):this.getRightMarginHorizPosition(c,s,b,T,F,m);break;default:n=this.viewer.clientArea.x+T}}}return new R(n,r)},e.prototype.getLeftMarginHorizPosition=function(e,t,i,n,r){var o=i;switch(t){case"Center":o=(e-n)/2;break;case"Left":o=0;break;case"Right":o=e-n}return o<0&&"InFrontOfText"!==r&&"Behind"!==r&&(o=0),o},e.prototype.getRightMarginHorizPosition=function(e,t,i,n,r,o){var s=e-t,a=s+n;switch(i){case"Center":a=s+(t-r)/2;break;case"Left":a=s;break;case"Right":a=e-r}return(a<0||a+r>e)&&"InFrontOfText"!==o&&"Behind"!==o&&(a=e-r),a},e.prototype.getVerticalPosition=function(e,t,i,n){var r=e.line.paragraph,o=0,s=r.associatedCell.y;switch(i){case"Page":case"Margin":case"TopMargin":case"InsideMargin":case"BottomMargin":case"OutsideMargin":o=s+t;break;case"Line":case"Paragraph":o=r.y+t+0;break;default:o=this.viewer.clientActiveArea.y+t}return o},e.prototype.getHorizontalPosition=function(e,t,i,n,r,o,s){var a=0,l=t.line.paragraph.associatedCell,d=s-l.leftMargin-l.rightMargin,h=l.cellFormat.cellWidth,c=l.x,p=c-l.leftMargin;switch(n){case"Page":switch(a=r,i){case"Center":a=p+(d-e)/2;break;case"Left":a=p;break;case"Right":a=p+(d-e);break;case"None":a=p+r}break;case"Column":case"Margin":switch(i){case"Center":a=c+(h-e)/2;break;case"Left":a=c;break;case"Right":a=c+(h-e);break;case"None":a=c+r}break;default:a=c+r}return a},e.prototype.updateTableFloatPoints=function(e){if(e.wrapTextAround){var t=e.getTableCellWidth(),i=e.positioning,n=e.bodyWidget.sectionFormat;if(e.containerWidget instanceof Xe||e.isInsideTable){if(e.isInsideTable){var r=e.containerWidget,o=r.cellFormat;"Page"===i.verticalOrigin?(this.viewer.clientActiveArea.y=r.y,this.viewer.clientActiveArea.y+=L.convertPointToPixel(i.verticalPosition)):"Margin"===i.verticalOrigin?(this.viewer.clientActiveArea.y=r.y,this.viewer.clientActiveArea.y+=r.topMargin,this.viewer.clientActiveArea.y+=L.convertPointToPixel(i.verticalPosition)):this.viewer.clientActiveArea.y+=L.convertPointToPixel(i.verticalPosition),"Page"===i.horizontalOrigin?"Left"===i.horizontalAlignment||"Inside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=r.x:"Right"!==i.horizontalAlignment&&"Outside"!==i.horizontalAlignment||(this.viewer.clientActiveArea.x=r.x+o.preferredWidth-t):"Margin"!==i.horizontalOrigin&&"Column"!==i.horizontalOrigin||("Left"===i.horizontalAlignment||"Inside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=r.x+r.leftMargin:"Right"!==i.horizontalAlignment&&"Outside"!==i.horizontalAlignment||(this.viewer.clientActiveArea.x=r.x+o.preferredWidth-(t+r.rightMargin))),Math.round(i.horizontalPosition)>0&&(this.viewer.clientActiveArea.x=r.x,"Margin"===i.horizontalOrigin&&(this.viewer.clientActiveArea.x+=r.leftMargin),this.viewer.clientActiveArea.x+=L.convertPointToPixel(i.horizontalPosition)),"Center"===i.horizontalAlignment&&(this.viewer.clientActiveArea.x=o.preferredWidth/2-t/2)}}else"Page"===i.verticalOrigin?"Top"===i.verticalAlignment?this.viewer.clientActiveArea.y=0:"Inside"===i.verticalAlignment&&(this.viewer.clientActiveArea.y=0):"Margin"===i.verticalOrigin&&("Top"===i.verticalAlignment?this.viewer.clientActiveArea.y=L.convertPointToPixel(n.topMargin):"Inside"===i.verticalAlignment&&(this.viewer.clientActiveArea.y=L.convertPointToPixel(n.topMargin))),(Math.round(i.verticalPosition)>0||"Paragraph"===i.verticalOrigin)&&(this.viewer.clientActiveArea.y+=L.convertPointToPixel(i.verticalPosition)),"Page"===i.horizontalOrigin?"Left"===i.horizontalAlignment?this.viewer.clientActiveArea.x=0:"Inside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=0:"Right"===i.horizontalAlignment?this.viewer.clientActiveArea.x=L.convertPointToPixel(n.pageWidth)-t:"Outside"===i.horizontalAlignment&&(this.viewer.clientActiveArea.x=L.convertPointToPixel(n.pageWidth)-t):"Margin"!==i.horizontalOrigin&&"Column"!==i.horizontalOrigin||("Left"===i.horizontalAlignment?this.viewer.clientActiveArea.x=L.convertPointToPixel(n.leftMargin):"Inside"===i.horizontalAlignment?this.viewer.clientActiveArea.x=L.convertPointToPixel(n.leftMargin):"Right"===i.horizontalAlignment?this.viewer.clientActiveArea.x=L.convertPointToPixel(n.pageWidth)-(L.convertPointToPixel(n.rightMargin)+t):"Outside"===i.horizontalAlignment&&(this.viewer.clientActiveArea.x=L.convertPointToPixel(n.pageWidth)-(L.convertPointToPixel(n.rightMargin)+t))),Math.round(i.horizontalPosition)>0&&(this.viewer.clientActiveArea.x+=L.convertPointToPixel(i.horizontalPosition)),"Center"===i.horizontalAlignment&&(this.viewer.clientActiveArea.x=L.convertPointToPixel(n.pageWidth)/2-t/2)}e.x=this.viewer.clientActiveArea.x,e.y=this.viewer.clientActiveArea.y},e.prototype.cropPosition=function(e){var t=0,i=0,n=e;n.isCrop=!0,0!==n.left&&(n.x=n.left*n.cropWidthScale/100),0!==n.top&&(n.y=n.top*n.cropHeightScale/100),0!==n.right&&(t=n.right*n.cropWidthScale/100),0!==n.bottom&&(i=n.bottom*n.cropHeightScale/100),n.cropWidth=n.cropWidthScale-(n.x+t),n.cropHeight=n.cropHeightScale-(n.y+i)},e.prototype.isTocField=function(e){if(e instanceof Ie){var t=e.nextNode;if(e instanceof Ie&&0===e.fieldType&&t instanceof Oe&&-1!==t.text.trim().toLowerCase().indexOf("toc"))return!0}return!1},e.prototype.getTotalColumnSpan=function(e){for(var t=e,i=0,n=0;n<t.childWidgets.length;n++)i+=t.childWidgets[n].cellFormat.columnSpan;return i},e}(),Y=function(){function e(e){this.isPrinting=!1,this.pageLeft=0,this.pageTop=0,this.pageIndex=-1,this.isFieldCode=!1,this.leftPosition=0,this.topPosition=0,this.height=0,this.documentHelper=e}return Object.defineProperty(e.prototype,"pageCanvas",{get:function(){return this.isPrinting?(t.isNullOrUndefined(this.pageCanvasIn)&&(this.pageCanvasIn=document.createElement("canvas"),this.pageCanvasIn.getContext("2d").save()),this.pageCanvasIn):t.isNullOrUndefined(this.viewer)?void 0:this.documentHelper.containerCanvas},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spellChecker",{get:function(){return this.documentHelper.owner.spellChecker},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionCanvas",{get:function(){return t.isNullOrUndefined(this.viewer)?void 0:this.documentHelper.selectionCanvas},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageContext",{get:function(){return this.pageCanvas.getContext("2d")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionContext",{get:function(){return this.selectionCanvas.getContext("2d")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.renderWidgets=function(e,i,n,r,o){if(!t.isNullOrUndefined(this.pageCanvas)&&!t.isNullOrUndefined(e)){if(this.pageContext.fillStyle=L.getColor(this.documentHelper.backgroundColor),this.pageContext.beginPath(),this.viewer instanceof de){o=o>this.documentHelper.visibleBounds.height?o:this.documentHelper.visibleBounds.height;var s=n;0===e.index&&(s=n-this.viewer.padding.top),this.pageContext.fillRect(i-this.viewer.padding.left,s,r+this.viewer.padding.left,o+this.viewer.padding.top)}else this.pageContext.fillRect(i,n,r,o);this.pageContext.closePath(),this.viewer instanceof le&&(this.pageContext.strokeStyle=this.documentHelper.owner.pageOutline,this.pageContext.strokeRect(i,n,r,o)),this.pageLeft=i,this.pageTop=n,this.pageIndex=e.index,this.isPrinting?this.setPageSize(e):(this.pageContext.beginPath(),this.pageContext.save(),this.pageContext.rect(i,n,r,o),this.pageContext.clip()),this.height=o,e.headerWidget&&this.renderHFWidgets(e,e.headerWidget,r,!0),e.footerWidget&&this.renderHFWidgets(e,e.footerWidget,r,!1);for(var a=0;a<e.bodyWidgets.length;a++)this.render(e,e.bodyWidgets[a]),e.footnoteWidget&&"Pages"===this.documentHelper.owner.layoutType&&this.renderfootNoteWidget(e,e.footnoteWidget);e.endnoteWidget&&"Pages"===this.documentHelper.owner.layoutType&&this.renderfootNoteWidget(e,e.endnoteWidget),this.documentHelper.owner.enableHeaderAndFooter&&!this.isPrinting&&this.renderHeaderSeparator(e,this.pageLeft,this.pageTop,e.headerWidget),this.pageLeft=0,this.pageTop=0,this.pageContext.restore()}},e.prototype.setPageSize=function(e){this.pageContext.clearRect(0,0,this.pageCanvas.width,this.pageCanvas.height),this.selectionContext.clearRect(0,0,this.selectionCanvas.width,this.selectionCanvas.height),this.pageContext.restore(),this.selectionContext.restore();var t=e.boundingRectangle.width,i=e.boundingRectangle.height,n=Math.max(window.devicePixelRatio,this.documentHelper.owner.documentEditorSettings.printDevicePixelRatio);this.pageCanvas.width===t*n&&this.pageCanvas.height===i*n||(this.pageCanvas.height=i*n,this.pageCanvas.width=t*n,this.pageCanvas.style.height=i+"px",this.pageCanvas.style.width=t+"px",this.pageContext.globalAlpha=1,this.pageContext.scale(n,n)),this.pageContext.fillStyle="#FFFFFF",this.pageContext.fillRect(0,0,this.pageCanvas.width,this.pageCanvas.height),this.pageContext.fillStyle="#000000"},e.prototype.renderHFWidgets=function(e,t,i,n){this.isPrinting||(this.pageContext.globalAlpha=this.documentHelper.owner.enableHeaderAndFooter?1:.65);var r=!1,o=0,s=0,a=e.boundingRectangle.height/100*40;if(n){var l=L.convertPointToPixel(e.bodyWidgets[0].sectionFormat.topMargin);Math.max(t.y+t.height,l)>a&&(r=!0,this.pageContext.beginPath(),this.pageContext.save(),this.pageContext.rect(this.pageLeft,this.pageTop,i,this.getScaledValue(a)),this.pageContext.clip())}else{var d=L.convertPointToPixel(e.bodyWidgets[0].sectionFormat.footerDistance),h=e.boundingRectangle.height-Math.max(e.footerWidget.height+d,L.convertPointToPixel(e.footerWidget.sectionFormat.bottomMargin));o=Math.max(e.boundingRectangle.height-a,h),s=e.boundingRectangle.height-d}this.renderFloatingItems(e,t.floatingElements,"Behind");for(var c=0;c<t.childWidgets.length;c++){var p=t.childWidgets[c];n||(o+=p.height),(n||!n&&this.getScaledValue(Math.round(o))<=this.getScaledValue(Math.round(s)))&&this.renderWidget(e,p)}this.renderFloatingItems(e,t.floatingElements,"InFrontOfText"),r&&this.pageContext.restore(),this.isPrinting||(this.pageContext.globalAlpha=this.documentHelper.owner.enableHeaderAndFooter?.65:1)},e.prototype.renderHeaderSeparator=function(e,t,i,n){var r=L.convertPointToPixel(e.bodyWidgets[0].sectionFormat.topMargin),o=this.getScaledValue(Math.max(n.y+n.height,r)),s=this.getScaledValue(e.boundingRectangle.width),a=this.pageContext;a.save(),a.globalAlpha=.65;var l=this.getScaledValue(e.boundingRectangle.height)/100*40;o=Math.min(o,l),this.renderDashLine(a,t,i+o,s,"#000000",!1);var d=this.getHeaderFooterType(e,!0);a.font="9pt Arial";var h=a.measureText(d).width;if(this.renderHeaderFooterMark(a,t+5,i+o,h+10,20),this.renderHeaderFooterMarkText(a,d,t+10,o+i+15),e.footerWidget){var c=L.convertPointToPixel(e.bodyWidgets[0].sectionFormat.footerDistance),p=this.getScaledValue(e.boundingRectangle.height)-this.getScaledValue(Math.max(e.footerWidget.height+c,L.convertPointToPixel(e.footerWidget.sectionFormat.bottomMargin)));p=Math.max(this.getScaledValue(e.boundingRectangle.height)-l,p),this.renderDashLine(a,t,i+p,s,"#000000",!1),d=this.getHeaderFooterType(e,!1),h=a.measureText(d).width,this.renderHeaderFooterMark(a,t+5,i+p-20,h+10,20),this.renderHeaderFooterMarkText(a,d,t+10,i+p-5),a.restore()}},e.prototype.getHeaderFooterType=function(e,i){var n;return n=i?"Header":"Footer",e.bodyWidgets[0].sectionFormat.differentFirstPage&&(t.isNullOrUndefined(e.previousPage)||e.sectionIndex!==e.previousPage.sectionIndex)?n=i?"First Page Header":"First Page Footer":e.bodyWidgets[0].sectionFormat.differentOddAndEvenPages&&(n=(this.documentHelper.pages.indexOf(e)+1)%2==0?i?"Even Page Header":"Even Page Footer":i?"Odd Page Header":"Odd Page Footer"),n},e.prototype.renderDashLine=function(e,t,i,n,r,o){e.beginPath(),e.strokeStyle=r,e.lineWidth=1,o?e.setLineDash([3,2]):e.setLineDash([6,4]),e.moveTo(t,i),e.lineTo(t+n,i),e.stroke(),e.setLineDash([]),e.closePath()},e.prototype.renderSolidLine=function(e,t,i,n,r){e.beginPath(),e.strokeStyle=r,e.lineWidth=.5,e.moveTo(t,i),e.lineTo(t+n,i),e.stroke(),e.closePath()},e.prototype.renderHeaderFooterMark=function(e,t,i,n,r){e.beginPath(),e.fillStyle="lightgray",e.fillRect(t,i,n,r),e.strokeStyle="black",e.strokeRect(t,i,n,r),e.closePath()},e.prototype.renderHeaderFooterMarkText=function(e,t,i,n){e.beginPath(),e.fillStyle="#000000",e.textBaseline="alphabetic",e.fillText(t,i,n),e.closePath()},e.prototype.render=function(e,t){this.isFieldCode&&(this.isFieldCode=!1),this.renderFloatingItems(e,e.bodyWidgets[0].floatingElements,"Behind");for(var i=0;i<t.childWidgets.length;i++){var n=t.childWidgets[i];0===i&&t.childWidgets[0]instanceof xe&&t.childWidgets[0].childWidgets.length>0&&(t.childWidgets[0].childWidgets[0].rowFormat.isHeader||e.repeatHeaderRowTableWidget)&&this.renderHeader(e,n,this.documentHelper.layout.getHeader(t.childWidgets[0])),this.renderWidget(e,n)}this.renderFloatingItems(e,e.bodyWidgets[0].floatingElements,"InFrontOfText")},e.prototype.renderFloatingItems=function(e,i,n){if(!t.isNullOrUndefined(i)&&i.length>0){i.sort(function(e,t){return e instanceof xe||t instanceof xe?0:e.zOrderPosition-t.zOrderPosition});for(var r=0;r<i.length;r++)if(!(i[r]instanceof xe)){var o=i[r];if(!("Behind"===n&&"Behind"!==o.textWrappingStyle||"Behind"!==n&&"Behind"===o.textWrappingStyle))if(o instanceof Ze)this.renderImageElementBox(o,o.x,o.y,0);else if(o instanceof Ke){var s=this.getScaledValue(o.x,1),a=this.getScaledValue(o.y,2);this.renderShapeElementBox(o,s,a,e)}}}},e.prototype.renderShapeElementBox=function(e,i,n,r){var o=0===e.height,s=e.autoShapeType,a=e.textFrame.childWidgets;this.pageContext.beginPath(),e.fillFormat&&e.fillFormat.color&&e.fillFormat.fill&&(this.pageContext.fillStyle=e.fillFormat.color,this.pageContext.fillRect(i,n,this.getScaledValue(e.width),this.getScaledValue(e.height))),t.isNullOrUndefined(s)||(e.lineFormat.line&&"None"!==e.lineFormat.lineFormatType||!t.isNullOrUndefined(e.lineFormat.lineFormatType)&&"None"!==e.lineFormat.lineFormatType)&&(this.pageContext.lineWidth=e.lineFormat.weight,this.pageContext.strokeStyle=L.getColor(e.lineFormat.color),this.pageContext.strokeRect(i,n,this.getScaledValue(e.width),this.getScaledValue(e.height))),this.pageContext.closePath();var l=!1;0!=e.width&&0!=e.height&&(l=!0,this.clipRect(e.x,e.y,this.getScaledValue(e.width),this.getScaledValue(e.height)));for(var d=0;d<a.length;d++)this.renderWidget(r,a[d]),o&&"StraightConnector"!==s&&(e.height+=a[d].height);o&&(o=!1),l&&this.pageContext.restore()},e.prototype.renderWidget=function(e,t){this.documentHelper.owner.enableLockAndEdit&&this.renderLockRegionBorder(e,t),t instanceof we?this.renderParagraphWidget(e,t):this.renderTableWidget(e,t)},e.prototype.renderLockRegionBorder=function(e,i){if(!i.isInsideTable&&i instanceof ye&&i.locked){var n=this.documentHelper.owner.documentEditorSettings.collaborativeEditingSettings,r=e.bodyWidgets[0].sectionFormat,o=L.convertPointToPixel(r.leftMargin)-5,s=r.pageWidth-r.leftMargin-r.rightMargin;s=L.convertPointToPixel(s)+10,this.viewer instanceof de&&(o=i.x-5,s=(this.documentHelper.visibleBounds.width-5*this.viewer.padding.right)/this.documentHelper.zoomFactor);var a=i.previousRenderedWidget,l=i.nextRenderedWidget,d=i.lockedBy===this.documentHelper.owner.currentUser?n.editableRegionColor:n.lockedRegionColor,h=i.y,c=i.y+i.height;this.renderSingleBorder(d,o,h,o,c,1),!t.isNullOrUndefined(a)&&a.locked&&i.lockedBy===a.lockedBy||this.renderSingleBorder(d,o,h,o+s,h,1),this.renderSingleBorder(d,o+s,h,o+s,c,1),!t.isNullOrUndefined(l)&&l.locked&&i.lockedBy===l.lockedBy||this.renderSingleBorder(d,o,c,o+s,c,1)}},e.prototype.renderHeader=function(e,i,n){if(!t.isNullOrUndefined(n)){e.viewer.updateClientArea(e.bodyWidgets[0].sectionFormat,e);for(var r=e.viewer.clientArea.y,o=n.ownerTable.getSplitWidgets()[0],s=0;s<=n.rowIndex;s++){if(0===o.childWidgets.length)return;var a=o.childWidgets[s],l=a.clone();l.containerWidget=a.containerWidget,e.viewer.updateClientAreaLocation(l,new ce(e.viewer.clientArea.x,r,l.width,l.height)),e.documentHelper.layout.updateChildLocationForRow(r,l);for(var d=void 0,h=0;h<l.childWidgets.length;h++)d=l.childWidgets[h],this.renderTableCellWidget(e,d);r+=l.height}i.y!==r&&e.documentHelper.layout.updateChildLocationForTable(r,i)}},e.prototype.renderParagraphWidget=function(e,t){for(var i=t.y,n=t.x,r=0;r<t.childWidgets.length;r++){var o=t.childWidgets[r];i+=o.marginTop,this.renderLine(o,e,n,i),i+=o.height}},e.prototype.renderfootNoteWidget=function(e,i){for(var n=0;n<i.childWidgets.length;n++){var r=i.childWidgets[n];if(0!==n)!t.isNullOrUndefined(r.footNoteReference)&&r.childWidgets[0].children[0]instanceof Oe&&(n<2||n>1&&r.footNoteReference!==i.childWidgets[n-1].footNoteReference)&&(r.childWidgets[0].children[0].text=r.childWidgets[0].children[0].text.replace(r.childWidgets[0].children[0].text,r.footNoteReference.text)),this.renderWidget(e,r);else{var o=this.pageContext;this.renderSolidLine(o,this.getScaledValue(r.x,1),this.getScaledValue(r.y+r.height/2,2),300*this.documentHelper.zoomFactor,"#000000")}}},e.prototype.renderTableWidget=function(e,t){if(!this.isFieldCode)for(var i=0;i<t.childWidgets.length;i++){var n=t.childWidgets[i];this.renderTableRowWidget(e,n),t.tableFormat.cellSpacing>0&&this.renderTableOutline(t)}},e.prototype.renderTableRowWidget=function(e,t){for(var i=0;i<t.childWidgets.length;i++){var n=t.childWidgets[i];this.renderTableCellWidget(e,n)}},e.prototype.renderTableCellWidget=function(e,t){if(this.isPrinting||!(this.getScaledValue(t.y,2)+t.height*this.documentHelper.zoomFactor<0||this.getScaledValue(t.y,2)>this.documentHelper.visibleBounds.height)){!this.isPrinting&&e.documentHelper.owner.selection&&e.documentHelper.owner.selection.selectedWidgets.length>0&&e.documentHelper.owner.selection.addSelectionHighlightTable(this.selectionContext,t),this.renderTableCellOutline(e.documentHelper,t);for(var i=0;i<t.childWidgets.length;i++){var n=t.childWidgets[i],r=t.width+t.margin.left+t.margin.right-t.leftBorderWidth;this.isPrinting||this.clipRect(t.x-t.margin.left,t.y,this.getScaledValue(r),this.getScaledValue(this.height)),this.renderWidget(e,n),this.pageContext.restore()}}},e.prototype.renderLine=function(e,i,n,r){!this.isPrinting&&i.documentHelper.owner.selection&&!this.documentHelper.isScrollToSpellCheck&&i.documentHelper.owner.selection.selectedWidgets.length>0&&i.documentHelper.owner.selection.addSelectionHighlight(this.selectionContext,e,r);var o=e.paragraph.paragraphFormat;if(e.isFirstLine()&&!o.bidi&&(n+=L.convertPointToPixel(o.firstLineIndent)),this.documentHelper&&this.documentHelper.selection&&!t.isNullOrUndefined(this.documentHelper.selection.formFieldHighlighters)&&this.documentHelper.selection.formFieldHighlighters.containsKey(e)&&this.documentHelper.owner.documentEditorSettings&&this.documentHelper.owner.documentEditorSettings.formFieldSettings.applyShading)for(var s=i.documentHelper.selection.formFieldHighlighters.get(e),a=0;a<s.length;a++){this.pageContext.fillStyle=this.documentHelper.owner.documentEditorSettings.formFieldSettings.shadingColor;var l=e.height;e.isLastLine()&&(l-=L.convertPointToPixel(this.documentHelper.layout.getAfterSpacing(e.paragraph))),this.pageContext.fillRect(this.getScaledValue(s[a].left,1),this.getScaledValue(r,2),this.getScaledValue(s[a].width),this.getScaledValue(l))}if(this.documentHelper.owner.searchModule&&!t.isNullOrUndefined(i.documentHelper.owner.searchModule.searchHighlighters)&&i.documentHelper.owner.searchModule.searchHighlighters.containsKey(e))for(var s=i.documentHelper.owner.searchModule.searchHighlighters.get(e),a=0;a<s.length;a++)this.pageContext.fillStyle=this.viewer.owner.documentEditorSettings.searchHighlightColor,this.pageContext.fillRect(this.getScaledValue(s[a].left,1),this.getScaledValue(r,2),this.getScaledValue(s[a].width),this.getScaledValue(e.height));if(i.documentHelper.selection&&!t.isNullOrUndefined(i.documentHelper.selection.editRegionHighlighters)&&i.documentHelper.selection.editRegionHighlighters.containsKey(e))for(var s=i.documentHelper.selection.editRegionHighlighters.get(e),a=0;a<s.length;a++)this.pageContext.fillStyle=""!==s[a].color?s[a].color:"#add8e6",this.pageContext.fillRect(this.getScaledValue(s[a].left,1),this.getScaledValue(r,2),this.getScaledValue(s[a].width),this.getScaledValue(e.height));for(var d=!1,a=0;a<e.children.length;a++){var h=e.children[a];if(!(h instanceof Ge&&"Inline"!==h.textWrappingStyle)){if(h instanceof vt||h instanceof et){var c=0;this.viewer instanceof le&&(c=this.viewer.pageGap);var p="display:block;position:absolute;",g=this.getScaledValue(r-10+(i.boundingRectangle.y-c*(i.index+1)))+c*(i.index+1)+"px;";if(h instanceof et)if(this.documentHelper.owner.enableLockAndEdit){var u=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);u.setLocale(this.documentHelper.owner.locale),h.renderLockMark(this.documentHelper.owner.currentUser,u);var m=this.documentHelper.owner.documentEditorSettings.collaborativeEditingSettings;p+="color:"+(h.user===this.documentHelper.owner.currentUser?m.editableRegionColor:m.lockedRegionColor)+";";var f=L.convertPointToPixel(i.bodyWidgets[0].sectionFormat.leftMargin),v=i.boundingRectangle.x+this.getScaledValue(f-20)+"px;";this.viewer instanceof de&&(v=e.paragraph.x-5+"px;"),p=p+"left:"+v+"top:"+g,h.editRangeMark.setAttribute("style",p)}else h.editRangeMark&&h.editRangeMark.setAttribute("style","display:none");else if(h instanceof vt&&0===h.commentType&&this.documentHelper.owner.selectionModule)if(this.documentHelper.owner.enableComment&&!d){d=!0,h.renderCommentMark();var y=L.convertPointToPixel(i.bodyWidgets[0].sectionFormat.rightMargin),b=L.convertPointToPixel(i.bodyWidgets[0].sectionFormat.pageWidth),v=i.boundingRectangle.x+this.getScaledValue(b-y+y/4)+"px;";this.viewer instanceof de&&(v=i.boundingRectangle.width-2*this.viewer.padding.right-2*this.viewer.padding.left+"px;"),p=p+"left:"+v+"top:"+g,h.commentMark.setAttribute("style",p)}else h.commentMark&&h.commentMark.setAttribute("style","display:none")}if(h instanceof Ie||this.isFieldCode||0===h.width&&0===h.height)this.isFieldCode&&(h.width=0),n+=h.width+h.margin.left,this.toSkipFieldCode(h);else{var w=this.getUnderlineYPosition(e);if(this.isPrinting||!(this.getScaledValue(r+h.margin.top,2)+h.height*this.documentHelper.zoomFactor<0||this.getScaledValue(r+h.margin.top,2)>this.documentHelper.visibleBounds.height)){if(h instanceof Qe)this.renderListTextElementBox(h,n,r,w);else if(h instanceof Ze)this.renderImageElementBox(h,n,r,w);else if(h instanceof Ke){var C=this.getScaledValue(n,1),x=this.getScaledValue(r,2);this.renderShapeElementBox(h,C,x,i)}else h.isVisible=!0,n+=h.padding.left,this.renderTextElementBox(h,n,r,w);n+=h.width+h.margin.left}else n+=h.width+h.margin.left,h instanceof Oe&&(h.canTrigger=!0,h.isVisible=!1,h.isSpellChecked&&!h.line.paragraph.isChangeDetected||(h.ischangeDetected=!0))}}}},e.prototype.toSkipFieldCode=function(e){e instanceof Ie&&(0===e.fieldType?t.isNullOrUndefined(e.fieldEnd)&&!e.hasFieldEnd||(this.isFieldCode=!0):2!==e.fieldType&&1!==e.fieldType||(this.isFieldCode=!1))},e.prototype.getUnderlineYPosition=function(e){for(var t=0,i=0,n=0;n<e.children.length;n++)e.children[n]instanceof Ie||0===e.children[n].width&&0===e.children[n].height||e.children[n]instanceof Ke||t<e.children[n].height+e.children[n].margin.top&&(t=e.children[n].margin.top+e.children[n].height,i=e.children[n]instanceof Ze?.9:e.children[n].height/20);return t-2*i},e.prototype.renderListTextElementBox=function(e,i,n,r){var o=e.margin.top,s=e.margin.left,a=e.listLevel.characterFormat,l=e.line.paragraph.characterFormat,d="empty"===a.fontColor?l.fontColor:a.fontColor;this.pageContext.textBaseline="alphabetic";var h="",c="",p=a.hasValue("fontFamily")?a.fontFamily:l.fontFamily;!this.documentHelper.isIosDevice||"●"!==e.text&&"○"!==e.text||(p="");var g=11===a.fontSize?l.fontSize:a.fontSize,u="Normal"===a.baselineAlignment?l.baselineAlignment:a.baselineAlignment;h=a.hasValue("bold")?a.bold?"bold":"":l.bold?"bold":"",c=a.hasValue("italic")?a.italic?"italic":"":l.italic?"italic":"",g=0===g?.5:g/("Normal"===u?1:1.5),g=this.isPrinting?g:g*this.documentHelper.zoomFactor;var m="None"===a.strikethrough?l.strikethrough:a.strikethrough,f="NoColor"===a.highlightColor?l.highlightColor:a.highlightColor;"NoColor"!==f&&("#"!==f.substring(0,1)?this.pageContext.fillStyle=L.getHighlightColorCode(f):this.pageContext.fillStyle=L.getColor(f),this.pageContext.fillRect(this.getScaledValue(i+s,1),this.getScaledValue(n+o,2),this.getScaledValue(e.width),this.getScaledValue(e.height))),this.pageContext.font=h+" "+c+" "+g+"pt "+p,"Subscript"===u&&(o+=e.height-e.height/1.5);var v=e.baselineOffset;o="Normal"===a.baselineAlignment?o+v:o+v/1.5;var y=e.text;if(!("\t"===y||" "===y)&&(a.bidi||e.line.paragraph.paragraphFormat.bidi)){var b=y.indexOf(".");y=y.substr(b)+y.substring(0,b)}if("empty"===d){var w=this.documentHelper.backgroundColor;this.pageContext.fillStyle=this.getDefaultFontColor(w)}else this.pageContext.fillStyle=L.getColor(d);this.pageContext.fillText(y,this.getScaledValue(i+s,1),this.getScaledValue(n+o,2),this.getScaledValue(e.width)),"None"===a.underline||t.isNullOrUndefined(a.underline)||this.renderUnderline(e,i,n,r,d,a.underline,u),"None"!==m&&this.renderStrikeThrough(e,i,n,a.strikethrough,d,u)},e.prototype.getDefaultFontColor=function(e){return L.isVeryDark(e)?"#FFFFFF":"#000000"},e.prototype.renderTextElementBox=function(e,i,n,r){var o=!1,s=e.line.paragraph.containerWidget;s instanceof Pe&&(o="Exactly"===s.ownerRow.rowFormat.heightType);var a=e.margin.top,l=e.margin.left;o&&this.clipRect(s.x,s.y,this.getScaledValue(s.width),this.getScaledValue(s.height));var d=e.characterFormat;"NoColor"!==d.highlightColor&&("#"!==d.highlightColor.substring(0,1)?this.pageContext.fillStyle=L.getHighlightColorCode(d.highlightColor):this.pageContext.fillStyle=L.getColor(d.highlightColor),this.pageContext.fillRect(this.getScaledValue(i+l,1),this.getScaledValue(n+a,2),this.getScaledValue(e.width),this.getScaledValue(e.height)));var h=this.checkRevisionType(e),c=h.length>0?this.getRevisionColor(h):d.fontColor;this.pageContext.textBaseline="alphabetic";var p="",g="",u=11;p=d.bold?"bold":"",g=d.italic?"italic":"",u=0===d.fontSize?.5:d.fontSize/("Normal"===d.baselineAlignment?1:1.5),u=this.isPrinting?u:u*this.documentHelper.zoomFactor,this.pageContext.font=p+" "+g+" "+u+"pt "+d.fontFamily,"Subscript"===d.baselineAlignment&&(a+=e.height-e.height/1.5);var m=e.baselineOffset;if(a="Normal"===d.baselineAlignment?a+m:a+m/1.5,"empty"===c){var f=this.documentHelper.backgroundColor;this.pageContext.fillStyle=this.getDefaultFontColor(f)}else this.pageContext.fillStyle=L.getColor(c);var v=this.getScaledValue(e.width),y=e.text;if(e instanceof De){var b=e;""!==b.tabText||t.isNullOrUndefined(b.tabLeader)||"None"===b.tabLeader?""!==b.tabText&&(y=b.tabText):(y=this.getTabLeader(e),b.tabText=y)}var w=d.bidi||this.documentHelper.textHelper.isRTLText(e.text);if(y=this.documentHelper.textHelper.setText(y,w,d.bdo,!0),d.allCaps&&(y=y.toUpperCase()),this.pageContext.fillText(y,this.getScaledValue(i+l,1),this.getScaledValue(n+a,2),v),this.documentHelper.owner.isSpellCheck&&!this.spellChecker.removeUnderline&&(this.documentHelper.triggerSpellCheck||e.canTrigger)&&" "!==e.text&&!this.documentHelper.isScrollHandler&&(t.isNullOrUndefined(e.previousNode)||!(e.previousNode instanceof Ie))){e.canTrigger=!0,this.leftPosition=this.pageLeft,this.topPosition=this.pageTop;var C=this.spellChecker.checktextElementHasErrors(e.text,e,i);if(C.errorFound){c="#FF0000";for(var x=0;x<C.elements.length;x++){var F=C.elements[x];if(-1===e.ignoreOnceItems.indexOf(this.spellChecker.manageSpecialCharacters(F.text,void 0,!0))){var P=s instanceof Pe?s.cellFormat.shading.backgroundColor:this.documentHelper.backgroundColor;this.renderWavyLine(F,t.isNullOrUndefined(F.start)?i:F.start.location.x,t.isNullOrUndefined(F.start)?n:F.start.location.y-e.margin.top,r,c,"Single",d.baselineAlignment,P)}}}else(e.ischangeDetected||this.documentHelper.triggerElementsOnLoading)&&(e.ischangeDetected=!1,this.handleChangeDetectedElements(e,r,i,n,d.baselineAlignment))}var T=this.getRevisionType(h,!0);("None"===d.underline||t.isNullOrUndefined(d.underline))&&(t.isNullOrUndefined(T)||"Insertion"!==T.type&&"MoveTo"!==T.type)||this.renderUnderline(e,i,n,r,c,d.underline,d.baselineAlignment,T),T=this.getRevisionType(h,!1),("None"===d.strikethrough||t.isNullOrUndefined(d.strikethrough))&&(t.isNullOrUndefined(T)||"Deletion"!==T.type&&"MoveFrom"!==T.type)||this.renderStrikeThrough(e,i,n,d.strikethrough,c,d.baselineAlignment,T),o&&this.pageContext.restore()},e.prototype.handleChangeDetectedElements=function(e,t,i,n,r){var o=this,s=e.text.trim(),a=this.pageIndex;if("\v"!==e.text&&!this.spellChecker.checkElementCanBeCombined(e,t,a,!0)){var l=s.split(/[\s]+/),d=e.line.getOffset(e,0);if(l.length>1)for(var h=0;h<l.length;h++){var c=l[h],p=this.spellChecker.manageSpecialCharacters(c,void 0,!0);-1===this.spellChecker.ignoreAllItems.indexOf(p)&&-1===e.ignoreOnceItems.indexOf(p)&&(this.handleUnorderedElements(p,e,t,h,d,h===l.length-1,a),d+=c.length+1)}else{p=this.spellChecker.manageSpecialCharacters(s,void 0,!0);if(s.length>0&&-1===this.spellChecker.ignoreAllItems.indexOf(p)&&-1===e.ignoreOnceItems.indexOf(p)){var g=e.indexInOwner,u=e.line.paragraph.indexInOwner,m=this.spellChecker.checkSpellingInPageInfo(p);if(m.isElementPresent&&this.spellChecker.enableOptimizedSpellCheck){var f=JSON.parse('{"HasSpellingError":'+m.hasSpellError+"}");this.spellChecker.handleWordByWordSpellCheck(f,e,i,n,t,r,!0)}else this.spellChecker.callSpellChecker(this.spellChecker.languageID,s,!0,this.spellChecker.allowSpellCheckAndSuggestion).then(function(s){var l=JSON.parse(s),d=(a===o.pageIndex||e.isVisible)&&g===e.indexInOwner&&u===e.line.paragraph.indexInOwner;o.spellChecker.handleWordByWordSpellCheck(l,e,i,n,t,r,d)})}}}},e.prototype.handleUnorderedElements=function(e,t,i,n,r,o,s){var a=this,l=t.indexInOwner,d=t.line.paragraph.indexInOwner;if(e.length>0){var h=this.spellChecker.checkSpellingInPageInfo(e);if(h.isElementPresent&&this.spellChecker.enableOptimizedSpellCheck){var c=JSON.parse('{"HasSpellingError":'+h.hasSpellError+"}");this.spellChecker.handleSplitWordSpellCheck(c,e,t,!0,i,n,r,o)}else this.spellChecker.callSpellChecker(this.spellChecker.languageID,e,!0,this.spellChecker.allowSpellCheckAndSuggestion).then(function(s){var h=JSON.parse(s),c=t.isVisible&&l===t.indexInOwner&&d===t.line.paragraph.indexInOwner;a.spellChecker.handleSplitWordSpellCheck(h,e,t,c,i,n,r,o)})}},e.prototype.renderWavyLine=function(e,t,i,n,r,o,s,a){if(e.text.length>1){var l=e.height/("Normal"===s?1:1.5),d=e.margin.top,h=l/20,c=0;"Subscript"===s||e instanceof Qe?(c=l-2*h+i,c+=(d+=e.height-l)>0?d:0):c=n+i;var p=this.spellChecker.getSpecialCharactersInfo(e.text,e.characterFormat),g=this.spellChecker.getWhiteSpaceCharacterInfo(e.text,e.characterFormat),u=(t+p.beginningWidth+(g.isBeginning?g.width:0)+e.margin.left)*this.documentHelper.zoomFactor+this.leftPosition,m=c*this.documentHelper.zoomFactor+this.topPosition,f=u+this.getScaledValue(e.width-(p.beginningWidth+p.endWidth)-g.width),v=new R(u,m),y=new R(f,m);this.drawWavy(v,y,.5*(f-u),1,.7,r,e.height,a)}},e.prototype.drawWavy=function(e,i,n,r,o,s,a,l,d){this.pageContext.save(),this.pageContext.fillStyle=t.isNullOrUndefined(l)?this.documentHelper.backgroundColor:l,this.pageContext.fillRect(e.x,e.y-r,i.x-e.x,3*r),this.pageContext.restore(),this.pageContext.lineWidth=1,this.pageContext.lineCap="round",this.pageContext.strokeStyle=s,this.pageContext.beginPath();var h=0,c=0,p=e.x,g=e.y,u=i.x,m=i.y,f=0,v=0,y=Math.atan2(m-g,u-p),b=Math.sqrt((p-u)*(p-u)+(g-m)*(g-m)),w=1*r,C=Math.PI*n;for(f;f<=b;f+=o)v=Math.sin(f/b*C)*w,h=e.x+Math.cos(y)*f+Math.cos(y-Math.PI/2)*v,c=e.y+Math.sin(y)*f+Math.sin(y-Math.PI/2)*v,f>0?this.pageContext.lineTo(h,c):this.pageContext.moveTo(h,c);this.pageContext.stroke(),this.pageContext.restore()},e.prototype.getTabLeader=function(e){var t=0,i=this.getTabLeaderString(e.tabLeader),n=i;t=this.documentHelper.textHelper.getWidth(n,e.characterFormat);for(var r=Math.floor(e.width/t),o=0;o<=r;o++)n+=i;return n.slice(0,-1)},e.prototype.getTabLeaderString=function(e){var t="";switch(e){case"Dot":t=".";break;case"Hyphen":t="-";break;case"Underscore":t="_"}return t},e.prototype.clipRect=function(e,t,i,n){this.pageContext.beginPath(),this.pageContext.save(),this.pageContext.rect(this.getScaledValue(e,1),this.getScaledValue(t,2),i,n),this.pageContext.clip()},e.prototype.renderUnderline=function(e,i,n,r,o,s,a,l){var d=e.height/("Normal"===a?1:1.5),h=e.margin.top,c=d/20,p=0,g=d/20;"Subscript"===a||e instanceof Qe?(p=d-2*c+n,p+=(h+=e.height-d)>0?h:0):p=r+n;var u=0;for(t.isNullOrUndefined(l)||(s="MoveTo"===l.type?"Double":"Single"),"Double"===s&&(p-=g),e instanceof Ze&&(c=.9);u<("Double"===s?2:1);){u++;var m=e.width;e instanceof Oe&&t.isNullOrUndefined(e.nextNode)&&(m=this.documentHelper.textHelper.getWidth(L.trimEnd(e.text),e.characterFormat)),this.pageContext.fillRect(this.getScaledValue(i+e.margin.left,1),this.getScaledValue(p,2),this.getScaledValue(m),this.getScaledValue(c)),p+=2*g}},e.prototype.renderStrikeThrough=function(e,i,n,r,o,s,a){var l=e.height/("Normal"===s?1:1.5),d=e.margin.top;"Subscript"===s&&(d+=e.height-l),n+=d>0?d:0;var h=l/20,c=l/2+.5*h,p=0;for(t.isNullOrUndefined(a)||(r="Deletion"===a.type?"SingleStrike":"DoubleStrike"),e instanceof Ze&&(h=.9),"DoubleStrike"===r&&(c-=h);p<("DoubleStrike"===r?2:1);)p++,this.pageContext.fillRect(this.getScaledValue(i+e.margin.left,1),this.getScaledValue(c+n,2),this.getScaledValue(e.width),this.getScaledValue(h)),c+=2*h},e.prototype.renderImageElementBox=function(e,i,n,r){var o=e.margin.top,s=e.margin.left,a=this.checkRevisionType(e),l=a.length>0?this.getRevisionColor(a):"black";this.pageContext.textBaseline="top";var d=0,h=!1,c=e.line.paragraph.containerWidget,p=!1;if(c instanceof Pe&&(p="Exactly"===c.ownerRow.rowFormat.heightType),"Inline"===e.textWrappingStyle)if(o<0||e.line.paragraph.width<e.width){if(c instanceof Pe){var g=0;c.childWidgets[0]instanceof we&&(g=c.childWidgets[0].paragraphFormat.leftIndent),d=c.width+c.margin.left-c.leftBorderWidth-g,h=!0,this.clipRect(i+s,n+o,this.getScaledValue(d),this.getScaledValue(c.height))}}else if(p){var u=c.width+c.margin.left-c.leftBorderWidth;h=!0,this.clipRect(c.x,c.y,this.getScaledValue(u),this.getScaledValue(c.height))}if(e.isMetaFile&&!t.isNullOrUndefined(e.metaFileImageString))this.pageContext.drawImage(e.element,this.getScaledValue(i+s,1),this.getScaledValue(n+o,2),this.getScaledValue(e.width),this.getScaledValue(e.height));else try{e.isCrop?this.pageContext.drawImage(e.element,this.getScaledValue(e.x),this.getScaledValue(e.y),e.cropWidth,e.cropHeight,this.getScaledValue(i+s,1),this.getScaledValue(n+o,2),this.getScaledValue(e.width),this.getScaledValue(e.height)):this.pageContext.drawImage(e.element,this.getScaledValue(i+s,1),this.getScaledValue(n+o,2),this.getScaledValue(e.width),this.getScaledValue(e.height))}catch(t){e.imageString="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAgVBMVEX///8AAADgAADY2Njl5eVcXFxjY2NZWVl/f3+wsLCmpqb4+PiioqKpqam7u7vV1dX2uLj2wsLhFRXzpKT3vb30sbHhCwv74+P40dH+9vbkIyO2trbBwcHLy8tsbGycnJz529v4zMzrbGzlLS3qZmblNzfrdXXoRkbvi4vvgYHlHh7CZsBOAAADpUlEQVR4nO3da1faQBSF4ekAUQlUEFs14AXxVv7/D6yaQiZx5mSEYXF2ut+PNKzyyK5diYDmR9czx34AB49C/CjE759w3jvvWr15Tdgz3atXE54f++EcIArxoxA/CvGjED8K8aMQPwrxoxA/CvGLEeZ9jPJdhfk4GyCUjb3ECGE/Q6m/q3DwfudjP0ERZYN9hKdn2hvd3+0jHJz5/kBVuTk96bbQUEjhYR9ckiikUH8UUqg/CinUH4UU6o9CCvVHIYX6o5BC/VFIof4opFB/FFKoPwop1B+FFOqPQgrjyxfjVC38Lxk9tnAxGqZqdKtSOE4GHA5/fuNJpDCtcNHbv4VqYYqPLjgfUViPQgrjozA2CptRSGF8/59w+Wrt+rr1btNna1cPzg0wwuXavncxabnX7PfHYYXzlYARvlobQZyUR9mXm+1NMEK7SSLONgcVV9vb8IQXv4J3KSeKKlxXxNCzONkeYp8AV3p9UT1+P3FWHVAsq5thhGZSEb1DrSZq7dS5HUdoLiuBZ6jORG3tCwAkNJfCUJ2Jrqe1P0ESCkMNTdSACYNDDU7UoAkDQw1P1MAJvUMVJmrwhJ6hShM1gMIvQxUnahCFjaHKEzWQQneoxR95ogZTWBuqPFEDKnSHKk/UoArdoYoTNbDC5lBDEzW4QjMpYiZqgIXG/S76JhwHK5zVVipcnkIVuv/RW/HyFKhwYhuFr6NiCmdNoDBUSGFjovJQEYXuRN9ahwoorJ8uSZenPsMTNk+X2q6jwgm/ntHL11HhhL4zenmoYEL/Gb04VCxh6KKTNFQoYfiikzBUJKF00Sk8VCChfF00OFQcYdt10dBQYYRT5xn0n9G7Q0X8GfCzNNEyZ6iPgD/HlydaVg11DfhajJaJlm2HugIUrlomWrYZKuJKHz6vHhbSM/hROdRnxNe1meuXYvW0DB6+aflYrB7dlzDiCM3N1dVN6GDhMCDhjlHYjEIK46MwNgqbUUhhfJ/vA07wO8N1vw94ONo/3e/lTpVOYfc/UyG//ZmqW52fi/FuTNW3/lZ+eguF+qOQQv1RSKH+KKRQfxRSqD8KKdQfhRTqj0IK9UchhfqjkEL9UUih/iikUH8UUqg/CmXh6Hsv3jlK+wnvD/vgkrSHMMuyu1P9ZdmuwnycDQYn+svG3n9KEUKT9zHyf6+IEWJHIX4U4kchfhTiRyF+FOJHIX4U4kchfnVhijeZa6sunCf4ZdPamteEHY5C/CjEr/vCv0ec0g+AtS1QAAAAAElFTkSuQmCC",this.pageContext.drawImage(e.element,this.getScaledValue(i+s,1),this.getScaledValue(n+o,2),this.getScaledValue(e.width),this.getScaledValue(e.height))}this.pageContext.fillStyle=L.getColor(l);var m=this.getRevisionType(a,!1);if(t.isNullOrUndefined(m)||"Deletion"!==m.type&&"MoveFrom"!==m.type||this.renderStrikeThrough(e,i,n,"SingleStrike",l,"Normal",m),m=this.getRevisionType(a,!0),!t.isNullOrUndefined(m)&&("Insertion"===m.type||"MoveTo"===m.type)){var f=this.getUnderlineYPosition(e.line);this.renderUnderline(e,i,n,f,l,"Single","Normal")}h&&this.pageContext.restore()},e.prototype.renderTableOutline=function(e){var t=new X(this.documentHelper),i=e;e.width=this.documentHelper.layout.getTableWidth(i);var n=i.isBidiTable?t.getTableRightBorder(i.tableFormat.borders):t.getTableLeftBorder(i.tableFormat.borders),r=0;r=L.convertPointToPixel(n.getLineWidth()),this.renderSingleBorder(n.color,e.x-e.margin.left-r/2,e.y,e.x-e.margin.left-r/2,e.y+e.height,r),n=t.getTableTopBorder(i.tableFormat.borders),r=0,r=L.convertPointToPixel(n.getLineWidth()),this.renderSingleBorder(n.color,e.x-e.margin.left-r,e.y-r/2,e.x+e.width+r+e.margin.right,e.y-r/2,r),n=i.isBidiTable?t.getTableLeftBorder(i.tableFormat.borders):t.getTableRightBorder(i.tableFormat.borders),r=0,r=L.convertPointToPixel(n.getLineWidth()),this.renderSingleBorder(n.color,e.x+e.width+e.margin.right+r/2,e.y,e.x+e.width+e.margin.right+r/2,e.y+e.height,r),n=t.getTableBottomBorder(i.tableFormat.borders),r=0,r=L.convertPointToPixel(n.getLineWidth()),this.renderSingleBorder(n.color,e.x-e.margin.left-r,e.y+e.height-r/2,e.x+e.width+r+e.margin.right,e.y+e.height-r/2,r)},e.prototype.renderTableCellOutline=function(e,i){var n=e.layout,r=i,o=0,s=0,a=0,l=0,d=0,h=i.ownerTable.isBidiTable;r.cellFormat.borders,i.containerWidget instanceof Fe&&(s=i.margin.bottom-i.containerWidget.bottomBorderWidth,o=i.margin.top-i.containerWidget.topBorderWidth),a=i.margin.left-i.leftBorderWidth,l=i.margin.right-i.rightBorderWidth,d=t.isNullOrUndefined(r.ownerRow)||"Exactly"!==r.ownerRow.rowFormat.heightType?!t.isNullOrUndefined(r.ownerRow)&&[r.ownerRow].length<=1?Math.max(L.convertPointToPixel(r.ownerRow.rowFormat.height),i.height)+o+s:i.height+o+s:L.convertPointToPixel(r.ownerRow.rowFormat.height)+o+s;var c=h?Pe.getCellRightBorder(r):Pe.getCellLeftBorder(r),p=0;p=L.convertPointToPixel(c.getLineWidth()),this.renderCellBackground(d,i,a,p);var g=p;if(0===r.index||1===r.cellFormat.rowSpan||r.cellFormat.rowSpan>1&&0===r.columnIndex)this.renderSingleBorder(c.color,i.x-a-p,i.y-o,i.x-a-p,i.y+i.height+s,p);else for(var u=0;u<r.ownerTable.childWidgets.length;u++){for(var m=r.ownerTable.childWidgets[u],f=void 0,v=0;v<m.childWidgets.length;v++){var y=m.childWidgets[v];if(y.columnIndex+y.cellFormat.columnSpan-1==r.columnIndex-1){f=y;break}if(m.childWidgets[v].columnIndex>=r.columnIndex&&m.childWidgets[v].previousWidget){f=m.childWidgets[v].previousWidget;break}}if(f&&f.columnIndex+f.cellFormat.columnSpan-1==r.columnIndex-1){var b=h?Pe.getCellLeftBorder(f):Pe.getCellRightBorder(f),w=b.lineWidth;if(f.y+f.height<r.y)continue;if(f.y<r.y&&f.y+f.height>r.y)this.renderSingleBorder(b.color,r.x-a-w,r.y-o,r.x-a-w,f.y+f.height+f.margin.bottom,w);else if(f.y===r.y||f.y>r.y&&f.y+f.height<r.y+r.height)this.renderSingleBorder(b.color,r.x-a-w,f.y-f.margin.top,r.x-a-w,f.y+f.height+f.margin.bottom,w);else if(f.y<r.y+r.height&&f.y+f.height>=r.y+r.height)this.renderSingleBorder(b.color,r.x-a-w,f.y-f.margin.top,r.x-a-w,f.y+f.height+s,w);else if(f.y>r.y+r.height)break}}if(r.updatedTopBorders&&r.updatedTopBorders.length>1)for(var C=i.x-i.margin.left-g/2,x=i.y-i.margin.top,F=0;F<r.updatedTopBorders.length;F++){var P=r.updatedTopBorders[F];"None"!==(c=P.border).lineStyle&&c.lineWidth<Pe.getCellTopBorder(r).lineWidth&&(c.lineWidth=Pe.getCellTopBorder(r).lineWidth),t.isNullOrUndefined(c)||(p=L.convertPointToPixel(c.getLineWidth()),this.renderSingleBorder(c.color,C,x+p/2,C+P.width,x+p/2,p),C+=P.width)}else{c=Pe.getCellTopBorder(r),p=L.convertPointToPixel(c.getLineWidth());this.renderSingleBorder(c.color,i.x-i.margin.left-g/2,i.y-i.margin.top+p/2,i.x+i.width+i.margin.right+0,i.y-i.margin.top+p/2,p)}var T=!1;T=h?0===r.cellIndex:r.cellIndex===r.ownerRow.childWidgets.length-1;for(var S=r.containerWidget.getPreviousRowSpannedCells(),I=!1,N=0;N<S.length;N++){var E=S[N];if(r.rowIndex<E.rowIndex+E.cellFormat.rowSpan&&r.columnIndex<E.columnIndex){I=!0;break}}!(r.ownerTable.tableFormat.cellSpacing>0||T)||!h&&r.columnIndex+r.cellFormat.columnSpan!==r.ownerTable.tableHolder.columns.length&&I||(c=h?Pe.getCellLeftBorder(r):Pe.getCellRightBorder(r),p=L.convertPointToPixel(c.getLineWidth()),this.renderSingleBorder(c.color,i.x+i.width+i.margin.right-p/2,i.y-o,i.x+i.width+i.margin.right-p/2,i.y+i.height+s,p));var H=r.ownerRow.nextWidget,W=!1,O=void 0;if(!t.isNullOrUndefined(H)){if(H.lastChild){var k=H.lastChild;O=k.columnIndex+k.cellFormat.columnSpan}var R=void 0;(R=H)instanceof Fe&&i.containerWidget instanceof Fe&&i.containerWidget.containerWidget instanceof xe&&(W=-1!==i.containerWidget.containerWidget.childWidgets.indexOf(R))}if(r.ownerTable.tableFormat.cellSpacing>0||r.ownerRow.rowIndex===r.ownerTable.childWidgets.length-1||r.cellFormat.rowSpan>1&&r.ownerRow.rowIndex+r.cellFormat.rowSpan>=r.ownerTable.childWidgets.length||!W||O&&H.childWidgets.length<r.ownerRow.childWidgets.length&&O<r.columnIndex+r.cellFormat.columnSpan){var B=r.cellFormat.borders.bottom;c=(t.isNullOrUndefined(B)||"Cleared"!==B.lineStyle)&&r.cellFormat.rowSpan>1&&r.ownerRow.rowIndex+r.cellFormat.rowSpan===r.ownerTable.childWidgets.length?r.getBorderBasedOnPriority(r.getBorderBasedOnPriority(r.cellFormat.borders.bottom,r.ownerRow.rowFormat.borders.bottom),r.ownerTable.tableFormat.borders.bottom):Pe.getCellBottomBorder(r),"Cleared"!==r.cellFormat.borders.top.lineStyle||"None"!==r.cellFormat.borders.bottom.lineStyle||t.isNullOrUndefined(r.nextWidget)||(c=r.cellFormat.borders.bottom),p=L.convertPointToPixel(c.getLineWidth()),this.renderSingleBorder(c.color,i.x-i.margin.left-g/2,i.y+i.height+s+p/2,i.x+i.width+i.margin.right,i.y+i.height+s+p/2,p)}c=n.getCellDiagonalUpBorder(r),(p=L.convertPointToPixel(c.getLineWidth()))>0&&this.renderSingleBorder(c.color,i.x-a,i.y+i.height+s,i.x+i.width+l,i.y-o,p),c=n.getCellDiagonalDownBorder(r),(p=L.convertPointToPixel(c.getLineWidth()))>0&&this.renderSingleBorder(c.color,i.x-a,i.y-o,i.x+i.width+l,i.y+i.height+s,p)},e.prototype.renderCellBackground=function(e,t,i,n){var r=t.cellFormat,o="#ffffff"===r.shading.backgroundColor?t.ownerTable.tableFormat.shading.backgroundColor:r.shading.backgroundColor,s=t.x-i-n,a=t.topMargin?L.convertPointToPixel(t.topMargin):0,l=t.y-a,d=t.width+i+t.margin.right-n;t.ownerRow.rowFormat.revisions.length>0&&(o="Insertion"===t.ownerRow.rowFormat.revisions[t.ownerRow.rowFormat.revisions.length-1].revisionType?"#e1f2fa":"#fce6f4"),this.pageContext.beginPath(),"empty"!==o&&(this.pageContext.fillStyle=L.getColor(o),this.pageContext.fillRect(this.getScaledValue(s,1),this.getScaledValue(l,2),this.getScaledValue(d),this.getScaledValue(e)),this.pageContext.closePath()),r.shading.hasValue("foregroundColor")&&"TextureNone"!==r.shading.textureStyle&&(this.pageContext.beginPath(),"empty"!==r.shading.foregroundColor&&(this.pageContext.fillStyle=L.getColor(r.shading.foregroundColor),this.pageContext.fillRect(this.getScaledValue(s,1),this.getScaledValue(l,2),this.getScaledValue(d),this.getScaledValue(e)),this.pageContext.closePath()))},e.prototype.renderSingleBorder=function(e,t,i,n,r,o){this.pageContext.beginPath(),this.pageContext.moveTo(this.getScaledValue(t,1),this.getScaledValue(i,2)),this.pageContext.lineTo(this.getScaledValue(n,1),this.getScaledValue(r,2)),this.pageContext.lineWidth=this.getScaledValue(o),this.pageContext.strokeStyle=L.getColor(e),o>0&&this.pageContext.stroke(),this.pageContext.closePath()},e.prototype.getScaledValue=function(e,i){return this.isPrinting?e:(t.isNullOrUndefined(i)&&(i=0),e*this.documentHelper.zoomFactor+(1===i?this.pageLeft:2===i?this.pageTop:0))},e.prototype.checkRevisionType=function(e){for(var t=[],i=e.revisions.length,n=0;n<i;n++){var r=e.revisions[n],o=this.documentHelper.authors.get(r.author);t.push({type:r.revisionType,color:o})}return t},e.prototype.getRevisionColor=function(e){if(1===e.length)return e[0].color;for(var t=0;t<e.length;t++)if("Deletion"===e[t].type||"MoveFrom"===e[t].type)return e[t].color},e.prototype.getRevisionType=function(e,t){if(0!==e.length)for(var i=0;i<e.length;i++){var n=void 0;if(t&&("Insertion"===e[i].type||"MoveTo"===e[i].type))return n=e[i],this.pageContext.fillStyle=L.getColor(n.color),e.splice(i,1),n;if(!t&&("Deletion"===e[i].type||"MoveFrom"===e[i].type))return n=e[i],this.pageContext.fillStyle=L.getColor(n.color),e.splice(i,1),n}},e.prototype.destroy=function(){this.documentHelper=void 0,t.isNullOrUndefined(this.pageCanvasIn)||(this.pageCanvasIn.innerHTML=""),this.pageCanvasIn=void 0},e}(),J=function(){function e(e){this.paragraphMarkInfo={},this.documentHelper=e,t.isNullOrUndefined(e)||(this.context=e.containerContext)}return Object.defineProperty(e.prototype,"paragraphMark",{get:function(){return"¶"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineBreakMark",{get:function(){return"↲"},enumerable:!0,configurable:!0}),e.prototype.getEnSpaceCharacter=function(){return String.fromCharCode(8194)},e.prototype.repeatChar=function(e,t){for(var i="",n=0;n<t;n++)i+=e;return i},e.prototype.getParagraphMarkWidth=function(e){return this.getParagraphMarkSize(e).Width},e.prototype.getParagraphMarkSize=function(e){var t=this.getFormatText(e);if(this.paragraphMarkInfo[t])return this.paragraphMarkInfo[t];var i=this.getWidth(this.paragraphMark,e),n=this.getHeight(e),r={Width:i,Height:n.Height,BaselineOffset:n.BaselineOffset};return this.paragraphMarkInfo[t]=r},e.prototype.getTextSize=function(e,t){var i=0,n=t.bidi||this.isRTLText(e.text),r=this.setText(e.text,n,t.bdo);i=this.getWidth(r,t),e.width=i;var o=this.getHeight(t);return e.height=o.Height,e.baselineOffset=o.BaselineOffset," "===e.text[e.text.length-1]&&(i=this.getWidth(L.trimEnd(e.text),t)),e.trimEndWidth=i,i},e.prototype.getHeight=function(e){var i=this.getFormatText(e);if(!t.isNullOrUndefined(this.documentHelper.heightInfoCollection[i]))return this.documentHelper.heightInfoCollection[i];var n=this.getHeightInternal(e);return this.documentHelper.heightInfoCollection[i]=n,n},e.prototype.getFormatText=function(e){var t=e.fontFamily.toLocaleLowerCase();return t+=";"+e.fontSize,e.bold&&(t+=";bold"),e.italic&&(t+=";italic"),t},e.prototype.getHeightInternal=function(e){var t=0,i=0,n=document.createElement("span");n.innerText="m",this.applyStyle(n,e);var r=document.createElement("div");r.setAttribute("style","display:inline-block;position:absolute;");var o=document.createElement("div");o.setAttribute("style","display:inline-block;width: 1px; height: 0px;vertical-align: baseline;"),r.appendChild(n),r.appendChild(o),document.body.appendChild(r),t=n.offsetHeight;var s=n.offsetTop;return i=o.offsetTop-s,document.body.removeChild(r),{Height:t,BaselineOffset:i}},e.prototype.measureTextExcludingSpaceAtEnd=function(e,t){return this.getWidth(L.trimEnd(e),t)},e.prototype.getWidth=function(e,t){e.match("\v")&&e.replace("\v",this.lineBreakMark);var i="",n="",r="",o=t.fontSize;return i=t.bold?"bold":"",n=t.italic?"italic":"",r=t.fontFamily,o=0===o?.5:o/("Normal"===t.baselineAlignment?1:1.5),this.context.font=i+" "+n+" "+o+"pt "+r,t.allCaps&&(e=e.toUpperCase()),this.context.measureText(e).width},e.prototype.setText=function(e,i,n,r){if(t.isNullOrUndefined(r)&&(r=!1),0===e.length)return"";var o=i;if(!o&&"RTL"===n||o&&"LTR"===n)e=L.reverseString(e);else if(r&&o&&L.endsWith(e)){var s=e.length-L.trimEnd(e).length;e=L.addSpace(s)+L.trimEnd(e)}return e},e.prototype.applyStyle=function(e,i){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)){var n="white-space:nowrap;";""!==i.fontFamily&&(n+="font-family:"+i.fontFamily+";");var r=i.fontSize;r<=.5&&(r=.5),n+="font-size:"+r.toString()+"pt;",i.bold&&(n+="font-weight:bold;"),i.italic&&(n+="font-style:italic;"),e.setAttribute("style",n)}},e.prototype.measureText=function(e,t){var i=this.getWidth(e,t),n=this.getHeight(t);return{Width:i,Height:n.Height,BaselineOffset:n.BaselineOffset}},e.prototype.updateTextSize=function(e,t){var i=new k(void 0),n=e.listLevel.characterFormat,r=t.characterFormat;i.fontSize=11===n.fontSize?r.fontSize:n.fontSize,i.fontFamily="Verdana"===n.fontFamily?r.fontFamily:n.fontFamily;var o="",s="",a="Normal"===n.baselineAlignment?r.baselineAlignment:n.baselineAlignment;o=n.hasValue("bold")?n.bold?"bold":"":r.bold?"bold":"",s=n.hasValue("italic")?n.italic?"italic":"":r.italic?"italic":"",i.baselineAlignment=a,o&&(i.bold=!0),s&&(i.italic=!0);var l=i.bidi||this.isRTLText(e.text),d=this.setText(e.text,l,i.bdo);e.width=this.getWidth(d,i);var h=this.getHeight(i);e.height=h.Height,e.baselineOffset=h.BaselineOffset},e.prototype.containsSpecialCharAlone=function(e){for(var t="*|.:[]{}-`;()@&$#%!~? '",i=0;i<e.length;i++)if(-1===t.indexOf(e.charAt(i)))return!1;return!0},e.prototype.containsNumberAlone=function(e){if(""===e)return!1;for(var t=0;t<e.length;t++)if(-1==="0123456789".indexOf(e.charAt(t)))return!1;return!0},e.prototype.inverseCharacter=function(e){switch(e){case"(":return")";case")":return"(";case"<":return">";case">":return"<";case"{":return"}";case"}":return"{";case"[":return"]";case"]":return"[";default:return e}},e.prototype.containsSpecialChar=function(e){for(var t="*|.:[]{}-`;()@&$#%!~? ",i=0;i<e.length;i++)if(-1!==t.indexOf(e.charAt(i)))return!0;return!1},e.prototype.isRTLText=function(e){var i=!1;if(!t.isNullOrUndefined(e))for(var n=0;n<e.length;n++){var r=e[n];if(r>=""&&r<=""||r>=""&&r<="ۿ"||r>="ݐ"&&r<="ݿ"||r>="ࢠ"&&r<="ࣿ"||r>="ﭐ"&&r<="﷿"||r>="ﹰ"&&r<="\ufeff"||r>="ꦀ"&&r<="꧟"||r>="܀"&&r<="ݏ"||r>="ހ"&&r<=""||r>="ࡀ"&&r<=""||r>="߀"&&r<="߿"||r>="ࠀ"&&r<=""||r>="ⴰ"&&r<="⵿"){i=!0;break}}return i},e.prototype.getRtlLanguage=function(e){return t.isNullOrUndefined(e)||""===e?{isRtl:!1,id:0}:e>=""&&e<=""?{isRtl:!0,id:1}:e>=""&&e<="ۿ"||e>="ݐ"&&e<="ݿ"||e>="ࢠ"&&e<="ࣿ"||e>="ﭐ"&&e<="﷿"||e>="ﹰ"&&e<="\ufeff"?{isRtl:!0,id:2}:e>="ꦀ"&&e<="꧟"?{isRtl:!0,id:3}:e>="܀"&&e<="ݏ"?{isRtl:!0,id:4}:e>="ހ"&&e<=""?{isRtl:!0,id:5}:e>="ࡀ"&&e<=""?{isRtl:!0,id:6}:e>="߀"&&e<="߿"?{isRtl:!0,id:7}:e>="ࠀ"&&e<=""?{isRtl:!0,id:8}:e>="ⴰ"&&e<="⵿"?{isRtl:!0,id:9}:{isRtl:!1,id:0}},e.prototype.destroy=function(){this.documentHelper=void 0,this.context=void 0,this.paragraphMarkInfo={},this.paragraphMarkInfo=void 0},e}(),Z=function(){function e(e){var i=this;this.onMouseWheelInternal=function(e){if(!0===e.ctrlKey&&(e.preventDefault(),e.pageX-i.documentHelper.viewerContainer.offsetLeft<i.documentHelper.pageContainer.offsetWidth)){var n=navigator.userAgent.match("Firefox")?e.detail<0:t.Browser.isIE?e.wheelDelta>0:e.deltaY<0,r=i.documentHelper.zoomFactor;n?r<=4.9?r+=.1:r=5:r>=.2?r-=.1:r=.1,i.documentHelper.zoomFactor=r}},this.documentHelper=e}return e.prototype.setZoomFactor=function(){this.onZoomFactorChanged(),t.isNullOrUndefined(this.documentHelper.selection)||this.documentHelper.selection.updateCaretPosition(),this.documentHelper.updateTouchMarkPosition(),t.isNullOrUndefined(this.documentHelper.owner.imageResizerModule)||this.documentHelper.owner.imageResizerModule.updateImageResizerPosition(),this.documentHelper.owner.fireZoomFactorChange()},Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.onZoomFactorChanged=function(){this.documentHelper.zoomFactor>5?this.documentHelper.zoomFactor=5:this.documentHelper.zoomFactor<.1&&(this.documentHelper.zoomFactor=.1),this.zoom()},e.prototype.zoom=function(){var e=this.viewer;this.documentHelper.clearContent(),e.handleZoom(),this.documentHelper.updateFocus()},e}(),Q=function(){function e(e){var i=this;this.show=function(){var e=new t.L10n("documenteditor",i.documentHelper.owner.defaultLocale);e.setLocale(i.documentHelper.owner.locale),i.target||i.initUserDialog(e,i.documentHelper.owner.enableRtl),i.documentHelper.dialog.header=e.getConstant("Add Users"),i.documentHelper.dialog.height="auto",i.documentHelper.dialog.width="auto",i.documentHelper.dialog.content=i.target,i.documentHelper.dialog.beforeOpen=i.loadUserDetails,i.documentHelper.dialog.close=i.documentHelper.updateFocus,i.documentHelper.dialog.buttons=[{click:i.okButtonClick,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat",isPrimary:!0}},{click:i.hideDialog,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat"}},{click:i.deleteButtonClick,buttonModel:{content:e.getConstant("Delete"),cssClass:"e-flat e-user-delete"}}],i.documentHelper.dialog.dataBind(),i.documentHelper.dialog.show()},this.loadUserDetails=function(){i.documentHelper.restrictEditingPane.addedUser.dataSource=i.documentHelper.userCollection.slice(),i.documentHelper.restrictEditingPane.addedUser.dataBind()},this.okButtonClick=function(){i.documentHelper.restrictEditingPane.isAddUser=!0,i.documentHelper.restrictEditingPane.showStopProtectionPane(!1),i.documentHelper.restrictEditingPane.loadPaneValue(),i.documentHelper.restrictEditingPane.isAddUser=!1,i.documentHelper.dialog.hide()},this.hideDialog=function(){i.textBoxInput.value="",i.documentHelper.dialog.hide()},this.onKeyUpOnDisplayBox=function(){i.addButton.disabled=""===i.textBoxInput.value},this.addButtonClick=function(){i.validateUserName(i.textBoxInput.value)?(-1===i.documentHelper.userCollection.indexOf(i.textBoxInput.value)&&i.documentHelper.userCollection.push(i.textBoxInput.value),i.userList.dataSource=i.documentHelper.userCollection.slice(),i.userList.dataBind(),i.textBoxInput.value=""):n.DialogUtility.alert("Invalid user name")},this.deleteButtonClick=function(){var e=i.documentHelper.userCollection.indexOf(i.userList.getSelectedItems().text);e>-1&&(i.documentHelper.userCollection.splice(e,1),i.userList.dataSource=i.documentHelper.userCollection.slice(),i.userList.dataBind())},this.documentHelper=e}return e.prototype.initUserDialog=function(e,i){var n=this.documentHelper.owner.containerId+"_addUser";this.target=t.createElement("div",{id:n,className:"e-de-user-dlg"});var s=e.getConstant("Enter User"),a=t.createElement("div",{innerHTML:s,className:"e-bookmark-dlgfields"});this.target.appendChild(a);var l=t.createElement("div",{className:"e-de-user-dlg-common"});this.target.appendChild(l);var d=t.createElement("div",{className:"e-de-user-dlg-list",styles:"display:inline-flex"});l.appendChild(d),i&&d.classList.add("e-de-rtl");var h=t.createElement("div",{className:"e-de-user-dlg-textboxdiv"});d.appendChild(h),this.textBoxInput=t.createElement("input",{className:"e-input e-de-user-dlg-textbox-input",id:"bookmark_text_box",attrs:{autofocus:"true"}}),this.textBoxInput.setAttribute("type","text"),h.appendChild(this.textBoxInput),this.textBoxInput.addEventListener("keyup",this.onKeyUpOnDisplayBox);var c=t.createElement("button",{innerHTML:e.getConstant("Add"),id:"add",attrs:{type:"button"}});d.appendChild(c),c.addEventListener("click",this.addButtonClick),this.addButton=new r.Button({cssClass:"e-de-user-add-btn"}),this.addButton.disabled=!0,this.addButton.appendTo(c),this.addButton.addEventListener("click",this.addButtonClick);var p=t.createElement("div");l.appendChild(p);var g=t.createElement("div",{innerHTML:e.getConstant("Users"),className:"e-de-user-dlg-user"});p.appendChild(g);var u=t.createElement("div",{id:"user_listView"});p.appendChild(u),this.userList=new o.ListView({cssClass:"e-de-user-listview"}),this.userList.appendTo(u)},e.prototype.validateUserName=function(e){if(-1===e.indexOf("@"))return!1;var t=e.split("@")[1];if(-1===t.indexOf("."))return!1;var i=t.split("."),n=i[1];return!(i.length>2)&&!(n.length>4||n.length<2)},e}(),$=function(){function e(e,i){var r=this;this.show=function(){r.localeValue=new t.L10n("documenteditor",r.viewer.owner.defaultLocale),r.localeValue.setLocale(r.viewer.owner.locale),r.target||r.initDialog(r.localeValue),r.documentHelper.dialog.header=r.localeValue.getConstant("Start Enforcing Protection"),r.documentHelper.dialog.height="auto",r.documentHelper.dialog.content=r.target,r.documentHelper.dialog.width="auto",r.documentHelper.dialog.buttons=[{click:r.okButtonClick,buttonModel:{content:r.localeValue.getConstant("Ok"),cssClass:"e-flat",isPrimary:!0}},{click:r.hideDialog,buttonModel:{content:r.localeValue.getConstant("Cancel"),cssClass:"e-flat"}}],r.passwordTextBox.value="",r.confirmPasswordTextBox.value="",r.documentHelper.dialog.show()},this.hideDialog=function(){r.passwordTextBox.value="",r.confirmPasswordTextBox.value="",r.documentHelper.dialog.hide()},this.okButtonClick=function(){r.passwordTextBox.value!==r.confirmPasswordTextBox.value?n.DialogUtility.alert(r.localeValue.getConstant("Password Mismatch")):(r.password=r.passwordTextBox.value,r.viewer.owner.editor.addProtection(r.password,r.owner.protectionType))},this.documentHelper=e,this.owner=i}return Object.defineProperty(e.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.initDialog=function(e){var i=this.viewer.owner.containerId+"_enforce_protection";this.target=t.createElement("div",{id:i,className:"e-de-enforce"});var n=t.createElement("div"),r=t.createElement("div",{className:"e-de-enforce-dlg-title",innerHTML:e.getConstant("Enter new password")});this.passwordTextBox=t.createElement("input",{attrs:{type:"password",autofocus:"true"},id:this.viewer.owner.containerId+"_display_text",className:"e-input e-de-enforce-dlg-input"}),n.appendChild(r),n.appendChild(this.passwordTextBox);var o=t.createElement("div",{className:"e-de-enforce-dlg-title",innerHTML:e.getConstant("Reenter new password to confirm")});this.confirmPasswordTextBox=t.createElement("input",{attrs:{type:"password"},id:this.viewer.owner.containerId+"_url_text",className:"e-input e-de-enforce-dlg-input"}),n.appendChild(o),n.appendChild(this.confirmPasswordTextBox),this.target.appendChild(n)},e}(),ee=function(){function e(e,i){var n=this;this.show=function(){n.localObj=new t.L10n("documenteditor",n.viewer.owner.defaultLocale),n.localObj.setLocale(n.viewer.owner.locale),n.target||n.initDialog(n.localObj),n.documentHelper.dialog.header="Unprotect Document",n.documentHelper.dialog.height="auto",n.documentHelper.dialog.width="auto",n.documentHelper.dialog.content=n.target,n.documentHelper.dialog.buttons=[{click:n.okButtonClick,buttonModel:{content:n.localObj.getConstant("Ok"),cssClass:"e-flat",isPrimary:!0}},{click:n.hideDialog,buttonModel:{content:n.localObj.getConstant("Cancel"),cssClass:"e-flat"}}],n.documentHelper.dialog.dataBind(),n.passwordTextBox.value="",n.documentHelper.dialog.show()},this.okButtonClick=function(){var e=n.passwordTextBox.value;""!==e&&n.viewer.owner.editor.stopProtection(e)},this.hideDialog=function(){n.passwordTextBox.value="",n.documentHelper.dialog.hide()},this.documentHelper=e,this.owner=i}return Object.defineProperty(e.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.initDialog=function(e){var i=this.viewer.owner.containerId+"_enforce_protection";this.target=t.createElement("div",{id:i,className:"e-de-enforce"});var n=t.createElement("div"),r=t.createElement("div",{className:"e-de-unprotect-dlg-title",innerHTML:e.getConstant("Password")});this.passwordTextBox=t.createElement("input",{attrs:{type:"password"},id:this.viewer.owner.containerId+"_display_text",className:"e-input e-de-enforce-dlg-input"}),n.appendChild(r),n.appendChild(this.passwordTextBox),this.target.appendChild(n)},e}(),te=function(){function e(e){var t=this;this.addRemove=!0,this.protectionType="ReadOnly",this.restrictFormatting=!1,this.isShowRestrictPane=!1,this.isAddUser=!1,this.usersCollection=["Everyone"],this.closePane=function(){t.restrictPane.style.display="none",t.documentHelper.updateViewerSize()},this.showAllRegion=function(){t.documentHelper.selection.showAllEditingRegion()},this.documentHelper=e,this.addUserDialog=new Q(e),this.enforceProtectionDialog=new $(e,this),this.unProtectDialog=new ee(e,this),this.base64=new B}return Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.showHideRestrictPane=function(e){this.restrictPane||(this.localObj=new t.L10n("documenteditor",this.viewer.owner.defaultLocale),this.localObj.setLocale(this.viewer.owner.locale),this.initPane(this.localObj)),e?(this.restrictPane.style.display="block",this.isShowRestrictPane=!0,this.documentHelper.selection.isHighlightEditRegion=!0,this.wireEvents(),this.documentHelper.updateViewerSize(),this.loadPaneValue()):(this.closePane(),this.documentHelper.updateFocus())},e.prototype.initPane=function(e){this.restrictPane=t.createElement("div",{className:"e-de-restrict-pane",styles:"display:none"});var i=t.createElement("div",{className:"e-de-rp-whole-header"}),n=t.createElement("div",{styles:"width:75%",innerHTML:e.getConstant("Restrict Editing"),className:"e-de-rp-header"});this.closeButton=t.createElement("button",{className:"e-de-rp-close-icon e-de-close-icon e-btn e-flat e-icon-btn",id:"close",attrs:{type:"button"}}),i.appendChild(this.closeButton),i.appendChild(n);var r=t.createElement("span",{className:"e-de-op-close-icon e-de-close-icon e-btn-icon e-icons"});this.closeButton.appendChild(r),this.restrictPane.appendChild(i),this.initRestrictEditingPane(e),this.documentHelper.optionsPaneContainer.setAttribute("style","display:inline-flex;"),this.documentHelper.optionsPaneContainer.insertBefore(this.restrictPane,this.documentHelper.viewerContainer)},e.prototype.initRestrictEditingPane=function(e){this.restrictPaneWholeDiv=t.createElement("div");var i=t.createElement("div",{className:"e-de-rp-sub-div"}),n=t.createElement("div",{innerHTML:e.getConstant("Formatting restrictions"),className:"e-de-rp-format"});i.appendChild(n);var a=t.createElement("input",{attrs:{type:"checkbox"},id:this.viewer.owner.containerId+"_allowFormat"});i.appendChild(a),this.allowFormat=this.createCheckBox(e.getConstant("Allow formatting"),a),this.restrictPaneWholeDiv.appendChild(i);var l=t.createElement("div",{className:"e-de-rp-sub-div"}),d=t.createElement("div",{innerHTML:e.getConstant("Editing restrictions"),className:"e-de-rp-format"});l.appendChild(d);t.createElement("input",{attrs:{type:"checkbox"},id:this.viewer.owner.containerId+"_readOnly"});var h=t.createElement("input",{id:this.viewer.owner.containerId+"_readOnly",className:"e-prop-font-style"});l.appendChild(h);var c=["Read only","Filling in forms"];this.protectionTypeDrop=new s.DropDownList({dataSource:c,cssClass:"e-de-prop-dropdown"}),this.protectionTypeDrop.value="Read only",this.protectionTypeDrop.appendTo(h),this.restrictPaneWholeDiv.appendChild(l),this.userWholeDiv=t.createElement("div",{className:"e-de-rp-sub-div"});var p=t.createElement("div",{innerHTML:e.getConstant("Exceptions Optional"),className:"e-de-rp-format"});this.userWholeDiv.appendChild(p);var g=t.createElement("div",{innerHTML:e.getConstant("Select Part Of Document And User"),styles:"margin-bottom:8px;",className:"e-de-rp-sub-content-div"});this.userWholeDiv.appendChild(g);var u=t.createElement("div",{className:"e-de-rp-user"});this.userWholeDiv.appendChild(u),this.addedUser=new o.ListView({cssClass:"e-de-user-listView",dataSource:[{text:"Everyone"}],showCheckBox:!0,select:this.selectHandler.bind(this)}),this.addedUser.appendTo(u),this.addUser=t.createElement("button",{id:this.viewer.owner.containerId+"_addUser",className:"e-btn e-primary e-flat",innerHTML:e.getConstant("More users")+"...",styles:"margin-top: 3px",attrs:{type:"button"}}),this.userWholeDiv.appendChild(this.addUser),this.restrictPaneWholeDiv.appendChild(this.userWholeDiv);var m=t.createElement("div",{className:"e-de-rp-enforce"});this.restrictPaneWholeDiv.appendChild(m),this.enforceProtection=t.createElement("button",{id:this.viewer.owner.containerId+"_addUser",innerHTML:e.getConstant("Enforcing Protection"),className:"e-btn e-de-rp-btn-enforce",attrs:{type:"button"}}),m.appendChild(this.enforceProtection),this.restrictPane.appendChild(this.restrictPaneWholeDiv),this.stopProtectionDiv=t.createElement("div",{styles:"display:none"});var f=t.createElement("div",{innerHTML:e.getConstant("Your permissions"),className:"e-de-rp-stop-div1"});this.stopProtectionDiv.appendChild(f);var v=e.getConstant("Protected Document");this.contentDiv1=t.createElement("div",{innerHTML:v,className:"e-de-rp-stop-div2"}),this.stopProtectionDiv.appendChild(this.contentDiv1);var y=t.createElement("div",{innerHTML:e.getConstant("You may format text only with certain styles"),className:"e-de-rp-stop-div3"});this.stopProtectionDiv.appendChild(y),this.stopReadOnlyOptions=t.createElement("div"),this.stopProtectionDiv.appendChild(this.stopReadOnlyOptions);var b=t.createElement("div",{className:"e-de-rp-enforce-nav"}),w=t.createElement("button",{innerHTML:e.getConstant("Find Next Region I Can Edit"),className:"e-btn e-de-rp-nav-btn",attrs:{type:"button"}});b.appendChild(w),w.addEventListener("click",this.navigateNextRegion.bind(this)),this.stopReadOnlyOptions.appendChild(b);var C=t.createElement("div",{className:"e-de-rp-enforce-nav"}),x=t.createElement("button",{innerHTML:e.getConstant("Show All Regions I Can Edit"),className:"e-btn e-de-rp-nav-btn",attrs:{type:"button"}});C.appendChild(x),x.addEventListener("click",this.showAllRegion),this.stopReadOnlyOptions.appendChild(C);var F=t.createElement("div",{className:"e-de-rp-enforce-nav e-de-rp-nav-lbl"}),P=t.createElement("input",{attrs:{type:"checkbox"},className:"e-btn e-de-rp-nav-btn"});F.appendChild(P),this.stopReadOnlyOptions.appendChild(F),this.highlightCheckBox=new r.CheckBox({label:e.getConstant("Highlight the regions I can edit")},P);var T=t.createElement("div",{className:"e-de-rp-enforce"});this.stopProtection=t.createElement("button",{innerHTML:e.getConstant("Stop Protection"),className:"e-btn e-de-rp-btn-stop-enforce",attrs:{type:"button"}}),T.appendChild(this.stopProtection),this.stopProtectionDiv.appendChild(T),this.restrictPane.appendChild(this.stopProtectionDiv)},e.prototype.showStopProtectionPane=function(e){e?(this.stopProtectionDiv.style.display="block",this.restrictPaneWholeDiv.style.display="none"):(this.stopProtectionDiv.style.display="none",this.restrictPaneWholeDiv.style.display="block"),"ReadOnly"===this.documentHelper.protectionType?this.stopReadOnlyOptions.style.display="block":this.stopReadOnlyOptions.style.display="none"},e.prototype.wireEvents=function(){this.addUser.addEventListener("click",this.addUserDialog.show),this.enforceProtection.addEventListener("click",this.protectDocument.bind(this)),this.stopProtection.addEventListener("click",this.stopProtectionTriggered.bind(this)),this.closeButton.addEventListener("click",this.closePane),this.allowFormat.addEventListener("change",this.enableFormatting.bind(this)),this.protectionTypeDrop.addEventListener("change",this.protectionTypeDropChanges.bind(this)),this.highlightCheckBox.addEventListener("change",this.highlightClicked.bind(this))},e.prototype.enableFormatting=function(e){this.restrictFormatting=!e.checked},e.prototype.stopProtectionTriggered=function(e){if((t.isNullOrUndefined(this.documentHelper.saltValue)||""===this.documentHelper.saltValue)&&(t.isNullOrUndefined(this.documentHelper.hashValue)||""===this.documentHelper.hashValue))return void this.documentHelper.owner.editor.unProtectDocument();this.unProtectDialog.show()},e.prototype.protectionTypeDropChanges=function(e){"Read only"===e.value?(this.protectionType="ReadOnly",this.userWholeDiv.style.display="block",this.enforceProtection.style.marginLeft="0px"):"Filling in forms"===e.value?(this.protectionType="FormFieldsOnly",this.userWholeDiv.style.display="none",this.enforceProtection.style.marginLeft="8px"):(this.protectionType="NoProtection",this.addedUser.uncheckAllItems(),this.viewer.owner.editor.removeAllEditRestrictions()),"Filling in forms"===e.value?this.contentDiv1.innerHTML=this.localObj.getConstant("FormFieldsOnly"):this.contentDiv1.innerHTML=this.localObj.getConstant("Protected Document")},e.prototype.selectHandler=function(e){e.isChecked?(this.viewer.owner.editor.insertEditRangeElement(e.text),e.event.target.classList.add("e-check")):this.viewer.owner.editor.removeUserRestrictions(e.text)},e.prototype.highlightClicked=function(e){this.documentHelper.selection.isHighlightEditRegion=e.checked},e.prototype.protectDocument=function(){this.enforceProtectionDialog.show()},e.prototype.createCheckBox=function(e,t){var i=new r.CheckBox({label:e});return i.appendTo(t),i},e.prototype.loadPaneValue=function(){this.allowFormat.checked=!this.documentHelper.restrictFormatting,"ReadOnly"===this.documentHelper.protectionType?this.protectionTypeDrop.value="Read only":"FormFieldsOnly"===this.documentHelper.protectionType&&(this.protectionTypeDrop.value="Filling in forms"),this.highlightCheckBox.checked=!0,this.addedUser.enablePersistence=!0,this.addedUser.dataSource=this.usersCollection.slice(),this.addedUser.dataBind(),this.showStopProtectionPane(this.documentHelper.isDocumentProtected)},e.prototype.navigateNextRegion=function(){this.documentHelper.selection.navigateToNextEditingRegion()},e.prototype.addUserCollection=function(){if(this.documentHelper.selection&&this.documentHelper.selection.editRangeCollection.length>0)for(var e=0;e<this.documentHelper.selection.editRangeCollection.length;e++){var t=this.documentHelper.selection.editRangeCollection[e];""!==t.user&&-1===this.usersCollection.indexOf(t.user)&&this.usersCollection.push(t.user),""!==t.group&&-1===this.usersCollection.indexOf(t.group)&&this.usersCollection.push(t.group)}this.addedUser.dataSource=this.documentHelper.userCollection.slice(),this.addedUser.dataBind()},e.prototype.updateUserInformation=function(){if(this.addedUser.uncheckAllItems(),this.documentHelper.selection.checkSelectionIsAtEditRegion){var e=this.documentHelper.selection.getEditRangeStartElement();if(e){var t=this.addedUser.dataSource.indexOf(e.user);if(t>-1&&(i=this.addedUser.element.querySelectorAll("li")[t]).querySelector(".e-icons").classList.add("e-check"),(t=this.addedUser.dataSource.indexOf(e.group))>-1){var i=this.addedUser.element.querySelectorAll("li")[t];i.querySelector(".e-icons").classList.add("e-check")}}}},e}(),ie=function(){function e(e){var i=this;this.applyTextFormFieldValue=function(){i.owner.editor.updateFormField(i.formField,i.textBoxInstance.value),i.owner.trigger(y,{fieldName:i.formField.formFieldData.name,value:i.formField.resultText,isCanceled:!1}),i.hidePopup()},this.applyNumberFormFieldValue=function(){i.owner.editor.updateFormField(i.formField,i.numberInput.value.toString()),i.owner.trigger(y,{fieldName:i.formField.formFieldData.name,value:i.formField.resultText,isCanceled:!1}),i.hidePopup()},this.applyDateFormFieldValue=function(){t.isNullOrUndefined(i.datePickerInstance.value)||(i.owner.editor.updateFormField(i.formField,i.dateInput.value),i.owner.trigger(y,{fieldName:i.formField.formFieldData.name,value:i.formField.resultText,isCanceled:!1}),i.hidePopup())},this.applyDropDownFormFieldValue=function(){i.owner.editor.updateFormField(i.formField,i.ddlInstance.index),i.owner.trigger(y,{fieldName:i.formField.formFieldData.name,value:i.formField.formFieldData.selectedIndex,isCanceled:!1}),i.hidePopup()},this.enableDisableDatePickerOkButton=function(e){e.isInteracted&&(i.dataPickerOkButton.disabled=!1)},this.closeButton=function(){var e=i.formField;i.hidePopup();var t={fieldName:e.formFieldData.name};e.formFieldData instanceof Ee?t.value=e.resultText:e.formFieldData instanceof He?t.value=e.formFieldData.checked:t.value=e.formFieldData.selectedIndex,t.isCanceled=!0,i.owner.trigger(y,t)},this.hidePopup=function(){i.owner.documentHelper.isFormFilling=!1,i.formField=void 0,i.target&&(i.target.style.display="none"),i.popupObject&&(i.popupObject.hide(),i.popupObject.destroy(),i.popupObject=void 0)},this.owner=e}return e.prototype.initPopup=function(){var e=t.createElement("div",{className:"e-de-form-popup"});this.textBoxContainer=this.initTextBoxInput(),e.appendChild(this.textBoxContainer),e.appendChild(this.initNumericTextBox()),e.appendChild(this.initDatePicker()),e.appendChild(this.initDropDownList()),this.target=e,this.owner.documentHelper.viewerContainer.appendChild(e)},e.prototype.initTextBoxInput=function(){var e=t.createElement("div",{className:"e-de-txt-field"}),i=t.createElement("input",{className:"e-de-txt-form"}),n=new a.TextBox;this.textBoxInput=i;var o=t.createElement("div",{className:"e-de-cmt-action-button"}),s=t.createElement("button"),l=t.createElement("button");return s.addEventListener("click",this.applyTextFormFieldValue),l.addEventListener("click",this.closeButton),e.appendChild(i),o.appendChild(s),o.appendChild(l),e.appendChild(o),n.appendTo(i),new r.Button({cssClass:"e-de-save",iconCss:"e-de-save-icon"},s),new r.Button({cssClass:"e-de-cancel",iconCss:"e-de-cancel-icon"},l),this.textBoxInstance=n,e},e.prototype.initNumericTextBox=function(){var e=t.createElement("div",{className:"e-de-num-field"}),i=t.createElement("input",{className:"e-de-txt-form"}),n=new a.NumericTextBox;this.numberInput=i;var o=t.createElement("div",{className:"e-de-cmt-action-button"}),s=t.createElement("button"),l=t.createElement("button");return s.addEventListener("click",this.applyNumberFormFieldValue),l.addEventListener("click",this.closeButton),e.appendChild(i),o.appendChild(s),o.appendChild(l),e.appendChild(o),n.appendTo(i),new r.Button({cssClass:"e-de-save",iconCss:"e-de-save-icon"},s),new r.Button({cssClass:"e-de-cancel",iconCss:"e-de-cancel-icon"},l),this.numericTextBoxInstance=n,e},e.prototype.initDatePicker=function(){var e=t.createElement("div",{className:"e-de-date-field"}),i=t.createElement("input",{className:"e-de-txt-form"}),n=new l.DateTimePicker({allowEdit:!1,strictMode:!0,change:this.enableDisableDatePickerOkButton});this.dateInput=i;var o=t.createElement("div",{className:"e-de-cmt-action-button"}),s=t.createElement("button"),a=t.createElement("button");return s.addEventListener("click",this.applyDateFormFieldValue),a.addEventListener("click",this.closeButton),e.appendChild(i),o.appendChild(s),o.appendChild(a),e.appendChild(o),n.appendTo(i),this.dataPickerOkButton=new r.Button({cssClass:"e-de-save",iconCss:"e-de-save-icon"},s),new r.Button({cssClass:"e-de-cancel",iconCss:"e-de-cancel-icon"},a),this.datePickerInstance=n,e},e.prototype.initDropDownList=function(){var e=t.createElement("div",{className:"e-de-ddl-field"}),i=t.createElement("input",{className:"e-de-txt-form"}),n=new s.DropDownList;this.dropDownInput=i;var o=t.createElement("div",{className:"e-de-cmt-action-button"}),a=t.createElement("button"),l=t.createElement("button");return a.addEventListener("click",this.applyDropDownFormFieldValue),l.addEventListener("click",this.closeButton),e.appendChild(i),o.appendChild(a),o.appendChild(l),e.appendChild(o),n.appendTo(i),new r.Button({cssClass:"e-de-save",iconCss:"e-de-save-icon"},a),new r.Button({cssClass:"e-de-cancel",iconCss:"e-de-cancel-icon"},l),this.ddlInstance=n,e},e.prototype.showPopUp=function(e){var i=this;if(e){this.formField=e,this.owner.selection.selectField(),t.isNullOrUndefined(this.target)&&this.initPopup(),t.classList(this.target,[],["e-de-txt-form","e-de-num-form","e-de-date-form","e-de-ddl-form"]);var r=e.formFieldData;if(r){if(r instanceof Ee){var o=e.resultText,s=new RegExp(this.owner.documentHelper.textHelper.getEnSpaceCharacter(),"gi");""===o.replace(s,"")&&(o="");var a,l=r.maxLength,d=r.type;if(o=o||"","Text"===d)t.classList(this.target,["e-de-txt-form"],[]),a=this.textBoxInput,this.textBoxInstance.value=o;else if("Number"===r.type)t.classList(this.target,["e-de-num-form"],[]),a=this.numberInput,this.numericTextBoxInstance.format=r.format,this.numericTextBoxInstance.value=parseFloat(o.replace(/,/gi,""));else if("Date"===d){t.classList(this.target,["e-de-date-form"],[]),a=this.dateInput;var h=r.format;-1!==h.indexOf("am/pm")&&(h=h.replace(/am\/pm/gi,"a")),this.datePickerInstance.format=h,this.datePickerInstance.value=new Date(o),this.dataPickerOkButton.disabled=!0}a&&(l>0?a.maxLength=l:a.removeAttribute("maxlength"),setTimeout(function(){a.focus()}))}else r instanceof We&&(t.classList(this.target,["e-de-ddl-form"],[]),this.ddlInstance.dataSource=r.dropdownItems,this.ddlInstance.index=r.selectedIndex,setTimeout(function(){i.ddlInstance.showPopup()}));var c=this.owner.selection.getLeftInternal(e.line,e,0),p=e.line.height*this.owner.documentHelper.zoomFactor,g=this.owner.selection.getTooltipPosition(e.line,c,this.target,!0);this.popupObject||(this.popupObject=new n.Popup(this.target,{height:"auto",width:"auto",relateTo:this.owner.documentHelper.viewerContainer.parentElement,position:{X:g.x,Y:g.y+p}})),this.target.style.display="block",this.popupObject.show()}this.owner.documentHelper.isFormFilling=!0}},e}(),ne=function(){function e(e,i){this.users=[],this.enableButtons=!0,this.viewTypeitems=[],this.sortedRevisions=[],this.noChangesVisibleInternal=!0,this.isTrackingPageBreak=!1,this.owner=e,this.commentReviewPane=i,this.locale=new t.L10n("documenteditor",this.owner.defaultLocale),this.locale.setLocale(this.owner.locale),this.selectedUser=this.locale.getConstant("All"),this.selectedType=this.locale.getConstant("All"),this.initTrackChangePane(),this.commentReviewPane.reviewTab.items[1].content=this.trackChangeDiv}return Object.defineProperty(e.prototype,"setNoChangesVisibility",{get:function(){return this.noChangesVisibleInternal},set:function(e){this.isChangesTabVisible=!e,this.noChangeDivElement.style.display=e?"block":"none",this.noChangesVisibleInternal=e,this.enableDisableToolbarItem(!e),this.commentReviewPane.reviewTab.hideTab(1,e),this.owner.notify("reviewPane",{changes:!e,comment:this.commentReviewPane.isCommentTabVisible})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentSelectedRevision",{get:function(){return this.currentSelectedRevisionInternal},set:function(e){var i=t.select(".e-de-trckchanges-inner-select",this.changesInfoDiv);t.isNullOrUndefined(e)?t.isNullOrUndefined(i)||i.classList.remove("e-de-trckchanges-inner-select"):(e!==this.currentSelectedRevisionInternal||t.isNullOrUndefined(i))&&(i&&i.classList.remove("e-de-trckchanges-inner-select"),this.changes.length>0&&this.changes.containsKey(e)&&this.changes.get(e).singleInnerDiv.classList.add("e-de-trckchanges-inner-select")),this.currentSelectedRevisionInternal=e,i=t.select(".e-de-trckchanges-inner-select",this.changesInfoDiv),t.isNullOrUndefined(i)||i.parentElement.scrollIntoView({block:"nearest"})},enumerable:!0,configurable:!0}),e.prototype.initTrackChangePane=function(){this.changes=new u,this.trackChangeDiv=t.createElement("div",{className:"e-de-tc-pane"}),this.trackChangeDiv.appendChild(this.initPaneHeader()),this.changesInfoDiv=t.createElement("div",{id:"e-de-tc-pane-revision",styles:"overflow:auto"}),this.trackChangeDiv.appendChild(this.changesInfoDiv),this.noChangeDivElement=t.createElement("div",{styles:"display:none;",className:"e-de-tc-no-chng"}),this.noChangeDivElement.textContent=this.locale.getConstant("No changes"),this.changesInfoDiv.appendChild(this.noChangeDivElement),this.updateTrackChanges()},e.prototype.initPaneHeader=function(){var e=this;this.toolbarElement=t.createElement("div",{className:"e-de-track-toolbar"}),this.toolbar=new i.Toolbar({enableRtl:this.owner.enableRtl,items:[{template:this.locale.getConstant("User")+":",cssClass:"e-de-track-toolbar-overlay",disabled:!0},{template:t.createElement("div",{id:"e-de-user-list"})},{type:"Separator"},{template:this.locale.getConstant("View")+":",cssClass:"e-de-track-toolbar-overlay",disabled:!0},{template:t.createElement("div",{id:"e-de-revision-list"})},{prefixIcon:"e-de-nav-left-arrow e-de-tc-tbr",align:"Right",cssClass:"e-de-nvgte-left",tooltipText:this.locale.getConstant("Previous Changes"),click:this.navigatePreviousChanges.bind(this)},{prefixIcon:"e-de-nav-right-arrow e-de-tc-tbr",align:"Right",cssClass:"e-de-nvgte-right",tooltipText:this.locale.getConstant("Next Changes"),click:this.navigateNextChanges.bind(this)},{template:t.createElement("div",{id:"e-de-menu-option"}),align:"Right",cssClass:"e-de-tc-tbr",tooltipText:this.locale.getConstant("More Options")+"..."}]}),this.toolbar.appendTo(this.toolbarElement),t.select(".e-de-nvgte-left",this.toolbarElement).firstChild.classList.add("e-tc-nvgte"),t.select(".e-de-nvgte-right",this.toolbarElement).firstChild.classList.add("e-tc-nvgte");var n=t.select("#e-de-user-list",this.toolbarElement);this.userDropDownitems=[{text:this.locale.getConstant("All")}],this.userDropDown={items:this.userDropDownitems,cssClass:"e-de-track-pane-drop-btn e-tc-btn-bg-clr",select:this.onUserSelect.bind(this),beforeOpen:this.onUserOpen.bind(this),beforeItemRender:function(t){e.beforeDropDownItemRender(t,e.selectedUser)}},this.userDropDownButton=new d.DropDownButton(this.userDropDown),this.userDropDownButton.appendTo(n),this.userDropDownButton.content=this.getSpanView(this.userDropDown.items[0].text,0);var r=t.select("#e-de-revision-list",this.toolbarElement);this.viewTypeitems=[{text:this.locale.getConstant("All")},{text:this.locale.getConstant("Inserted")},{text:this.locale.getConstant("Deleted")}],this.viewTypeDropDownButton=new d.DropDownButton({items:this.viewTypeitems,cssClass:"e-de-track-pane-drop-btn e-tc-btn-bg-clr",select:this.onTypeSelect.bind(this),beforeItemRender:function(t){e.beforeDropDownItemRender(t,e.selectedType)}}),this.viewTypeDropDownButton.content=this.getSpanView(this.viewTypeitems[0].text,1),this.viewTypeDropDownButton.appendTo(r),this.menuoptionEle=t.select("#e-de-menu-option",this.toolbarElement);var o={items:[{text:this.locale.getConstant("Accept all")},{text:this.locale.getConstant("Reject all")}],select:this.onMenuSelect.bind(this),iconCss:"e-de-menu-icon",cssClass:"e-caret-hide e-tc-btn-bg-clr"};return this.menuDropDownButton=new d.DropDownButton(o),this.menuDropDownButton.appendTo(this.menuoptionEle),this.toolbarElement},e.prototype.beforeDropDownItemRender=function(e,t){e.element.innerHTML="<span></span>"+e.item.text;var i=e.element.children[0];e.item.text===t?(i.style.marginRight="10px",i.style.alignSelf="center",i.setAttribute("class","e-de-selected-item e-icons")):(e.element.children[0].style.marginRight="25px",e.element.children[0].classList.remove("e-de-selected-item"))},e.prototype.onUserOpen=function(e){var t=e.element;t.style.maxHeight="200px",t.style.overflowY="auto"},e.prototype.enableDisableToolbarItem=function(e){var t=this.toolbar.element.querySelectorAll(".e-de-tc-tbr");this.owner&&this.owner.viewer&&(this.toolbar.enableItems(t[0].parentElement.parentElement,e),this.toolbar.enableItems(t[1].parentElement.parentElement,e),this.toolbar.enableItems(t[2],e))},e.prototype.getSpanView=function(e,t){return(0===t?'<span class="e-de-track-span-user">':'<span class="e-de-track-span-view">')+e+"</span>"},e.prototype.onMenuSelect=function(e){var t=this,i=e.item.text;i.match(this.locale.getConstant("Accept all"))?setTimeout(function(){t.owner.revisionsInternal.handleRevisionCollection(!0,t.sortedRevisions)},0):i.match(this.locale.getConstant("Reject all"))&&setTimeout(function(){t.owner.revisionsInternal.handleRevisionCollection(!1,t.sortedRevisions)},0),this.updateUsers()},e.prototype.onSelection=function(e){this.currentSelectedRevision=e},e.prototype.onUserSelect=function(e){var t=e.item.text;this.selectedUser=t,this.userDropDownButton.content=this.getSpanView(t,0),this.sortCollectionToDisplay()},e.prototype.onTypeSelect=function(e){var t=e.item.text;this.selectedType=t,this.viewTypeDropDownButton.content=this.getSpanView(t,1),this.sortCollectionToDisplay()},e.prototype.updateMenuOptions=function(){var e;this.selectedType!==this.locale.getConstant("All")&&(e=this.selectedType===this.locale.getConstant("Inserted")?this.locale.getConstant("Insertion"):this.locale.getConstant("Deletion")),this.selectedUser===this.locale.getConstant("All")&&this.selectedType===this.locale.getConstant("All")?(this.menuDropDownButton.items[0].text=this.locale.getConstant("Accept all")+" "+this.locale.getConstant("Changes"),this.menuDropDownButton.items[1].text=this.locale.getConstant("Reject all")+" "+this.locale.getConstant("Changes")):this.selectedUser===this.locale.getConstant("All")&&this.selectedType!==this.locale.getConstant("All")?(this.menuDropDownButton.items[0].text=this.locale.getConstant("Accept all")+" "+e,this.menuDropDownButton.items[1].text=this.locale.getConstant("Reject all")+" "+e):this.selectedUser!==this.locale.getConstant("All")&&this.selectedType===this.locale.getConstant("All")?(this.menuDropDownButton.items[0].text=this.locale.getConstant("Accept all")+" "+this.locale.getConstant("Changes")+" "+this.locale.getConstant("By").toLowerCase()+" "+this.selectedUser,this.menuDropDownButton.items[1].text=this.locale.getConstant("Reject all")+" "+this.locale.getConstant("Changes")+" "+this.locale.getConstant("By").toLowerCase()+" "+this.selectedUser):(this.menuDropDownButton.items[0].text=this.locale.getConstant("Accept all")+" "+e+" "+this.locale.getConstant("By").toLowerCase()+" "+this.selectedUser,this.menuDropDownButton.items[1].text=this.locale.getConstant("Reject all")+" "+e+" "+this.locale.getConstant("By").toLowerCase()+" "+this.selectedUser)},e.prototype.sortCollectionToDisplay=function(){var e=!1;this.sortedRevisions=[],this.updateMenuOptions();for(var t=0;t<this.changes.length;t++){var i=this.changes.get(this.revisions[t]),n=i.outerSingleDiv;this.selectedUser===this.locale.getConstant("All")&&this.selectedType===this.locale.getConstant("All")?(n.style.display="block",e=!0):this.selectedUser===this.locale.getConstant("All")&&this.selectedType!==this.locale.getConstant("All")?i.revisionType===this.selectedType?(n.style.display="block",e=!0):n.style.display="none":this.selectedUser!==this.locale.getConstant("All")&&this.selectedType===this.locale.getConstant("All")?i.user===this.selectedUser?(n.style.display="block",e=!0):n.style.display="none":i.user===this.selectedUser&&i.revisionType===this.selectedType?(n.style.display="block",e=!0):n.style.display="none","block"===n.style.display&&this.sortedRevisions.push(this.revisions[t])}this.setNoChangesVisibility=!e},e.prototype.enableDisableButton=function(e){this.enableButtons=e,this.updateTrackChanges()},e.prototype.updateTrackChanges=function(e){if(e||t.isNullOrUndefined(e)){this.removeAllChanges(),this.enableButtons||this.menuoptionEle.classList.contains("e-de-overlay")?this.menuoptionEle.classList.contains("e-de-overlay")&&this.menuoptionEle.classList.remove("e-de-overlay"):this.menuoptionEle.classList.add("e-de-overlay"),this.isChangesTabVisible=!0,this.owner.notify("reviewPane",{comment:this.commentReviewPane.isCommentTabVisible,changes:this.isChangesTabVisible});for(var i=0;i<this.owner.revisions.changes.length;i++){var n=this.owner.revisions.changes[i];this.addChanges(n)}this.sortCollectionToDisplay(),this.updateUsers(),e&&(this.currentSelectedRevision=this.currentSelectedRevisionInternal,this.updateHeight(),this.owner.resize())}else this.currentSelectedRevision=void 0},e.prototype.updateUsers=function(){this.users.length>0&&(this.userDropDownButton.removeItems(this.users),this.users=[]);for(var e=0;e<this.revisions.length;e++)-1===this.users.indexOf(this.revisions[e].author)&&(this.users.push(this.revisions[e].author),this.userDropDownButton.items.push({text:this.revisions[e].author}))},e.prototype.updateHeight=function(){var e=this.commentReviewPane.reviewTab.getRootElement().getElementsByClassName("e-tab-header")[0].getBoundingClientRect().height;this.changesInfoDiv.style.height=this.commentReviewPane.parentPaneElement.clientHeight-this.toolbarElement.clientHeight-e-2+"px"},e.prototype.removeAllChanges=function(){for(;this.changesInfoDiv.childNodes.length>1;)this.changesInfoDiv.removeChild(this.changesInfoDiv.lastChild);this.revisions=[],this.changes.clear()},e.prototype.clear=function(){this.removeAllChanges(),this.selectedUser=this.locale.getConstant("All"),this.userDropDownButton.content=this.getSpanView(this.selectedUser,0),this.selectedType=this.locale.getConstant("All"),this.viewTypeDropDownButton.content=this.getSpanView(this.selectedType,1),this.currentSelectedRevision=void 0},e.prototype.destroy=function(){this.removeAllChanges(),this.toolbar&&this.toolbar.destroy(),this.userDropDownButton&&this.userDropDownButton.destroy(),this.menuDropDownButton&&(this.menuDropDownButton.destroy(),this.menuDropDownButton=void 0),this.viewTypeDropDownButton&&this.viewTypeDropDownButton.destroy(),this.menuDropDownButton&&(this.menuDropDownButton.destroy(),this.menuDropDownButton=void 0),this.userDropDown&&(this.userDropDown=void 0),this.users.length>0&&(this.users=[]),this.trackChangeDiv&&(this.trackChangeDiv=void 0)},e.prototype.addChanges=function(e){var t=new re(this.owner,this);this.changesInfoDiv.appendChild(t.createSingleChangesDiv(e)),this.enableButtons?t.acceptButtonElement.classList.contains("e-de-overlay")&&(t.acceptButtonElement.classList.remove("e-de-overlay"),t.rejectButtonElement.classList.remove("e-de-overlay")):t.acceptButtonElement.classList.contains("e-de-overlay")||(t.acceptButtonElement.classList.add("e-de-overlay"),t.rejectButtonElement.classList.add("e-de-overlay")),this.revisions.push(e),this.changes.add(e,t)},e.prototype.navigatePreviousChanges=function(){this.owner.selection.navigatePreviousRevision()},e.prototype.navigateNextChanges=function(){this.owner.selection.navigateNextRevision()},e}(),re=function(){function e(e,i){this.owner=e,this.locale=new t.L10n("documenteditor",this.owner.defaultLocale),this.locale.setLocale(this.owner.locale),this.trackChangesPane=i}return e.prototype.createSingleChangesDiv=function(e){this.revision=e,this.user=e.author,this.outerSingleDiv=t.createElement("div",{className:"e-de-tc-outer"}),this.singleInnerDiv=t.createElement("div",{className:"e-de-trckchanges-inner"}),this.singleInnerDiv.addEventListener("click",this.selectRevision.bind(this)),this.outerSingleDiv.appendChild(this.singleInnerDiv);var i=t.createElement("div",{className:"e-de-track-usernme-div"}),n=t.createElement("div",{innerHTML:e.author,className:"e-de-track-user-nme"});t.isNullOrUndefined(e.author)||(i.style.display="flex",this.owner.documentHelper.getAvatar(i,n,void 0,e));var o=t.createElement("div");"Insertion"===e.revisionType?(this.revisionType="Inserted",o.innerHTML=this.locale.getConstant("Inserted").toUpperCase(),o.classList.add("e-de-track-insert")):"Deletion"===e.revisionType?(this.revisionType="Deleted",o.innerHTML=this.locale.getConstant("Deleted").toUpperCase(),o.classList.add("e-de-track-delete")):"MoveFrom"===e.revisionType?(this.revisionType="MoveFrom",o.innerHTML=this.locale.getConstant("Move From").toUpperCase(),o.classList.add("e-de-track-delete"),o.style.whiteSpace="nowrap"):"MoveTo"===e.revisionType&&(this.revisionType="MoveTo",o.innerHTML=this.locale.getConstant("Move To").toUpperCase(),o.classList.add("e-de-track-insert"),o.style.whiteSpace="nowrap"),i.appendChild(o),this.singleInnerDiv.appendChild(i);var s=t.createElement("div",{className:"e-de-track-date",innerHTML:L.getModifiedDate(e.date)});this.singleInnerDiv.appendChild(s);var a=t.createElement("div",{className:"e-de-track-chngs-text"});this.layoutElementText(e.range,a),this.singleInnerDiv.appendChild(a);var l=t.createElement("div",{styles:"display:inline-block;width:100%"});this.singleInnerDiv.appendChild(l);var d=t.createElement("div",{styles:"float:left;"});this.acceptButtonElement=t.createElement("button",{className:"e-de-track-accept-button"});var h=new r.Button({cssClass:"e-outline",content:this.locale.getConstant("Accept")});d.appendChild(this.acceptButtonElement),l.appendChild(d),h.appendTo(this.acceptButtonElement),this.acceptButtonElement.addEventListener("click",this.acceptButtonClick.bind(this)),d=t.createElement("div",{styles:"float:left;"}),this.rejectButtonElement=t.createElement("button",{className:"e-de-track-reject-button"});var c=new r.Button({cssClass:"e-outline",content:this.locale.getConstant("Reject")});d.appendChild(this.rejectButtonElement),l.appendChild(d),c.appendTo(this.rejectButtonElement),this.rejectButtonElement.addEventListener("click",this.rejectButtonClick.bind(this));var p=t.createElement("div",{className:"e-de-track-chngs-count",styles:"float:right;"}),g=this.owner.revisions.changes.indexOf(e)+1,u=this.owner.revisions.changes.length;return p.innerHTML=this.locale.getConstant("Changes")+" "+g.toString()+" "+this.locale.getConstant("of")+" "+u.toString(),l.appendChild(p),this.outerSingleDiv},e.prototype.selectRevision=function(){this.owner.selection.selectRevision(this.revision),this.trackChangesPane.onSelection(this.revision)},e.prototype.layoutElementText=function(e,i){i.style.width="100%";for(var n="",r=!1,o=0;o<e.length;o++){var s=e[o];if(s instanceof Ie&&1===s.fieldType)r=!1;else if(!r)if(s instanceof Ie&&0===s.fieldType&&(r=!0),s instanceof Oe)n+=s.text;else if(s instanceof Ie&&0===s.fieldType){var a=this.owner.selection.getFieldCode(s);if(a.match("TOC ")||a.match("Toc"))return n+="<Table of Content>",void i.appendChild(this.addSpan(n));if(a.match("HYPERLINK ")||a.match("MERGEFIELD")||a.match("FORMTEXT")||a.match("PAGE "))n+=this.owner.editor.retrieveFieldResultantText(s.fieldEnd);else if(s.formFieldData){var l=this.owner.documentHelper.textHelper.repeatChar(this.owner.documentHelper.textHelper.getEnSpaceCharacter(),5);""!==n&&(i.appendChild(this.addSpan(n)),n=""),s.formFieldData instanceof Ee?i.appendChild(this.addSpan(""===s.formFieldData.defaultValue?l:s.formFieldData.defaultValue,"e-de-tc-field")):s.formFieldData instanceof We?i.appendChild(this.addSpan(s.formFieldData.dropdownItems.length>0?s.formFieldData.dropdownItems[0]:l,"e-de-tc-field")):i.appendChild(this.addSpan(s.formFieldData.checked?String.fromCharCode(9745):String.fromCharCode(9744),"e-de-tc-field"))}}else if(s instanceof Ze){""!==n&&(i.appendChild(this.addSpan(n)),n="");var d=t.createElement("img");d.setAttribute("src",s.imageString),d.classList.add("e-de-tc-shrink-img"),i.appendChild(d)}else{if(s instanceof H){var h=t.createElement("table");h.classList.add("e-de-track-chng-table"),h.insertRow();for(var c=0;c<s.ownerBase.childWidgets.length;c++)h.rows[0].insertCell(),h.rows[0].cells[c].classList.add("e-de-tc-tble-cell");return void i.appendChild(h)}if(s instanceof k){""!==n&&(i.appendChild(this.addSpan(n)),n="");var p="¶";s.ownerBase instanceof we&&s.ownerBase.isEndsWithPageBreak&&(p="............Page Break............"+p),i.appendChild(this.addSpan(p,"e-de-tc-pmark")),i.appendChild(t.createElement("br"))}}}i.appendChild(this.addSpan(n))},e.prototype.addSpan=function(e,i){var n=t.createElement("span");return n.textContent=e,i&&n.classList.add(i),n},e.prototype.acceptButtonClick=function(){this.trackChangesPane.changesInfoDiv.removeChild(this.outerSingleDiv),this.removeFromParentCollec(),this.revision.accept()},e.prototype.rejectButtonClick=function(){this.trackChangesPane.changesInfoDiv.removeChild(this.outerSingleDiv),this.removeFromParentCollec(),this.revision.reject()},e.prototype.removeFromParentCollec=function(){this.trackChangesPane.changes.remove(this.revision),this.trackChangesPane.revisions.splice(this.trackChangesPane.revisions.indexOf(this.revision),1),0===this.trackChangesPane.changes.length&&(this.trackChangesPane.setNoChangesVisibility=!0),this.trackChangesPane.updateUsers()},e}(),oe=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),se=function(){function e(e){var i=this;this.scrollbarWidth=0,this.isWebPrinting=!1,this.isHeaderFooter=!1,this.currentPage=void 0,this.selectionStartPageIn=void 0,this.selectionEndPageIn=void 0,this.fieldStacks=[],this.showRevision=!1,this.splittedCellWidgets=[],this.tableLefts=[],this.tapCount=0,this.timer=-1,this.isTimerStarted=!1,this.isFirstLineFitInShiftWidgets=!1,this.preZoomFactor=0,this.preDifference=-1,this.fieldEndParagraph=void 0,this.fieldToLayout=void 0,this.backgroundColor="#FFFFFF",this.isMouseDown=!1,this.isMouseEntered=!1,this.scrollMoveTimer=0,this.isSelectionChangedOnMouseMoved=!1,this.isControlPressed=!1,this.isTouchInput=!1,this.isTouchMoved=!1,this.useTouchSelectionMark=!1,this.touchDownOnSelectionMark=0,this.isComposingIME=!1,this.lastComposedText="",this.isCompositionStart=!1,this.isCompositionUpdated=!1,this.isCompositionCanceled=!1,this.isCompositionEnd=!1,this.prefix="",this.suffix="",this.fields=[],this.heightInfoCollection={},this.defaultTabWidth=36,this.dontUseHtmlParagraphAutoSpacing=!1,this.alignTablesRowByRow=!1,this.lists=[],this.comments=[],this.authors=new u,this.revisionsInternal=new u,this.commentUserOptionId=1,this.abstractLists=[],this.styles=new V,this.preDefinedStyles=void 0,this.isRowOrCellResizing=!1,this.formFields=[],this.isMouseDownInFooterRegion=!1,this.pageFitTypeIn="None",this.fieldCollection=[],this.isPageField=!1,this.mouseDownOffset=new R(0,0),this.zoomFactorInternal=1,this.moveCaretPosition=0,this.isTextInput=!1,this.isScrollHandler=!1,this.triggerElementsOnLoading=!1,this.triggerSpellCheck=!1,this.restrictFormatting=!1,this.protectionType="NoProtection",this.isDocumentProtected=!1,this.hashValue="",this.saltValue="",this.userCollection=[],this.cachedPages=[],this.skipScrollToPosition=!1,this.isIosDevice=!1,this.isMobileDevice=!1,this.isFormFilling=!1,this.footnotes=new ke,this.endnotes=new ke,this.isFootnoteWidget=!1,this.onTextInput=function(e){if(!i.isComposingIME){e.preventDefault();var t=e.data;i.owner.editor.handleTextInput(t)}},this.compositionStart=function(){t.Browser.isDevice||i.owner.isReadOnlyMode||(i.isComposingIME=!0,i.positionEditableTarget(),i.owner.editorHistory&&i.owner.editor.initComplexHistory("IMEInput")),i.isCompositionStart=!0},this.compositionUpdated=function(){i.isComposingIME&&!i.owner.isReadOnlyMode&&setTimeout(function(){i.owner.editor.insertIMEText(i.getEditableDivTextContent(),!0)},0),i.isCompositionUpdated=!0},this.compositionEnd=function(e){if(i.isComposingIME&&!i.owner.isReadOnlyMode){var t=i.getEditableDivTextContent();""!==t&&i.owner.editor.insertIMEText(t,!1),i.isComposingIME=!1,i.lastComposedText="",i.iframe.setAttribute("style","pointer-events:none;position:absolute;left:"+i.owner.viewer.containerLeft+"px;top:"+i.owner.viewer.containerTop+"px;outline:none;background-color:transparent;width:0px;height:0px;overflow:hidden"),i.editableDiv.innerHTML="",i.owner.editorHistory&&(i.owner.editorHistory.updateComplexHistory(),""===t&&(i.owner.editorHistory.undo(),i.owner.editorHistory.redoStack.pop()))}e.preventDefault(),i.isCompositionUpdated=!1,i.isCompositionEnd=!0},this.onKeyPressInternal=function(e){var n=e.which||e.keyCode;i.triggerElementsOnLoading=!1;var r=!(!e.ctrlKey&&!e.metaKey)||17===n,o=e.altKey?e.altKey:18===n;if(t.Browser.isIE&&o&&r&&(r=!1),r&&"v"===e.key||r&&"a"===e.key||(r||i.isControlPressed&&t.Browser.isIE)&&"p"===e.key)return void(t.Browser.isIE&&(i.isControlPressed=!1));if(!i.owner.isReadOnlyMode||i.selection&&i.selection.isInlineFormFillMode()){var s=e.keyCode||e.charCode,a="";s?a=String.fromCharCode(s):e.key&&(a=e.key)," "===a||"\r"===a||"\b"===a||""===a||r?" "===a&&(i.triggerSpellCheck=!0,i.owner.editorModule.handleTextInput(" "),i.triggerSpellCheck=!1):i.owner.editorModule.handleTextInput(a),e.preventDefault()}},this.onTextInputInternal=function(e){i.owner.isReadOnlyMode?i.editableDiv.innerText="":i.owner.editorModule.onTextInputInternal()},this.onPaste=function(e){(!i.owner.isReadOnlyMode&&i.owner.editor.canEditContentControl||i.selection.isInlineFormFillMode())&&i.owner.editorModule.pasteInternal(e),i.editableDiv.innerText="",e.preventDefault()},this.onFocusOut=function(){if(!t.isNullOrUndefined(i.selection)){if(i.owner.contextMenuModule&&i.owner.contextMenuModule.contextMenuInstance&&"block"===i.owner.contextMenuModule.contextMenuInstance.element.style.display)return;i.selection.hideCaret()}},this.updateFocus=function(){!i.selection||i.isMobileDevice&&i.owner.isReadOnly||(t.Browser.isDevice||t.Browser.isIE||navigator.userAgent.match("Edge")||t.isNullOrUndefined(i.iframe)||i.iframe.focus(),t.isNullOrUndefined(i.editableDiv)||i.editableDiv.focus(),i.selection.showCaret())},this.scrollHandler=function(){i.scrollTimer&&clearTimeout(i.scrollTimer),i.clearContent(),i.isScrollHandler=!0,t.Browser.isDevice||i.isComposingIME||(i.iframe.style.top=i.owner.viewer.containerTop+"px",i.iframe.style.left=i.owner.viewer.containerLeft+"px"),i.owner.viewer.updateScrollBars();var e=i.owner.viewer.containerTop+i.visibleBounds.height-(i.owner.viewer.padding.top+i.owner.viewer.padding.bottom);e>i.pageContainer.offsetHeight&&(i.viewerContainer.scrollTop=i.owner.viewer.containerTop-(e-i.pageContainer.offsetHeight)),i.owner.viewer instanceof le&&!t.isNullOrUndefined(i.owner)&&i.owner.fireViewChange(),i.isScrollHandler=!1,i.scrollTimer=setTimeout(function(){i.isScrollHandler||t.isNullOrUndefined(i.owner)||!i.owner.isSpellCheck||(i.isScrollToSpellCheck=!0,i.owner.viewer.updateScrollBars())},200)},this.onWindowResize=function(){i.resizeTimer&&clearTimeout(i.resizeTimer),i.resizeTimer=setTimeout(function(){t.isNullOrUndefined(i.owner)||t.isNullOrUndefined(i.owner.element)||(i.updateViewerSize(),i.clearContent(),i.owner.viewer.updateScrollBars(),t.isNullOrUndefined(i.selection)||i.selection.updateCaretPosition(),i.updateTouchMarkPosition(),i.owner.contextMenuModule&&i.owner.contextMenuModule.contextMenuInstance&&i.owner.contextMenuModule.contextMenuInstance.close(),i.resizeTimer&&clearTimeout(i.resizeTimer))},200)},this.onContextMenu=function(e){i.owner.contextMenuModule&&(i.isMouseDown&&(i.isMouseDown=!1),i.owner.contextMenuModule.onContextMenuInternal(e))},this.onMouseDownInternal=function(e){var n=e.target;if(!(!t.isNullOrUndefined(n)&&n!==i.viewerContainer||i.isTouchInput||e.offsetX>i.visibleBounds.width-(i.visibleBounds.width-i.viewerContainer.clientWidth)||e.offsetY>i.visibleBounds.height-(i.visibleBounds.height-i.viewerContainer.clientHeight)||(i.isFootnoteWidget=!1,t.isNullOrUndefined(i.selection)))){if(i.updateCursor(e),i.formFillPopup&&i.formFillPopup.hidePopup(),i.isLeftButtonPressed(e)&&!i.owner.isReadOnlyMode&&i.owner.enableImageResizerMode&&!t.isNullOrUndefined(i.owner.imageResizerModule.selectedResizeElement)){if(i.selection.isInShape){var r=i.owner.selection.getCurrentTextFrame().containerShape;i.selection.selectShape(r)}i.owner.imageResizerModule.isImageResizing=!0}e.preventDefault(),i.isTouchInput||i.selection.hideCaret();var o=new R(e.offsetX,e.offsetY),s=i.owner.viewer.findFocusedPage(o,!0);if(i.mouseDownOffset.x=s.x,i.mouseDownOffset.y=s.y,i.isMouseDownInFooterRegion=i.selection.isCursorInsidePageRect(o,i.currentPage)&&i.selection.isCursorInFooterRegion(o,i.currentPage),i.isSelectionChangedOnMouseMoved=!1,!i.owner.isReadOnlyMode&&(i.owner.editorModule.tableResize.isInCellResizerArea(s)||i.owner.editorModule.tableResize.isInRowResizerArea(s)))return i.selection.hideCaret(),i.isMouseDown=!0,i.isSelectionChangedOnMouseMoved=!1,void(i.isLeftButtonPressed(e)&&(i.owner.editorModule.tableResize.startingPoint.x=s.x,i.owner.editorModule.tableResize.startingPoint.y=s.y,i.owner.editorModule.tableResize.handleResize(s)));if(e.ctrlKey&&(i.isControlPressed=!0),i.owner.selection.isEmpty&&(i.useTouchSelectionMark=!1),3===e.which&&!i.owner.selection.isEmpty&&i.selection.checkCursorIsInSelection(i.getLineWidget(s),s))return void e.preventDefault();i.isTouchInput=!1,i.isMouseDown=!0,i.updateFocus(),i.timer=setTimeout(function(){++i.tapCount>1&&(i.tapCount=1)},100)}},this.onMouseMoveInternal=function(e){if((t.isNullOrUndefined(e.target)||e.target===i.viewerContainer)&&(e.preventDefault(),!t.isNullOrUndefined(i.selection))){if(!i.owner.isReadOnlyMode&&i.owner.enableImageResizerMode&&i.owner.imageResizerModule.isImageResizing)return void(i.owner.imageResizerModule.isImageMoveToNextPage||i.owner.imageResizerModule.handleImageResizingOnMouse(e));var n=new R(e.offsetX,e.offsetY),r=i.owner.viewer.findFocusedPage(n,!i.owner.enableHeaderAndFooter);if(i.isMouseDown){if(!t.isNullOrUndefined(i.currentPage)){var o=r.x,s=r.y;if(!i.owner.isReadOnlyMode&&i.isRowOrCellResizing){var a=i.owner.editorModule.tableResize.currentResizingTable,l=i.selection.setPositionForBlock(a,!0),d=i.selection.setPositionForBlock(a,!1);i.owner.documentHelper.isDocumentProtected&&!i.selection.checkSelectionIsAtEditRegion(l,d)||i.owner.editorModule.tableResize.handleResizing(r)}else if(i.isTouchInput||i.isSelectionChangedOnMouseMoved||i.touchDownOnSelectionMark>0||i.updateTextPositionForSelection(r,1),i.isLeftButtonPressed(e)){e.preventDefault();var h=s,c=i.owner.selection.end,p=new R(o,h);i.owner.enableImageResizerMode&&i.owner.imageResizerModule.isImageResizerVisible&&!i.owner.imageResizerModule.isShapeResize||i.owner.selection.moveTextPosition(p,c),i.isSelectionChangedOnMouseMoved=!0}}i.selection.checkForCursorVisibility()}i.isRowOrCellResizing||i.isSelectionChangedOnMouseMoved||i.updateCursor(e),i.isRowOrCellResizing&&i.selection.hideCaret()}},this.onMouseLeaveInternal=function(e){e.preventDefault();var t=new R(e.offsetX,e.offsetY);if(i.isMouseDown){var n=i.viewerContainer.scrollTop;e.offsetY+n>n?i.scrollMoveTimer=setInterval(function(){i.scrollForwardOnSelection(t)},500):i.scrollMoveTimer=setInterval(function(){i.scrollBackwardOnSelection(t)},500),i.isMouseEntered&&(i.isMouseEntered=!1)}},this.onMouseEnterInternal=function(){i.isMouseEntered||i.owner.viewer.updateScrollBars(),i.isMouseEntered=!0,i.scrollMoveTimer&&clearInterval(i.scrollMoveTimer)},this.onDoubleTap=function(e){if((t.isNullOrUndefined(e.target)||e.target===i.viewerContainer)&&!t.isNullOrUndefined(i.selection)){i.isTouchInput=!1;var n=new R(e.offsetX,e.offsetY),r=i.owner.viewer.findFocusedPage(n,!0);if(i.selection.checkAndEnableHeaderFooter(n,i.owner.viewer.findFocusedPage(n,!0)))return;var o=i.getLineWidget(r),s=i.selection.getHyperLinkFieldInCurrentSelection(o,r,!0);if(t.isNullOrUndefined(s)&&(s=i.selection.getCurrentFormField()),!i.isDocumentProtected&&i.owner.enableFormField){var a=i.selection.getFormFieldType(s);if(a)switch(""!==a.toString()&&i.selection.selectField(s),a){case"Text":i.owner.textFormFieldDialogModule.show();break;case"CheckBox":i.owner.checkBoxFormFieldDialogModule.show();break;case"DropDown":i.owner.dropDownFormFieldDialogModule.show()}}else{if(!(i.isDocumentProtected&&s&&s.formFieldData instanceof Ee&&"Text"===s.formFieldData.type))return void(i.tapCount=2);i.selection.selectField()}var l=i.selection.start.clone(),d=i.selection.end.clone(),h=l.currentWidget.getInline(l.offset,0).element;if("Pages"===i.owner.layoutType)if(h instanceof Le)if("Footnote"===h.footnoteType){var c=i.currentPage.footnoteWidget,p=void 0;for(p=1;p<=c.childWidgets.length;p++){var g=c.childWidgets[p].footNoteReference;if(h.text===g.text)break}l.setPositionParagraph(c.childWidgets[p].childWidgets[0],0),d.setPositionParagraph(c.childWidgets[p].childWidgets[0],0),i.selection.selectRange(l,d)}else{var u=i.pages[i.pages.length-1].endnoteWidget,p=void 0;if(!t.isNullOrUndefined(u))for(p=1;p<=u.childWidgets.length;p++){var m=u.childWidgets[p].footNoteReference;if(h.text===m.text)break}l.setPositionParagraph(u.childWidgets[p].childWidgets[0],0),d.setPositionParagraph(u.childWidgets[p].childWidgets[0],0),i.selection.selectRange(l,d)}else h instanceof Oe&&(i.selection.isinEndnote||i.selection.isinFootnote)&&i.selection.footnoteReferenceElement(l,d,h);!i.selection.isEmpty||t.isNullOrUndefined(i.currentPage)||t.isNullOrUndefined(i.owner.selection.start)||(i.owner.selection.selectCurrentWord(),i.selection.checkForCursorVisibility(),i.tapCount=2)}},this.onMouseUpInternal=function(e){if(t.isNullOrUndefined(e.target)||e.target===i.viewerContainer){e.preventDefault(),i.isListTextSelected=!1;var n=new R(e.offsetX,e.offsetY),r=i.owner.viewer.findFocusedPage(n,!0);if(!t.isNullOrUndefined(i.selection)){var o=1;t.Browser.isIE?o=i.tapCount:e.detail>2&&(o=e.detail),i.isRowOrCellResizing&&i.owner.editorModule.tableResize.updateResizingHistory(r),!i.isMouseDown||i.isSelectionChangedOnMouseMoved||t.isNullOrUndefined(i.currentPage)||t.isNullOrUndefined(i.owner.selection.start)||i.owner.enableImageResizerMode&&i.owner.imageResizerModule.isImageResizing||(0!==i.touchDownOnSelectionMark||i.isRowOrCellResizing||(i.updateTextPositionForSelection(r,o),t.Browser.isIE&&2===o&&i.selection.checkAndEnableHeaderFooter(n,r)),i.selection.checkForCursorVisibility(),t.isNullOrUndefined(i.currentSelectedComment)||!i.owner.commentReviewPane||i.owner.commentReviewPane.commentPane.isEditMode||(i.currentSelectedComment=void 0));var s=i.isIosDevice?e.metaKey:e.ctrlKey;if(t.isNullOrUndefined(i.currentPage)||t.isNullOrUndefined(i.owner.selection.start)||!i.owner.selection.isEmpty&&!i.owner.selection.isImageSelected||!(s&&i.owner.useCtrlClickToFollowHyperlink||!i.owner.useCtrlClickToFollowHyperlink)||!0!==i.isLeftButtonPressed(e)||i.selection.navigateHyperLinkOnEvent(r,!1),i.isMouseDown&&i.isLeftButtonPressed(e)&&i.isDocumentProtected&&"FormFieldsOnly"===i.protectionType&&i.selection){var a=i.getLineWidget(r),l=i.selection.getHyperLinkFieldInCurrentSelection(a,r,!0);if(t.isNullOrUndefined(l)&&(l=i.selection.getCurrentFormField(!0)),l&&l.formFieldData&&l.formFieldData.enabled&&!i.selection.isInlineFormFillMode(l)){var d={fieldName:l.formFieldData.name};l.formFieldData instanceof Ee?d.value=l.resultText:l.formFieldData instanceof He?d.value=l.formFieldData.checked:d.value=l.formFieldData.selectedIndex,i.owner.trigger(b,d),"Popup"===i.owner.documentEditorSettings.formFieldSettings.formFillingMode&&!(l.formFieldData instanceof He)||l.formFieldData instanceof Ee&&"Text"!==l.formFieldData.type||l.formFieldData instanceof We?i.formFillPopup.showPopUp(l):(i.owner.editor.toggleCheckBoxFormField(l),d.value=l.formFieldData.checked,d.isCanceled=!1,i.owner.trigger(y,d))}!l&&i.isFormFillProtectedMode&&i.selection.navigateToNextFormField()}else if(i.isMouseDown&&i.formFields.length>0)if((l=i.selection.getCurrentFormField(!0))&&l.formFieldData instanceof Ee)i.selection.selectField();else if(i.isLeftButtonPressed(e)&&l&&l.formFieldData instanceof We){var h=l.line.getOffset(l,0),c=i.selection.getPhysicalPositionInternal(l.line,h,!1);i.selection.selectInternal(l.line,l,0,c)}if(!i.owner.isReadOnlyMode&&i.isSelectionInListText(r)&&i.selection.selectListText(),!i.owner.isReadOnlyMode&&i.owner.enableImageResizerMode&&i.owner.imageResizerModule.isImageResizing&&(i.owner.imageResizerModule.mouseUpInternal(),i.scrollToPosition(i.owner.selection.start,i.owner.selection.end),i.owner.imageResizerModule.isImageResizing=!1),i.owner.enableImageResizerMode&&i.owner.imageResizerModule.isImageResizerVisible&&!t.isNullOrUndefined(i.selection.caret)&&(i.selection.caret.style.display="none"),i.isMouseDown=!1,i.isFootnoteWidget=!1,i.isSelectionChangedOnMouseMoved=!1,i.isTouchInput=!1,i.useTouchSelectionMark=!0,i.isControlPressed=!1,i.updateFocus(),i.isListTextSelected&&i.selection.hideCaret(),i.owner.enableImageResizerMode){var p=i.owner.imageResizerModule;p.isImageResizing=!1,p.isImageMoveToNextPage=!1,p.leftValue=void 0,p.topValue=void 0}i.isMouseDownInFooterRegion=!1}}},this.onTouchStartInternal=function(e){if(i.selection){if(i.isTouchMoved=!1,i.isCompositionStart=!1,i.isCompositionEnd=!1,i.isCompositionUpdated=!1,i.isCompositionCanceled=!0,i.isTouchInput=!0,i.isTimerStarted?1===i.tapCount?i.tapCount=2:(i.tapCount=3,i.isTimerStarted=!1):(i.isTimerStarted=!0,i.tapCount=1),1===e.touches.length){i.zoomX=e.touches[0].clientX,i.zoomY=e.touches[0].clientY,i.owner.selection.isEmpty&&(i.useTouchSelectionMark=!1),i.isMouseDown=!0,i.isSelectionChangedOnMouseMoved=!1;var n=void 0;if(i.isMouseDown&&(n=i.getTouchOffsetValue(e)),n=i.owner.viewer.findFocusedPage(n,!0),i.owner.enableImageResizerMode){var r=i.owner.imageResizerModule.getImagePointOnTouch(n);i.owner.imageResizerModule.selectedResizeElement=r.selectedElement}i.owner.enableImageResizerMode&&!t.isNullOrUndefined(i.owner.imageResizerModule.selectedResizeElement)&&(i.owner.imageResizerModule.isImageResizing=!0);var o=i.owner.selection.end.location.x,s=i.selection.getCaretBottom(i.owner.selection.end,i.owner.selection.isEmpty)+9;i.touchDownOnSelectionMark=(n.y<=s&&n.y>=s-20||n.y>=s&&n.y<=s+20)&&(n.x<=o&&n.x>=o-20||n.x>=o&&n.x<=o+20)?1:0,i.owner.selection.isEmpty||0!==i.touchDownOnSelectionMark||(o=i.owner.selection.start.location.x,s=i.selection.getCaretBottom(i.owner.selection.start,!1)+9,i.touchDownOnSelectionMark=(n.y<=s&&n.y>=s-20||n.y>=s&&n.y<=s+20)&&(n.x<=o&&n.x>=o-20||n.x>=o&&n.x<=o+20)?2:0)}!t.isNullOrUndefined(i.owner.contextMenuModule)&&i.owner.contextMenuModule.contextMenuInstance&&i.owner.contextMenuModule.contextMenuInstance.close(),(i.touchDownOnSelectionMark||e.touches.length>1)&&e.preventDefault(),i.longTouchTimer=setTimeout(i.onLongTouch,500,e),i.timer=setTimeout(function(){i.isTimerStarted=!1},200)}},this.onLongTouch=function(e){if(!(t.isNullOrUndefined(i.owner)||t.isNullOrUndefined(i.viewerContainer)||i.isTouchMoved||1!==e.touches.length)){var n=i.getTouchOffsetValue(e),r=i.owner.viewer.findFocusedPage(n,!0),o=i.selection.start,s=i.selection.end,a=!1;i.selection.isForward||(o=i.selection.end,s=i.selection.start);var l=o.location,d=s.location;a=o.currentWidget!==s.currentWidget?!(r.x>=l.x&&r.x<=d.x||r.y>=l.y&&r.y<=d.y):!(r.x>=l.x&&r.x<=d.x&&r.y>=l.y&&r.y<=d.y),1===e.changedTouches.length&&a&&(i.updateSelectionOnTouch(n,r),i.isMouseDown=!1,i.touchDownOnSelectionMark=0,i.useTouchSelectionMark=!0,i.isSelectionChangedOnMouseMoved=!1),i.selection.isEmpty&&i.selection.selectCurrentWord(),!t.isNullOrUndefined(i.owner.contextMenuModule)&&i.owner.contextMenuModule.contextMenuInstance&&i.owner.contextMenuModule.onContextMenuInternal(e)}},this.onTouchMoveInternal=function(e){i.isTouchMoved=!0;var n,r=e.touches;if(!t.isNullOrUndefined(i.selection)){if(i.owner.editorModule&&i.owner.enableImageResizerMode&&i.owner.imageResizerModule.isImageResizing)return e.preventDefault(),void(i.owner.imageResizerModule.isImageMoveToNextPage||(i.owner.imageResizerModule.handleImageResizingOnTouch(e),i.selection.caret.style.display="none"));if(i.isMouseDown){n=i.getTouchOffsetValue(e);var o=i.owner.viewer.findFocusedPage(n,!0);if(i.touchDownOnSelectionMark>0){e.preventDefault();var s=o.y,a=i.owner.selection.end;o.y<=26?s-=o.y<0?0:o.y+.5:s-=36.5,a=2===i.touchDownOnSelectionMark?i.selection.start:i.selection.end,o=new R(o.x,s),i.owner.selection.moveTextPosition(o,a),i.isSelectionChangedOnMouseMoved=!0}i.selection.checkForCursorVisibility(),i.updateTouchMarkPosition()}}if(r.length>1){e.preventDefault(),i.isMouseDown=!1,i.zoomX=(r[0].clientX+r[1].clientX)/2,i.zoomY=(r[0].clientY+r[1].clientY)/2;var l=Math.sqrt(Math.pow(r[0].clientX-r[1].clientX,2)+Math.pow(r[0].clientY-r[1].clientY,2));i.preDifference>-1?l>i.preDifference?i.onPinchOutInternal(e):l<i.preDifference&&i.onPinchInInternal(e):i.zoomFactor<2?-1!==i.preDifference&&l>i.preDifference&&i.onPinchInInternal(e):-1===i.preDifference&&i.zoomFactor>2&&l>i.preDifference&&i.onPinchInInternal(e),i.preDifference=l}i.longTouchTimer&&(clearTimeout(i.longTouchTimer),i.longTouchTimer=void 0)},this.onTouchUpInternal=function(e){if(!t.isNullOrUndefined(i.selection)){var n=i.getTouchOffsetValue(e),r=i.owner.viewer.findFocusedPage(n,!0);1===e.changedTouches.length&&((!i.isTouchMoved||i.owner.enableImageResizerMode&&i.owner.imageResizerModule.isImageResizing)&&(i.updateSelectionOnTouch(n,r),t.isNullOrUndefined(i.currentPage)||t.isNullOrUndefined(i.selection.start)||i.isSelectionChangedOnMouseMoved||!(i.selection.isEmpty||i.selection.isImageField()&&(!i.owner.enableImageResizerMode||i.owner.enableImageResizerMode&&!i.owner.imageResizerModule.isImageResizing))||i.selection.navigateHyperLinkOnEvent(r,!0)),i.isMouseDown=!1,i.touchDownOnSelectionMark=0,i.useTouchSelectionMark=!0,i.isSelectionChangedOnMouseMoved=!1),i.owner.enableImageResizerMode&&i.owner.imageResizerModule.isImageResizing&&(i.owner.imageResizerModule.mouseUpInternal(),i.owner.imageResizerModule.isImageResizing=!1,i.owner.imageResizerModule.isImageMoveToNextPage=!1,i.scrollToPosition(i.owner.selection.start,i.owner.selection.end)),i.owner.enableImageResizerMode&&i.owner.imageResizerModule.isImageResizerVisible&&i.isTouchInput&&(i.touchStart.style.display="none",i.touchEnd.style.display="none"),e.preventDefault()}i.preDifference=-1,i.isTouchInput=!1,i.longTouchTimer&&(clearTimeout(i.longTouchTimer),i.longTouchTimer=void 0),i.isTimerStarted||(i.tapCount=1),i.isListTextSelected&&i.selection.hideCaret()},this.onKeyUpInternal=function(e){t.Browser.isDevice&&e.target===i.editableDiv&&window.getSelection().anchorOffset!==i.prefix.length&&i.selection.setEditableDivCaretPosition(i.editableDiv.innerText.length),(e.ctrlKey||17===e.keyCode||17===e.which)&&(i.isControlPressed=!1)},this.onKeyDownInternal=function(e){if(t.isNullOrUndefined(e.target)||e.target===i.editableDiv){var n=!1,r={event:e,isHandled:!1,source:i.owner};if(i.owner.trigger(w,r),!r.isHandled){var o=e.which||e.keyCode,s=!(!e.ctrlKey&&!e.metaKey)||17===o,a=e.shiftKey?e.shiftKey:16===o,l=e.altKey?e.altKey:18===o;if(s&&!a&&!l)switch(o){case 80:e.preventDefault(),i.owner.print(),n=!0;break;case 83:e.preventDefault(),i.owner.save(""===i.owner.documentName?"sample":i.owner.documentName,"Sfdt"),n=!0}n||t.isNullOrUndefined(i.selection)||i.selection.onKeyDownInternal(e,s,a,l),n&&e.preventDefault()}}},this.owner=e,this.pages=[],this.lists=[],this.abstractLists=[],this.render=new Y(this),this.characterFormat=new k(this),this.paragraphFormat=new I(this),this.renderedLists=new u,this.renderedLevelOverrides=[],this.headersFooters=[],this.styles=new V,this.preDefinedStyles=new u,this.initalizeStyles(),this.bookmarks=new u,this.editRanges=new u,this.isIosDevice=/Mac|iPad|iPod/i.test(navigator.userAgent),this.isMobileDevice=/Android|Windows Phone|webOS/i.test(navigator.userAgent),this.formFillPopup=new ie(this.owner),this.customXmlData=new u,this.contentControlCollection=[],this.footnoteCollection=[],this.endnoteCollection=[]}return Object.defineProperty(e.prototype,"visibleBounds",{get:function(){return this.visibleBoundsIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containerCanvas",{get:function(){return t.isNullOrUndefined(this.containerCanvasIn)&&(this.containerCanvasIn=document.createElement("canvas"),this.containerCanvasIn.getContext("2d").save()),t.isNullOrUndefined(this.pageContainer)||this.containerCanvasIn.parentElement===this.pageContainer||this.pageContainer.appendChild(this.containerCanvasIn),this.containerCanvasIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionCanvas",{get:function(){return t.isNullOrUndefined(this.selectionCanvasIn)&&(this.selectionCanvasIn=document.createElement("canvas"),this.selectionCanvas.getContext("2d").save()),t.isNullOrUndefined(this.pageContainer)||this.selectionCanvasIn.parentElement===this.pageContainer||this.pageContainer.appendChild(this.selectionCanvasIn),this.selectionCanvasIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containerContext",{get:function(){return this.containerCanvas.getContext("2d")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionContext",{get:function(){return this.selectionCanvas.getContext("2d")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentRenderingPage",{get:function(){if(0!==this.pages.length)return this.pages[this.pages.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zoomFactor",{get:function(){return this.zoomFactorInternal},set:function(e){this.zoomFactorInternal!==e&&(this.preZoomFactor=this.zoomFactor,this.zoomFactorInternal=e,this.zoomModule.setZoomFactor(),this.owner.zoomFactor=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){return this.owner.selection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionStartPage",{get:function(){return this.selectionStartPageIn},set:function(e){this.selectionStartPageIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionEndPage",{get:function(){return this.selectionEndPageIn},set:function(e){this.selectionEndPageIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dialog",{get:function(){return this.dialogInternal||this.initDialog(this.owner.enableRtl),this.dialogInternal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dialog2",{get:function(){return this.dialogInternal2||this.initDialog2(this.owner.enableRtl),this.dialogInternal2},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dialog3",{get:function(){return this.dialogInternal3||this.initDialog3(this.owner.enableRtl),this.dialogInternal3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentSelectedComment",{get:function(){return this.currentSelectedCommentInternal},set:function(e){this.owner&&this.owner.commentReviewPane&&(this.owner.commentReviewPane.previousSelectedComment=this.currentSelectedCommentInternal),this.currentSelectedCommentInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentSelectedRevision",{get:function(){return this.currentSelectedRevisionInternal},set:function(e){this.currentSelectedRevisionInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInlineFormFillProtectedMode",{get:function(){return this.isFormFillProtectedMode&&"Inline"===this.owner.documentEditorSettings.formFieldSettings.formFillingMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFormFillProtectedMode",{get:function(){return this.isDocumentProtected&&"FormFieldsOnly"===this.protectionType},enumerable:!0,configurable:!0}),e.prototype.initalizeStyles=function(){this.preDefinedStyles.add("Normal",'{"type":"Paragraph","name":"Normal","next":"Normal"}'),this.preDefinedStyles.add("Heading 1",'{"type":"Paragraph","name":"Heading 1","basedOn":"Normal","next":"Normal","link":"Heading 1 Char","characterFormat":{"fontSize":16.0,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":12.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level1"}}'),this.preDefinedStyles.add("Heading 2",'{"type":"Paragraph","name":"Heading 2","basedOn":"Normal","next":"Normal","link":"Heading 2 Char","characterFormat":{"fontSize":13.0,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level2"}}'),this.preDefinedStyles.add("Heading 3",'{"type":"Paragraph","name":"Heading 3","basedOn":"Normal","next":"Normal","link":"Heading 3 Char","characterFormat":{"fontSize":12.0,"fontFamily":"Calibri Light","fontColor":"#1F3763"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level3"}}'),this.preDefinedStyles.add("Heading 4",'{"type":"Paragraph","name":"Heading 4","basedOn":"Normal","next":"Normal","link":"Heading 4 Char","characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#2F5496"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level4"}}'),this.preDefinedStyles.add("Heading 5",'{"type":"Paragraph","name":"Heading 5","basedOn":"Normal","next":"Normal","link":"Heading 5 Char","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#2F5496"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level5"}}'),this.preDefinedStyles.add("Heading 6",'{"type":"Paragraph","name":"Heading 6","basedOn":"Normal","next":"Normal","link":"Heading 6 Char","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#1F3763"},"paragraphFormat":{"leftIndent":0.0,"rightIndent":0.0,"firstLineIndent":0.0,"beforeSpacing":2.0,"afterSpacing":0.0,"lineSpacing":1.0791666507720947,"lineSpacingType":"Multiple","textAlignment":"Left","outlineLevel":"Level6"}}'),this.preDefinedStyles.add("Default Paragraph Font",'{"type":"Character","name":"Default Paragraph Font"}'),this.preDefinedStyles.add("Heading 1 Char",'{"type":"Character","name":"Heading 1 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontSize":16.0,"fontFamily":"Calibri Light","fontColor":"#2F5496"}}'),this.preDefinedStyles.add("Heading 2 Char",'{"type":"Character","name":"Heading 2 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontSize":13.0,"fontFamily":"Calibri Light","fontColor":"#2F5496"}}'),this.preDefinedStyles.add("Heading 3 Char",'{"type":"Character","name":"Heading 3 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontSize":12.0,"fontFamily":"Calibri Light","fontColor": "#1F3763"}}'),this.preDefinedStyles.add("Heading 4 Char",'{"type":"Character","name":"Heading 4 Char","basedOn":"Default Paragraph Font","characterFormat":{"italic":true,"fontFamily":"Calibri Light","fontColor":"#2F5496"}}'),this.preDefinedStyles.add("Heading 5 Char",'{"type":"Character","name":"Heading 5 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#2F5496"}}'),this.preDefinedStyles.add("Heading 6 Char",'{"type":"Character","name":"Heading 6 Char","basedOn":"Default Paragraph Font","characterFormat":{"fontFamily":"Calibri Light","fontColor":"#1F3763"}}'),this.preDefinedStyles.add("Hyperlink",'{"type":"Character","name":"Hyperlink","basedOn":"Default Paragraph Font","next":"Normal","characterFormat":{"fontColor":"#0563C1","underline": "Single"}}'),this.preDefinedStyles.add("Toc1",'{"type":"Paragraph","name":"Toc1","basedOn":"Normal","next":"Normal","paragraphFormat":{"afterSpacing":5.0}}'),this.preDefinedStyles.add("Toc2",'{"type":"Paragraph","name":"Toc2","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :11.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("Toc3",'{"type":"Paragraph","name":"Toc3","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :22.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("Toc4",'{"type":"Paragraph","name":"Toc4","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :33.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("Toc5",'{"type":"Paragraph","name":"Toc5","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :44.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("Toc6",'{"type":"Paragraph","name":"Toc6","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :55.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("Toc7",'{"type":"Paragraph","name":"Toc7","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :66.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("Toc8",'{"type":"Paragraph","name":"Toc8","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :77.0,"afterSpacing":5.0}}'),this.preDefinedStyles.add("Toc9",'{"type":"Paragraph","name":"Toc9","basedOn":"Normal","next":"Normal","paragraphFormat":{"leftIndent" :88.0,"afterSpacing":5.0}}')},e.prototype.clearDocumentItems=function(){this.editRanges.clear(),this.headersFooters=[],this.fields=[],this.formFields=[],this.currentSelectedComment=void 0,this.currentSelectedRevision=void 0;for(var e=0;e<this.comments.length;e++){var t=this.comments[e].commentStart;t&&t.destroy()}this.comments=[],this.bookmarks.clear(),this.styles.clear(),this.authors.clear(),this.revisionsInternal.clear(),this.owner.revisions.destroy(),this.characterFormat.clearFormat(),this.paragraphFormat.clearFormat(),this.owner.trackChangesPane&&this.owner.trackChangesPane.clear(),this.setDefaultCharacterValue(this.characterFormat),this.setDefaultParagraphValue(this.paragraphFormat),this.owner.commentReviewPane&&this.owner.commentReviewPane.clear(),this.isHeaderFooter=!1,this.defaultTabWidth=36,this.isDocumentProtected=!1,this.protectionType="NoProtection",this.restrictFormatting=!1,this.hashValue="",this.saltValue="",this.userCollection=[],this.formFillPopup&&this.formFillPopup.hidePopup(),this.customXmlData.clear(),this.contentControlCollection=[],this.endnotes.clear(),this.footnotes.clear(),this.footnoteCollection=[],this.endnoteCollection=[],this.abstractLists=[],this.lists=[]},e.prototype.setDefaultDocumentFormat=function(){this.owner.parser.parseCharacterFormat(this.owner.characterFormat,this.characterFormat),this.owner.parser.parseParagraphFormat(this.owner.paragraphFormat,this.paragraphFormat)},e.prototype.setDefaultCharacterValue=function(e){e.bold=!1,e.italic=!1,e.fontFamily="Calibri",e.fontSize=11,e.underline="None",e.strikethrough="None",e.fontSizeBidi=11,e.fontFamilyBidi="Calibri",e.baselineAlignment="Normal",e.highlightColor="NoColor",e.fontColor="empty",e.allCaps=!1},e.prototype.setDefaultParagraphValue=function(e){e.leftIndent=0,e.rightIndent=0,e.firstLineIndent=0,e.textAlignment="Left",e.beforeSpacing=0,e.afterSpacing=0,e.lineSpacing=1,e.lineSpacingType="Multiple",e.bidi=!1},e.prototype.getAbstractListById=function(e){if(!t.isNullOrUndefined(this.abstractLists))for(var i=0;i<this.abstractLists.length;i++){var n=this.abstractLists[i];if(n instanceof G&&n.abstractListId===e)return n}},e.prototype.getListById=function(e){if(!t.isNullOrUndefined(this.lists))for(var i=0;i<this.lists.length;i++)if(!t.isNullOrUndefined(this.lists[i])&&this.lists[i].listId===e)return this.lists[i]},e.getListLevelNumber=function(e){return e.ownerBase instanceof F?e.ownerBase.levelNumber:e.ownerBase instanceof G&&!t.isNullOrUndefined(e.ownerBase.levels)?e.ownerBase.levels.indexOf(e):-1},e.prototype.getBookmarks=function(e){for(var t=[],i=0;i<this.bookmarks.keys.length;i++){var n=this.bookmarks.keys[i];(e||0!==n.indexOf("_"))&&t.push(n)}return t},e.prototype.selectComment=function(e){var t=this;this.owner.selection&&this.owner.commentReviewPane&&(this.owner.showComments=!0,setTimeout(function(){t.owner&&t.owner.selection&&t.owner.selection.selectComment(e)}))},e.prototype.showComments=function(e){if(this.owner&&e&&this.owner.enableComment){var t={type:"Comment"};this.owner.trigger("beforePaneSwitch",t)}this.owner.commentReviewPane.reviewTab.hideTab(0,!1),this.owner.commentReviewPane.reviewTab.hideTab(1,!1),this.owner.commentReviewPane.showHidePane(e&&this.owner.enableComment,"Comments")},e.prototype.showRevisions=function(e){if(this.owner&&e){var t={type:"comment"};this.owner.trigger("beforePaneSwitch",t)}!e&&this.owner.showComments?(this.owner.commentReviewPane.reviewTab.hideTab(0,!1),this.owner.commentReviewPane.showHidePane(!0,"Comments")):this.showRevision||this.owner.enableTrackChanges||!this.owner.showRevisions?(this.owner.commentReviewPane.showHidePane(e,"Changes"),this.owner.enableComment,this.showRevision=!1):(this.owner.commentReviewPane.showHidePane(!e,"Changes"),this.owner.showRevisions=!1),e&&this.owner.trackChangesPane.enableDisableButton(!this.owner.isReadOnly)},e.prototype.initializeComponents=function(){var e=this.owner.element;if(!t.isNullOrUndefined(e)){this.optionsPaneContainer=t.createElement("div",{className:"e-documenteditor-optionspane"}),e.appendChild(this.optionsPaneContainer);var i;this.owner.enableRtl&&(i="direction:ltr;"),this.viewerContainer=t.createElement("div",{id:this.owner.containerId+"_viewerContainer"}),this.viewerContainer.style.cssText="position:relative;backgroundColor:#FBFBFB;overflow:auto;"+i,this.optionsPaneContainer.appendChild(this.viewerContainer),this.viewerContainer.tabIndex=0,this.viewerContainer.style.outline="none",this.pageContainer=t.createElement("div",{id:this.owner.containerId+"_pageContainer",className:"e-de-background"}),this.viewerContainer.appendChild(this.pageContainer),this.pageContainer.style.top="0px",this.pageContainer.style.left="0px",this.pageContainer.style.position="relative",this.pageContainer.style.pointerEvents="none",t.Browser.isDevice?this.createEditableDiv(e):this.createEditableIFrame(),this.owner.enableImageResizerMode&&this.owner.imageResizerModule.initializeImageResizer(),this.updateViewerSizeInternal(e),this.layout=new X(this),this.textHelper=new J(this),this.zoomModule=new Z(this),this.initTouchEllipse(),this.wireEvent(),this.restrictEditingPane=new te(this),this.owner.commentReviewPane=new ki(this.owner),this.owner.trackChangesPane=new ne(this.owner,this.owner.commentReviewPane),n.createSpinner({target:this.owner.element,cssClass:"e-spin-overlay"})}},e.prototype.measureScrollbarWidth=function(e){var t=document.createElement("div");t.setAttribute("style","visibility:hidden;overflow:scroll"),e.appendChild(t);var i=document.createElement("div");t.appendChild(i),this.scrollbarWidth=t.getBoundingClientRect().width-i.getBoundingClientRect().width,t.parentNode.removeChild(t)},e.prototype.createEditableDiv=function(e){this.editableDiv=document.createElement("div"),this.editableDiv.contentEditable="true",this.editableDiv.style.position="fixed",this.editableDiv.style.left="-150em",this.editableDiv.style.width="100%",this.editableDiv.style.height="100%",this.editableDiv.id=e.id+"_editableDiv",document.body.appendChild(this.editableDiv)},e.prototype.createEditableIFrame=function(){this.iframe=t.createElement("iframe",{attrs:{scrolling:"no",style:"pointer-events:none;position:absolute;left:0px;top:0px;outline:none;background-color:transparent;width:0px;height:0px;overflow:hidden"},className:"e-de-text-target"}),this.viewerContainer.appendChild(this.iframe),this.initIframeContent()},e.prototype.initIframeContent=function(){t.isNullOrUndefined(this.iframe.contentDocument)||(this.iframe.contentDocument.open(),this.iframe.contentDocument.write('<!DOCTYPE html><html><head></head><body spellcheck="false" style=background-color:transparent;width:100%;height:100%;padding: 0px; margin: 0px; ><div contenteditable="true" style=background-color:transparent;width:100%;height:100%;padding: 0px; margin: 0px;></div></body></html>'),this.iframe.contentDocument.close(),this.editableDiv=this.iframe.contentDocument.body.children[0])},e.prototype.wireEvent=function(){t.isNullOrUndefined(this.selection)||this.selection.initCaret(),this.wireInputEvents(),t.isNullOrUndefined(this.iframe)||this.iframe.addEventListener("load",this.onIframeLoad.bind(this)),this.viewerContainer.addEventListener("scroll",this.scrollHandler),this.viewerContainer.addEventListener("mousedown",this.onMouseDownInternal),this.viewerContainer.addEventListener("keydown",this.onKeyDownInternal),this.viewerContainer.addEventListener("mousemove",this.onMouseMoveInternal),this.viewerContainer.addEventListener("mouseleave",this.onMouseLeaveInternal),this.viewerContainer.addEventListener("mouseenter",this.onMouseEnterInternal),this.viewerContainer.addEventListener("contextmenu",this.onContextMenu),this.viewerContainer.addEventListener("dblclick",this.onDoubleTap),this.viewerContainer.addEventListener("mouseup",this.onMouseUpInternal),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUpInternal),window.addEventListener("mouseup",this.onImageResizer.bind(this)),window.addEventListener("touchend",this.onImageResizer.bind(this)),this.viewerContainer.addEventListener("touchstart",this.onTouchStartInternal),this.viewerContainer.addEventListener("touchmove",this.onTouchMoveInternal),this.viewerContainer.addEventListener("touchend",this.onTouchUpInternal),navigator.userAgent.match("Firefox")&&this.viewerContainer.addEventListener("DOMMouseScroll",this.zoomModule.onMouseWheelInternal.bind(this)),this.viewerContainer.addEventListener("mousewheel",this.zoomModule.onMouseWheelInternal.bind(this))},e.prototype.wireInputEvents=function(){t.isNullOrUndefined(this.editableDiv)||(this.editableDiv.addEventListener("paste",this.onPaste),t.Browser.isDevice?this.editableDiv.addEventListener("input",this.onTextInputInternal):(this.editableDiv.addEventListener("keypress",this.onKeyPressInternal),"chrome"===t.Browser.info.name&&this.editableDiv.addEventListener("textInput",this.onTextInput)),this.editableDiv.addEventListener("blur",this.onFocusOut),this.editableDiv.addEventListener("keydown",this.onKeyDownInternal),this.editableDiv.addEventListener("compositionstart",this.compositionStart),this.editableDiv.addEventListener("compositionupdate",this.compositionUpdated),this.editableDiv.addEventListener("compositionend",this.compositionEnd))},e.prototype.onIframeLoad=function(){t.isNullOrUndefined(this.iframe)||0!==this.iframe.contentDocument.body.children.length||(this.initIframeContent(),this.wireInputEvents())},e.prototype.getEditableDivTextContent=function(){return this.editableDiv.textContent},e.prototype.updateAuthorIdentity=function(){for(var e=this.owner.revisions.changes,t=0;t<e.length;t++)this.getAuthorColor(e[t].author)},e.prototype.getAvatar=function(e,i,n,r){var o,s;if(t.isNullOrUndefined(n)?o=r.author:(o=n.author,s=n.initial),!t.isNullOrUndefined(o)){var a=t.createElement("div",{className:"e-de-cmt-avatar"}),l=t.createElement("div",{className:"e-de-ff-cmt-avatar"});if(l.style.backgroundColor=this.owner.documentHelper.getAuthorColor(o),""===s||t.isNullOrUndefined(s)){var d=o.split(" "),h=d[0].charAt(0);d.length>1&&(h+=d[d.length-1][0]),l.innerText=h.toUpperCase()}else s.length>2?l.innerText=s.substring(0,2):l.innerText=s;a.appendChild(l),a.appendChild(i),e.appendChild(a)}},e.prototype.getAuthorColor=function(e){if(this.authors.containsKey(e))return this.authors.get(e);var t=this.owner.userColor;return e!==this.owner.currentUser&&(t=0===this.authors.length&&"#b5082e"!==t?"#b5082e":this.generateRandomColor()),this.authors.add(e,t),t},e.prototype.generateRandomColor=function(){return["#b5082e","#2e97d3","#bb00ff","#f37e43","#03a60b","#881824","#e09a2b","#50565e"][this.authors.length%8]},e.prototype.positionEditableTarget=function(){var e=this.selection.getRect(this.selection.start),t=this.selection.getSelectionPage(this.selection.start),i=t.bodyWidgets[0].sectionFormat,n=t.boundingRectangle.x+L.convertPointToPixel(i.leftMargin)*this.zoomFactor,r=e.y,o=i.pageWidth-i.leftMargin-i.rightMargin,s="left:"+n+"px;";s+="top:"+r+"px;",s+="width:"+L.convertPointToPixel(o)*this.zoomFactor+"px;",s+="height:250px;outline-style:none;position:absolute",this.iframe.setAttribute("style",s);var a="background-color:transparent;width:100%;height:250px;padding: 0px; margin: 0px;";a+="text-indent:"+(e.x-n)+"px;",a+="color:transparent;pointer-events:none;outline-style:none;",a+="font-size:"+L.convertPointToPixel(this.selection.characterFormat.fontSize)*this.zoomFactor+"px;",a+="font-family"+this.selection.characterFormat.fontFamily+";",a+="overflow:hidden;text-decoration:none;white-space:normal;",this.editableDiv.setAttribute("style",a)},e.prototype.onImageResizer=function(e){!t.isNullOrUndefined(this.owner)&&!t.isNullOrUndefined(this.owner.imageResizerModule)&&this.owner.imageResizerModule.isImageResizerVisible&&this.owner.imageResizerModule.isImageResizing&&(e instanceof MouseEvent?this.onMouseUpInternal(e):e instanceof TouchEvent&&this.onTouchUpInternal(e)),this.scrollMoveTimer&&(this.isMouseEntered=!0,clearInterval(this.scrollMoveTimer))},e.prototype.initDialog=function(e){this.dialogInternal||(this.dialogTarget1=t.createElement("div",{className:"e-de-dlg-target"}),document.body.appendChild(this.dialogTarget1),e&&this.dialogTarget1.classList.add("e-de-rtl"),this.dialogInternal=new n.Dialog({target:document.body,showCloseIcon:!0,allowDragging:!0,enableRtl:e,visible:!1,width:"1px",isModal:!0,position:{X:"center",Y:"center"},zIndex:this.owner.zIndex+20,animationSettings:{effect:"None"}}),this.dialogInternal.isStringTemplate=!0,this.dialogInternal.open=this.selection.hideCaret,this.dialogInternal.beforeClose=this.updateFocus,this.dialogInternal.appendTo(this.dialogTarget1))},e.prototype.initDialog3=function(e){this.dialogInternal3||(this.dialogTarget3=t.createElement("div",{className:"e-de-dlg-target"}),document.body.appendChild(this.dialogTarget3),e&&this.dialogTarget3.classList.add("e-de-rtl"),this.dialogInternal3=new n.Dialog({target:document.body,showCloseIcon:!0,allowDragging:!0,enableRtl:e,visible:!1,width:"1px",isModal:!0,position:{X:"center",Y:"center"},zIndex:this.owner.zIndex,animationSettings:{effect:"None"}}),this.dialogInternal3.isStringTemplate=!0,this.dialogInternal3.open=this.selection.hideCaret,this.dialogInternal3.beforeClose=this.updateFocus,this.dialogInternal3.appendTo(this.dialogTarget3))},e.prototype.hideDialog=function(){this.dialog.hide(),this.updateFocus()},e.prototype.initDialog2=function(e){this.dialogInternal2||(this.dialogTarget2=t.createElement("div",{className:"e-de-dlg-target"}),document.body.appendChild(this.dialogTarget2),e&&this.dialogTarget2.classList.add("e-de-rtl"),this.dialogInternal2=new n.Dialog({target:document.body,showCloseIcon:!0,allowDragging:!0,enableRtl:e,visible:!1,width:"1px",isModal:!0,position:{X:"center",Y:"Top"},zIndex:this.owner.zIndex+10}),this.dialogInternal2.isStringTemplate=!0,this.dialogInternal2.appendTo(this.dialogTarget2))},e.prototype.clearContent=function(){if(this.containerContext.clearRect(0,0,this.containerCanvas.width,this.containerCanvas.height),this.selectionContext.clearRect(0,0,this.selectionCanvas.width,this.selectionCanvas.height),this.pageContainer)for(var e=this.pageContainer.getElementsByClassName("e-de-cmt-mark"),t=0;t<e.length;t++)e[t].style.display="none";if(this.pageContainer)for(var i=this.pageContainer.getElementsByClassName("e-de-lock-mark"),t=0;t<i.length;t++)i[t].style.display="none"},e.prototype.onDocumentChanged=function(e){this.clearContent(),this.owner.editorModule&&(this.owner.editorModule.tocStyles={},this.owner.editorModule.tocBookmarkId=0),this.heightInfoCollection={},this.owner.isDocumentLoaded=!1,this.updateAuthorIdentity();for(var i=0;i<this.pages.length;i++)this.pages[i].bodyWidgets[0].destroy();this.pages=[],t.isNullOrUndefined(this.renderedLists)||this.renderedLists.clear(),t.isNullOrUndefined(this.renderedLevelOverrides)||(this.renderedLevelOverrides=[]),t.isNullOrUndefined(this.owner.editorHistory)||this.owner.editorHistory.destroy(),this.owner.isDocumentLoaded=!0,this.layout.isInitialLoad=!0,this.layout.footHeight=0,this.layout.footnoteHeight=0,this.layout.layoutItems(e,!1),this.owner.selection&&(this.selection.previousSelectedFormField=void 0,this.formFields.length>0&&this.owner.selection.highlightFormFields(),this.owner.selection.editRangeCollection=[],this.owner.selection.selectRange(this.owner.documentStart,this.owner.documentStart),this.isDocumentProtected&&this.restrictEditingPane.showHideRestrictPane(!0)),this.owner.optionsPaneModule&&this.owner.optionsPaneModule.showHideOptionsPane(!1),this.restrictEditingPane.restrictPane&&!this.isDocumentProtected&&this.restrictEditingPane.showHideRestrictPane(!1),!t.isNullOrUndefined(this.owner.selection)&&this.owner.selection.isViewPasteOptions&&(this.owner.selection.isViewPasteOptions=!1,this.owner.selection.showHidePasteOptions(void 0,void 0)),this.owner.fireDocumentChange()},e.prototype.initTouchEllipse=function(){var e="height: 30px;width: 30px;position: absolute;background-color: transparent;margin: 0px;padding: 0px;z-index:5",i=" height: 12px;width: 12px;border-radius: 50%;background-color: white;position: absolute;margin: 0px 6px 0px 6px;border-width: 2px;border-style: solid;border-color: #000000;box-sizing: unset;";this.touchStart=t.createElement("div",{className:"e-touch-ellipse",styles:e});var n=t.createElement("div",{styles:i});this.touchEnd=t.createElement("div",{className:"e-touch-ellipse",styles:e}),this.touchStart.style.display="none";var r=t.createElement("div",{styles:i});this.touchStart.appendChild(n),this.touchEnd.appendChild(r),this.touchEnd.style.display="none",this.viewerContainer.appendChild(this.touchStart),this.viewerContainer.appendChild(this.touchEnd)},e.prototype.updateTouchMarkPosition=function(){if("none"!==this.touchStart.style.display&&!t.isNullOrUndefined(this.selection))if(this.selection.isEmpty)this.selection.updateCaretPosition();else{var e=this.selection.getCaretBottom(this.selection.start,!1),i=this.selection.getPage(this.selection.start.paragraph),n=i.boundingRectangle.y-this.owner.viewer.pageGap*(this.pages.indexOf(i)+1)*this.zoomFactor+this.owner.viewer.pageGap*(this.pages.indexOf(i)+1);this.touchStart.style.left=i.boundingRectangle.x+(Math.round(this.selection.start.location.x)*this.zoomFactor-14)+"px",this.touchStart.style.top=n+e*this.zoomFactor+"px",this.selection.isEmpty||(e=this.selection.getCaretBottom(this.selection.end,!1),i=this.selection.getPage(this.selection.end.paragraph)),this.touchEnd.style.left=i.boundingRectangle.x+(Math.round(this.selection.end.location.x)*this.zoomFactor-14)+"px",this.touchEnd.style.top=n+e*this.zoomFactor+"px"}},e.prototype.scrollForwardOnSelection=function(e){if(this.viewerContainer){this.viewerContainer.scrollTop=this.viewerContainer.scrollTop+200;var t=this.owner.viewer.findFocusedPage(e,!this.owner.enableHeaderAndFooter),i=this.owner.selection.end;this.owner.enableImageResizerMode&&this.owner.imageResizerModule.isImageResizerVisible&&!this.owner.imageResizerModule.isShapeResize||this.owner.selection.moveTextPosition(t,i)}},e.prototype.scrollBackwardOnSelection=function(e){this.viewerContainer.scrollTop=this.viewerContainer.scrollTop-200;var t=this.owner.viewer.findFocusedPage(e,!this.owner.enableHeaderAndFooter),i=this.owner.selection.end;this.owner.enableImageResizerMode&&this.owner.imageResizerModule.isImageResizerVisible&&!this.owner.imageResizerModule.isShapeResize||this.owner.selection.moveTextPosition(t,i)},e.prototype.isSelectionInListText=function(e){var i=this.getLineWidget(e);if(!t.isNullOrUndefined(i)&&i.children[0]instanceof Qe){var n=this.getLeftValue(i),r=i.children[0].width,o=i.children[0].height;if(this.isInsideRect(n,i.paragraph.y,r,o,e))return this.selectionLineWidget=i,!0}return!1},e.prototype.isInShapeBorder=function(e,i){if(!t.isNullOrUndefined(e)){var n=e.width,r=e.height;if(this.isInsideRect(e.x-e.margin.left,e.y-e.margin.top,n,r,i)){if(e instanceof Ze)return!0;if(e instanceof Ke){var o=e.lineFormat.weight;if(!this.isInsideRect(e.x+o,e.y+o+e.textFrame.marginTop,n-2*o,r-(2*o+e.textFrame.marginTop+e.textFrame.marginBottom),i))return!0}}}return!1},e.prototype.isInsideRect=function(e,t,i,n,r){return r.x>e&&r.x<=e+i&&r.y>t&&r.y<=t+n},e.prototype.getLeftValue=function(e){var t=e.paragraph.x,i=e.paragraph.paragraphFormat;this.selection.isParagraphFirstLine(e)&&("Right"===i.textAlignment?(t-=L.convertPointToPixel(i.firstLineIndent),t-=L.convertPointToPixel(i.leftIndent)):t+=L.convertPointToPixel(i.firstLineIndent));var n=e.children[0];return n instanceof Qe&&(t+=n.margin.left),t},e.prototype.isLeftButtonPressed=function(e){return this.isTouchInput=!1,1===(e.which||e.button)},e.prototype.updateSelectionOnTouch=function(e,i){this.zoomX=void 0,this.zoomY=void 0,!this.isMouseDown||this.isSelectionChangedOnMouseMoved||t.isNullOrUndefined(this.currentPage)||t.isNullOrUndefined(this.owner.selection.start)||(0===this.touchDownOnSelectionMark&&(this.updateTextPositionForSelection(new R(i.x,i.y),this.tapCount),2===this.tapCount&&this.selection.checkAndEnableHeaderFooter(e,i)),this.owner.selection.isEmpty&&this.selection.updateCaretPosition(),this.selection.checkForCursorVisibility(),t.isNullOrUndefined(this.currentSelectedComment)||!this.owner.commentReviewPane||this.owner.commentReviewPane.commentPane.isEditMode||(this.currentSelectedComment=void 0))},e.prototype.getTouchOffsetValue=function(e){var i=this.viewerContainer.getBoundingClientRect(),n=e.touches[0];t.isNullOrUndefined(n)&&(n=e.changedTouches[0]);var r=n.pageX-i.left,o=n.pageY-i.top;return new R(r,o)},e.prototype.onPinchInInternal=function(e){this.preZoomFactor=this.zoomFactor;var t=this.zoomFactor-.01;t<5&&t>2&&(t-=.01),t<.1&&(t=.1),this.zoomFactor=t},e.prototype.onPinchOutInternal=function(e){this.preZoomFactor=this.zoomFactor;var t=this.zoomFactor+.01;t>2&&(t+=.01),t>5&&(t=5),this.zoomFactor=t},e.prototype.getPageWidth=function(e){return e.boundingRectangle.width},e.prototype.removePage=function(e){this.currentPage===e&&(this.currentPage=void 0);var i=this.pages.indexOf(e);if(this.pages.splice(i,1),!t.isNullOrUndefined(this.owner.viewer.visiblePages)&&this.owner.viewer.visiblePages.indexOf(e)>-1){var n=this.owner.viewer.visiblePages.indexOf(e);this.owner.viewer.visiblePages.splice(n,1)}for(var r=0,o=0;o<this.pages.length;o++)r+=this.pages[o].boundingRectangle.height;r-=e.boundingRectangle.height+20;var s=20;if(i>0&&(s+=this.pages[i-1].boundingRectangle.bottom),-1!==i)for(o=i;o<this.pages.length;o++)(e=this.pages[o]).boundingRectangle=new ce(e.boundingRectangle.x,s,e.boundingRectangle.width,e.boundingRectangle.height),s=e.boundingRectangle.bottom+20,e.repeatHeaderRowTableWidget=!1},e.prototype.updateViewerSize=function(){var e=this,i=this.owner.getDocumentEditorElement();this.updateViewerSizeInternal(i),this.owner.viewer.updateScrollBars(),this.owner.viewer instanceof de&&!t.isNullOrUndefined(this.owner)&&!t.isNullOrUndefined(i)&&(this.resizerTimer&&clearTimeout(this.resizerTimer),this.resizerTimer=setTimeout(function(){if(!t.isNullOrUndefined(e.owner)){var i=void 0;i=t.isNullOrUndefined(e.visibleBounds)?0:e.visibleBounds.width,t.isNullOrUndefined(e.owner.viewer.preVisibleWidth)&&(e.owner.viewer.preVisibleWidth=0),t.isNullOrUndefined(e.visibleBounds)||i===e.owner.viewer.preVisibleWidth||(e.owner.editorModule.layoutWholeDocument(),e.owner.viewer.preVisibleWidth=i),e.resizerTimer&&clearTimeout(e.resizerTimer)}},50)),t.isNullOrUndefined(this.selection)||this.selection.updateCaretPosition()},e.prototype.updateViewerSizeInternal=function(e){if(!t.isNullOrUndefined(e)){var i=e.getBoundingClientRect(),n=0,r=0;r=i.height>0?i.height:200;var o=this.restrictEditingPane&&this.restrictEditingPane.isShowRestrictPane?this.restrictEditingPane.restrictPane.getBoundingClientRect():void 0,s=this.owner.optionsPaneModule&&this.owner.optionsPaneModule.isOptionsPaneShow?this.owner.optionsPaneModule.optionsPane.getBoundingClientRect():void 0,a=this.owner.commentReviewPane&&this.owner.commentReviewPane.parentPaneElement?this.owner.commentReviewPane.parentPaneElement.getBoundingClientRect():void 0;if(o||s||a){var l=o?o.width:0;l+=s?s.width:0,l+=a?a.width:0,n=i.width-l>0?i.width-l:200}else n=i.width>0?i.width:200;this.viewerContainer.style.height=r.toString()+"px",this.viewerContainer.style.width=Math.ceil(n)+"px",this.visibleBoundsIn=new ce(0,0,n,r),this.containerCanvas.width=n,this.containerCanvas.height=r,this.selectionCanvas.width=n,this.selectionCanvas.height=r,this.measureScrollbarWidth(e)}},e.prototype.insertPage=function(e,t){this.pages.indexOf(t)>-1&&this.pages.splice(this.pages.indexOf(t),1),this.pages.splice(e,0,t);var i=20;e>0&&(i+=this.pages[e-1].boundingRectangle.bottom);for(var n=e;n<this.pages.length;n++)(t=this.pages[n]).boundingRectangle=new ce(t.boundingRectangle.x,i,t.boundingRectangle.width,t.boundingRectangle.height),i=t.boundingRectangle.bottom+20},e.prototype.updateTextPositionForSelection=function(e,i){var n=this.getLineWidget(e);if(t.isNullOrUndefined(n)||this.selection.updateTextPosition(n,e),i>1){if(this.isMouseDown=!1,this.useTouchSelectionMark=!1,0===this.pages.length)return;t.isNullOrUndefined(this.currentPage)||t.isNullOrUndefined(this.owner.selection.start)||(i%2==0?this.owner.selection.selectCurrentWord():this.owner.selection.selectParagraph())}},e.prototype.scrollToPosition=function(e,i,n){if(this.skipScrollToPosition||this.isWebPrinting)return void(this.skipScrollToPosition=!1);if(!(this.owner.enableImageResizerMode&&this.owner.imageResizerModule.isImageResizing||this.isMouseDownInFooterRegion||this.isRowOrCellResizing)){var r=this.selection.getLineWidgetInternal(i.currentWidget,i.offset,!0);if(!t.isNullOrUndefined(r)){this.selection.getTop(r);if(this.isMouseDown){var o=this.selection.getLineWidgetInternal(i.currentWidget,i.offset,!1),s=this.selection.getTop(o);o!==r&&i.location.y>=s&&(r=o)}r.height;var a=this.selection.getPage(r.paragraph);this.currentPage=a;var l=0,d=0;this.owner.viewer,this.owner.viewer;if(!t.isNullOrUndefined(a)){var h=a.boundingRectangle.width;(l=(this.visibleBounds.width-h*this.zoomFactor)/2)<30&&(l=30),d=a.boundingRectangle.y*this.zoomFactor+(this.pages.indexOf(a)+1)*this.owner.viewer.pageGap*(1-this.zoomFactor);var c=this.owner.viewer.containerTop,p=this.owner.viewer.containerLeft,g=this.visibleBounds.height,u=this.selection.updateCaretSize(this.owner.selection.end,!0),m=u.topMargin,f=u.height;l+=i.location.x*this.zoomFactor,c+20>(d+=(i.location.y+m)*this.zoomFactor)?this.viewerContainer.scrollTop=d-10:c+g<d+f&&(this.viewerContainer.scrollTop=d+f-g+10),n||this.selection.updateCaretToPage(e,a);var v=this.viewerContainer.offsetWidth-this.viewerContainer.clientWidth;p>l?this.viewerContainer.scrollLeft=l-this.pageContainer.offsetWidth/100*20:p+this.visibleBounds.width<l+v&&(this.viewerContainer.scrollLeft=p+this.pageContainer.offsetWidth/100*15+v)}}}},e.prototype.getLineWidget=function(e){return this.getLineWidgetInternal(e,!1)},e.prototype.getLineWidgetInternal=function(e,i){var n=void 0;if(!t.isNullOrUndefined(this.currentPage)){var r=void 0;if(this.owner.enableHeaderAndFooter){var o=this.currentPage,s=o.boundingRectangle.height,a=Math.max(o.headerWidget.y+o.headerWidget.height,L.convertPointToPixel(o.bodyWidgets[0].sectionFormat.topMargin))*this.zoomFactor,l=L.convertPointToPixel(o.bodyWidgets[0].sectionFormat.footerDistance),d=o.boundingRectangle.height-Math.max(o.footerWidget.height+l,2*l);if(i?r=this.isBlockInHeader(this.selection.start.paragraph)?this.currentPage.headerWidget:this.currentPage.footerWidget:e.y<=s&&e.y>=d?r=this.currentPage.footerWidget:e.y>=0&&e.y<=a&&(r=this.currentPage.headerWidget),t.isNullOrUndefined(r))return;var h=this.checkFloatingItems(r,e,i);return h.isShapeSelected?h.isInShapeBorder?h.element.line:this.selection.getLineWidgetBodyWidget(h.element.textFrame,e):this.selection.getLineWidgetBodyWidget(r,e)}var c=this.checkFloatingItems(this.currentPage.bodyWidgets[0],e,i);if(c.isShapeSelected){if(c.isInShapeBorder)return c.element.line;c.element instanceof Ke&&(n=this.selection.getLineWidgetBodyWidget(c.element.textFrame,e))}else if(i&&this.isFootnoteWidget){if(void 0!==this.selection.start.paragraph.footNoteReference&&this.selection.start.paragraph.containerWidget instanceof be&&"Footnote"===this.selection.start.paragraph.containerWidget.footNoteType)return this.selection.getLineWidgetBodyWidget(this.currentPage.footnoteWidget,e);if(void 0!==this.selection.start.paragraph.footNoteReference&&this.selection.start.paragraph.containerWidget instanceof be&&"Endnote"===this.selection.start.paragraph.containerWidget.footNoteType)return this.selection.getLineWidgetBodyWidget(this.currentPage.endnoteWidget,e)}else if(!i&&this.currentPage.footnoteWidget&&this.isInFootnoteWidget(this.currentPage.footnoteWidget,e))(n=this.selection.getLineWidgetBodyWidget(this.currentPage.footnoteWidget,e))&&(this.isFootnoteWidget=!0);else if(!i&&this.currentPage.endnoteWidget&&this.isInFootnoteWidget(this.currentPage.endnoteWidget,e))(n=this.selection.getLineWidgetBodyWidget(this.currentPage.endnoteWidget,e))&&(this.isFootnoteWidget=!0);else for(var p=0;p<this.currentPage.bodyWidgets.length;p++){var g=this.currentPage.bodyWidgets[p];if(n=this.selection.getLineWidgetBodyWidget(g,e),!t.isNullOrUndefined(n)){this.isFootnoteWidget=!1;break}}}return n},e.prototype.isInFootnoteWidget=function(e,t){for(var i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];if(n instanceof ue&&n.y<=t.y&&n.y+n.height>=t.y)return!0}return!1},e.prototype.checkFloatingItems=function(e,t,i){var n,r=!1,o=!1,s=this.selection.isInShape,a=i&&s;if(e.floatingElements.length>0){this.currentPage;if(e.floatingElements.sort(function(e,t){return e instanceof xe||t instanceof xe?0:e.zOrderPosition-t.zOrderPosition}),a){var l=this.owner.selection.getCurrentTextFrame();l&&(n=l.containerShape,r=!0)}else{for(var d=0;d<e.floatingElements.length;d++)if(!(e.floatingElements[d]instanceof xe)&&(n=e.floatingElements[d],t.x<n.x+n.margin.left+n.width&&t.x>n.x&&t.y<n.y+n.margin.top+n.height&&t.y>n.y)){r=!0,this.isInShapeBorder(n,t)&&(o=!0);break}i&&!s&&(r=!1)}}return{element:n,caretPosition:t,isShapeSelected:r,isInShapeBorder:o}},e.prototype.isBlockInHeader=function(e){for(;!(e.containerWidget instanceof ve);){if(!e.containerWidget)return!1;(e=e.containerWidget)instanceof Xe&&(e=e.containerShape.paragraph)}return-1!==e.containerWidget.headerFooterType.indexOf("Header")},e.prototype.clearSelectionHighlight=function(){!this.isControlPressed||this.isMouseDown,this.owner.selection.clearSelectionHighlightInSelectedWidgets()&&this.selectionContext.clearRect(0,0,this.selectionCanvas.width,this.selectionCanvas.height)},e.prototype.removeEmptyPages=function(){for(var e=!1,t=0;t<this.pages.length;t++){var i=this.pages[t];0!==i.bodyWidgets.length&&0!==i.bodyWidgets[0].childWidgets.length||(t===this.pages.length-1&&this.owner.viewer instanceof le&&-1!==this.owner.viewer.visiblePages.indexOf(this.pages[t])&&(e=!0),this.removePage(this.pages[t]),t--)}e&&this.scrollToBottom()},e.prototype.scrollToBottom=function(){if(this.selection.start.paragraph&&this.selection.start.paragraph.bodyWidget){var e=this.selection.start.paragraph.bodyWidget.page,t=this.visibleBounds.height;this.viewerContainer.scrollTop=e.boundingRectangle.bottom-t}},e.prototype.getFieldResult=function(e,i){if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(this.selection)){var n=this.selection.getFieldCode(e).split("*"),r=n[0].replace(/[^\w\s]/gi,"").trim().toLowerCase(),o="";switch(n.length>1&&(o=n[1].replace(/[^\w\s]/gi,"").trim()),r=r.match("numpages")||r.match("sectionpages")||!r.match("page")?r:"page"){case"page":if(i.bodyWidgets[0].sectionFormat.restartPageNumbering&&0!==i.sectionIndex){var s=i.sectionIndex,a=i.previousPage;return s!==a.sectionIndex?(i.currentPageNum=i.bodyWidgets[0].sectionFormat.pageStartingNumber,this.getFieldText(o,i.currentPageNum)):(1===a.currentPageNum&&(a.currentPageNum=i.bodyWidgets[0].sectionFormat.pageStartingNumber),i.currentPageNum=a.currentPageNum+1,this.getFieldText(o,i.currentPageNum))}return i.bodyWidgets[0].sectionFormat.restartPageNumbering&&0===i.sectionIndex?(i.currentPageNum=i.bodyWidgets[0].sectionFormat.pageStartingNumber+i.index,this.getFieldText(o,i.currentPageNum)):(i.currentPageNum=t.isNullOrUndefined(i.previousPage)?i.index+1:i.previousPage.currentPageNum+1,i.currentPageNum=i.index+1,this.getFieldText(o,i.currentPageNum));case"numpages":return this.getFieldText(o,i.documentHelper.pages.length);case"sectionpages":for(var l=i.sectionIndex,d=0,h=0;h<i.documentHelper.pages.length;h++)if(i.documentHelper.pages[h].sectionIndex===l)d++;else if(0!==d)break;return this.getFieldText(o,d)}}return""},e.prototype.getFieldText=function(e,t){switch(e){case"ALPHABETIC":return this.layout.getAsLetter(t).toUpperCase();case"alphabetic":return this.layout.getAsLetter(t).toLowerCase();case"roman":return this.layout.getAsRoman(t).toLowerCase();case"ROMAN":return this.layout.getAsRoman(t).toUpperCase();default:return t.toString()}},e.prototype.destroy=function(){t.isNullOrUndefined(this.owner)||this.unWireEvent(),this.pages=[],this.pages=void 0,this.fieldStacks=[],this.fieldStacks=void 0,this.splittedCellWidgets=[],this.splittedCellWidgets=void 0,this.fields=[],this.fields=void 0,this.layout&&this.layout.destroy(),this.layout=void 0,t.isNullOrUndefined(this.render)||this.render.destroy(),this.render=void 0,this.dialogInternal&&this.dialogInternal.destroy(),this.dialogInternal=void 0,this.dialogInternal2&&(this.dialogInternal2.destroy(),this.dialogInternal2=void 0),this.dialogInternal3&&(this.dialogInternal3.destroy(),this.dialogInternal3=void 0),this.dialogTarget1&&this.dialogTarget1.parentElement&&this.dialogTarget1.parentElement.removeChild(this.dialogTarget1),this.dialogTarget1=void 0,this.dialogTarget2&&this.dialogTarget2.parentElement&&this.dialogTarget2.parentElement.removeChild(this.dialogTarget2),this.dialogTarget2=void 0,this.dialogTarget3&&this.dialogTarget3.parentElement&&this.dialogTarget3.parentElement.removeChild(this.dialogTarget3),this.dialogTarget3=void 0,t.isNullOrUndefined(this.touchStart)||(this.touchStart.innerHTML=""),this.textHelper&&this.textHelper.destroy(),this.textHelper=void 0,this.touchStart=void 0,t.isNullOrUndefined(this.touchEnd)||(this.touchEnd.innerHTML=""),this.touchEnd=void 0,t.isNullOrUndefined(this.containerCanvasIn)||(this.containerCanvasIn.innerHTML=""),this.containerCanvasIn=void 0,t.isNullOrUndefined(this.selectionCanvasIn)||(this.selectionCanvasIn.innerHTML=""),this.selectionCanvasIn=void 0,t.isNullOrUndefined(this.editableDiv)||(this.editableDiv.innerHTML="",this.editableDiv.parentElement.removeChild(this.editableDiv)),this.editableDiv=void 0,t.isNullOrUndefined(this.pageContainer)||(this.pageContainer.innerHTML=""),this.pageContainer=void 0,t.isNullOrUndefined(this.viewerContainer)||(this.viewerContainer.innerHTML=""),this.viewerContainer=void 0,this.owner=void 0,this.heightInfoCollection=void 0},e.prototype.unWireEvent=function(){this.viewerContainer.removeEventListener("scroll",this.scrollHandler),this.viewerContainer.removeEventListener("mousedown",this.onMouseDownInternal),this.viewerContainer.removeEventListener("mousemove",this.onMouseMoveInternal),t.Browser.isDevice?this.editableDiv.removeEventListener("input",this.onTextInputInternal):(this.editableDiv.removeEventListener("keypress",this.onKeyPressInternal),"chrome"===t.Browser.info.name&&this.editableDiv.removeEventListener("textInput",this.onTextInput)),this.editableDiv.removeEventListener("paste",this.onPaste),this.viewerContainer.removeEventListener("contextmenu",this.onContextMenu),this.editableDiv.removeEventListener("blur",this.onFocusOut),this.editableDiv.removeEventListener("keydown",this.onKeyDownInternal),this.editableDiv.removeEventListener("compositionstart",this.compositionStart),this.editableDiv.removeEventListener("compositionupdate",this.compositionUpdated),this.editableDiv.removeEventListener("compositionend",this.compositionEnd),this.viewerContainer.removeEventListener("mouseup",this.onMouseUpInternal),t.isNullOrUndefined(this.iframe)||this.iframe.removeEventListener("load",this.onIframeLoad),this.viewerContainer.removeEventListener("dblclick",this.onDoubleTap),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUpInternal),window.removeEventListener("mouseup",this.onImageResizer.bind(this)),window.removeEventListener("touchend",this.onImageResizer.bind(this))},e.prototype.updateCursor=function(e){var i,n,r,o=void 0,s=void 0,a=this.viewerContainer,l=new R(e.offsetX,e.offsetY),d=this.owner.viewer.findFocusedPage(l,!0),h=this.getLineWidget(d),c=this.owner.isReadOnlyMode?void 0:this.owner.editorModule,p=!!c&&c.tableResize.isInRowResizerArea(d),g=!!c&&c.tableResize.isInCellResizerArea(d),u=this.selection.checkAllFloatingElements(h,d),m="";if(this.owner.enableImageResizerMode){var f=this.owner.imageResizerModule.getImagePoint(d);this.owner.imageResizerModule.selectedResizeElement=f.selectedElement,m=f.resizePosition}var v=0,y=void 0;if(!t.isNullOrUndefined(h)){if(v=this.selection.getLineStartLeft(h),o=this.selection.getHyperLinkFieldInCurrentSelection(h,d),t.isNullOrUndefined(o)&&(y=this.selection.getHyperLinkFieldInCurrentSelection(h,d,!0)),!t.isNullOrUndefined(o)){var b=this.selection.getFieldCode(o);0!==b.toLowerCase().indexOf("ref ")||b.match("\\h")||(o=void 0)}if(i=this.selection.updateTextPositionIn(h,void 0,0,d,!0),n=this.selection.getLeft(h),r=this.selection.getTop(h),t.isNullOrUndefined(o)&&!t.isNullOrUndefined(y)&&this.isDocumentProtected&&"FormFieldsOnly"===this.protectionType&&!this.isFormFilling?this.selection.setHyperlinkContentToToolTip(y,h,d.x,!0):this.selection.setHyperlinkContentToToolTip(o,h,d.x,!1),y){var w=y.formFieldData instanceof Ee&&"Text"===y.formFieldData.type;"Inline"===this.owner.documentEditorSettings.formFieldSettings.formFillingMode&&w&&(y=void 0)}if(this.owner.enableLockAndEdit){var C=!1,x=h.paragraph;x.isInsideTable&&(x=this.layout.getParentTable(x)),x.locked&&x.lockedBy!==this.owner.currentUser&&(C=!0);var F=h.paragraph.bodyWidget.sectionFormat,P=F.pageWidth-F.rightMargin-F.leftMargin;P=L.convertPointToPixel(P)*this.zoomFactor,this.viewer instanceof de&&(P=(this.visibleBounds.width-5*this.viewer.padding.right)/this.zoomFactor),C&&d.x>=v&&d.x<v+P?this.selection.setLockInfoTooptip(h,d.x,x.lockedBy):this.selection.setLockInfoTooptip(void 0,d.x,"")}}t.isNullOrUndefined(h)||t.isNullOrUndefined(s)&&"Pages"==this.owner.layoutType&&(s=this.selection.getFootNoteElementInCurrentSelection(h,d))instanceof Le&&this.selection.setFootnoteContentToToolTip(s,h,d.x);var T=this.isIosDevice?e.metaKey:e.ctrlKey;if(!t.isNullOrUndefined(o)&&(T&&this.owner.useCtrlClickToFollowHyperlink||!this.owner.useCtrlClickToFollowHyperlink)||y)return void(t.isNullOrUndefined(y)?a.style.cursor="pointer":this.isFormFillProtectedMode&&(a.style.cursor="default"));d.x>=v&&e.offsetX<this.visibleBounds.width-(this.visibleBounds.width-this.viewerContainer.clientWidth)&&e.offsetY<this.visibleBounds.height-(this.visibleBounds.height-this.viewerContainer.clientHeight)?this.selection.isEmpty?a.style.cursor="text":a.style.cursor=this.selection.checkCursorIsInSelection(h,d)?"default":"text":a.style.cursor="default",t.isNullOrUndefined(m)||""===m?!t.isNullOrUndefined(i)&&i.isImageSelected&&n<d.x&&r<d.y&&n+h.width>d.x&&r+h.height>d.y&&(a.style.cursor="move"):(!this.owner.imageResizerModule.isShapeResize||this.owner.imageResizerModule.isShapeResize&&"move"!==m)&&(a.style.cursor=m),p?a.style.cursor="row-resize":g&&(a.style.cursor="col-resize"),u.isInShapeBorder&&(a.style.cursor="all-scroll")},e}(),ae=function(){function e(e){this.visiblePages=[],this.padding=new pe(10,10,10,10),this.textWrap=!0,this.pageFitTypeIn="None",this.containerTop=0,this.containerLeft=0,this.owner=e}return Object.defineProperty(e.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageFitType",{get:function(){return this.pageFitTypeIn},set:function(e){this.pageFitTypeIn=e,this.onPageFitTypeChanged(this.pageFitTypeIn)},enumerable:!0,configurable:!0}),e.prototype.updateClientArea=function(e,i,n){var r=0,o=0;if(this instanceof de){(r=(this.documentHelper.visibleBounds.width-4*this.padding.right-2*this.padding.left)/this.documentHelper.zoomFactor)<0&&(r=0),o=Number.POSITIVE_INFINITY,this.clientArea=new ce(this.padding.left/this.documentHelper.zoomFactor,0,r,o),this.clientActiveArea=new ce(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)}else{var s=0,a=48,l=48,d=L.convertPointToPixel(e.pageHeight),h=L.convertPointToPixel(e.bottomMargin);t.isNullOrUndefined(e)||(s=L.convertPointToPixel(e.topMargin),a=L.convertPointToPixel(e.headerDistance),l=L.convertPointToPixel(e.footerDistance));var c=!1;t.isNullOrUndefined(i.headerWidget)||(!(c=i.headerWidget.isEmpty)||c&&this.owner.enableHeaderAndFooter)&&(s=Math.min(Math.max(a+i.headerWidget.height,s),d/100*40));var p=.667+h;if(!t.isNullOrUndefined(i.footerWidget)){c=i.footerWidget.isEmpty;var g=t.isNullOrUndefined(i.footnoteWidget)?0:i.footnoteWidget.height;if(0===g){var u=this.owner.documentHelper.pages.indexOf(i);if(u>0){var m=this.owner.documentHelper.pages[u-1].footnoteWidget;g=t.isNullOrUndefined(m)?0:m.height,this.clientArea.height-=g}}(!c||c&&this.owner.enableHeaderAndFooter)&&(p=.667+Math.min(d/100*40,Math.max(l+i.footerWidget.height+g,h)))}t.isNullOrUndefined(e)||(r=L.convertPointToPixel(e.pageWidth-e.leftMargin-e.rightMargin),o=d-s-p),r<0&&(r=0),this.clientArea=new ce(L.convertPointToPixel(e.leftMargin),s,r,d-s-p),n&&i.footnoteWidget&&(this.clientArea.height-=i.footnoteWidget.height),this.clientActiveArea=new ce(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)}},e.prototype.updateClientAreaTopOrLeft=function(e,t){t&&(this.clientActiveArea.y=this.clientActiveArea.y+e.topBorderWidth,this.clientActiveArea.x=this.clientActiveArea.x+e.leftBorderWidth)},e.prototype.updateClientAreaForTable=function(e){this.clientActiveArea.x=this.clientArea.x=e.x,this.clientActiveArea.width=this.clientArea.width=e.width},e.prototype.updateClientAreaForRow=function(e,t){var i=e.ownerTable;t||(this.clientActiveArea.x=this.clientArea.x=i.x,this.clientActiveArea.width=this.clientArea.width=i.width,this.clientArea=new ce(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new ce(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height-this.documentHelper.layout.footnoteHeight))},e.prototype.updateClientAreaForCell=function(e,t){var i=e.ownerRow,n=e;t?(this.clientActiveArea.x=this.clientArea.x=n.x,this.clientActiveArea.y=n.y,this.clientActiveArea.width=this.clientArea.width=n.width>0?n.width:0,this instanceof le&&(this.clientActiveArea.height=Number.POSITIVE_INFINITY),this.clientArea=new ce(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new ce(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height)):(this.clientActiveArea.x=this.clientArea.x=n.x+n.width+n.margin.right,i.x+i.width-this.clientArea.x<0?this.clientActiveArea.width=this.clientArea.width=0:this.clientActiveArea.width=this.clientArea.width=i.x+i.width-this.clientArea.x,this.clientActiveArea.y=n.y-n.margin.top-L.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing),e.ownerTable.isInsideTable||(this.clientActiveArea.height=this.clientArea.bottom-i.y>0?this.clientArea.bottom-i.y:0),this.clientArea=new ce(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new ce(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height))},e.prototype.updateClientAreaForTextBoxShape=function(e,t){if("Inline"===e.textWrappingStyle&&(e.y=this.clientActiveArea.y,e.x=this.clientActiveArea.x),t){var i=L.convertPointToPixel(e.textFrame.marginLeft),n=L.convertPointToPixel(e.textFrame.marginRight),r=L.convertPointToPixel(e.textFrame.marginTop),o=L.convertPointToPixel(e.textFrame.marginBottom),s=e.width,a=Number.POSITIVE_INFINITY;this.clientArea=new ce(e.x+i,e.y+r,s-i-n,a-r-o),this.clientActiveArea=new ce(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)}},e.prototype.updateClientAreaByWidgetFootNote=function(e){this.clientArea.x=e.x,this.clientArea.y=e.y,this.clientActiveArea.x=e.x,this.clientActiveArea.y=e.y},e.prototype.updateClientAreaForTextWrap=function(e){this.clientActiveArea=new ce(e.x,e.y,e.width,e.height)},e.prototype.updateClientAreaByWidget=function(e){this.clientArea.x=e.x,this.clientArea.y=e.y,this.clientActiveArea.x=e.x,this.clientActiveArea.y=e.y},e.prototype.updateClientAreaLocation=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width},e.prototype.updateClientAreaForBlock=function(e,i,n){var r=L.convertPointToPixel(e.leftIndent),o=L.convertPointToPixel(e.rightIndent),s=e.bidi,a=0;if(i)if(e instanceof xe&&n){var l=n[0];this.clientActiveArea.x=this.clientArea.x=l.x,this.clientActiveArea.width=this.clientArea.width=l.width,(l=n[n.length-1]).x=this.clientActiveArea.x,l.y=this.clientActiveArea.y}else{if(e instanceof xe&&!t.isNullOrUndefined(e.tableFormat)&&(e.isGridUpdated||(e.buildTableColumns(),e.isGridUpdated=!0),"Left"!==(h=this.tableAlignmentForBidi(e,s)))){var d=0;d=0===(d=L.convertPointToPixel(e.tableHolder.getTotalWidth(0)))?0===e.tableHolder.tableWidth?e.getTableClientWidth(e.getOwnerWidth(!1)):e.tableHolder.tableWidth:d,this.owner.editor&&this.owner.editor.tableResize.currentResizingTable===e&&0===this.owner.editor.tableResize.resizerPosition&&(d=L.convertPointToPixel(e.tableHolder.tableWidth)),"Center"===h?(d=e.getTableCellWidth(),r=(this.clientArea.width-d)/2):r=this.clientArea.width-d,s&&(o=r-=L.convertPointToPixel(e.leftIndent)),e.isInsideTable,this.documentHelper.tableLefts.push(r)}a=this.clientArea.width-(r+L.convertPointToPixel(e.rightIndent)),this.clientActiveArea.x=this.clientArea.x=this.clientArea.x+(s?o:r),this.clientActiveArea.width=this.clientArea.width=a>0?a:0}else{if(e instanceof xe&&!t.isNullOrUndefined(e.tableFormat)){var h=this.tableAlignmentForBidi(e,s);e.isGridUpdated||(e.buildTableColumns(),e.isGridUpdated=!0),"Left"!==h&&this.documentHelper.tableLefts.length>0&&(r=this.documentHelper.tableLefts.pop(),s&&(o=r))}a=this.clientArea.width+r+L.convertPointToPixel(e.rightIndent),this.clientActiveArea.width=this.clientArea.width=a>0?a:0,this.clientActiveArea.x=this.clientArea.x=this.clientArea.x-(s?o:r)}this.clientArea=new ce(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height),this.clientActiveArea=new ce(this.clientActiveArea.x,this.clientActiveArea.y,this.clientActiveArea.width,this.clientActiveArea.height)},e.prototype.tableAlignmentForBidi=function(e,t){var i=e.tableFormat.tableAlignment;return t&&("Left"===i?i="Right":"Right"===i&&(i="Left")),i},e.prototype.cutFromLeft=function(e){e<this.clientActiveArea.x&&(e=this.clientActiveArea.x),e>this.clientActiveArea.right&&this.textWrap&&(e=this.clientActiveArea.right),this.clientActiveArea.width=this.clientActiveArea.right>e?this.clientActiveArea.right-e:0,this.clientActiveArea.x=e},e.prototype.cutFromTop=function(e){e<this.clientActiveArea.y&&(e=this.clientActiveArea.y),e>this.clientActiveArea.bottom&&(e=this.clientActiveArea.bottom),this.clientActiveArea.height=this.clientActiveArea.bottom-e,this.clientActiveArea.x=this.clientArea.x,this.clientActiveArea.width=this.clientArea.width,this.clientActiveArea.y=e},e.prototype.updateClientWidth=function(e){this.clientActiveArea.x-=e,this.clientActiveArea.width+e>0?this.clientActiveArea.width+=e:this.clientActiveArea.width=0},e.prototype.findFocusedPage=function(e,t){var i=new R(e.x,e.y);i.x+=this.documentHelper.viewerContainer.scrollLeft,i.y+=this.documentHelper.viewerContainer.scrollTop;for(var n=0;n<this.documentHelper.pages.length;n++){var r=this.documentHelper.pages[n],o=(r.boundingRectangle.y-this.pageGap*(n+1))*this.documentHelper.zoomFactor+this.pageGap*(n+1),s=r.boundingRectangle.height*this.documentHelper.zoomFactor+this.pageGap,a=r.boundingRectangle.x,l=void 0;if(l=this instanceof le?(r.boundingRectangle.right-a)*this.documentHelper.zoomFactor+a:r.boundingRectangle.right+a,o<=i.y&&o+s>=i.y)return t&&(this.documentHelper.currentPage=r),i.y=(i.y-o)/this.documentHelper.zoomFactor,i.x>l?i.x=r.boundingRectangle.right:i.x<a?i.x=0:i.x=(i.x-a)/this.documentHelper.zoomFactor,i}return i},e.prototype.getPageHeightAndWidth=function(e,t,i,n){e=0;for(r=0;r<this.documentHelper.pages.length;r++)e+=this.documentHelper.pages[r].boundingRectangle.height;t=0;for(var r=0;r<this.documentHelper.pages.length;r++)t<this.documentHelper.pages[r].boundingRectangle.width&&(t=this.documentHelper.pages[r].boundingRectangle.width);return i=this.documentHelper.visibleBounds.width,n=this.documentHelper.visibleBounds.height,{height:e,width:t,viewerWidth:i,viewerHeight:n}},e.prototype.renderVisiblePages=function(){if(!(t.isNullOrUndefined(this.visiblePages)||this.visiblePages.length<1)){this.documentHelper.clearContent();for(var e=0;e<this.visiblePages.length;e++){var i=this.visiblePages[e],n=i.boundingRectangle.width*this.documentHelper.zoomFactor,r=i.boundingRectangle.height*this.documentHelper.zoomFactor,o=i.boundingRectangle.x,s=(i.boundingRectangle.y-this.pageGap*(e+1))*this.documentHelper.zoomFactor+this.pageGap*(e+1);this.owner.viewer.renderPage(i,o,s,n,r)}}},e.prototype.handleZoom=function(){var e=this.documentHelper.preZoomFactor,i=null,n=0,r=!1;if(this.documentHelper.selection&&t.isNullOrUndefined(this.documentHelper.zoomX&&t.isNullOrUndefined(this.documentHelper.zoomY))){var o=0,s=0,a=this.documentHelper.selection.getPage(this.documentHelper.selection.end.currentWidget.paragraph);(o=(this.documentHelper.visibleBounds.width-a.boundingRectangle.width*e)/2)<30&&(o=30),s=a.boundingRectangle.y*e+(this.documentHelper.pages.indexOf(a)+1)*this.pageGap*(1-e);var l=this.documentHelper.selection.updateCaretSize(this.owner.selection.end,!0),d=l.topMargin;l.height;o+=this.documentHelper.selection.end.location.x*e,s+=(this.documentHelper.selection.end.location.y+d)*e,o>=this.containerLeft&&o<=this.documentHelper.visibleBounds.width&&s>=this.containerTop&&s<=this.containerTop+this.documentHelper.visibleBounds.height&&(r=!0)}for(c=0;c<this.documentHelper.pages.length;c++)n+=this.documentHelper.pages[c].boundingRectangle.height;for(var h=0,c=0;c<this.documentHelper.pages.length;c++)h<this.documentHelper.pages[c].boundingRectangle.width&&(h=this.documentHelper.pages[c].boundingRectangle.width);var p=n*this.documentHelper.zoomFactor+(this.documentHelper.pages.length+1)*this.pageGap*(1-this.documentHelper.zoomFactor)-this.documentHelper.visibleBounds.height,g=h*this.documentHelper.zoomFactor-this.documentHelper.visibleBounds.width;if(this.documentHelper.visibleBounds.width-h*this.documentHelper.zoomFactor<60&&(g+=60),p>0){y=this.containerTop;if(this.visiblePages.length>0){var u=((i=this.visiblePages[0]).boundingRectangle.y-(i.index+1)*this.pageGap)*e+(i.index+1)*this.pageGap,m=this.documentHelper.zoomY;t.isNullOrUndefined&&(m=this.documentHelper.visibleBounds.height/2);for(var f=y+m;f>u+i.boundingRectangle.height*e;){var v=i.index+1;if(v===this.documentHelper.pages.length)break;u=((i=this.documentHelper.pages[v]).boundingRectangle.y-(i.index+1)*this.pageGap)*e+(i.index+1)*this.pageGap}y=(i.boundingRectangle.y-(i.index+1)*this.pageGap)*this.documentHelper.zoomFactor+(i.index+1)*this.pageGap+(f-u<0?f-u:(f-u)*(this.documentHelper.zoomFactor/e))-m,m=this.documentHelper.visibleBounds.height/2}this.documentHelper.viewerContainer.scrollTop=y}else this.documentHelper.viewerContainer.scrollTop=0;if(g>0){var y=this.containerLeft;if(this.visiblePages.length>0){null===i&&(i=this.visiblePages[0]);var b=this.documentHelper.zoomX;t.isNullOrUndefined(b)&&(b=this.documentHelper.visibleBounds.width/2);var w=i.boundingRectangle.width*e/i.boundingRectangle.width,C=y+b;y=i.boundingRectangle.x+(C-i.boundingRectangle.x<0?C-i.boundingRectangle.x:(C-i.boundingRectangle.x)*(this.documentHelper.zoomFactor/w))-b,b=this.documentHelper.visibleBounds.width/2}this.documentHelper.viewerContainer.scrollLeft=y}else this.documentHelper.viewerContainer.scrollLeft=0;this.updateScrollBars(),r&&this.documentHelper.scrollToPosition(this.documentHelper.selection.start,this.documentHelper.selection.end),this instanceof de&&this.owner.editorModule.layoutWholeDocument()},e.prototype.updateCanvasWidthAndHeight=function(e,t,i,n,r,o){this instanceof le?this.documentHelper.visibleBounds.width!==this.documentHelper.viewerContainer.clientWidth?e-=this.documentHelper.visibleBounds.width-this.documentHelper.viewerContainer.clientWidth:i>t&&(e-=this.documentHelper.viewerContainer.offsetWidth-this.documentHelper.viewerContainer.clientWidth):i>t&&(e-=this.documentHelper.scrollbarWidth,n-=this.documentHelper.scrollbarWidth),n>e&&(t-=this.documentHelper.scrollbarWidth),r=n>e?n:e,o=i>t?i:t,parseInt(this.documentHelper.pageContainer.style.width.replace("px",""),10)===r&&parseInt(this.documentHelper.pageContainer.style.height.replace("px",""),10)===r||(this.documentHelper.pageContainer.style.width=r.toString()+"px",this.documentHelper.pageContainer.style.height=o.toString()+"px");var s=Math.max(1,window.devicePixelRatio||1);return this.documentHelper.containerCanvas.width===Math.floor(e*s)&&this.documentHelper.containerCanvas.height===Math.floor(t*s)||(this.documentHelper.containerCanvas.width=e*s,this.documentHelper.containerCanvas.height=t*s,this.documentHelper.containerCanvas.style.width=e+"px",this.documentHelper.containerCanvas.style.height=t+"px",this.documentHelper.containerContext.scale(s,s),this.documentHelper.selectionCanvas.width=e*s,this.documentHelper.selectionCanvas.height=t*s,this.documentHelper.selectionCanvas.style.width=e+"px",this.documentHelper.selectionCanvas.style.height=t+"px",this.documentHelper.selectionContext.scale(s,s)),{height:o,width:r,viewerWidth:e,viewerHeight:t,containerHeight:i,containerWidth:n}},e.prototype.updateScrollBarPosition=function(e,t,i,n,r,o){this.owner.viewer.containerTop=this.documentHelper.viewerContainer.scrollTop,this.documentHelper.containerCanvas.style.position="absolute",this.documentHelper.containerCanvas.style.top=this.owner.viewer.containerTop.toString()+"px",this.documentHelper.selectionCanvas.style.position="absolute",this.documentHelper.selectionCanvas.style.top=this.owner.viewer.containerTop.toString()+"px",this.owner.viewer.containerLeft=this.documentHelper.viewerContainer.scrollLeft,this.documentHelper.containerCanvas.style.left=this.owner.viewer.containerLeft+"px",this.documentHelper.selectionCanvas.style.left=this.owner.viewer.containerLeft+"px"},e.prototype.destroy=function(){this.clientArea=void 0,this.clientActiveArea=void 0},e}(),le=function(e){function i(t){var i=e.call(this,t)||this;return i.pageLeft=30,i.owner=t,i}return oe(i,e),Object.defineProperty(i.prototype,"pageGap",{get:function(){return this.owner.pageGap},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),i.prototype.createNewPage=function(e,i){var n=this,r=this.pageGap;this.documentHelper.pages.length>0&&(r=this.documentHelper.pages[this.documentHelper.pages.length-1].boundingRectangle.bottom+this.pageGap);var o=new bt(this.documentHelper);return this.updatePageBoundingRectangle(e,o,r),t.isNullOrUndefined(i)?this.documentHelper.pages.push(o):this.documentHelper.pages.splice(i,0,o),this.updateClientArea(e.sectionFormat,o),o.bodyWidgets.push(e),o.bodyWidgets[o.bodyWidgets.length-1].page=o,this.documentHelper.layout.layoutHeaderFooter(e,n,o),this.updateClientArea(e.sectionFormat,o),this.documentHelper.layout.footnoteHeight=0,o},i.prototype.updatePageBoundingRectangle=function(e,i,n){var r=t.isNullOrUndefined(e.sectionFormat)?816:L.convertPointToPixel(e.sectionFormat.pageWidth),o=t.isNullOrUndefined(e.sectionFormat)?1056:L.convertPointToPixel(e.sectionFormat.pageHeight),s=(this.documentHelper.visibleBounds.width-r*this.documentHelper.zoomFactor)/2;s<this.pageLeft&&(s=this.pageLeft),i.boundingRectangle=new ce(s,n,r,o)},i.prototype.onPageFitTypeChanged=function(e){var i=this.documentHelper.visibleBounds.width,n=this.documentHelper.visibleBounds.height,r=this.visiblePages[0].bodyWidgets[0],o=L.convertPointToPixel(r.sectionFormat.pageWidth),s=L.convertPointToPixel(r.sectionFormat.pageHeight);switch(e){case"FitOnePage":if(n>0&&s>0){var a=(this.documentHelper.visibleBounds.height-2*this.pageGap-(this.pageGap-2))/s;a===this.documentHelper.zoomFactor?t.isNullOrUndefined(this.owner.selection)||t.isNullOrUndefined(this.owner.selection.start)||t.isNullOrUndefined(this.owner.selection.end)||this.documentHelper.scrollToPosition(this.owner.selection.start,this.owner.selection.end):this.documentHelper.zoomFactor=a}break;case"FitPageWidth":i>0&&o>0&&(this.documentHelper.zoomFactor=(this.documentHelper.visibleBounds.width-80)/o);break;default:this.documentHelper.zoomFactor=1}},i.prototype.getCurrentPageHeaderFooter=function(e,t){return this.getCurrentHeaderFooter(this.getHeaderFooterType(e,t),e.index)},i.prototype.getHeaderFooterType=function(e,i){var n;n=i?"OddHeader":"OddFooter";var r=e.page;return e.sectionFormat.differentFirstPage&&(t.isNullOrUndefined(r.previousPage)||r.sectionIndex!==r.previousPage.sectionIndex)?n=i?"FirstPageHeader":"FirstPageFooter":e.sectionFormat.differentOddAndEvenPages&&this.documentHelper.pages.length%2==0&&(n=i?"EvenHeader":"EvenFooter"),n},i.prototype.getCurrentHeaderFooter=function(e,t){if(this.documentHelper.headersFooters[t]){var i=this.getHeaderFooter(e),n=this.documentHelper.headersFooters[t][i];if(!n){for(var r=t>0?t-1:t;!n&&-1!==r&&this.documentHelper.headersFooters[r][i];)n=this.documentHelper.headersFooters[r][i],r--;n||((n=this.createHeaderFooterWidget(e)).isEmpty=!0),this.documentHelper.headersFooters[t][i]=n}return n}if(t>0)return this.getCurrentHeaderFooter(e,t-1)},i.prototype.createHeaderFooterWidget=function(e){var t=new ve(e),i=new we;return i.childWidgets.push(new Te(i)),t},i.prototype.getHeaderFooter=function(e){switch(e){case"OddHeader":return 0;case"OddFooter":return 1;case"EvenHeader":return 2;case"EvenFooter":return 3;case"FirstPageHeader":return 4;case"FirstPageFooter":return 5}},i.prototype.updateHFClientArea=function(e,t){var i=L.convertPointToPixel(e.pageWidth-e.leftMargin-e.rightMargin);i<0&&(i=0),this.clientArea=t?new ce(L.convertPointToPixel(e.leftMargin),L.convertPointToPixel(e.headerDistance),i,Number.POSITIVE_INFINITY):new ce(L.convertPointToPixel(e.leftMargin),L.convertPointToPixel(e.pageHeight-e.footerDistance),i,Number.POSITIVE_INFINITY),this.clientActiveArea=new ce(this.clientArea.x,this.clientArea.y,this.clientArea.width,this.clientArea.height)},i.prototype.updateHeaderFooterClientAreaWithTop=function(e,t,i){this.updateHFClientArea(e,t),t||i.footerWidget.y<this.clientActiveArea.y&&(this.clientActiveArea.y=i.footerWidget.y,this.clientActiveArea.height=Number.POSITIVE_INFINITY)},i.prototype.updateFootnoteClientArea=function(e,t,i,n){var r=L.convertPointToPixel(e.pageWidth-e.leftMargin-e.rightMargin);this.clientArea=new ce(L.convertPointToPixel(e.leftMargin),L.convertPointToPixel(e.pageHeight-e.bottomMargin)-t.height,r,t.height),this.clientActiveArea=new ce(this.clientArea.x,this.clientArea.y,this.clientArea.width,t.height)},i.prototype.scrollToPage=function(e){for(var t=0,i=0;i<this.documentHelper.pages.length&&(t=this.documentHelper.pages[i].boundingRectangle.y-this.pageGap/2,i!==e);i++);this.documentHelper.viewerContainer.scrollTop=t,this.updateScrollBars()},i.prototype.updateScrollBars=function(){var e,t,i=(e=this.getPageHeightAndWidth(0,0,0,0)).width*this.documentHelper.zoomFactor+2*this.pageLeft,n=e.height*this.documentHelper.zoomFactor+(this.documentHelper.pages.length+1)*this.pageGap;n=(t=this.updateCanvasWidthAndHeight(e.viewerWidth,e.viewerHeight,n,i,e.width,e.height)).containerHeight,i=t.containerWidth,this.documentHelper.containerContext.globalAlpha=1,this.documentHelper.selectionContext.globalAlpha=.4;for(var r=0;r<this.documentHelper.pages.length;r++){var o=(t.width-this.documentHelper.pages[r].boundingRectangle.width*this.documentHelper.zoomFactor)/2;o>this.pageLeft?this.documentHelper.pages[r].boundingRectangle=new ce(o,this.documentHelper.pages[r].boundingRectangle.y,this.documentHelper.pages[r].boundingRectangle.width,this.documentHelper.pages[r].boundingRectangle.height):this.documentHelper.pages[r].boundingRectangle=new ce(this.pageLeft,this.documentHelper.pages[r].boundingRectangle.y,this.documentHelper.pages[r].boundingRectangle.width,this.documentHelper.pages[r].boundingRectangle.height)}this.updateScrollBarPosition(i,n,t.viewerWidth,t.viewerHeight,t.width,t.height),this.updateVisiblePages(),this.documentHelper.isScrollToSpellCheck=!1},i.prototype.updateVisiblePages=function(){this.visiblePages=[];for(var e=this.documentHelper.visibleBounds.height,t=this.documentHelper.viewerContainer.scrollTop,i=0;i<this.documentHelper.pages.length;i++){var n=this.documentHelper.pages[i],r=(n.boundingRectangle.y-this.pageGap*(i+1))*this.documentHelper.zoomFactor+this.pageGap*(i+1),o=n.boundingRectangle.height*this.documentHelper.zoomFactor,s=n.boundingRectangle.x,a=r>=t&&r<=t+e,l=r+o>=t&&r+o<=t+e,d=r<=t&&r+o>=t+e;(a||l||d)&&this.addVisiblePage(n,s,r)}},i.prototype.addVisiblePage=function(e,t,i){var n=this,r=e.boundingRectangle.width*this.documentHelper.zoomFactor,o=e.boundingRectangle.height*this.documentHelper.zoomFactor;if(this.owner.enableImageResizerMode&&void 0!==this.owner.imageResizerModule.currentPage&&this.owner.imageResizerModule.currentPage===e&&this.owner.imageResizerModule.isImageResizerVisible&&this.owner.imageResizerModule.setImageResizerPositions(t,i,r,o),this.visiblePages.push(e),this.owner.isSpellCheck&&this.owner.spellChecker.enableOptimizedSpellCheck&&(this.documentHelper.triggerElementsOnLoading||this.documentHelper.isScrollHandler)&&this.documentHelper.cachedPages.indexOf(e.index)<0){e.allowNextPageRendering=!1,this.documentHelper.cachedPages.push(e.index);var s=this.owner.spellChecker.getPageContent(e);s.trim().length>0?this.owner.spellChecker.callSpellChecker(this.owner.spellChecker.languageID,s,!0,!1,!1,!0).then(function(s){var a=JSON.parse(s);n.owner.spellChecker.updateUniqueWords(a.SpellCollection),e.allowNextPageRendering=!0,n.documentHelper.triggerSpellCheck=!0,n.renderPage(e,t,i,r,o),n.documentHelper.triggerSpellCheck=!1,n.documentHelper.triggerElementsOnLoading=!1}):this.renderPage(e,t,i,r,o)}else this.renderPage(e,t,i,r,o)},i.prototype.renderPage=function(e,t,i,n,r){this.documentHelper.render.renderWidgets(e,t-this.owner.viewer.containerLeft,i-this.owner.viewer.containerTop,n,r)},i}(ae),de=function(e){function t(t){var i=e.call(this,t)||this;return i.visiblePages=[],i.owner=t,i}return oe(t,e),Object.defineProperty(t.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageGap",{get:function(){return 0},enumerable:!0,configurable:!0}),t.prototype.createNewPage=function(e,t){var i,n=0;return this.documentHelper.pages.length>0&&(n=this.documentHelper.pages[this.documentHelper.pages.length-1].boundingRectangle.bottom),i=new bt(this.documentHelper),0===this.documentHelper.pages.length?i.boundingRectangle=new ce(10,n,this.documentHelper.visibleBounds.width,this.documentHelper.visibleBounds.height):i.boundingRectangle=new ce(10,n-20,this.documentHelper.visibleBounds.width,this.documentHelper.visibleBounds.height),this.documentHelper.pages.push(i),this.updateClientArea(void 0,i),i.bodyWidgets.push(e),i.bodyWidgets[i.bodyWidgets.length-1].page=i,i},t.prototype.onPageFitTypeChanged=function(e){this.documentHelper.zoomFactor=1},t.prototype.scrollToPage=function(e){this.updateScrollBars()},t.prototype.getContentHeight=function(){for(var e=0,t=0;t<this.documentHelper.pages.length;t++){var i=this.documentHelper.pages[t];0===t?(e+=this.padding.top,i.boundingRectangle.y=this.padding.top):i.boundingRectangle.y=this.documentHelper.pages[t-1].boundingRectangle.bottom,i.boundingRectangle.height=i.bodyWidgets[0].height,e+=i.bodyWidgets[0].height,t===this.documentHelper.pages.length-1&&(e+=this.padding.bottom)}return e},t.prototype.getContentWidth=function(){for(var e=this.documentHelper.visibleBounds.width,t=e,i=0;i<this.documentHelper.pages.length;i++){for(var n=this.documentHelper.pages[i],r=0;r<n.bodyWidgets[0].childWidgets.length;r++)if(n.bodyWidgets[0].childWidgets[r]instanceof xe){var o=n.bodyWidgets[0].childWidgets[r],s=L.convertPointToPixel(o.getTableWidth())*this.documentHelper.zoomFactor+4*this.padding.left+4*this.padding.right+n.boundingRectangle.x;t<s&&(e=s,t=s)}n.boundingRectangle.width=e}return e},t.prototype.updateScrollBars=function(){var e;e=this.getPageHeightAndWidth(0,0,0,0);var t,i=this.getContentWidth()*this.documentHelper.zoomFactor+this.padding.left+this.padding.right,n=this.getContentHeight()*this.documentHelper.zoomFactor+this.padding.top+this.padding.bottom;t=this.updateCanvasWidthAndHeight(e.viewerWidth,e.viewerHeight,n,i,e.width,e.height),this.documentHelper.containerContext.globalAlpha=1,this.documentHelper.selectionContext.globalAlpha=.4,this.updateScrollBarPosition(i,n,t.viewerWidth,t.viewerHeight,t.width,t.height),this.updateVisiblePages(),this.documentHelper.isScrollToSpellCheck=!1},t.prototype.updateVisiblePages=function(){this.visiblePages=[];for(var e,t,i=this.documentHelper.visibleBounds.height,n=this.documentHelper.viewerContainer.scrollTop,r=0;r<this.documentHelper.pages.length;r++){t=(e=this.documentHelper.pages[r]).boundingRectangle.y*this.documentHelper.zoomFactor;var o=e.boundingRectangle.height*this.documentHelper.zoomFactor,s=t>=n&&t<=n+i,a=t+o>=n&&t+o<=n+i,l=t<=n&&t+o>=n+i;(s||a||l)&&this.addVisiblePage(e,this.padding.left,t)}},t.prototype.addVisiblePage=function(e,t,i){var n=this,r=this.getContentWidth(),o=this.getContentHeight()*this.documentHelper.zoomFactor+this.padding.top+this.padding.bottom;if(this.owner.enableImageResizerMode&&void 0!==this.owner.imageResizerModule.currentPage&&this.owner.imageResizerModule.currentPage===e&&this.owner.imageResizerModule.isImageResizerVisible&&this.owner.imageResizerModule.setImageResizerPositions(t,i,r,o),this.visiblePages.push(e),this.documentHelper.owner.isSpellCheck&&this.documentHelper.owner.spellChecker.enableOptimizedSpellCheck&&(this.owner.documentHelper.triggerElementsOnLoading||this.owner.documentHelper.isScrollHandler)&&this.documentHelper.cachedPages.indexOf(e.index)<0){e.allowNextPageRendering=!1,this.owner.documentHelper.cachedPages.push(e.index);var s=this.documentHelper.owner.spellChecker.getPageContent(e);s.trim().length>0?this.owner.spellChecker.callSpellChecker(this.owner.spellChecker.languageID,s,!0,!1,!1,!0).then(function(s){var a=JSON.parse(s);n.owner.spellChecker.updateUniqueWords(a.SpellCollection),e.allowNextPageRendering=!0,n.owner.documentHelper.triggerSpellCheck=!0,n.renderPage(e,t,i,r,o),n.owner.documentHelper.triggerSpellCheck=!1,n.owner.documentHelper.triggerElementsOnLoading=!1}):this.renderPage(e,t,i,r,o)}else this.renderPage(e,t,i,r,o)},t.prototype.renderPage=function(e,t,i,n,r){this.documentHelper.render.renderWidgets(e,t-this.owner.viewer.containerLeft,i-this.owner.viewer.containerTop,n,r)},t}(ae),he=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ce=function(){function e(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n}return Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),e.prototype.isIntersecting=function(e){return!(e.y>this.bottom||this.y>e.bottom||e.x>this.right||this.x>e.right)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e}(),pe=function(){function e(e,t,i,n){this.right=10,this.left=10,this.top=10,this.bottom=10,this.right=e,this.left=t,this.top=i,this.bottom=n}return e}(),ge=function(){function e(e,t,i,n){this.left=e,this.top=t,this.right=i,this.bottom=n}return e.prototype.clone=function(){return new e(this.left,this.top,this.right,this.bottom)},e.prototype.destroy=function(){this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0},e}(),ue=function(){function e(){this.childWidgets=[],this.x=0,this.y=0,this.width=0,this.height=0,this.index=0}return Object.defineProperty(e.prototype,"indexInOwner",{get:function(){return this instanceof fe&&this.page?this.page.bodyWidgets.indexOf(this):this.containerWidget&&this.containerWidget.childWidgets?this.containerWidget.childWidgets.indexOf(this):this instanceof be?0:-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childWidgets.length>0?this.childWidgets[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){if(this.childWidgets)return this.childWidgets.length>0?this.childWidgets[this.childWidgets.length-1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousWidget",{get:function(){var e=this,t=this.indexInOwner;return e=e instanceof fe?t>0?e.page.bodyWidgets[t-1]:void 0:t>0?e.containerWidget.childWidgets[t-1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextWidget",{get:function(){var e=this,t=this.indexInOwner;if(-1!==t)return e=e instanceof fe?t<e.page.bodyWidgets.length-1?e.page.bodyWidgets[t+1]:void 0:t<e.containerWidget.childWidgets.length-1?e.containerWidget.childWidgets[t+1]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousRenderedWidget",{get:function(){var e=this,i=this.indexInOwner;if(!(i<0)){if(e instanceof fe)e=i>0?e.page.bodyWidgets[i-1]:(n=e.page.previousPage)&&n.bodyWidgets.length>0?n.bodyWidgets[n.bodyWidgets.length-1]:void 0;else if(e instanceof be)for(var n=e.page;n.previousPage&&(n=n.previousPage,e=n.footnoteWidget,t.isNullOrUndefined(e)););else if(i>0)e=e.containerWidget.childWidgets[i-1];else{var r=void 0;for(e.containerWidget instanceof Pe?r=e.containerWidget.getPreviousSplitWidget():e.containerWidget instanceof Fe||e.containerWidget instanceof ve||(r=e.containerWidget.previousRenderedWidget);r&&0===r.childWidgets.length&&(r=r.previousRenderedWidget,!t.isNullOrUndefined(r)););e=r&&r.constructor===e.containerWidget.constructor?r.lastChild:void 0}return e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextRenderedWidget",{get:function(){var e=this,i=this.indexInOwner;if(!(i<0)){if(e instanceof fe)e=i<e.page.bodyWidgets.length-1?e.page.bodyWidgets[i+1]:e.page.allowNextPageRendering&&(n=e.page.nextPage)&&n.bodyWidgets.length>0?n.bodyWidgets[0]:void 0;else if(e instanceof be)for(var n=e.page;n.allowNextPageRendering&&n.nextPage&&(n=n.nextPage,e=n.footnoteWidget,t.isNullOrUndefined(e)););else if(i<e.containerWidget.childWidgets.length-1)e=e.containerWidget.childWidgets[i+1];else{var r=void 0;for(e.containerWidget instanceof Pe?r=e.containerWidget.getNextSplitWidget():e.containerWidget instanceof Fe||e.containerWidget instanceof ve||e.containerWidget instanceof be||(r=e.containerWidget.nextRenderedWidget);r&&0===r.childWidgets.length&&!(r instanceof Pe)&&(r=r.nextRenderedWidget,!t.isNullOrUndefined(r)););e=r&&r.constructor===e.containerWidget.constructor?r.firstChild:void 0}return e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousSplitWidget",{get:function(){var e=this;if(e instanceof Pe)return e.getPreviousSplitWidget();var t=e.previousRenderedWidget;return e instanceof fe&&t instanceof fe&&e.equals(t)?t:t instanceof ye&&e.index===t.index&&e.equals(t)?t:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextSplitWidget",{get:function(){var e=this;if(e instanceof Pe)return e.getNextSplitWidget();var t=e.nextRenderedWidget;return e instanceof fe&&t instanceof fe&&e.equals(t)?t:t instanceof ye&&e.index===t.index&&e.equals(t)?t:void 0},enumerable:!0,configurable:!0}),e.prototype.getPreviousSplitWidgets=function(){for(var e=[],t=this.previousSplitWidget;t;)e.unshift(t),t=t.previousSplitWidget;return e},e.prototype.getSplitWidgets=function(){for(var e=this.getPreviousSplitWidgets(),t=this;t;)e.push(t),t=t.nextSplitWidget;return e},e.prototype.combineWidget=function(e){var t=this,i=this.getSplitWidgets();if(i.length>1)for(t=i.shift();i.length>0;){var n=i.shift();t.combine(n,e)}return t instanceof xe&&t.combineRows(e),t},e.prototype.combine=function(t,i){if(t.childWidgets.length>0){var n=this.lastChild;if(n instanceof xe)n.combineWidget(i);else{var r=t.firstChild;!(t instanceof xe)&&n instanceof e&&r instanceof e&&n.index===r.index&&n.combine(t.childWidgets.shift(),i)}this.addWidgets(t.childWidgets),t.childWidgets=[]}t.destroyInternal(i)},e.prototype.addWidgets=function(t){for(;t.length>0;){var i=t.shift();if(i instanceof Te&&this instanceof we)i.paragraph=this,this.height+=i.height;else if(i instanceof e){var n=this.lastChild;i.containerWidget=this,i.y=n instanceof e?n.y+n.height:this.y,this.height+=i.height}this.childWidgets.push(i)}},e.prototype.removeChild=function(e){e>-1&&e<this.childWidgets.length&&this.childWidgets.splice(e,1)},e.prototype.destroy=function(){if(this.childWidgets)for(;this.childWidgets.length>0;){var t=this.childWidgets.pop();(t instanceof Te||t instanceof e)&&t.destroy()}this.childWidgets=void 0,this.containerWidget&&this.containerWidget.removeChild(this.indexInOwner),this.containerWidget=void 0,this.margin=void 0,this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.index=void 0},e}(),me=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.floatingElements=[],t.sectionFormatIn=void 0,t}return he(i,e),Object.defineProperty(i.prototype,"sectionFormat",{get:function(){var e=this;return e instanceof fe?e.sectionFormatIn:e.page?e.page.bodyWidgets[0].sectionFormat:void 0},set:function(e){this instanceof fe&&(this.sectionFormatIn=e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sectionIndex",{get:function(){var e=this,t=0;return e instanceof fe?t=e.index:e.page&&(t=e.page.bodyWidgets[0].index),t},enumerable:!0,configurable:!0}),i.prototype.getHierarchicalIndex=function(e){var i=this;return e=i instanceof fe?i.index+";"+e:i instanceof be?"Footnote"===i.footNoteType?"FN;"+e:"EN;"+e:-1!==i.headerFooterType.indexOf("Header")?"H;"+e:"F;"+e,t.isNullOrUndefined(i.page)?e:this.page.documentHelper.pages.indexOf(this.page)+";"+e},i}(ue),fe=function(e){function i(){return e.call(this)||this}return he(i,e),i.prototype.equals=function(e){return e instanceof i&&e.sectionFormat===this.sectionFormat},i.prototype.getHierarchicalIndex=function(e){var i=this;return e=i.index+";"+e,t.isNullOrUndefined(i.page)?e:this.page.documentHelper.pages.indexOf(this.page)+";"+e},i.prototype.getTableCellWidget=function(e){for(var t=0;t<this.childWidgets.length;t++)if(this.childWidgets[t].y<=e.y&&this.childWidgets[t].y+this.childWidgets[t].height>=e.y)return this.childWidgets[t].getTableCellWidget(e);var i=void 0;return this.childWidgets.length>0&&(i=this.childWidgets[0].y<=e.y?this.childWidgets[this.childWidgets.length-1].getTableCellWidget(e):this.childWidgets[0].getTableCellWidget(e)),i},i.prototype.destroyInternal=function(e){this.height;if(!t.isNullOrUndefined(this.childWidgets)){for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i];if(n.destroyInternal(e),t.isNullOrUndefined(this.childWidgets))break;i--}this.childWidgets=void 0}if(!t.isNullOrUndefined(this.page)){var r=this.indexInOwner;this.indexInOwner>-1&&(this.page.bodyWidgets.splice(r,1),0===this.page.bodyWidgets.length?this.page.destroy():this instanceof ve&&this.page.headerWidget===this?this.page.headerWidget=void 0:this instanceof ve&&this.page.footerWidget===this&&(this.page.footerWidget=void 0),this.page=void 0)}this.destroy()},i.prototype.destroy=function(){this.sectionFormat=void 0,this.page=void 0,e.prototype.destroy.call(this)},i}(me),ve=function(e){function t(t){var i=e.call(this)||this;return i.isEmpty=!1,i.headerFooterType=t,i}return he(t,e),t.prototype.getTableCellWidget=function(e){},t.prototype.equals=function(e){return e instanceof t&&e.containerWidget===this.containerWidget},t.prototype.clone=function(){for(var e=new t(this.headerFooterType),i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i].clone();e.childWidgets.push(n),n.index=i,n.containerWidget=e}return e.isEmpty=this.isEmpty,e.x=this.x,e.y=this.y,e.height=0,e.width=0,e},t.prototype.destroyInternal=function(t){this.page=void 0,e.prototype.destroy.call(this)},t}(me),ye=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.isLayouted=!1,t.locked=!1,t.lockedBy="",t.footNoteReference=void 0,t}return he(i,e),Object.defineProperty(i.prototype,"bodyWidget",{get:function(){for(var e=this;e.containerWidget;){if(e.containerWidget instanceof Xe){var t=e.containerWidget.containerShape.line.paragraph;if(t)return t.bodyWidget}else if(e.containerWidget instanceof me)return e.containerWidget;e=e.containerWidget}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"leftIndent",{get:function(){var e=this;return e instanceof we&&e.paragraphFormat instanceof I?e.paragraphFormat.leftIndent:e instanceof xe&&e.tableFormat instanceof j?e.tableFormat.leftIndent:0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rightIndent",{get:function(){var e=this;return e instanceof we&&e.paragraphFormat instanceof I?e.paragraphFormat.rightIndent:0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isInsideTable",{get:function(){return this.containerWidget instanceof Pe},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isInHeaderFooter",{get:function(){return this.bodyWidget instanceof ve},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"associatedCell",{get:function(){if(this.containerWidget instanceof Pe)return this.containerWidget},enumerable:!0,configurable:!0}),i.prototype.isPageBreak=function(){var e=!1;if(this instanceof we){var t=this;null!=t&&1===t.childWidgets.length&&1===t.firstChild.children.length&&(e=t.firstChild.children[0].isPageBreak)}return e},i.prototype.getHierarchicalIndex=function(e){var n=this;if(e=n.containerWidget.childWidgets.indexOf(n)+";"+e,!t.isNullOrUndefined(n.containerWidget)){if(n.containerWidget instanceof Xe)return n.containerWidget.getHierarchicalIndex(e);if(n.containerWidget instanceof i)return n.containerWidget.getHierarchicalIndex(e);n.containerWidget instanceof me&&(e=n.containerWidget.getHierarchicalIndex(e))}return e},i.prototype.getIndex=function(){return this instanceof we||this instanceof xe?this.containerWidget.childWidgets.indexOf(this):this instanceof Fe?this.ownerTable.childWidgets.indexOf(this):this instanceof Pe?this.ownerRow.childWidgets.indexOf(this):0},i.prototype.getContainerWidth=function(){if(this.isInsideTable)return this.associatedCell.getCellWidth(this);if(this.containerWidget instanceof Xe){var e=this.containerWidget.containerShape;return L.convertPixelToPoint(e.width)-L.convertPixelToPoint(e.textFrame.marginLeft)-L.convertPixelToPoint(e.textFrame.marginRight)}var t=this.bodyWidget.sectionFormat;return t.pageWidth-(t.leftMargin+t.rightMargin)},Object.defineProperty(i.prototype,"bidi",{get:function(){return this instanceof we&&this.paragraphFormat instanceof I?this.paragraphFormat.bidi:this instanceof xe&&this.tableFormat instanceof j&&this.tableFormat.bidi},enumerable:!0,configurable:!0}),i}(ue),be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return he(t,e),t.prototype.getMinimumAndMaximumWordWidth=function(e,t){throw new Error("Method not implemented.")},t.prototype.getTableCellWidget=function(e){},t.prototype.equals=function(e){return e instanceof t&&e.containerWidget===this.containerWidget},t.prototype.clone=function(){for(var e=new t,i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i].clone();e.childWidgets.push(n),n.index=i,n.containerWidget=e}return e.block=this.block,e},t.prototype.destroyInternal=function(t){this.block=void 0,e.prototype.destroy.call(this)},t}(me),we=function(e){function i(){var t=e.call(this)||this;return t.isChangeDetected=!1,t.floatingElements=[],t.paragraphFormat=new I(t),t.characterFormat=new k(t),t}return he(i,e),Object.defineProperty(i.prototype,"isEndsWithPageBreak",{get:function(){return this.childWidgets.length>0&&this.lastChild.isEndsWithPageBreak},enumerable:!0,configurable:!0}),i.prototype.equals=function(e){return e instanceof i&&e.paragraphFormat===this.paragraphFormat},i.prototype.isContainsShapeAlone=function(){for(var e=!1,t=0;t<this.childWidgets.length;t++)for(var i=this.childWidgets[t],n=0;n<i.children.length;n++){if(!(i.children[n]instanceof Ke))return!1;e=!0}return!!e},i.prototype.isEmpty=function(){if(t.isNullOrUndefined(this.childWidgets)||0===this.childWidgets.length)return!0;for(var e=0;e<this.childWidgets.length;e++)for(var i=this.childWidgets[e],n=0;n<i.children.length;n++){var r=i.children[n];if(0!==r.length&&(r instanceof Oe||r instanceof Ze||r instanceof Ae||r instanceof $e||r instanceof et||r instanceof tt||r instanceof Ke||r instanceof Me||r instanceof Ie&&L.isLinkedFieldCharacter(r)))return!1}return!0},i.prototype.getInline=function(e,i){for(var n=void 0,r=0,o=!1,s=this.getSplitWidgets(),a=0;a<s.length;a++)for(var l=s[a],d=0;d<l.childWidgets.length;d++)for(var h=l.childWidgets[d],c=0;c<h.children.length;c++)if(!((n=h.children[c])instanceof Qe)){if((!o&&(n instanceof Oe||n instanceof Ze||n instanceof Ke||n instanceof Ae||n instanceof Ie&&L.isLinkedFieldCharacter(n))||n instanceof tt)&&(o=!0),o&&e<=r+n.length)return i=e-r,{element:n,index:i};r+=n.length}return e>r&&(i=t.isNullOrUndefined(n)?e:n.length),{element:n,index:i}},i.prototype.getLength=function(){for(var e=0,t=0;t<this.childWidgets.length;t++)for(var i=this.childWidgets[t],n=0;n<i.children.length;n++){var r=i.children[n];r instanceof Qe||(e+=r.length)}return e},i.prototype.getTableCellWidget=function(e){},i.prototype.getMinimumAndMaximumWordWidth=function(e,i){if(e=L.convertPointToPixel(e),i=L.convertPointToPixel(i),this.childWidgets.length>0){for(var n=this.childWidgets[0].children[0],r="",o=new u,s=[];;){if(n instanceof Oe&&""!==n.text)o.add(n,r.length),r+=n.text;else if(n instanceof Ie&&0===n.fieldType){var a=n;t.isNullOrUndefined(a.fieldEnd)||(n=t.isNullOrUndefined(a.fieldSeparator)?a.fieldEnd:a.fieldSeparator)}else n instanceof Ze&&s.push(n.width);if(t.isNullOrUndefined(n)||t.isNullOrUndefined(n.nextNode))break;n=n.nextNode}for(var l=new RegExp("\\b\\w+\\b","g"),d=[],h=void 0;!t.isNullOrUndefined(h=l.exec(r));)d.push(h);for(var c=0;c<d.length;c++){var p=d[c],g=0;r="";for(var m="",f=0,v=p.index,y=p.index,b=0;b<o.keys.length;b++){var w=o.keys[b],C=o.get(w),x=w.length;if(y<=C+x&&(f=y-C,p.index+p[0].length<=C+x?v=p.index+p[0].length-(C+f):y+=v=x-f,m+=r=w.text.substring(f,f+v)),""!==r&&(g+=this.bodyWidget.page.documentHelper.textHelper.getWidth(r,w.characterFormat)),m===p[0])break}0!==g&&(0===e||g>e)&&(e=g)}var F=0;s.length>0&&(F=Math.max.apply(null,s)),(0===e||F>e)&&(e=F);var P=this.measureParagraph();(0===i||P>i)&&(i=P)}return{maximumWordWidth:L.convertPixelToPoint(i),minimumWordWidth:L.convertPixelToPoint(e)}},i.prototype.measureParagraph=function(){for(var e=0,i=this.childWidgets[0].children[0];;){if(i instanceof Oe&&""!==i.text)e+=this.bodyWidget.page.documentHelper.textHelper.getWidth(i.text,i.characterFormat);else if(i instanceof Ie&&0===i.fieldType){var n=i;null!=n.fieldEnd&&(i=t.isNullOrUndefined(n.fieldSeparator)?n.fieldEnd:n.fieldSeparator)}else i instanceof Ze&&(e+=i.width);if(t.isNullOrUndefined(i)||t.isNullOrUndefined(i.nextNode))break;i=i.nextNode}return this.leftIndent>0&&(e+=this.leftIndent),this.rightIndent>0&&(e+=this.rightIndent),e},i.prototype.clone=function(){var e=new i;e.paragraphFormat.copyFormat(this.paragraphFormat),e.characterFormat.copyFormat(this.characterFormat);for(var t=0;t<this.childWidgets.length;t++){var n=this.childWidgets[t].clone();e.childWidgets.push(n);for(var r=0;r<n.children.length;r++){var o=n.children[r];o instanceof Ge&&"Inline"!==o.textWrappingStyle&&e.floatingElements.push(o)}n.paragraph=e}return e.x=this.x,e.y=this.y,e.height=this.height,e.width=this.width,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},i.prototype.destroyInternal=function(e){var i=this.height;if(!t.isNullOrUndefined(this.childWidgets)){for(var n=0;n<this.childWidgets.length&&(this.childWidgets[n].destroy(),1===this.childWidgets.length&&t.isNullOrUndefined(this.childWidgets[0].children)&&(this.childWidgets=void 0),!t.isNullOrUndefined(this.childWidgets));n++)n--;this.childWidgets=void 0}t.isNullOrUndefined(this.containerWidget)||t.isNullOrUndefined(this.containerWidget.childWidgets)||-1===this.containerWidget.childWidgets.indexOf(this)||(this.containerWidget.childWidgets.splice(this.containerWidget.childWidgets.indexOf(this),1),this.containerWidget.height-=i,this.containerWidget=void 0),this.destroy()},i.prototype.destroy=function(){this.paragraphFormat=void 0,this.characterFormat=void 0,e.prototype.destroy.call(this)},i}(ye),Ce=function(){function e(){}return e.prototype.clone=function(){var t=new e;return t.allowOverlap=this.allowOverlap,t.distanceTop=this.distanceTop,t.distanceRight=this.distanceRight,t.distanceLeft=this.distanceLeft,t.distanceBottom=this.distanceBottom,t.verticalAlignment=this.verticalAlignment,t.verticalOrigin=this.verticalOrigin,t.verticalPosition=this.verticalPosition,t.horizontalAlignment=this.horizontalAlignment,t.horizontalOrigin=this.horizontalOrigin,t.horizontalPosition=this.horizontalPosition,t},e}(),xe=function(e){function i(){var t=e.call(this)||this;return t.flags=0,t.leftMargin=0,t.topMargin=0,t.rightMargin=0,t.bottomMargin=0,t.isDefaultFormatUpdated=!1,t.margin=new ge(t.leftMargin,t.topMargin,t.rightMargin,t.bottomMargin),t.leftBorderWidth=0,t.rightBorderWidth=0,t.topBorderWidth=0,t.bottomBorderWidth=0,t.tableFormat=new j(t),t.tableHolder=new wt,t.spannedRowCollection=new u,t}return he(i,e),Object.defineProperty(i.prototype,"isGridUpdated",{get:function(){return(4&this.flags)>>2!=0},set:function(e){this.flags=251&this.flags|(e?1:0)<<2},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"continueHeader",{get:function(){return(2&this.flags)>>1!=0},set:function(e){this.flags=253&this.flags|(e?1:0)<<1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"header",{get:function(){return 0!=(1&this.flags)},set:function(e){this.flags=254&this.flags|(e?1:0)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isBidiTable",{get:function(){return(16&this.flags)>>4!=0},set:function(e){this.flags=239&this.flags|(e?1:0)<<4},enumerable:!0,configurable:!0}),i.prototype.equals=function(e){return e instanceof i&&e.tableFormat===this.tableFormat},i.prototype.combineRows=function(e){for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];0===i.childWidgets.length?(i.destroy(),t--):i.combineCells(e)}},i.prototype.contains=function(e){if(this.equals(e.ownerTable))return!0;for(;e.ownerTable.isInsideTable;){if(this.equals(e.ownerTable))return!0;e=e.ownerTable.associatedCell}return this.equals(e.ownerTable)},i.prototype.getOwnerWidth=function(e){var t=this.getContainerWidth();return t=t-this.leftIndent-this.rightIndent,t>=0?t:0},i.prototype.getTableWidth=function(){for(var e=0,t=0;t<this.childWidgets.length;t++){for(var i=0,n=this.childWidgets[t],r=0;r<n.childWidgets.length;r++)i+=n.childWidgets[r].cellFormat.cellWidth;e<i&&(e=i)}return e},i.prototype.getTableCellWidth=function(){for(var e=0,t=0;t<this.childWidgets.length;t++){for(var i=0,n=this.childWidgets[t],r=0;r<n.childWidgets.length;r++){var o=n.childWidgets[r],s=o.width;0===s&&((s=o.cellFormat.cellWidth)>o.cellFormat.preferredWidth&&0!==o.cellFormat.preferredWidth&&"Percent"!==o.cellFormat.preferredWidthType&&(s=o.cellFormat.preferredWidth),s=L.convertPointToPixel(s-(o.margin.left+o.margin.right))),i+=s+o.margin.left+o.margin.right}e<i&&(e=i)}return e},i.prototype.getTableClientWidth=function(e){var t=e;return"Point"===this.tableFormat.preferredWidthType&&this.tableFormat.preferredWidth>0?t=this.tableFormat.preferredWidth:"Percent"===this.tableFormat.preferredWidthType&&this.tableFormat.preferredWidth>0&&(t=t*this.tableFormat.preferredWidth/100),t},i.prototype.getCellWidth=function(e,i,n,r){var o=e;return"Percent"===i?o=e*n/100:"Point"===i?o=e:t.isNullOrUndefined(r)||(o=r.getMinimumPreferredWidth()),o},i.prototype.fitCellsToClientArea=function(e){for(var t=e/this.getTableWidth(),i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i];n.rowFormat.gridAfterWidth*=t,n.rowFormat.gridBeforeWidth*=t;for(var r=0;r<n.childWidgets.length;r++)n.childWidgets[r].cellFormat.cellWidth*=t,n.childWidgets[r].cellFormat.preferredWidth*=t}},i.prototype.getTableCellWidget=function(e){for(var t=void 0,i=0;i<this.childWidgets.length;i++)if(this.childWidgets[i].y<=e.y&&this.childWidgets[i].y+this.childWidgets[i].height>=e.y){t=this.childWidgets[i].getTableCellWidget(e);break}return t},i.prototype.calculateGrid=function(){var e=[],t=[],i=this.getOwnerWidth(!0),n=this.getTableClientWidth(i);this.tableCellInfo=new u;for(var r=0;r<this.childWidgets.length;r++){var o=this.childWidgets[r],s=new u,a=o.rowFormat,l=o.rowFormat.gridBefore,d=0;e.indexOf(d)<0&&e.push(d),d+=this.getCellWidth(a.gridBeforeWidth,a.gridBeforeWidthType,n,null);var h=parseFloat(d.toFixed(2));e.indexOf(h)<0&&e.push(h);for(var c=0;c<o.childWidgets.length;c++){for(var p=o.childWidgets[c],g=0;g<t.length;g++)if(!(t[g].columnIndex<l)){var m=t[g].cellFormat.rowSpan,f=!0;t[g].columnIndex>l?(f=!1,c===o.childWidgets.length-1&&o.rowFormat.gridAfter>0&&(d+=this.getCellWidth(t[g].cellFormat.preferredWidth,t[g].cellFormat.preferredWidthType,n,null))):(d+=this.getCellWidth(t[g].cellFormat.preferredWidth,t[g].cellFormat.preferredWidthType,n,null),l=t[g].columnIndex+t[g].cellFormat.columnSpan),f||c!==o.childWidgets.length-1||(f=!0),f&&r-t[g].ownerRow.rowIndex==m-1&&(t.splice(g,1),g--)}if(p.cellFormat.rowSpan>1)if(0===t.length||t[t.length-1].columnIndex<=l)t.push(p);else for(var v=t.length;v>0;v--)t[v-1].columnIndex>l&&t.splice(v-1,0,p);s.containsKey(p.cellIndex)||s.add(p.cellIndex,parseFloat((d-h).toFixed(2))),l+=p.cellFormat.columnSpan,d+=this.getCellWidth(p.cellFormat.preferredWidth,p.cellFormat.preferredWidthType,n,null);var y=parseFloat(d.toFixed(2));e.indexOf(y)<0&&e.push(y),c===o.childWidgets.length-1&&a.gridAfter>0&&(d+=this.getCellWidth(a.gridAfterWidth,"Point",n,null),e.indexOf(parseFloat(d.toFixed(2)))<0&&e.push(parseFloat(d.toFixed(2))),l+=a.gridAfter),this.tableCellInfo.containsKey(o.rowIndex)||this.tableCellInfo.add(o.rowIndex,s)}}e.sort(function(e,t){return e-t}),this.tableHolder.columns.length>0&&e.length-1!==this.tableHolder.columns.length&&this.updateColumnSpans(e,n),this.tableCellInfo.clear(),this.tableCellInfo=void 0},i.prototype.updateColumnSpans=function(e,t){for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i];n.rowFormat.gridBeforeWidth>=0&&(n.rowFormat.gridBefore=n.getGridCount(e,void 0,-1,t));for(var r=0;r<n.childWidgets.length;r++){var o=n.childWidgets[r],s=n.getGridCount(e,o,o.getIndex(),t);s>0&&o.cellFormat.columnSpan!==s&&(o.cellFormat.columnSpan=s)}n.rowFormat.gridAfterWidth>=0&&(n.rowFormat.gridAfter=n.getGridCount(e,void 0,n.childWidgets.length,t))}},i.prototype.getMinimumAndMaximumWordWidth=function(e,t){this.checkTableColumns();var i=this.tableHolder.getTotalWidth(0);return i>e&&(e=i),i>t&&(t=i),{minimumWordWidth:e,maximumWordWidth:t}},i.prototype.checkTableColumns=function(){this.isGridUpdated||((this.isAutoFit()||0===this.tableHolder.columns.length)&&this.buildTableColumns(),this.isGridUpdated=!0)},i.prototype.isAutoFit=function(){var e=this.bodyWidget;return!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.page)&&e.page.documentHelper.layout.getParentTable(this).tableFormat.allowAutoFit},i.prototype.buildTableColumns=function(){if(!this.isGridUpdated){this.tableHolder.resetColumns();var e=0,i=0,n=[],r="Auto"===this.tableFormat.preferredWidthType,o=this.tableFormat.allowAutoFit;e=!(!t.isNullOrUndefined(this.bodyWidget.page)&&this.bodyWidget.page.viewer instanceof de&&o)||this.isInsideTable||this.containerWidget instanceof Xe?this.getOwnerWidth(!0):L.convertPixelToPoint(this.bodyWidget.page.viewer.clientArea.width-3*this.bodyWidget.page.viewer.padding.right),e=this.tableFormat.preferredWidth>e?this.tableFormat.preferredWidth:e;var s=r&&0===this.tableFormat.preferredWidth&&!o;i=this.getTableClientWidth(e),s&&!this.isDefaultFormatUpdated&&this.splitWidthToTableCells(i,s);for(var a=0;a<this.childWidgets.length;a++){var l=this.childWidgets[a],d=l.rowFormat,h=0,c=0,p=new xt,g=0;!(d.gridBefore>0)||0===l.rowFormat.beforeWidth&&0===l.rowFormat.gridBeforeWidth||this.bodyWidget.page.documentHelper.alignTablesRowByRow&&"Left"!==l.ownerTable.tableFormat.tableAlignment||(c=this.getCellWidth(d.gridBeforeWidth,l.rowFormat.gridAfterWidthType,i,null),p.minimumWidth=c,this.tableHolder.addColumns(h,h=d.gridBefore,c,p,g=c));for(var u=0;u<l.childWidgets.length;u++){var m=l.childWidgets[u];0===n.length&&(m.columnIndex=h);for(var f=0;f<n.length;f++){var v=n[f];if(v.columnIndex<h)m.columnIndex=h;else{var y=1,b=!0;y=v.cellFormat.rowSpan,v.columnIndex>h?(m.columnIndex=h,b=!1):(p=v.getCellSizeInfo(o),c=this.getCellWidth(v.cellFormat.preferredWidth,v.cellFormat.preferredWidthType,i,v),this.tableHolder.columns.length>0?(this.tableHolder.addColumns(h,h=this.tableHolder.columns.indexOf(v.ownerColumn)+v.cellFormat.columnSpan,c,p,g+=c),m.columnIndex=h):(this.tableHolder.addColumns(h,h=v.columnIndex+v.cellFormat.columnSpan,c,p,g+=c),m.columnIndex=h)),b||u!==l.childWidgets.length-1||(b=!0),b&&a-v.ownerRow.rowIndex==y-1&&(n.splice(f,1),f--)}}if(m.cellFormat.rowSpan>1)if(0===n.length||n[n.length-1].columnIndex<=h)n.push(m);else{for(var w=0,C=n.length;C>0;C--)n[C-1].columnIndex>h&&(w=C-1);n.splice(w,0,m)}p=m.getCellSizeInfo(o),c=this.getCellWidth(m.cellFormat.preferredWidth,m.cellFormat.preferredWidthType,i,m),this.tableHolder.addColumns(h,h+=m.cellFormat.columnSpan,c,p,g+=c),u===l.childWidgets.length-1&&d.gridAfterWidth>0&&(c=this.getCellWidth(d.gridAfterWidth,"Point",i,null),this.tableHolder.addColumns(h,h+=d.gridAfter,c,p,g+=c))}}s&&!this.isDefaultFormatUpdated&&(this.isDefaultFormatUpdated=!0),this.tableHolder.validateColumnWidths(),o?this.tableHolder.autoFitColumn(e,i,r,this.isInsideTable):this.tableHolder.fitColumns(e,i,r,this.leftIndent+this.rightIndent),this.setWidthToCells(i,r)}},i.prototype.setWidthToCells=function(e,t){for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i],r=n.rowFormat;r.gridBefore>0&&(r.beforeWidth=this.tableHolder.getCellWidth(0,r.gridBefore,e));for(var o=0;o<n.childWidgets.length;o++){var s=n.childWidgets[o];s.cellFormat.cellWidth=this.tableHolder.getCellWidth(s.columnIndex,s.cellFormat.columnSpan,e)}r.gridAfter>0&&(r.afterWidth=this.tableHolder.getCellWidth(0,r.gridAfter,e))}},i.prototype.updateProperties=function(e,t,i){if(e&&(this.tableFormat.allowAutoFit="FixedColumnWidth"!==i),this!==t)return void t.updateProperties(!1,t,i);if("FixedColumnWidth"===i){this.tableFormat.preferredWidth=0,this.tableFormat.preferredWidthType="Auto";for(d=0;d<this.childWidgets.length;d++)for(var n=this.childWidgets[d],r=0;r<n.childWidgets.length;r++){var o=n.childWidgets[r];o.cellFormat.preferredWidthType="Point",o.cellFormat.preferredWidth=o.cellFormat.cellWidth}}else if("FitToWindow"===i){var s=this.tableHolder.getTotalWidth(0);this.tableFormat.leftIndent=0,this.tableFormat.preferredWidth=100,this.tableFormat.preferredWidthType="Percent";for(d=0;d<this.childWidgets.length;d++)for(var a=this.childWidgets[d],l=0;l<a.childWidgets.length;l++)"Percent"!==(h=a.childWidgets[l]).cellFormat.preferredWidthType&&(h.cellFormat.preferredWidthType="Percent",h.cellFormat.preferredWidth=h.cellFormat.cellWidth/s*100)}else{this.tableFormat.preferredWidth=0,this.tableFormat.preferredWidthType="Auto";for(var d=0;d<this.childWidgets.length;d++){(a=this.childWidgets[d]).rowFormat.beforeWidth=0,a.rowFormat.gridBefore=0,a.rowFormat.gridBeforeWidth=0,a.rowFormat.gridBeforeWidthType="Auto",a.rowFormat.afterWidth=0,a.rowFormat.gridAfter=0,a.rowFormat.gridAfterWidth=0,a.rowFormat.gridAfterWidthType="Auto";for(r=0;r<a.childWidgets.length;r++){var h=a.childWidgets[r];h.cellFormat.preferredWidth=0,h.cellFormat.preferredWidthType="Auto"}}}},i.prototype.getMaxRowWidth=function(e){for(var t=0,i=0;i<this.childWidgets.length;i++){for(var n=this.childWidgets[i],r=0,o=0;o<n.childWidgets.length;o++){var s=n.childWidgets[o];r+=this.getCellWidth(s.cellFormat.preferredWidth,s.cellFormat.preferredWidthType,e,s)}t<r&&(t=r)}return t},i.prototype.updateWidth=function(e){var t=this.tableHolder.getTotalWidth(0),i=this.getOwnerWidth(!0),n=this.getTableClientWidth(i);if(n<=t&&"Auto"===this.tableFormat.preferredWidthType&&(this.tableFormat.preferredWidthType="Point"),"Auto"!==this.tableFormat.preferredWidthType)if("Point"===this.tableFormat.preferredWidthType)this.tableFormat.preferredWidth=this.getMaxRowWidth(n);else{var r=t/i*100;this.tableFormat.preferredWidth=r}},i.prototype.convertPointToPercent=function(e,t){var i=0;return i=e/t*100,i=Math.round(i),i<100?i:100},i.prototype.updateChildWidgetLeft=function(e){for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];i.x=e,i.updateChildWidgetLeft(e)}},i.prototype.shiftWidgetsForRtlTable=function(e,t){var i=t.x,n=e.right,r=0;t.tableFormat&&t.tableFormat.cellSpacing>0&&(r=t.tableFormat.cellSpacing);for(var o=0;o<t.childWidgets.length;o++)for(var s=t.childWidgets[o],a=n-(s.x-i),l=0;l<s.childWidgets.length;l++){var d=s.childWidgets[l];a-=d.width+d.margin.left+d.margin.right-d.rightBorderWidth+r,d.updateWidgetLeft(a+d.margin.left)}},i.prototype.clone=function(){var e=new i;e.tableHolder=this.tableHolder.clone(),e.tableFormat.copyFormat(this.tableFormat),this.wrapTextAround&&(e.wrapTextAround=this.wrapTextAround,e.positioning=this.positioning.clone());for(var t=0;t<this.childWidgets.length;t++){var n=this.childWidgets[t].clone();e.childWidgets.push(n),n.containerWidget=e,n.index=t}return e.x=this.x,e.y=this.y,e.height=this.height,e.width=this.width,e.containerWidget=this.containerWidget,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},i.getTableOf=function(e){if(e instanceof E){var n=Fe.getRowOf(e);return t.isNullOrUndefined(n)?e.ownerBase instanceof j&&e.ownerBase.ownerBase instanceof i?e.ownerBase.ownerBase:void 0:n.ownerTable}},i.prototype.fitChildToClientArea=function(){var e=this.getContainerWidth();Math.round(e)<Math.round(this.getTableWidth())&&this.fitCellsToClientArea(e);for(var t=0;t<this.childWidgets.length;t++)for(var n=this.childWidgets[t],r=0;r<n.childWidgets.length;r++)for(var o=n.childWidgets[r],s=0;s<o.childWidgets.length;s++)o.childWidgets[s]instanceof i&&o.childWidgets[s].fitChildToClientArea()},i.prototype.getColumnCellsForSelection=function(e,t){for(var i=[],n=e.columnIndex,r=t.columnIndex+t.cellFormat.columnSpan,o=0;o<this.childWidgets.length;o++)for(var s=this.childWidgets[o],a=0;a<s.childWidgets.length;a++){var l=s.childWidgets[a],d=l.columnIndex,h=l.cellFormat.columnSpan;d+h>n&&d+h<r||d>n&&d<r?i.indexOf(l)<0&&i.push(l):d>n&&d<r&&d+h<r||d<n&&d+h>r?i.indexOf(l)<0&&i.push(l):d!==n&&d+h!==r||i.indexOf(l)<0&&i.push(l)}return i},i.prototype.splitWidthToTableCells=function(e,t){for(var i=0;i<this.childWidgets.length;i++)this.childWidgets[i].splitWidthToRowCells(e,t)},i.prototype.insertTableRowsInternal=function(e,t,i){for(var n=e.length-1;n>=0;n--){var r=e.splice(n,1)[0];r.containerWidget=this,this.childWidgets.splice(t,0,r)}this.updateRowIndex(t),this.isGridUpdated=!1,i&&this.buildTableColumns(),this.isGridUpdated=!0},i.prototype.updateRowIndex=function(e){for(var t=e;t<this.childWidgets.length;t++){var i=this.childWidgets[t];i.index=t;for(var n=0;n<i.childWidgets.length;n++)i.childWidgets[n].index=n,i.childWidgets[n].rowIndex=i.rowIndex;e++}},i.prototype.getCellStartOffset=function(e){var t=0;if(e&&this.tableCellInfo&&this.tableCellInfo.containsKey(e.ownerRow.rowIndex)){var i=this.tableCellInfo.get(e.ownerRow.rowIndex);i.containsKey(e.cellIndex)&&(t=i.get(e.cellIndex))}return t},i.prototype.destroyInternal=function(e){var i=this.height;if(!t.isNullOrUndefined(this.childWidgets)){for(var n=0;n<this.childWidgets.length;n++){var r=void 0;if(r=this.childWidgets[n],t.isNullOrUndefined(r)||r.destroyInternal(e),t.isNullOrUndefined(this.childWidgets))break;n--}this.childWidgets=void 0}t.isNullOrUndefined(this.containerWidget)||(t.isNullOrUndefined(this.containerWidget.childWidgets)||(-1!==this.containerWidget.childWidgets.indexOf(this)&&this.containerWidget.childWidgets.splice(this.containerWidget.childWidgets.indexOf(this),1),this.containerWidget.height-=i),this.containerWidget=void 0),this.destroy()},i.prototype.destroy=function(){this.tableFormat=void 0,this.spannedRowCollection&&this.spannedRowCollection.destroy(),this.spannedRowCollection=void 0,this.tableHolder=void 0,this.flags=void 0,this.leftMargin=void 0,this.topMargin=void 0,this.rightMargin=void 0,this.bottomMargin=void 0,this.headerHeight=void 0,this.description=void 0,this.title=void 0,this.isDefaultFormatUpdated=void 0,e.prototype.destroy.call(this)},i}(ye),Fe=function(e){function i(){var t=e.call(this)||this;return t.topBorderWidth=0,t.bottomBorderWidth=0,t.rowFormat=new H(t),t}return he(i,e),Object.defineProperty(i.prototype,"rowIndex",{get:function(){return this.containerWidget?this.containerWidget.childWidgets.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ownerTable",{get:function(){if(this.containerWidget instanceof xe)return this.containerWidget},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"nextRow",{get:function(){var e=this.indexInOwner;if(e>-1&&e<this.ownerTable.childWidgets.length-1)return this.ownerTable.childWidgets[e+1]},enumerable:!0,configurable:!0}),i.prototype.equals=function(e){return e instanceof i&&e.rowFormat===this.rowFormat},i.prototype.combineCells=function(e){for(var t=0;t<this.childWidgets.length;t++){var i=this.childWidgets[t];if(i.combineWidget(e),1===i.cellFormat.rowSpan){i.height,i.margin.top,i.margin.bottom;this.height-this.ownerTable.tableFormat.cellSpacing<i.height&&(this.height=this.ownerTable.tableFormat.cellSpacing+i.height)}}},i.getRowOf=function(e){if(e instanceof E){var n=Pe.getCellOf(e);return t.isNullOrUndefined(n)?e.ownerBase instanceof H&&e.ownerBase.ownerBase instanceof i?e.ownerBase.ownerBase:void 0:n.ownerRow}},i.prototype.getCell=function(e,t){for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i];if(n.rowIndex===e&&n.index===t)return n}},i.prototype.splitWidthToRowCells=function(e,t){for(var i=this.childWidgets,n=e/i.length,r=0;r<i.length;r++)if(t&&0===i[r].cellFormat.preferredWidth)i[r].cellFormat.preferredWidth=n,this.ownerTable.isDefaultFormatUpdated=!1;else{if(t){this.ownerTable.isDefaultFormatUpdated=!0;break}i[r].cellFormat.preferredWidth=n}},i.prototype.getGridCount=function(e,t,i,n){var r=0,o=0,s=this.ownerTable,a=this.rowFormat;-1===i?o=s.getCellWidth(a.gridBeforeWidth,a.gridBeforeWidthType,n,null):(r+=s.getCellWidth(a.gridBeforeWidth,a.gridBeforeWidthType,n,null),i>=0&&(r+=s.getCellStartOffset(t)),o=i<this.childWidgets.length?s.getCellWidth(t.cellFormat.preferredWidth,t.cellFormat.preferredWidthType,n,null):s.getCellWidth(a.gridAfterWidth,a.gridAfterWidthType,n,null));var l=this.getOffsetIndex(e,r);return this.getOffsetIndex(e,r+o)-l},i.prototype.getOffsetIndex=function(e,t){t=parseFloat(t.toFixed(2));var i=0;if(e.indexOf(t)>=0)i=e.indexOf(t);else{for(var n=0;n<e.length;n++)if(e[n]>t)return n;i=e.length-1}return i},i.prototype.getCellOffset=function(e,t){for(var i=0,n=this.ownerTable,r=0;r<this.childWidgets.length;r++){var o=this.childWidgets[r].cellFormat;if(r===e)break;i+=n.getCellWidth(o.preferredWidth,o.preferredWidthType,t,null)}return i},i.prototype.updateRowBySpannedCells=function(){for(var e=this.getPreviousRowSpannedCells(),t=this.rowIndex,i=0;i<e.length;i++){var n=e[i];n.ownerRow.rowIndex+n.cellFormat.rowSpan-1>=t&&(n.cellFormat.rowSpan-=1)}},i.prototype.getPreviousRowSpannedCells=function(e){for(var i=[],n=e?this:this.previousWidget;!t.isNullOrUndefined(n);){for(var r=0;r<n.childWidgets.length;r++){var o=n.childWidgets[r];o.cellFormat.rowSpan>1&&i.splice(0,0,o)}n=n.previousWidget}return i},i.prototype.getTableCellWidget=function(e){for(var t=0;t<this.childWidgets.length;t++){var i=Math.round(this.childWidgets[t].x);if(i-this.childWidgets[t].margin.left-1<=e.x&&i+this.childWidgets[t].width>=e.x)return this.childWidgets[t];if(t===this.childWidgets.length-1&&this.childWidgets[t].x+this.childWidgets[t].width+1<=e.x)return this.childWidgets[t]}var n=void 0;return this.childWidgets.length>0&&(n=this.childWidgets[0].x<=e.x?this.childWidgets[this.childWidgets.length-1].getTableCellWidget(e):this.childWidgets[0].getTableCellWidget(e)),n},i.prototype.getMinimumAndMaximumWordWidth=function(e,t){return{minimumWordWidth:e,maximumWordWidth:t}},i.prototype.destroyInternal=function(e){var i=this.height;if(!t.isNullOrUndefined(this.childWidgets)){for(var n=0;n<this.childWidgets.length&&(this.childWidgets[n].destroyInternal(e),!t.isNullOrUndefined(this.childWidgets));n++)n--;this.childWidgets=void 0}t.isNullOrUndefined(this.containerWidget)||t.isNullOrUndefined(this.containerWidget.childWidgets)||(this.containerWidget.childWidgets.splice(this.containerWidget.childWidgets.indexOf(this),1),(t.isNullOrUndefined(this.containerWidget.childWidgets)||0===this.containerWidget.childWidgets.length)&&this.containerWidget instanceof xe?this.containerWidget.destroyInternal(e):this.containerWidget.containerWidget instanceof fe&&(this.containerWidget.containerWidget.height-=i),this.containerWidget.height-=i),this.destroy()},i.prototype.clone=function(){var e=new i;e.rowFormat.copyFormat(this.rowFormat),e.topBorderWidth=this.topBorderWidth,e.bottomBorderWidth=this.bottomBorderWidth;for(var t=0;t<this.childWidgets.length;t++){var n=this.childWidgets[t].clone();e.childWidgets.push(n),n.containerWidget=e,n.index=t,n.rowIndex=this.rowIndex}return e.x=this.x,e.y=this.y,e.height=this.height,e.width=this.width,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},i.prototype.updateChildWidgetLeft=function(e){var t=0;this.ownerTable.tableFormat.cellSpacing>0&&(t=this.ownerTable.tableFormat.cellSpacing);for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i];e+=t+n.margin.left,n.x=e,n.updateChildWidgetLeft(n.x),e+=n.width+n.margin.right}},i.prototype.shiftWidgetForRtlTable=function(e,t,i){var n=t.x,r=0,o=0;null!=t.tableFormat&&t.tableFormat.cellSpacing>0&&(r=t.tableFormat.cellSpacing);for(var s=n+(o=L.convertPointToPixel(t.getTableWidth()))-(i.x-n),a=0;a<i.childWidgets.length;a++){var l=i.childWidgets[a];s-=l.width+l.margin.left+l.margin.right-l.rightBorderWidth+r,l.updateWidgetLeft(s+l.margin.left)}},i.prototype.destroy=function(){this.rowFormat=void 0,this.rowFormat=void 0,this.topBorderWidth=void 0,this.bottomBorderWidth=void 0,e.prototype.destroy.call(this)},i}(ye),Pe=function(e){function i(){var t=e.call(this)||this;return t.rowIndex=-1,t.sizeInfoInternal=new xt,t.updatedTopBorders=[],t.margin=new ge(t.leftMargin,t.topMargin,t.rightMargin,t.bottomMargin),t.leftBorderWidth=0,t.rightBorderWidth=0,t.cellFormat=new q(t),t}return he(i,e),Object.defineProperty(i.prototype,"ownerColumn",{get:function(){return this.ownerTable.tableHolder.columns[this.columnIndex]},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"leftMargin",{get:function(){return this.cellFormat&&this.cellFormat.containsMargins()?this.cellFormat.leftMargin:!t.isNullOrUndefined(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("leftMargin")?this.ownerRow.rowFormat.leftMargin:t.isNullOrUndefined(this.ownerTable)||t.isNullOrUndefined(this.ownerTable.tableFormat)?0:this.ownerTable.tableFormat.leftMargin},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"topMargin",{get:function(){return this.cellFormat&&this.cellFormat.containsMargins()?this.cellFormat.topMargin:!t.isNullOrUndefined(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("topMargin")?this.ownerRow.rowFormat.topMargin:t.isNullOrUndefined(this.ownerTable)||t.isNullOrUndefined(this.ownerTable.tableFormat)?0:this.ownerTable.tableFormat.topMargin},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"rightMargin",{get:function(){return this.cellFormat&&this.cellFormat.containsMargins()?this.cellFormat.rightMargin:!t.isNullOrUndefined(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("rightMargin")?this.ownerRow.rowFormat.rightMargin:t.isNullOrUndefined(this.ownerTable)||t.isNullOrUndefined(this.ownerTable.tableFormat)?0:this.ownerTable.tableFormat.rightMargin},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bottomMargin",{get:function(){return this.cellFormat&&this.cellFormat.containsMargins()?this.cellFormat.bottomMargin:!t.isNullOrUndefined(this.ownerRow)&&this.ownerRow.rowFormat.hasValue("bottomMargin")?this.ownerRow.rowFormat.bottomMargin:t.isNullOrUndefined(this.ownerTable)||t.isNullOrUndefined(this.ownerTable.tableFormat)?0:this.ownerTable.tableFormat.bottomMargin},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"cellIndex",{get:function(){return this.ownerRow?this.ownerRow.childWidgets.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ownerTable",{get:function(){if(this.containerWidget instanceof Fe)return this.containerWidget.ownerTable},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ownerRow",{get:function(){return this.containerWidget},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sizeInfo",{get:function(){return this.sizeInfoInternal},enumerable:!0,configurable:!0}),i.prototype.equals=function(e){return e instanceof i&&e.cellFormat===this.cellFormat},i.prototype.getContainerTable=function(){for(var e=this.ownerTable;e instanceof xe&&e.associatedCell instanceof i;)e=e.associatedCell.getContainerTable();return e},i.prototype.getPreviousSplitWidget=function(){if(this.containerWidget instanceof Fe){var e=this.containerWidget;do{if(e=e.previousRenderedWidget,t.isNullOrUndefined(e)||e.index<this.rowIndex)break;var i=e.getCell(this.rowIndex,this.index);if(i&&this.equals(i))return i}while(e)}},i.prototype.getNextSplitWidget=function(){var e=this.cellFormat.rowSpan;if(this.containerWidget instanceof Fe){var i=this.containerWidget;do{if(i=i.nextRenderedWidget,t.isNullOrUndefined(i)||i.index>this.rowIndex+e)break;var n=i.getCell(this.rowIndex,this.index);if(n&&this.equals(n))return n}while(i)}},i.prototype.getTableCellWidget=function(e){for(var t=0;t<this.childWidgets.length;t++)if(this.childWidgets[t].y<=e.y&&this.childWidgets[t].y+this.childWidgets[t].height>=e.y)return this.childWidgets[t].getTableCellWidget(e);var i=void 0;return this.childWidgets.length>0&&(i=this.childWidgets[0].y<=e.y?this.childWidgets[this.childWidgets.length-1].getTableCellWidget(e):this.childWidgets[0].getTableCellWidget(e)),i},i.prototype.updateWidth=function(e){"Point"===this.cellFormat.preferredWidthType?this.cellFormat.preferredWidth=e:"Percent"===this.cellFormat.preferredWidthType&&(this.cellFormat.preferredWidth=this.convertPointToPercent(e)),this.cellFormat.cellWidth=e},i.prototype.getCellWidth=function(e){var i=this.ownerTable,n=i?i.getTableClientWidth(i.getOwnerWidth(!0)):0,r=n,o=t.isNullOrUndefined(this.leftMargin)?0:this.leftMargin,s=t.isNullOrUndefined(this.rightMargin)?0:this.rightMargin;return i&&"Auto"===i.tableFormat.preferredWidthType&&i.tableFormat.allowAutoFit?r=0===this.cellFormat.preferredWidth?n:this.cellFormat.preferredWidth:"Percent"===this.cellFormat.preferredWidthType?r=this.cellFormat.preferredWidth*n/100-o-s:"Point"===this.cellFormat.preferredWidthType&&(r=e instanceof xe&&"Percent"===e.tableFormat.preferredWidthType?this.cellFormat.cellWidth-o-s:this.cellFormat.preferredWidth-o-s),r},i.prototype.convertPointToPercent=function(e){var t=0,i=this.ownerTable.getOwnerWidth(!0);return t=e/this.ownerTable.getTableClientWidth(i)*100,t=Math.round(t),t<100?t:100},i.getCellLeftBorder=function(e){var i=void 0,n=e.cellFormat.borders,r=t.isNullOrUndefined(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=t.isNullOrUndefined(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;if(t.isNullOrUndefined(n.left)||(i=n.left),t.isNullOrUndefined(i)&&(i=e.getLeftBorderToRenderByHierarchy(i,r,o)),e.ownerTable.tableFormat.cellSpacing>0)i=e.getLeftBorderToRenderByHierarchy(i,r,o);else{var s=void 0;if(t.isNullOrUndefined(e.previousWidget)){if((e.cellFormat.columnSpan>1||e.columnIndex>=1)&&e.ownerRow.rowIndex>0)for(var a=e.ownerRow.previousWidget;!t.isNullOrUndefined(a)&&a.childWidgets.length>0;){for(var l=0;l<a.childWidgets.length;l++){var d=a.childWidgets[l];if(d.columnIndex+d.cellFormat.columnSpan===e.columnIndex){s=a.childWidgets[l];break}}if(!t.isNullOrUndefined(s))break;a=a.previousWidget}}else s=e.previousWidget;i=e.getPreviousCellLeftBorder(i,s)}return t.isNullOrUndefined(i)&&(i=new N(e.cellFormat.borders)),i},i.prototype.getLeftBorderWidth=function(){var e=0;return null!==this.cellFormat&&null!==this.cellFormat.borders&&(e=i.getCellLeftBorder(this).getLineWidth()),e},i.prototype.getRightBorderWidth=function(){var e=0;this.ownerTable;return null!==this.cellFormat&&null!==this.cellFormat.borders&&(e=i.getCellRightBorder(this).getLineWidth()),e},i.prototype.getCellSpacing=function(){var e=this.ownerTable&&this.ownerTable.tableFormat?this.ownerTable.tableFormat.cellSpacing:0;return 1===this.ownerRow.childWidgets.length?2*e:0===this.cellIndex||this.cellIndex===this.ownerRow.childWidgets.length-1?e+e/2:e},i.prototype.getCellSizeInfo=function(e){var i=!0,n=void 0;if(t.isNullOrUndefined(this.bodyWidget)||t.isNullOrUndefined(this.bodyWidget.page)||t.isNullOrUndefined(this.bodyWidget.page.documentHelper)||(n=this.bodyWidget.page.documentHelper.layout),t.isNullOrUndefined(n)||t.isNullOrUndefined(n.currentCell)||(i=!1,this===n.currentCell&&(i=!0)),i&&!this.sizeInfo.hasMinimumWidth&&(this.sizeInfo.minimumWidth=this.getMinimumPreferredWidth()),e&&i&&!this.sizeInfo.hasMinimumWordWidth){var r=this.getMinimumAndMaximumWordWidth(0,0);this.sizeInfo.minimumWordWidth=r.minimumWordWidth+this.sizeInfo.minimumWidth,this.sizeInfo.maximumWordWidth=r.maximumWordWidth+this.sizeInfo.minimumWidth}var o=new xt;return o.minimumWidth=this.sizeInfo.minimumWidth,o.minimumWordWidth=this.sizeInfo.minimumWordWidth,o.maximumWordWidth=this.sizeInfo.maximumWordWidth,o},i.prototype.getMinimumPreferredWidth=function(){return this.cellFormat.preferredWidth>0&&!this.ownerTable.tableFormat.allowAutoFit||this.cellFormat.preferredWidth>0&&"Auto"!==this.cellFormat.preferredWidthType?this.cellFormat.preferredWidth:0===this.cellFormat.preferredWidth&&"Auto"===this.cellFormat.preferredWidthType&&0!==this.cellFormat.cellWidth&&this.ownerTable&&"Auto"!==this.ownerTable.tableFormat.preferredWidthType?this.cellFormat.cellWidth:0===this.cellFormat.preferredWidth&&"Auto"===this.cellFormat.preferredWidthType&&0===this.cellFormat.cellWidth&&this.previousWidget&&this.previousWidget.cellFormat.preferredWidth>0?this.previousWidget.cellFormat.preferredWidth:this.leftMargin+this.rightMargin+this.getLeftBorderWidth()+this.getRightBorderWidth()+this.getCellSpacing()},i.prototype.getPreviousCellLeftBorder=function(e,i){if((t.isNullOrUndefined(i)||!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&!e.hasNoneStyle)&&(t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof j||(e=this.getLeftBorderToRenderByHierarchy(e,Fe.getRowOf(e.ownerBase).rowFormat.borders,xe.getTableOf(e.ownerBase).tableFormat.borders))),t.isNullOrUndefined(i))return e;var n=void 0;return t.isNullOrUndefined(i.cellFormat.borders)||t.isNullOrUndefined(i.cellFormat.borders.right)||"None"===i.cellFormat.borders.right.lineStyle||(n=i.cellFormat.borders.right),t.isNullOrUndefined(n)||"None"===n.lineStyle?t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof j?e:this.getLeftBorderToRenderByHierarchy(e,Fe.getRowOf(e.ownerBase).rowFormat.borders,xe.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(n,e)},i.prototype.getBorderBasedOnPriority=function(e,i){if(t.isNullOrUndefined(e))return i;if(t.isNullOrUndefined(i))return e;var n=e.getBorderWeight(),r=i.getBorderWeight();if(n===r){var o=e.getPrecedence(),s=i.getPrecedence();if(o===s){var a=this.convertHexToRGB(e.color),l=a.r,d=a.g,h=a.b,c=this.convertHexToRGB(i.color),p=c.r,g=c.g,u=c.b,m=l+h+2*d,f=p+u+2*g;return m===f?(m=h+2*d,f=u+2*g,m===f?d===g?e:d>g?i:e:m>f?i:e):m>f?i:e}return o>s?e:i}return n>r?e:i},i.prototype.getLeftBorderToRenderByHierarchy=function(e,n,r){return t.isNullOrUndefined(e)||"None"===e.lineStyle&&(!e.hasNoneStyle||"None"===e.lineStyle&&0===e.lineWidth&&"#000000"===e.color)?!t.isNullOrUndefined(e)&&e.ownerBase instanceof E&&(0===i.getCellOf(e.ownerBase).columnIndex||0===i.getCellOf(e.ownerBase).cellIndex&&i.getCellOf(e.ownerBase).ownerRow.rowFormat.gridBefore>0)?0!==i.getCellOf(e.ownerBase).columnIndex&&i.getCellOf(e.ownerBase).ownerRow.rowFormat.gridBefore<1&&!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(n.vertical)&&"None"!==n.vertical.lineStyle?e=n.vertical:(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.left)||(e=r.left),e):t.isNullOrUndefined(n)||t.isNullOrUndefined(n.vertical)||"None"===n.vertical.lineStyle?t.isNullOrUndefined(r)||t.isNullOrUndefined(r.vertical)||"None"===r.vertical.lineStyle?e:e=r.vertical:e=n.vertical:e},i.getCellRightBorder=function(e){var i=void 0,n=e.cellFormat.borders,r=t.isNullOrUndefined(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=t.isNullOrUndefined(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;if(t.isNullOrUndefined(n.right)||(i=n.right),t.isNullOrUndefined(i)&&(i=e.getRightBorderToRenderByHierarchy(i,r,o)),e.ownerTable.tableFormat.cellSpacing>0)i=e.getRightBorderToRenderByHierarchy(i,r,o);else{var s=void 0;t.isNullOrUndefined(e.nextWidget)||(s=e.nextWidget),i=e.getAdjacentCellRightBorder(i,s)}return t.isNullOrUndefined(i)&&(i=new N(e.cellFormat.borders)),i},i.prototype.getAdjacentCellRightBorder=function(e,i){if((t.isNullOrUndefined(i)||!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&!e.hasNoneStyle)&&(t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof j||(e=this.getRightBorderToRenderByHierarchy(e,Fe.getRowOf(e.ownerBase).rowFormat.borders,xe.getTableOf(e.ownerBase).tableFormat.borders))),t.isNullOrUndefined(i))return e;var n=void 0;return t.isNullOrUndefined(i.cellFormat.borders)||t.isNullOrUndefined(i.cellFormat.borders.left)||"None"===i.cellFormat.borders.left.lineStyle||(n=i.cellFormat.borders.left),t.isNullOrUndefined(n)||"None"===n.lineStyle?t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof j?e:this.getRightBorderToRenderByHierarchy(e,Fe.getRowOf(e.ownerBase).rowFormat.borders,xe.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(e,n)},i.prototype.getRightBorderToRenderByHierarchy=function(e,n,r){return t.isNullOrUndefined(e)||"None"===e.lineStyle&&(!e.hasNoneStyle||"None"===e.lineStyle&&0===e.lineWidth&&"#000000"===e.color)?!t.isNullOrUndefined(e)&&e.ownerBase instanceof E&&i.getCellOf(e.ownerBase).cellIndex===i.getCellOf(e.ownerBase).ownerRow.childWidgets.length-1?(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.right)||(e=r.right),e):t.isNullOrUndefined(n)||t.isNullOrUndefined(n.vertical)||"None"===n.vertical.lineStyle?t.isNullOrUndefined(r)||t.isNullOrUndefined(r.vertical)||"None"===r.vertical.lineStyle?e:e=r.vertical:e=n.vertical:e},i.getCellTopBorder=function(e){var i=void 0,n=e.cellFormat.borders,r=t.isNullOrUndefined(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=t.isNullOrUndefined(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;if(t.isNullOrUndefined(n.top)||(i=n.top),t.isNullOrUndefined(i)&&(i=e.getTopBorderToRenderByHierarchy(i,r,o)),e.ownerTable.tableFormat.cellSpacing>0)i=e.getTopBorderToRenderByHierarchy(i,r,o);else{for(var s=void 0,a=e.ownerRow.previousWidget;!t.isNullOrUndefined(a)&&a.childWidgets.length>0;){for(l=0;l<a.childWidgets.length;l++)if((d=a.childWidgets[l]).columnIndex+d.cellFormat.columnSpan-1>=e.columnIndex){s=a.childWidgets[l];break}if(!t.isNullOrUndefined(s))break;if(a=a.previousWidget,t.isNullOrUndefined(a)&&t.isNullOrUndefined(s))if(a=e.ownerRow.previousWidget,e.columnIndex<a.childWidgets.length)for(var l=0;l<a.childWidgets.length;l++){var d=a.childWidgets[l];if(d.columnIndex===e.columnIndex){s=a.childWidgets[l];break}}else s=e.ownerRow.previousWidget.childWidgets[e.ownerRow.previousWidget.childWidgets.length-1]}i=e.getPreviousCellTopBorder(i,s)}return t.isNullOrUndefined(i)&&(i=new N(e.cellFormat.borders)),i},i.prototype.getPreviousCellTopBorder=function(e,i){if((t.isNullOrUndefined(i)||!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&!e.hasNoneStyle)&&(t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof j||(e=this.getTopBorderToRenderByHierarchy(e,Fe.getRowOf(e.ownerBase).rowFormat.borders,xe.getTableOf(e.ownerBase).tableFormat.borders))),t.isNullOrUndefined(i))return e;var n=void 0;return t.isNullOrUndefined(i.cellFormat.borders)||t.isNullOrUndefined(i.cellFormat.borders.bottom)||"None"===i.cellFormat.borders.bottom.lineStyle||(n=i.cellFormat.borders.bottom),t.isNullOrUndefined(n)||"None"===n.lineStyle?t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof j?e:this.getTopBorderToRenderByHierarchy(e,Fe.getRowOf(e.ownerBase).rowFormat.borders,xe.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(e,n)},i.prototype.getTopBorderToRenderByHierarchy=function(e,n,r){return t.isNullOrUndefined(e)||"None"===e.lineStyle&&(!e.hasNoneStyle||"None"===e.lineStyle&&0===e.lineWidth&&"#000000"===e.color)?!t.isNullOrUndefined(e)&&e.ownerBase instanceof E&&0===i.getCellOf(e.ownerBase).ownerRow.rowIndex?(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.top)||(e=r.top),e):t.isNullOrUndefined(n)||t.isNullOrUndefined(n.horizontal)||"None"===n.horizontal.lineStyle?t.isNullOrUndefined(r)||t.isNullOrUndefined(r.horizontal)||"None"===r.horizontal.lineStyle?e:e=r.horizontal:e=n.horizontal:e},i.getCellBottomBorder=function(e){var i=void 0,n=e.cellFormat.borders,r=t.isNullOrUndefined(e.ownerRow)?void 0:e.ownerRow.rowFormat.borders,o=t.isNullOrUndefined(e.ownerTable)?void 0:e.ownerTable.tableFormat.borders;if(t.isNullOrUndefined(n.bottom)||(i=n.bottom),t.isNullOrUndefined(i)&&(i=e.getBottomBorderToRenderByHierarchy(i,r,o)),e.ownerTable.tableFormat.cellSpacing>0)i=e.getBottomBorderToRenderByHierarchy(i,r,o);else{var s=void 0,a=e.ownerRow.nextWidget;!t.isNullOrUndefined(a)&&e.columnIndex<a.childWidgets.length&&(s=a.childWidgets[e.columnIndex]),i=e.getAdjacentCellBottomBorder(i,s)}return t.isNullOrUndefined(i)&&(i=new N(e.cellFormat.borders)),i},i.prototype.getAdjacentCellBottomBorder=function(e,i){if((t.isNullOrUndefined(i)||!t.isNullOrUndefined(e)&&"None"===e.lineStyle&&!e.hasNoneStyle)&&(t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof j||(e=this.getBottomBorderToRenderByHierarchy(e,Fe.getRowOf(e.ownerBase).rowFormat.borders,xe.getTableOf(e.ownerBase).tableFormat.borders))),t.isNullOrUndefined(i))return e;var n=void 0;return t.isNullOrUndefined(i.cellFormat.borders)||t.isNullOrUndefined(i.cellFormat.borders.top)||"None"===i.cellFormat.borders.top.lineStyle||(n=i.cellFormat.borders.top),t.isNullOrUndefined(n)||"None"===n.lineStyle?t.isNullOrUndefined(e)||e.ownerBase.ownerBase instanceof j?e:this.getBottomBorderToRenderByHierarchy(e,Fe.getRowOf(e.ownerBase).rowFormat.borders,xe.getTableOf(e.ownerBase).tableFormat.borders):this.getBorderBasedOnPriority(e,n)},i.prototype.getBottomBorderToRenderByHierarchy=function(e,n,r){return t.isNullOrUndefined(e)||"None"===e.lineStyle&&(!e.hasNoneStyle||"None"===e.lineStyle&&0===e.lineWidth&&"#000000"===e.color)?!t.isNullOrUndefined(e)&&e.ownerBase instanceof E&&i.getCellOf(e.ownerBase).ownerRow.rowIndex+i.getCellOf(e.ownerBase).cellFormat.rowSpan===i.getCellOf(e.ownerBase).ownerTable.childWidgets.length?(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.bottom)||(e=r.bottom),e):t.isNullOrUndefined(n)||t.isNullOrUndefined(n.horizontal)||"None"===n.horizontal.lineStyle?t.isNullOrUndefined(r)||t.isNullOrUndefined(r.horizontal)||"None"===r.horizontal.lineStyle?e:e=r.horizontal:e=n.horizontal:e},i.prototype.convertHexToRGB=function(e){if(e){e=e.replace(/[^0-9A-‌​F]/gi,"");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}}},i.getCellOf=function(e){if(e instanceof E)return e.ownerBase instanceof q&&e.ownerBase.ownerBase instanceof i?e.ownerBase.ownerBase:void 0},i.prototype.updateWidgetLeft=function(e){this.x=e,this.updateChildWidgetLeft(e)},i.prototype.updateChildWidgetLeft=function(e){for(var t=0;t<this.childWidgets.length;t++)if(this.childWidgets[t].x=e,this.childWidgets[t]instanceof xe){var i=this.childWidgets[t];if(i.updateChildWidgetLeft(e),i.isBidiTable){var n=new ce(i.x,i.y,i.width,i.height);i.shiftWidgetsForRtlTable(n,i)}}},i.prototype.getMinimumAndMaximumWordWidth=function(e,t){for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i].getMinimumAndMaximumWordWidth(e,t);e=n.minimumWordWidth,t=n.maximumWordWidth}return{minimumWordWidth:e,maximumWordWidth:t}},i.prototype.destroyInternal=function(e){if(!t.isNullOrUndefined(this.childWidgets)){for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i];n.destroyInternal(e),i--}this.childWidgets=void 0}this.destroy()},i.prototype.clone=function(){var e=new i;e.cellFormat.copyFormat(this.cellFormat);for(var t=0;t<this.childWidgets.length;t++){var n=this.childWidgets[t].clone();e.childWidgets.push(n),n.containerWidget=e,n.index=t}return e.leftBorderWidth=this.leftBorderWidth,e.rightBorderWidth=this.rightBorderWidth,this.margin&&(e.margin=this.margin.clone()),e.columnIndex=this.columnIndex,e.x=this.x,e.y=this.y,e.height=this.height,e.width=this.width,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},i.prototype.destroy=function(){this.cellFormat=void 0,this.rowIndex=void 0,this.columnIndex=void 0,e.prototype.destroy.call(this)},i}(ye),Te=function(){function e(e){this.children=[],this.x=0,this.y=0,this.width=0,this.height=0,this.marginTop=0,this.paragraph=e}return Object.defineProperty(e.prototype,"indexInOwner",{get:function(){return this.paragraph&&this.paragraph.childWidgets?this.paragraph.childWidgets.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextLine",{get:function(){var t=this.paragraph,i=this.indexInOwner;if(i<=t.childWidgets.length-2)return t.childWidgets[i+1];if(t.nextSplitWidget){var n=t.nextSplitWidget.firstChild;if(n instanceof e&&n.paragraph.equals(this.paragraph))return n}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousLine",{get:function(){var t=this.paragraph,i=this.indexInOwner,n=t.previousSplitWidget;if(i>0)return t.childWidgets[i-1];if(n instanceof we){var r=n.lastChild;if(r instanceof e&&r.paragraph.equals(this.paragraph))return r}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEndsWithPageBreak",{get:function(){if(this.children.length>0){var e=this.children[this.children.length-1];if(e instanceof Oe)return e.isPageBreak}return!1},enumerable:!0,configurable:!0}),e.prototype.isFirstLine=function(){var e=this.indexInOwner;return!!(e>-1&&(void 0===this.paragraph.previousSplitWidget||this.paragraph.previousSplitWidget instanceof we&&this.paragraph.previousSplitWidget.isEndsWithPageBreak))&&0===e},e.prototype.isLastLine=function(){var e=this.indexInOwner;return e>-1&&void 0===this.paragraph.nextSplitWidget&&e===this.paragraph.childWidgets.length-1},e.prototype.getOffset=function(e,i){if(t.isNullOrUndefined(e))return i;var n=i,r=e.line,o=(e.line.paragraph.childWidgets.indexOf(e.line),r.paragraph.bidi),s=this.paragraph.bodyWidget.page.documentHelper.layout.isContainsRtl(this);if(o||s)if(o)n=(a=this.getInlineForOffset(n,!0,e)).index;else{var a=this.getInlineForRtlLine(n,!0,e);n=a.index}else for(var l=0;l<r.children.length;l++){var d=r.children[l];if(e===d)break;d instanceof Qe||(n+=d.length)}return n},e.prototype.getEndOffset=function(){var e=0,t=0;if(this.paragraph.bidi||this.paragraph.bodyWidget.page.documentHelper.layout.isContainsRtl(this))e=this.getInlineForOffset(e,!1,this.children[0],!0).index;else for(var i=0;i<this.children.length;i++){var n=this.children[i];0!==n.length&&(n instanceof Qe||((n instanceof Oe||n instanceof et||n instanceof Ze||n instanceof $e||n instanceof Ae||n instanceof Me||n instanceof Ie&&L.isLinkedFieldCharacter(n))&&(e=t+n.length),t+=n.length))}return e},e.prototype.getInlineForOffset=function(e,i,n,r,o,s){for(var a,l=this.children[this.children.length-1],d=l,h=this.paragraph.bodyWidget.page.documentHelper,c=h.textHelper,p=!1,g=0,u=h.selection.getLineLength(this),m=0;d;){if(!(a||d instanceof De&&"\t"===d.text||(!(d instanceof Oe)||c.isRTLText(d.text)||(c.containsSpecialCharAlone(d.text)||/^[0-9]+$/.test(d.text))&&d.characterFormat.bidi)&&d instanceof Oe)){for(;d.previousElement&&(d.previousElement instanceof Oe&&!c.isRTLText(d.previousElement.text)&&(!c.containsSpecialCharAlone(d.previousElement.text)&&!/^[0-9]+$/.test(d.previousElement.text)||!d.previousElement.characterFormat.bidi)||d.previousElement instanceof Ie||d.previousElement instanceof Ae&&!t.isNullOrUndefined(d.previousElement.previousElement)&&!(d.previousElement.previousElement instanceof Ae)||d.previousElement instanceof Ae&&d.previousElement.previousElement instanceof Ae&&!t.isNullOrUndefined(d.previousElement.previousElement.previousElement)||d instanceof Ae&&d.previousElement instanceof Ae&&!t.isNullOrUndefined(d.previousElement.previousElement)||d.previousElement instanceof Qe||d.previousElement instanceof $e||d.previousElement instanceof et||d.previousElement instanceof Ze);)p=!0,d=d.previousElement;if(d.previousElement&&(p||d.previousElement instanceof Oe&&(c.isRTLText(d.previousElement.text)||(c.containsSpecialCharAlone(d.previousElement.text)||/^[0-9]+$/.test(d.previousElement.text))&&d.previousElement.characterFormat.bidi)))a=d.previousElement;else if(!d.previousElement){if(d instanceof Qe)break;a=d}d instanceof Qe&&a&&(d=a,a=void 0)}if(i&&!t.isNullOrUndefined(n)){if(n===d)return{element:d,index:e};e+=d.length}else if(r){if((e+=d.length)===u)return{element:d,index:e};if(e>u)return{element:d,index:u}}else if(s){if(e<g+d.length&&(d instanceof Oe||d instanceof Ze||d instanceof Ie&&L.isLinkedFieldCharacter(d)))return{element:d,index:(e>g?e:g)+1};g+=d.length}else{if(e<=g+d.length)return{element:d,index:o?e-1===g?m:e-1:e-g};o&&(d instanceof Oe||d instanceof Ze||d instanceof Ie&&L.isLinkedFieldCharacter(d))&&(m=g+d.length),g+=d.length}if(d.previousElement&&(d instanceof Oe&&(c.isRTLText(d.text)||(c.containsSpecialCharAlone(d.text)||/^[0-9]+$/.test(d.text))&&d.characterFormat.bidi)||d instanceof De&&"\t"===d.text||d instanceof Ae&&(d instanceof Ae&&d.previousElement instanceof Ae&&!d.previousElement.previousElement||1===d.bookmarkType&&!d.previousElement))){if((e===g+1||e>g+1)&&g===u&&!d.previousElement)break;d=d.previousElement}else if(a&&(!d.nextElement||d===l||d.nextElement instanceof Oe&&(c.isRTLText(d.nextElement.text)||(c.containsSpecialCharAlone(d.nextElement.text)||/^[0-9]+$/.test(d.nextElement.text))&&d.nextElement.characterFormat.bidi)||d.nextElement instanceof Qe)){if(e===g+1&&g===u)break;d=a,a=void 0,p=!1}else{if((a===d||e===g+1)&&!d.previousElement&&g===u)break;d=d.nextElement}}return s?{element:d,index:e}:o?{element:d,index:-1}:{element:d,index:r?e:0}},e.prototype.getInlineForRtlLine=function(e,i,n){for(var r,o=this.children[0],s=this.paragraph.bodyWidget.page.documentHelper,a=s.textHelper,l=!1,d=0,h=(s.selection.getLineLength(this),-1),c=-1,p=!1;o;)if(o instanceof Qe)o=o.nextElement;else{if(!p&&(o instanceof Oe||o instanceof Ze||o instanceof Ae||o instanceof $e||o instanceof et||o instanceof Ie&&L.isLinkedFieldCharacter(o))&&(p=!0),!r)for(;o&&o instanceof Oe&&(a.isRTLText(o.text)||a.containsSpecialCharAlone(o.text));)r||(r=o),h=this.children.indexOf(o),o=o.nextElement,l=!0;if(-1!==h&&l&&(o=this.children[h]),i&&!t.isNullOrUndefined(n)){if(n===o)return{element:o,index:e};e+=o.length}else{if(p&&e<=d+o.length)return c=e-d,{element:o,index:c};d+=o.length}if(r===o&&(r=void 0,-1!==h&&(o=this.children[h]),h=-1),r&&o.previousElement)o=o.previousElement;else{if(!o.nextElement)return e>d&&(c=t.isNullOrUndefined(o)?e:o.length),{element:o,index:c};o=o.nextElement}l=!1}return{element:o,index:c}},e.prototype.getInline=function(e,i,n,r){n=t.isNullOrUndefined(n)?this.paragraph.bidi:n;var o=void 0,s=0,a=!1;if(0===this.children.length&&this.previousLine){var l=this.previousLine.children[this.previousLine.children.length-1];if(l instanceof Oe&&"\v"===l.text)return o=this.previousLine.children[this.previousLine.children.length-1],i=1,{element:o,index:i}}var d=this.paragraph.bodyWidget.page.documentHelper.layout.isContainsRtl(this);if(n||d)if(n)o=(h=this.getInlineForOffset(e)).element,i=h.index;else{var h=this.getInlineForRtlLine(e);o=h.element,i=h.index}else{for(var c=0;c<this.children.length;c++)if(!((o=this.children[c])instanceof Qe)){if(!a&&(o instanceof Oe||o instanceof Ze||o instanceof Ke||o instanceof Me||o instanceof Ae||o instanceof $e||o instanceof et||o instanceof vt||o instanceof Ie&&L.isLinkedFieldCharacter(o))&&(a=!0),a&&e<=s+o.length){if(o instanceof Oe&&" "===o.text&&0===o.revisions.length&&r){var p=this.getNextTextElement(this,c+1);return o=t.isNullOrUndefined(p)?o:p,i=t.isNullOrUndefined(p)?e-s:0,{element:o,index:i}}return e===s+o.length&&this.children[c+1]instanceof Le?{element:this.children[c+1],index:i}:(i=e-s,{element:o,index:i})}s+=o.length}e>s&&(i=t.isNullOrUndefined(o)?e:o.length)}return{element:o,index:i}},e.prototype.getNextTextElement=function(e,t){return t<e.children.length-1&&e.children[t]?e.children[t]:null},e.prototype.getHierarchicalIndex=function(e){var t=this;return e=t.paragraph.childWidgets.indexOf(t)+";"+e,t.paragraph instanceof ye?t.paragraph.getHierarchicalIndex(e):e},e.prototype.clone=function(){for(var t=new e(void 0),i=0;i<this.children.length;i++){var n=this.children[i].clone();t.children.push(n),n.line=t}return t.width=this.width,t.height=this.height,t},e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.children)){for(var e=0;e<this.children.length;e++)this.children[e].destroy();this.children=[]}this.children=void 0,this.paragraph&&this.paragraph.removeChild(this.indexInOwner),this.paragraph=void 0,this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0},e}(),Se=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0,this.margin=new ge(0,0,0,0),this.padding=new ge(0,0,0,0),this.characterFormat=void 0,this.isRightToLeft=!1,this.canTrigger=!1,this.ischangeDetected=!1,this.isVisible=!1,this.isSpellChecked=!1,this.revisions=[],this.canTrack=!1,this.removedIds=[],this.isMarkedForRevision=!1,this.characterFormat=new k(this),this.margin=new ge(0,0,0,0)}return Object.defineProperty(e.prototype,"isPageBreak",{get:function(){return this instanceof Oe&&"\f"===this.text},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValidNodeForTracking",{get:function(){return!(this instanceof Ae||this instanceof vt||this instanceof et||this instanceof $e||this instanceof Me)},enumerable:!0,configurable:!0}),e.prototype.linkFieldCharacter=function(e){if(this instanceof Ie)if(0===this.fieldType){var i=this;t.isNullOrUndefined(i.fieldEnd)&&(this.linkFieldTraversingForward(this.line,i,i),-1===e.fields.indexOf(i)&&e.fields.push(i),t.isNullOrUndefined(i.formFieldData)||-1!==e.formFields.indexOf(i)||e.formFields.push(i))}else if(2===this.fieldType){var n=this;if(t.isNullOrUndefined(n.fieldBegin)&&this.linkFieldTraversingBackwardSeparator(this.line,n,n),!t.isNullOrUndefined(n.fieldBegin)){n.fieldBegin.fieldSeparator=n;var r=this.linkFieldTraversingForward(this.line,n.fieldBegin,n);t.isNullOrUndefined(n.fieldEnd)&&r&&(n.fieldEnd=n.fieldBegin.fieldEnd),n.fieldEnd&&(n.fieldEnd.fieldSeparator=n)}}else{var o=this;t.isNullOrUndefined(o.fieldBegin)&&this.linkFieldTraversingBackward(this.line,o,o)}},e.prototype.linkFieldTraversingBackward=function(e,i,n){var r=e.children.length-1;e.children.indexOf(n)>-1&&(r=e.children.indexOf(n)-1);for(var o=r;o>=0;o--){var s=e.children[o];if(s instanceof Ie)if(0===s.fieldType){if(t.isNullOrUndefined(s.fieldEnd))return i.fieldBegin=s,t.isNullOrUndefined(s.fieldEnd)&&(s.fieldEnd=i),i.fieldSeparator&&t.isNullOrUndefined(i.fieldSeparator.fieldBegin)&&(i.fieldSeparator.fieldBegin=s,t.isNullOrUndefined(s.fieldSeparator)&&(s.fieldSeparator=i.fieldSeparator)),!t.isNullOrUndefined(i.fieldBegin)}else 2===s.fieldType&&t.isNullOrUndefined(s.fieldEnd)&&(i.fieldSeparator=s,s.fieldEnd=i,t.isNullOrUndefined(s.fieldBegin)||(i.fieldBegin=s.fieldBegin))}if(e.previousLine)this.linkFieldTraversingBackward(e.previousLine,i,this);else if(e.paragraph.previousRenderedWidget instanceof we&&e.paragraph.previousRenderedWidget.childWidgets.length>0){var a=e.paragraph.previousRenderedWidget;this.linkFieldTraversingBackward(a.childWidgets[a.childWidgets.length-1],i,this)}return!0},e.prototype.linkFieldTraversingForward=function(e,i,n){var r=0;e.children.indexOf(n)>-1&&(r=e.children.indexOf(n)+1);for(var o=r;o<e.children.length;o++){var s=e.children[o];if(s instanceof Ie){if(1===s.fieldType)return t.isNullOrUndefined(s.fieldBegin)&&(i.fieldEnd=s),i.fieldEnd&&t.isNullOrUndefined(i.fieldEnd.fieldBegin)&&(i.fieldEnd.fieldBegin=i),!0;if(t.isNullOrUndefined(i.fieldSeparator)){if(2!==s.fieldType||!t.isNullOrUndefined(s.fieldBegin))return!1;if(i.fieldSeparator=s,i.fieldSeparator&&t.isNullOrUndefined(i.fieldSeparator.fieldBegin)&&(i.fieldSeparator.fieldBegin=i),!t.isNullOrUndefined(s.fieldEnd))return i.fieldEnd=s.fieldEnd,i.fieldSeparator.fieldEnd=i.fieldEnd,!0}}}return e.nextLine?this.linkFieldTraversingForward(e.nextLine,i,this):e.paragraph.nextRenderedWidget instanceof we&&e.paragraph.nextRenderedWidget.childWidgets.length>0&&this.linkFieldTraversingForward(e.paragraph.nextRenderedWidget.childWidgets[0],i,this),!0},e.prototype.linkFieldTraversingBackwardSeparator=function(e,i,n){var r=e.children.length-1;e.children.indexOf(n)>-1&&(r=e.children.indexOf(n)-1);for(var o=r;o>=0;o--){var s=e.children[o];if(s instanceof Ie&&s instanceof Ie&&0===s.fieldType)return t.isNullOrUndefined(s.fieldSeparator)&&(i.fieldBegin=s),!t.isNullOrUndefined(i.fieldBegin)}if(e.previousLine)this.linkFieldTraversingBackwardSeparator(e.previousLine,i,this);else{if(!(e.paragraph.previousRenderedWidget instanceof we&&e.paragraph.previousRenderedWidget.childWidgets.length>0))return!0;e=e.paragraph.previousRenderedWidget.childWidgets[e.paragraph.previousRenderedWidget.childWidgets.length-1],this.linkFieldTraversingBackwardSeparator(e,i,this)}return!0},Object.defineProperty(e.prototype,"length",{get:function(){return this.getLength()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indexInOwner",{get:function(){return this.line instanceof Te&&this.line.children?this.line.children.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousElement",{get:function(){var e=this.indexInOwner;if(e>0&&e<this.line.children.length)return this.line.children[e-1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextElement",{get:function(){var e=this.indexInOwner;if(e>-1&&e<this.line.children.length-1)return this.line.children[e+1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextNode",{get:function(){var e=this.line.children.indexOf(this),t=this.line.paragraph.childWidgets.indexOf(this.line);return e<this.line.children.length-1?this.line.children[e+1]:t<this.line.paragraph.childWidgets.length-1?this.line.paragraph.childWidgets[t+1].children[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextValidNodeForTracking",{get:function(){for(var e=this;!t.isNullOrUndefined(e)&&(e instanceof Ae||e instanceof vt||e instanceof et||e instanceof $e||e instanceof Me);)e=e.nextNode;return e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousValidNodeForTracking",{get:function(){for(var e=this;!t.isNullOrUndefined(e)&&(e instanceof Ae||e instanceof vt||e instanceof et||e instanceof $e||e instanceof Me);)e=e.previousNode;return e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousNode",{get:function(){var e=this.line.children.indexOf(this),t=this.line.paragraph.childWidgets.indexOf(this.line);if(e>0)return this.line.children[e-1];if(t>0){var i=this.line.paragraph.childWidgets[t-1];return i.children[i.children.length-1]}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraph",{get:function(){if(this.line)return this.line.paragraph},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.line)&&this.line.children&&this.line.children.indexOf(this)>-1){var e=this.line.children.indexOf(this);this.line.children.splice(e,1)}this.line=void 0,this.characterFormat&&this.characterFormat.destroy(),this.characterFormat=void 0,this.margin&&this.margin.destroy(),this.margin=void 0,this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0},e.objectCharacter=String.fromCharCode(65532),e}(),Ie=function(e){function i(t){var i=e.call(this)||this;return i.fieldType=0,i.fieldCodeType="",i.hasFieldEnd=!1,i.fieldBeginInternal=void 0,i.fieldSeparatorInternal=void 0,i.fieldEndInternal=void 0,i.fieldType=t,i}return he(i,e),Object.defineProperty(i.prototype,"fieldBegin",{get:function(){return this.fieldBeginInternal},set:function(e){this.fieldBeginInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fieldSeparator",{get:function(){return this.fieldSeparatorInternal},set:function(e){this.fieldSeparatorInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fieldEnd",{get:function(){return this.fieldEndInternal},set:function(e){this.fieldEndInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"resultText",{get:function(){if(!t.isNullOrUndefined(this.formFieldData)&&0===this.fieldType&&!t.isNullOrUndefined(this.fieldSeparator)&&!t.isNullOrUndefined(this.fieldEnd)){var e=this.fieldSeparator.nextElement,i="";do{if(e instanceof Oe&&(i+=e.text),(e=e.nextNode)===this.fieldEnd)break}while(e);return i}},enumerable:!0,configurable:!0}),i.prototype.getLength=function(){return 1},i.prototype.clone=function(){var e=new i(this.fieldType);return 0!==this.fieldType||t.isNullOrUndefined(this.formFieldData)||(e.formFieldData=this.formFieldData.clone()),e.characterFormat.copyFormat(this.characterFormat),this.margin&&(e.margin=this.margin.clone()),e.width=this.width,e.height=this.height,this.revisions.length>0?e.removedIds=W.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice(),e.fieldCodeType=this.fieldCodeType,e},i.prototype.destroy=function(){this.fieldType=void 0,this.hasFieldEnd=void 0,this.fieldBeginInternal=void 0,this.fieldEndInternal=void 0,this.fieldSeparatorInternal=void 0,e.prototype.destroy.call(this)},i}(Se),Ne=function(){function e(){this.name="",this.enabled=!0,this.helpText="",this.statusText=""}return e}(),Ee=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="Text",t.maxLength=0,t.defaultValue="",t.format="",t}return he(i,e),i.prototype.clone=function(){var e=new i;return e.type=this.type,e.name=this.name,e.enabled=this.enabled,e.helpText=this.helpText,e.statusText=this.statusText,e.maxLength=this.maxLength,e.defaultValue=this.defaultValue,e.format=this.format,e},i.prototype.getFormFieldInfo=function(){return{defaultValue:this.defaultValue,enabled:this.enabled,format:this.format,helpText:this.helpText,maxLength:this.maxLength,type:this.type}},i.prototype.copyFieldInfo=function(e){t.isNullOrUndefined(e.defaultValue)||(this.defaultValue=e.defaultValue),t.isNullOrUndefined(e.enabled)||(this.enabled=e.enabled),t.isNullOrUndefined(e.format)||(this.format=e.format),t.isNullOrUndefined(e.helpText)||(this.helpText=e.helpText),t.isNullOrUndefined(e.maxLength)||(this.maxLength=e.maxLength),t.isNullOrUndefined(e.type)||(this.type=e.type)},i}(Ne),He=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.sizeType="Auto",t.size=11,t.defaultValue=!1,t.checked=!1,t}return he(i,e),i.prototype.clone=function(){var e=new i;return e.name=this.name,e.enabled=this.enabled,e.helpText=this.helpText,e.statusText=this.statusText,e.sizeType=this.sizeType,e.size=this.size,e.defaultValue=this.defaultValue,e.checked=this.checked,e},i.prototype.getFormFieldInfo=function(){return{defaultValue:this.defaultValue,enabled:this.enabled,helpText:this.helpText,size:this.size,sizeType:this.sizeType}},i.prototype.copyFieldInfo=function(e){t.isNullOrUndefined(e.defaultValue)||(this.defaultValue=e.defaultValue,this.checked=e.defaultValue),t.isNullOrUndefined(e.enabled)||(this.enabled=e.enabled),t.isNullOrUndefined(e.size)||(this.size=e.size),t.isNullOrUndefined(e.helpText)||(this.helpText=e.helpText),t.isNullOrUndefined(e.sizeType)||(this.sizeType=e.sizeType)},i}(Ne),We=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.dropdownItems=[],t.selectedIndex=0,t}return he(i,e),i.prototype.clone=function(){var e=new i;return e.name=this.name,e.enabled=this.enabled,e.helpText=this.helpText,e.statusText=this.statusText,e.dropdownItems=this.dropdownItems.slice(),e.selectedIndex=this.selectedIndex,e},i.prototype.getFormFieldInfo=function(){return{dropdownItems:this.dropdownItems.slice(),enabled:this.enabled,helpText:this.helpText}},i.prototype.copyFieldInfo=function(e){t.isNullOrUndefined(e.dropdownItems)||(this.dropdownItems=e.dropdownItems),t.isNullOrUndefined(e.enabled)||(this.enabled=e.enabled),t.isNullOrUndefined(e.helpText)||(this.helpText=e.helpText)},i}(Ne),Oe=function(e){function t(){var t=e.call(this)||this;return t.baselineOffset=0,t.text="",t.trimEndWidth=0,t.ignoreOnceItems=[],t.istextCombined=!1,t.errorCollection=[],t}return he(t,e),t.prototype.getLength=function(){return this.text?this.text.length:0},t.prototype.clone=function(){var e=new t;return e.characterFormat.copyFormat(this.characterFormat),e.text=this.text,this.margin&&(e.margin=this.margin.clone()),e.baselineOffset=this.baselineOffset,this.revisions.length>0?e.removedIds=W.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice(),e.width=this.width,e.height=this.height,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},t.prototype.destroy=function(){this.text=void 0,e.prototype.destroy.call(this)},t}(Se),ke=function(){function e(){this.separator=[],this.continuationNotice=[],this.continuationSeparator=[]}return e.prototype.clear=function(){this.separator=[],this.continuationSeparator=[],this.continuationNotice=[]},e.prototype.destroy=function(){this.separator=[],this.continuationSeparator=[],this.continuationNotice=[]},e}(),Le=function(e){function t(){var t=e.call(this)||this;return t.isLayout=!1,t.blocks=[],t}return he(t,e),t.prototype.clone=function(){var e=new t;return e.text=this.text,e.characterFormat.copyFormat(this.characterFormat),e.height=this.height,e.footnoteType=this.footnoteType,e.width=this.width,e.symbolCode=this.symbolCode,e.blocks=this.blocks,this.margin&&(e.margin=this.margin.clone()),e},t.prototype.getLength=function(){return 1},t.prototype.destroy=function(){this.symbolCode="",this.symbolFontName="",this.customMarker=""},t}(Oe),Re=function(e){function t(){var t=e.call(this)||this;return t.startIn=void 0,t.endIn=void 0,t}return he(t,e),Object.defineProperty(t.prototype,"start",{get:function(){return this.startIn},set:function(e){this.startIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.endIn},set:function(e){this.endIn=e},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.start=void 0,this.end=void 0},t}(Oe),Be=function(e){function t(){var t=e.call(this)||this;return t.fieldText="",t}return he(t,e),Object.defineProperty(t.prototype,"text",{get:function(){return this.fieldText},set:function(e){this.fieldText=e},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.characterFormat.copyFormat(this.characterFormat),e.fieldBegin=this.fieldBegin,e.text=this.text,this.margin&&(e.margin=this.margin.clone()),this.revisions.length>0?e.removedIds=W.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice(),e.width=this.width,e.height=this.height,e},t}(Oe),De=function(e){function t(){var t=e.call(this)||this;return t.tabText="",t.tabLeader="None",t}return he(t,e),t.prototype.destroy=function(){this.tabText=void 0,this.tabLeader=void 0},t.prototype.clone=function(){var e=new t;return e.characterFormat.copyFormat(this.characterFormat),e.tabText=this.tabText,e.tabLeader=this.tabLeader,e.text=this.text,this.margin&&(e.margin=this.margin.clone()),e.width=this.width,e.height=this.height,this.revisions.length>0?e.removedIds=W.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice(),e},t}(Oe),Ae=function(e){function t(t){var i=e.call(this)||this;return i.bookmarkTypeIn=0,i.refereneceIn=void 0,i.nameIn="",i.bookmarkTypeIn=t,i}return he(t,e),Object.defineProperty(t.prototype,"bookmarkType",{get:function(){return this.bookmarkTypeIn},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.nameIn},set:function(e){this.nameIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reference",{get:function(){return this.refereneceIn},set:function(e){this.refereneceIn=e},enumerable:!0,configurable:!0}),t.prototype.getLength=function(){return 1},t.prototype.destroy=function(){this.name=void 0,this.reference=void 0,this.bookmarkTypeIn=void 0},t.prototype.clone=function(){var e=new t(this.bookmarkType);return e.name=this.name,e.reference=this.reference,this.margin&&(e.margin=this.margin.clone()),e.width=this.width,e.height=this.height,this.contentControlProperties&&(e.contentControlProperties=this.contentControlProperties),e},t}(Se),Me=function(e){function t(t){var i=e.call(this)||this;return i.contentControlWidgetType=t,i.contentControlProperties=new Ue(t),i}return he(t,e),t.prototype.getLength=function(){return 1},t.prototype.clone=function(){var e=new t(this.contentControlWidgetType);return e.characterFormat.copyFormat(this.characterFormat),e.contentControlProperties=this.contentControlProperties,e.contentControlWidgetType=this.contentControlWidgetType,this.margin&&(e.margin=this.margin.clone()),this.revisions.length>0?e.removedIds=W.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice(),e.type=this.type,e.width=this.width,e.height=this.height,e.reference=this.reference,e},t.prototype.destroy=function(){this.contentControlProperties=void 0,this.contentControlWidgetType=void 0,e.prototype.destroy.call(this)},t}(Se),Ue=function(){function e(e){this.contentControlListItems=[],this.contentControlWidgetType=e,this.characterFormat=new k}return e.prototype.destroy=function(){this.lockContentControl=void 0,this.lockContents=void 0,this.tag=void 0,this.color=void 0,this.title=void 0,this.appearance=void 0,this.type=void 0,this.hasPlaceHolderText=void 0,this.multiline=void 0,this.isTemporary=void 0,this.isChecked=void 0,this.dateCalendarType=void 0,this.dateStorageFormat=void 0,this.dateDisplayLocale=void 0,this.dateDisplayFormat=void 0},e.prototype.clone=function(){var t=new e(this.contentControlWidgetType);if(t.lockContentControl=this.lockContentControl,t.lockContents=this.lockContents,t.tag=this.tag,t.color=this.color,t.title=this.title,t.appearance=this.appearance,t.type=this.type,t.hasPlaceHolderText=this.hasPlaceHolderText,t.multiline=this.multiline,t.isTemporary=this.isTemporary,t.isChecked=this.isChecked,t.dateCalendarType=this.dateCalendarType,t.dateStorageFormat=this.dateStorageFormat,t.dateDisplayLocale=this.dateDisplayLocale,t.dateDisplayFormat=this.dateDisplayFormat,this.contentControlListItems.length>0)for(var i=0;i<this.contentControlListItems.length;i++)t.contentControlListItems.push(this.contentControlListItems[i].clone());return this.checkedState&&(t.checkedState=this.checkedState.clone()),this.uncheckedState&&(t.uncheckedState=this.uncheckedState.clone()),this.xmlMapping&&(t.xmlMapping=this.xmlMapping.clone()),t},e}(),ze=function(){function e(){}return e.prototype.destroy=function(){this.displayText=void 0,this.value=void 0},e.prototype.clone=function(){var t=new e;return t.displayText=this.displayText,t.value=this.value,t},e}(),Ve=function(){function e(){}return e.prototype.destroy=function(){this.font=void 0,this.value=void 0},e.prototype.clone=function(){var t=new e;return t.font=this.font,t.value=this.value,t},e}(),_e=function(){function e(){}return e.prototype.destroy=function(){this.isMapped=void 0,this.isWordMl=void 0,this.prefixMapping=void 0,this.xPath=void 0,this.storeItemId=void 0,this.customXmlPart=void 0},e.prototype.clone=function(){var t=new e;return t.isMapped=this.isMapped,t.isWordMl=this.isWordMl,t.prefixMapping=this.prefixMapping,t.xPath=this.xPath,t.storeItemId=this.storeItemId,this.customXmlPart&&(t.customXmlPart=this.customXmlPart.clone()),t},e}(),je=function(){function e(){}return e.prototype.destroy=function(){this.id=void 0,this.xml=void 0},e.prototype.clone=function(){var t=new e;return t.id=this.id,t.xml=this.xml,t},e}(),qe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="",t.alternativeText="",t.title="",t}return he(t,e),t.prototype.getLength=function(){return 1},t.prototype.clone=function(){return new Ke},t}(Se),Ge=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.verticalPosition=0,t.horizontalPosition=0,t.textWrappingStyle="Inline",t.distanceBottom=0,t.distanceLeft=0,t.distanceRight=0,t.distanceTop=0,t}return he(t,e),t}(qe),Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return he(t,e),t.prototype.clone=function(){var e=new t;return e.characterFormat.copyFormat(this.characterFormat),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e.shapeId=this.shapeId,e.name=this.name,e.alternativeText=this.alternativeText,e.title=this.title,e.widthScale=this.widthScale,e.heightScale=this.heightScale,e.visible=this.visible,e.verticalPosition=this.verticalPosition,e.verticalAlignment=this.verticalAlignment,e.verticalOrigin=this.verticalOrigin,e.verticalRelativePercent=this.verticalRelativePercent,e.horizontalPosition=this.horizontalPosition,e.horizontalAlignment=this.horizontalAlignment,e.horizontalOrigin=this.horizontalOrigin,e.horizontalRelativePercent=this.horizontalRelativePercent,e.zOrderPosition=this.zOrderPosition,e.allowOverlap=this.allowOverlap,e.textWrappingStyle=this.textWrappingStyle,e.textWrappingType=this.textWrappingType,e.distanceBottom=this.distanceBottom,e.distanceLeft=this.distanceLeft,e.distanceRight=this.distanceRight,e.distanceTop=this.distanceTop,e.layoutInCell=this.layoutInCell,e.lockAnchor=this.lockAnchor,e.autoShapeType=this.autoShapeType,this.lineFormat&&(e.lineFormat=this.lineFormat.clone()),this.fillFormat&&(e.fillFormat=this.fillFormat.clone()),this.textFrame&&(e.textFrame=this.textFrame.clone(),e.textFrame.containerShape=e),this.margin&&(e.margin=this.margin.clone()),e},t}(Ge),Xe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.marginLeft=0,t.marginRight=0,t.marginTop=0,t.marginBottom=0,t}return he(t,e),t.prototype.equals=function(){return!1},t.prototype.destroyInternal=function(){},t.prototype.getHierarchicalIndex=function(e){var t=this.containerShape.line,i=t.getOffset(this.containerShape,0).toString();return t.getHierarchicalIndex(i)},t.prototype.getTableCellWidget=function(){},t.prototype.clone=function(){var e=new t;e.textVerticalAlignment=this.textVerticalAlignment,e.marginBottom=this.marginBottom,e.marginLeft=this.marginLeft,e.marginRight=this.marginRight,e.marginTop=this.marginTop;for(var i=0;i<this.childWidgets.length;i++){var n=this.childWidgets[i].clone();e.childWidgets.push(n),n.index=i,n.containerWidget=e}return e},t}(ue),Ye=function(){function e(){}return e.prototype.clone=function(){var t=new e;return t.lineFormatType=this.lineFormatType,t.color=this.color,t.weight=this.weight,t.dashStyle=this.dashStyle,t.line=this.line,t},e}(),Je=function(){function e(){}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.fill=this.fill,t},e}(),Ze=function(e){function i(t){var i=e.call(this)||this;return i.imageStr="",i.imgElement=void 0,i.isInlineImageIn=!0,i.isCrop=!1,i.left=0,i.top=0,i.right=0,i.bottom=0,i.isMetaFile=!1,i.isCompressed=!1,i.isInlineImageIn=t,i}return he(i,e),Object.defineProperty(i.prototype,"isInlineImage",{get:function(){return this.isInlineImageIn},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"element",{get:function(){return t.isNullOrUndefined(this.imgElement)&&(this.imgElement=document.createElement("img")),this.imgElement},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"length",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"imageString",{get:function(){return this.imageStr},set:function(e){this.imageStr=e,t.isNullOrUndefined(e)||(this.element.src=this.imageStr)},enumerable:!0,configurable:!0}),i.prototype.getLength=function(){return 1},i.prototype.clone=function(){var e=new i(this.isInlineImage);return e.characterFormat.copyFormat(this.characterFormat),e.imageString=this.imageString,e.isMetaFile=this.isMetaFile,e.isCompressed=this.isCompressed,e.metaFileImageString=this.metaFileImageString,e.width=this.width,e.height=this.height,this.isCrop&&(e.top=this.top,e.left=this.left,e.bottom=this.bottom,e.right=this.right,e.isCrop=this.isCrop,e.cropHeightScale=this.cropHeightScale,e.cropWidthScale=this.cropWidthScale),this.margin&&(e.margin=this.margin.clone()),this.revisions.length>0?e.removedIds=W.cloneRevisions(this.revisions):e.removedIds=this.removedIds.slice(),e.name=this.name,e.alternativeText=this.alternativeText,e.title=this.title,e.visible=this.visible,e.widthScale=this.widthScale,e.heightScale=this.heightScale,e.verticalPosition=this.verticalPosition,e.verticalOrigin=this.verticalOrigin,e.verticalAlignment=this.verticalAlignment,e.horizontalPosition=this.horizontalPosition,e.horizontalOrigin=this.horizontalOrigin,e.horizontalAlignment=this.horizontalAlignment,e.allowOverlap=this.allowOverlap,e.textWrappingStyle=this.textWrappingStyle,e.textWrappingType=this.textWrappingType,e.layoutInCell=this.layoutInCell,e.zOrderPosition=this.zOrderPosition,e},i.prototype.destroy=function(){this.imgElement=void 0,this.imageString=void 0,this.isInlineImageIn=void 0,e.prototype.destroy.call(this)},i}(Ge),Qe=function(e){function t(t,i){var n=e.call(this)||this;return n.baselineOffset=0,n.trimEndWidth=0,n.isFollowCharacter=!1,n.listLevel=t,n.isFollowCharacter=i,n}return he(t,e),t.prototype.getLength=function(){return this.text?this.text.length:0},t.prototype.clone=function(){var e=new t(this.listLevel,this.isFollowCharacter);return e.text=this.text,e.baselineOffset=this.baselineOffset,this.margin&&(e.margin=this.margin.clone()),e.width=this.width,e.height=this.height,e},t.prototype.destroy=function(){this.text=void 0,e.prototype.destroy.call(this)},t}(Se),$e=function(e){function t(){var t=e.call(this)||this;return t.editRangeStart=void 0,t.editRangeId=-1,t}return he(t,e),t.prototype.getLength=function(){return 1},t.prototype.destroy=function(){this.editRangeStart=void 0},t.prototype.clone=function(){var e=new t;return e.editRangeStart=this.editRangeStart,e.editRangeId=this.editRangeId,e},t}(Se),et=function(e){function i(){var t=e.call(this)||this;return t.columnFirst=-1,t.columnLast=-1,t.user="",t.group="",t.editRangeId=-1,t}return he(i,e),i.prototype.getLength=function(){return 1},i.prototype.renderLockMark=function(e,i){if(t.isNullOrUndefined(this.editRangeMark)){var n=e===this.user?"you":this.user;this.editRangeMark=document.createElement("div"),this.editRangeMark.style.display="none",this.editRangeMark.classList.add("e-de-lock-mark");var r=document.createElement("span");r.className="e-icons e-de-ctnr-lock",this.editRangeMark.appendChild(r),this.editRangeMark.title=i.getConstant("This region is locked by")+" "+n}this.line&&t.isNullOrUndefined(this.editRangeMark.parentElement)&&this.line.paragraph.bodyWidget.page.documentHelper.pageContainer.appendChild(this.editRangeMark)},i.prototype.removeEditRangeMark=function(){this.editRangeMark&&(this.editRangeMark.parentElement.removeChild(this.editRangeMark),this.editRangeMark=void 0)},i.prototype.destroy=function(){this.user=void 0,this.columnFirst=void 0,this.columnLast=void 0},i.prototype.clone=function(){var e=new i;return e.columnFirst=this.columnFirst,e.columnLast=this.columnLast,e.user=this.user,e.group=this.group,e.editRangeEnd=this.editRangeEnd,e.editRangeId=this.editRangeId,e},i}(Se),tt=function(e){function i(){var t=e.call(this)||this;return t.chartTitle="",t.chartType="",t.chartElement=void 0,t.chartCategory=[],t.chartSeries=[],t.chartArea=new it,t.chartPlotArea=new it,t.chartTitleArea=new ct,t.chartLegend=new ot,t.chartPrimaryCategoryAxis=new mt,t.chartPrimaryValueAxis=new mt,t.chartDataTable=new ft,t}return he(i,e),i.prototype.getLength=function(){return 1},Object.defineProperty(i.prototype,"title",{get:function(){return this.chartTitle},set:function(e){this.chartTitle=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){return this.chartType},set:function(e){this.chartType=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"chartGapWidth",{get:function(){return this.gapWidth},set:function(e){this.gapWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"chartOverlap",{get:function(){return this.overlap},set:function(e){this.overlap=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"targetElement",{get:function(){return t.isNullOrUndefined(this.div)&&(this.div=t.createElement("div")),this.div},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"officeChart",{get:function(){return this.officeChartInternal},set:function(e){e&&(this.officeChartInternal=e,this.officeChartInternal.chart.loaded=this.onChartLoaded.bind(this))},enumerable:!0,configurable:!0}),i.prototype.onChartLoaded=function(){var e=this;this.officeChart.convertChartToImage(this.officeChart.chart,this.width,this.height).then(function(t){e.imageString=t})},i.prototype.clone=function(){var e=new i;e.chartTitle=this.chartTitle,e.chartType=this.chartType,e.height=this.height,e.width=this.width,e.gapWidth=this.gapWidth,e.overlap=this.overlap;for(n=0;n<this.chartCategory.length;n++){var t=this.chartCategory[n].clone();e.chartCategory.push(t)}for(var n=0;n<this.chartSeries.length;n++){var r=this.chartSeries[n].clone();e.chartSeries.push(r)}return e.chartArea=this.chartArea.clone(),e.chartPlotArea=this.chartPlotArea.clone(),e.chartLegend=this.chartLegend.clone(),e.chartTitleArea=this.chartTitleArea.clone(),e.chartPrimaryCategoryAxis=this.chartPrimaryCategoryAxis.clone(),e.chartPrimaryValueAxis=this.chartPrimaryValueAxis.clone(),e.chartDataTable=this.chartDataTable.clone(),e},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.officeChartInternal&&(this.officeChartInternal.chart.loaded=void 0,this.officeChartInternal.destroy(),this.officeChartInternal=void 0),this.div&&(this.div=void 0),this.chartTitle=void 0,this.chartType=void 0,this.chartArea=void 0,this.chartPlotArea=void 0,this.chartCategory=[],this.chartSeries=[],this.chartTitleArea=void 0,this.chartLegend=void 0,this.chartPrimaryCategoryAxis=void 0,this.chartPrimaryValueAxis=void 0,this.chartDataTable=void 0,this.chartElement=void 0},i}(Ze),it=function(){function e(){}return Object.defineProperty(e.prototype,"chartForeColor",{get:function(){return this.foreColor},set:function(e){this.foreColor=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.foreColor=this.foreColor,t},e.prototype.destroy=function(){this.foreColor=void 0},e}(),nt=function(){function e(){this.categoryXName="",this.chartData=[]}return Object.defineProperty(e.prototype,"xName",{get:function(){return this.categoryXName},set:function(e){this.categoryXName=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;t.categoryXName=this.categoryXName;for(var i=0;i<this.chartData.length;i++){var n=this.chartData[i].clone();t.chartData.push(n)}return t},e.prototype.destroy=function(){this.categoryXName=void 0,this.chartData=[]},e}(),rt=function(){function e(){}return Object.defineProperty(e.prototype,"yAxisValue",{get:function(){return this.yValue},set:function(e){this.yValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"xAxisValue",{get:function(){return this.xValue},set:function(e){this.xValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bubbleSize",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.yValue=this.yValue,t.xValue=this.xValue,t.size=this.size,t},e.prototype.destroy=function(){this.xValue=void 0,this.yValue=void 0,this.size=void 0},e}(),ot=function(){function e(){this.chartTitleArea=new ct}return Object.defineProperty(e.prototype,"chartLegendPostion",{get:function(){return this.legendPostion},set:function(e){this.legendPostion=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.legendPostion=this.legendPostion,t.chartTitleArea=this.chartTitleArea.clone(),t},e.prototype.destroy=function(){this.legendPostion=void 0,this.chartTitleArea=void 0},e}(),st=function(){function e(){this.chartDataFormat=[],this.trendLines=[],this.errorBar=new at,this.dataLabels=new dt,this.seriesFormat=new lt}return Object.defineProperty(e.prototype,"seriesName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstSliceAngle",{get:function(){return this.sliceAngle},set:function(e){this.sliceAngle=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doughnutHoleSize",{get:function(){return this.holeSize},set:function(e){this.holeSize=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;t.name=this.name,t.sliceAngle=this.sliceAngle,t.holeSize=this.holeSize,t.errorBar=this.errorBar.clone(),t.dataLabels=this.dataLabels.clone(),t.seriesFormat=this.seriesFormat.clone();for(n=0;n<this.chartDataFormat.length;n++){var i=this.chartDataFormat[n].clone();t.chartDataFormat.push(i)}for(var n=0;n<this.trendLines.length;n++){var r=this.trendLines[n].clone();t.trendLines.push(r)}return t},e.prototype.destroy=function(){this.name=void 0,this.errorBar=void 0,this.trendLines=void 0,this.chartDataFormat=[]},e}(),at=function(){function e(){}return Object.defineProperty(e.prototype,"errorType",{get:function(){return this.type},set:function(e){this.type=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorDirection",{get:function(){return this.direction},set:function(e){this.direction=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorEndStyle",{get:function(){return this.endStyle},set:function(e){this.endStyle=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numberValue",{get:function(){return this.errorValue},set:function(e){this.errorValue=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.type=this.type,t.errorDirection=this.errorDirection,t.endStyle=this.endStyle,t.errorValue=this.errorValue,t},e.prototype.destroy=function(){this.type=void 0,this.errorDirection=void 0,this.endStyle=void 0},e}(),lt=function(){function e(){}return Object.defineProperty(e.prototype,"markerStyle",{get:function(){return this.style},set:function(e){this.style=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"markerColor",{get:function(){return this.color},set:function(e){this.color=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numberValue",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.style=this.style,t.color=this.color,t.size=this.size,t},e.prototype.destroy=function(){this.style=void 0,this.color=void 0,this.size=void 0},e}(),dt=function(){function e(){}return Object.defineProperty(e.prototype,"labelPosition",{get:function(){return this.position},set:function(e){this.position=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontColor",{get:function(){return this.color},set:function(e){this.color=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this.size},set:function(e){this.size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLegendKey",{get:function(){return this.isLegend},set:function(e){this.isLegend=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isBubbleSize",{get:function(){return this.isBubble},set:function(e){this.isBubble=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCategoryName",{get:function(){return this.isCategory},set:function(e){this.isCategory=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSeriesName",{get:function(){return this.isSeries},set:function(e){this.isSeries=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isValue",{get:function(){return this.isValueEnabled},set:function(e){this.isValueEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPercentage",{get:function(){return this.isPercentageEnabled},set:function(e){this.isPercentageEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLeaderLines",{get:function(){return this.showLeaderLines},set:function(e){this.showLeaderLines=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.position=this.position,t.name=this.name,t.color=this.color,t.size=this.size,t.isBubble=this.isBubble,t.isLegend=this.isLegend,t.isCategory=this.isCategory,t.isSeries=this.isSeries,t.isValueEnabled=this.isValueEnabled,t.isPercentageEnabled=this.isPercentageEnabled,t.showLeaderLines=this.showLeaderLines,t},e.prototype.destroy=function(){this.position=void 0},e}(),ht=function(){function e(){}return Object.defineProperty(e.prototype,"trendLineType",{get:function(){return this.type},set:function(e){this.type=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trendLineName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"interceptValue",{get:function(){return this.intercept},set:function(e){this.intercept=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"forwardValue",{get:function(){return this.forward},set:function(e){this.forward=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"backwardValue",{get:function(){return this.backward},set:function(e){this.backward=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisplayRSquared",{get:function(){return this.displayRSquared},set:function(e){this.displayRSquared=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisplayEquation",{get:function(){return this.displayEquation},set:function(e){this.displayEquation=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.type=this.type,t.name=this.name,t.forward=this.forward,t.backward=this.backward,t.intercept=this.intercept,t.displayEquation=this.displayEquation,t.displayRSquared=this.displayRSquared,t},e.prototype.destroy=function(){this.type=void 0,this.name=void 0,this.forward=void 0,this.backward=void 0},e}(),ct=function(){function e(){this.dataFormat=new pt,this.layout=new ut}return Object.defineProperty(e.prototype,"chartfontName",{get:function(){return this.fontName},set:function(e){this.fontName=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"chartFontSize",{get:function(){return this.fontSize},set:function(e){this.fontSize=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.fontName=this.fontName,t.fontSize=this.fontSize,t.dataFormat=this.dataFormat.clone(),t.layout=this.layout.clone(),t},e.prototype.destroy=function(){this.fontName=void 0,this.fontSize=void 0,this.dataFormat=void 0,this.layout=void 0},e}(),pt=function(){function e(){this.fill=new gt,this.line=new gt}return e.prototype.clone=function(){var t=new e;return t.fill=this.fill.clone(),t.line=this.line.clone(),t},e.prototype.destroy=function(){this.fill=void 0,this.line=void 0},e}(),gt=function(){function e(){}return Object.defineProperty(e.prototype,"color",{get:function(){return this.fillColor},set:function(e){this.fillColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rgb",{get:function(){return this.fillRGB},set:function(e){this.fillRGB=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.fillColor=this.fillColor,t.fillRGB=this.fillRGB,t},e.prototype.destroy=function(){this.fillColor=void 0,this.fillRGB=void 0},e}(),ut=function(){function e(){}return Object.defineProperty(e.prototype,"chartLayoutLeft",{get:function(){return this.layoutX},set:function(e){this.layoutX=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"chartLayoutTop",{get:function(){return this.layoutY},set:function(e){this.layoutY=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.layoutX=this.layoutX,t.layoutY=this.layoutY,t},e.prototype.destroy=function(){this.layoutX=void 0,this.layoutY=void 0},e}(),mt=function(){function e(){this.chartTitleArea=new ct}return Object.defineProperty(e.prototype,"majorTick",{get:function(){return this.majorTickMark},set:function(e){this.majorTickMark=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minorTick",{get:function(){return this.minorTickMark},set:function(e){this.minorTickMark=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tickPosition",{get:function(){return this.tickLabelPostion},set:function(e){this.tickLabelPostion=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minorGridLines",{get:function(){return this.hasMinorGridLines},set:function(e){this.hasMinorGridLines=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"majorGridLines",{get:function(){return this.hasMajorGridLines},set:function(e){this.hasMajorGridLines=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"interval",{get:function(){return this.majorUnit},set:function(e){this.majorUnit=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this.maximumValue},set:function(e){this.maximumValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this.minimumValue},set:function(e){this.minimumValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"categoryAxisTitle",{get:function(){return this.title},set:function(e){this.title=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"categoryAxisType",{get:function(){return this.categoryType},set:function(e){this.categoryType=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"categoryNumberFormat",{get:function(){return this.numberFormat},set:function(e){this.numberFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"axisFontSize",{get:function(){return this.fontSize},set:function(e){this.fontSize=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"axisFontName",{get:function(){return this.fontName},set:function(e){this.fontName=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.title=this.title,t.categoryType=this.categoryType,t.numberFormat=this.numberFormat,t.fontSize=this.fontSize,t.fontName=this.fontName,t.hasMajorGridLines=this.hasMajorGridLines,t.hasMinorGridLines=this.hasMinorGridLines,t.minimumValue=this.minimumValue,t.maximumValue=this.maximumValue,t.majorUnit=this.majorUnit,t.majorTickMark=this.majorTickMark,t.minorTickMark=this.minorTickMark,t.tickLabelPostion=this.tickLabelPostion,t.chartTitleArea=this.chartTitleArea.clone(),t},e.prototype.destroy=function(){this.title=void 0,this.categoryType=void 0,this.numberFormat=void 0,this.chartTitleArea=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.fontSize=void 0,this.fontName=void 0,this.majorUnit=void 0,this.majorTickMark=void 0,this.minorTickMark=void 0,this.tickLabelPostion=void 0},e}(),ft=function(){function e(){}return Object.defineProperty(e.prototype,"showSeriesKeys",{get:function(){return this.isSeriesKeys},set:function(e){this.isSeriesKeys=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasHorzBorder",{get:function(){return this.isHorzBorder},set:function(e){this.isHorzBorder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasVertBorder",{get:function(){return this.isVertBorder},set:function(e){this.isVertBorder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasBorders",{get:function(){return this.isBorders},set:function(e){this.isBorders=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.isSeriesKeys=this.isSeriesKeys,t.isHorzBorder=this.isHorzBorder,t.isVertBorder=this.isVertBorder,t.isBorders=this.isBorders,t},e.prototype.destroy=function(){this.isSeriesKeys=void 0,this.isHorzBorder=void 0,this.isVertBorder=void 0,this.isBorders=void 0},e}(),vt=function(e){function i(t){var i=e.call(this)||this;return i.commentType=0,i.commentId="",i.commentType=t,i}return he(i,e),Object.defineProperty(i.prototype,"comment",{get:function(){return this.commentInternal},set:function(e){this.commentInternal=e},enumerable:!0,configurable:!0}),i.prototype.getLength=function(){return 1},i.prototype.clone=function(){var e=new i(this.commentType);return e.commentId=this.commentId,e.commentType=this.commentType,e},i.prototype.renderCommentMark=function(){if(0===this.commentType&&t.isNullOrUndefined(this.commentMark)){this.commentMark=document.createElement("div"),this.commentMark.style.display="none",this.commentMark.classList.add("e-de-cmt-mark");var e=document.createElement("span");e.classList.add("e-icons"),e.classList.add("e-de-cmt-mark-icon"),this.commentMark.appendChild(e)}this.line&&t.isNullOrUndefined(this.commentMark.parentElement)&&(this.line.paragraph.bodyWidget.page.documentHelper.pageContainer.appendChild(this.commentMark),this.commentMark.addEventListener("click",this.selectComment.bind(this)))},i.prototype.selectComment=function(){var e=this.line.paragraph.bodyWidget.page.documentHelper;e.owner&&(e.owner.commentReviewPane.commentPane.isEditMode?e.owner.showComments=!0:e.selectComment(this.comment))},i.prototype.removeCommentMark=function(){this.commentMark&&this.commentMark.parentElement&&(this.commentMark.removeEventListener("click",this.selectComment.bind(this)),this.commentMark.parentElement.removeChild(this.commentMark))},i.prototype.destroy=function(){this.commentMark&&this.removeCommentMark()},i}(Se),yt=function(e){function t(t){var i=e.call(this,0)||this;return i.authorIn="",i.initialIn="",i.done=!1,i.textIn="",i.isReply=!1,i.ownerComment=void 0,i.createdDate=t,i.replyComments=[],i}return he(t,e),Object.defineProperty(t.prototype,"commentStart",{get:function(){return this.commentStartIn},set:function(e){this.commentStartIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"commentEnd",{get:function(){return this.commentEndIn},set:function(e){this.commentEndIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"author",{get:function(){return this.authorIn},set:function(e){this.authorIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"initial",{get:function(){return this.initialIn},set:function(e){this.initialIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isResolved",{get:function(){return this.done},set:function(e){this.done=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"date",{get:function(){return this.createdDate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this.textIn},set:function(e){this.textIn=e},enumerable:!0,configurable:!0}),t.prototype.getLength=function(){return 1},t.prototype.clone=function(){var e=new t(this.date);return e.author=this.author,e.initial=this.initial,e.commentId=this.commentId,e.replyComments=this.replyComments,e.isResolved=this.isResolved,e.text=this.text,e},t.prototype.destroy=function(){this.ownerComment=void 0},t}(vt),bt=function(){function e(e){this.boundingRectangle=new ce(96,96,816,1056),this.repeatHeaderRowTableWidget=!1,this.bodyWidgets=[],this.headerWidget=void 0,this.footerWidget=void 0,this.footnoteWidget=void 0,this.endnoteWidget=void 0,this.currentPageNum=1,this.allowNextPageRendering=!0,this.documentHelper=e}return Object.defineProperty(e.prototype,"index",{get:function(){return this.documentHelper?this.documentHelper.pages.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousPage",{get:function(){var e=this.index;if(e>0)return this.documentHelper.pages[e-1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextPage",{get:function(){var e=this.index;if(e<this.documentHelper.pages.length-1)return this.documentHelper.pages[e+1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sectionIndex",{get:function(){return this.bodyWidgets.length>0?this.bodyWidgets[0].index:-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.headerWidget&&(this.viewer&&this.documentHelper.owner.editor&&(this.documentHelper.owner.editor.removeFieldInWidget(this.headerWidget),this.documentHelper.owner.editor.removeFieldInWidget(this.headerWidget,!1,!0)),this.headerWidget.destroy()),this.headerWidget=void 0,this.footerWidget&&(this.viewer&&this.documentHelper.owner.editor&&(this.documentHelper.owner.editor.removeFieldInWidget(this.footerWidget),this.documentHelper.owner.editor.removeFieldInWidget(this.footerWidget,!1,!0)),this.footerWidget.destroy()),this.footerWidget=void 0,this.bodyWidgets=[],this.bodyWidgets=void 0,t.isNullOrUndefined(this.documentHelper)||t.isNullOrUndefined(this.documentHelper.pages)||this.documentHelper.removePage(this),this.documentHelper=void 0},e}(),wt=function(){function e(){this.tableColumns=[],this.tableWidth=0}return Object.defineProperty(e.prototype,"columns",{get:function(){return this.tableColumns},enumerable:!0,configurable:!0}),e.prototype.resetColumns=function(){for(var e=0;e<this.tableColumns.length;e++)this.tableColumns[e].destroy();this.tableColumns=[]},e.prototype.getPreviousSpannedCellWidth=function(e,t){for(var i=0,n=e;n<t;n++)i+=this.tableColumns[n].preferredWidth;return i},e.prototype.addColumns=function(e,t,i,n,r){for(var o=this.columns.length;o<t;o++)this.columns.push(new Ct);for(var s=0,a=e;a<t;a++)s+=this.columns[a].preferredWidth;!(t-e>1)&&s<i&&(this.columns[t-1].preferredWidth+=i-s),n.minimumWordWidth>this.columns[t-1].minimumWordWidth&&(this.columns[t-1].minimumWordWidth=n.minimumWordWidth),n.maximumWordWidth>this.columns[t-1].maximumWordWidth&&(this.columns[t-1].maximumWordWidth=n.maximumWordWidth),n.minimumWidth>this.columns[t-1].minimumWidth&&(this.columns[t-1].minimumWidth=n.minimumWidth),r>this.columns[t-1].endOffset&&(this.columns[t-1].endOffset=r)},e.prototype.getTotalWidth=function(e){for(var t=0,i=0;i<this.columns.length;i++){var n=this.columns[i];t+=0===e?n.preferredWidth:1===e?n.minimumWordWidth:2===e?n.maximumWordWidth:n.minimumWidth}return t},e.prototype.isFitColumns=function(e,t,i){var n=this.getTotalWidth(0);if(this.tableWidth=i&&t>n?n:t,n!==this.tableWidth){var r=this.tableWidth/n;r=isNaN(r)||r===1/0?1:r;for(var o=0;o<this.columns.length;o++){var s=this.columns[o];if(r*s.preferredWidth<s.minWidth)return!1}return!0}return!0},e.prototype.autoFitColumn=function(e,t,i,n){for(var r=0,o=0,s=0,a=0;a<this.columns.length;a++){0===(f=this.columns[a]).minimumWordWidth&&0===f.maximumWordWidth&&0===f.minWidth&&(f.minimumWordWidth=f.preferredWidth,f.maximumWordWidth=f.preferredWidth,f.minWidth=f.preferredWidth),r+=f.preferredWidth>f.maximumWordWidth?f.preferredWidth:f.maximumWordWidth,o+=f.preferredWidth>f.minimumWordWidth?f.preferredWidth:f.minimumWordWidth;var l=0===f.preferredWidth?f.minimumWordWidth:f.preferredWidth>f.minimumWordWidth?f.preferredWidth:f.minimumWordWidth;s+=(d=f.maximumWordWidth-l)>0?d:0}if(r<=t){for(a=0;a<this.columns.length;a++)(f=this.columns[a]).preferredWidth<f.maximumWordWidth&&(f.preferredWidth=n?f.minimumWidth+f.minimumWordWidth:f.maximumWordWidth);i||this.fitColumns(e,t,i)}else{if(!i)return void this.fitColumns(e,t,i);if(o<=t||o<=e){m=e>t?e:t;m-=o;for(a=0;a<this.columns.length;a++)if(0===(f=this.columns[a]).preferredWidth)f.preferredWidth=f.minimumWordWidth;else if(f.preferredWidth<f.minimumWordWidth&&(f.preferredWidth=f.minimumWordWidth),!n){var d=f.maximumWordWidth-f.preferredWidth,h=m*((d=d>0?d:0)/s);f.preferredWidth+=isNaN(h)?0:h}}else{var c=this.getTotalWidth(1),p=this.getTotalWidth(3),g=this.getTotalWidth(0);if(p>2112)for(var u=2112/this.columns.length,a=0;a<this.columns.length;a++)this.columns[a].preferredWidth=u;else{var m=0;if(p<e){m=e-p;for(a=0;a<this.columns.length;a++){h=m*(f=this.columns[a]).minimumWordWidth/c;h=isNaN(h)?0:h,f.preferredWidth<=f.minimumWidth||(f.preferredWidth=f.minimumWidth+h)}}else if(g>e)for(var h=e/g,a=0;a<this.columns.length;a++){var f=this.columns[a];f.preferredWidth=f.preferredWidth*h}}}}this.tableWidth=this.getTotalWidth(0)},e.prototype.fitColumns=function(e,i,n,r){t.isNullOrUndefined(r)&&(r=0);var o=this.getTotalWidth(0);if(n&&(o-=r),this.tableWidth=n?o:i,o!==this.tableWidth){var s=this.tableWidth/o;s=isNaN(s)||s===1/0?1:s;for(var a=0;a<this.columns.length;a++){var l=this.columns[a];l.preferredWidth=s*l.preferredWidth}}},e.prototype.getCellWidth=function(e,t,i){for(var n=0,r=0;r<t;r++)n+=this.tableColumns[r+e].preferredWidth;return n},e.prototype.validateColumnWidths=function(){for(var e=0;e<this.columns.length;e++)0===e?this.columns[e].preferredWidth!==this.columns[e].endOffset&&(this.columns[e].preferredWidth=this.columns[e].endOffset):this.columns[e-1].endOffset+this.columns[e].preferredWidth<this.columns[e].endOffset&&(this.columns[e].preferredWidth=this.columns[e].endOffset-this.columns[e-1].endOffset)},e.prototype.clone=function(){var t=new e;t.tableWidth=this.tableWidth;for(var i=0;i<this.columns.length;i++)t.columns.push(this.columns[i].clone());return t},e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.tableColumns))for(var e=0;e<this.tableColumns.length;e++)this.tableColumns[e].destroy();this.tableColumns=[],this.tableColumns=void 0,this.tableWidth=void 0},e}(),Ct=function(){function e(){this.preferredWidth=0,this.minWidth=0,this.maxWidth=0,this.endOffset=0,this.minimumWordWidth=0,this.maximumWordWidth=0,this.minimumWidth=0}return e.prototype.clone=function(){var t=new e;return t.preferredWidth=this.preferredWidth,t.minWidth=this.minWidth,t.maxWidth=this.maxWidth,t},e.prototype.destroy=function(){this.preferredWidth=void 0,this.minWidth=void 0,this.maxWidth=void 0},e}(),xt=function(){function e(){this.minimumWordWidth=0,this.maximumWordWidth=0,this.minimumWidth=0,this.hasMinimumWidth=!1,this.hasMinimumWordWidth=!1,this.hasMaximumWordWidth=!1}return e}(),Ft=function(){function e(e){var i=this;this.contextMenuInstance=void 0,this.menuItems=[],this.customMenuItems=[],this.ids=[],this.spellContextItems=[],this.customItems=[],this.onContextMenuInternal=function(e){MouseEvent;if(i.documentHelper.owner.isSpellCheck&&i.spellChecker.allowSpellCheckAndSuggestion){e.preventDefault(),i.currentContextInfo=i.spellChecker.findCurretText();var n,r,o=i.spellChecker.manageSpecialCharacters(i.currentContextInfo.text,void 0,!0);!t.isNullOrUndefined(o)&&i.spellChecker.errorWordCollection.containsKey(o)?(i.spellChecker.currentContextInfo=i.currentContextInfo,i.spellChecker.errorSuggestions.containsKey(o)?(r=i.spellChecker.errorSuggestions.get(o).slice(),n=i.spellChecker.handleSuggestions(r),i.processSuggestions(r,n,e)):i.spellChecker.enableOptimizedSpellCheck?i.spellChecker.callSpellChecker(i.spellChecker.languageID,o,!1,!0,!1,!1).then(function(s){var a=JSON.parse(s);r=a.Suggestions,t.isNullOrUndefined(r)||(i.spellChecker.errorSuggestions.add(o,r.slice()),n=i.spellChecker.handleSuggestions(r)),i.processSuggestions(r,n,e)}):i.processSuggestions(r,n,e)):(i.hideSpellContextItems(),i.showContextMenuOnSel(e))}else i.hideSpellContextItems(),i.showContextMenuOnSel(e)},this.documentHelper=e,this.locale=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale),this.locale.setLocale(this.documentHelper.owner.locale),this.initContextMenu(this.locale,this.documentHelper.owner.enableRtl)}return Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spellChecker",{get:function(){return this.documentHelper.owner.spellChecker},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"ContextMenu"},e.prototype.initContextMenu=function(e,n){var r=this,o=this.documentHelper.owner.element.id;this.contextMenu=document.createElement("div"),this.contextMenu.id=this.documentHelper.owner.containerId+"e-de-contextmenu",document.body.appendChild(this.contextMenu);var s=document.createElement("ul");s.style.width="auto",s.id=this.documentHelper.owner.containerId+"e-de-contextmenu-list",s.style.listStyle="none",s.style.margin="0px",s.style.maxHeight="auto",s.oncontextmenu=this.disableBrowserContextmenu,this.contextMenu.appendChild(s),this.menuItems=[{text:e.getConstant("Lock"),iconCss:"e-icons e-de-ctnr-lock",id:o+"_contextmenu_lock"},{text:e.getConstant("Unlock"),iconCss:"e-icons",id:o+"_contextmenu_unlock"},{text:e.getConstant("Cut"),iconCss:"e-icons e-de-cut",id:o+"_contextmenu_cut"},{text:e.getConstant("Copy"),iconCss:"e-icons e-de-copy",id:o+"_contextmenu_copy"},{text:e.getConstant("Paste"),iconCss:"e-icons e-de-paste",id:o+"_contextmenu_paste"},{separator:!0},{text:e.getConstant("New Comment"),iconCss:"e-icons e-de-cmt-add",id:o+"_add_comment"},{separator:!0},{text:e.getConstant("Accept Changes"),iconCss:"e-icons e-de-acceptchange",id:o+"_contextmenu_accept_changes"},{text:e.getConstant("Reject Changes"),iconCss:"e-icons e-de-rejectchange",id:o+"_contextmenu_reject_changes"},{text:e.getConstant("Update Field"),iconCss:"e-icons e-de-update-field",id:o+"_contextmenu_update_field"},{text:e.getConstant("Edit Field")+"...",iconCss:"e-icons e-de-edit_field",id:o+"_contextmenu_edit_field"},{text:e.getConstant("Continue Numbering"),iconCss:"e-icons e-de-continue-numbering",id:o+"_contextmenu_continue_numbering"},{text:e.getConstant("Restart At")+" 1",iconCss:"e-icons e-de-restart-at",id:o+"_contextmenu_restart_at"},{separator:!0},{text:e.getConstant("Hyperlink")+"...",iconCss:"e-icons e-de-insertlink",id:o+"_contextmenu_hyperlink"},{text:e.getConstant("Edit Hyperlink")+"...",iconCss:"e-icons e-de-edit-hyperlink",id:o+"_contextmenu_edit_hyperlink"},{text:e.getConstant("Open Hyperlink"),iconCss:"e-icons e-de-open-hyperlink",id:o+"_contextmenu_open_hyperlink"},{text:e.getConstant("Copy Hyperlink"),iconCss:"e-icons e-de-copy-hyperlink",id:o+"_contextmenu_copy_hyperlink"},{text:e.getConstant("Remove Hyperlink"),iconCss:"e-icons e-de-remove-hyperlink",id:o+"_contextmenu_remove_hyperlink"},{text:e.getConstant("Properties"),iconCss:"e-icons e-de-formproperties",id:o+"_properties"},{separator:!0},{text:e.getConstant("Font")+"...",iconCss:"e-icons e-de-fonts",id:o+"_contextmenu_font_dialog"},{text:e.getConstant("Paragraph")+"...",iconCss:"e-icons e-de-paragraph",id:o+"_contextmenu_paragraph_dialog"},{text:e.getConstant("Notes Options")+"...",id:o+"_contextmenu_note_options"},{separator:!0},{text:e.getConstant("Table Properties")+"...",id:o+"_contextmenu_table_dialog",iconCss:"e-icons e-de-table"},{text:e.getConstant("Merge Cells"),id:o+"_contextmenu_merge_cell",iconCss:"e-icons e-de-ctnr-mergecell"},{text:e.getConstant("AutoFit"),id:o+"_contextmenu_auto_fit",iconCss:"e-icons",items:[{text:e.getConstant("AutoFit to Contents"),id:o+"_contextmenu_auto_fit_contents",iconCss:"e-icons e-de-icon-autofit e-de-autofit-contents"},{text:e.getConstant("AutoFit to Window"),id:o+"_contextmenu_auto_fit_window",iconCss:"e-icons e-de-icon-auto-fitwindow e-de-autofit-window"},{text:e.getConstant("Fixed Column Width"),id:o+"_contextmenu_fixed_column_width",iconCss:"e-icons e-de-icon-fixed-columnwidth e-de-fixed-column"}]},{text:e.getConstant("Insert"),id:o+"_contextmenu_insert_table",iconCss:"e-icons",items:[{text:e.getConstant("Insert Above"),id:o+"_contextmenu_insert_above",iconCss:"e-icons e-de-insertabove"},{text:e.getConstant("Insert Below"),id:o+"_contextmenu_insert_below",iconCss:"e-icons e-de-insertbelow"},{text:e.getConstant("Insert Left"),id:o+"_contextmenu_insert_left",iconCss:"e-icons e-de-insertleft"},{text:e.getConstant("Insert Right"),id:o+"_contextmenu_insert_right",iconCss:"e-icons e-de-insertright"}]},{text:e.getConstant("Delete"),id:o+"_contextmenu_delete_table",iconCss:"e-icons",items:[{text:e.getConstant("Delete Table"),id:o+"_contextmenu_complete_table_delete",iconCss:"e-icons e-de-delete-table"},{text:e.getConstant("Delete Row"),id:o+"_contextmenu_delete_row",iconCss:"e-icons e-de-deleterow"},{text:e.getConstant("Delete Column"),id:o+"_contextmenu_delete_column",iconCss:"e-icons e-de-deletecolumn"}]}];var a={target:"#"+this.documentHelper.owner.containerId+"e-de-contextmenu",enableRtl:n,items:this.addMenuItems(this.menuItems),select:function(e){var t=e.element.id;r.handleContextMenuItem(t)}};this.contextMenuInstance=new i.ContextMenu(a,"#"+this.documentHelper.owner.containerId+"e-de-contextmenu-list"),this.contextMenuInstance.beforeOpen=function(){for(e=0;e<r.customMenuItems.length;e++)void 0!==r.customMenuItems[e].id?r.ids[e]=r.customMenuItems[e].id:r.ids[e]=r.customMenuItems[e+1].id;if(r.documentHelper.owner.fireCustomContextMenuBeforeOpen(r.ids),r.enableCustomContextMenu)for(var e=0;e<r.menuItems.length;e++)void 0!==r.menuItems[e].id?document.getElementById(r.menuItems[e].id).style.display="none":document.getElementById(r.menuItems[e-1].id).nextSibling.style.display="none";r.viewer&&r.documentHelper.selection&&(t.classList(r.documentHelper.selection.caret,[],["e-de-cursor-animation"]),r.documentHelper.selection.showCaret())},this.contextMenuInstance.onClose=function(){r.viewer&&r.documentHelper.selection&&(t.classList(r.documentHelper.selection.caret,["e-de-cursor-animation"],[]),r.documentHelper.updateFocus())}},e.prototype.disableBrowserContextmenu=function(){return!1},e.prototype.handleContextMenuItem=function(e){var t=this.documentHelper.owner.element.id;switch(e){case t+"_contextmenu_lock":this.documentHelper.owner.collaborativeEditingModule&&this.documentHelper.owner.collaborativeEditingModule.lockContent(this.documentHelper.owner.currentUser);break;case t+"_contextmenu_unlock":this.documentHelper.owner.collaborativeEditingModule&&this.documentHelper.owner.collaborativeEditingModule.unlockContent(this.documentHelper.owner.currentUser);break;case t+"_contextmenu_copy":this.documentHelper.selection.copy();break;case t+"_contextmenu_cut":this.documentHelper.owner.editor.cut();break;case t+"_contextmenu_paste":this.documentHelper.owner.isReadOnlyMode||this.documentHelper.owner.editorModule.pasteInternal(void 0);break;case t+"_add_comment":this.documentHelper.owner.isReadOnlyMode||(this.documentHelper.owner.editor.isUserInsert=!0,this.documentHelper.owner.editorModule.insertComment(),this.documentHelper.owner.editor.isUserInsert=!1);break;case t+"_contextmenu_update_field":var i=this.documentHelper.owner.isReadOnlyMode;this.documentHelper.selection.isReferenceField()&&(!i||i&&"FormFieldsOnly"===this.documentHelper.protectionType)?this.documentHelper.selection.updateRefField():this.documentHelper.owner.isReadOnlyMode||this.documentHelper.owner.editorModule.updateToc();break;case t+"_contextmenu_edit_field":this.documentHelper.owner.isReadOnlyMode||this.documentHelper.owner.tableOfContentsDialogModule.show();break;case t+"_contextmenu_font_dialog":this.documentHelper.owner.fontDialogModule&&this.documentHelper.owner.fontDialogModule.showFontDialog();break;case t+"_contextmenu_open_hyperlink":this.documentHelper.selection.navigateHyperlink();break;case t+"_contextmenu_copy_hyperlink":this.documentHelper.selection.copyHyperlink();break;case t+"_contextmenu_edit_hyperlink":case t+"_contextmenu_hyperlink":this.documentHelper.owner.hyperlinkDialogModule&&this.documentHelper.owner.hyperlinkDialogModule.show();break;case t+"_contextmenu_remove_hyperlink":this.documentHelper.owner.editor.removeHyperlink();break;case t+"_contextmenu_paragraph_dialog":this.documentHelper.owner.paragraphDialogModule&&this.documentHelper.owner.paragraphDialogModule.show();break;case t+"_contextmenu_table_dialog":this.documentHelper.owner.tablePropertiesDialogModule.show();break;case t+"_contextmenu_merge_cell":this.documentHelper.owner.editor.mergeCells();break;case t+"_contextmenu_insert_above":this.documentHelper.owner.editor.insertRow(!0);break;case t+"_contextmenu_insert_below":this.documentHelper.owner.editor.insertRow(!1);break;case t+"_contextmenu_insert_left":this.documentHelper.owner.editor.insertColumn(!0);break;case t+"_contextmenu_insert_right":this.documentHelper.owner.editor.insertColumn(!1);break;case t+"_contextmenu_complete_table_delete":this.documentHelper.owner.editor.deleteTable();break;case t+"_contextmenu_delete_row":this.documentHelper.owner.editor.deleteRow();break;case t+"_contextmenu_delete_column":this.documentHelper.owner.editor.deleteColumn();break;case t+"_contextmenu_continue_numbering":this.documentHelper.owner.editorModule.applyContinueNumbering();break;case t+"_contextmenu_restart_at":this.documentHelper.owner.editorModule.applyRestartNumbering(this.documentHelper.selection);break;case t+"_contextmenu_auto_fit_contents":this.documentHelper.owner.editor.autoFitTable("FitToContents");break;case t+"_contextmenu_auto_fit_window":this.documentHelper.owner.editor.autoFitTable("FitToWindow");break;case t+"_contextmenu_fixed_column_width":this.documentHelper.owner.editor.autoFitTable("FixedColumnWidth");break;case t+"_contextmenu_spelling_dialog":var n=this.spellChecker.retriveText();this.currentContextInfo=null,this.documentHelper.owner.spellCheckDialog.show(n.text,n.element);break;case t+"_contextmenu_accept_changes":this.documentHelper.selection.handleAcceptReject(!0);break;case t+"_contextmenu_reject_changes":this.documentHelper.selection.handleAcceptReject(!1);break;case t+"_properties":var r=this.documentHelper.selection.getCurrentFormField();r instanceof Ie&&(r.formFieldData instanceof Ee?this.documentHelper.owner.textFormFieldDialogModule.show():r.formFieldData instanceof He?this.documentHelper.owner.checkBoxFormFieldDialogModule.show():r.formFieldData instanceof We&&this.documentHelper.owner.dropDownFormFieldDialogModule.show());break;case t+"_contextmenu_note_options":this.documentHelper.owner.showFootNotesDialog();break;default:var o=this.documentHelper.owner.element.id+"_contextmenu_otherSuggestions_spellcheck_";if(e.substring(0,o.length)===o){var s=e.substring(e.lastIndexOf("_")+1);this.callSelectedOption(s);break}this.documentHelper.owner.fireCustomContextMenuSelect(e)}},e.prototype.callSelectedOption=function(e){e===this.locale.getConstant("Add To Dictionary")?this.spellChecker.handleAddToDictionary():e===this.locale.getConstant("Ignore All")?this.spellChecker.handleIgnoreAllItems():this.spellChecker.manageReplace(e)},e.prototype.addCustomMenu=function(e,t,i){var n=JSON.parse(JSON.stringify(e));this.destroy(),0===this.spellContextItems.length&&(this.customItems=e);for(var r=0;r<n.length;r++)this.customMenuItems.push(n[r]),this.customMenuItems[r].id=this.documentHelper.owner.element.id+this.customMenuItems[r].id;this.enableCustomContextMenu=t,this.enableCustomContextMenuBottom=i,this.initContextMenu(this.locale)},e.prototype.addMenuItems=function(e){return this.enableCustomContextMenuBottom?e.concat(this.customMenuItems):this.customMenuItems.concat(e)},e.prototype.showContextMenuOnSel=function(e){var i=!(e instanceof MouseEvent),n=0,r=0;if(i){var o=this.documentHelper.getTouchOffsetValue(e);n=o.x,r=o.y}else r=(t.Browser.isIE?e.clientY:e.y)+document.body.scrollTop+document.documentElement.scrollTop,n=(t.Browser.isIE?e.clientX:e.x)+document.body.scrollLeft+document.documentElement.scrollLeft;this.showHideElements(this.documentHelper.selection)&&(i&&(this.documentHelper.isMouseDown=!1),this.contextMenuInstance.open(r,n),e.preventDefault())},e.prototype.hideSpellContextItems=function(){if(this.spellContextItems.length>0)for(var e=0;e<this.spellContextItems.length;e++){var i=document.getElementById(this.documentHelper.owner.element.id+this.spellContextItems[e].id);t.isNullOrUndefined(i)||(i.style.display="none")}},e.prototype.processSuggestions=function(e,i,n){this.spellContextItems=this.constructContextmenu(e,i),this.addCustomMenu(this.spellContextItems),this.noSuggestion=document.getElementById(this.documentHelper.owner.element.id+"_contextmenu_no_suggestion"),t.isNullOrUndefined(this.noSuggestion)||(this.noSuggestion.style.display="block",t.classList(this.noSuggestion,["e-disabled"],["e-focused"])),this.showContextMenuOnSel(n)},e.prototype.constructContextmenu=function(e,i){var n=this.customItems.length>0?this.customItems.slice():[];if(t.isNullOrUndefined(e)||0===e.length)n.push({text:this.locale.getConstant("no suggestions"),id:"_contextmenu_no_suggestion",classList:["e-focused"],iconCss:""});else for(var r=0;r<e.length;r++)n.push({text:e[r],id:"_contextmenu_otherSuggestions_spellcheck_"+e[r],iconCss:""});return n.push({separator:!0,id:"_contextmenu_suggestion_separator"}),!t.isNullOrUndefined(i)&&i.length>1?(n.push({text:this.locale.getConstant("More Suggestion"),items:i}),n.push({separator:!0,id:"_contextmenu_moreSuggestion_separator"})):n.push({text:this.locale.getConstant("Add To Dictionary"),id:"_contextmenu_otherSuggestions_spellcheck_Add To Dictionary",iconCss:""}),n.push({text:this.locale.getConstant("Ignore Once"),id:"_contextmenu_otherSuggestions_spellcheck_Ignore Once",iconCss:""}),n.push({text:this.locale.getConstant("Ignore All"),id:"_contextmenu_otherSuggestions_spellcheck_Ignore All",iconCss:""}),n.push({separator:!0,id:"_contextmenu_change_separator"}),n.push({text:this.locale.getConstant("Spelling"),id:"_contextmenu_spelling_dialog",iconCss:"e-icons e-de-spellcheck",items:[]}),n.push({separator:!0,id:"_contextmenu_spelling_separator"}),n},e.prototype.showHideElements=function(e){if(t.isNullOrUndefined(e))return!1;e.hideToolTip();var i=this.documentHelper.owner,n=i.element.id,r=document.getElementById(n+"_contextmenu_lock"),o=document.getElementById(n+"_contextmenu_unlock"),s=document.getElementById(n+"_contextmenu_copy"),a=document.getElementById(n+"_contextmenu_cut"),l=document.getElementById(n+"_contextmenu_paste"),d=document.getElementById(n+"_contextmenu_update_field"),h=document.getElementById(n+"_contextmenu_edit_field"),c=document.getElementById(n+"_contextmenu_font_dialog"),p=document.getElementById(n+"_contextmenu_paragraph_dialog"),g=document.getElementById(n+"_contextmenu_table_dialog"),u=document.getElementById(n+"_contextmenu_insert_table"),m=document.getElementById(n+"_contextmenu_delete_table"),f=document.getElementById(n+"_contextmenu_merge_cell"),v=document.getElementById(n+"_contextmenu_hyperlink"),y=document.getElementById(n+"_contextmenu_open_hyperlink"),b=document.getElementById(n+"_contextmenu_edit_hyperlink"),w=document.getElementById(n+"_contextmenu_copy_hyperlink"),C=document.getElementById(n+"_contextmenu_remove_hyperlink"),x=document.getElementById(n+"_properties"),F=document.getElementById(n+"_contextmenu_continue_numbering"),P=document.getElementById(n+"_contextmenu_restart_at"),T=document.getElementById(n+"_contextmenu_auto_fit"),S=document.getElementById(n+"_add_comment"),I=document.getElementById(n+"_contextmenu_note_options");this.documentHelper.owner.enableLockAndEdit?this.documentHelper.editRanges.containsKey(this.documentHelper.owner.currentUser)?(r.style.display="none",o.style.display="block",this.documentHelper.selection.isSelectionInEditRegion()?t.classList(o,["e-blankicon"],["e-disabled"]):t.classList(o,["e-disabled","e-blankicon"],[])):(r.style.display="block",this.documentHelper.owner.collaborativeEditingModule&&this.documentHelper.owner.collaborativeEditingModule.canLock()?t.classList(o,["e-disabled"],[]):t.classList(o,[],["e-disabled"]),o.style.display="none"):(r.style.display="none",o.style.display="none");var N=!1;a.style.display="none",l.style.display="none",l.nextSibling.style.display="none";var E=document.getElementById(n+"_contextmenu_accept_changes"),H=document.getElementById(n+"_contextmenu_reject_changes");v.style.display="none",I.style.display="none",I.nextSibling.style.display="none",c.previousSibling.style.display="none",y.style.display="none",w.style.display="none",b.style.display="none",C.style.display="none",C.nextSibling.style.display="none",x.style.display="none",f.style.display="none",T.style.display="none",c.style.display="none",p.style.display="none",u.style.display="none",m.style.display="none",g.style.display="none",d.style.display="none";var W=e.getHyperlinkField(),O=!1;E.style.display="none",H.style.display="none",W instanceof Ie&&e.isReferenceField(W)&&(O=!0),W instanceof Ie&&O&&("FormFieldsOnly"===this.documentHelper.protectionType||!this.documentHelper.owner.isReadOnlyMode)&&(d.style.display="block"),h.style.display="none",F.style.display="none",P.style.display="none",P.nextSibling.style.display="none";var k=e.isEmpty;t.classList(a,k?["e-disabled"]:[],k?[]:["e-disabled"]),t.classList(s,k?["e-disabled"]:[],k?[]:["e-disabled"]);var L=this.documentHelper.owner.isReadOnlyMode||this.documentHelper.owner.enableHeaderAndFooter||!this.documentHelper.owner.enableComment;if(S.style.display=L?"none":"block",S.previousSibling.style.display=L?"none":"block",S.nextSibling.style.display=L?"none":"block",i.isReadOnlyMode)return!0;this.viewer&&this.documentHelper.owner&&this.documentHelper.owner.commentReviewPane&&this.documentHelper.owner.commentReviewPane.commentPane.isEditMode?t.classList(S,["e-disabled"],[]):t.classList(S,[],["e-disabled"]),E.previousSibling.style.display="none",a.style.display="block",l.style.display="block",l.nextSibling.style.display="block",t.classList(u,["e-blankicon"],[]),t.classList(m,["e-blankicon"],[]),t.classList(h,["e-blankicon"],[]),t.classList(T,["e-blankicon"],[]);var R=i.enableLocalPaste&&!t.isNullOrUndefined(i.editor.copiedData);if(t.classList(l,R?[]:["e-disabled"],R?["e-disabled"]:[]),"TableOfContents"===e.contextType)d.style.display="block",h.style.display="block";else{var B=e.start,D=e.end;"List"===e.contextType&&"Bullet"!==i.selection.getListLevel(B.paragraph).listLevelPattern&&(F.style.display="block",P.style.display="block",P.nextSibling.style.display="block"),B.paragraph.isInsideTable&&(!D.paragraph.isInsideTable||B.paragraph.associatedCell!==D.paragraph.associatedCell||e.isCellSelected(B.paragraph.associatedCell,B,D))?v.classList.add("e-disabled"):v.classList.contains("e-disabled")&&v.classList.remove("e-disabled"),W instanceof Ie&&!e.isImageField()&&!O?(y.style.display="block",w.style.display="block",i.hyperlinkDialogModule&&(b.style.display="block"),C.style.display="block",C.nextSibling.style.display="block",N=!0,x.style.display="none"):i.hyperlinkDialogModule&&(v.style.display="block",c.previousSibling.style.display="block",N=!0),e.isFormField()&&this.documentHelper.owner.enableFormField&&(v.style.display="none",x.style.display="block"),W instanceof Ie&&O&&(v.style.display="none",d.style.display="block")}return this.documentHelper.owner.selection.start.paragraph.isInsideTable&&this.documentHelper.owner.selection.end.paragraph.isInsideTable?(i.tablePropertiesDialogModule&&(g.style.display="block"),u.style.display="block",m.style.display="block",this.documentHelper.owner.editor.canMergeCells()&&(f.style.display="block"),T.style.display=this.documentHelper.selection.isTableSelected()?"block":"none"):(this.documentHelper.owner.fontDialogModule&&(c.style.display="block"),this.documentHelper.owner.paragraphDialogModule?p.style.display="block":N||this.documentHelper.owner.fontDialogModule||L||(S.nextSibling.style.display="none")),"Image"===e.contextType&&(c.style.display="none",p.style.display="none",c.previousSibling.style.display="none",C.nextSibling.style.display="none"),this.documentHelper.selection.hasRevisions()&&(E.previousSibling.style.display=this.documentHelper.owner.enableHeaderAndFooter?"none":"block",E.style.display="block",H.style.display="block"),(this.documentHelper.selection.isinFootnote||this.documentHelper.selection.isinEndnote)&&(I.style.display="block"),!0},e.prototype.destroy=function(){this.contextMenuInstance&&this.contextMenuInstance.destroy(),this.contextMenu&&this.contextMenu.parentElement&&(this.contextMenu.parentElement.removeChild(this.contextMenu),this.contextMenu.innerHTML=""),this.contextMenu=void 0,this.contextMenuInstance=void 0,this.menuItems=[],this.customMenuItems=[],this.ids=[]},e}(),Pt=function(){function e(e){this.documentHelper=void 0,this.commentStarts=void 0,this.commentEnds=void 0,this.commentsCollection=void 0,this.revisionCollection=void 0,this.isPageBreakInsideTable=!1,this.isParseHeader=!1,this.footnotes=void 0,this.endnotes=void 0,this.isCutPerformed=!1,this.isPaste=!1,this.documentHelper=e,this.editableRanges=new u}return Object.defineProperty(e.prototype,"isPasting",{get:function(){return this.viewer&&this.viewer.owner.isPastingContent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.convertJsonToDocument=function(e){this.commentStarts=new u,this.commentEnds=new u,this.commentsCollection=new u,this.revisionCollection=new u,this.footnotes=new ke,this.endnotes=new ke;var i=[],n=e;n=n instanceof Object?n:JSON.parse(n);var r=t.isNullOrUndefined(n.characterFormat)?this.viewer.owner.characterFormat:n.characterFormat;this.parseCharacterFormat(r,this.documentHelper.characterFormat);var o=t.isNullOrUndefined(n.paragraphFormat)?this.viewer.owner.paragraphFormat:n.paragraphFormat;return this.parseParagraphFormat(o,this.documentHelper.paragraphFormat),this.parseDocumentProtection(n),t.isNullOrUndefined(n.defaultTabWidth)||(this.documentHelper.defaultTabWidth=n.defaultTabWidth),t.isNullOrUndefined(n.trackChanges)||(this.documentHelper.owner.showRevisions=n.trackChanges,this.documentHelper.owner.enableTrackChanges=n.trackChanges),t.isNullOrUndefined(n.dontUseHTMLParagraphAutoSpacing)||(this.documentHelper.dontUseHtmlParagraphAutoSpacing=n.dontUseHTMLParagraphAutoSpacing),t.isNullOrUndefined(n.alignTablesRowByRow)||(this.documentHelper.alignTablesRowByRow=n.alignTablesRowByRow),t.isNullOrUndefined(n.background)||(this.documentHelper.backgroundColor=this.getColor(n.background.color)),t.isNullOrUndefined(n.abstractLists)||this.parseAbstractList(n,this.documentHelper.abstractLists),t.isNullOrUndefined(n.lists)||this.parseList(n,this.documentHelper.lists),t.isNullOrUndefined(n.styles)||this.parseStyles(n,this.documentHelper.styles),t.isNullOrUndefined(n.comments)||this.parseComments(n,this.documentHelper.comments),t.isNullOrUndefined(n.revisions)||this.parseRevisions(n,this.viewer.owner.revisionsInternal.changes),t.isNullOrUndefined(n.sections)||this.parseSections(n.sections,i),t.isNullOrUndefined(n.customXml)||this.parseCustomXml(n),t.isNullOrUndefined(n.formFieldShading)||(this.documentHelper.owner.documentEditorSettings.formFieldSettings.applyShading=n.formFieldShading),t.isNullOrUndefined(n.footnotes)||this.parseFootnotes(n.footnotes,this.documentHelper.footnotes),t.isNullOrUndefined(n.endnotes)||this.parseEndtnotes(n.endnotes,this.documentHelper.endnotes),i},e.prototype.parseFootnotes=function(e,i){t.isNullOrUndefined(e.separator)||this.parseBody(e.separator,i.separator),t.isNullOrUndefined(e.continuationNotice)||this.parseBody(e.continuationNotice,i.continuationNotice),t.isNullOrUndefined(e.continuationSeparator)||this.parseBody(e.continuationSeparator,i.continuationSeparator)},e.prototype.parseEndtnotes=function(e,i){t.isNullOrUndefined(e.separator)||this.parseBody(e.separator,i.separator),t.isNullOrUndefined(e.continuationNotice)||this.parseBody(e.continuationNotice,i.continuationNotice),t.isNullOrUndefined(e.continuationSeparator)||this.parseBody(e.continuationSeparator,i.continuationSeparator)},e.prototype.parseCustomXml=function(e){for(var t=0;t<e.customXml.length;t++){var i=e.customXml[t];this.revisionCollection.containsKey(i.itemID)||this.documentHelper.customXmlData.add(i.itemID,i.xml)}},e.prototype.parseDocumentProtection=function(e){t.isNullOrUndefined(e.formatting)||(this.documentHelper.restrictFormatting=e.formatting),t.isNullOrUndefined(e.enforcement)||(this.documentHelper.isDocumentProtected=e.enforcement),t.isNullOrUndefined(e.protectionType)||(this.documentHelper.protectionType=e.protectionType),t.isNullOrUndefined(e.hashValue)||(this.documentHelper.hashValue=e.hashValue),t.isNullOrUndefined(e.saltValue)||(this.documentHelper.saltValue=e.saltValue)},e.prototype.parseStyles=function(e,i){for(var n=0;n<e.styles.length;n++)t.isNullOrUndefined(this.documentHelper.styles.findByName(e.styles[n].name))&&this.parseStyle(e,e.styles[n],i)},e.prototype.parseRevisions=function(e,i){for(var n=0;n<e.revisions.length;n++){var r=e.revisions[n];if(!t.isNullOrUndefined(r.revisionId)&&!t.isNullOrUndefined(r.revisionType)){var o=this.parseRevision(r),s=!0;if(!this.documentHelper.owner.sfdtExportModule.copyWithTrackChange&&this.isPaste){if("Insertion"===r.revisionType&&this.isPaste&&this.documentHelper.owner.enableTrackChanges)continue;this.revisionCollection.containsKey(r.revisionId)||this.revisionCollection.add(r.revisionId,o)}else this.revisionCollection.add(r.revisionId,o);for(var a=0;a<i.length;a++)i[a].revisionID===o.revisionID&&(s=!1);s&&i.push(o)}}this.documentHelper.revisionsInternal=this.revisionCollection,this.documentHelper.owner.sfdtExportModule&&(this.documentHelper.owner.sfdtExportModule.copyWithTrackChange=!1)},e.prototype.parseRevision=function(e){if(!t.isNullOrUndefined(e)){var i=new W(this.viewer.owner,e.author,e.date);return i.revisionID=e.revisionId,i.revisionType=e.revisionType,i}},e.prototype.checkAndApplyRevision=function(e,i){if(!t.isNullOrUndefined(e.revisionIds)&&e.revisionIds.length>0)for(var n=0;n<e.revisionIds.length;n++){var r=e.revisionIds[n];if(this.revisionCollection.containsKey(r)){var o=this.revisionCollection.get(r);i instanceof I||o.range.push(i),i.revisions.push(o)}}},e.prototype.parseComments=function(e,t){for(var i=0,n=0;n<e.comments.length;n++){var r=e.comments[n],o=void 0;for(o=this.parseComment(r,o);i<r.replyComments.length;){var s=void 0;(s=this.parseComment(r.replyComments[i],s)).ownerComment=o,s.isReply=!0,o.replyComments.push(s),this.commentsCollection.add(s.commentId,s),i++}this.commentsCollection.add(o.commentId,o),t.push(o),i=0}},e.prototype.parseComment=function(e,t){return t=new yt(e.date),t.author=e.author,t.initial=e.initial,t.commentId=e.commentId,t.isResolved=e.done,t.text=this.parseCommentText(e.blocks),t},e.prototype.parseCommentText=function(e){for(var t="",i=0;i<e.length;i++){0!==i&&(t+="\n");for(var n=0;n<e[i].inlines.length;n++)t+=e[i].inlines[n].text}return t},e.prototype.parseStyle=function(e,i,n){var r;if(!t.isNullOrUndefined(i.type)){if("Paragraph"===i.type&&((r=new U).type="Paragraph"),"Character"===i.type&&((r=new z).type="Character"),t.isNullOrUndefined(i.name)||(r.name=i.name),n.push(r),!t.isNullOrUndefined(i.basedOn)){var o=n.findByName(i.basedOn);if(t.isNullOrUndefined(o)){var s=this.getStyle(i.basedOn,e),a=void 0;a=t.isNullOrUndefined(s)||s.type!==r.type?"Paragraph"===r.type?JSON.parse('{"type":"Paragraph","name":"Normal","next":"Normal"}'):JSON.parse('{"type": "Character","name": "Default Paragraph Font"}'):s,this.parseStyle(e,a,n),r.basedOn=n.findByName(a.name)}else o.type===r.type&&(r.basedOn=o)}if(!t.isNullOrUndefined(i.link)){var l=n.findByName(i.link),d=this.getStyle(i.link,e),a=void 0;if(t.isNullOrUndefined(l)){if(t.isNullOrUndefined(d)){var h={};h.characterFormat=i.characterFormat,h.name=i.name+" Char",h.type="Character",h.basedOn="Normal"===i.basedOn?"Default Paragraph Font":i.basedOn+" Char",a=h}else a=d;this.parseStyle(e,a,n),r.link=t.isNullOrUndefined(n.findByName(a.name))?i.link:n.findByName(a.name)}else r.link=l}if(t.isNullOrUndefined(i.characterFormat)||this.parseCharacterFormat(i.characterFormat,r.characterFormat),t.isNullOrUndefined(i.paragraphFormat)||this.parseParagraphFormat(i.paragraphFormat,r.paragraphFormat),!t.isNullOrUndefined(i.next))if(i.next===i.name)r.next=r;else{var c=n.findByName(i.next);if(t.isNullOrUndefined(c)||c.type!==r.type){var p=this.getStyle(i.next,e);t.isNullOrUndefined(p)?r.next=r:(this.parseStyle(e,p,n),r.next=n.findByName(p.name))}else r.next=c}}},e.prototype.getStyle=function(e,t){for(var i=0;i<t.styles.length;i++)if(t.styles[i].name===e)return t.styles[i]},e.prototype.parseAbstractList=function(e,i){for(var n=0;n<e.abstractLists.length;n++){var r=new G,o=e.abstractLists[n];if(i.push(r),!t.isNullOrUndefined(o)&&(t.isNullOrUndefined(o.abstractListId)||(r.abstractListId=o.abstractListId),!t.isNullOrUndefined(o.levels)))for(var s=0;s<o.levels.length;s++){var a=o.levels[s];if(!t.isNullOrUndefined(a)){var l=this.parseListLevel(a,r);r.levels.push(l)}}}},e.prototype.parseListLevel=function(e,i){var n=new K(i);return"Bullet"===e.listLevelPattern?(n.listLevelPattern="Bullet",n.numberFormat=t.isNullOrUndefined(e.numberFormat)?"":e.numberFormat):(n.listLevelPattern=e.listLevelPattern,n.startAt=e.startAt,n.numberFormat=t.isNullOrUndefined(e.numberFormat)?"":e.numberFormat,e.restartLevel>=0?n.restartLevel=e.restartLevel:n.restartLevel=e.levelNumber),n.followCharacter=e.followCharacter,this.parseCharacterFormat(e.characterFormat,n.characterFormat),this.parseParagraphFormat(e.paragraphFormat,n.paragraphFormat),n},e.prototype.parseList=function(e,i){for(var n=0;n<e.lists.length;n++){var r=new P,o=e.lists[n];t.isNullOrUndefined(o.abstractListId)||(r.abstractListId=o.abstractListId,r.abstractList=this.documentHelper.getAbstractListById(o.abstractListId)),i.push(r),t.isNullOrUndefined(o.listId)||(r.listId=o.listId),o.hasOwnProperty("levelOverrides")&&this.parseLevelOverride(o.levelOverrides,r)}},e.prototype.parseLevelOverride=function(e,i){if(!t.isNullOrUndefined(e))for(var n=0;n<e.length;n++){var r=new F,o=e[n];r.startAt=o.startAt,r.levelNumber=o.levelNumber,t.isNullOrUndefined(o.overrideListLevel)||(r.overrideListLevel=this.parseListLevel(o.overrideListLevel,r)),i.levelOverrides.push(r)}},e.prototype.parseSections=function(e,i){for(var n=0;n<e.length;n++){var r=new fe;r.sectionFormat=new x(r),r.index=n;var o=e[n];t.isNullOrUndefined(o.sectionFormat)||this.parseSectionFormat(o.sectionFormat,r.sectionFormat),t.isNullOrUndefined(o.headersFooters)&&(o.headersFooters={}),this.documentHelper.headersFooters.push(this.parseHeaderFooter(o.headersFooters,this.documentHelper.headersFooters)),this.isParseHeader=!1,this.parseTextBody(o.blocks,r,n+1<e.length);for(var s=0;s<r.childWidgets.length;s++)r.childWidgets[s].containerWidget=r;i.push(r)}},e.prototype.parseHeaderFooter=function(e,i){this.isParseHeader=!0;var n={};if(!t.isNullOrUndefined(e.header)){var r=new ve("OddHeader");n[0]=r,this.parseTextBody(e.header.blocks,r)}if(!t.isNullOrUndefined(e.footer)){var o=new ve("OddFooter");n[1]=o,this.parseTextBody(e.footer.blocks,o)}if(!t.isNullOrUndefined(e.evenHeader)){var s=new ve("EvenHeader");n[2]=s,this.parseTextBody(e.evenHeader.blocks,s)}if(!t.isNullOrUndefined(e.evenFooter)){var a=new ve("EvenFooter");n[3]=a,this.parseTextBody(e.evenFooter.blocks,a)}if(!t.isNullOrUndefined(e.firstPageHeader)){var l=new ve("FirstPageHeader");n[4]=l,this.parseTextBody(e.firstPageHeader.blocks,l)}if(!t.isNullOrUndefined(e.firstPageFooter)){var d=new ve("FirstPageFooter");n[5]=d,this.parseTextBody(e.firstPageFooter.blocks,d)}return n},e.prototype.parseTextBody=function(e,t,i){this.parseBody(e,t.childWidgets,t,i)},e.prototype.addCustomStyles=function(e){if(!t.isNullOrUndefined(e.styles))for(var i=0;i<e.styles.length;i++)void 0===this.documentHelper.styles.findByName(e.styles[i].name)&&this.parseStyle(e,e.styles[i],this.documentHelper.styles)},e.prototype.parseBody=function(e,i,n,r,o){if(!t.isNullOrUndefined(e))for(var s=0;s<e.length;s++){var a=e[s],l=!1;if(a.hasOwnProperty("inlines")){var d=new we;if(d.characterFormat=new k(d),d.paragraphFormat=new I(d),a.inlines.length>0&&(l=this.parseParagraph(a.inlines,d,!1)),!r||a!==e[e.length-1]||l){this.parseCharacterFormat(a.characterFormat,d.characterFormat),this.parseParagraphFormat(a.paragraphFormat,d.paragraphFormat);var h=void 0;t.isNullOrUndefined(a.paragraphFormat)||t.isNullOrUndefined(a.paragraphFormat.styleName)||(h=this.documentHelper.styles.findByName(a.paragraphFormat.styleName,"Paragraph"),t.isNullOrUndefined(h)||d.paragraphFormat.applyStyle(h)),i.push(d)}else r&&1===e.length&&i.push(d);d.index=i.length-1,d.containerWidget=n}else if(a.hasOwnProperty("rows"))this.parseTable(a,i,i.length,n);else if(a.hasOwnProperty("contentControlProperties")){var c=new Me("Block"),p=new Me("Block");this.parseContentControlProperties(a.contentControlProperties,c.contentControlProperties),p.contentControlProperties=c.contentControlProperties,c.type=0,p.type=1,this.parseBody(a.blocks,i,n,r,c.contentControlProperties);for(var g=0;g<2;g++){var u=i.length<a.blocks.length?i[0]:0===g?i[i.length-a.blocks.length]:i[i.length-1],m=void 0;if(u instanceof we?m=u:u instanceof xe&&(m=0===g?u.firstChild.firstChild.firstChild:u.lastChild.lastChild.lastChild),!t.isNullOrUndefined(m)&&0===m.childWidgets.length){var f=new Te(m);m.childWidgets.push(f)}0===g?(m.firstChild.children.splice(0,0,c),c.line=m.firstChild):(m.lastChild.children.push(p),p.line=m.lastChild)}}t.isNullOrUndefined(o)||(i[i.length-1].contentControlProperties=o)}},e.prototype.parseTable=function(e,i,n,r){var o=new xe;o.index=n,o.tableFormat=new j(o),t.isNullOrUndefined(e.tableFormat)||this.parseTableFormat(e.tableFormat,o.tableFormat),o.title=e.title,o.description=e.description,this.parseTablePositioning(e,o);for(var s=0;s<e.rows.length;s++){var a=new Fe;a.rowFormat=new H(a);var l=e.rows[s];if(t.isNullOrUndefined(l.contentControlProperties)||(a.contentControlProperties=new Ue("Row"),this.parseContentControlProperties(l.contentControlProperties,a.contentControlProperties)),l.hasOwnProperty("rowFormat")){this.parseRowFormat(l.rowFormat,a.rowFormat),this.parseRowGridValues(l,a.rowFormat),this.parseRowGridValues(l.rowFormat,a.rowFormat),a.index=s;for(var d=0;d<e.rows[s].cells.length;d++){var h=new Pe;if(h.cellFormat=new q(h),t.isNullOrUndefined(e.rows[s].cells[d].contentControlProperties)||(h.contentControlProperties=new Ue("Cell"),this.parseContentControlProperties(e.rows[s].cells[d].contentControlProperties,h.contentControlProperties)),a.childWidgets.push(h),h.containerWidget=a,h.index=d,h.rowIndex=s,h.columnIndex=d,e.rows[s].cells[d].hasOwnProperty("cellFormat")&&this.parseCellFormat(e.rows[s].cells[d].cellFormat,h.cellFormat),this.isPageBreakInsideTable=!0,this.parseTextBody(e.rows[s].cells[d].blocks,h,!1),!t.isNullOrUndefined(h.contentControlProperties)){var c=new Me("Cell"),p=new Me("Cell");if(c.contentControlProperties=h.contentControlProperties,p.contentControlProperties=h.contentControlProperties,c.type=0,p.type=1,0===h.firstChild.childWidgets.length){m=new Te(h.firstChild);h.firstChild.childWidgets.push(m)}c.line=h.firstChild.firstChild,h.firstChild.firstChild.children.splice(0,0,c),p.line=h.lastChild.lastChild,h.lastChild.lastChild.children.push(p)}if(!t.isNullOrUndefined(a.contentControlProperties))if(a.firstChild===h){var g=new Me("Row");if(g.contentControlProperties=a.contentControlProperties,g.type=0,0===h.firstChild.childWidgets.length){m=new Te(h.firstChild);h.firstChild.childWidgets.push(m)}g.line=h.firstChild.firstChild,h.firstChild.firstChild.children.splice(0,0,g)}else if(a.lastChild===h){var u=new Me("Row");if(u.contentControlProperties=a.contentControlProperties,u.type=1,0===h.lastChild.childWidgets.length){var m=new Te(h.lastChild);h.lastChild.childWidgets.push(m)}u.line=h.lastChild.lastChild,h.lastChild.lastChild.children.push(u)}this.isPageBreakInsideTable=!1}}o.childWidgets.push(a),a.containerWidget=o}o.containerWidget=r,i.push(o),o.isGridUpdated=!1},e.prototype.parseTablePositioning=function(e,i){i.wrapTextAround=!t.isNullOrUndefined(e.wrapTextAround)&&e.wrapTextAround,i.wrapTextAround&&(i.positioning=new Ce,i.positioning.allowOverlap=e.positioning.allowOverlap,i.positioning.distanceBottom=L.convertPointToPixel(e.positioning.distanceBottom),i.positioning.distanceLeft=L.convertPointToPixel(e.positioning.distanceLeft),i.positioning.distanceRight=L.convertPointToPixel(e.positioning.distanceRight),i.positioning.distanceTop=L.convertPointToPixel(e.positioning.distanceTop),t.isNullOrUndefined(e.positioning.verticalAlignment)||(i.positioning.verticalAlignment=e.positioning.verticalAlignment),t.isNullOrUndefined(e.positioning.verticalOrigin)||(i.positioning.verticalOrigin=e.positioning.verticalOrigin),i.positioning.verticalPosition=e.positioning.verticalPosition,t.isNullOrUndefined(e.positioning.horizontalAlignment)||(i.positioning.horizontalAlignment=e.positioning.horizontalAlignment),t.isNullOrUndefined(e.positioning.horizontalOrigin)||(i.positioning.horizontalOrigin=e.positioning.horizontalOrigin),i.positioning.horizontalPosition=e.positioning.horizontalPosition)},e.prototype.parseRowGridValues=function(e,i){t.isNullOrUndefined(e.gridBefore)||(i.gridBefore=e.gridBefore),t.isNullOrUndefined(e.gridBeforeWidth)||(i.gridBeforeWidth=e.gridBeforeWidth),t.isNullOrUndefined(e.gridBeforeWidthType)||(i.gridBeforeWidthType=e.gridBeforeWidthType),t.isNullOrUndefined(e.gridAfter)||(i.gridAfter=e.gridAfter),t.isNullOrUndefined(e.gridAfterWidth)||(i.gridAfterWidth=e.gridAfterWidth),t.isNullOrUndefined(e.gridAfterWidthType)||(i.gridAfterWidthType=e.gridAfterWidthType)},e.prototype.parseContentControlProperties=function(e,i){if(t.isNullOrUndefined(e.lockContentControl)||(i.lockContentControl=e.lockContentControl),t.isNullOrUndefined(e.lockContents)||(i.lockContents=e.lockContents),t.isNullOrUndefined(e.tag)||(i.tag=e.tag),t.isNullOrUndefined(e.color)||(i.color=e.color),t.isNullOrUndefined(e.title)||(i.title=e.title),t.isNullOrUndefined(e.appearance)||(i.appearance=e.appearance),t.isNullOrUndefined(e.type)||(i.type=e.type),t.isNullOrUndefined(e.hasPlaceHolderText)||(i.hasPlaceHolderText=e.hasPlaceHolderText),t.isNullOrUndefined(e.multiline)||(i.multiline=e.multiline),t.isNullOrUndefined(e.isTemporary)||(i.isTemporary=e.isTemporary),t.isNullOrUndefined(e.characterFormat)||this.parseCharacterFormat(e.characterFormat,i.characterFormat),"CheckBox"===i.type)t.isNullOrUndefined(e.isChecked)||(i.isChecked=e.isChecked),t.isNullOrUndefined(e.uncheckedState)||(i.uncheckedState=new Ve,i.uncheckedState.font=e.uncheckedState.font,i.uncheckedState.value=e.uncheckedState.value),t.isNullOrUndefined(e.checkedState)||(i.checkedState=new Ve,i.checkedState.font=e.checkedState.font,i.checkedState.value=e.checkedState.value);else if("Date"===i.type)t.isNullOrUndefined(e.dateCalendarType)||(i.dateCalendarType=e.dateCalendarType),t.isNullOrUndefined(e.dateStorageFormat)||(i.dateStorageFormat=e.dateStorageFormat),t.isNullOrUndefined(e.dateDisplayLocale)||(i.dateDisplayLocale=e.dateDisplayLocale),t.isNullOrUndefined(e.dateDisplayFormat)||(i.dateDisplayFormat=e.dateDisplayFormat);else if(("ComboBox"===i.type||"DropDownList"===i.type)&&!t.isNullOrUndefined(e.contentControlListItems))for(var n=0;n<e.contentControlListItems.length;n++){var r=new ze;r.displayText=e.contentControlListItems[n].displayText,r.value=e.contentControlListItems[n].value,i.contentControlListItems.push(r)}t.isNullOrUndefined(e.xmlMapping)||(i.xmlMapping=new _e,i.xmlMapping.isMapped=e.xmlMapping.isMapped,i.xmlMapping.isWordMl=e.xmlMapping.isWordMl,t.isNullOrUndefined(e.xmlMapping.prefixMapping)||(i.xmlMapping.prefixMapping=e.xmlMapping.prefixMapping),i.xmlMapping.xPath=e.xmlMapping.xPath,i.xmlMapping.storeItemId=e.xmlMapping.storeItemId,t.isNullOrUndefined(e.xmlMapping.customXmlPart)||(i.xmlMapping.customXmlPart=new je,i.xmlMapping.customXmlPart.id=e.xmlMapping.customXmlPart.id,i.xmlMapping.customXmlPart.xml=e.xmlMapping.customXmlPart.xml))},e.prototype.parseParagraph=function(e,i,n,r){var o=!1;t.isNullOrUndefined(r)?r=new Te(i):o=!0;for(var s,a=!1,l=this.viewer.owner.enableTrackChanges,d=0;d<e.length;d++){var c=e[d];if(c.hasOwnProperty("text")){var p=void 0;if(this.documentHelper.isPageField)(p=new Be).fieldBegin=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1];else if("\t"===c.text)p=new De;else{if("\f"===c.text&&this.isPageBreakInsideTable)continue;p=new Oe}if(p.characterFormat=new k(p),this.parseCharacterFormat(c.characterFormat,p.characterFormat,n),this.applyCharacterStyle(c,p),p.text=c.text,this.documentHelper.owner.parser.isPaste&&!this.isCutPerformed){if(!t.isNullOrUndefined(c.revisionIds))for(u=0;u<c.revisionIds.length;u++)if(this.revisionCollection.containsKey(c.revisionIds[u])){if(l&&(s=this.revisionCollection.get(c.revisionIds[u])),!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(r.children[d-1].revisions[u])&&(!l||l&&"Deletion"===s.revisionType)&&s.revisionID===c.revisionIds[u]){c.revisionIds[u]=r.children[d-1].revisions[u].revisionID,this.checkAndApplyRevision(c,p);continue}l||(s=this.documentHelper.revisionsInternal.get(c.revisionIds[u])),this.documentHelper.owner.editorModule.insertRevision(p,s.revisionType,s.author),c.revisionIds[u]=p.revisions[u].revisionID}}else this.checkAndApplyRevision(c,p);p.line=r,r.children.push(p),a=!0}else if(c.hasOwnProperty("footnoteType")){var g=new Le;g.line=r,g.footnoteType=c.footnoteType,"Footnote"===g.footnoteType?this.documentHelper.footnoteCollection.push(g):this.documentHelper.endnoteCollection.push(g),g.symbolCode=c.symbolCode,g.symbolFontName=c.symbolFontName,g.customMarker=c.customMarker,g.characterFormat=new k(g),this.parseCharacterFormat(c.characterFormat,g.characterFormat,n),this.applyCharacterStyle(c,g),this.parseBody(c.blocks,g.blocks,void 0,!1),r.children.push(g);for(var u=0;u<g.blocks.length;u++)g.blocks[u].footNoteReference=g;a=!0}else if(c.hasOwnProperty("chartType")){this.documentHelper.owner.editor&&(this.documentHelper.owner.editor.chartType=!0);var m=new tt;m.title=c.chartTitle,m.type=c.chartType,m.chartGapWidth=c.gapWidth,m.chartOverlap=c.overlap,this.parseChartTitleArea(c.chartTitleArea,m.chartTitleArea),this.parseChartArea(c.chartArea,m.chartArea),this.parseChartArea(c.plotArea,m.chartPlotArea),this.parseChartLegend(c.chartLegend,m.chartLegend),this.parseChartData(c,m),this.parseChartCategoryAxis(c.chartPrimaryCategoryAxis,m.chartPrimaryCategoryAxis),this.parseChartCategoryAxis(c.chartPrimaryValueAxis,m.chartPrimaryValueAxis),null!=c.chartDataTable&&this.parseChartDataTable(c.chartDataTable,m.chartDataTable),m.line=r,r.children.push(m),m.height=L.convertPointToPixel(c.height),m.width=L.convertPointToPixel(c.width);var f=new h.ChartComponent;f.chartRender(c),m.officeChart=f,f.chart.appendTo(m.targetElement),a=!0}else if(c.hasOwnProperty("imageString")){var v=new Ze(e[d].isInlineImage);v.isMetaFile=e[d].isMetaFile,v.isCompressed=e[d].isCompressed,v.metaFileImageString=e[d].metaFileImageString,v.characterFormat=new k(v),v.line=r,this.checkAndApplyRevision(c,v),r.children.push(v);var y=L.formatClippedString(c.imageString).formatClippedString,b=this.validateImageUrl(y);v.imageString=b?c.imageString:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAgVBMVEX///8AAADgAADY2Njl5eVcXFxjY2NZWVl/f3+wsLCmpqb4+PiioqKpqam7u7vV1dX2uLj2wsLhFRXzpKT3vb30sbHhCwv74+P40dH+9vbkIyO2trbBwcHLy8tsbGycnJz529v4zMzrbGzlLS3qZmblNzfrdXXoRkbvi4vvgYHlHh7CZsBOAAADpUlEQVR4nO3da1faQBSF4ekAUQlUEFs14AXxVv7/D6yaQiZx5mSEYXF2ut+PNKzyyK5diYDmR9czx34AB49C/CjE759w3jvvWr15Tdgz3atXE54f++EcIArxoxA/CvGjED8K8aMQPwrxoxA/CvGLEeZ9jPJdhfk4GyCUjb3ECGE/Q6m/q3DwfudjP0ERZYN9hKdn2hvd3+0jHJz5/kBVuTk96bbQUEjhYR9ckiikUH8UUqg/CinUH4UU6o9CCvVHIYX6o5BC/VFIof4opFB/FFKoPwop1B+FFOqPQgrjyxfjVC38Lxk9tnAxGqZqdKtSOE4GHA5/fuNJpDCtcNHbv4VqYYqPLjgfUViPQgrjozA2CptRSGF8/59w+Wrt+rr1btNna1cPzg0wwuXavncxabnX7PfHYYXzlYARvlobQZyUR9mXm+1NMEK7SSLONgcVV9vb8IQXv4J3KSeKKlxXxNCzONkeYp8AV3p9UT1+P3FWHVAsq5thhGZSEb1DrSZq7dS5HUdoLiuBZ6jORG3tCwAkNJfCUJ2Jrqe1P0ESCkMNTdSACYNDDU7UoAkDQw1P1MAJvUMVJmrwhJ6hShM1gMIvQxUnahCFjaHKEzWQQneoxR95ogZTWBuqPFEDKnSHKk/UoArdoYoTNbDC5lBDEzW4QjMpYiZqgIXG/S76JhwHK5zVVipcnkIVuv/RW/HyFKhwYhuFr6NiCmdNoDBUSGFjovJQEYXuRN9ahwoorJ8uSZenPsMTNk+X2q6jwgm/ntHL11HhhL4zenmoYEL/Gb04VCxh6KKTNFQoYfiikzBUJKF00Sk8VCChfF00OFQcYdt10dBQYYRT5xn0n9G7Q0X8GfCzNNEyZ6iPgD/HlydaVg11DfhajJaJlm2HugIUrlomWrYZKuJKHz6vHhbSM/hROdRnxNe1meuXYvW0DB6+aflYrB7dlzDiCM3N1dVN6GDhMCDhjlHYjEIK46MwNgqbUUhhfJ/vA07wO8N1vw94ONo/3e/lTpVOYfc/UyG//ZmqW52fi/FuTNW3/lZ+eguF+qOQQv1RSKH+KKRQfxRSqD8KKdQfhRTqj0IK9UchhfqjkEL9UUih/iikUH8UUqg/CmXh6Hsv3jlK+wnvD/vgkrSHMMuyu1P9ZdmuwnycDQYn+svG3n9KEUKT9zHyf6+IEWJHIX4U4kchfhTiRyF+FOJHIX4U4kchfnVhijeZa6sunCf4ZdPamteEHY5C/CjEr/vCv0ec0g+AtS1QAAAAAElFTkSuQmCC",v.width=L.convertPointToPixel(c.width),v.height=L.convertPointToPixel(c.height),v.top=c.top,v.left=c.left,v.bottom=c.bottom,v.right=c.right,v.cropHeightScale=c.getimageheight,v.cropWidthScale=c.getimagewidth,v.name=c.name,v.alternativeText=c.alternativeText,v.title=c.title,v.visible=c.visible,v.widthScale=c.widthScale,v.heightScale=c.heightScale,v.verticalPosition=L.convertPointToPixel(c.verticalPosition),v.verticalOrigin=c.verticalOrigin,v.verticalAlignment=c.verticalAlignment,v.horizontalPosition=L.convertPointToPixel(c.horizontalPosition),v.horizontalOrigin=c.horizontalOrigin,v.horizontalAlignment=c.horizontalAlignment,v.allowOverlap=c.allowOverlap,v.textWrappingStyle=t.isNullOrUndefined(c.textWrappingStyle)?"Inline":c.textWrappingStyle,v.textWrappingType=c.textWrappingType,v.zOrderPosition=c.zOrderPosition,v.layoutInCell=c.layoutInCell,"Inline"!==v.textWrappingStyle&&i.floatingElements.push(v),this.parseCharacterFormat(c.characterFormat,v.characterFormat),a=!0}else if(c.hasOwnProperty("hasFieldEnd")||c.hasOwnProperty("fieldType")&&0===c.fieldType){var w=new Ie(0);if(this.parseCharacterFormat(c.characterFormat,w.characterFormat,n),this.applyCharacterStyle(c,w),w.fieldCodeType=c.fieldCodeType,w.hasFieldEnd=c.hasFieldEnd,c.hasOwnProperty("formFieldData")){var C=void 0;c.formFieldData.hasOwnProperty("textInput")?((C=new Ee).type=c.formFieldData.textInput.type,C.maxLength=c.formFieldData.textInput.maxLength,C.defaultValue=c.formFieldData.textInput.defaultValue,C.format=c.formFieldData.textInput.format):c.formFieldData.hasOwnProperty("checkBox")?((C=new He).sizeType=c.formFieldData.checkBox.sizeType,C.size=c.formFieldData.checkBox.size,C.defaultValue=c.formFieldData.checkBox.defaultValue,C.checked=c.formFieldData.checkBox.checked):((C=new We).dropdownItems=c.formFieldData.dropDownList.dropDownItems,C.selectedIndex=c.formFieldData.dropDownList.selectedIndex),C.name=c.formFieldData.name,C.enabled=c.formFieldData.enabled,C.helpText=c.formFieldData.helpText,C.statusText=c.formFieldData.statusText,w.formFieldData=C,this.documentHelper.formFields.push(w)}this.documentHelper.fieldStacks.push(w),this.checkAndApplyRevision(c,w),w.line=r,this.documentHelper.fields.push(w),r.children.push(w)}else if(c.hasOwnProperty("fieldType")){var x=void 0;if(2===c.fieldType){if(x=new Ie(2),this.fieldSeparator=x,this.documentHelper.fieldStacks.length>0&&(x.fieldBegin=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1],x.fieldBegin.fieldSeparator=x,r.children.length>=2)){var F=this.containsFieldBegin(r);!t.isNullOrUndefined(F)&&F instanceof Oe&&F.text.match("PAGE")&&(this.documentHelper.isPageField=!0)}}else 1===c.fieldType&&(x=new Ie(1),this.parseCharacterFormat(c.characterFormat,x.characterFormat,n),this.applyCharacterStyle(c,x),this.checkAndApplyRevision(c,x),this.documentHelper.fieldStacks.length>0&&(x.fieldBegin=this.documentHelper.fieldStacks[this.documentHelper.fieldStacks.length-1],x.fieldBegin.fieldEnd=x),!t.isNullOrUndefined(x.fieldBegin)&&x.fieldBegin.fieldSeparator&&(x.fieldSeparator=x.fieldBegin.fieldSeparator,x.fieldBegin.fieldSeparator.fieldEnd=x,a=!0),this.documentHelper.fieldStacks.splice(this.documentHelper.fieldStacks.length-1,1),this.fieldSeparator=void 0,this.documentHelper.isPageField=!1,this.documentHelper.fieldCollection.push(x.fieldBegin));x.line=r,r.children.push(x)}else if(c.hasOwnProperty("bookmarkType")){var P=void 0;if(P=new Ae(c.bookmarkType),P.name=c.name,r.children.push(P),P.line=r,!this.isParseHeader||this.isPaste)if(0===c.bookmarkType){var T=this.isPaste&&!this.documentHelper.bookmarks.containsKey(P.name);!this.isPaste||T?this.documentHelper.bookmarks.add(P.name,P):T||r.children.splice(r.children.indexOf(P),1)}else if(1===c.bookmarkType&&this.documentHelper.bookmarks.containsKey(P.name)){var S=this.documentHelper.bookmarks.get(P.name),I=this.isPaste&&t.isNullOrUndefined(S.reference);!this.isPaste||I?(S.reference=P,P.reference=S):I||r.children.splice(r.children.indexOf(P),1)}0!==P.name.indexOf("_")&&(a=!0)}else if(c.hasOwnProperty("editRangeId")){if(c.hasOwnProperty("editableRangeStart")){var N=new $e;if(this.editableRanges.containsKey(c.editRangeId)){var E=this.editableRanges.get(c.editRangeId);N.editRangeStart=E,E.editRangeEnd=N,this.editableRanges.remove(c.editRangeId)}r.children.push(N),N.line=r}else{var H=this.parseEditableRangeStart(c);r.children.push(H),H.line=r,this.editableRanges.containsKey(c.editRangeId)||this.editableRanges.add(c.editRangeId,H)}a=!0}else if(c.hasOwnProperty("commentId")&&!this.isPaste){var W=c.commentId,O=void 0;this.commentStarts.containsKey(W)&&this.commentStarts.get(W);if(this.commentEnds.containsKey(W)&&this.commentEnds.get(W),c.hasOwnProperty("commentCharacterType")){if(0===c.commentCharacterType){var R=new vt(0);R.commentId=W,this.commentStarts.containsKey(W)||this.commentStarts.add(W,R),R.line=r,r.children.push(R),O=this.commentsCollection.get(W),t.isNullOrUndefined(O)||(O.commentStart=R,R.comment=O)}else{var B=new vt(1);B.commentId=W,this.commentEnds.containsKey(W)||this.commentEnds.add(W,B),B.line=r,r.children.push(B),O=this.commentsCollection.get(W),t.isNullOrUndefined(O)||(O.commentEnd=B,B.comment=O)}!t.isNullOrUndefined(O)&&O.isReply&&(t.isNullOrUndefined(O.ownerComment.commentStart)&&(O.ownerComment.commentStart=O.commentStart),t.isNullOrUndefined(O.ownerComment.commentEnd)&&(O.ownerComment.commentEnd=O.commentEnd))}}else if(c.hasOwnProperty("shapeId")){var D=new Ke;if(D.shapeId=c.shapeId,D.name=c.name,D.alternativeText=c.alternativeText,D.title=c.title,D.visible=c.visible,D.width=L.convertPointToPixel(c.width),D.height=L.convertPointToPixel(c.height),D.widthScale=c.widthScale,D.heightScale=c.heightScale,D.verticalPosition=L.convertPointToPixel(c.verticalPosition),D.verticalOrigin=c.verticalOrigin,D.verticalAlignment=c.verticalAlignment,D.verticalRelativePercent=c.verticalRelativePercent,D.horizontalPosition=L.convertPointToPixel(c.horizontalPosition),D.horizontalOrigin=c.horizontalOrigin,D.horizontalAlignment=c.horizontalAlignment,D.horizontalRelativePercent=c.horizontalRelativePercent,D.zOrderPosition=c.zOrderPosition,D.allowOverlap=c.allowOverlap,D.textWrappingStyle=t.isNullOrUndefined(c.textWrappingStyle)?"InFrontOfText":c.textWrappingStyle,D.textWrappingType=c.textWrappingType,D.distanceBottom=L.convertPointToPixel(c.distanceBottom),D.distanceLeft=L.convertPointToPixel(c.distanceLeft),D.distanceRight=L.convertPointToPixel(c.distanceRight),D.distanceTop=L.convertPointToPixel(c.distanceTop),D.layoutInCell=c.layoutInCell,D.lockAnchor=c.lockAnchor,D.autoShapeType=c.autoShapeType,c.hasOwnProperty("lineFormat")){var A=new Ye;A.line=c.lineFormat.line,A.lineFormatType=c.lineFormat.lineFormatType,A.color=c.lineFormat.color,A.weight=c.lineFormat.weight,A.dashStyle=c.lineFormat.lineStyle,D.lineFormat=A}if(c.hasOwnProperty("fillFormat")){var M=new Je;M.color=c.fillFormat.color,M.fill=c.fillFormat.fill,D.fillFormat=M}if(c.hasOwnProperty("textFrame")){var U=new Xe;U.textVerticalAlignment=c.textFrame.textVerticalAlignment,U.marginLeft=c.textFrame.leftMargin,U.marginRight=c.textFrame.rightMargin,U.marginTop=c.textFrame.topMargin,U.marginBottom=c.textFrame.bottomMargin,this.parseBody(c.textFrame.blocks,U.childWidgets,U),D.textFrame=U,U.containerShape=D}D.line=r,r.children.push(D),"Inline"!==D.textWrappingStyle&&i.floatingElements.push(D)}else if(c.hasOwnProperty("contentControlProperties")){var z=new Me("Inline"),V=new Me("Inline");this.parseContentControlProperties(c.contentControlProperties,z.contentControlProperties),V.contentControlProperties=z.contentControlProperties,z.line=r,V.line=r,z.type=0,V.type=1,r.children.push(z),this.parseParagraph(c.inlines,i,n,r);for(var _=r.children[r.children.length-1];!(_ instanceof Me);)_.contentControlProperties=z.contentControlProperties,_=_.previousElement;r.children.push(V),a=!0}}return this.isCutPerformed=!1,o||i.childWidgets.push(r),a},e.prototype.applyCharacterStyle=function(e,i){if(!t.isNullOrUndefined(e.characterFormat)&&!t.isNullOrUndefined(e.characterFormat.styleName)){var n=this.documentHelper.styles.findByName(e.characterFormat.styleName,"Character");i.characterFormat.applyStyle(n)}},e.prototype.parseEditableRangeStart=function(e){var i=new et;return t.isNullOrUndefined(e.columnFirst)||(i.columnFirst=e.columnFirst),t.isNullOrUndefined(e.columnLast)||(i.columnLast=e.columnLast),t.isNullOrUndefined(e.user)||(i.user=e.user,-1===this.documentHelper.userCollection.indexOf(i.user)&&this.documentHelper.userCollection.push(i.user),this.addEditRangeCollection(i.user,i)),t.isNullOrUndefined(e.group)||""===e.group||(i.group=e.group,i.group="everyone"===i.group?"Everyone":i.group,-1===this.documentHelper.userCollection.indexOf(i.group)&&this.documentHelper.userCollection.push(i.group),this.addEditRangeCollection(i.group,i)),i},e.prototype.addEditRangeCollection=function(e,t){if(this.documentHelper.editRanges.containsKey(e))this.documentHelper.editRanges.get(e).push(t);else{var i=[];i.push(t),this.documentHelper.editRanges.add(e,i)}},e.prototype.parseChartTitleArea=function(e,t){t.chartfontName=e.fontName,t.chartFontSize=e.fontSize,this.parseChartDataFormat(e.dataFormat,t.dataFormat),this.parseChartLayout(e.layout,t.layout)},e.prototype.parseChartDataFormat=function(e,t){t.fill.color=e.fill.foreColor,t.fill.rgb=e.fill.rgb,t.line.color=e.line.color,t.line.rgb=e.line.rgb},e.prototype.parseChartLayout=function(e,t){t.chartLayoutLeft=e.layoutX,t.chartLayoutTop=e.layoutY},e.prototype.parseChartLegend=function(e,t){t.chartLegendPostion=e.position,this.parseChartTitleArea(e.chartTitleArea,t.chartTitleArea)},e.prototype.parseChartCategoryAxis=function(e,t){t.categoryAxisType=e.categoryType,t.categoryNumberFormat=e.numberFormat,t.interval=e.majorUnit,t.axisFontSize=e.fontSize,t.axisFontName=e.fontName,t.max=e.maximumValue,t.min=e.minimumValue,t.majorGridLines=e.hasMajorGridLines,t.minorGridLines=e.hasMinorGridLines,t.majorTick=e.majorTickMark,t.minorTick=e.minorTickMark,t.tickPosition=e.tickLabelPosition,t.categoryAxisTitle=e.chartTitle,null!=e.chartTitle&&this.parseChartTitleArea(e.chartTitleArea,t.chartTitleArea)},e.prototype.parseChartDataTable=function(e,t){t.showSeriesKeys=e.showSeriesKeys,t.hasHorzBorder=e.hasHorzBorder,t.hasVertBorder=e.hasVertBorder,t.hasBorders=e.hasBorders},e.prototype.parseChartArea=function(e,t){t.chartForeColor=e.foreColor},e.prototype.parseChartData=function(e,t){for(var i=0;i<e.chartCategory.length;i++){var n=new nt,r=e.chartCategory[i];r.hasOwnProperty("categoryXName")&&(n.xName=r.categoryXName);for(var o=0;o<r.chartData.length;o++){var s=new rt,a=r.chartData[o];s.yAxisValue=a.yValue,"Bubble"===e.chartType&&(s.bubbleSize=a.size),n.chartData.push(s)}t.chartCategory.push(n)}this.parseChartSeries(e,t)},e.prototype.parseChartSeries=function(e,t){for(var i=e.chartType,n="Pie"===i||"Doughnut"===i,r=0;r<e.chartSeries.length;r++){var o=new st,s=e.chartSeries[r];if(s.hasOwnProperty("seriesName")){if(o.seriesName=s.seriesName,n&&(s.hasOwnProperty("firstSliceAngle")&&(o.firstSliceAngle=s.firstSliceAngle),"Doughnut"===i&&(o.doughnutHoleSize=s.holeSize)),s.hasOwnProperty("dataLabel")&&this.parseChartDataLabels(s.dataLabel,o),s.hasOwnProperty("seriesFormat")){var a=new lt,l=s.seriesFormat;a.markerStyle=l.markerStyle,a.markerColor=l.markerColor,a.numberValue=l.markerSize,o.seriesFormat=a}if(s.hasOwnProperty("errorBar")){var d=o.errorBar;d.errorType=s.errorBar.type,d.errorDirection=s.errorBar.direction,d.errorEndStyle=s.errorBar.endStyle,d.numberValue=s.errorBar.numberValue}s.hasOwnProperty("trendLines")&&this.parseChartTrendLines(s.trendLines,o),this.parseChartSeriesDataPoints(s.dataPoints,o)}t.chartSeries.push(o)}},e.prototype.parseChartDataLabels=function(e,t){var i=new dt;i.labelPosition=e.position,i.fontName=e.fontName,i.fontColor=e.fontColor,i.fontSize=e.fontSize,i.isLegendKey=e.isLegendKey,i.isBubbleSize=e.isBubbleSize,i.isCategoryName=e.isCategoryName,i.isSeriesName=e.isSeriesName,i.isValue=e.isValue,i.isPercentage=e.isPercentage,i.isLeaderLines=e.isLeaderLines,t.dataLabels=i},e.prototype.parseChartSeriesDataPoints=function(e,t){for(var i=0;i<e.length;i++){var n=new pt;this.parseChartDataFormat(e[i],n),t.chartDataFormat.push(n)}},e.prototype.parseChartTrendLines=function(e,t){for(var i=0;i<e.length;i++){var n=e[i],r=new ht;r.trendLineName=n.name,r.trendLineType=n.type,r.forwardValue=n.forward,r.backwardValue=n.backward,r.interceptValue=n.intercept,r.isDisplayEquation=n.isDisplayEquation,r.isDisplayRSquared=n.isDisplayRSquared,t.trendLines.push(r)}},e.prototype.parseTableFormat=function(e,i){this.parseBorders(e.borders,i.borders),t.isNullOrUndefined(e.allowAutoFit)||(i.allowAutoFit=e.allowAutoFit),t.isNullOrUndefined(e.cellSpacing)||(i.cellSpacing=e.cellSpacing),t.isNullOrUndefined(e.leftMargin)||(i.leftMargin=e.leftMargin),t.isNullOrUndefined(e.topMargin)||(i.topMargin=e.topMargin),t.isNullOrUndefined(e.rightMargin)||(i.rightMargin=e.rightMargin),t.isNullOrUndefined(e.bottomMargin)||(i.bottomMargin=e.bottomMargin),t.isNullOrUndefined(e.leftIndent)||(i.leftIndent=e.leftIndent),this.parseShading(e.shading,i.shading),t.isNullOrUndefined(e.tableAlignment)||(i.tableAlignment=e.tableAlignment),t.isNullOrUndefined(e.preferredWidth)||(i.preferredWidth=e.preferredWidth),t.isNullOrUndefined(e.preferredWidthType)||(i.preferredWidthType=e.preferredWidthType),t.isNullOrUndefined(e.bidi)||(i.bidi=e.bidi),t.isNullOrUndefined(e.horizontalPositionAbs)||(i.horizontalPositionAbs=e.horizontalPositionAbs),t.isNullOrUndefined(e.horizontalPosition)||(i.horizontalPosition=e.horizontalPosition)},e.prototype.parseCellFormat=function(e,i){t.isNullOrUndefined(e)||(this.parseBorders(e.borders,i.borders),e.isSamePaddingAsTable||this.parseCellMargin(e,i),t.isNullOrUndefined(e.cellWidth)||(i.cellWidth=e.cellWidth),t.isNullOrUndefined(e.columnSpan)||(i.columnSpan=e.columnSpan),t.isNullOrUndefined(e.rowSpan)||(i.rowSpan=e.rowSpan),this.parseShading(e.shading,i.shading),t.isNullOrUndefined(e.verticalAlignment)||(i.verticalAlignment=e.verticalAlignment),t.isNullOrUndefined(e.preferredWidthType)||(i.preferredWidthType=e.preferredWidthType),t.isNullOrUndefined(e.preferredWidth)||(i.preferredWidth=e.preferredWidth))},e.prototype.parseCellMargin=function(e,i){t.isNullOrUndefined(e.leftMargin)||(i.leftMargin=e.leftMargin),t.isNullOrUndefined(e.rightMargin)||(i.rightMargin=e.rightMargin),t.isNullOrUndefined(e.topMargin)||(i.topMargin=e.topMargin),t.isNullOrUndefined(e.bottomMargin)||(i.bottomMargin=e.bottomMargin)},e.prototype.parseRowFormat=function(e,i){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.allowBreakAcrossPages)||(i.allowBreakAcrossPages=e.allowBreakAcrossPages),t.isNullOrUndefined(e.isHeader)||(i.isHeader=e.isHeader),t.isNullOrUndefined(e.heightType)||(i.heightType=e.heightType),t.isNullOrUndefined(e.height)||(i.height=e.height),t.isNullOrUndefined(e.leftMargin)||(i.leftMargin=e.leftMargin),t.isNullOrUndefined(e.topMargin)||(i.topMargin=e.topMargin),t.isNullOrUndefined(e.rightMargin)||(i.rightMargin=e.rightMargin),t.isNullOrUndefined(e.bottomMargin)||(i.bottomMargin=e.bottomMargin),t.isNullOrUndefined(e.leftIndent)||(i.leftIndent=e.leftIndent),!t.isNullOrUndefined(e.revisionIds)&&e.revisionIds.length>0&&this.checkAndApplyRevision(e,i),this.parseBorders(e.borders,i.borders))},e.prototype.parseBorders=function(e,i){t.isNullOrUndefined(e)||(this.parseBorder(e.left,i.left),this.parseBorder(e.right,i.right),this.parseBorder(e.top,i.top),this.parseBorder(e.bottom,i.bottom),this.parseBorder(e.vertical,i.vertical),this.parseBorder(e.horizontal,i.horizontal),this.parseBorder(e.diagonalDown,i.diagonalDown),this.parseBorder(e.diagonalUp,i.diagonalUp))},e.prototype.parseBorder=function(e,i){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.color)||(i.color=this.getColor(e.color)),t.isNullOrUndefined(e.lineStyle)||(i.lineStyle=e.lineStyle),t.isNullOrUndefined(e.lineWidth)||(i.lineWidth=e.lineWidth),t.isNullOrUndefined(e.hasNoneStyle)||(i.hasNoneStyle=e.hasNoneStyle))},e.prototype.parseShading=function(e,i){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.backgroundColor)||(i.backgroundColor=this.getColor(e.backgroundColor)),t.isNullOrUndefined(e.foregroundColor)||(i.foregroundColor=this.getColor(e.foregroundColor)),t.isNullOrUndefined(e.texture)&&t.isNullOrUndefined(e.textureStyle)||(i.textureStyle=t.isNullOrUndefined(e.texture)?e.textureStyle:e.texture))},e.prototype.parseCharacterFormat=function(e,i,n){if(!t.isNullOrUndefined(e)){if(n&&e.hasOwnProperty("inlineFormat"))return void this.parseCharacterFormat(e.inlineFormat,i);if(t.isNullOrUndefined(e.baselineAlignment)||(i.baselineAlignment=e.baselineAlignment),t.isNullOrUndefined(e.underline)||(i.underline=e.underline),t.isNullOrUndefined(e.strikethrough)||(i.strikethrough=e.strikethrough),!t.isNullOrUndefined(e.fontSize)){e.fontSize=parseFloat(e.fontSize);var r=10*e.fontSize;r%10!=0&&(r=10*e.fontSize.toFixed(1),e.fontSize=r%5==0?e.fontSize.toFixed(1):Math.round(e.fontSize));var o=parseFloat(e.fontSize);i.fontSize=o<0?0:o}t.isNullOrUndefined(e.fontFamily)||(-1!==e.fontFamily.indexOf('"')&&(e.fontFamily=e.fontFamily.replace('"',"")),i.fontFamily=e.fontFamily),t.isNullOrUndefined(e.bold)||(i.bold=e.bold),t.isNullOrUndefined(e.italic)||(i.italic=e.italic),t.isNullOrUndefined(e.highlightColor)||(i.highlightColor=e.highlightColor),t.isNullOrUndefined(e.fontColor)||(i.fontColor=this.getColor(e.fontColor)),t.isNullOrUndefined(e.bidi)||(i.bidi=e.bidi),t.isNullOrUndefined(e.bdo)||(i.bdo=e.bdo),t.isNullOrUndefined(e.fontSizeBidi)||(i.fontSizeBidi=e.fontSizeBidi<0?0:e.fontSizeBidi),t.isNullOrUndefined(e.fontFamilyBidi)||(i.fontFamilyBidi=e.fontFamilyBidi),t.isNullOrUndefined(e.boldBidi)||(i.boldBidi=e.boldBidi),t.isNullOrUndefined(e.italicBidi)||(i.italicBidi=e.italicBidi),!t.isNullOrUndefined(e.revisionIds)&&e.revisionIds.length>0&&this.checkAndApplyRevision(e,i),t.isNullOrUndefined(e.allCaps)||(i.allCaps=e.allCaps)}},e.prototype.getColor=function(e){return e||"#ffffff"},e.prototype.parseParagraphFormat=function(e,i){t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.bidi)||(i.bidi=e.bidi),t.isNullOrUndefined(e.leftIndent)||(i.leftIndent=e.leftIndent),t.isNullOrUndefined(e.rightIndent)||(i.rightIndent=e.rightIndent),t.isNullOrUndefined(e.firstLineIndent)||(i.firstLineIndent=e.firstLineIndent),t.isNullOrUndefined(e.afterSpacing)||(i.afterSpacing=e.afterSpacing),t.isNullOrUndefined(e.beforeSpacing)||(i.beforeSpacing=e.beforeSpacing),t.isNullOrUndefined(e.lineSpacing)||(i.lineSpacing=e.lineSpacing),t.isNullOrUndefined(e.lineSpacingType)?t.isNullOrUndefined(e.lineSpacing)||(i.lineSpacingType="Multiple"):i.lineSpacingType=e.lineSpacingType,t.isNullOrUndefined(e.textAlignment)||(i.textAlignment=e.textAlignment),t.isNullOrUndefined(e.outlineLevel)||(i.outlineLevel=e.outlineLevel),t.isNullOrUndefined(e.contextualSpacing)||(i.contextualSpacing=e.contextualSpacing),i.listFormat=new T,e.hasOwnProperty("listFormat")&&this.parseListFormat(e,i.listFormat),e.hasOwnProperty("tabs")&&this.parseTabStop(e.tabs,i.tabs))},e.prototype.parseListFormat=function(e,i){t.isNullOrUndefined(e.listFormat)||(t.isNullOrUndefined(e.listFormat.listId)||(i.listId=e.listFormat.listId,i.list=this.documentHelper.getListById(e.listFormat.listId)),t.isNullOrUndefined(e.listFormat.listLevelNumber)||(i.listLevelNumber=e.listFormat.listLevelNumber))},e.prototype.parseSectionFormat=function(e,i){t.isNullOrUndefined(e.pageWidth)||(i.pageWidth=e.pageWidth),t.isNullOrUndefined(e.pageHeight)||(i.pageHeight=e.pageHeight),t.isNullOrUndefined(e.leftMargin)||(i.leftMargin=e.leftMargin),t.isNullOrUndefined(e.topMargin)||(i.topMargin=e.topMargin),t.isNullOrUndefined(e.rightMargin)||(i.rightMargin=e.rightMargin),t.isNullOrUndefined(e.bottomMargin)||(i.bottomMargin=e.bottomMargin),t.isNullOrUndefined(e.headerDistance)||(i.headerDistance=e.headerDistance),t.isNullOrUndefined(e.footerDistance)||(i.footerDistance=e.footerDistance),t.isNullOrUndefined(e.differentFirstPage)||(i.differentFirstPage=e.differentFirstPage),t.isNullOrUndefined(e.differentOddAndEvenPages)||(i.differentOddAndEvenPages=e.differentOddAndEvenPages),t.isNullOrUndefined(e.bidi)||(i.bidi=e.bidi),t.isNullOrUndefined(e.restartPageNumbering)||(i.restartPageNumbering=e.restartPageNumbering),t.isNullOrUndefined(e.pageStartingNumber)||(i.pageStartingNumber=e.pageStartingNumber),t.isNullOrUndefined(e.endnoteNumberFormat)||(i.endnoteNumberFormat=e.endnoteNumberFormat),t.isNullOrUndefined(e.footNoteNumberFormat)||(i.footNoteNumberFormat=e.footNoteNumberFormat),t.isNullOrUndefined(e.restartIndexForFootnotes)||(i.restartIndexForFootnotes=e.restartIndexForFootnotes),t.isNullOrUndefined(e.pageStartingNumber)||(i.restartIndexForEndnotes=e.restartIndexForEndnotes),t.isNullOrUndefined(e.initialFootNoteNumber)||(i.initialFootNoteNumber=e.initialFootNoteNumber),t.isNullOrUndefined(e.initialEndNoteNumber)||(i.initialEndNoteNumber=e.initialEndNoteNumber)},e.prototype.parseTabStop=function(e,t){if(e)for(var i=0;i<e.length;i++){var n=new S;n.position=e[i].position,n.tabLeader=e[i].tabLeader,n.deletePosition=e[i].deletePosition,n.tabJustification=e[i].tabJustification,t.push(n)}},e.prototype.validateImageUrl=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;return e.charAt(e.length-1)===t.charAt(64)&&i--,e.charAt(e.length-2)===t.charAt(64)&&i--,i%1==0},e.prototype.containsFieldBegin=function(e){for(var t=void 0,i=e.children.length-1;i>=0;i--){if((t=e.children[i])instanceof Ie&&t.hasFieldEnd&&t.nextElement instanceof Oe)return t.nextElement;if(t instanceof Ie)return}return t},e}(),Tt=function(){function e(e){this.boldIn=void 0,this.italicIn=void 0,this.underlineIn=void 0,this.strikeThroughIn=void 0,this.baselineAlignmentIn=void 0,this.highlightColorIn=void 0,this.fontSizeIn=0,this.fontColorIn=void 0,this.allCapsIn=void 0,this.boldBidi=void 0,this.italicBidi=void 0,this.fontSizeBidi=0,this.bidi=void 0,this.bdo=void 0,this.selection=e}return Object.defineProperty(e.prototype,"fontSize",{get:function(){return this.fontSizeIn},set:function(e){e!==this.fontSizeIn&&(this.fontSizeIn=e,this.notifyPropertyChanged("fontSize"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontFamily",{get:function(){return this.fontFamilyIn},set:function(e){e!==this.fontFamilyIn&&(this.fontFamilyIn=e,this.notifyPropertyChanged("fontFamily"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fontColor",{get:function(){return this.fontColorIn},set:function(e){e!==this.fontColorIn&&(this.fontColorIn=e,this.notifyPropertyChanged("fontColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bold",{get:function(){return this.boldIn},set:function(e){e!==this.boldIn&&(this.boldIn=e,this.notifyPropertyChanged("bold"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"italic",{get:function(){return this.italicIn},set:function(e){e!==this.italic&&(this.italicIn=e,this.notifyPropertyChanged("italic"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strikethrough",{get:function(){return this.strikeThroughIn},set:function(e){e!==this.strikeThroughIn&&(this.strikeThroughIn=e,this.notifyPropertyChanged("strikethrough"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"baselineAlignment",{get:function(){return this.baselineAlignmentIn},set:function(e){e!==this.baselineAlignmentIn&&(this.baselineAlignmentIn=e,this.notifyPropertyChanged("baselineAlignment"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{get:function(){return this.underlineIn},set:function(e){e!==this.underlineIn&&(this.underlineIn=e,this.notifyPropertyChanged("underline"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"highlightColor",{get:function(){return this.highlightColorIn},set:function(e){e===this.highlightColorIn&&"NoColor"!==e||(this.highlightColorIn=e,this.notifyPropertyChanged("highlightColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allCaps",{get:function(){return this.allCapsIn},set:function(e){e!==this.allCapsIn&&(this.allCapsIn=e,this.notifyPropertyChanged("allCaps"))},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(e){switch(e){case"bold":return this.bold;case"italic":return this.italic;case"fontSize":if(this.fontSize>=1)return this.fontSize;return;case"fontFamily":return this.fontFamily;case"strikethrough":return this.strikethrough;case"baselineAlignment":return this.baselineAlignment;case"highlightColor":return this.highlightColor;case"underline":return this.underline;case"fontColor":return this.fontColor;case"allCaps":return this.allCaps;default:return}},e.prototype.notifyPropertyChanged=function(e){if((t.isNullOrUndefined(this.selection)||!(this.selection.isCleared||this.selection.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||!this.selection.owner.isDocumentLoaded||this.selection.owner.isPastingContent)||this.selection.isRetrieveFormatting)&&!t.isNullOrUndefined(this.selection)&&!t.isNullOrUndefined(this.selection.start)&&!this.selection.isRetrieveFormatting){var i=this.getPropertyValue(e);t.isNullOrUndefined(i)||this.selection.owner.editorModule.onApplyCharacterFormat(e,i)}},e.prototype.copyFormat=function(e){this.styleName=t.isNullOrUndefined(e.baseCharStyle)?"Default Paragraph Font":e.baseCharStyle.name,this.fontSize=e.fontSize,this.fontFamily=e.fontFamily,this.bold=e.bold,this.italic=e.italic,this.baselineAlignment=e.baselineAlignment,this.underline=e.underline,this.fontColor=e.fontColor,this.highlightColor=e.highlightColor,this.strikethrough=e.strikethrough,this.bidi=e.bidi,this.bdo=e.bdo,this.boldBidi=e.boldBidi,this.italicBidi=e.italicBidi,this.fontFamilyBidi=e.fontFamilyBidi,this.fontSizeBidi=e.fontSizeBidi,this.allCaps=e.allCaps},e.prototype.combineFormat=function(e){t.isNullOrUndefined(this.bold)||this.bold===e.bold||(this.bold=void 0),t.isNullOrUndefined(this.italic)||this.italic===e.italic||(this.italic=void 0),0!==this.fontSize&&this.fontSize!==e.fontSize&&(this.fontSize=0),t.isNullOrUndefined(this.fontFamily)||this.fontFamily===e.fontFamily||(this.fontFamily=void 0),t.isNullOrUndefined(this.highlightColor)||this.highlightColor===e.highlightColor||(this.highlightColor=void 0),t.isNullOrUndefined(this.baselineAlignment)||this.baselineAlignment===e.baselineAlignment||(this.baselineAlignment=void 0),t.isNullOrUndefined(this.fontColor)||this.fontColor===e.fontColor||(this.fontColor=void 0),t.isNullOrUndefined(this.underline)||this.underline===e.underline||(this.underline=void 0),t.isNullOrUndefined(this.strikethrough)||this.strikethrough===e.strikethrough||(this.strikethrough=void 0),t.isNullOrUndefined(this.boldBidi)||this.boldBidi===e.boldBidi||(this.boldBidi=void 0),t.isNullOrUndefined(this.italicBidi)||this.italicBidi===e.italicBidi||(this.italicBidi=void 0),0!==this.fontSizeBidi&&this.fontSizeBidi!==e.fontSizeBidi&&(this.fontSizeBidi=0),t.isNullOrUndefined(this.fontFamilyBidi)||this.fontFamilyBidi===e.fontFamilyBidi||(this.fontFamilyBidi=void 0),t.isNullOrUndefined(this.bidi)||this.bidi===e.bidi||(this.bidi=void 0),t.isNullOrUndefined(this.bdo)||this.bdo===e.bdo||(this.bdo=void 0),t.isNullOrUndefined(this.allCaps)||this.allCaps===e.allCaps||(this.allCaps=void 0)},e.prototype.cloneFormat=function(e){this.bold=e.bold,this.italic=e.italic,this.underline=e.underline,this.strikethrough=e.strikethrough,this.baselineAlignment=e.baselineAlignment,this.highlightColor=e.highlightColor,this.fontSize=e.fontSize,this.fontFamily=e.fontFamily,this.fontColor=e.fontColor,this.styleName=e.styleName,this.bidi=e.bidi,this.bdo=e.bdo,this.boldBidi=e.boldBidi,this.italicBidi=e.italicBidi,this.fontSizeBidi=e.fontSizeBidi,this.fontFamilyBidi=e.fontFamilyBidi,this.allCaps=e.allCaps},e.prototype.isEqualFormat=function(e){return this.fontSize===e.fontSize&&this.strikethrough===e.strikethrough&&this.bold===e.bold&&this.fontFamily===e.fontFamily&&this.underline===e.underline&&this.highlightColor===e.highlightColor&&this.italic===e.italic&&this.baselineAlignment===e.baselineAlignment&&this.fontColor===e.fontColor&&this.allCaps===e.allCaps},e.prototype.clearFormat=function(){this.fontSizeIn=0,this.boldIn=void 0,this.italicIn=void 0,this.fontFamilyIn=void 0,this.fontColorIn=void 0,this.underlineIn=void 0,this.strikeThroughIn=void 0,this.highlightColorIn=void 0,this.baselineAlignmentIn=void 0,this.styleName=void 0,this.bidi=void 0,this.bdo=void 0,this.boldBidi=void 0,this.italicBidi=void 0,this.fontFamilyBidi=void 0,this.fontSizeBidi=void 0,this.allCapsIn=void 0},e.prototype.destroy=function(){this.fontSizeIn=void 0,this.boldIn=void 0,this.italicIn=void 0,this.fontFamilyIn=void 0,this.fontColorIn=void 0,this.underlineIn=void 0,this.strikeThroughIn=void 0,this.baselineAlignmentIn=void 0,this.highlightColorIn=void 0,this.selection=void 0,this.styleName=void 0,this.bidi=void 0,this.bdo=void 0,this.boldBidi=void 0,this.italicBidi=void 0,this.fontFamilyBidi=void 0,this.fontSizeBidi=void 0,this.allCapsIn=void 0},e}(),St=function(){function e(e,t){this.leftIndentIn=0,this.rightIndentIn=0,this.beforeSpacingIn=0,this.afterSpacingIn=0,this.textAlignmentIn=void 0,this.firstLineIndentIn=0,this.lineSpacingIn=1,this.lineSpacingTypeIn=void 0,this.bidiIn=void 0,this.contextualSpacingIn=void 0,this.listLevelNumberIn=-1,this.selection=e,this.documentHelper=t}return Object.defineProperty(e.prototype,"leftIndent",{get:function(){return this.leftIndentIn},set:function(e){e!==this.leftIndentIn&&(this.leftIndentIn=e,this.notifyPropertyChanged("leftIndent"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightIndent",{get:function(){return this.rightIndentIn},set:function(e){e!==this.rightIndentIn&&(this.rightIndentIn=e,this.notifyPropertyChanged("rightIndent"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstLineIndent",{get:function(){return this.firstLineIndentIn},set:function(e){e!==this.firstLineIndentIn&&(this.firstLineIndentIn=e,this.notifyPropertyChanged("firstLineIndent"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textAlignment",{get:function(){return this.textAlignmentIn},set:function(e){e!==this.textAlignmentIn&&(this.textAlignmentIn=e,this.notifyPropertyChanged("textAlignment"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"afterSpacing",{get:function(){return this.afterSpacingIn},set:function(e){e!==this.afterSpacingIn&&(this.afterSpacingIn=e,this.notifyPropertyChanged("afterSpacing"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"beforeSpacing",{get:function(){return this.beforeSpacingIn},set:function(e){e!==this.beforeSpacingIn&&(this.beforeSpacingIn=e,this.notifyPropertyChanged("beforeSpacing"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacing",{get:function(){return this.lineSpacingIn},set:function(e){e!==this.lineSpacingIn&&(this.lineSpacingIn=e,this.notifyPropertyChanged("lineSpacing"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineSpacingType",{get:function(){return this.lineSpacingTypeIn},set:function(e){e!==this.lineSpacingTypeIn&&(this.lineSpacingTypeIn=e,this.notifyPropertyChanged("lineSpacingType"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listLevelNumber",{get:function(){return this.listLevelNumberIn},set:function(e){e!==this.listLevelNumberIn&&(this.listLevelNumberIn=e,this.notifyPropertyChanged("listLevelNumber"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bidi",{get:function(){return this.bidiIn},set:function(e){this.bidiIn=e,this.notifyPropertyChanged("bidi")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contextualSpacing",{get:function(){return this.contextualSpacingIn},set:function(e){this.contextualSpacingIn=e,this.notifyPropertyChanged("contextualSpacing")},enumerable:!0,configurable:!0}),e.prototype.validateLineSpacing=function(){return"Multiple"!==this.lineSpacingType&&this.lineSpacingIn<12},Object.defineProperty(e.prototype,"listText",{get:function(){var e=void 0,t=this.documentHelper.getListById(this.listId);if(t instanceof P&&this.listLevelNumberIn>-1&&this.listLevelNumberIn<9){var i=t.getListLevel(this.listLevelNumber);if(i instanceof K)if("Bullet"===i.listLevelPattern)e=i.numberFormat;else{e=i.numberFormat;for(var n=0;n<9;n++){var r="%"+(n+1);if(e.indexOf(r)>-1){n===this.listLevelNumberIn||t.getListLevel(n);var o=this.selection.getListTextElementBox(this.selection.start.paragraph);e=o?o.text:""}}}}return e},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(e){switch(e){case"leftIndent":return this.leftIndent;case"rightIndent":return this.rightIndent;case"firstLineIndent":return this.firstLineIndent;case"beforeSpacing":return this.beforeSpacing;case"afterSpacing":return this.afterSpacing;case"textAlignment":return this.textAlignment;case"lineSpacing":return this.lineSpacing;case"lineSpacingType":return this.lineSpacingType;case"bidi":return this.bidi;case"contextualSpacing":return this.contextualSpacing;default:return}},e.prototype.notifyPropertyChanged=function(e){if((t.isNullOrUndefined(this.selection)||(!this.selection.owner.isReadOnlyMode||this.selection.isInlineFormFillMode())&&this.selection.owner.isDocumentLoaded||this.selection.isRetrieveFormatting)&&!t.isNullOrUndefined(this.selection)&&!t.isNullOrUndefined(this.selection.start)&&!this.selection.isRetrieveFormatting){var i=this.selection.owner.editorModule;if("lineSpacing"===e||"lineSpacingType"===e){var n=this.selection.owner.editorHistory;if((!n||!n.isUndoing&&!n.isRedoing)&&this.validateLineSpacing()){if(this.selection.owner.editorHistory.initComplexHistory(this.selection,"LineSpacing"),"lineSpacing"===e){this.lineSpacingTypeIn="Multiple";var r=this.getPropertyValue("lineSpacingType");i.onApplyParagraphFormat("lineSpacingType",r,!1,!1),i.onApplyParagraphFormat(e,this.getPropertyValue(e),!1,!1)}else i.onApplyParagraphFormat(e,this.getPropertyValue(e),!1,!1),this.lineSpacingIn=12,i.onApplyParagraphFormat("lineSpacing",this.getPropertyValue("lineSpacing"),!1,!1);return void this.selection.owner.editorHistory.updateComplexHistory()}}var o=this.getPropertyValue(e);if(!("leftIndent"!==e&&"rightIndent"!==e&&"firstLineIndent"!==e||o>=-1056&&o<1056))return;"listLevelNumber"===e?i.onApplyListInternal(this.documentHelper.getListById(this.listId),this.listLevelNumber):i.onApplyParagraphFormat(e,o,"textAlignment"===e,!1)}},e.prototype.copyFormat=function(e){this.styleName=t.isNullOrUndefined(e.baseStyle)?"Normal":e.baseStyle.name,this.leftIndent=e.leftIndent,this.rightIndent=e.rightIndent,this.firstLineIndent=e.firstLineIndent,this.afterSpacing=e.afterSpacing,this.beforeSpacing=e.beforeSpacing,this.lineSpacing=e.lineSpacing,this.lineSpacingType=e.lineSpacingType,this.textAlignment=e.textAlignment,this.bidi=e.bidi,this.contextualSpacing=e.contextualSpacing,t.isNullOrUndefined(e.listFormat)||t.isNullOrUndefined(e.listFormat.listId)?(this.listId=void 0,this.listLevelNumber=0):(this.listId=e.listFormat.listId,this.listLevelNumber=e.listFormat.listLevelNumber)},e.prototype.copyToFormat=function(e){t.isNullOrUndefined(e)||(t.isNullOrUndefined(this.afterSpacing)||(e.afterSpacing=this.afterSpacing),t.isNullOrUndefined(this.beforeSpacing)||(e.beforeSpacing=this.beforeSpacing),t.isNullOrUndefined(this.leftIndent)||(e.leftIndent=this.leftIndent),t.isNullOrUndefined(this.rightIndent)||(e.rightIndent=this.rightIndent),t.isNullOrUndefined(this.textAlignment)||(e.textAlignment=this.textAlignment),t.isNullOrUndefined(this.lineSpacing)||(e.lineSpacing=this.lineSpacing),t.isNullOrUndefined(this.lineSpacingType)||(e.lineSpacingType=this.lineSpacingType),t.isNullOrUndefined(this.firstLineIndent)||(e.firstLineIndent=this.firstLineIndent),t.isNullOrUndefined(this.bidi)||(e.bidi=this.bidi),t.isNullOrUndefined(this.contextualSpacing)||(e.contextualSpacing=this.contextualSpacing))},e.prototype.combineFormat=function(e){t.isNullOrUndefined(this.leftIndent)||this.leftIndent===e.leftIndent||(this.leftIndent=void 0),t.isNullOrUndefined(this.rightIndent)||this.rightIndent===e.rightIndent||(this.rightIndent=void 0),t.isNullOrUndefined(this.firstLineIndent)||this.firstLineIndent===e.firstLineIndent||(this.firstLineIndent=void 0),0!==this.lineSpacing&&this.lineSpacing!==e.lineSpacing&&(this.lineSpacing=0),-1!==this.beforeSpacing&&this.beforeSpacing!==e.beforeSpacing&&(this.beforeSpacing=-1),-1!==this.afterSpacing&&this.afterSpacing!==e.afterSpacing&&(this.afterSpacing=-1),t.isNullOrUndefined(this.lineSpacingType)||this.lineSpacingType===e.lineSpacingType||(this.lineSpacingType=void 0),t.isNullOrUndefined(this.textAlignment)||this.textAlignment===e.textAlignment||(this.textAlignment=void 0),this.listLevelNumber>=0&&!t.isNullOrUndefined(this.listId)&&(t.isNullOrUndefined(e.listFormat)||e.listFormat.listLevelNumber!==this.listLevelNumber)&&(this.listLevelNumber=-1),(t.isNullOrUndefined(e.listFormat)||t.isNullOrUndefined(e.listFormat.listId)||!t.isNullOrUndefined(this.listId)&&this.listId!==e.listFormat.listId)&&(this.listId=void 0),t.isNullOrUndefined(this.bidi)||this.bidi===e.bidi||(this.bidi=void 0),t.isNullOrUndefined(this.contextualSpacing)||this.contextualSpacing===e.contextualSpacing||(this.contextualSpacing=void 0),!t.isNullOrUndefined(this.styleName)&&e.baseStyle&&this.styleName!==e.baseStyle.name&&(this.styleName=void 0)},e.prototype.clearFormat=function(){this.leftIndent=0,this.rightIndent=0,this.beforeSpacing=0,this.afterSpacing=0,this.firstLineIndent=0,this.lineSpacing=1,this.textAlignment=void 0,this.lineSpacingType=void 0,this.listId=void 0,this.listLevelNumber=-1,this.styleName=void 0,this.bidi=void 0,this.contextualSpacing=void 0},e.prototype.getList=function(){var e=this.documentHelper.getListById(this.listId);if(!t.isNullOrUndefined(e)){var i=new P,n=new G,r=this.documentHelper.getAbstractListById(e.abstractListId),o=this.selection.owner.editorModule;if(t.isNullOrUndefined(r))n.levels.push(new K(n));else for(a=0;a<r.levels.length;a++){var s=o.cloneListLevel(r.levels[a]);n.levels.push(s),s.ownerBase=n}if(!t.isNullOrUndefined(e.levelOverrides))for(var a=0;a<e.levelOverrides.length;a++){var l=o.cloneLevelOverride(e.levelOverrides[a]);i.levelOverrides.push(l)}return i.abstractList=n,i.abstractListId=n.abstractListId,i.sourceListId=e.listId,i}},e.prototype.setList=function(e){if((!this.documentHelper.owner.isReadOnlyMode||this.selection.isInlineFormFillMode())&&this.documentHelper.owner.isDocumentLoaded){var i=this.documentHelper.getListById(this.listId),n=void 0,r=e?this.documentHelper.getAbstractListById(e.abstractListId):void 0;if(t.isNullOrUndefined(i)||t.isNullOrUndefined(e)||t.isNullOrUndefined(r)||e.sourceListId!==i.listId)t.isNullOrUndefined(e)?this.selection.owner.editorModule.onApplyList(void 0):(this.selection.owner.isLayoutEnabled=!1,t.isNullOrUndefined(r)||-1!==this.documentHelper.abstractLists.indexOf(r)||this.documentHelper.abstractLists.push(r),-1===this.documentHelper.lists.indexOf(e)&&this.documentHelper.lists.push(e),this.selection.owner.isLayoutEnabled=!0,this.selection.owner.editorModule.onApplyList(e));else{var o=this.documentHelper.owner.editorHistory;this.documentHelper.layout.getListLevel(i,1);this.selection.owner.isLayoutEnabled=!1,this.documentHelper.owner.editorModule.setOffsetValue(this.selection),o&&(n=o.updateListChangesInHistory(r,i)),this.documentHelper.owner.editorModule.updateListParagraphs(),o&&o.applyListChanges(this.selection,n),this.selection.owner.isLayoutEnabled=!0,this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[],this.documentHelper.owner.editorModule.layoutWholeDocument(),this.documentHelper.owner.editorModule.updateSelectionTextPosition(!1),o&&o.currentBaseHistoryInfo&&(o.currentBaseHistoryInfo.modifiedProperties.length>0&&o.currentBaseHistoryInfo.updateSelection(),o.updateHistory()),this.documentHelper.owner.editorModule.fireContentChange()}}},e.prototype.destroy=function(){this.leftIndentIn=void 0,this.rightIndentIn=void 0,this.beforeSpacingIn=void 0,this.afterSpacingIn=void 0,this.firstLineIndentIn=void 0,this.lineSpacingIn=void 0,this.textAlignmentIn=void 0,this.lineSpacingTypeIn=void 0,this.listId=void 0,this.listLevelNumberIn=void 0,this.documentHelper=void 0,this.selection=void 0,this.styleName=void 0,this.bidi=void 0,this.contextualSpacing=void 0},e}(),It=function(){function e(e){this.differentFirstPageIn=void 0,this.differentOddAndEvenPagesIn=void 0,this.bidi=void 0,this.selection=e}return Object.defineProperty(e.prototype,"pageHeight",{get:function(){return this.pageHeightIn},set:function(e){this.pageHeightIn=e,this.notifyPropertyChanged("pageHeight")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageWidth",{get:function(){return this.pageWidthIn},set:function(e){this.pageWidthIn=e,this.notifyPropertyChanged("pageWidth")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.leftMarginIn},set:function(e){this.leftMarginIn=e,this.notifyPropertyChanged("leftMargin")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.bottomMarginIn},set:function(e){this.bottomMarginIn=e,this.notifyPropertyChanged("bottomMargin")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.topMarginIn},set:function(e){this.topMarginIn=e,this.notifyPropertyChanged("topMargin")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.rightMarginIn},set:function(e){this.rightMarginIn=e,this.notifyPropertyChanged("rightMargin")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerDistance",{get:function(){return this.headerDistanceIn},set:function(e){this.headerDistanceIn=e,this.notifyPropertyChanged("headerDistance")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageStartingNumber",{get:function(){return this.pageStartingNumberIn},set:function(e){this.pageStartingNumberIn=e,this.notifyPropertyChanged("pageStartingNumber")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartPageNumbering",{get:function(){return this.restartPageNumberingIn},set:function(e){this.restartPageNumberingIn=e,this.notifyPropertyChanged("restartPageNumbering")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footerDistance",{get:function(){return this.footerDistanceIn},set:function(e){this.footerDistanceIn=e,this.notifyPropertyChanged("footerDistance")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"differentFirstPage",{get:function(){return this.differentFirstPageIn},set:function(e){this.differentFirstPageIn=e,this.notifyPropertyChanged("differentFirstPage")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"differentOddAndEvenPages",{get:function(){return this.differentOddAndEvenPagesIn},set:function(e){this.differentOddAndEvenPagesIn=e,this.notifyPropertyChanged("differentOddAndEvenPages")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endnoteNumberFormat",{get:function(){return this.endnoteNumberFormatIn},set:function(e){this.endnoteNumberFormatIn=e,this.notifyPropertyChanged("endnoteNumberFormat")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footNoteNumberFormat",{get:function(){return this.footNoteNumberFormatIn},set:function(e){this.footNoteNumberFormatIn=e,this.notifyPropertyChanged("footNoteNumberFormat")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialFootNoteNumber",{get:function(){return this.initialFootNoteNumberIn},set:function(e){this.initialFootNoteNumberIn=e,this.notifyPropertyChanged("initialFootNoteNumber")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialEndNoteNumber",{get:function(){return this.initialEndNoteNumberIn},set:function(e){this.initialEndNoteNumberIn=e,this.notifyPropertyChanged("initialEndNoteNumber")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartIndexForFootnotes",{get:function(){return this.restartIndexForFootnotesIn},set:function(e){this.restartIndexForFootnotesIn=e,this.notifyPropertyChanged("restartIndexForFootnotes")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restartIndexForEndnotes",{get:function(){return this.restartIndexForEndnotesIn},set:function(e){this.restartIndexForEndnotesIn=e,this.notifyPropertyChanged("restartIndexForEndnotes")},enumerable:!0,configurable:!0}),e.prototype.copyFormat=function(e){this.pageHeight=e.pageHeight,this.pageWidth=e.pageWidth,this.leftMargin=e.leftMargin,this.topMargin=e.topMargin,this.rightMargin=e.rightMargin,this.bottomMargin=e.bottomMargin,this.headerDistance=e.headerDistance,this.footerDistance=e.footerDistance,this.differentFirstPage=e.differentFirstPage,this.differentOddAndEvenPages=e.differentOddAndEvenPages,this.bidi=e.bidi,this.pageStartingNumber=e.pageStartingNumber,this.restartPageNumbering=e.restartPageNumbering,this.endnoteNumberFormat=e.endnoteNumberFormat,this.footNoteNumberFormat=e.footNoteNumberFormat,this.restartIndexForEndnotes=e.restartIndexForEndnotes,this.restartIndexForFootnotes=e.restartIndexForFootnotes,this.initialEndNoteNumber=e.initialEndNoteNumber,this.initialFootNoteNumber=e.initialFootNoteNumber},e.prototype.notifyPropertyChanged=function(e){var i=this.selection;if((t.isNullOrUndefined(i)||!(i.isCleared||i.owner.isPastingContent||i.owner.isReadOnlyMode)&&i.owner.isDocumentLoaded||i.isRetrieveFormatting)&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.start)&&!i.isRetrieveFormatting){var n=this.getPropertyvalue(e);t.isNullOrUndefined(n)||i.owner.editorModule.onApplySectionFormat(e,n)}},e.prototype.getPropertyvalue=function(e){switch(e){case"pageHeight":if(this.pageHeight>0)return this.pageHeight;return;case"pageWidth":if(this.pageWidth>0)return this.pageWidth;return;case"leftMargin":if(this.leftMargin>=0)return this.leftMargin;return;case"rightMargin":if(this.rightMargin>=0)return this.rightMargin;return;case"topMargin":if(this.topMargin>=0)return this.topMargin;return;case"bottomMargin":if(this.bottomMargin>=0)return this.bottomMargin;return;case"differentFirstPage":if(!t.isNullOrUndefined(this.differentFirstPage))return this.differentFirstPage;return;case"differentOddAndEvenPages":if(!t.isNullOrUndefined(this.differentOddAndEvenPages))return this.differentOddAndEvenPages;return;case"headerDistance":return this.headerDistanceIn;case"footerDistance":return this.footerDistance;case"pageStartingNumber":if(!t.isNullOrUndefined(this.pageStartingNumber))return this.pageStartingNumber;return;case"restartPageNumbering":if(!t.isNullOrUndefined(this.restartPageNumbering))return this.restartPageNumbering;return;case"endnoteNumberFormat":return this.endnoteNumberFormatIn;case"restartIndexForEndnotes":return this.restartIndexForEndnotesIn;case"restartIndexForFootnotes":return this.restartIndexForFootnotesIn;case"footNoteNumberFormat":return this.footNoteNumberFormatIn;case"initialFootNoteNumber":return this.initialFootNoteNumber;case"initialEndNoteNumber":return this.initialEndNoteNumber;default:return}},e.prototype.combineFormat=function(e){this.pageHeight>0&&this.pageHeight!==e.pageHeight&&(this.pageHeight=0),this.pageWidth>0&&this.pageWidth!==e.pageWidth&&(this.pageWidth=0),this.leftMargin>-1&&this.leftMargin!==e.leftMargin&&(this.leftMargin=-1),this.topMargin>-1&&this.topMargin!==e.topMargin&&(this.topMargin=-1),this.rightMargin>-1&&this.rightMargin!==e.rightMargin&&(this.rightMargin=-1),this.bottomMargin>-1&&this.bottomMargin!==e.bottomMargin&&(this.bottomMargin=-1),0!==this.headerDistance&&this.headerDistance!==e.headerDistance&&(this.headerDistance=0),0!==this.footerDistance&&this.footerDistance!==e.footerDistance&&(this.footerDistance=0),t.isNullOrUndefined(this.differentFirstPage)||this.differentFirstPage===e.differentFirstPage||(this.differentFirstPage=void 0),t.isNullOrUndefined(this.pageStartingNumber)||this.pageStartingNumber===e.pageStartingNumber||(this.pageStartingNumber=void 0),t.isNullOrUndefined(this.restartPageNumbering)||this.restartPageNumbering===e.restartPageNumbering||(this.restartPageNumbering=void 0),t.isNullOrUndefined(this.differentOddAndEvenPages)||this.differentOddAndEvenPages===e.differentOddAndEvenPages||(this.differentOddAndEvenPages=void 0),t.isNullOrUndefined(this.bidi)||this.bidi===e.bidi||(this.bidi=void 0),t.isNullOrUndefined(this.endnoteNumberFormat)||this.endnoteNumberFormat===e.endnoteNumberFormat||(this.endnoteNumberFormat=void 0),t.isNullOrUndefined(this.restartIndexForEndnotes)||this.restartIndexForEndnotes===e.restartIndexForEndnotes||(this.restartIndexForEndnotes=void 0),t.isNullOrUndefined(this.restartIndexForFootnotes)||this.restartIndexForFootnotes===e.restartIndexForFootnotes||(this.restartIndexForFootnotes=void 0),t.isNullOrUndefined(this.footNoteNumberFormat)||this.footNoteNumberFormat===e.footNoteNumberFormat||(this.footNoteNumberFormat=void 0),t.isNullOrUndefined(this.initialFootNoteNumber)||this.initialFootNoteNumber===e.initialFootNoteNumber||(this.initialFootNoteNumber=void 0),t.isNullOrUndefined(this.initialEndNoteNumber)||this.initialEndNoteNumber===e.initialEndNoteNumber||(this.initialEndNoteNumber=void 0)},e.prototype.clearFormat=function(){this.headerDistance=0,this.footerDistance=0,this.pageHeight=0,this.pageWidth=0,this.leftMargin=-1,this.rightMargin=-1,this.topMargin=-1,this.bottomMargin=-1,this.differentFirstPage=void 0,this.differentOddAndEvenPages=void 0,this.bidi=void 0,this.pageStartingNumber=void 0,this.restartPageNumbering=void 0,this.endnoteNumberFormat=void 0,this.footNoteNumberFormat=void 0,this.restartIndexForFootnotes=void 0,this.restartIndexForEndnotes=void 0,this.initialFootNoteNumber=1,this.initialEndNoteNumber=1},e.prototype.destroy=function(){this.headerDistanceIn=void 0,this.footerDistanceIn=void 0,this.pageHeightIn=void 0,this.pageWidthIn=void 0,this.leftMarginIn=void 0,this.rightMarginIn=void 0,this.topMarginIn=void 0,this.bottomMarginIn=void 0,this.differentFirstPageIn=void 0,this.differentOddAndEvenPagesIn=void 0,this.selection=void 0,this.bidi=void 0,this.pageStartingNumberIn=void 0,this.restartPageNumberingIn=void 0,this.endnoteNumberFormatIn=void 0,this.footNoteNumberFormatIn=void 0,this.restartIndexForFootnotesIn=void 0,this.restartIndexForEndnotesIn=void 0,this.initialEndNoteNumber=void 0,this.initialFootNoteNumber=void 0},e}(),Nt=function(){function e(e){this.leftIndentIn=0,this.backgroundIn=void 0,this.tableAlignmentIn=void 0,this.cellSpacingIn=0,this.leftMarginIn=0,this.rightMarginIn=0,this.topMarginIn=0,this.bottomMarginIn=0,this.preferredWidthIn=0,this.bidiIn=void 0,this.selection=e}return Object.defineProperty(e.prototype,"table",{get:function(){return this.tableIn},set:function(e){this.tableIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftIndent",{get:function(){return this.leftIndentIn},set:function(e){e!==this.leftIndentIn&&(this.leftIndentIn=e,this.notifyPropertyChanged("leftIndent"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.topMarginIn},set:function(e){e!==this.topMarginIn&&(this.topMarginIn=e,this.notifyPropertyChanged("topMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this.backgroundIn},set:function(e){e!==this.backgroundIn&&(this.backgroundIn=e,this.notifyPropertyChanged("background"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tableAlignment",{get:function(){return this.tableAlignmentIn},set:function(e){e!==this.tableAlignmentIn&&(this.tableAlignmentIn=e,this.notifyPropertyChanged("tableAlignment"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.leftMarginIn},set:function(e){e!==this.leftMarginIn&&(this.leftMarginIn=e,this.notifyPropertyChanged("leftMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.bottomMarginIn},set:function(e){e!==this.bottomMarginIn&&(this.bottomMarginIn=e,this.notifyPropertyChanged("bottomMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellSpacing",{get:function(){return this.cellSpacingIn},set:function(e){e!==this.cellSpacingIn&&(this.cellSpacingIn=e,this.notifyPropertyChanged("cellSpacing"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.rightMarginIn},set:function(e){e!==this.rightMarginIn&&(this.rightMarginIn=e,this.notifyPropertyChanged("rightMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidth",{get:function(){return this.preferredWidthIn},set:function(e){e!==this.preferredWidthIn&&(this.preferredWidthIn=e,this.notifyPropertyChanged("preferredWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidthType",{get:function(){return this.preferredWidthTypeIn},set:function(e){e!==this.preferredWidthTypeIn&&(this.preferredWidthTypeIn=e,this.notifyPropertyChanged("preferredWidthType"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bidi",{get:function(){return this.bidiIn},set:function(e){this.bidiIn=e,this.notifyPropertyChanged("bidi")},enumerable:!0,configurable:!0}),e.prototype.getPropertyValue=function(e){switch(e){case"tableAlignment":return this.tableAlignment;case"leftIndent":return this.leftIndent;case"cellSpacing":return this.cellSpacing;case"leftMargin":return this.leftMargin;case"rightMargin":return this.rightMargin;case"topMargin":return this.topMargin;case"bottomMargin":return this.bottomMargin;case"background":var t=new _;return t.backgroundColor=this.background,t;case"preferredWidth":return this.preferredWidth;case"preferredWidthType":return this.preferredWidthType;case"bidi":return this.bidi;default:return}},e.prototype.notifyPropertyChanged=function(e){if((t.isNullOrUndefined(this.selection)||!this.selection.isCleared&&this.selection.owner.isDocumentLoaded&&!this.selection.owner.isReadOnlyMode&&!this.selection.owner.isPastingContent||this.selection.isRetrieveFormatting)&&!t.isNullOrUndefined(this.selection)&&!t.isNullOrUndefined(this.selection.start)&&!this.selection.isRetrieveFormatting){var i=this.getPropertyValue(e);"background"===e&&(e="shading"),t.isNullOrUndefined(i)||this.selection.owner.editorModule.onApplyTableFormat(e,i)}},e.prototype.copyFormat=function(e){this.leftIndent=e.leftIndent,this.background=e.shading.backgroundColor,this.tableAlignment=e.tableAlignment,this.leftMargin=e.leftMargin,this.rightMargin=e.rightMargin,this.topMargin=e.topMargin,this.bottomMargin=e.bottomMargin,this.cellSpacing=e.cellSpacing,this.preferredWidth=e.preferredWidth,this.preferredWidthType=e.preferredWidthType,this.bidi=e.bidi},e.prototype.clearFormat=function(){this.table=void 0,this.leftIndent=0,this.background=void 0,this.leftIndent=0,this.leftMargin=0,this.rightMargin=0,this.topMargin=0,this.bottomMargin=0,this.cellSpacing=0,this.tableAlignment=void 0,this.bidi=void 0},e.prototype.destroy=function(){this.leftIndentIn=void 0,this.backgroundIn=void 0,this.leftIndentIn=void 0,this.leftMarginIn=void 0,this.rightMarginIn=void 0,this.topMarginIn=void 0,this.bottomMarginIn=void 0,this.cellSpacingIn=void 0,this.tableAlignmentIn=void 0,this.tableIn=void 0,this.selection=void 0,this.bidi=void 0},e}(),Et=function(){function e(e){this.verticalAlignmentIn=void 0,this.leftMarginIn=0,this.rightMarginIn=0,this.topMarginIn=0,this.bottomMarginIn=0,this.backgroundIn=void 0,this.preferredWidthTypeIn=void 0,this.selection=e}return Object.defineProperty(e.prototype,"verticalAlignment",{get:function(){return this.verticalAlignmentIn},set:function(e){e!==this.verticalAlignmentIn&&(this.verticalAlignmentIn=e,this.notifyPropertyChanged("verticalAlignment"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftMargin",{get:function(){return this.leftMarginIn},set:function(e){e!==this.leftMarginIn&&(this.leftMarginIn=e,this.notifyPropertyChanged("leftMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightMargin",{get:function(){return this.rightMarginIn},set:function(e){e!==this.rightMarginIn&&(this.rightMarginIn=e,this.notifyPropertyChanged("rightMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topMargin",{get:function(){return this.topMarginIn},set:function(e){e!==this.topMarginIn&&(this.topMarginIn=e,this.notifyPropertyChanged("topMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomMargin",{get:function(){return this.bottomMarginIn},set:function(e){e!==this.bottomMarginIn&&(this.bottomMarginIn=e,this.notifyPropertyChanged("bottomMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this.backgroundIn},set:function(e){e!==this.backgroundIn&&(this.backgroundIn=e,this.notifyPropertyChanged("background"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidthType",{get:function(){return this.preferredWidthTypeIn},set:function(e){e!==this.preferredWidthTypeIn&&(this.preferredWidthTypeIn=e,this.notifyPropertyChanged("preferredWidthType"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredWidth",{get:function(){return this.preferredWidthIn},set:function(e){e!==this.preferredWidthIn&&(this.preferredWidthIn=e,this.notifyPropertyChanged("preferredWidth"))},enumerable:!0,configurable:!0}),e.prototype.notifyPropertyChanged=function(e){var i=this.selection;if(!t.isNullOrUndefined(i)){if((i.isCleared||!i.owner.isDocumentLoaded||i.owner.isReadOnlyMode||i.owner.isPastingContent)&&!i.isRetrieveFormatting)return;if(!t.isNullOrUndefined(this.selection.start)&&!this.selection.isRetrieveFormatting){var n=this.getPropertyValue(e);"background"===e&&(e="shading"),t.isNullOrUndefined(n)||this.selection.owner.editorModule.onApplyTableCellFormat(e,n)}}},e.prototype.getPropertyValue=function(e){switch(e){case"verticalAlignment":return this.verticalAlignment;case"leftMargin":return this.leftMargin;case"rightMargin":return this.rightMargin;case"topMargin":return this.topMargin;case"bottomMargin":return this.bottomMargin;case"preferredWidth":return this.preferredWidth;case"preferredWidthType":return this.preferredWidthType;case"background":var t=new _;return t.backgroundColor=this.background,t;default:return}},e.prototype.copyFormat=function(e){this.leftMargin=e.leftMargin,this.rightMargin=e.rightMargin,this.topMargin=e.topMargin,this.bottomMargin=e.bottomMargin,this.background=e.shading.backgroundColor,this.verticalAlignment=e.verticalAlignment,this.preferredWidth=e.preferredWidth,this.preferredWidthType=e.preferredWidthType},e.prototype.clearCellFormat=function(){this.leftMargin=void 0,this.rightMargin=void 0,this.topMargin=void 0,this.bottomMargin=void 0,this.background=void 0,this.verticalAlignment=void 0},e.prototype.combineFormat=function(e){t.isNullOrUndefined(this.leftMargin)||this.leftMargin===e.leftMargin||(this.leftMargin=void 0),t.isNullOrUndefined(this.topMargin)||this.topMargin===e.topMargin||(this.topMargin=void 0),t.isNullOrUndefined(this.rightMargin)||this.rightMargin===e.rightMargin||(this.rightMargin=void 0),t.isNullOrUndefined(this.bottomMargin)||this.bottomMargin===e.bottomMargin||(this.bottomMargin=void 0),t.isNullOrUndefined(this.background)||this.background===e.shading.backgroundColor||(this.background=void 0),t.isNullOrUndefined(this.verticalAlignment)||this.verticalAlignment===e.verticalAlignment||(this.verticalAlignment=void 0),t.isNullOrUndefined(this.preferredWidth)||this.preferredWidth===e.preferredWidth||(this.preferredWidth=void 0),t.isNullOrUndefined(this.preferredWidthType)||this.preferredWidthType===e.preferredWidthType||(this.preferredWidthType=void 0)},e.prototype.clearFormat=function(){this.background=void 0,this.bottomMargin=0,this.leftMargin=0,this.rightMargin=0,this.topMargin=0,this.verticalAlignment=void 0},e.prototype.destroy=function(){this.backgroundIn=void 0,this.verticalAlignmentIn=void 0,this.bottomMarginIn=void 0,this.leftMarginIn=void 0,this.rightMarginIn=void 0,this.topMarginIn=void 0,this.selection=void 0},e}(),Ht=function(){function e(e){this.heightIn=void 0,this.heightTypeIn=void 0,this.isHeaderIn=void 0,this.allowRowBreakAcrossPagesIn=void 0,this.selection=e}return Object.defineProperty(e.prototype,"height",{get:function(){return this.heightIn},set:function(e){e!==this.heightIn&&(this.heightIn=e,this.notifyPropertyChanged("height"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"heightType",{get:function(){return this.heightTypeIn},set:function(e){e!==this.heightTypeIn&&(this.heightTypeIn=e,this.notifyPropertyChanged("heightType"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHeader",{get:function(){return this.isHeaderIn},set:function(e){e!==this.isHeaderIn&&(this.isHeaderIn=e,this.notifyPropertyChanged("isHeader"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowBreakAcrossPages",{get:function(){return this.allowRowBreakAcrossPagesIn},set:function(e){e!==this.allowRowBreakAcrossPagesIn&&(this.allowRowBreakAcrossPagesIn=e,this.notifyPropertyChanged("allowBreakAcrossPages"))},enumerable:!0,configurable:!0}),e.prototype.notifyPropertyChanged=function(e){var i=this.selection;if((t.isNullOrUndefined(i)||!i.isCleared&&!i.owner.isReadOnlyMode&&i.owner.isDocumentLoaded&&!i.owner.isPastingContent||i.isRetrieveFormatting)&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.start)&&!i.isRetrieveFormatting){var n=this.getPropertyValue(e);t.isNullOrUndefined(n)||i.owner.editorModule.onApplyTableRowFormat(e,n)}},e.prototype.getPropertyValue=function(e){switch(e){case"height":return this.height;case"heightType":return this.heightType;case"isHeader":return this.isHeader;case"allowBreakAcrossPages":return this.allowBreakAcrossPages;default:return}},e.prototype.copyFormat=function(e){this.height=e.height,this.heightType=e.heightType,this.allowBreakAcrossPages=e.allowBreakAcrossPages,this.isHeader=e.isHeader},e.prototype.combineFormat=function(e){t.isNullOrUndefined(this.height)||this.height===e.height||(this.height=void 0),t.isNullOrUndefined(this.heightType)||this.heightType===e.heightType||(this.heightType=void 0),t.isNullOrUndefined(this.allowBreakAcrossPages)||this.allowBreakAcrossPages===e.allowBreakAcrossPages||(this.allowBreakAcrossPages=void 0),t.isNullOrUndefined(this.isHeader)||this.isHeader===e.isHeader||(this.isHeader=void 0)},e.prototype.clearRowFormat=function(){this.height=void 0,this.heightType=void 0,this.allowBreakAcrossPages=void 0,this.isHeader=void 0},e.prototype.clearFormat=function(){this.height=0,this.heightType=void 0,this.allowBreakAcrossPages=void 0,this.isHeader=void 0},e.prototype.destroy=function(){this.heightIn=void 0,this.heightTypeIn=void 0,this.allowRowBreakAcrossPagesIn=void 0,this.isHeaderIn=void 0,this.selection=void 0},e}(),Wt=function(){function e(e){this.selection=e}return Object.defineProperty(e.prototype,"width",{get:function(){return this.image?this.image.width:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.image?this.image.height:0},enumerable:!0,configurable:!0}),e.prototype.resize=function(e,t){this.updateImageFormat(e,t)},e.prototype.updateImageFormat=function(e,t){this.image&&this.selection.owner.editorModule&&this.selection.owner.editorModule.onImageFormat(this.image,e,t)},e.prototype.copyImageFormat=function(e){this.image=e},e.prototype.clearImageFormat=function(){this.image=void 0},e}(),Ot=function(){function e(){this.document=void 0,this.prevListLevel=void 0,this.isOrdered=void 0,this.fieldCheck=0,this.isMergeField=!1}return e.prototype.writeHtml=function(e){this.document=e;for(var t="",i=0;i<e.sections.length;i++)t+=this.serializeSection(e.sections[i]);return t},e.prototype.serializeSection=function(e){for(var t="",i=0;i<e.blocks.length;i++){var n=e.blocks[i];n.hasOwnProperty("inlines")?t+=this.serializeParagraph(n):n.hasOwnProperty("blocks")?t+=this.serializeSection(n):(t+=this.closeList(),t+=this.serializeTable(n))}return t+=this.closeList(),this.prevListLevel=void 0,this.isOrdered=void 0,t},e.prototype.serializeParagraph=function(e){var i="",n=!1,r=!1;t.isNullOrUndefined(this.prevListLevel)||(r=!0);var o=[],s=void 0;return t.isNullOrUndefined(e.paragraphFormat.listFormat)||(s=this.getListLevel(e),r||(this.prevListLevel=s),this.prevListLevel!==s&&(r=!1),this.prevListLevel=s),r||(i+=this.closeList()),t.isNullOrUndefined(s)||(n=!0),n&&!r&&(i+=this.getHtmlList(s,e.paragraphFormat.listFormat.listLevelNumber)),o.push('style="'+this.serializeParagraphStyle(e,"",n)+';white-space:pre"'),n?i+=this.createAttributesTag("li",o):(this.prevListLevel=void 0,this.isOrdered=void 0,i+=this.createAttributesTag(this.getStyleName(e.paragraphFormat.styleName),o)),0===e.inlines.length?i+=" ":i=this.serializeInlines(e,i),n?(i+=this.endTag("li")).indexOf("<ul")>-1?this.isOrdered=!1:i.indexOf("<ol")>-1&&(this.isOrdered=!0):i+=this.endTag(this.getStyleName(e.paragraphFormat.styleName)),i},e.prototype.closeList=function(){var e="";return t.isNullOrUndefined(this.isOrdered)||(e=this.isOrdered?this.endTag("ol"):this.endTag("ul"),this.isOrdered=void 0),e},e.prototype.getListLevel=function(e){for(var t=void 0,i=void 0,n=0;n<this.document.lists.length;n++)if(this.document.lists[n].listId===e.paragraphFormat.listFormat.listId){i=this.document.lists[n];break}if(i)for(var r=0;r<this.document.abstractLists.length;r++)if(this.document.abstractLists[r].abstractListId===i.abstractListId){t=this.document.abstractLists[r].levels[e.paragraphFormat.listFormat.listLevelNumber];break}return t},e.prototype.getHtmlList=function(e,t){var i="";if("Bullet"===e.listLevelPattern){switch(i+='<ul type="',t){case 0:i+="disc",e.characterFormat.fontFamily="Symbol";break;case 1:i+="circle",e.characterFormat.fontFamily="Symbol";break;case 2:i+="square",e.characterFormat.fontFamily="Wingdings";break;default:i+="disc",e.characterFormat.fontFamily="Symbol"}i+='">'}else{switch(i+='<ol type="',e.listLevelPattern){case"LowLetter":i+="a";break;case"UpLetter":i+="A";break;case"LowRoman":i+="i";break;case"UpRoman":i+="I";break;default:i+="1"}i+='" start="'+e.startAt.toString()+'">'}return i},e.prototype.serializeInlines=function(e,i){for(var n=void 0,r=0,o=[];e.inlines.length>r;)if((n=e.inlines[r]).hasOwnProperty("inlines"))i+=this.serializeContentInlines(n,i),r++;else{if(n.hasOwnProperty("imageString"))i+=this.serializeImageContainer(n);else if(n.hasOwnProperty("fieldType"))if(0===n.fieldType){var s=e.inlines[r+1];t.isNullOrUndefined(s)||t.isNullOrUndefined(s.text)||!(s.text.indexOf("TOC")>=0||s.text.indexOf("HYPERLINK")>=0)?s.text.toLowerCase().indexOf("mergefield")>=0?(this.isMergeField=!0,(o=[]).push('style="mso-element:field-begin"'),i+="\x3c!--[if supportFields]>",i+=this.createAttributesTag("span",o),i+=this.endTag("span"),o=[]):this.fieldCheck=void 0:(this.fieldCheck=1,(o=[]).push('style="'+this.serializeInlineStyle(n.characterFormat)+'"'),i+=this.createAttributesTag("a",o))}else 2===n.fieldType?(this.isMergeField&&((o=[]).push('style="mso-element:field-separator"'),i+=this.createAttributesTag("span",o),i+=this.endTag("span"),i+="<![endif]--\x3e"),t.isNullOrUndefined(this.fieldCheck)?this.fieldCheck=0:this.fieldCheck=2):(this.isMergeField?(i+="\x3c!--[if supportFields]>",(o=[]).push('style="mso-element:field-end"'),i+=this.createAttributesTag("span",o),i+=this.endTag("span"),i+="<![endif]--\x3e"):t.isNullOrUndefined(this.fieldCheck)||0===this.fieldCheck||(i+=this.endTag("a")),this.fieldCheck=0);else{var a=t.isNullOrUndefined(n.text)?"":n.text;0===this.fieldCheck&&(a.indexOf("MERGEFIELD")>=0&&this.isMergeField?((o=[]).push('style="'+this.serializeInlineStyle(n.characterFormat)+'"'),i+=this.createAttributesTag("span",o),i+=a,i+=this.endTag("span")):i+=this.serializeSpan(a,n.characterFormat)),1===this.fieldCheck&&-1===a.indexOf("MERGEFIELD")&&(i+=' href= "'+a.replace(/"/g,"").replace("HYPERLINK","").trim(),i+='"',i+=">"),2===this.fieldCheck&&(this.isMergeField?((o=[]).push('style="'+this.serializeInlineStyle(n.characterFormat)+'"'),i+=this.createAttributesTag("span",o),i+=a,i+=this.endTag("span")):(i+=this.createAttributesTag("span",[]),i+=this.endTag("span"),i+=a))}r++}return i},e.prototype.serializeContentInlines=function(e,t){return t+=this.serializeInlines(e,t)},e.prototype.serializeSpan=function(e,t){var i="";if(-1!==e.indexOf("\v"))return(i+="<br>").toString();if(-1!==e.indexOf("\f"))return(i+='<br style = "page-break-after:always;"/>').toString();var n=[];this.serializeInlineStyle(t),n.push('style="'+this.serializeInlineStyle(t)+'"'),i+=this.createAttributesTag("span",n);var r=this.decodeHtmlNames(e.toString());return 0===r.length&&(r=" "),i+=r,(i+=this.endTag("span")).toString()},e.prototype.getStyleName=function(e){switch(e){case"Heading 1":return"h1";case"Heading 2":return"h2";case"Heading 3":return"h3";case"Heading 4":return"h4";case"Heading 5":return"h5";default:return"div"}},e.prototype.serializeImageContainer=function(e){var i="",n=[];this.serializeInlineStyle(e.characterFormat);var r="";t.isNullOrUndefined(e.imageString)||(r=e.imageString);var o=L.convertPointToPixel(e.width),s=L.convertPointToPixel(e.height);return n.push('width="'+o.toString()+'"'),n.push('height="'+s.toString()+'"'),n.push('src="'+r+'"'),i+=this.createAttributesTag("img",n),(i+=this.endTag("img")).toString()},e.prototype.serializeCell=function(e){var i="",n=[],r="";if(n=[],!t.isNullOrUndefined(e.cellFormat)){if(t.isNullOrUndefined(e.cellFormat.shading.backgroundColor)||n.push('bgcolor="'+L.getColor(e.cellFormat.shading.backgroundColor)+'"'),!t.isNullOrUndefined(e.cellFormat.columnSpan)&&e.cellFormat.columnSpan>1&&n.push('colspan="'+e.cellFormat.columnSpan.toString()+'"'),!t.isNullOrUndefined(e.cellFormat.rowSpan)&&e.cellFormat.rowSpan>1&&n.push('rowspan="'+e.cellFormat.rowSpan.toString()+'"'),!t.isNullOrUndefined(e.cellFormat.cellWidth)&&0!==e.cellFormat.cellWidth){var o=L.convertPointToPixel(e.cellFormat.cellWidth);n.push('width="'+o.toString()+'"')}var s=t.isNullOrUndefined(e.cellFormat.verticalAlignment)?"top":e.cellFormat.verticalAlignment.toString().toLowerCase();n.push('valign="'+s+'"'),t.isNullOrUndefined(e.cellFormat.leftMargin)||0===e.cellFormat.leftMargin||(r+="padding-left:"+e.cellFormat.leftMargin.toString()+"pt;"),t.isNullOrUndefined(e.cellFormat.rightMargin)||0===e.cellFormat.rightMargin||(r+="padding-right:"+e.cellFormat.rightMargin.toString()+"pt;"),t.isNullOrUndefined(e.cellFormat.topMargin)||0===e.cellFormat.topMargin||(r+="padding-top:"+e.cellFormat.topMargin.toString()+"pt;"),t.isNullOrUndefined(e.cellFormat.bottomMargin)||0===e.cellFormat.bottomMargin||(r+="padding-bottom:"+e.cellFormat.bottomMargin.toString()+"pt;"),t.isNullOrUndefined(e.cellFormat.borders)||(r+=this.serializeCellBordersStyle())}0!==r.length&&n.push('style="'+r+'"'),i+=this.createAttributesTag("td",n);for(var a=0;a<e.blocks.length;a++){var l=e.blocks[a];l.hasOwnProperty("rows")?i+=this.serializeTable(l):i+=this.serializeParagraph(l)}return i+=this.endTag("td")},e.prototype.serializeTable=function(e){var t="";t+=this.createTableStartTag(e);for(var i=0;i<e.rows.length;i++)t+=this.serializeRow(e.rows[i]);return t+=this.createTableEndTag()},e.prototype.serializeRow=function(e){var t="";t+=this.createRowStartTag(e);for(var i=0;i<e.cells.length;i++)t+=this.serializeCell(e.cells[i]);return t},e.prototype.serializeParagraphStyle=function(e,t,i){var n="";return n+=this.serializeCharacterFormat(e.characterFormat),n+=this.serializeParagraphFormat(e.paragraphFormat,i)},e.prototype.serializeInlineStyle=function(e){return this.serializeCharacterFormat(e)},e.prototype.serializeTableBorderStyle=function(e){var i="";return t.isNullOrUndefined(e.left.lineStyle)||(i+="border-left-style:"+this.convertBorderLineStyle(e.left.lineStyle),i+=";"),e.left.lineWidth&&(i+="border-left-width:"+e.left.lineWidth.toString()+"pt",i+=";"),t.isNullOrUndefined(e.left.color)||(i+="border-left-color:"+L.getColor(e.left.color),i+=";"),t.isNullOrUndefined(e.right.lineStyle)||(i+="border-right-style:"+this.convertBorderLineStyle(e.right.lineStyle),i+=";"),t.isNullOrUndefined(e.right.lineWidth)||(i+="border-right-width:"+e.right.lineWidth.toString()+"pt",i+=";"),t.isNullOrUndefined(e.right.color)||(i+="border-right-color:"+L.getColor(e.right.color),i+=";"),t.isNullOrUndefined(e.top.lineStyle)||(i+="border-top-style:"+this.convertBorderLineStyle(e.top.lineStyle),i+=";"),t.isNullOrUndefined(e.top.lineWidth)||(i+="border-top-width:"+e.top.lineWidth.toString()+"pt",i+=";"),t.isNullOrUndefined(e.top.color)||(i+="border-top-color:"+L.getColor(e.bottom.color),i+=";"),t.isNullOrUndefined(e.bottom.lineStyle)||(i+="border-bottom-style:"+this.convertBorderLineStyle(e.bottom.lineStyle),i+=";"),t.isNullOrUndefined(e.bottom.lineWidth)||(i+="border-bottom-width:"+e.bottom.lineWidth.toString()+"pt",i+=";"),t.isNullOrUndefined(e.bottom.color)||(i+="border-bottom-color:"+L.getColor(e.bottom.color),i+=";"),i},e.prototype.serializeCellBordersStyle=function(){return"border:solid 1px;","border:solid 1px;"},e.prototype.serializeBorderStyle=function(e,i){var n="";return n+="border-"+i+"-style:"+this.convertBorderLineStyle(e.lineStyle),n+=";",e.lineWidth>0&&(n+="border-"+i+"-width:"+e.lineWidth.toString()+"pt;"),t.isNullOrUndefined(e.color)||(n+="border-"+i+"-color:"+L.getColor(e.color)+";"),n},e.prototype.convertBorderLineStyle=function(e){switch(e){case"None":return"none";case"Single":return"solid";case"Dot":return"dotted";case"DashSmallGap":case"DashLargeGap":case"DashDot":case"DashDotDot":return"dashed";case"Double":case"Triple":case"ThinThickSmallGap":case"ThickThinSmallGap":case"ThinThickThinSmallGap":case"ThinThickMediumGap":case"ThickThinMediumGap":case"ThinThickThinMediumGap":case"ThinThickLargeGap":case"ThickThinLargeGap":case"ThinThickThinLargeGap":return"double";case"SingleWavy":return"solid";case"DoubleWavy":return"double";case"DashDotStroked":return"solid";case"Emboss3D":return"ridge";case"Engrave3D":return"groove";case"Outset":return"outset";case"Inset":return"inset";default:return"solid"}},e.prototype.serializeCharacterFormat=function(e){if(!t.isNullOrUndefined(e.inlineFormat))return this.serializeCharacterFormat(e.inlineFormat);var i,n="";return n+="font-weight",n+=":",n+=e.bold?"bold":"normal",n+=";",n+="font-style",n+=":",e.italic?n+="italic":n+="normal",n+=";",n+=this.serializeTextDecoration(e),"Superscript"!==e.baselineAlignment&&"Subscript"!==e.baselineAlignment||(n+="vertical-align",n+=":",n+="Superscript"===e.baselineAlignment?"super":"sub",n+=";"),t.isNullOrUndefined(e.highlightColor)||"NoColor"===e.highlightColor||(n+="background-color",n+=":",n+=L.getColor(e.highlightColor.toString()),n+=";"),i=e.fontColor,t.isNullOrUndefined(i)||(n+="color",n+=":",n+=L.getColor(i),n+=";"),!t.isNullOrUndefined(e.allCaps)&&e.allCaps&&(n+="text-transform",n+=":",n+="uppercase",n+=";"),i=e.fontSize,t.isNullOrUndefined(i)||(n+="font-size",n+=":",n+=i.toString(),n+="pt",n+=";"),i=e.fontFamily,t.isNullOrUndefined(i)||(n+="font-family",n+=":",n+=i.toString(),n+=";"),n.toString()},e.prototype.serializeTextDecoration=function(e){var i="";return"SingleStrike"!==e.strikethrough&&"DoubleStrike"!==e.strikethrough||(i+="line-through "),t.isNullOrUndefined(e.underline)||"None"===e.underline||(i+="underline"),i.length>1&&(i="text-decoration:"+i+";"),i},e.prototype.serializeParagraphFormat=function(e,i){if(!t.isNullOrUndefined(e.inlineFormat))return this.serializeParagraphFormat(e.inlineFormat,i);var n,r="";return n=e.textAlignment,t.isNullOrUndefined(n)||(r+="text-align:"+n.toLowerCase()+";"),n=e.beforeSpacing,t.isNullOrUndefined(n)||(r+="margin-top:"+n.toString()+"pt; "),n=e.rightIndent,t.isNullOrUndefined(n)||(r+="margin-right:"+n.toString()+"pt; "),n=e.afterSpacing,t.isNullOrUndefined(n)||(r+="margin-bottom:"+n.toString()+"pt; "),n=e.leftIndent,i&&(n=0),t.isNullOrUndefined(n)||(r+="margin-left:"+n.toString()+"pt; "),n=e.firstLineIndent,i&&(n=0),t.isNullOrUndefined(n)||0===n||(r+="text-indent:"+n.toString()+"pt;"),n=e.lineSpacing,t.isNullOrUndefined(n)||(r+="line-height:"+(n="Multiple"===e.lineSpacingType?Math.round(10*n)/10:n.toString()+"pt;")),r.toString()},e.prototype.createAttributesTag=function(e,t){var i="";i+="<",i+=e;for(var n=0;n<t.length;n++)i+=" ",i+=t[n];return"a"!==e&&(i+=">"),i},e.prototype.createTag=function(e){var t="";return t+="<",t+=e,t+=">"},e.prototype.endTag=function(e){var t="";return t+="<",t+="/",t+=e,t+=">"},e.prototype.createTableStartTag=function(e){var i="",n="",r=[];return r.push('border="1"'),t.isNullOrUndefined(e.tableFormat)||(t.isNullOrUndefined(e.tableFormat.shading)||t.isNullOrUndefined(e.tableFormat.shading.backgroundColor)||r.push('bgcolor="'+L.getColor(e.tableFormat.shading.backgroundColor)+'"'),t.isNullOrUndefined(e.tableFormat.leftIndent)||0===e.tableFormat.leftIndent||r.push('left-indent="'+e.tableFormat.leftIndent.toString()+'pt;"'),!t.isNullOrUndefined(e.tableFormat.cellSpacing)&&e.tableFormat.cellSpacing>0?r.push('cellspacing="'+(72*e.tableFormat.cellSpacing/96*2).toString()+'"'):n+="border-collapse:collapse;",r.push('cellpadding="0"'),t.isNullOrUndefined(e.tableFormat.borders)||(n+=this.serializeTableBorderStyle(e.tableFormat.borders))),0!==n.length&&r.push('style="',n.toString()+'"'),i+=this.createAttributesTag("table",r)},e.prototype.createTableEndTag=function(){var e="";return e+=this.endTag("table")},e.prototype.createRowStartTag=function(e){var i="",n=[];if(e.rowFormat.isHeader&&(i+=this.createTag("thead")),!t.isNullOrUndefined(e.rowFormat.height)&&e.rowFormat.height>0){var r=L.convertPointToPixel(e.rowFormat.height);n.push('height="'+r+'"')}return i+this.createAttributesTag("tr",n)},e.prototype.createRowEndTag=function(e){var t="";return t+=this.endTag("tr"),e.rowFormat.isHeader&&(t+=this.endTag("thead")),t},e.prototype.decodeHtmlNames=function(e){if("\t"===e)return" ";var t=(e=e.replace(/</g,"<").replace(/>/g,">")).split(" "),i="";if(t.length>0){i=t[0];for(var n=0;n<t.length-1;n++)i+=" "+t[n+1]}return i},e}(),kt=function(){function e(e){this.location=new R(0,0),this.isUpdateLocation=!0,this.owner=e,this.documentHelper=this.owner.documentHelper}return Object.defineProperty(e.prototype,"paragraph",{get:function(){return this.currentWidget.paragraph},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAtParagraphStart",{get:function(){return this.offset===this.owner.selection.getStartOffset(this.paragraph)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAtParagraphEnd",{get:function(){return this.owner.selection.isParagraphLastLine(this.currentWidget)&&this.offset===this.owner.selection.getLineLength(this.currentWidget)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCurrentParaBidi",{get:function(){return!t.isNullOrUndefined(this.currentWidget.paragraph)&&this.currentWidget.paragraph.paragraphFormat.bidi},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){return this.owner.selection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hierarchicalPosition",{get:function(){return this.getHierarchicalIndexInternal()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e(this.owner);return t.currentWidget=this.currentWidget,t.offset=this.offset,t.location=this.location,t},e.prototype.containsRtlText=function(e){for(var t=0;t<e.children.length;t++)if(e.children[t].isRightToLeft)return!0;return!1},e.prototype.setPositionForSelection=function(e,i,n,r){var o=!1;t.isNullOrUndefined(i)?this.currentWidget=e:(this.currentWidget=i.line,i.nextNode instanceof Ie&&n>i.length&&(o=this.selection.isLastRenderedInline(i,i.length))),this.location=r,this.offset=o?this.selection.getParagraphLength(this.currentWidget.paragraph)+1:this.currentWidget.getOffset(i,n)},e.prototype.setPositionFromLine=function(e,t,i){this.currentWidget=e,this.offset=t,i instanceof R&&this.location.copy(i)},e.prototype.setPosition=function(e,t){this.currentWidget=e,this.offset=t?this.selection.getStartOffset(e.paragraph):e.paragraph.lastChild.getEndOffset()+1,this.updatePhysicalPosition(!0)},e.prototype.setPositionInternal=function(e){this.currentWidget=e.currentWidget,this.offset=e.offset,this.location=e.location},e.prototype.setPositionForCurrentIndex=function(e){var t={index:e},i=this.getParagraphWidget(t);this.offset=parseFloat(t.index),this.setPositionParagraph(i,this.offset)},e.prototype.getPage=function(e){var t=e.index.indexOf(";"),i="0";return t>=0&&(i=e.index.substring(0,t),e.index=e.index.substring(t).replace(";","")),t=parseInt(i,10),this.documentHelper.pages[t]},e.prototype.getParagraphWidget=function(e){if(!t.isNullOrUndefined(e.index)){var i=this.getPage(e);return this.getLineWidget(void 0,e,i)}},e.prototype.getLineWidget=function(e,i,n){if(!t.isNullOrUndefined(i.index)){var r=i.index.indexOf(";"),o="0";if(r>=0&&(o=i.index.substring(0,r),i.index=i.index.substring(r).replace(";","")),"H"===o||"F"===o?e="H"===o?n.headerWidget:n.footerWidget:"FN"===o||"EN"===o?e="FN"===o?n.footnoteWidget:n.endnoteWidget:t.isNullOrUndefined(n)||(e=n.bodyWidgets[0]),r=parseInt(o,10),e instanceof me&&(r=i.index.indexOf(";"),o="0",o=i.index.substring(0,r),i.index=i.index.substring(r).replace(";",""),r=parseInt(o,10)),e instanceof Fe&&r>=e.childWidgets.length&&(i.index="0;0",r=e.childWidgets.length-1),r>=0&&r<e.childWidgets.length){var s=e.childWidgets[r];if(s instanceof Te)return i.index.indexOf(";")>0&&(i.index="0"),s;if(s instanceof ue){if(i.index.indexOf(";")>0)return this.getLineWidget(s,i);if(s instanceof xe)return this.getLineWidget(this.selection.getFirstParagraphInFirstCell(s),i);if(s instanceof Fe&&-1===i.index.indexOf(";"))return this.selection.getFirstParagraphInFirstCell(s.ownerTable).childWidgets[0];return}}else if(e.nextRenderedWidget instanceof ue)return i.index="0",e.nextRenderedWidget instanceof xe?this.selection.getFirstParagraphInFirstCell(e.nextRenderedWidget).firstChild:this.getLineWidget(e.nextRenderedWidget,i)}},e.prototype.updatePhysicalPosition=function(e){this.currentWidget&&this.owner.isLayoutEnabled&&this.isUpdateLocation&&(this.location=this.selection.getPhysicalPositionInternal(this.currentWidget,this.offset,e))},e.prototype.isAtSamePosition=function(e){return this.currentWidget===e.currentWidget&&this.offset===e.offset},e.prototype.isInSameParagraphIndex=function(e){if(t.isNullOrUndefined(e))throw new Error("textPosition is undefined.");return this.paragraph.index===e.paragraph.index},e.prototype.isInSameParagraph=function(e){if(t.isNullOrUndefined(e))throw new Error("textPosition is undefined.");return this.paragraph===e.paragraph},e.prototype.isExistBefore=function(e){if(t.isNullOrUndefined(e))throw new Error("textPosition is undefined.");if(this.currentWidget===e.currentWidget)return this.offset<e.offset;var i=this.currentWidget.paragraph,n=e.currentWidget.paragraph;return i===n?i.childWidgets.indexOf(this.currentWidget)<n.childWidgets.indexOf(e.currentWidget):i.containerWidget===n.containerWidget?i.isInsideTable?i.associatedCell.childWidgets.indexOf(i)<n.associatedCell.childWidgets.indexOf(n):i.containerWidget.childWidgets.indexOf(i)<n.containerWidget.childWidgets.indexOf(n):this.owner.selection.isExistBefore(i,n)},e.prototype.isExistAfter=function(e){if(t.isNullOrUndefined(e))throw new Error("textPosition is undefined.");if(this.currentWidget===e.currentWidget)return this.offset>e.offset;if(this.currentWidget.paragraph===e.currentWidget.paragraph)return this.currentWidget.paragraph.childWidgets.indexOf(this.currentWidget)>e.currentWidget.paragraph.childWidgets.indexOf(e.currentWidget);var i=this.currentWidget.paragraph,n=e.currentWidget.paragraph;return i.containerWidget instanceof fe&&n.containerWidget instanceof fe&&i.containerWidget===n.containerWidget?i.isInsideTable&&n.isInsideTable?i.associatedCell.childWidgets.indexOf(i)>n.associatedCell.childWidgets.indexOf(n):i.containerWidget.childWidgets.indexOf(i)>n.containerWidget.childWidgets.indexOf(n):this.owner.selection.isExistAfter(i,n)},e.prototype.getHierarchicalIndexInternal=function(){return this.getHierarchicalIndex(this.currentWidget,this.offset.toString())},e.prototype.getHierarchicalIndex=function(e,t){var i=e;return i?i.getHierarchicalIndex(t):t},e.prototype.setPositionParagraph=function(e,t){this.currentWidget=e,this.offset=t,this.updatePhysicalPosition(!0)},e.prototype.setPositionForLineWidget=function(e,i){var n=this.selection.getLineLength(e),r=e.paragraph.childWidgets.indexOf(e);if(e.isLastLine()&&(t.isNullOrUndefined(e.paragraph.footNoteReference)?n+=1:n+=e.paragraph.footNoteReference.text.length),i>n){var o=void 0;if(r>=e.paragraph.childWidgets.length-1){var s=this.selection.getNextRenderedBlock(e.paragraph);s&&s.index===e.paragraph.index&&(o=s.firstChild)}else o=e.paragraph.childWidgets[r+1];return void this.setPositionForLineWidget(o,i-n)}if(i<0){var a=e.paragraph.childWidgets[r-1],l=this.selection.getLineLength(a)+i;return void this.setPositionForLineWidget(a,l)}this.currentWidget=e,this.offset=i,this.updatePhysicalPosition(!0)},e.prototype.moveNextPosition=function(i){t.isNullOrUndefined(i)&&(i=!0);var n=this.selection.getNextStartInline(this.currentWidget,this.offset);if(n instanceof Ie&&0===n.fieldType&&!t.isNullOrUndefined(n.fieldEnd)){if(i)return this.moveNextPositionInternal(n),void this.moveNextPosition();var r=n.fieldEnd.line,o=n.fieldEnd,s=r.getOffset(o,1),a=this.getHierarchicalIndex(r,s.toString());if(e.isForwardSelection(this.selection.end.getHierarchicalIndexInternal(),a))return void this.selection.end.moveToInline(n.fieldEnd,1);this.moveToInline(n.fieldEnd,1)}var l=this.selection.getNextValidOffset(this.currentWidget,this.offset),d=this.paragraph.childWidgets.indexOf(this.currentWidget),h=0;if(l>this.offset){this.offset=l;var c=this.currentWidget.getInline(this.offset,h);if(n=c.element,h=c.index,!t.isNullOrUndefined(n)&&h===n.length&&(n.nextNode instanceof Ie||n.nextNode instanceof Ae)){var p=this.selection.getNextValidElement(n.nextNode);(p instanceof Ie&&1===p.fieldType||p instanceof Ae&&1===p.bookmarkType)&&(n=p,this.currentWidget=n.line,this.offset=this.currentWidget.getOffset(n,this.documentHelper.isFormFillProtectedMode?0:1))}}else if(d+1<this.paragraph.childWidgets.length){var g=this.paragraph.childWidgets[d+1];g&&(this.currentWidget=g,this.offset=this.selection.getStartLineOffset(this.currentWidget));var u=this.currentWidget.getInline(this.offset,h);n=u.element,h=u.index,n instanceof Ie&&0===n.fieldType&&this.offset++}else this.updateOffsetToNextParagraph(h,!1);this.updatePhysicalPosition(!0)},e.prototype.moveToPreviousParagraphInTable=function(e){var i,n=this.currentWidget.paragraph;i=n.isInsideTable?e.getPreviousSelectionCell(n.associatedCell):e.getPreviousParagraphBlock(n),t.isNullOrUndefined(i)||(this.currentWidget=i.childWidgets[i.childWidgets.length-1],this.offset=this.currentWidget.getEndOffset()+1)},e.prototype.updateOffsetToNextParagraph=function(e,i){var n,r=!1,o=void 0,s=this.paragraph.childWidgets.indexOf(this.currentWidget);if(i)if(s+1<this.paragraph.childWidgets.length){var a=this.paragraph.childWidgets[s+1];a&&(this.currentWidget=a,this.offset=1)}else o=this.selection.getNextSelectionBlock(this.paragraph),t.isNullOrUndefined(o)||o.containerWidget instanceof Pe&&(r=!this.selection.start.paragraph.isInsideTable||!this.selection.getContainerCellOf(this.selection.start.paragraph.associatedCell,o.associatedCell).ownerTable.contains(o.associatedCell));else o=this.selection.getNextParagraphBlock(this.paragraph);!t.isNullOrUndefined(o)&&o.childWidgets.length>0&&(r?(this.currentWidget=o.childWidgets[o.childWidgets.length-1],this.offset=this.selection.getLineLength(this.currentWidget)+1):(this.currentWidget=o.firstChild,this.offset=i?1:this.selection.getStartLineOffset(this.currentWidget)));var l=this.currentWidget.getInline(this.offset,e);n=l.element,e=l.index,n instanceof Ie&&0===n.fieldType&&this.offset++},e.prototype.updateOffsetToPrevPosition=function(e,i){var n,r,o=this.paragraph.childWidgets.indexOf(this.currentWidget),s=this.selection.getPreviousValidOffset(this.currentWidget.paragraph,this.offset);if(this.offset>s)this.offset=s;else if(o>0){var a=this.paragraph.childWidgets[o-1];if(a){this.currentWidget=a;var l=this.currentWidget.getEndOffset();this.offset=l>0?l-1:l}}else{var d=void 0,h=!1;i?(d=this.selection.getPreviousSelectionBlock(this.paragraph),t.isNullOrUndefined(d)||d.containerWidget instanceof Pe&&(h=!this.selection.start.paragraph.isInsideTable||!this.selection.getContainerCellOf(this.selection.start.paragraph.associatedCell,d.associatedCell).ownerTable.contains(d.associatedCell))):d=this.selection.getPreviousParagraphBlock(this.paragraph),t.isNullOrUndefined(d)||(h?(this.currentWidget=d.firstChild,this.offset=this.selection.getStartLineOffset(this.currentWidget)):(this.currentWidget=d.childWidgets[d.childWidgets.length-1],this.offset=this.currentWidget.isEndsWithPageBreak?this.currentWidget.getEndOffset()-1:this.currentWidget.getEndOffset()))}if(e=0,n=this.currentWidget.getInline(this.offset,e),r=n.element,e=n.index,r instanceof Ie&&0===r.fieldType&&this.offset++,r instanceof Ie){var c=this.selection.getPreviousValidElement(r);t.isNullOrUndefined(c)||(r=c,this.currentWidget=r.line,this.offset=this.currentWidget.getOffset(r,r.length),r instanceof Ie&&0===r.fieldType&&this.offset--)}this.updatePhysicalPosition(!0)},e.prototype.moveToNextParagraphStartInternal=function(){var e=this.currentWidget.paragraph;t.isNullOrUndefined(this.selection.getNextParagraphBlock(e))||(this.currentWidget=this.selection.getNextParagraphBlock(e).firstChild,this.offset=this.selection.getStartOffset(e),this.updatePhysicalPosition(!0))},e.prototype.movePreviousPosition=function(){var e=0,i=this.currentWidget.getInline(this.offset,e),n=i.element;e=i.index;this.paragraph.childWidgets.indexOf(this.currentWidget);(n instanceof Ie&&1===n.fieldType&&!t.isNullOrUndefined(n.fieldBegin)||n instanceof Ae&&1===n.bookmarkType)&&this.movePreviousPositionInternal(n),this.updateOffsetToPrevPosition(e,!1)},e.prototype.moveNextPositionInternal=function(e){var i;t.isNullOrUndefined(e.fieldSeparator)?i=e.fieldEnd:(i=e.fieldSeparator,this.currentWidget=i.line,this.currentWidget!==e.fieldEnd.line||this.selection.hasValidInline(this.paragraph,i,e.fieldEnd)||(i=e.fieldEnd)),this.currentWidget=i.line,this.offset=this.currentWidget.getOffset(i,1)},e.prototype.moveBackward=function(){var i=0,n=this.currentWidget.getInline(this.offset,i),r=n.element;if(i=n.index,!this.owner.selection.isEmpty&&!t.isNullOrUndefined(r)){var o=this.selection.getNextRenderedElementBox(r,i);if(o instanceof Ie&&0===o.fieldType){var s=this.owner.selection.start.getHierarchicalIndexInternal(),a=o.fieldEnd.line.getOffset(o.fieldEnd,1),l=this.getHierarchicalIndex(o.fieldEnd.line,a.toString());if(!e.isForwardSelection(l,s))return void this.owner.selection.start.setPositionParagraph(o.fieldEnd.line,a)}}if(r instanceof Ie&&1===r.fieldType&&!t.isNullOrUndefined(r.fieldBegin)){var s=this.owner.selection.start.getHierarchicalIndexInternal(),a=r.line.getOffset(r,1),l=this.getHierarchicalIndex(r.line,a.toString());if(!e.isForwardSelection(s,l)){var d=r.fieldBegin.line.getOffset(r.fieldBegin,0);return this.currentWidget=r.fieldBegin.line,this.offset=d,void this.updatePhysicalPosition(!0)}this.movePreviousPositionInternal(r)}this.updateOffsetToPrevPosition(i,!0)},e.prototype.moveForward=function(){var i=0,n=this.currentWidget.getInline(this.offset,i),r=n.element;if(i=n.index,!t.isNullOrUndefined(r)){if(!this.owner.selection.isEmpty&&i===r.length&&r instanceof Ie&&1===r.fieldType){var o=this.owner.selection.start.getHierarchicalIndexInternal(),s=r.fieldBegin.line.getOffset(r.fieldBegin,0),a=this.getHierarchicalIndex(r.fieldBegin.line,s.toString());if(!e.isForwardSelection(o,a))return void this.owner.selection.start.setPositionParagraph(r.fieldBegin.line,s)}r=this.selection.getNextRenderedElementBox(r,i)}if(r instanceof Ie&&!t.isNullOrUndefined(r.fieldEnd)){var l=0,d=this.owner.selection.start.paragraph.getInline(this.owner.selection.start.offset,l),h=d.element;if(l=d.index,this.selection.getNextRenderedElementBox(h,l)!==r)return r=r.fieldEnd,this.currentWidget=r.line,this.offset=this.currentWidget.getOffset(r,1),void this.updatePhysicalPosition(!0);this.moveNextPositionInternal(r)}else r instanceof Ie&&(0===r.fieldType||1===r.fieldType)&&(this.currentWidget=r.line,this.offset=this.currentWidget.getOffset(r,1));i=0;var c=this.selection.getNextValidOffset(this.currentWidget,this.offset),p=this.selection.getLineLength(this.currentWidget),g=this.selection.isParagraphLastLine(this.currentWidget);if(this.offset<c){this.offset=c;var u=this.currentWidget.getInline(this.offset,i);if(r=u.element,i=u.index,!t.isNullOrUndefined(r)&&i===r.length&&r.nextNode instanceof Ie){var m=this.selection.getNextValidElement(r.nextNode);m instanceof Ie&&1===m.fieldType&&(r=m,this.offset=this.currentWidget.getOffset(r,1))}}else this.offset===c&&r instanceof Ie&&1===r.fieldType&&r.previousNode instanceof Ze?this.offset=c:this.offset===c&&this.offset<p+1&&g?this.offset=p+1:this.updateOffsetToNextParagraph(i,!0);this.updatePhysicalPosition(!0)},e.prototype.moveToInline=function(e,t){this.currentWidget=e.line,this.offset=this.currentWidget.getOffset(e,t),this.updatePhysicalPosition(!0)},e.isForwardSelection=function(e,t){if(e===t)return!0;e=e.replace(/C;/g,""),t=t.replace(/C;/g,""),e=e.replace(/H;/g,""),t=t.replace(/H;/g,""),e=e.replace(/F;/g,""),t=t.replace(/F;/g,"");var i=e.split(";"),n=t.split(";"),r=i.length;r>n.length&&(r=n.length-1);for(var o=0;o<r;o++){var s=parseFloat(i[o]),a=parseFloat(n[o]);if(s!==a)return s<a}return!1},e.prototype.movePreviousPositionInternal=function(e){var i;i=e instanceof Ie&&t.isNullOrUndefined(e.fieldSeparator)?this.selection.getPreviousValidElement(e.fieldBegin):this.selection.getPreviousValidElement(e),this.currentWidget=i.line;var n=i instanceof Ie||i instanceof Ae&&1===i.bookmarkType?0:i.length;this.offset=this.currentWidget.getOffset(i,n)},e.prototype.moveToWordStartInternal=function(e){var i=this.currentWidget.getEndOffset(),n=this.currentWidget.paragraph,r=this.selection;if(2!==e||this.offset!==i&&this.offset!==i+1){if(this.offset===i+1)this.offset=i;else if(this.offset===r.getStartOffset(n)&&this.currentWidget===n.childWidgets[0]){var o=r.getPreviousParagraphBlock(n);if(t.isNullOrUndefined(o))return;this.currentWidget=o.childWidgets[o.childWidgets.length-1],this.offset=this.currentWidget.getEndOffset()}else{if(this.offset===r.getStartLineOffset(this.currentWidget)){var s=n.childWidgets.indexOf(this.currentWidget);s-1>=0&&(this.currentWidget=n.childWidgets[s-1],this.offset=this.currentWidget.getEndOffset())}var a=0,l=this.currentWidget.getInline(this.offset,a),d=l.element;a=l.index,this.getPreviousWordOffset(d,r,a,e,d instanceof Ie&&1===d.fieldType,!1,!1,this)}1===e&&this.calculateOffset(),this.updatePhysicalPosition(!0)}},e.prototype.getNextWordOffset=function(e,t,i,n,r,o,s){e instanceof Oe?this.getNextWordOffsetSpan(e,t,i,n,r,o,s):e instanceof Ze?this.getNextWordOffsetImage(e,t,i,n,r,o,s):e instanceof Ie&&0===e.fieldType?this.getNextWordOffsetFieldBegin(e,t,i,n,r,o,s):e instanceof Ie&&2===e.fieldType||e instanceof Ae?this.getNextWordOffsetFieldSeparator(e,t,i,n,r,o,s):e instanceof Ie&&1===e.fieldType?this.getNextWordOffsetFieldEnd(e,t,i,n,r,o,s):e instanceof vt&&this.getNextWordOffsetComment(e,t,i,n,r,o,s)},e.prototype.getNextWordOffsetFieldBegin=function(e,i,n,r,o,s,a){var l=e.line.getOffset(e,0);e.length;if(t.isNullOrUndefined(e.fieldSeparator))this.getNextWordOffsetFieldEnd(e.fieldEnd,0,n,r,o,s,a);else if(0===n)this.getNextWordOffsetFieldSeparator(e.fieldSeparator,0,n,r,o,s,a);else if(!t.isNullOrUndefined(e.fieldEnd)){var d=e.fieldSeparator;if(d.line.paragraph!==e.fieldEnd.line.paragraph||this.selection.hasValidInline(d.line.paragraph,d,e.fieldEnd)||(d=e.fieldEnd),this.getNextWordOffset(d,0,n,!(s.paragraph===e.line.paragraph&&s.offset===l),o,s,a),o&&!t.isNullOrUndefined(e.fieldSeparator)&&s.paragraph===e.line.paragraph&&s.offset===e.fieldSeparator.line.getOffset(e.fieldSeparator,e.fieldSeparator.length))return void s.setPositionParagraph(e.line,l);o||s.setPositionParagraph(e.fieldEnd.line,e.fieldEnd.line.getOffset(e.fieldEnd,e.fieldEnd.length))}},e.prototype.getNextWordOffsetImage=function(e,i,n,r,o,s,a){if(r)return s.setPositionParagraph(e.line,e.line.getOffset(e,i)),void(o=!1);if(0===i){var l=e.line.getOffset(e,0);o=!0,s.offset===l?t.isNullOrUndefined(e.nextNode)?s.setPositionParagraph(e.line,l+e.length):this.getNextWordOffset(e.nextNode,0,n,r,o,s,a):s.setPositionParagraph(e.line,l)}else t.isNullOrUndefined(e.nextNode)||this.getNextWordOffset(e.nextNode,0,n,r,o,s,a)},e.prototype.getNextWordOffsetSpan=function(e,i,n,r,o,s,a){if("\t"===e.text||"\v"===e.text){if(r)return s.setPositionParagraph(e.line,e.line.getOffset(e,i)),void(o=!1);if(0===i){o=!0;var l=e.line.getOffset(e,0);s.offset===l?s.setPositionParagraph(e.line,l+e.length):s.setPositionParagraph(e.line,l)}else t.isNullOrUndefined(e.nextNode)||this.getNextWordOffset(e.nextNode,0,n,r,o,s,a)}else{var d=0;if(0===i&&o&&-1===L.wordSplitCharacters.indexOf(e.text[0])){if(s.setPositionParagraph(e.line,e.line.getOffset(e,i)),r)return}else if(i<e.length){var h=i>0&&e.text.length-1>=i?e.text.slice(i,e.length):e.text;if(-1===(d=L.indexOfAny(h,L.wordSplitCharacters))&&e.nextNode instanceof vt&&t.isNullOrUndefined(e.nextNode.nextNode)&&(d=e.length),-1!==d){if(r)return void(o=!1);var c=e.line.getOffset(e,d+i);if((a||" "!==h[d])&&!o&&e.line.paragraph===s.paragraph&&c!==s.offset)return o=!0,void s.setPositionParagraph(e.line,c);for(d++;d<h.length&&-1!==L.wordSplitCharacters.indexOf(h[d])&&(" "===h[d]||" "===h[d]);)d++;o=!0,d<h.length?s.setPositionParagraph(e.line,e.line.getOffset(e,d+i)):t.isNullOrUndefined(e.nextNode)?s.setPositionParagraph(e.line,e.line.getOffset(e,d+i)):this.getNextWordOffset(e.nextNode,0,n,r,o,s,a)}else t.isNullOrUndefined(e.nextNode)?s.setPositionParagraph(e.line,e.line.getEndOffset()):this.getNextWordOffset(e.nextNode,0,n,r,o,s,a)}else t.isNullOrUndefined(e.nextNode)||this.getNextWordOffset(e.nextNode,0,n,r,o,s,a)}},e.prototype.getNextWordOffsetFieldSeparator=function(e,i,n,r,o,s,a){t.isNullOrUndefined(e.nextNode)||this.getNextWordOffset(e.nextNode,0,n,r,o,s,a)},e.prototype.getNextWordOffsetComment=function(e,i,n,r,o,s,a){t.isNullOrUndefined(e.nextNode)||this.getNextWordOffset(e.nextNode,0,n,r,o,s,a)},e.prototype.getNextWordOffsetFieldEnd=function(e,i,n,r,o,s,a){var l=e.line.getOffset(e,0),d=l+e.length;s.offset===l&&(s.setPositionParagraph(e.line,d),t.isNullOrUndefined(e.nextNode))||(t.isNullOrUndefined(e.nextNode)?s.setPositionParagraph(e.line,l):(this.getNextWordOffset(e.nextNode,0,n,!1,o,s,a),s.offset===d&&s.setPositionParagraph(e.line,l)),o=!0)},e.prototype.getPreviousWordOffset=function(e,t,i,n,r,o,s,a){e instanceof Oe?this.getPreviousWordOffsetSpan(e,t,i,n,r,o,s,a):e instanceof Ze?this.getPreviousWordOffsetImage(e,t,i,n,r,o,s,a):e instanceof Ie&&0===e.fieldType?this.getPreviousWordOffsetFieldBegin(e,t,i,n,r,o,s,a):e instanceof Ie&&2===e.fieldType?this.getPreviousWordOffsetFieldSeparator(e,t,i,n,r,o,s,a):e instanceof Ie&&1===e.fieldType?this.getPreviousWordOffsetFieldEnd(e,t,i,n,r,o,s,a):e instanceof Ae?this.getPreviousWordOffsetBookMark(e,t,i,n,r,o,s,a):e instanceof Qe&&e.previousNode?this.getPreviousWordOffsetSpan(e.previousNode,t,i,n,r,o,s,a):e instanceof vt&&this.getPreviousWordOffsetComment(e,t,i,n,r,o,s,a)},e.prototype.getPreviousWordOffsetBookMark=function(e,t,i,n,r,o,s,a){if(e.previousNode){if(e.previousNode instanceof Oe){var l=e.previousNode;L.lastIndexOfAny(l.text,L.wordSplitCharacters)!==l.text.length-1?this.getPreviousWordOffset(l,t,i,n,r,o,s,a):a.setPositionParagraph(e.line,e.line.getOffset(e,0))}}else a.setPositionParagraph(e.line,t.getStartLineOffset(e.line))},e.prototype.getPreviousWordOffsetFieldEnd=function(e,i,n,r,o,s,a,l){var d=e.line.getOffset(e,0),h=d+e.length;if(t.isNullOrUndefined(e.fieldSeparator))this.getPreviousWordOffsetFieldBegin(e.fieldBegin,i,0,r,o,s,a,l);else if(0!==r||t.isNullOrUndefined(e.previousNode)){if(!t.isNullOrUndefined(e.fieldBegin)&&0!==r){c=e.previousNode;if((t.isNullOrUndefined(c)||c.line.paragraph===e.fieldBegin.line.paragraph&&!i.hasValidInline(c.line.paragraph,c,e.fieldBegin))&&(c=e.fieldBegin),this.getPreviousWordOffset(c,i,c.length,r,!(l.paragraph===e.line.paragraph&&l.offset===h),s,a,l),a&&l.paragraph===e.line.paragraph&&l.offset===d)return void l.setPositionParagraph(e.line,h);a||l.setPositionParagraph(e.fieldBegin.line,e.fieldBegin.line.getOffset(e.fieldBegin,0))}}else{var c=e.previousNode;this.getPreviousWordOffset(c,i,c.length,r,c instanceof Ie&&1===c.fieldType,s,a,l)}},e.prototype.getPreviousWordOffsetFieldSeparator=function(e,t,i,n,r,o,s,a){this.getPreviousWordOffsetFieldBegin(e.fieldBegin,t,e.fieldBegin.length,n,r,o,s,a)},e.prototype.getPreviousWordOffsetComment=function(e,t,i,n,r,o,s,a){if(e.previousNode){var l=e.previousNode;e.previousNode instanceof Oe&&L.lastIndexOfAny(l.text,L.wordSplitCharacters)!==l.text.length-1?this.getPreviousWordOffset(l,t,i,n,r,o,s,a):this.getPreviousWordOffset(e.previousNode,t,e.previousNode.length,n,r,o,s,a)}else a.setPositionParagraph(e.line,t.getStartLineOffset(e.line))},e.prototype.getPreviousWordOffsetFieldBegin=function(e,i,n,r,o,s,a,l){var d=e.line.getOffset(e,0),h=d+e.length;l.offset===h&&l.setPositionParagraph(e.line,d),t.isNullOrUndefined(e.previousNode)?e.fieldSeparator?l.setPositionParagraph(e.line,e.fieldSeparator.line.getOffset(e.fieldSeparator,e.fieldSeparator.length)):l.setPositionParagraph(e.line,i.getStartLineOffset(e.line)):(this.getPreviousWordOffset(e.previousNode,i,e.previousNode.length,r,!1,s,a,l),l.offset===d&&(0===r||t.isNullOrUndefined(e.fieldSeparator)||l.setPositionParagraph(e.line,e.fieldSeparator.line.getOffset(e.fieldSeparator,e.fieldSeparator.length))))},e.prototype.getPreviousWordOffsetImage=function(e,i,n,r,o,s,a,l){if(o)return l.setPositionParagraph(e.line,e.line.getOffset(e,n)),void(a=!1);if(n===e.length){var d=e.line.getOffset(e,e.length);d===l.offset?l.setPositionParagraph(e.line,d-e.length):l.setPositionParagraph(e.line,d)}else t.isNullOrUndefined(e.previousNode)||this.getPreviousWordOffset(e.previousNode,i,e.previousNode.length,r,o,s,a,l)},e.prototype.getPreviousWordOffsetSpan=function(e,i,n,r,o,s,a,l){if("\t"===e.text||"\v"===e.text){if(o)return void(a=!1);if(n===e.length){a=!0;var d=e.line.getOffset(e,e.length);d===l.offset?l.setPositionParagraph(e.line,d-e.length):l.setPositionParagraph(e.line,d)}else t.isNullOrUndefined(e.previousNode)||this.getPreviousWordOffset(e.previousNode,i,e.previousNode.length,r,o,s,a,l)}else{var h=0;if(!s){for(;n>0&&" "===e.text[n-1];)n--;l.setPositionParagraph(e.line,e.line.getOffset(e,n))}if(n>0){if(s=!0,0===n&&a&&-1===L.wordSplitCharacters.indexOf(e.text[0]))return l.setPositionParagraph(e.line,e.line.getOffset(e,n)),void(a=!0);var c=e.text.length>n?e.text.slice(0,n):e.text;if(-1===(h=L.lastIndexOfAny(c,L.wordSplitCharacters))&&e.previousElement instanceof vt&&t.isNullOrUndefined(e.previousNode.previousNode)&&(h=e.length),-1!==h){if(o)return void(a=!1);for(;h>0&&a&&" "!==c[h]&&-1!==L.wordSplitCharacters.indexOf(c[h-1]);)h--;if(" "!==c[h]&&" "!==c[h]&&a||h++,a=!0,h>0){var p=e.line.getOffset(e,h);e.line.paragraph===l.paragraph&&p===l.offset?this.getPreviousWordOffsetSpan(e,i,n,r,o,s,a,l):l.setPositionParagraph(e.line,p)}else e.previousNode instanceof Oe?this.getPreviousWordOffset(e.previousNode,i,e.previousNode.length,r,o,s,a,l):l.setPositionParagraph(e.line,e.line.getOffset(e,0))}else this.setPreviousWordOffset(e,i,n,r,o,s,a,l)}else this.setPreviousWordOffset(e,i,n,r,o,s,a,l)}},e.prototype.setPreviousWordOffset=function(e,t,i,n,r,o,s,a){e.previousNode instanceof Se&&e.line===e.previousNode.line?this.getPreviousWordOffset(e.previousNode,t,e.previousNode.length,n,r,o,s,a):a.setPositionParagraph(e.line,t.getStartLineOffset(e.line))},e.prototype.validateForwardFieldSelection=function(i,n){var r=new e(this.owner);r.setPositionForCurrentIndex(i),r.isUpdateLocation=!1;var o=!1;for(this.selection.start.paragraph===this.selection.end.paragraph&&this.selection.start.offset!==this.selection.getStartOffset(this.selection.start.paragraph)||this.selection.end.offset===this.selection.end.currentWidget.getEndOffset()&&this.selection.isParagraphLastLine(this.selection.end.currentWidget)&&this.selection.end.setPositionParagraph(this.selection.end.currentWidget,this.selection.end.offset+1);i!==n&&e.isForwardSelection(i,n)&&(o||(r.moveNextPosition(!1),i!==r.getHierarchicalIndexInternal()));){var s=0,a=r.currentWidget.getInline(r.offset,s),l=a.element;if(s=a.index,!t.isNullOrUndefined(l)){var d=this.selection.start.getHierarchicalIndexInternal();if(s===l.length&&l instanceof Ie&&1===l.fieldType){if(l.line.getOffset(l,0)===this.offset)return;var h=l.fieldBegin.line,c=h.getOffset(l.fieldBegin,0),p=this.getHierarchicalIndex(h,c.toString());e.isForwardSelection(d,p)||this.selection.start.setPositionParagraph(h,c)}var g=this.selection.getNextRenderedElementBox(l,s);!t.isNullOrUndefined(g)&&g instanceof Se&&(l=g)}if(o=l instanceof Ie&&0===l.fieldType&&!t.isNullOrUndefined(l.fieldEnd)){if(l.line.getOffset(l,0)===this.offset)return;var u=l.fieldEnd,m=(u.line.paragraph,u.line.getOffset(u,1)),f=this.getHierarchicalIndex(u.line,m.toString());if(!e.isForwardSelection(f,n))return void this.moveToInline(l.fieldEnd,1);r.moveToInline(l.fieldEnd,1)}i=r.getHierarchicalIndexInternal()}},e.prototype.validateBackwardFieldSelection=function(i,n){var r=new e(this.owner);r.setPositionForCurrentIndex(i),r.isUpdateLocation=!1;var o=!1;(this.selection.start.paragraph!==this.selection.end.paragraph&&this.selection.end.offset!==this.selection.getStartOffset(this.selection.start.paragraph)||this.documentHelper.isSelectionChangedOnMouseMoved&&this.selection.isParagraphFirstLine(this.selection.end.currentWidget)&&this.selection.end.offset===this.selection.getStartOffset(this.selection.start.paragraph))&&(o=!0),o&&this.selection.start.offset===this.selection.start.currentWidget.getEndOffset()&&this.selection.isParagraphLastLine(this.selection.start.currentWidget)&&this.selection.start.setPositionParagraph(this.selection.start.currentWidget,this.selection.start.offset+1);for(var s=this.selection.start.getHierarchicalIndexInternal();i!==n&&e.isForwardSelection(n,i);){var a=0,l=r.currentWidget.getInline(r.offset,a),d=l.element;if(a=l.index,!t.isNullOrUndefined(d)){var h=this.selection.getNextRenderedElementBox(d,a);if(h instanceof Ie&&0===h.fieldType){var c=h.fieldEnd.line,p=c.getOffset(h.fieldEnd,1),g=this.getHierarchicalIndex(c,p.toString());e.isForwardSelection(g,s)||(this.selection.start.setPositionParagraph(c,p),s=g)}}if(d instanceof Ie&&1===d.fieldType&&!t.isNullOrUndefined(d.fieldBegin)){var u=d.fieldBegin.line,m=d.fieldBegin,f=u.getOffset(m,0),v=this.getHierarchicalIndex(u,f.toString());if(!e.isForwardSelection(n,v))return void this.moveToInline(d.fieldBegin,0);r.moveToInline(d.fieldBegin,0)}else r.movePreviousPosition();i=r.getHierarchicalIndexInternal()}},e.prototype.paragraphStartInternal=function(e,i){var n=e.getStartLineOffset(this.currentWidget);if(this.offset===n&&i){if(this.moveToNextParagraphInTableCheck())this.moveToPreviousParagraphInTable(e);else if(!t.isNullOrUndefined(e.getPreviousParagraphBlock(this.currentWidget.paragraph))){var r=e.getPreviousParagraphBlock(this.currentWidget.paragraph);this.currentWidget=r.childWidgets[0],this.offset=e.getStartLineOffset(this.currentWidget)}}else this.currentWidget=this.currentWidget.paragraph.getSplitWidgets()[0].childWidgets[0],this.offset=n;this.calculateOffset()},e.prototype.calculateOffset=function(){var e=this.owner.selection.start.getHierarchicalIndexInternal(),t=this.getHierarchicalIndexInternal();e!==t&&this.validateBackwardFieldSelection(e,t),this.updatePhysicalPosition(!0)},e.prototype.moveToParagraphStartInternal=function(e,i){for(var n=this.currentWidget.paragraph;n.previousSplitWidget;)n=n.previousSplitWidget;var r=e.getStartOffset(n);this.offset===r&&i?this.moveToNextParagraphInTableCheck()?this.moveToPreviousParagraphInTable(e):t.isNullOrUndefined(e.getPreviousParagraphBlock(this.paragraph))||(this.currentWidget=e.getPreviousParagraphBlock(this.paragraph).firstChild,this.offset=e.getStartOffset(this.paragraph)):(this.currentWidget=n.firstChild,this.offset=e.getStartLineOffset(this.currentWidget));var o=this.owner.selection.start.getHierarchicalIndexInternal(),s=this.getHierarchicalIndexInternal();o!==s&&this.validateBackwardFieldSelection(o,s),this.updatePhysicalPosition(!1)},e.prototype.moveToParagraphEndInternal=function(e,i){for(var n=this.currentWidget.paragraph;n.nextSplitWidget;)n=n.nextSplitWidget;this.currentWidget=n.childWidgets[n.childWidgets.length-1];var r=this.currentWidget.getEndOffset()+1;if(this.offset===r&&i){if(this.moveToNextParagraphInTableCheck())this.moveToNextParagraphInTable();else if(!t.isNullOrUndefined(e.getNextParagraphBlock(this.currentWidget.paragraph))){var o=e.getNextParagraphBlock(this.currentWidget.paragraph);this.currentWidget=o.childWidgets[o.childWidgets.length-1],this.offset=this.currentWidget.getEndOffset()+1}}else this.offset=r;this.calculateOffset()},e.prototype.moveUp=function(e,i){var n=this.currentWidget.paragraph;this.moveToLineStartInternal(e,!0),this.movePreviousPosition();var r=void 0,o=this.currentWidget.paragraph;if(n.isInsideTable&&n!==o&&n.associatedCell!==o.associatedCell&&!t.isNullOrUndefined(o.associatedCell)&&n.associatedCell.ownerRow===o.associatedCell.ownerRow){var s=o.associatedCell.ownerRow;if(s.previousRenderedWidget instanceof Fe){var a=e.getFirstCellInRegion(s.previousRenderedWidget,o.associatedCell,i,!0),l=e.getLastParagraph(a);this.setPosition(l.childWidgets[l.childWidgets.length-1],!1)}else{var d=s.ownerTable.previousRenderedWidget;do{d instanceof xe&&(d=e.getLastBlockInLastCell(d))}while(d instanceof xe);d instanceof we&&this.setPosition(d.childWidgets[d.childWidgets.length-1],!1)}r=e.getLineWidgetParagraph(this.offset,this.currentWidget)}else{if(!n.isInsideTable&&this.currentWidget.paragraph.isInsideTable){var a=e.getFirstCellInRegion(this.currentWidget.paragraph.associatedCell.ownerRow,this.currentWidget.paragraph.associatedCell,this.owner.selection.upDownSelectionLength,!0),l=e.getLastParagraph(a);this.setPosition(l.childWidgets[l.childWidgets.length-1],!1)}else if(n.isInsideTable&&!t.isNullOrUndefined(this.currentWidget.paragraph.associatedCell)&&n.associatedCell.ownerRow.previousRenderedWidget!==n.associatedCell.ownerRow.previousSplitWidget&&n.associatedCell.ownerRow.previousRenderedWidget===this.currentWidget.paragraph.associatedCell.ownerRow){var a=e.getLastCellInRegion(this.currentWidget.paragraph.associatedCell.ownerRow,this.currentWidget.paragraph.associatedCell,this.owner.selection.upDownSelectionLength,!0),l=e.getLastParagraph(a);this.setPosition(l.childWidgets[l.childWidgets.length-1],!1)}r=e.getLineWidgetParagraph(this.offset,this.currentWidget)}var h=e.getTop(r);this.currentWidget.isEndsWithPageBreak&&this.offset===this.currentWidget.getEndOffset()-1&&(i=this.location.x),e.updateTextPositionWidget(r,new R(i,h),this,!1)},e.prototype.moveDown=function(e,i){var n=this.currentWidget.paragraph,r=this.currentWidget;this.moveToLineEndInternal(e,!0);var o=this.selection.getParagraphLength(this.currentWidget.paragraph);this.offset>o&&(this.offset=o),this.moveNextPosition();var s=void 0;if(n.isInsideTable&&n!==this.currentWidget.paragraph&&n.associatedCell!==this.currentWidget.paragraph.associatedCell&&!t.isNullOrUndefined(this.currentWidget.paragraph.associatedCell)&&n.associatedCell.ownerRow===this.currentWidget.paragraph.associatedCell.ownerRow){var a=this.currentWidget.paragraph.associatedCell.ownerRow;if(n.isInsideTable&&this.currentWidget.paragraph.isInsideTable&&n.associatedCell.cellFormat.rowSpan>1&&n.associatedCell.cellFormat.rowSpan+n.associatedCell.ownerRow.rowIndex===n.associatedCell.ownerTable.childWidgets.length&&(a=this.currentWidget.paragraph.associatedCell.ownerTable.childWidgets[this.currentWidget.paragraph.associatedCell.ownerTable.childWidgets.length-1]),a.nextRenderedWidget instanceof Fe){d=this.selection.getLastCellInRegion(a.nextRenderedWidget,this.currentWidget.paragraph.associatedCell,i,!1);this.setPosition(this.selection.getFirstParagraph(d).childWidgets[0],!0)}else{var l=this.selection.getNextRenderedBlock(a.ownerTable);do{l instanceof xe&&(l=this.selection.getFirstBlockInFirstCell(l))}while(l instanceof xe);l instanceof we&&this.setPosition(l.childWidgets[0],!0)}s=e.getLineWidgetParagraph(this.offset,this.currentWidget)}else{if(!n.isInsideTable&&this.currentWidget.paragraph.isInsideTable){d=this.selection.getLastCellInRegion(this.currentWidget.paragraph.associatedCell.ownerRow,this.currentWidget.paragraph.associatedCell,this.owner.selection.upDownSelectionLength,!1);this.setPosition(this.selection.getFirstParagraph(d).childWidgets[0],!0)}else if(n.isInsideTable&&!t.isNullOrUndefined(this.currentWidget.paragraph.associatedCell)&&n.associatedCell.ownerRow.nextRenderedWidget!==n.associatedCell.ownerRow.nextSplitWidget&&n.associatedCell.ownerRow.nextRenderedWidget===this.currentWidget.paragraph.associatedCell.ownerRow){var d=e.getLastCellInRegion(this.currentWidget.paragraph.associatedCell.ownerRow,this.currentWidget.paragraph.associatedCell,this.owner.selection.upDownSelectionLength,!0);this.setPosition(e.getFirstParagraph(d).childWidgets[0],!1)}s=e.getLineWidgetParagraph(this.offset,this.currentWidget)}var h=this.selection.getTop(s);s!==r&&this.selection.updateTextPositionWidget(s,new R(i,h),this,!1)},e.prototype.moveToLineStartInternal=function(e,i){this.location.x>this.viewer.clientActiveArea.right&&(this.offset=this.offset-1);var n,r=e.getLineWidgetInternal(this.currentWidget,this.offset,i);this.currentWidget.paragraph.paragraphFormat.bidi&&r.children.length>0&&this.containsRtlText(r)?(n=r.children[r.children.length-1])instanceof Qe&&(n=void 0):n=e.getFirstElementInternal(r),this.documentHelper.moveCaretPosition=1;var o=e.getStartOffset(this.currentWidget.paragraph);if(t.isNullOrUndefined(n)&&this.offset>o){var s=0,a=(d=this.currentWidget.getInline(this.offset,s)).element;s=d.index,a instanceof Oe&&"\v"!==a.text&&(this.offset=o)}else if(!t.isNullOrUndefined(n)){var l=0;this.currentWidget=n.line,this.offset=this.currentWidget.getOffset(n,l),l=0;var d=this.currentWidget.getInline(this.offset,l),a=d.element;if(l=d.index,a instanceof Ie){var h=e.getPreviousValidElement(a);t.isNullOrUndefined(h)||(a=h,this.currentWidget=a.line,this.offset=this.currentWidget.getOffset(a,a.length),a instanceof Ie&&this.offset--)}}this.updatePhysicalPosition(!0)},e.prototype.moveToNextParagraphInTableCheck=function(){return!(!this.selection.start.paragraph.isInsideTable&&!this.paragraph.isInsideTable||this.selection.start.paragraph.associatedCell===this.paragraph.associatedCell&&!this.selection.isCellSelected(this.selection.start.paragraph.associatedCell,this.selection.start,this))},e.prototype.moveToWordEndInternal=function(e,i){var n=0,r=this.currentWidget.getEndOffset();if(this.selection.isParagraphFirstLine(this.currentWidget)&&(this.currentWidget.children[0]instanceof Qe&&(n=1),this.currentWidget.children[1]instanceof Qe&&(n=2)),this.offset+n===r||this.offset===r+1)if(this.offset===r&&0!==e)this.setPositionParagraph(this.currentWidget,r+1);else{var o=this.selection.getNextParagraphBlock(this.currentWidget.paragraph);if(t.isNullOrUndefined(o))return;this.currentWidget=o.childWidgets[0],this.offset=this.selection.getStartLineOffset(this.currentWidget),1===e&&(this.moveToNextParagraphInTableCheck()?this.moveToNextParagraphInTable():this.moveToWordEndInternal(e,i))}else{var s=0,a=this.currentWidget.getInline(this.offset,s),l=a.element;s=a.index,this.getNextWordOffset(l,s,e,!1,!1,this,i)}if(0!==e){var d=this.owner.selection.start.getHierarchicalIndexInternal(),h=this.getHierarchicalIndexInternal();d!==h&&this.validateForwardFieldSelection(d,h)}this.updatePhysicalPosition(!0)},e.prototype.moveToNextParagraphInTable=function(){var e=this.currentWidget.paragraph,i=e.isInsideTable?this.selection.getNextSelectionCell(e.associatedCell):this.selection.getNextParagraphBlock(e);t.isNullOrUndefined(i)||(this.currentWidget=i.childWidgets[i.childWidgets.length-1],this.offset=this.currentWidget.getEndOffset()+1)},e.prototype.moveToPreviousParagraph=function(e){var i=e.getStartOffset(this.currentWidget.paragraph);if(this.offset!==i||t.isNullOrUndefined(e.getPreviousParagraphBlock(this.currentWidget.paragraph)))this.offset=e.getStartOffset(this.currentWidget.paragraph);else{var n=e.getPreviousParagraphBlock(this.currentWidget.paragraph);this.currentWidget=n.childWidgets[0],this.offset=e.getStartOffset(this.currentWidget.paragraph)}this.updatePhysicalPosition(!0)},e.prototype.moveToPreviousLine=function(e,t){var i=this.getHierarchicalIndexInternal(),n=e.getLineWidgetParagraph(this.offset,this.currentWidget);this.moveToLineStartInternal(e,!0),this.currentWidget.paragraph.isInsideTable?this.moveUpInTable(e):this.moveBackward();var r=e.getLineWidgetParagraph(this.offset,this.currentWidget),o=e.getLeft(r);if(e.getWidth(r,!0)+o>=t&&n!==r){var s=e.getTop(r),a=new R(t,s);e.updateTextPositionWidget(r,a,this,!0)}var l=this.getHierarchicalIndexInternal();this.validateBackwardFieldSelection(i,l)},e.prototype.moveToLineEndInternal=function(e,i){this.location.x>this.viewer.clientActiveArea.right&&(this.offset=this.offset-1);var n=e.getLineWidgetParagraph(this.offset,this.currentWidget),r=e.getFirstElementInternal(n),o=this.currentWidget.paragraph.paragraphFormat.bidi;if(this.documentHelper.moveCaretPosition=2,t.isNullOrUndefined(r)&&this.offset===e.getStartLineOffset(this.currentWidget))this.offset=e.getParagraphLength(this.paragraph)+1,this.updatePhysicalPosition(!0);else if(!t.isNullOrUndefined(r)){var s=void 0;if(o&&this.containsRtlText(n)){var a=n.getEndOffset();s=n.getInline(a,0).element}else(s=n.children[n.children.length-1])instanceof Qe&&n.children.length>2&&(s=n.children[n.children.length-3]);var l=0;if(l+=s instanceof Oe?s.length:1,this.currentWidget=s.line,l===s.length&&t.isNullOrUndefined(s.nextNode)&&e.isParagraphLastLine(this.currentWidget)){var d=e.getLineLength(this.currentWidget);this.offset=i?d+1:d}else{for(var h=s;!t.isNullOrUndefined(h)&&h.length===l&&h.nextNode instanceof Ie;){var c=e.getNextValidElement(h.nextNode);if(h!==c&&(h=c,l=0),h instanceof Ie&&0===h.fieldType&&!t.isNullOrUndefined(h.fieldEnd)){var p=h;t.isNullOrUndefined(p.fieldSeparator)?h=p.fieldEnd:(h=p.fieldSeparator,this.currentWidget=h.line,this.currentWidget!==p.fieldEnd.line||e.hasValidInline(this.currentWidget.paragraph,h,p.fieldEnd)||(h=p.fieldEnd)),this.currentWidget=h.line}h instanceof Ie&&(l=1)}l===h.length&&t.isNullOrUndefined(h.nextNode)&&l++,!i&&h instanceof Se&&"\v"===h.text&&l--,this.offset=this.currentWidget.getOffset(h,l)}this.updatePhysicalPosition(i)}},e.prototype.moveToNextLine=function(i){var n=this.selection,r=new e(this.owner);r.setPositionInternal(this);var o=this.getHierarchicalIndexInternal();n.getLineWidgetParagraph(this.offset,this.currentWidget),this.offset;this.moveToLineEndInternal(n,!0);var s=!r.isAtSamePosition(this);r.setPositionInternal(this),this.currentWidget.paragraph.isInsideTable?this.moveDownInTable(n):(this.moveNextPosition(),this.moveForward());var a=n.getLineWidgetParagraph(this.offset,this.currentWidget),l=n.getLeft(a),d=n.getFirstElementInternal(a),h=t.isNullOrUndefined(d)?n.getWidth(a,!0):n.getLeftInternal(a,d,1)-l;if(l<i&&h/2<i-l){var c=n.getTop(a),p=new R(i,c);n.updateTextPositionWidget(a,p,this,!0),n.getWidth(a,!0)<i-l&&this.moveToLineEndInternal(n,!0)}else s&&this.currentWidget.paragraph.isInsideTable&&this.currentWidget===this.owner.selection.start.currentWidget?this.setPositionInternal(r):s||this.moveToLineEndInternal(n,!0);var g=this.getHierarchicalIndexInternal();this.validateForwardFieldSelection(o,g)},e.prototype.moveUpInTable=function(e){var i=!1,n=this.owner.selection.end,r=!this.owner.selection.isEmpty;if(i=n.paragraph.isInsideTable){var o=this.currentWidget.paragraph.associatedCell,s=n.paragraph.associatedCell,a=e.getContainerCellOf(s,o);if(i=a.ownerTable.contains(o)){s=e.getSelectedCell(s,a),o=e.getSelectedCell(o,a);var l=e.containsCell(a,this.currentWidget.paragraph.associatedCell),d=e.isCellSelected(a,this,n);if(d||(d=this.currentWidget.paragraph===e.getFirstParagraph(a)&&this.isAtParagraphStart),(l&&d||!l)&&!t.isNullOrUndefined(o.ownerRow.previousRenderedWidget)){var h=o.ownerRow.previousRenderedWidget,c=e.getFirstCellInRegion(h,a,this.owner.selection.upDownSelectionLength,!0),p=e.getLastParagraph(c);return void this.setPosition(p.childWidgets[0],!0)}if(l&&d&&t.isNullOrUndefined(o.ownerRow.previousRenderedWidget)||!l)if(r){o=o.ownerRow.childWidgets[0];p=e.getFirstParagraph(o);this.setPosition(p.childWidgets[0],!0)}else{o=o.ownerRow.childWidgets[o.ownerRow.childWidgets.length-1];p=e.getLastParagraph(o);this.setPosition(p.childWidgets[0],!1)}}}if(!i){c=e.getContainerCell(this.currentWidget.paragraph.associatedCell);if(r){c=c.ownerRow.childWidgets[0];p=e.getFirstParagraph(c);this.setPosition(p.childWidgets[0],!0)}else{c=c.ownerRow.childWidgets[c.ownerRow.childWidgets.length-1];p=e.getLastParagraph(c);this.setPosition(p.childWidgets[0],!1)}}this.moveBackward()},e.prototype.moveDownInTable=function(e){var i=!1,n=this.owner.selection.isEmpty||this.owner.selection.isForward;if(i=this.owner.selection.start.paragraph.isInsideTable){var r=this.owner.selection.start.paragraph.associatedCell,o=this.currentWidget.paragraph.associatedCell,s=e.getContainerCellOf(r,o);if(i=s.ownerTable.contains(o)){r=e.getSelectedCell(r,s),o=e.getSelectedCell(o,s);var a=e.containsCell(s,this.currentWidget.paragraph.associatedCell),l=e.isCellSelected(s,this.owner.selection.start,this);if((a&&l||!a)&&!t.isNullOrUndefined(o.ownerRow.nextRenderedWidget)){var d=o.ownerRow.nextRenderedWidget,h=e.getLastCellInRegion(d,s,this.owner.selection.upDownSelectionLength,!1),c=e.getLastParagraph(h);return void this.setPosition(c.childWidgets[c.childWidgets.length-1],!1)}if(a&&l&&t.isNullOrUndefined(o.ownerRow.nextRenderedWidget)||!a)if(n){o=o.ownerRow.childWidgets[o.ownerRow.childWidgets.length-1];c=e.getLastParagraph(o);this.setPosition(c.childWidgets[c.childWidgets.length-1],!1)}else{o=o.ownerRow.childWidgets[0];c=e.getFirstParagraph(o);this.setPosition(c.childWidgets[c.childWidgets.length-1],!0)}}}if(!i){h=e.getContainerCell(this.currentWidget.paragraph.associatedCell);if(n){h=h.ownerRow.childWidgets[h.ownerRow.childWidgets.length-1];c=e.getLastParagraph(h);this.setPosition(c.childWidgets[c.childWidgets.length-1],!1)}else if(h.ownerRow.nextRenderedWidget){h=h.ownerRow.nextRenderedWidget.childWidgets[0];c=e.getFirstParagraph(h);this.setPosition(c.childWidgets[c.childWidgets.length-1],!0)}}this.moveForward()},e.prototype.destroy=function(){this.offset=void 0,this.isUpdateLocation=void 0,t.isNullOrUndefined(this.location)||this.location.destroy(),this.location=void 0,this.currentWidget=void 0,this.owner=void 0,this.documentHelper=void 0},e}(),Lt=function(){function e(e,t){this.leftIn=0,this.widthIn=0,this.color="",this.leftIn=e,this.widthIn=t}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftIn},set:function(e){this.leftIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.widthIn},set:function(e){this.widthIn=e},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.widthIn=void 0,this.leftIn=void 0,this.floatingItems=[],this.floatingItems=void 0},e}(),Rt=function(){function e(e,t){this.linkInternal="",this.localRef="",this.opensNewWindow=!1,this.isCrossRefField=!1;var i=t.getFieldCode(e),n=i.toLowerCase();"hyperlink"===n.substring(0,9)?this.parseFieldValues(i.substring(9).trim(),!0):0===n.indexOf("ref ")&&n.match("\\h")&&(this.parseFieldValues(i.substring(4).trim(),!1),this.isCrossRefField=!0)}return Object.defineProperty(e.prototype,"navigationLink",{get:function(){return this.linkInternal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localReference",{get:function(){return this.localRef},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"linkType",{get:function(){return this.typeInternal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCrossRef",{get:function(){return this.isCrossRefField},enumerable:!0,configurable:!0}),e.prototype.parseFieldValues=function(e,t){var i=e.split(" "),n=!1;if(t)for(var r=0;r<i.length;r++){var o=i[r];o.length<1||("\\t"===o||"\\l"===o?n=!0:"\\n"===o?this.opensNewWindow=!0:(o=this.parseFieldValue(o,'"'===o[0]?'"':void 0,t),n?(this.localRef=o,n=!1):this.linkInternal=o))}else this.localRef=i[0];this.setLinkType()},e.prototype.parseFieldValue=function(e,t,i){e=i?e.substring(1):e.substring(0);var n=t?e.indexOf(t):-1;return n<0&&(n=e.length),e.substring(0,n).trim()},e.prototype.setLinkType=function(){if(t.isNullOrUndefined(this.linkInternal)||this.linkInternal.length<1)return void(this.typeInternal="Bookmark");"www."===this.linkInternal.substring(0,4)?this.linkInternal="http://"+this.navigationLink:"@"===this.linkInternal[0]&&(this.linkInternal="mailto:"+this.navigationLink),"http://"===this.linkInternal.substring(0,7)||"https://"===this.linkInternal.substring(0,8)?this.typeInternal="WebPage":"mailto:"===this.linkInternal.substring(0,7)?this.typeInternal="Email":this.typeInternal="File"},e.prototype.destroy=function(){this.linkInternal=void 0,this.localRef=void 0,this.typeInternal=void 0,this.opensNewWindow=void 0},e}(),Bt=function(){function e(e){this.width=0,this.height=0,this.width=e.width,this.height=e.height}return e.prototype.destroy=function(){this.width=void 0,this.height=void 0},e}(),Dt=function(){function e(e){var i=this;this.upDownSelectionLength=0,this.isSkipLayouting=!1,this.isImageSelected=!1,this.contextTypeInternal=void 0,this.caret=void 0,this.isRetrieveFormatting=!1,this.skipFormatRetrieval=!1,this.isMoveDownOrMoveUp=!1,this.isViewPasteOptions=!1,this.skipEditRangeRetrieval=!1,this.selectedWidgets=void 0,this.isHighlightEditRegionIn=!1,this.isHighlightFormFields=!1,this.isHightlightEditRegionInternal=!1,this.isCurrentUser=!1,this.isHighlightNext=!1,this.isWebLayout=!1,this.editRegionHighlighters=void 0,this.formFieldHighlighters=void 0,this.isSelectList=!1,this.previousSelectedFormField=void 0,this.isFormatUpdated=!1,this.pasteOptions=function(e){var n=new t.L10n("documenteditor",i.owner.defaultLocale);n.setLocale(i.owner.locale),"Keep source formatting"===e.item.text?i.owner.editor.applyPasteOptions("KeepSourceFormatting"):"Match destination formatting"===e.item.text?i.owner.editor.applyPasteOptions("MergeWithExistingFormatting"):e.item.text===n.getConstant("NestTable")?i.owner.editor.applyTablePasteOptions("NestTable"):e.item.text===n.getConstant("InsertAsRows")?i.owner.editor.applyTablePasteOptions("InsertAsRows"):e.item.text===n.getConstant("InsertAsColumns")?i.owner.editor.applyTablePasteOptions("InsertAsColumns"):e.item.text===n.getConstant("OverwriteCells")?i.owner.editor.applyTablePasteOptions("OverwriteCells"):i.owner.editor.applyPasteOptions("KeepTextOnly")},this.hideCaret=function(){t.isNullOrUndefined(i.caret)||(i.caret.style.display="none")},this.owner=e,this.documentHelper=this.owner.documentHelper,this.start=new kt(this.owner),this.end=new kt(this.owner),this.selectedWidgets=new u,this.characterFormatIn=new Tt(this),this.paragraphFormatIn=new St(this,this.documentHelper),this.sectionFormatIn=new It(this),this.rowFormatIn=new Ht(this),this.cellFormatIn=new Et(this),this.tableFormatIn=new Nt(this),this.imageFormatInternal=new Wt(this),this.editRangeCollection=[],this.editRegionHighlighters=new u,this.formFieldHighlighters=new u}return Object.defineProperty(e.prototype,"isHighlightEditRegion",{get:function(){return this.isHighlightEditRegionIn},set:function(e){this.isHighlightEditRegionIn=e,this.onHighlight()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"htmlWriter",{get:function(){return t.isNullOrUndefined(this.htmlWriterIn)&&(this.htmlWriterIn=new Ot),this.htmlWriterIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){if(!t.isNullOrUndefined(this.owner)&&!t.isNullOrUndefined(this.viewer))return t.isNullOrUndefined(this.startInternal)&&(this.startInternal=this.owner.documentStart),this.startInternal},set:function(e){this.startInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"characterFormat",{get:function(){return this.characterFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphFormat",{get:function(){return this.paragraphFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sectionFormat",{get:function(){return this.sectionFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tableFormat",{get:function(){return this.tableFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cellFormat",{get:function(){return this.cellFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowFormat",{get:function(){return this.rowFormatIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageFormat",{get:function(){return this.imageFormatInternal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.endInternal},set:function(e){this.endInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startPage",{get:function(){return!this.owner.isDocumentLoaded||t.isNullOrUndefined(this.viewer)||this.viewer instanceof de||t.isNullOrUndefined(this.documentHelper.selectionStartPage)?1:this.documentHelper.pages.indexOf(this.documentHelper.selectionStartPage)+1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endPage",{get:function(){return!this.owner.isDocumentLoaded||t.isNullOrUndefined(this.viewer)||this.viewer instanceof de||t.isNullOrUndefined(this.documentHelper.selectionEndPage)?1:this.documentHelper.pages.indexOf(this.documentHelper.selectionEndPage)+1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isForward",{get:function(){return this.start.isExistBefore(this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isinFootnote",{get:function(){var e=this.getContainerWidget(this.start.paragraph);return e instanceof be&&"Footnote"===e.footNoteType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isinEndnote",{get:function(){var e=this.getContainerWidget(this.start.paragraph);return e instanceof be&&"Endnote"===e.footNoteType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return!!t.isNullOrUndefined(this.start)||this.start.isAtSamePosition(this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startOffset",{get:function(){return this.getHierarchicalIndexByPosition(this.start)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endOffset",{get:function(){return this.getHierarchicalIndexByPosition(this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInShape",{get:function(){var e=this.start.paragraph.containerWidget;do{if(e instanceof Xe)return!0;e&&(e=e.containerWidget)}while(e);return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.getText(!1)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contextType",{get:function(){return this.contextTypeInternal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bookmarks",{get:function(){return this.getSelBookmarks(!1)},enumerable:!0,configurable:!0}),e.prototype.getBookmarks=function(e){return this.getSelBookmarks(e)},Object.defineProperty(e.prototype,"isCleared",{get:function(){return t.isNullOrUndefined(this.end)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInField",{get:function(){return!t.isNullOrUndefined(this.getHyperlinkField(!0))},enumerable:!0,configurable:!0}),e.prototype.getSelBookmarks=function(e){var i=[],n=this.documentHelper.bookmarks,r=this.start,o=this.end;this.isForward||(r=this.end,o=this.start);for(var s,a,l=!1,d=this.getSelectedCells(),h=0;h<n.length;h++)if(e||!e&&0!==n.keys[h].indexOf("_")){if(s=n.get(n.keys[h]),a=s.reference,t.isNullOrUndefined(a))continue;var c=this.getElementPosition(s).startPosition,p=this.getElementPosition(a,!0).startPosition;if(c.paragraph.isInsideTable||p.paragraph.isInsideTable)if(d.length>0){if(d.indexOf(c.paragraph.associatedCell)>=0||d.indexOf(p.paragraph.associatedCell)>=0)l=!0;else if(l=!1,d.indexOf(c.paragraph.associatedCell)<0||d.indexOf(p.paragraph.associatedCell)<0){var g=o.paragraph.isInsideTable&&o.paragraph.associatedCell,u=p.paragraph.associatedCell;if(g&&u&&g.ownerTable.equals(u.ownerTable)&&!(g.ownerTable&&d.indexOf(this.getCellInTable(g.ownerTable,u))>=0))continue}}else l=!1;else l=!1;((r.isExistAfter(c)||r.isAtSamePosition(c))&&(o.isExistBefore(p)||o.isAtSamePosition(p))||(c.isExistAfter(r)||c.isAtSamePosition(r))&&(p.isExistBefore(o)||p.isAtSamePosition(o))||c.isExistAfter(r)&&c.isExistBefore(o)&&(o.isExistAfter(p)||o.isExistBefore(p))||p.isExistBefore(o)&&p.isExistAfter(r)&&(r.isExistBefore(c)||r.isExistAfter(c))||l)&&i.push(s.name)}return i},Object.defineProperty(e.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"Selection"},e.prototype.checkLayout=function(){"Continuous"===this.owner.layoutType&&(this.isWebLayout=!0,this.documentHelper.isHeaderFooter=!0,this.owner.layoutType="Pages",this.owner.viewer.destroy(),this.owner.viewer=new le(this.owner),this.owner.editor.layoutWholeDocument())},e.prototype.goToHeader=function(){this.checkLayout(),this.owner.enableHeaderAndFooter=!0,this.enableHeadersFootersRegion(this.start.paragraph.bodyWidget.page.headerWidget),this.isWebLayout=!1},e.prototype.goToFooter=function(){this.checkLayout(),this.owner.enableHeaderAndFooter=!0,this.enableHeadersFootersRegion(this.start.paragraph.bodyWidget.page.footerWidget),this.isWebLayout=!1},e.prototype.closeHeaderFooter=function(){this.disableHeaderFooter(),this.documentHelper.isHeaderFooter&&"Pages"===this.owner.layoutType&&(this.owner.layoutType="Continuous",this.documentHelper.isHeaderFooter=!1)},e.prototype.goToPage=function(e){if(e>=1&&e<=this.owner.documentHelper.pages.length){var t=this.owner.documentHelper.pages[e-1];this.updateTextPositionForBlockContainer(t.bodyWidgets[0])}},e.prototype.selectTable=function(){this.owner.enableSelection&&this.selectTableInternal()},e.prototype.selectRow=function(){this.owner.enableSelection&&this.selectTableRow()},e.prototype.selectColumn=function(){this.owner.enableSelection&&this.selectColumnInternal()},e.prototype.selectCell=function(){this.owner.enableSelection&&this.selectTableCell()},e.prototype.select=function(e,t){if("string"==typeof e){var i=this.getTextPosBasedOnLogicalIndex(e),n=this.getTextPosBasedOnLogicalIndex(t);this.selectPosition(i,n)}else{var r=new R(e.x,e.y),o=this.viewer.findFocusedPage(r,!0);e.extend?this.moveTextPosition(o,this.end):this.documentHelper.updateTextPositionForSelection(o,1)}},e.prototype.selectByHierarchicalIndex=function(e,t){var i=this.getTextPosBasedOnLogicalIndex(e),n=this.getTextPosBasedOnLogicalIndex(t);this.selectPosition(i,n)},e.prototype.selectField=function(e){!this.isInField&&t.isNullOrUndefined(e)||(t.isNullOrUndefined(e)&&(e=this.getHyperlinkField(!0)),this.selectFieldInternal(e))},e.prototype.selectFieldInternal=function(e){if(e){var t=this.documentHelper.isFormFillProtectedMode,i=e.fieldEnd;t&&(e=e.fieldSeparator);var n=e.line.getOffset(e,t?1:0),r=new kt(this.owner);r.setPositionParagraph(e.line,n),e.nextNode instanceof Ae&&!t&&(i=e.nextElement.reference);var o=i.line.getOffset(i,t?0:1),s=new kt(this.owner);s.setPositionParagraph(i.line,o),this.documentHelper.selection.selectRange(r,s)}},e.prototype.selectShape=function(e){if(e){var t=e.line.getOffset(e,0),i=new kt(this.owner);i.setPositionParagraph(e.line,t);var n=e.line.getOffset(e,1),r=new kt(this.owner);r.setPositionParagraph(e.line,n),this.documentHelper.selection.selectRange(i,r)}},e.prototype.toggleBold=function(){this.owner.editorModule&&this.owner.editorModule.toggleBold()},e.prototype.toggleItalic=function(){this.owner.editorModule&&this.owner.editorModule.toggleItalic()},e.prototype.toggleAllCaps=function(){this.owner.editorModule&&this.owner.editorModule.toggleAllCaps()},e.prototype.toggleUnderline=function(e){this.owner.editor&&this.owner.editor.toggleUnderline(e)},e.prototype.toggleStrikethrough=function(e){this.owner.editor&&this.owner.editor.toggleStrikethrough(e)},e.prototype.toggleHighlightColor=function(e){this.owner.editor&&this.owner.editor.toggleHighlightColor(e)},e.prototype.toggleSubscript=function(){this.owner.editor&&this.owner.editor.toggleSubscript()},e.prototype.toggleSuperscript=function(){this.owner.editor&&this.owner.editor.toggleSuperscript()},e.prototype.toggleTextAlignment=function(e){this.owner.editor&&this.owner.editor.toggleTextAlignment(e)},e.prototype.increaseIndent=function(){this.owner.editor&&this.owner.editor.increaseIndent()},e.prototype.decreaseIndent=function(){this.owner.editor&&this.owner.editor.decreaseIndent()},e.prototype.navigateHyperlink=function(){var e=this.getHyperlinkField();e&&this.fireRequestNavigate(e)},e.prototype.fireRequestNavigate=function(e){var t=this.getFieldCode(e);if(0!==t.toLowerCase().indexOf("ref ")||t.match("\\h")){var i=new Rt(e,this),n={isHandled:!1,navigationLink:i.navigationLink,linkType:i.linkType,localReference:i.localReference,source:this.owner};this.owner.trigger("requestNavigate",n),n.isHandled||this.documentHelper.selection.navigateBookmark(i.localReference,!0)}},e.prototype.copyHyperlink=function(){var e=this.getHyperlinkField(),t=this.getLinkText(e);this.copyToClipboard(t)},e.prototype.isHideSelection=function(e){var t=e.bodyWidget,i=t.sectionFormat,n=i.pageHeight-i.footerDistance,r=t.page.boundingRectangle.height/100*40;return this.contextType.indexOf("Footer")>=0&&e.y+e.height>L.convertPointToPixel(n)||this.contextType.indexOf("Header")>=0&&e.y+e.height>r},e.prototype.highlightSelection=function(e){if(this.owner.enableImageResizerMode&&this.owner.imageResizerModule.hideImageResizer(),this.isEmpty){if(!this.isInShape&&this.isHideSelection(this.start.paragraph))return void this.hideCaret();this.isInShape&&this.showResizerForShape(),this.updateCaretPosition()}else this.isForward?this.highlightSelectedContent(this.start,this.end):this.highlightSelectedContent(this.end,this.start),this.documentHelper.isComposingIME&&this.updateCaretPosition();this.documentHelper.updateTouchMarkPosition(),e&&this.documentHelper.scrollToPosition(this.start,this.end)},e.prototype.createHighlightBorder=function(e,t,i,n,r){t<0&&(t=0);var o=e.paragraph,s=[];if(o.floatingElements.length>0)for(var a=0;a<o.floatingElements.length;a++){var l=o.floatingElements[a];if(l.line===e){var d=this.start,h=this.end;this.isForward||(d=this.end,h=this.start);var c=l.line.getOffset(l,0);(d.currentWidget!==e&&h.currentWidget!==e||d.currentWidget===e&&d.offset<=c&&(h.currentWidget===e&&h.offset>=c+1||h.currentWidget!==e)||d.currentWidget!==e&&h.currentWidget===e&&h.offset>=c)&&s.push(l)}}var p=this.getPage(e.paragraph),g=(e.height,this.selectedWidgets),u=void 0,m=void 0;if(this.isHightlightEditRegionInternal)return void this.addEditRegionHighlight(e,i,t);if(this.isHighlightFormFields)return void this.addFormFieldHighlight(e,i,t);if(g.containsKey(e))g.get(e)instanceof Lt?(u=g.get(e),r&&(g.remove(e),m=[],g.add(e,m))):m=g.get(e);else if(r)m=[],g.add(e,m);else{var f=this.getWrapPosition(e,o);if(f.length>0){var v=this.splitSelectionHighlightPosition(i,t,f);if(v.length>0)return v[0].floatingItems=s,g.add(e,v),void this.renderHighlight(p,e,v,n,s);(u=new Lt(i,t)).floatingItems=s,g.add(e,u)}else(u=new Lt(i,t)).floatingItems=s,g.add(e,u)}void 0===u&&((u=new Lt(i,t)).floatingItems=s,g.add(e,u)),this.renderHighlight(p,e,[u],n,s),r&&m.push(u)},e.prototype.renderHighlight=function(e,t,i,n,r){var o=this.owner.documentHelper,s=this.getPageTop(e),a=e.boundingRectangle.x,l=t.height;if(this.viewer.containerTop<=s||s<this.viewer.containerTop+o.selectionCanvas.height){var d=o.zoomFactor;this.clipSelection(e,s);for(var h=0;h<i.length;h++){var c=i[h],p=c.left,g=c.width;this.documentHelper.isComposingIME?this.renderDashLine(o.selectionContext,e,t,a+p*d-this.viewer.containerLeft,n,g*d,l):(this.documentHelper.selectionContext.fillStyle="gray",o.selectionContext.globalAlpha=.4,o.selectionContext.fillRect(a+p*d-this.viewer.containerLeft,s+n*d-this.viewer.containerTop,g*d,l*d))}if(r.length>0)for(var u=0;u<r.length;u++){var p=r[u].x,m=r[u].y,f=r[u].width,v=r[u].height;o.selectionContext.fillRect(a+p*d-this.viewer.containerLeft,s+m*d-this.viewer.containerTop,f*d,v*d)}o.selectionContext.restore()}},e.prototype.getWrapPosition=function(e,i){var n=i.bodyWidget;if(!t.isNullOrUndefined(n)&&n.floatingElements.length>0&&e.children.length>0){for(var r=this.getLeftInternal(e,e.children[0],0),o=0,s=[],a=!1,l=0;l<e.children.length;l++){var d=e.children[l];if(!(d instanceof Ge&&"Inline"!==d.textWrappingStyle)){if(d.padding.left>0){1===s.length&&0===s[0].end&&(s[0].end=s[0].start-i.x,s[0].start=i.x,r=i.x);var h={};h.start=r+o,h.end=0,a&&(h.end=r+o+d.padding.left),s.push(h)}o+=d.padding.left+d.width,d instanceof Oe&&(a=!0)}}return 1===s.length&&0===s[0].end&&(s[0].end=s[0].start-i.x,s[0].start=i.x),s}return[]},e.prototype.splitSelectionHighlightPosition=function(e,t,i){for(var n=[],r=0;r<i.length;r++){var o=i[r];e<o.start&&e+t<o.end||e>o.end||(e<o.start&&e+t>o.end?(n.push(new Lt(e,o.start-e)),t=e+t-o.end,e=o.end):e===o.start&&(e+=o.end,t-=o.end),r===i.length-1&&n.push(new Lt(e,t)))}return n},e.prototype.addEditRegionHighlight=function(e,t,i){var n=void 0,r=this.editRegionHighlighters;r.containsKey(e)?n=r.get(e):(n=[],r.add(e,n));var o=new Lt(t,i);return this.isCurrentUser&&(o.color=""!==this.owner.userColor?this.owner.userColor:"#FFFF00"),n.push(o),o},e.prototype.addFormFieldHighlight=function(e,t,i){var n=void 0,r=this.formFieldHighlighters;r.containsKey(e)?n=r.get(e):(n=[],r.add(e,n));var o=new Lt(t,i);n.push(o)},e.prototype.createHighlightBorderInsideTable=function(e){var t=this.getPage(e),i=void 0,n=e.x-e.margin.left+e.leftBorderWidth,r=e.width+e.margin.left+e.margin.right-e.leftBorderWidth-e.rightBorderWidth,o=e.y,s=e.height,a=this.getPageTop(t),l=t.boundingRectangle.x,d=this.viewer.containerTop<=a||a<this.viewer.containerTop+this.documentHelper.selectionCanvas.height,h=this.selectedWidgets;if(this.isHightlightEditRegionInternal||this.isHighlightFormFields||(h.containsKey(e)&&h.get(e)instanceof Lt?(i=h.get(e),d&&this.documentHelper.selectionContext.clearRect(l+i.left*this.documentHelper.zoomFactor-this.viewer.containerLeft,a+o*this.documentHelper.zoomFactor-this.viewer.containerTop,i.width*this.documentHelper.zoomFactor,s*this.documentHelper.zoomFactor)):(i=new Lt(n,r),h.containsKey(e)&&h.remove(h.get(e)),h.add(e,i))),d){this.documentHelper.selectionContext.fillStyle="gray",this.documentHelper.selectionContext.globalAlpha=.4;var c=this.documentHelper.zoomFactor;this.clipSelection(t,a),this.documentHelper.selectionContext.fillRect(l+n*c-this.viewer.containerLeft,a+o*c-this.viewer.containerTop,r*c,s*c),this.documentHelper.selectionContext.restore()}},e.prototype.clipSelection=function(e,t){var i,n,r=this.owner.documentHelper;this.viewer instanceof de&&this.documentHelper.zoomFactor<1?(i=e.boundingRectangle.width/this.documentHelper.zoomFactor,n=e.boundingRectangle.height/this.documentHelper.zoomFactor):(i=e.boundingRectangle.width*this.documentHelper.zoomFactor,n=e.boundingRectangle.height*this.documentHelper.zoomFactor);var o=e.boundingRectangle.x;r.selectionContext.beginPath(),r.selectionContext.save(),r.selectionContext.rect(o-this.viewer.containerLeft,t-this.viewer.containerTop,i,n),r.selectionContext.clip()},e.prototype.addSelectionHighlight=function(e,i,n){if(this.selectedWidgets.containsKey(i)){var r=this.documentHelper.render.getScaledValue(i.height),o=this.selectedWidgets.get(i),s=void 0;if(o instanceof Lt?(s=[]).push(o):s=o,!t.isNullOrUndefined(s))for(var a=0;a<s.length;a++){var l=s[a],d=this.documentHelper.render.getScaledValue(s[a].width),h=this.documentHelper.render.getScaledValue(s[a].left,1),c=this.owner.selection.getPage(i.paragraph);if(this.owner.selection.clipSelection(c,this.owner.selection.getPageTop(c)),this.documentHelper.isComposingIME)this.renderDashLine(e,c,i,h,n,d,r);else if(e.globalAlpha=.4,e.fillStyle="gray",e.fillRect(h,this.documentHelper.render.getScaledValue(n,2),d,r),l.floatingItems&&l.floatingItems.length>0)for(var p=0;p<l.floatingItems.length;p++){var g=l.floatingItems[p];d=this.documentHelper.render.getScaledValue(g.width),h=this.documentHelper.render.getScaledValue(g.x,1);var u=this.documentHelper.render.getScaledValue(g.y,2);e.fillRect(h,u,d,this.documentHelper.render.getScaledValue(g.height))}e.restore()}}},e.prototype.renderDashLine=function(e,t,i,n,r,o,s){var a=this.characterFormat.fontColor,l=a?L.getColor(a):"#000000";e.globalAlpha=1;var d=this.owner.editor.copyInsertFormat(new k,!1),h=this.documentHelper.textHelper.getHeight(d),c=this.getPageTop(t),p=h.Height-h.BaselineOffset;r=this.documentHelper.render.getUnderlineYPosition(i)+r+4-p,this.documentHelper.render.renderDashLine(e,n,c-this.viewer.containerTop+r*this.documentHelper.zoomFactor,o,l,!0)},e.prototype.addSelectionHighlightTable=function(e,i){if(this.selectedWidgets.containsKey(i)){var n=this.selectedWidgets.get(i),r=void 0;if(n instanceof Lt?(r=[]).push(n):r=n,!t.isNullOrUndefined(r))for(var o=0;o<r.length;o++){var s=this.documentHelper.render.getScaledValue(r[o].left,1),a=this.documentHelper.render.getScaledValue(i.y,2),l=this.documentHelper.render.getScaledValue(r[o].width),d=this.documentHelper.render.getScaledValue(i.height);e.fillStyle="gray";var h=this.owner.selection.getPage(i);this.owner.selection.clipSelection(h,this.owner.selection.getPageTop(h)),e.fillRect(s,a,l,d),e.restore()}}},e.prototype.removeSelectionHighlight=function(e){var i=0,n=0,r=0,o=0,s=void 0;if(e instanceof Te){var a=e,l=a.paragraph;if(s=t.isNullOrUndefined(l)?void 0:this.getPage(a.paragraph),t.isNullOrUndefined(s))return;n=this.getTop(a),o=a.height}else if(e instanceof Pe){if(s=t.isNullOrUndefined(e)?void 0:this.getPage(e),t.isNullOrUndefined(s))return;n=e.y,o=e.height}if(!t.isNullOrUndefined(s)){var d=this.selectedWidgets.get(e),h=void 0;if(d instanceof Lt?(h=[]).push(d):h=d,!t.isNullOrUndefined(h))for(var c=0;c<h.length;c++){r=h[c].width,i=h[c].left;var p=s.boundingRectangle,g=this.documentHelper.pages.indexOf(s),u=this.viewer.pageGap,m=(p.y-u*(g+1))*this.documentHelper.zoomFactor+u*(g+1),f=p.x,v=this.documentHelper.zoomFactor;(this.viewer.containerTop<=m||m<this.viewer.containerTop+this.documentHelper.selectionCanvas.height)&&this.documentHelper.selectionContext.clearRect(f+i*v-this.viewer.containerLeft-.5,m+n*v-this.viewer.containerTop-.5,r*v+.5,o*v+.5)}}},e.prototype.selectCurrentWord=function(e){var t=this.start.clone(),i=this.end.clone();this.selectCurrentWordRange(t,i,e||!1),this.selectRange(t,i)},e.prototype.selectParagraph=function(){t.isNullOrUndefined(this.start)||(this.start.paragraphStartInternal(this,!1),this.end.moveToParagraphEndInternal(this,!1),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.selectLine=function(){t.isNullOrUndefined(this.start)||(this.moveToLineStart(),this.handleShiftEndKey())},e.prototype.moveToDocumentStart=function(){this.handleControlHomeKey()},e.prototype.moveToDocumentEnd=function(){this.handleControlEndKey()},e.prototype.moveToParagraphStart=function(){this.isForward?(this.start.paragraphStartInternal(this,!1),this.end.setPositionInternal(this.start),this.upDownSelectionLength=this.end.location.x):(this.end.paragraphStartInternal(this,!1),this.start.setPositionInternal(this.end),this.upDownSelectionLength=this.start.location.x),this.fireSelectionChanged(!0)},e.prototype.moveToParagraphEnd=function(){this.isForward?(this.start.moveToParagraphEndInternal(this,!1),this.end.setPositionInternal(this.start),this.upDownSelectionLength=this.end.location.x):(this.end.moveToParagraphEndInternal(this,!1),this.start.setPositionInternal(this.end),this.upDownSelectionLength=this.start.location.x),this.fireSelectionChanged(!0)},e.prototype.moveToNextLine=function(){this.moveDown()},e.prototype.moveToPreviousLine=function(){this.moveUp()},e.prototype.moveToNextCharacter=function(){this.handleRightKey()},e.prototype.moveToPreviousCharacter=function(){this.handleLeftKey()},e.prototype.selectCurrentWordRange=function(e,i,n){if(!t.isNullOrUndefined(e)){if(e.offset>0){var r=e.clone(),o=0,s=e.currentWidget.getInline(e.offset,o),a=s.element;o=s.index,!t.isNullOrUndefined(a)&&a instanceof Ie&&1===a.fieldType?e.offset>2&&(!t.isNullOrUndefined(a.fieldSeparator)||t.isNullOrUndefined(a.fieldBegin))?(r.setPositionParagraph(r.currentWidget,e.offset-2),r.moveToWordEndInternal(0,!1),r.paragraph===e.paragraph&&r.offset===e.offset-1||e.moveToWordStartInternal(2)):e.offset>3&&t.isNullOrUndefined(a.fieldSeparator)&&(r.setPositionParagraph(r.currentWidget,e.offset-3),r.moveToWordEndInternal(0,!1),r.paragraph===e.paragraph&&r.offset===e.offset||e.moveToWordStartInternal(2)):(r.setPositionParagraph(r.currentWidget,e.offset-1),r.moveToWordEndInternal(0,!1),r.paragraph===e.paragraph&&r.offset===e.offset||e.moveToWordStartInternal(2))}i.moveToWordEndInternal(2,n)}},e.prototype.extendToParagraphStart=function(){t.isNullOrUndefined(this.start)||(this.end.paragraphStartInternal(this,!0),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.extendToParagraphEnd=function(){t.isNullOrUndefined(this.start)||(this.end.moveToParagraphEndInternal(this,!0),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.moveNextPosition=function(){if(!t.isNullOrUndefined(this.start)&&(this.isEmpty&&(this.start.moveNextPosition(),this.end.setPositionInternal(this.start)),this.updateForwardSelection(),this.upDownSelectionLength=this.start.location.x,this.fireSelectionChanged(!0),this.documentHelper.isFormFillProtectedMode)){var e=this.getCurrentFormField();e||(e=this.getFormFieldInFormFillMode(),this.selectPrevNextFormField(!0,e))}},e.prototype.moveToNextParagraph=function(){t.isNullOrUndefined(this.start)||(this.end.moveToNextParagraphStartInternal(),this.start.setPositionInternal(this.end),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.nextFootnote=function(){if(this.isinFootnote){var e=this.start.paragraph.footNoteReference,i=(this.documentHelper.footnoteCollection.length,this.documentHelper.footnoteCollection.indexOf(e)),n=this.documentHelper.footnoteCollection[i+1];t.isNullOrUndefined(n)&&(n=e);for(var r=this.start.clone(),o=this.end.clone(),s=0;s<this.documentHelper.pages.length;s++)for(var a=this.documentHelper.pages[s].footnoteWidget,l=1;l<a.childWidgets.length;l++)a.childWidgets[l].footNoteReference===n&&(r.setPositionParagraph(a.childWidgets[l].childWidgets[0],0),o.setPositionInternal(r),this.selectRange(r,o))}},e.prototype.previousFootnote=function(){if(this.isinFootnote){var e=this.start.paragraph.footNoteReference,i=(this.documentHelper.footnoteCollection.length,this.documentHelper.footnoteCollection.indexOf(e)),n=this.documentHelper.footnoteCollection[i-1];t.isNullOrUndefined(n)&&(n=e);for(var r=this.start.clone(),o=this.end.clone(),s=0;s<this.documentHelper.pages.length;s++)for(var a=this.documentHelper.pages[s].footnoteWidget,l=1;l<a.childWidgets.length;l++)a.childWidgets[l].footNoteReference===n&&(r.setPositionParagraph(a.childWidgets[l].childWidgets[0],0),o.setPositionInternal(r),this.selectRange(r,o))}},e.prototype.nextEndnote=function(){if(this.isinEndnote){var e=this.start.paragraph.footNoteReference,i=(this.documentHelper.endnoteCollection.length,this.documentHelper.endnoteCollection.indexOf(e)),n=this.documentHelper.endnoteCollection[i+1];t.isNullOrUndefined(n)&&(n=e);for(var r=this.start.clone(),o=this.end.clone(),s=this.documentHelper.pages[this.endPage-1].endnoteWidget,a=0;a<s.childWidgets.length;a++)s.childWidgets[a].footNoteReference===n&&(r.setPositionParagraph(s.childWidgets[a].childWidgets[0],0),o.setPositionInternal(r),this.selectRange(r,o))}},e.prototype.previousEndnote=function(){if(this.isinEndnote){var e=this.start.paragraph.footNoteReference,i=(this.documentHelper.endnoteCollection.length,this.documentHelper.endnoteCollection.indexOf(e)),n=this.documentHelper.endnoteCollection[i-1];t.isNullOrUndefined(n)&&(n=e);for(var r=this.start.clone(),o=this.end.clone(),s=this.documentHelper.pages[this.endPage-1].endnoteWidget,a=0;a<s.childWidgets.length;a++)s.childWidgets[a].footNoteReference===n&&(r.setPositionParagraph(s.childWidgets[a].childWidgets[0],0),o.setPositionInternal(r),this.selectRange(r,o))}},e.prototype.movePreviousPosition=function(){if(!t.isNullOrUndefined(this.start)&&(this.isEmpty&&(this.start.movePreviousPosition(),this.end.setPositionInternal(this.start)),this.updateBackwardSelection(),this.upDownSelectionLength=this.start.location.x,this.fireSelectionChanged(!0),this.documentHelper.isFormFillProtectedMode)){var e=this.getCurrentFormField();e||(e=this.getFormFieldInFormFillMode(),this.selectPrevNextFormField(!1,e))}},e.prototype.moveToPreviousParagraph=function(){t.isNullOrUndefined(this.start)||(this.end.moveToPreviousParagraph(this),this.start.setPositionInternal(this.end),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.extendToPreviousLine=function(){t.isNullOrUndefined(this.start)||(this.end.moveToPreviousLine(this,this.upDownSelectionLength),this.fireSelectionChanged(!0))},e.prototype.extendToLineEnd=function(){t.isNullOrUndefined(this.start)||(this.end.moveToLineEndInternal(this,!0),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.extendToLineStart=function(){t.isNullOrUndefined(this.start)||(this.end.moveToLineStartInternal(this,!0),this.upDownSelectionLength=this.end.location.x,this.start.paragraph===this.end.paragraph&&this.start.offset===this.start.currentWidget.getEndOffset()&&this.isParagraphLastLine(this.start.currentWidget)&&this.isParagraphFirstLine(this.end.currentWidget)&&this.start.setPositionParagraph(this.start.currentWidget,this.start.offset+1),this.fireSelectionChanged(!0))},e.prototype.moveUp=function(){if(this.documentHelper.isFormFillProtectedMode)return void this.selectPrevNextFormField(!1);t.isNullOrUndefined(this.start)||(this.isEmpty||(this.isForward?this.end.setPositionInternal(this.start):this.start.setPositionInternal(this.end),this.upDownSelectionLength=this.start.location.x),this.upDownSelectionLength=this.start.location.x,this.start.moveUp(this,this.upDownSelectionLength),this.end.setPositionInternal(this.start),this.fireSelectionChanged(!0))},e.prototype.moveDown=function(){if(this.documentHelper.isFormFillProtectedMode)return void this.selectPrevNextFormField(!0);t.isNullOrUndefined(this.start)||(this.isEmpty||(this.isForward?this.start.setPositionInternal(this.end):this.end.setPositionInternal(this.start),this.upDownSelectionLength=this.start.location.x),this.start.moveDown(this,this.upDownSelectionLength),this.end.setPositionInternal(this.start),this.fireSelectionChanged(!0))},e.prototype.updateForwardSelection=function(){this.isEmpty||(this.isForward?this.start.setPositionInternal(this.end):this.end.setPositionInternal(this.start))},e.prototype.updateBackwardSelection=function(){this.isEmpty||(this.isForward?this.end.setPositionInternal(this.start):this.start.setPositionInternal(this.end))},e.prototype.getFirstBlockInFirstCell=function(e){if(e.childWidgets.length>0){var t=e.childWidgets[0];if(t.childWidgets.length>0){var i=t.childWidgets[0];if(0===i.childWidgets.length)return;return i.childWidgets[0]}}},e.prototype.getFirstCellInRegion=function(e,i,n,r){var o=this.getCellLeft(e,i),s=o+i.cellFormat.cellWidth,a=!0;if(o<=n&&n<s)for(var l=0;l<e.childWidgets.length;l++){var d=this.getCellLeft(e,e.childWidgets[l]);if(L.round(o,2)<=L.round(d,2)&&L.round(d,2)<L.round(s,2))return a=!1,e.childWidgets[l]}else for(var h=0;h<e.childWidgets.length;h++){var c=this.getCellLeft(e,e.childWidgets[h]);if(c<=n&&c+e.childWidgets[h].cellFormat.cellWidth>n)return a=!1,e.childWidgets[h]}if(a){if(!t.isNullOrUndefined(e.previousRenderedWidget)&&r){var p=e.previousRenderedWidget;return this.getFirstCellInRegion(p,i,n,r)}if(!t.isNullOrUndefined(e.nextRenderedWidget)&&!r)return this.getFirstCellInRegion(e.nextRenderedWidget,i,n,r)}return e.childWidgets[0]},e.prototype.getFirstParagraph=function(e){for(;e.previousSplitWidget;)e=e.previousSplitWidget;var t=e.firstChild;return this.getFirstParagraphBlock(t)},e.prototype.getLastBlockInLastCell=function(e){if(e.childWidgets.length>0){for(var i=e.childWidgets[e.childWidgets.length-1],n=i.childWidgets[i.childWidgets.length-1];0===n.childWidgets.length&&!t.isNullOrUndefined(n.previousSplitWidget);)n=n.previousSplitWidget;return n.childWidgets[n.childWidgets.length-1]}},e.prototype.moveToLineStart=function(){t.isNullOrUndefined(this.start)||(this.updateBackwardSelection(),this.start.moveToLineStartInternal(this,!1),this.end.setPositionInternal(this.start),this.upDownSelectionLength=this.start.location.x,this.fireSelectionChanged(!0))},e.prototype.moveToLineEnd=function(){t.isNullOrUndefined(this.start)||(this.updateForwardSelection(),this.start.moveToLineEndInternal(this,!1),this.end.setPositionInternal(this.start),this.upDownSelectionLength=this.start.location.x,this.fireSelectionChanged(!0))},e.prototype.getPageTop=function(e){return(e.boundingRectangle.y-this.viewer.pageGap*(this.documentHelper.pages.indexOf(e)+1))*this.documentHelper.zoomFactor+this.viewer.pageGap*(this.documentHelper.pages.indexOf(e)+1)},e.prototype.moveTextPosition=function(e,i){if(!t.isNullOrUndefined(this.start)){var n=this.documentHelper.getLineWidgetInternal(e,!0);t.isNullOrUndefined(n)||this.updateTextPositionWidget(n,e,i,!0),this.upDownSelectionLength=i.location.x;var r=this.start.getHierarchicalIndexInternal(),o=this.end.getHierarchicalIndexInternal();r!==o&&(kt.isForwardSelection(r,o)?i.validateForwardFieldSelection(r,o):i.validateBackwardFieldSelection(r,o)),this.fireSelectionChanged(!0)}},e.prototype.getDocumentStart=function(){var e=this.documentHelper.pages[0].bodyWidgets[0].childWidgets[0];return this.setPositionForBlock(e,!0)},e.prototype.getDocumentEnd=function(){var e=void 0,i=this.owner.documentStart,n=this.documentHelper.pages[this.documentHelper.pages.length-1];if(!t.isNullOrUndefined(i)&&n.bodyWidgets[0].childWidgets.length>0){var r=void 0,o=n.bodyWidgets[0].childWidgets,s=o[o.length-1];s instanceof ye&&(r=s),e=this.setPositionForBlock(r,!1)}return e},e.prototype.handleControlEndKey=function(){var e=void 0;t.isNullOrUndefined(this.owner.documentEnd)||(e=this.owner.documentEnd),t.isNullOrUndefined(e)||this.owner.selection.selectContent(e,!0),this.checkForCursorVisibility()},e.prototype.handleControlHomeKey=function(){var e=void 0;t.isNullOrUndefined(this.owner.documentStart)||(e=this.owner.documentStart),t.isNullOrUndefined(e)||this.owner.selection.selectContent(e,!0),this.checkForCursorVisibility()},e.prototype.handleControlLeftKey=function(){this.extendToWordStartInternal(!0),this.checkForCursorVisibility()},e.prototype.handleControlRightKey=function(){this.extendToWordEndInternal(!0),this.checkForCursorVisibility()},e.prototype.handleControlDownKey=function(){this.moveToNextParagraph(),this.checkForCursorVisibility()},e.prototype.handleControlUpKey=function(){this.moveToPreviousParagraph(),this.checkForCursorVisibility()},e.prototype.handleShiftLeftKey=function(){this.extendBackward(),this.checkForCursorVisibility()},e.prototype.handleShiftUpKey=function(){this.extendToPreviousLine(),this.checkForCursorVisibility()},e.prototype.handleShiftRightKey=function(){this.extendForward(),this.checkForCursorVisibility()},e.prototype.handleShiftDownKey=function(){this.extendToNextLine(),this.checkForCursorVisibility()},e.prototype.handleControlShiftLeftKey=function(){(this.isForward?this.start.isCurrentParaBidi:this.end.isCurrentParaBidi)?this.extendToWordEndInternal(!1):this.extendToWordStartInternal(!1),this.checkForCursorVisibility()},e.prototype.handleControlShiftUpKey=function(){this.extendToParagraphStart(),this.checkForCursorVisibility()},e.prototype.handleControlShiftRightKey=function(){(this.isForward?this.start.isCurrentParaBidi:this.end.isCurrentParaBidi)?this.extendToWordStartInternal(!1):this.extendToWordEndInternal(!1),this.checkForCursorVisibility()},e.prototype.handleControlShiftDownKey=function(){this.extendToParagraphEnd(),this.checkForCursorVisibility()},e.prototype.handleLeftKey=function(){this.end.isCurrentParaBidi?this.moveNextPosition():this.movePreviousPosition(),this.checkForCursorVisibility()},e.prototype.handleUpKey=function(){this.isMoveDownOrMoveUp=!0,this.moveUp(),this.isMoveDownOrMoveUp=!1,this.checkForCursorVisibility()},e.prototype.handleRightKey=function(){this.end.isCurrentParaBidi?this.movePreviousPosition():this.moveNextPosition(),this.checkForCursorVisibility()},e.prototype.handleEndKey=function(){this.moveToLineEnd(),this.checkForCursorVisibility()},e.prototype.handleHomeKey=function(){this.moveToLineStart(),this.checkForCursorVisibility()},e.prototype.handleDownKey=function(){this.isMoveDownOrMoveUp=!0,this.moveDown(),this.isMoveDownOrMoveUp=!1,this.checkForCursorVisibility()},e.prototype.handleShiftEndKey=function(){this.extendToLineEnd(),this.checkForCursorVisibility()},e.prototype.handleShiftHomeKey=function(){this.extendToLineStart(),this.checkForCursorVisibility()},e.prototype.handleControlShiftEndKey=function(){var e=void 0;t.isNullOrUndefined(this.owner.documentEnd)||(e=this.owner.documentEnd),t.isNullOrUndefined(e)||(this.end.setPosition(e.currentWidget,!1),this.fireSelectionChanged(!0)),this.checkForCursorVisibility()},e.prototype.handleControlShiftHomeKey=function(){var e=void 0;t.isNullOrUndefined(this.owner.documentStart)||(e=this.owner.documentStart),t.isNullOrUndefined(e)||(this.end.setPositionInternal(e),this.fireSelectionChanged(!0)),this.checkForCursorVisibility()},e.prototype.handleSpaceBarKey=function(){this.owner.documentHelper.isDocumentProtected&&"FormFieldsOnly"===this.owner.documentHelper.protectionType&&"CheckBox"===this.getFormFieldType()&&this.owner.editor.toggleCheckBoxFormField(this.getCurrentFormField())},e.prototype.handleTabKey=function(e,i){var n=this.start;t.isNullOrUndefined(n)||(n.paragraph.isInsideTable&&this.end.paragraph.isInsideTable&&(e||i)?this.owner.documentHelper.isDocumentProtected||"FormFieldsOnly"===this.documentHelper.protectionType||(i?this.selectPreviousCell():this.selectNextCell()):!e&&!i||t.isNullOrUndefined(n)||n.offset!==this.getStartOffset(n.paragraph)||t.isNullOrUndefined(n.paragraph.paragraphFormat)||t.isNullOrUndefined(n.paragraph.paragraphFormat.listFormat)||-1===n.paragraph.paragraphFormat.listFormat.listId||this.owner.isReadOnlyMode?this.owner.isReadOnlyMode||this.documentHelper.isFormFillProtectedMode||this.owner.editorModule.handleTextInput("\t"):this.owner.editorModule.updateListLevel(!i),"FormFieldsOnly"===this.documentHelper.protectionType&&this.documentHelper.formFields.length>0&&this.selectPrevNextFormField(!i),this.checkForCursorVisibility())},e.prototype.getFormFieldInFormFillMode=function(){for(var e,t=this.owner.selection.start,i=this.documentHelper.formFields.length-1;i>=0;i--)if(this.documentHelper.formFields[i].formFieldData.enabled){if(this.getElementPosition(this.documentHelper.formFields[i]).startPosition.isExistBefore(t)){e=this.documentHelper.formFields[i];break}0===i&&(e=this.documentHelper.formFields[this.documentHelper.formFields.length-1])}return e},e.prototype.selectPrevNextFormField=function(e,t){if(this.documentHelper.isFormFillProtectedMode){t||(t=this.getCurrentFormField());var i=this.documentHelper.formFields.indexOf(t);if(e)for(n=i;;n++){n===this.documentHelper.formFields.length-1?n=0:n+=1;if(this.documentHelper.formFields[n].formFieldData.enabled){this.selectFieldInternal(this.documentHelper.formFields[n]);break}n-=1}else for(var n=i;;n--){0===n?n=this.documentHelper.formFields.length-1:n-=1;if(this.documentHelper.formFields[n].formFieldData.enabled){this.selectFieldInternal(this.documentHelper.formFields[n]);break}n+=1}}},e.prototype.navigateToNextFormField=function(){for(var e,t=this.owner.selection.end,i=0;i<this.documentHelper.formFields.length;i++)if(e=this.documentHelper.formFields[i],this.documentHelper.formFields[i].formFieldData.enabled){if(this.getElementPosition(this.documentHelper.formFields[i]).startPosition.isExistAfter(t)){e.formFieldData instanceof Ee&&"Text"===e.formFieldData.type&&this.documentHelper.isInlineFormFillProtectedMode?this.selectTextElementStartOfField(this.documentHelper.formFields[i]):this.selectFieldInternal(this.documentHelper.formFields[i]);break}i===this.documentHelper.formFields.length-1&&((e=this.documentHelper.formFields[0]).formFieldData instanceof Ee&&"Text"===e.formFieldData.type&&this.documentHelper.isInlineFormFillProtectedMode?this.selectTextElementStartOfField(this.documentHelper.formFields[0]):this.selectFieldInternal(this.documentHelper.formFields[0]))}},e.prototype.selectTextElementStartOfField=function(e){var t=e.fieldSeparator.nextElement;if(t){for(;!(t instanceof Oe);)t=t.nextElement;var i=e.line.getOffset(t,0),n=this.getPhysicalPositionInternal(e.line,i,!1);this.selectInternal(e.line,t,0,n)}},e.prototype.triggerFormFillEvent=function(){var e,t,i=this.previousSelectedFormField,n=this.getCurrentFormField();n!==i&&i&&i.formFieldData instanceof Ee&&"Text"===i.formFieldData.type&&(""===i.formFieldData.format||this.isFormatUpdated||this.owner.editor.applyFormTextFormat(i),e={fieldName:i.formFieldData.name,value:this.owner.editorModule.getFormFieldText(i)},this.owner.trigger(y,e)),n!==i&&n&&n.formFieldData instanceof Ee&&"Text"===n.formFieldData.type&&(t={fieldName:n.formFieldData.name,value:this.owner.editorModule.getFormFieldText(n)},this.owner.trigger(b,t))},e.prototype.selectPreviousCell=function(){var e=this.start.paragraph.associatedCell,i=e.ownerRow;i.ownerTable;if(t.isNullOrUndefined(e.previousWidget)){if(!t.isNullOrUndefined(i.previousRenderedWidget)){var n=void 0;i.previousRenderedWidget instanceof Fe&&(n=i.previousRenderedWidget),this.selectTableCellInternal(n.childWidgets[n.childWidgets.length-1],!0)}}else{var r=void 0;e.previousWidget instanceof Pe&&(r=e.previousWidget),this.selectTableCellInternal(r,!0)}},e.prototype.selectNextCell=function(){var e=this.start.paragraph.associatedCell,i=e.ownerRow;i.ownerTable;if(t.isNullOrUndefined(e.nextWidget))if(t.isNullOrUndefined(i.nextRenderedWidget)&&!this.owner.isReadOnlyMode)this.owner.editorModule.insertRow(!1);else{var n=void 0;i.nextRenderedWidget instanceof Fe&&(n=i.nextRenderedWidget),this.selectTableCellInternal(n.childWidgets[0],!0)}else{var r=void 0;e.nextRenderedWidget instanceof Pe&&(r=e.nextRenderedWidget),this.selectTableCellInternal(r,!0)}},e.prototype.selectTableCellInternal=function(e,t){var i=this.getFirstParagraph(e),n=this.getLastParagraph(e);if(i===n&&n.isEmpty())this.selectParagraphInternal(n,!0);else{var r=n.childWidgets[0];this.start.setPosition(i.childWidgets[0],!0),this.end.setPositionParagraph(r,r.getEndOffset()),this.fireSelectionChanged(!0)}},e.prototype.selectTableInternal=function(){var e=this.start,i=this.end;if(this.isForward||(e=this.end,i=this.start),!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(this.getTable(e,i))){var n=this.getContainerCellOf(e.paragraph.associatedCell,i.paragraph.associatedCell).ownerTable,r=this.getFirstParagraphBlock(n),o=this.getLastParagraphBlock(n),s=o.lastChild.getEndOffset();this.start.setPosition(r.childWidgets[0],!0),this.end.setPositionParagraph(o.lastChild,s+1)}this.selectPosition(this.start,this.end)},e.prototype.selectColumnInternal=function(){var e=this.start,i=this.end;if(this.isForward||(e=this.end,i=this.start),!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(this.getTable(e,i))){var n=this.getContainerCellOf(e.paragraph.associatedCell,i.paragraph.associatedCell);if(n.ownerTable.contains(i.paragraph.associatedCell)){var r=this.getSelectedCell(e.paragraph.associatedCell,n),o=this.getSelectedCell(i.paragraph.associatedCell,n);if(this.containsCell(n,i.paragraph.associatedCell)){r.ownerRow;var s=n.ownerTable.getColumnCellsForSelection(n,n);if(s.length>0){var a=this.getFirstParagraph(s[0]),l=this.getLastParagraph(s[s.length-1]);this.start.setPosition(a.firstChild,!0);c=l.lastChild;this.end.setPositionParagraph(c,c.getEndOffset()+1)}}else{var d=n.ownerTable.getColumnCellsForSelection(r,r),h=n.ownerTable.getColumnCellsForSelection(o,o);if(d.length>0&&h.length>0){var a=this.getFirstParagraph(d[0]),l=this.getLastParagraph(h[h.length-1]);this.start.setPosition(a.firstChild,!0);var c=l.lastChild;this.end.setPositionParagraph(c,c.getEndOffset()+1)}}}}this.selectPosition(this.start,this.end)},e.prototype.selectTableRow=function(){var e=this.start,i=this.end;if(this.isForward||(e=this.end,i=this.start),!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(this.getTable(e,i))){var n=void 0;if((n=this.getContainerCellOf(e.paragraph.associatedCell,i.paragraph.associatedCell)).ownerTable.contains(i.paragraph.associatedCell)){var r=this.getSelectedCell(e.paragraph.associatedCell,n),o=this.getSelectedCell(i.paragraph.associatedCell,n);if(this.containsCell(n,i.paragraph.associatedCell)){var s=r.ownerRow,a=this.getFirstParagraph(s.childWidgets[0]),l=this.getLastParagraph(s.childWidgets[s.childWidgets.length-1]);this.start.setPosition(a.firstChild,!0),this.end.setPositionParagraph(l.lastChild,l.lastChild.getEndOffset()+1)}else{var a=this.getFirstParagraph(r.ownerRow.childWidgets[0]),l=void 0;l=this.getLastParagraph(o.ownerRow.childWidgets[o.ownerRow.childWidgets.length-1]),this.start.setPosition(a.firstChild,!0),this.end.setPositionParagraph(l.lastChild,l.lastChild.getEndOffset()+1)}}}this.selectPosition(this.start,this.end)},e.prototype.selectTableCell=function(){var e=this.start,i=this.end;if(this.isForward||(e=this.end,i=this.start),!t.isNullOrUndefined(this.getTable(e,i))){if(this.isEmpty)e.paragraph.isInsideTable&&!t.isNullOrUndefined(e.paragraph.associatedCell)&&((r=this.getFirstParagraph(e.paragraph.associatedCell))===(o=this.getLastParagraph(i.paragraph.associatedCell))?(this.start.setPosition(o.firstChild,!0),this.end.setPositionParagraph(o.lastChild,o.lastChild.getEndOffset()+1)):(this.start.setPosition(r.firstChild,!0),this.end.setPositionParagraph(o.lastChild,o.lastChild.getEndOffset()+1)));else{var n=this.getContainerCell(e.paragraph.associatedCell);if(this.containsCell(n,e.paragraph.associatedCell)&&this.containsCell(n,i.paragraph.associatedCell)){var r=this.getFirstParagraph(n),o=this.getLastParagraph(n);t.isNullOrUndefined(r)||t.isNullOrUndefined(o)||(this.start.setPosition(r.firstChild,!0),this.end.setPositionParagraph(o.lastChild,o.lastChild.getEndOffset()+1))}}this.selectPosition(this.start,this.end)}},e.prototype.selectAll=function(){var e,i;this.documentHelper.skipScrollToPosition=!0;var n=this.getContainerWidget(this.start.paragraph);if(this.owner.enableHeaderAndFooter){var r=this.getContainerWidget(this.start.paragraph);e=this.setPositionForBlock(r.firstChild,!0),i=this.setPositionForBlock(r.lastChild,!1)}else if(this.isInShape){var o=this.getCurrentTextFrame();e=this.setPositionForBlock(o.firstChild,!0),i=this.setPositionForBlock(o.lastChild,!1)}else if(n instanceof be&&"Footnote"===n.footNoteType){var s=void 0,a=void 0,l=this.documentHelper.pages.length;for(s=0;s<=l-1;s++)if(!t.isNullOrUndefined(this.documentHelper.pages[s].footnoteWidget)){e=this.setPositionForBlock(this.documentHelper.pages[s].footnoteWidget.firstChild,!0);break}for(a=l-1;a>=0;a--)if(!t.isNullOrUndefined(this.documentHelper.pages[a].footnoteWidget)){var d=this.documentHelper.pages[a].footnoteWidget.childWidgets.length;i=this.setPositionForBlock(this.documentHelper.pages[a].footnoteWidget.childWidgets[d-1],!1);break}}else if(n instanceof be&&"Endnote"===n.footNoteType){var h=this.getContainerWidget(this.start.paragraph);e=this.setPositionForBlock(h.firstChild,!0),i=this.setPositionForBlock(h.lastChild,!1)}else e=this.owner.documentStart,i=this.owner.documentEnd;t.isNullOrUndefined(e)||(this.start.setPositionInternal(e),this.end.setPositionParagraph(i.currentWidget,i.offset+1),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.extendBackward=function(){t.isNullOrUndefined(this.start)||((this.isForward?this.start.isCurrentParaBidi:this.end.isCurrentParaBidi)?this.end.moveForward():this.end.moveBackward(),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.extendForward=function(){t.isNullOrUndefined(this.start)||((this.isForward?this.start.isCurrentParaBidi:this.end.isCurrentParaBidi)?this.end.moveBackward():this.end.moveForward(),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.extendToWordStartEnd=function(){return!(!this.start.paragraph.isInsideTable&&!this.end.paragraph.isInsideTable||this.start.paragraph.associatedCell===this.end.paragraph.associatedCell&&!this.isCellSelected(this.start.paragraph.associatedCell,this.start,this.end))},e.prototype.extendToWordStart=function(){this.extendToWordStartInternal(!1)},e.prototype.extendToWordEnd=function(){this.extendToWordEndInternal(!1)},e.prototype.extendToWordStartInternal=function(e){t.isNullOrUndefined(this.start)||(this.extendToWordStartEnd()?this.end.moveToPreviousParagraphInTable(this):e&&this.end.isCurrentParaBidi?this.end.moveToWordEndInternal(e?0:1,!1):this.end.moveToWordStartInternal(e?0:1),e&&this.start.setPositionInternal(this.end),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.extendToWordEndInternal=function(e){t.isNullOrUndefined(this.start)||(this.extendToWordStartEnd()?this.end.moveToNextParagraphInTable():e&&this.end.isCurrentParaBidi?this.end.moveToWordStartInternal(e?0:1):this.end.moveToWordEndInternal(e?0:1,!1),e&&this.start.setPositionInternal(this.end),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0))},e.prototype.extendToNextLine=function(){t.isNullOrUndefined(this.start)||(this.end.moveToNextLine(this.upDownSelectionLength),this.fireSelectionChanged(!0))},e.prototype.getTextPosition=function(e){var t=new kt(this.owner);return t.setPositionForCurrentIndex(e),t},e.prototype.getText=function(e){if(!(t.isNullOrUndefined(this.start)||t.isNullOrUndefined(this.end)||t.isNullOrUndefined(this.start.paragraph)||t.isNullOrUndefined(this.end.paragraph))){var i=this.start,n=this.end;return i.isAtSamePosition(n)?"":this.getTextInternal(i,n,e)}},e.prototype.getTextInternal=function(e,i,n){if(e.isExistAfter(i)){var r=i;i=e,e=r}var o=e,s=i;if(!(t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||t.isNullOrUndefined(e.paragraph)||t.isNullOrUndefined(i.paragraph))){var a=0,l=0,d=e.offset,h=i.offset,c=e.currentWidget.getInline(d,a);a=c.index;var p=c.element;if(p instanceof Ie&&!t.isNullOrUndefined(p.fieldEnd)){var g=this.getRenderedInline(p,a);p=g.element,a=g.index}var u=i.currentWidget.getInline(h,l),m=u.element;l=u.index;var f="";if(p instanceof Ze&&n&&0===a?f=Se.objectCharacter:p instanceof Oe&&(f=t.isNullOrUndefined(p.text)||""===p.text||p.text.length<a?f:p.text.substring(a)),o.paragraph===s.paragraph)p instanceof Se&&(p===m&&p instanceof Oe?f=f.length<l-a?f:f.substring(0,l-a):p.nextNode instanceof Se&&(f+=this.getTextInline(p.nextNode,s.paragraph,m,l,n)));else if(p instanceof Se&&p.nextNode instanceof Se)f+=this.getTextInline(p.nextNode,s.paragraph,void 0,0,n);else{var v=this.documentHelper.selection.getNextParagraphBlock(o.paragraph);for(f+="\r";!t.isNullOrUndefined(v)&&v.isEmpty();){if(f+="\r",v===s.paragraph)return f;v=this.documentHelper.selection.getNextParagraphBlock(v)}t.isNullOrUndefined(v)||v.isEmpty()||(f+=this.getTextInline(v.childWidgets[0].children[0],s.paragraph,m,l,n))}return h===s.currentWidget.getEndOffset()+1&&(f+="\r"),f}},e.prototype.getHierarchicalIndex=function(e,t){var i;if(e){if(e instanceof ve){var n=-1!==e.headerFooterType.indexOf("Header")?"H":"F",r=e.page.index.toString();i=(o=e.page.sectionIndex)+";"+n+";"+r+";"+t}else i=e.index+";"+t;if(e instanceof Xe)return i="S;"+e.containerShape.indexInOwner.toString()+";"+t,this.getHierarchicalIndex(e.containerShape.paragraph,i);if(e instanceof be){var n="Footnote"===e.footNoteType?"FN":"EN",r=e.page.index.toString(),o=e.page.sectionIndex;i=o+";"+n+";"+r+";"+t}if(e.containerWidget)return e instanceof Pe&&e.rowIndex!==e.containerWidget.index&&(i=e.rowIndex+";"+i,e=e.containerWidget),this.getHierarchicalIndex(e.containerWidget,i)}return i},e.prototype.getHierarchicalIndexByPosition=function(e){var t=this.getParagraphInfo(e);return this.getHierarchicalIndex(t.paragraph,t.offset.toString())},e.prototype.getTextPosBasedOnLogicalIndex=function(e){var t=new kt(this.owner),i=this.getParagraph({index:e}),n=this.getLineInfoBasedOnParagraph(i.paragraph,i.offset);return t.setPositionForLineWidget(n.line,n.offset),t},e.prototype.getLineInfoBasedOnParagraph=function(e,i){var n=this.getParagraphLength(e),r=e.nextSplitWidget;for(i>n+1&&t.isNullOrUndefined(r)&&(i=n);i>n&&r instanceof we;)i-=n,e=r,n=this.getParagraphLength(e),r=e.nextSplitWidget;return this.getLineInfo(e,i)},e.prototype.getParagraph=function(e){return{paragraph:this.getParagraphInternal(this.getBodyWidget(e),e),offset:parseInt(e.index,10)}},e.prototype.getBodyWidget=function(e){var t=e.index.indexOf(";"),i=e.index.substring(0,t);e.index=e.index.substring(t).replace(";","");var n=parseInt(i,10);return t=parseInt(i,10),t=e.index.indexOf(";"),"H"===(i=e.index.substring(0,t))||"F"===i?this.getHeaderFooterWidget(e):"FN"===i||"EN"===i?this.getFootNoteWidget(e):(t=parseInt(i,10),this.getBodyWidgetInternal(n,t))},e.prototype.getFootNoteWidget=function(e){var t=e.index.indexOf(";"),i=e.index.substring(0,t);e.index=e.index.substring(t).replace(";","");var n="FN"===i;t=e.index.indexOf(";"),i=e.index.substring(0,t),e.index=e.index.substring(t).replace(";",""),t=parseInt(i,10);var r=this.documentHelper.pages[t];return n?r.footnoteWidget:r.endnoteWidget},e.prototype.getHeaderFooterWidget=function(e){var t=e.index.indexOf(";"),i=e.index.substring(0,t);e.index=e.index.substring(t).replace(";","");var n="H"===i;t=e.index.indexOf(";"),i=e.index.substring(0,t),e.index=e.index.substring(t).replace(";",""),t=parseInt(i,10);var r=this.documentHelper.pages[t];return n?r.headerWidget:r.footerWidget},e.prototype.getBodyWidgetInternal=function(e,t){for(var i=0;i<this.documentHelper.pages.length;i++){var n=this.documentHelper.pages[i].bodyWidgets[0];if(n.index===e&&n.childWidgets.length>0&&n.firstChild.index<=t&&n.lastChild.index>=t)return n;if(n.index>e)break}},e.prototype.getParagraphInternal=function(e,i){if(!t.isNullOrUndefined(i.index)){var n=i.index.indexOf(";"),r="0";n>=0&&(r=i.index.substring(0,n),i.index=i.index.substring(n).replace(";","")),n=parseInt(r,10),e instanceof Fe&&n>=e.childWidgets.length&&(i.index="0;0",n=e.childWidgets.length-1);var o=this.getBlockByIndex(e,n);if(o){if("S"===(r=i.index.substring(0,1))){i.index=i.index.substring(1).replace(";","");var s=i.index.substring(0,1);i.index=i.index.substring(1).replace(";","");var a=i.index.substring(0,1);i.index=i.index.substring(1).replace(";",""),o=o.floatingElements[s].textFrame.childWidgets[a]}var l=o;if(l instanceof we)return i.index.indexOf(";")>0&&(i.index="0"),l;if(l instanceof ue){if(i.index.indexOf(";")>0)return this.getParagraphInternal(l,i);if(l instanceof xe)return this.documentHelper.selection.getFirstParagraphInFirstCell(l);return}}else if(e){var d=e.getSplitWidgets().pop().nextRenderedWidget;if(d instanceof ue)return i.index="0",d instanceof xe?this.documentHelper.selection.getFirstParagraphInFirstCell(d):d}}},e.prototype.getBlockByIndex=function(e,t){var i;if(e){for(var n=0;n<e.childWidgets.length;n++)if(e.childWidgets[n].index===t){i=e.childWidgets[n];break}if(!(i||e instanceof ve))return this.getBlockByIndex(e.nextSplitWidget,t)}return i},e.prototype.getParagraphInfo=function(e){return this.getParagraphInfoInternal(e.currentWidget,e.offset)},e.prototype.getParagraphInfoInternal=function(e,t){for(var i=e.paragraph,n=this.getParagraphLength(i,e)+t,r=i.previousSplitWidget;r instanceof we;)i=r,n+=this.documentHelper.selection.getParagraphLength(i),r=i.previousSplitWidget;return{paragraph:i,offset:n}},e.prototype.getListTextElementBox=function(e){if(!t.isNullOrUndefined(e)){var i;if(!e.isEmpty()){var n=e.childWidgets[0];n.children.length>1&&n.children[0]instanceof Qe&&(i=n.children[0])}return i}},e.prototype.getListLevel=function(e){var i=void 0,n=0;if(t.isNullOrUndefined(e.paragraphFormat)||t.isNullOrUndefined(e.paragraphFormat.listFormat)||(i=this.documentHelper.getListById(e.paragraphFormat.listFormat.listId),n=e.paragraphFormat.listFormat.listLevelNumber),!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(this.documentHelper.getAbstractListById(i.abstractListId))&&!t.isNullOrUndefined(this.documentHelper.getAbstractListById(i.abstractListId).levels))return this.documentHelper.layout.getListLevel(i,n)},e.prototype.getTextInline=function(e,i,n,r,o){var s="";do{if(e===n){if(e instanceof Oe){var a=e;t.isNullOrUndefined(a.text)||""===a.text||(a.text.length<r?s+=a.text:s+=a.text.substring(0,r))}else e instanceof Ze&&o&&r===e.length&&(s+=Se.objectCharacter);return s}if(e instanceof Oe?s+=e.text:e instanceof Ze&&o?s+=Se.objectCharacter:e instanceof Ie&&!t.isNullOrUndefined(e.fieldEnd)&&(e=t.isNullOrUndefined(e.fieldSeparator)?e.fieldEnd:e.fieldSeparator),t.isNullOrUndefined(e.nextNode))break;e=e.nextNode}while(!t.isNullOrUndefined(e));if(i===e.line.paragraph)return s;for(var l=this.documentHelper.selection.getNextParagraphBlock(e.line.paragraph);!t.isNullOrUndefined(l)&&l.isEmpty();){if(s+="\r",l===i)return s;l=this.documentHelper.selection.getNextParagraphBlock(l)}if(!t.isNullOrUndefined(l)&&!l.isEmpty()){var d=l.childWidgets[0];s=s+"\r"+this.getTextInline(d.children[0],i,n,r,o)}return s},e.prototype.getFieldCode=function(e){var t="";if(!(e.fieldEnd instanceof Ie))return t;var i=e.paragraph,n=e.fieldEnd.paragraph;e.fieldSeparator instanceof Ie&&(n=e.fieldSeparator.paragraph);var r=e.line.indexInOwner,o=e.indexInOwner;do{if(t+=this.getFieldCodeInternal(i,r,o),i===n)break;i=this.getNextParagraphBlock(i),r=0,o=0}while(i instanceof we);return t.trim()},e.prototype.getFieldCodeInternal=function(e,t,i){for(var n="",r=t;r<e.childWidgets.length;r++){for(var o=e.childWidgets[r],s=i;s<o.children.length;s++){var a=o.children[s];if(a instanceof Oe&&(n+=a.text),a instanceof Ie&&(2===a.fieldType||1===a.fieldType))return n}i=0}return n},e.prototype.getTocFieldInternal=function(){var e=this.start.paragraph;for(this.isEmpty||this.isForward||(e=this.end.paragraph);e instanceof we&&e.childWidgets.length>0;){var t=e.firstChild;if(t.children.length>0){var i=t.children[0],n=i.nextNode;if(i instanceof Ie&&0===i.fieldType&&n instanceof Oe&&0===n.text.trim().toLowerCase().indexOf("toc"))return i}e=e.previousRenderedWidget}},e.prototype.getNextParagraph=function(e){if(e.nextRenderedWidget instanceof fe){var t=e.nextRenderedWidget.childWidgets[0];return this.getFirstParagraphBlock(t)}},e.prototype.getPreviousParagraph=function(e){if(e.previousRenderedWidget instanceof fe){var t=e.previousRenderedWidget,i=t.childWidgets[t.childWidgets.length-1];return this.getLastParagraphBlock(i)}},e.prototype.getFirstParagraphInCell=function(e){var t=e.childWidgets[0];return t instanceof we?t:this.getFirstParagraphInFirstCell(t)},e.prototype.getFirstParagraphInFirstCell=function(e){if(e.childWidgets.length>0){var t=e.childWidgets[0].childWidgets[0].childWidgets[0];return this.getFirstParagraphBlock(t)}},e.prototype.getLastParagraphInLastCell=function(e){if(e.childWidgets.length>0){var t=e.lastChild.lastChild.lastChild;return this.getLastParagraphBlock(t)}},e.prototype.getLastParagraphInFirstRow=function(e){if(e.childWidgets.length>0){var t=e.firstChild.lastChild.lastChild;return this.getLastParagraphBlock(t)}},e.prototype.getNextStartInline=function(e,i){var n=0,r=e.getInline(i,n),o=r.element;if(n=r.index,!t.isNullOrUndefined(o)&&n===o.length&&o.nextNode instanceof Ie||o instanceof Ke){var s=this.getNextValidElement(o.nextNode);s instanceof Ie&&0===s.fieldType&&(o=s)}return o},e.prototype.getPreviousTextInline=function(e){return e.previousNode instanceof Oe?e.previousNode:e.previousNode instanceof Ie&&L.isLinkedFieldCharacter(e.previousNode)?0===e.previousNode.fieldType||1===e.previousNode.fieldType?e.previousNode:e.previousNode.fieldBegin:t.isNullOrUndefined(e.previousNode)?void 0:this.getPreviousTextInline(e.previousNode)},e.prototype.getNextTextInline=function(e){return e.nextNode instanceof Oe?e.nextNode:e.nextNode instanceof Ie&&L.isLinkedFieldCharacter(e.nextNode)?1===e.nextNode.fieldType||0===e.nextNode.fieldType?e.nextNode:e.nextNode.fieldEnd:t.isNullOrUndefined(e.nextNode)?void 0:this.getNextTextInline(e.nextNode)},e.prototype.getContainerTable=function(e){if(e.isInsideTable&&(e=e.associatedCell.ownerTable.isInsideTable?this.getContainerTable(e.associatedCell.ownerTable):e.associatedCell.ownerTable),e instanceof xe)return e},e.prototype.isElementInSelection=function(e){var t=e.line.getOffset(e,1),i=new kt(this.owner);i.setPositionParagraph(e.line,t);var n=this.start,r=this.end;return this.isForward||(r=n=r),(i.isExistAfter(n)||i.isAtSamePosition(n))&&(i.isExistBefore(r)||i.isAtSamePosition(r))},e.prototype.isExistBefore=function(e,t){if(e.isInsideTable){var i=e.associatedCell;if(t.isInsideTable){var n=t.associatedCell;if(i===n)return i.childWidgets.indexOf(e)<i.childWidgets.indexOf(t);if(i.ownerRow===n.ownerRow)return i.cellIndex<n.cellIndex;if(i.ownerTable===n.ownerTable)return i.ownerRow.rowIndex<n.ownerRow.rowIndex;var r=this.getContainerCellOf(i,n);return r.ownerTable.contains(n)?(i=this.getSelectedCell(i,r),n=this.getSelectedCell(n,r),i===r?this.isExistBefore(e,n.ownerTable):n===r?this.isExistBefore(i.ownerTable,t):r.ownerRow===n.ownerRow?r.cellIndex<n.cellIndex:r.ownerTable===n.ownerTable?r.ownerRow.rowIndex<n.ownerRow.rowIndex:this.isExistBefore(i.ownerTable,n.ownerTable)):this.isExistBefore(r.ownerTable,this.getContainerTable(n.ownerTable))}o=this.getContainerTable(e);return this.isExistBefore(o,t)}if(t.isInsideTable){var o=this.getContainerTable(t);return this.isExistBefore(e,o)}return e.containerWidget===t.containerWidget?e.index<t.index:(e.containerWidget instanceof fe&&t.containerWidget instanceof fe||e.containerWidget instanceof be&&t.containerWidget instanceof be)&&this.documentHelper.pages.indexOf(e.containerWidget.page)<this.documentHelper.pages.indexOf(t.containerWidget.page)},e.prototype.isExistAfter=function(e,t){if(e.isInsideTable){var i=e.associatedCell;if(t.isInsideTable){var n=t.associatedCell;if(i===n)return i.childWidgets.indexOf(e)>i.childWidgets.indexOf(t);if(i.ownerRow===n.ownerRow)return i.cellIndex>n.cellIndex;if(i.ownerTable===n.ownerTable)return i.ownerRow.rowIndex>n.ownerRow.rowIndex;var r=this.getContainerCellOf(i,n);return r.ownerTable.contains(n)?(i=this.getSelectedCell(i,r),n=this.getSelectedCell(n,r),i===r?this.isExistAfter(e,n.ownerTable):n===r?this.isExistAfter(i.ownerTable,t):r.ownerRow===n.ownerRow?r.cellIndex>n.cellIndex:r.ownerTable===n.ownerTable?r.ownerRow.rowIndex>n.ownerRow.rowIndex:this.isExistAfter(i.ownerTable,n.ownerTable)):this.isExistAfter(r.ownerTable,this.getContainerTable(n.ownerTable))}o=this.getContainerTable(e);return this.isExistAfter(o,t)}if(t.isInsideTable){var o=this.getContainerTable(t);return this.isExistAfter(e,o)}return e.containerWidget===t.containerWidget?e.index>t.index:(e.containerWidget instanceof fe&&t.containerWidget instanceof fe||e.containerWidget instanceof be&&t.containerWidget instanceof be)&&this.documentHelper.pages.indexOf(e.containerWidget.page)>this.documentHelper.pages.indexOf(t.containerWidget.page)},e.prototype.isExistBeforeInline=function(e,t){if(e.line===t.line)return e.line.children.indexOf(e)<=t.line.children.indexOf(t);if(e.line.paragraph===t.line.paragraph)return e.line.paragraph.childWidgets.indexOf(e.line)<t.line.paragraph.childWidgets.indexOf(t.line);var i=e.line.paragraph,n=t.line.paragraph;if(i.containerWidget===n.containerWidget){if(i.isInsideTable)return i.associatedCell.childWidgets.indexOf(i)<n.associatedCell.childWidgets.indexOf(n);if(!(i.containerWidget instanceof ve))return i.containerWidget.childWidgets.indexOf(i)<n.containerWidget.childWidgets.indexOf(n)}return this.isExistBefore(i,n)},e.prototype.isExistAfterInline=function(e,t,i){if(e.line===t.line){var n=this.documentHelper.selection;return i?e.line.children.indexOf(e)>=t.line.children.indexOf(t):e===t&&n.start.offset!==n.end.offset?e.line.children.indexOf(e)===t.line.children.indexOf(t):e.line.children.indexOf(e)>t.line.children.indexOf(t)}if(e.line.paragraph===t.line.paragraph)return e.line.paragraph.childWidgets.indexOf(e.line)>t.line.paragraph.childWidgets.indexOf(t.line);var r=e.line.paragraph,o=t.line.paragraph;if(r.containerWidget===o.containerWidget){if(r.isInsideTable)return r.associatedCell.childWidgets.indexOf(r)>o.associatedCell.childWidgets.indexOf(o);if(!(r.containerWidget instanceof ve))return r.containerWidget.childWidgets.indexOf(r)>o.containerWidget.childWidgets.indexOf(o)}return this.isExistAfter(r,o)},e.prototype.getNextRenderedBlock=function(e){return t.isNullOrUndefined(e.nextWidget)?e.nextRenderedWidget:e.nextWidget},e.prototype.getPreviousRenderedBlock=function(e){return t.isNullOrUndefined(e.previousWidget)?e.previousRenderedWidget:e.previousWidget},e.prototype.getNextParagraphBlock=function(e){if(e.nextRenderedWidget instanceof we)return e.nextRenderedWidget;if(e.nextRenderedWidget instanceof xe)return this.getFirstParagraphInFirstCell(e.nextRenderedWidget);if(e.containerWidget instanceof Pe)return this.getNextParagraphCell(e.containerWidget);if(e.containerWidget instanceof fe){e.containerWidget;return this.getNextParagraph(e.containerWidget)}return e.containerWidget instanceof ve&&this.isMoveDownOrMoveUp?this.getFirstBlockInNextHeaderFooter(e):void 0},e.prototype.getFirstBlockInNextHeaderFooter=function(e){var t,i=e.containerWidget;if(-1!==i.headerFooterType.indexOf("Header"))t=i.page.footerWidget.firstChild;else{if(!i.page.nextPage)return;t=i.page.nextPage.headerWidget.firstChild}return t instanceof we?t:this.getFirstBlockInFirstCell(t)},e.prototype.getLastBlockInPreviousHeaderFooter=function(e){var t,i=e.containerWidget;if(-1!==i.headerFooterType.indexOf("Footer"))t=i.page.headerWidget.lastChild;else{if(!i.page.previousPage)return;t=i.page.previousPage.footerWidget.lastChild}return t instanceof we?t:this.getFirstBlockInFirstCell(t)},e.prototype.getPreviousParagraphBlock=function(e){return e.previousRenderedWidget instanceof we?e.previousRenderedWidget:e.previousRenderedWidget instanceof xe?this.getLastParagraphInLastCell(e.previousRenderedWidget):e.containerWidget instanceof Pe?this.getPreviousParagraphCell(e.containerWidget):e.containerWidget instanceof fe?this.getPreviousParagraph(e.containerWidget):e.containerWidget instanceof ve&&this.isMoveDownOrMoveUp?this.getLastBlockInPreviousHeaderFooter(e):void 0},e.prototype.getFirstParagraphBlock=function(e){return e instanceof we?e:e instanceof xe?this.getFirstParagraphInFirstCell(e):void 0},e.prototype.getLastParagraphBlock=function(e){return e instanceof we?e:e instanceof xe?this.getLastParagraphInLastCell(e):void 0},e.prototype.hasValidInline=function(e,t,i){for(var n=e.childWidgets.indexOf(t.line);n<e.childWidgets.length;n++)for(var r=0;r<e.childWidgets[n].children.length;r++){var o=e.childWidgets[n].children[r];if(0!==o.length){if(o===i)return!1;if(o instanceof Oe||o instanceof Ze||o instanceof Ie&&L.isLinkedFieldCharacter(o))return!0}}return!1},e.prototype.getParagraphLength=function(e,t,i){for(var n=0,r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];if(t instanceof Te&&t===o){i&&(n+=this.getLineLength(o,i));break}n+=this.getLineLength(o)}return n},e.prototype.getLineLength=function(e,t){for(var i=0,n=e.paragraph.bidi,r=n?e.children.length-1:0;n?r>-1:r<e.children.length;n?r--:r++){var o=e.children[r];if(!(o instanceof Qe)){if(t&&t.element instanceof Se&&t.element===o){i+=t.index;break}i+=o.length}}return i},e.prototype.getLineInfo=function(e,t){for(var i=void 0,n=0,r=e.childWidgets.length,o=0;o<r&&(i=e.childWidgets[o],n=this.getLineLength(i),!(t<=n||o===r-1));o++)t-=n;return{line:i,offset:t}},e.prototype.getElementInfo=function(e,i){for(var n=void 0,r=0;r<e.children.length;r++)if(!((n=e.children[r])instanceof Qe)){if(!(i>n.length)||i===n.length+1&&t.isNullOrUndefined(n.nextNode))break;i-=n.length}return{element:n,index:i}},e.prototype.getStartOffset=function(e){if(e.childWidgets.length>0){var t=e.childWidgets[0];return this.getStartLineOffset(t)}return 0},e.prototype.getStartLineOffset=function(e){for(var t=0,i=0;i<e.children.length;i++){var n=e.children[i];if(0!==n.length){if(n instanceof Oe||n instanceof Ze||n instanceof Ae||n instanceof Ke||n instanceof et||n instanceof $e||n instanceof vt||n instanceof Ie&&L.isLinkedFieldCharacter(n)||n instanceof Me)return t;n instanceof Qe||(t+=n.length)}}return t},e.prototype.getPreviousSelectionCell=function(e){if(!t.isNullOrUndefined(e.previousRenderedWidget)){if(this.isForward){var i=e.previousRenderedWidget.childWidgets,n=i[i.length-1];return n instanceof we?n:this.getPreviousParagraphSelection(n.childWidgets[n.childWidgets.length-1])}return(n=e.previousRenderedWidget.childWidgets[0])instanceof we?n:this.getFirstParagraphInLastRow(n)}return this.getPreviousSelectionRow(e.ownerRow)},e.prototype.getPreviousSelectionRow=function(e){if(!t.isNullOrUndefined(e.previousRenderedWidget)){if(this.isForward)return this.getPreviousParagraphSelection(e.previousRenderedWidget);var i=e.previousRenderedWidget.childWidgets[0].childWidgets[0];return this.getFirstParagraphBlock(i)}return this.getPreviousSelectionBlock(e.ownerTable)},e.prototype.getNextSelectionBlock=function(e){return e.nextRenderedWidget instanceof we?e.nextRenderedWidget:e.nextRenderedWidget instanceof xe?this.isEmpty||this.isForward?this.getLastParagraphInFirstRow(e.nextRenderedWidget):this.getNextParagraphSelection(e.nextRenderedWidget.childWidgets[0]):e.containerWidget instanceof Pe?this.getNextSelectionCell(e.containerWidget):e.containerWidget instanceof fe?this.getNextSelection(e.containerWidget):void 0},e.prototype.getNextSelectionCell=function(e){if(!t.isNullOrUndefined(e.nextRenderedWidget)){if(this.isEmpty||this.isForward){var i=e.nextRenderedWidget.childWidgets[e.nextRenderedWidget.childWidgets.length-1];return this.getLastParagraphBlock(i)}return(i=e.nextRenderedWidget.childWidgets[0])instanceof we?i:this.getNextParagraphSelection(i.childWidgets[0])}return this.getNextSelectionRow(e.ownerRow)},e.prototype.getNextSelectionRow=function(e){if(!t.isNullOrUndefined(e.nextRenderedWidget)){if(this.isEmpty||this.isForward){var i=e.nextRenderedWidget.childWidgets[e.nextRenderedWidget.childWidgets.length-1],n=i.childWidgets[i.childWidgets.length-1];return this.getLastParagraphBlock(n)}return this.getNextParagraphSelection(e.nextRenderedWidget)}return this.getNextSelectionBlock(e.ownerTable)},e.prototype.getNextSelection=function(e){if(e.nextRenderedWidget instanceof fe){var t=e.nextRenderedWidget.childWidgets[0];return t instanceof we?t:this.isEmpty||this.isForward?this.getLastParagraphInFirstRow(t):this.getNextParagraphSelection(t.childWidgets[0])}},e.prototype.getNextParagraphSelection=function(e){var t=e.childWidgets[0];if(this.start.paragraph.isInsideTable&&e.ownerTable.contains(this.start.paragraph.associatedCell)){var i=this.getCellInTable(e.ownerTable,this.start.paragraph.associatedCell);t=this.getFirstCellInRegion(e,i,this.upDownSelectionLength,!1)}var n=t.childWidgets[0];return this.getFirstParagraphBlock(n)},e.prototype.getPreviousSelectionBlock=function(e){return e.previousRenderedWidget instanceof we?e.previousRenderedWidget:e.previousRenderedWidget instanceof xe?this.isForward?this.getPreviousParagraphSelection(e.previousRenderedWidget.childWidgets[e.previousRenderedWidget.childWidgets.length-1]):this.getFirstParagraphInLastRow(e.previousRenderedWidget):e.containerWidget instanceof Pe?this.getPreviousSelectionCell(e.containerWidget):e.containerWidget instanceof fe?this.getPreviousSelection(e.containerWidget):void 0},e.prototype.getPreviousSelection=function(e){if(e.previousRenderedWidget instanceof fe){var t=e.previousRenderedWidget,i=t.childWidgets[t.childWidgets.length-1];if(i instanceof we)return i;if(this.isForward){var n=i;return this.getPreviousParagraphSelection(n.childWidgets[n.childWidgets.length-1])}return this.getFirstParagraphInLastRow(i)}},e.prototype.getPreviousParagraphSelection=function(e){var t=e.childWidgets[e.childWidgets.length-1];if(this.start.paragraph.isInsideTable&&e.ownerTable.contains(this.start.paragraph.associatedCell)){var i=this.getCellInTable(e.ownerTable,this.start.paragraph.associatedCell);t=this.getLastCellInRegion(e,i,this.upDownSelectionLength,!0)}var n=t.childWidgets[t.childWidgets.length-1];return this.getLastParagraphBlock(n)},e.prototype.getLastCellInRegion=function(e,i,n,r){var o=this.getCellLeft(e,i),s=o+i.cellFormat.cellWidth,a=!0;if(o<=n&&n<s)for(d=e.childWidgets.length-1;d>=0;d--){var l=this.getCellLeft(e,e.childWidgets[d]);if(L.round(o,2)<=L.round(l,2)&&L.round(l,2)<L.round(s,2))return a=!1,e.childWidgets[d]}else for(var d=e.childWidgets.length-1;d>=0;d--)if((l=this.getCellLeft(e,e.childWidgets[d]))<=n&&l+e.childWidgets[d].cellFormat.cellWidth>n)return a=!1,e.childWidgets[d];if(a){if(!t.isNullOrUndefined(e.previousRenderedWidget)&&r)return this.getLastCellInRegion(e.previousRenderedWidget,i,n,r);if(!t.isNullOrUndefined(e.nextRenderedWidget)&&!r)return this.getLastCellInRegion(e.nextRenderedWidget,i,n,r)}return e.childWidgets[e.childWidgets.length-1]},e.prototype.getCellInTable=function(e,t){for(;t.ownerTable.isInsideTable;){if(e.equals(t.ownerTable))return t;t=t.ownerTable.associatedCell}return t},e.prototype.getFirstParagraphInLastRow=function(e){if(e.childWidgets.length>0){var t=e.childWidgets[e.childWidgets.length-1].childWidgets[0].childWidgets[0];return this.getFirstParagraphBlock(t)}},e.prototype.getPreviousValidOffset=function(e,t){if(0===t)return 0;for(var i=0,n=0,r=0,o=e.paragraphFormat.bidi,s=0;s<e.childWidgets.length;s++){var a=e.childWidgets[s];if(o){if((r=a.getInlineForOffset(t,!1,void 0,!1,!0,!1).index)>=0)return r}else for(var l=0;l<a.children.length;l++){var d=a.children[l];if(!(0===d.length||d instanceof Qe)){if(t<=n+d.length)return t-1===n?i:t-1;(d instanceof Oe||d instanceof Ze||d instanceof Ae||d instanceof Ie&&L.isLinkedFieldCharacter(d))&&(i=n+d.length),n+=d.length}}}return t-1===n?i:t-1},e.prototype.getNextValidOffset=function(e,t){var i=0;if(e.paragraph.paragraphFormat.bidi)t!==this.getLineLength(e)&&(t=e.getInlineForOffset(t,!1,void 0,!1,!1,!0).index);else for(var n=0;n<e.children.length;n++){var r=e.children[n];if(!(0===r.length||r instanceof Qe)){if(t<i+r.length&&(r instanceof Oe||r instanceof Ze||r instanceof Ie&&L.isLinkedFieldCharacter(r)))return(t>i?t:i)+1;if(t===i+r.length&&r instanceof Ie&&1===r.fieldType&&r.previousNode instanceof Ze)return t;i+=r.length}}return t},e.prototype.getParagraphMarkSize=function(e,t,i){var n=this.documentHelper.textHelper.getParagraphMarkSize(e.characterFormat),r=n.BaselineOffset,o=n.Height,s=r;if(e instanceof we){if(e.childWidgets.length>0)e.childWidgets[0];var a=this.documentHelper.layout.getLineSpacing(e,o),l=this.documentHelper.layout.getBeforeSpacing(e);t=s-r,i=o-s-(n.Height-r);var d=e.paragraphFormat.lineSpacingType;"Multiple"===d?a>o?i+=a-o:t+=a-o:"Exactly"===d?t+=a-(t+n.Height+i):a>t+n.Height+i&&(t+=a-(t+n.Height+i)),t+=l,i+=this.documentHelper.layout.getAfterSpacing(e)}return{width:n.Width,height:n.Height,topMargin:t,bottomMargin:i}},e.prototype.getPhysicalPositionInternal=function(e,t,i){if(e.paragraph.isEmpty()){var n=e.paragraph,r=n.x;if(n.childWidgets.length>0){var o=n.childWidgets[0];r=this.getLeft(o)}var s=this.getParagraphMarkSize(e.paragraph,0,0);return t>0&&(r+=s.width),new R(r,n.y+0)}var a=0,l=e.getInline(t,a,e.paragraph.bidi),d=l.element;return a=l.index,this.getPhysicalPositionInline(d,a,i)},e.prototype.highlightSelectedContent=function(e,i){if(!e.paragraph.isInsideTable||i.paragraph.isInsideTable&&e.paragraph.associatedCell.equals(i.paragraph.associatedCell)&&!this.isCellSelected(e.paragraph.associatedCell,e,i)){var n=void 0,r=0;if(!this.owner.isReadOnlyMode&&e.paragraph===i.paragraph)if(e.offset+1===i.offset){var o=i.currentWidget.getInline(i.offset,r);n=o.element,r=o.index,(n instanceof Ze||n instanceof Ke)&&e.currentWidget.getOffset(n,0)!==e.offset&&(n=void 0)}else{var s=0,a=e.currentWidget.getInline(e.offset,s),l=a.element;(s=a.index)===l.length&&(l=this.getNextRenderedElementBox(l,s));var d=i.currentWidget.getInline(i.offset,s),h=d.element;if(s=d.index,l instanceof Ie&&h instanceof Ie&&!t.isNullOrUndefined(l.fieldSeparator)){var c=l.fieldSeparator.nextNode;c instanceof Ze&&c.nextNode===h&&(n=c)}}if(!this.owner.isReadOnlyMode&&this.owner.isDocumentLoaded&&(n instanceof Ze||n instanceof Ke)){var p=this.getElementBoxInternal(n,r),g=p.element;r=p.index,this.owner.enableImageResizerMode&&(this.owner.imageResizerModule.positionImageResizer(g),this.owner.imageResizerModule.showImageResizer()),this.documentHelper.isTouchInput&&(this.documentHelper.touchStart.style.display="none",this.documentHelper.touchEnd.style.display="none")}else this.highlight(e.paragraph,e,i),this.isHighlightNext&&(this.highlightNextBlock(this.hightLightNextParagraph,e,i),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0);this.isInShape&&this.showResizerForShape()}else this.highlightCell(e.paragraph.associatedCell,this,e,i)},e.prototype.showResizerForShape=function(){var e=this.getCurrentTextFrame().containerShape;this.owner.imageResizerModule.positionImageResizer(e),this.owner.imageResizerModule.showImageResizer()},e.prototype.highlight=function(e,i,n){var r=0,o=0,s=void 0,a=void 0,l=void 0,d=void 0,h=this.getStartLineWidget(e,i,s,r);s=h.element,l=t.isNullOrUndefined(s)?e.childWidgets[0]:s.line,r=h.index;var c=this.getEndLineWidget(n,a,o);d=(a=c.element)?a.line:n.paragraph.childWidgets[n.paragraph.childWidgets.length-1],o=c.index;var p=0,g=0;if(t.isNullOrUndefined(l)||(p=this.getTop(l),g=this.getLeftInternal(l,s,r)),t.isNullOrUndefined(l)||l!==d){if(!t.isNullOrUndefined(l)){l.paragraph.x;e!==l.paragraph&&(e=l.paragraph);x=this.getWidth(l,!0)-(g-l.paragraph.x);if(e.bidi||s instanceof Oe&&s.isRightToLeft){var u=0,m=this.getElementsForward(l,s,a,e.bidi);if(m){for(var f=!1,v=0;v<m.length;v++){var y=m[v];f=!1,g=y===s?this.getLeftInternal(l,y,r):this.getLeftInternal(l,y,0);T=y instanceof Oe?y.length:1;u=this.getLeftInternal(l,y,T),y instanceof Oe&&(f=y.isRightToLeft),x=Math.abs(u-g),this.createHighlightBorder(l,x,f?u:g,p,!0)}if(l.isLastLine()){var b=m[m.length-1].line.paragraph.characterFormat,w=this.documentHelper.textHelper.getParagraphMarkSize(b).Width;g=e.bidi?this.getLineStartLeft(l)-w:f?l.paragraph.x+this.getWidth(l,!1):u,this.createHighlightBorder(l,w,g,p,!0)}}else this.createHighlightBorder(l,x,g,p,!1)}else this.createHighlightBorder(l,x,g,p,!1);var C=l.paragraph.childWidgets.indexOf(l);if(this.highlightParagraph(e,C+1,d,a,o),-1!==e.childWidgets.indexOf(n.currentWidget))return}if(this.isHideSelection(e))return void(this.isHighlightNext=!1);this.isHighlightNext=!0,this.hightLightNextParagraph=e}else{var u=this.getLeftInternal(d,a,o),x=0,F=!1;if(a instanceof Oe&&(F=a.isRightToLeft),!F&&s instanceof Oe&&(F=s.isRightToLeft),x=Math.abs(u-g),F||e.bidi){var P=this.getElementsForward(l,s,a,e.bidi);if(P&&P.length>1)for(v=0;v<P.length;v++){var f=!1,T=(y=P[v])instanceof Oe?y.length:1;if(y===s?(g=this.getLeftInternal(l,y,r),u=this.getLeftInternal(l,y,T)):y===a?(g=this.getLeftInternal(l,y,0),u=this.getLeftInternal(l,y,o)):(g=this.getLeftInternal(l,y,0),u=this.getLeftInternal(l,y,T)),y instanceof Oe&&(f=y.isRightToLeft),x=Math.abs(u-g),y===a&&y instanceof Oe&&o>y.length){var b=y.line.paragraph.characterFormat,w=this.documentHelper.textHelper.getParagraphMarkSize(b).Width;if(e.bidi&&!f){x-=w,this.createHighlightBorder(l,x,g,p,!0),g=this.getLineStartLeft(l)-w,this.createHighlightBorder(l,w,g,p,!0);continue}}this.createHighlightBorder(l,x,f?u:g,p,!0)}else if(a instanceof Oe&&o>a.length){var b=a.line.paragraph.characterFormat,w=this.documentHelper.textHelper.getParagraphMarkSize(b).Width;!e.bidi&&F?(u+=w,x-=w,this.createHighlightBorder(l,x,u,p,!0),u+=a.width,this.createHighlightBorder(l,w,u,p,!0)):e.bidi&&!F?(x-=w,this.createHighlightBorder(l,x,g,p,!0),g=this.getLineStartLeft(l)-w,this.createHighlightBorder(l,w,g,p,!0)):this.createHighlightBorder(l,x,F?u:g,p,!1)}else this.createHighlightBorder(l,x,F?u:g,p,!1)}else this.createHighlightBorder(l,x,e.bidi?u:g,p,!1)}},e.prototype.highlightNextBlock=function(e,i,n){var r=e.nextRenderedWidget;t.isNullOrUndefined(r)||(r instanceof we?(this.isHighlightNext=!1,this.highlight(r,i,n),this.isHighlightNext&&(this.highlightNextBlock(this.hightLightNextParagraph,i,n),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0)):this.highlightTable(r,i,n))},e.prototype.getStartLineWidget=function(e,t,i,n){var r=e===t.paragraph?t.offset:this.getStartOffset(e),o=void 0;if(o=e===t.paragraph?t.currentWidget.getInline(r,n):e.firstChild.getInline(r,n),i=o.element,n=o.index,i instanceof Ie){var s=this.getRenderedInline(i,n);i=s.element,n=s.index}return r===this.getParagraphLength(t.paragraph)+1&&n++,{index:n,element:i}},e.prototype.getEndLineWidget=function(e,t,i){var n=e.currentWidget.getInline(e.offset,i);if(t=n.element,i=n.index,t instanceof Ie){var r=this.getRenderedInline(t,i);t=r.element,i=r.index}return e.paragraph.childWidgets.indexOf(e.currentWidget)===e.paragraph.childWidgets.length-1&&e.offset===this.getLineLength(e.currentWidget)+1&&(i=t?t.length+1:1),{index:i,element:t}},e.prototype.getLineWidgetInternal=function(e,t,i){var n=void 0;if(0===e.children.length&&e instanceof Te)n=e;else{var r=0,o=e.getInline(t,r),s=o.element;r=o.index,n=s instanceof Se?s.line:this.getLineWidgetInternalInline(s,r,i)}return n},e.prototype.getLineWidgetParagraph=function(e,t){var i=void 0;if(0===t.children.length)i=t;else{var n=0,r=t.getInline(e,n),o=r.element;n=r.index,i=this.getLineWidget(o,n)}return i},e.prototype.highlightCells=function(e,t,i){var n=this.getCellLeft(t.ownerRow,t),r=n+t.cellFormat.cellWidth,o=this.getCellLeft(i.ownerRow,i),s=o+i.cellFormat.cellWidth;n>o&&(n=o),r<s&&(r=s),n>this.upDownSelectionLength&&(n=this.upDownSelectionLength),r<this.upDownSelectionLength&&(r=this.upDownSelectionLength);var a=e.getSplitWidgets(),l=a.indexOf(t.ownerRow.ownerTable),d=a.indexOf(i.ownerRow.ownerTable);if(l===d)for(var h=e.childWidgets.indexOf(i.ownerRow),c=e.childWidgets.indexOf(t.ownerRow);c<=h;c++)this.highlightRow(e.childWidgets[c],n,r);else for(var p=0,g=0,c=l;c<=d;c++){e=a[c],p=c===l?e.childWidgets.indexOf(t.ownerRow):0,g=c===d?e.childWidgets.indexOf(i.ownerRow):e.childWidgets.length-1;for(var u=p;u<=g;u++)this.highlightRow(e.childWidgets[u],n,r)}},e.prototype.highlightTable=function(e,t,i){this.highlightInternal(e.childWidgets[0],t,i),i.paragraph.isInsideTable&&e.contains(i.paragraph.associatedCell)||this.highlightNextBlock(e,t,i)},e.prototype.getCellLeft=function(e,t){var i=0;return i+=t.x-t.margin.left},e.prototype.getNextParagraphRow=function(e){if(!t.isNullOrUndefined(e.nextRenderedWidget)){var i=e.nextRenderedWidget.childWidgets[0].childWidgets[0];return this.getFirstParagraphBlock(i)}return this.getNextParagraphBlock(e.ownerTable)},e.prototype.getPreviousParagraphRow=function(e){if(!t.isNullOrUndefined(e.previousRenderedWidget)){var i=e.previousRenderedWidget.lastChild,n=i.lastChild?i.lastChild:i.previousSplitWidget.lastChild;return this.getLastParagraphBlock(n)}return this.getPreviousParagraphBlock(e.ownerTable)},e.prototype.containsRow=function(e,t){if(-1!==e.childWidgets.indexOf(t))return!0;for(;t.ownerTable.isInsideTable;){if(-1!==e.childWidgets.indexOf(t))return!0;t=t.ownerTable.associatedCell}return-1!==e.childWidgets.indexOf(t)},e.prototype.highlightRow=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++){var r=this.getCellLeft(e,e.childWidgets[n]);L.round(t,2)<=L.round(r,2)&&L.round(r,2)<L.round(i,2)&&this.highlightCellWidget(e.childWidgets[n])}},e.prototype.highlightInternal=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++)this.highlightCellWidget(e.childWidgets[n]);i.paragraph.isInsideTable&&this.containsRow(e,i.paragraph.associatedCell)||e.nextRenderedWidget instanceof Fe&&this.highlightInternal(e.nextRenderedWidget,t,i)},e.prototype.getLastParagraph=function(e){for(;e.nextSplitWidget&&e.nextSplitWidget.childWidgets.length>0;)e=e.nextSplitWidget;var t;return t=e.childWidgets.length>0?e.lastChild:e.previousSplitWidget.lastChild,this.getLastParagraphBlock(t)},e.prototype.containsCell=function(e,t){if(e.equals(t))return!0;for(;t.ownerTable.isInsideTable;){if(e.equals(t.ownerTable.associatedCell))return!0;t=t.ownerTable.associatedCell}return!1},e.prototype.isCellSelected=function(e,t,i){var n=this.getLastParagraph(e);return n===i.paragraph&&i.offset===this.getParagraphLength(n)+1||!this.containsCell(e,t.paragraph.associatedCell)||!this.containsCell(e,i.paragraph.associatedCell)},e.prototype.getContainerCellOf=function(e,t){for(;e.ownerTable.isInsideTable;){if(e.ownerTable.contains(t))return e;e=e.ownerTable.associatedCell}return e},e.prototype.getSelectedCell=function(e,t){if(e.ownerTable.equals(t.ownerTable))return e;for(;e.ownerTable.isInsideTable;){if(e.ownerTable.associatedCell.equals(t))return e;e=e.ownerTable.associatedCell}return e},e.prototype.getSelectedCells=function(){for(var e=[],t=0;t<this.selectedWidgets.keys.length;t++){var i=this.selectedWidgets.keys[t];i instanceof Pe&&e.push(i)}return e},e.prototype.getNextParagraphCell=function(e){if(e.nextRenderedWidget&&e.nextRenderedWidget instanceof Pe){var t=(e=e.nextRenderedWidget).firstChild;return t?this.getFirstParagraphBlock(t):this.getNextParagraphCell(e)}return this.getNextParagraphRow(e.containerWidget)},e.prototype.getPreviousParagraphCell=function(e){if(!t.isNullOrUndefined(e.previousRenderedWidget)&&e.previousRenderedWidget instanceof Pe){var i=(e=e.previousRenderedWidget).lastChild;return this.getLastParagraphBlock(i)}return this.getPreviousParagraphRow(e.ownerRow)},e.prototype.getContainerCell=function(e){for(;!t.isNullOrUndefined(e.ownerTable)&&e.ownerTable.isInsideTable;)e=e.ownerTable.associatedCell;return e},e.prototype.highlightCell=function(e,i,n,r){if(r.paragraph.isInsideTable){var o=this.getContainerCellOf(e,r.paragraph.associatedCell);if(o.ownerTable.contains(r.paragraph.associatedCell)){var s=this.getSelectedCell(e,o),a=this.getSelectedCell(r.paragraph.associatedCell,o);if(this.containsCell(o,r.paragraph.associatedCell))this.isCellSelected(o,n,r)?this.highlightCellWidget(o):s===o?(this.highlight(n.paragraph,n,r),this.isHighlightNext&&(this.highlightNextBlock(this.hightLightNextParagraph,n,r),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0)):this.highlightContainer(s,n,r);else if(this.highlightCellWidget(o),o.ownerRow.equals(a.ownerRow))for(s=o;!t.isNullOrUndefined(s.nextRenderedWidget)&&(s=s.nextRenderedWidget,this.highlightCellWidget(s),s!==a););else this.highlightCells(o.ownerTable,o,a)}else this.highlightContainer(o,n,r)}else{var l=this.getContainerCell(e);this.highlightContainer(l,n,r)}},e.prototype.highlightContainer=function(e,t,i){this.highlightInternal(e.containerWidget,t,i),this.highlightNextBlock(e.ownerTable,t,i)},e.prototype.getPreviousValidElement=function(e){var i=void 0;if(this.documentHelper.isFormFillProtectedMode&&2===e.fieldType)return e;for(;e instanceof Ie;)L.isLinkedFieldCharacter(e)&&(e instanceof Ie&&0===e.fieldType?i=e:e instanceof Ie&&1===e.fieldType?(i=e,t.isNullOrUndefined(e.fieldSeparator)&&(i=e=e.fieldBegin)):i=e=e.fieldBegin),e=e.previousNode;return t.isNullOrUndefined(i)?e:i},e.prototype.getNextValidElement=function(e){var i=void 0;if(e instanceof Ae&&1===e.bookmarkType)return e;for(;e instanceof Ie;){if(0===e.fieldType&&!t.isNullOrUndefined(e.fieldEnd))return t.isNullOrUndefined(i)?e:i;1!==e.fieldType||t.isNullOrUndefined(e.fieldBegin)||(i=e),e=e.nextNode}return t.isNullOrUndefined(i)?e:i},e.prototype.validateTextPosition=function(e,t){if(e.length===t&&(e.nextNode instanceof Ie||!(e instanceof Ze)&&e.nextNode instanceof Ae)){var i=this.getNextValidElement(e.nextNode);(i instanceof Ie&&1===i.fieldType||i instanceof Ae&&1===i.bookmarkType)&&(e=i,t=this.documentHelper.isFormFillProtectedMode?0:1)}else 0===t&&e.previousNode instanceof Ie&&(t=(e=this.getPreviousValidElement(e.previousNode))instanceof Ie?0:e.length,e instanceof Ie&&1===e.fieldType&&t++);return{element:e,index:t}},e.prototype.getPhysicalPositionInline=function(e,i,n){var r=void 0;r=this.getElementBox(e,i,n).element;var o=void 0;if(t.isNullOrUndefined(r)||t.isNullOrUndefined(r.line)){if(!(e instanceof Ie&&1===e.fieldType||e instanceof vt))return e instanceof Ie||e instanceof Ae?this.getFieldCharacterPosition(e):new R(0,0);r=e}var s=r.margin,a=0,l=0;if(r instanceof Oe&&"\v"===r.text&&t.isNullOrUndefined(e.nextNode)?(o=this.getNextLineWidget(r.line.paragraph,r),i=0):o=r.line,a=this.getTop(o),r instanceof Ze&&"Inline"===r.textWrappingStyle){var d=r.line.paragraph.characterFormat,h=this.getPreviousTextElement(e);if(t.isNullOrUndefined(h)){var c=this.getNextTextElement(e);t.isNullOrUndefined(c)||(d=c.characterFormat)}else d=h.characterFormat;var p=this.documentHelper.textHelper.getHeight(d);r.margin.top+r.height-p.BaselineOffset>0&&(a+=r.margin.top+r.height-p.BaselineOffset)}else r instanceof Ie||e instanceof vt||(a+=s.top>0?s.top:0);return l=t.isNullOrUndefined(r)||t.isNullOrUndefined(o)?0:this.getLeftInternal(o,r,i),new R(l,a)},e.prototype.getFieldCharacterPosition=function(e){var i=this.getNextValidElementForField(e);if(t.isNullOrUndefined(i)){var n=e.line.paragraph;return this.getEndPosition(n)}return this.getPhysicalPositionInline(i,0,!0)},e.prototype.getNextValidElementForField=function(e){if(e instanceof Ie&&0===e.fieldType&&L.isLinkedFieldCharacter(e)){var i=e;e=t.isNullOrUndefined(i.fieldSeparator)?i.fieldEnd:i.fieldSeparator}var n=void 0;return t.isNullOrUndefined(e.nextNode)||(n=this.getNextValidElement(e.nextNode)),n},e.prototype.getEndPosition=function(e){var i=e.x,n=e.y,r=void 0;e.childWidgets.length>0&&(r=e.childWidgets[e.childWidgets.length-1],i+=this.getWidth(r,!1)),t.isNullOrUndefined(r)||(n=this.getTop(r));var o=this.getParagraphMarkSize(e,0,0);return new R(i,n+o.topMargin)},e.prototype.getElementBox=function(e,t,i){var n=void 0;return e instanceof Ie||e instanceof Ae||e instanceof vt||(n=e),{element:n,index:t}},e.prototype.getPreviousTextElement=function(e){return e.previousNode instanceof Oe?e.previousNode:t.isNullOrUndefined(e.previousNode)?void 0:this.getPreviousTextElement(e.previousNode)},e.prototype.getNextTextElement=function(e){return e.nextNode instanceof Oe?e.nextNode:t.isNullOrUndefined(e.nextNode)?void 0:this.getNextTextElement(e.nextNode)},e.prototype.getNextRenderedElementBox=function(e,i){if(e instanceof Ie){if(0===(r=e).fieldType&&(e=this.getRenderedField(r),r===e))return r;i=1}for(;!t.isNullOrUndefined(e)&&i===e.length&&e.nextNode instanceof Ie;){var n=this.getNextValidElement(e.nextNode);if(n instanceof Ie&&0===n.fieldType){var r=n;if(e=this.getRenderedField(r),!t.isNullOrUndefined(e)&&r===e)return r;i=1}else e=n}return e},e.prototype.getElementBoxInternal=function(e,t){var i=void 0;return i=e,{element:i,index:t}},e.prototype.getLineWidget=function(e,t){return this.getLineWidgetInternalInline(e,t,!0)},e.prototype.getLineWidgetInternalInline=function(e,i,n){var r=this.getElementBox(e,i,n),o=r.element;if(i=r.index,!t.isNullOrUndefined(o))return n&&o instanceof Oe&&"\v"===o.text&&1===i?this.getNextLineWidget(o.line.paragraph,o):o.line;var s=e,a=this.getNextValidElementForField(s);if(t.isNullOrUndefined(a)){var l=void 0,d=s.line.paragraph;return d.childWidgets.length>0&&(l=d.childWidgets[d.childWidgets.length-1]),l}return this.getLineWidget(a,0)},e.prototype.getNextLineWidget=function(e,t){var i=void 0,n=e;if(n.childWidgets.length>0){var r=n.childWidgets.indexOf(t.line);r===n.childWidgets.length-1?(n=e,r=-1):r>n.childWidgets.length-1?(n=this.getNextParagraphBlock(e),r=-1):r<0&&(r=(n=e).childWidgets.indexOf(t.line)),i=n.childWidgets[r+1]}return i},e.prototype.getCaretHeight=function(e,i,n,r,o,s){var a=this.getElementBox(e,i,!1).element,l=e;if(t.isNullOrUndefined(a))return l instanceof Ie?this.getFieldCharacterHeight(l,n,r,o,s):{height:this.documentHelper.textHelper.getHeight(n).Height,topMargin:o,isItalic:s};var d=a.margin,h=a.height,c=0;if(a instanceof Ze){var p=this.getPreviousTextElement(e),g=this.getNextTextElement(e);if(t.isNullOrUndefined(p)&&t.isNullOrUndefined(g)){var u=0,m=0,f=e.line.paragraph,v=this.getParagraphMarkSize(f,u,m);u=v.topMargin,m=v.bottomMargin,c=v.height,s=f.characterFormat.italic,r||(c+=this.documentHelper.layout.getAfterSpacing(f))}else{if(t.isNullOrUndefined(p))return s=g.characterFormat.italic,this.getCaretHeight(g,0,g.characterFormat,r,o,s);if(t.isNullOrUndefined(g)||!(a instanceof Ze))return s=p.characterFormat.italic,this.getCaretHeight(p,p.length,p.characterFormat,r,o,s);var y=this.documentHelper.textHelper.getHeight(a.characterFormat),b=y.Height,w=y.BaselineOffset;c=a.margin.top<0&&w>a.margin.top+a.height?a.margin.top+a.height+b-w:b,r||(c+=a.margin.bottom)}}else{var C=n.baselineAlignment,x=h;"Normal"!==C&&r&&(x/=1.5,"Subscript"===C&&(o=h-x)),c=(d.top<0?d.top:0)+x,r||(c+=d.bottom)}if(!r)return{height:c,topMargin:o,isItalic:s};var F=this.documentHelper.textHelper.getHeight(n).Height;return F>c&&(F=c),{height:F,topMargin:o,isItalic:s}},e.prototype.getFieldCharacterHeight=function(e,i,n,r,o){var s=this.getNextValidElementForField(e);if(t.isNullOrUndefined(s)){var a=e.line.paragraph,l=this.documentHelper.textHelper.getParagraphMarkSize(i).Height,d=0,h=0,c=this.getParagraphMarkSize(a,d,h),p=c.height;return d=c.topMargin,h=c.bottomMargin,n?(l>p&&(l=p),{height:l,topMargin:r,isItalic:o}):(p+=h,{height:p,topMargin:r,isItalic:o})}return this.getCaretHeight(s,0,i,n,r,o)},e.prototype.getRenderedInline=function(e,i){for(var n=this.getPreviousValidElement(e);n instanceof Ie;)(n=this.getPreviousTextElement(n))instanceof Ie&&(n=n.previousNode);if(!t.isNullOrUndefined(n))return i=n.length,{element:n,index:i};i=0;var r=this.getNextRenderedElementBox(e,0);if(r instanceof Ie&&0===r.fieldType)for(r=(r=r.fieldSeparator).nextNode;r instanceof Ie;)r instanceof Ie&&0===r.fieldType&&L.isLinkedFieldCharacter(r)&&(r=t.isNullOrUndefined(r.fieldSeparator)?r.fieldEnd:r.fieldSeparator),r=r.nextNode;return{element:r,index:i}},e.prototype.getRenderedField=function(e){var i=e;if(t.isNullOrUndefined(e.fieldSeparator))i=e.fieldEnd;else{var n=(i=e.fieldSeparator).line.paragraph;if(n!==e.fieldEnd.line.paragraph||this.hasValidInline(n,i,e.fieldEnd))return i;i=e.fieldEnd}return i},e.prototype.isLastRenderedInline=function(e,i){for(;i===e.length&&e.nextNode instanceof Ie;){var n=this.getNextValidElement(e.nextNode);if(i=0,n instanceof Ie&&0===n.fieldType&&(e=n),e instanceof Ie&&0===e.fieldType&&!t.isNullOrUndefined(e.fieldEnd)){var r=e;if(t.isNullOrUndefined(r.fieldSeparator))e=r.fieldEnd,i=1;else{var o=(e=r.fieldSeparator).line.paragraph;if(i=1,o!==r.fieldEnd.line.paragraph||this.hasValidInline(o,e,r.fieldEnd))break;e=r.fieldEnd}}}return i===e.length&&t.isNullOrUndefined(e.nextNode)},e.prototype.getPage=function(e){var i=void 0;if(e.containerWidget instanceof Xe){var n=e.containerWidget.containerShape;n.line&&(i=this.getPage(n.line.paragraph))}else if(e.containerWidget instanceof me){e.containerWidget;i=e.containerWidget.page}else t.isNullOrUndefined(e.containerWidget)||(i=this.getPage(e.containerWidget));return i},e.prototype.clearSelectionHighlightInSelectedWidgets=function(){for(var e=!1,t=this.selectedWidgets.keys,i=0;i<t.length;i++)this.removeSelectionHighlight(t[i]),e=!0;return this.selectedWidgets.clear(),e},e.prototype.clearChildSelectionHighlight=function(e){for(var t=0;t<e.childWidgets.length;t++)e.childWidgets[t]instanceof Te?this.clearSelectionHighlightLineWidget(e.childWidgets[t]):e.childWidgets[t]instanceof Pe?this.clearSelectionHighlight(e.childWidgets[t]):e.childWidgets[t]instanceof ue&&this.clearChildSelectionHighlight(e.childWidgets[t])},e.prototype.getLineWidgetBodyWidget=function(e,i){for(var n=0;n<e.childWidgets.length;n++)if((l=e.childWidgets[n])instanceof be)for(var r=0;r<l.childWidgets.length;r++){var o=l.childWidgets[r];if(o instanceof ue&&o.y<=i.y&&o.y+o.height>=i.y)return o instanceof we?this.getLineWidgetParaWidget(o,i):this.getLineWidgetTableWidget(o,i)}else if(l instanceof ue&&l.y<=i.y&&l.y+l.height>=i.y)return l instanceof we?this.getLineWidgetParaWidget(l,i):this.getLineWidgetTableWidget(l,i);var s=void 0;if(e.childWidgets.length>0){var a=e.childWidgets[0];if(a instanceof ue&&a.y<=i.y)s=e.childWidgets[e.childWidgets.length-1]instanceof we?this.getLineWidgetParaWidget(e.childWidgets[e.childWidgets.length-1],i):this.getLineWidgetTableWidget(e.childWidgets[e.childWidgets.length-1],i);else{var l=void 0;a instanceof ue&&(l=a),t.isNullOrUndefined(l)||(s=l instanceof we?this.getLineWidgetParaWidget(a,i):this.getLineWidgetTableWidget(a,i))}}return s},e.prototype.getLineWidgetParaWidget=function(e,t){for(var i=e.childWidgets,n=e.y,r=0;r<i.length;r++){var o=i[r];n+=o.marginTop;var s=o.height;if(o.nextLine&&o.nextLine.marginTop>0&&(s+=o.nextLine.marginTop),n<=t.y&&n+s>=t.y)return o;n+=o.height}var a=void 0;return i.length>0&&(a=e.y<=t.y?i[i.length-1]:i[0]),a},e.prototype.highlightParagraph=function(e,t,i,n,r){var o=0,s=0,a=!1;e.paragraphFormat.bidi&&i.children.indexOf(n)>0&&(n=i.children[0]);for(var l=t;l<e.childWidgets.length;l++){var d=e.childWidgets[l];l===t?o=this.getTop(d):o+=d.marginTop,n instanceof Oe&&(a=n.isRightToLeft);var h=this.getLeft(d);if(d===i){var c=0;if(a||e.bidi){for(var p=this.getElementsBackward(d,n,n,e.bidi),g=0;g<p.length;g++){var u=p[g],m=!1;if(u===n)c=this.getLeftInternal(d,u,r);else{var f=u instanceof Oe?u.length:1;c=this.getLeftInternal(d,u,f)}if(h=this.getLeftInternal(d,u,0),u instanceof Oe&&(m=u.isRightToLeft),s=Math.abs(c-h),u===n&&u instanceof Oe&&r>u.length){var v=this.documentHelper.textHelper.getParagraphMarkSize(u.line.paragraph.characterFormat).Width;if(!e.bidi&&m)c+=v;else if(e.bidi&&!m){s-=v,this.createHighlightBorder(d,s,h,o,!0),h=this.getLineStartLeft(d)-v,this.createHighlightBorder(d,v,h,o,!0);continue}}this.createHighlightBorder(d,s,m?c:h,o,!0)}return}return c=this.getLeftInternal(i,n,r),s=Math.abs(c-h),void this.createHighlightBorder(d,s,a?c:h,o,!1)}s=this.getWidth(d,!0)-(h-e.x),e.bidi&&d.isLastLine()&&(h-=this.documentHelper.textHelper.getParagraphMarkSize(e.characterFormat).Width),this.createHighlightBorder(d,s,h,o,!1),o+=d.height}},e.prototype.getLineWidgetTableWidget=function(e,i){for(var n=void 0,r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];if(o instanceof Fe&&o.y<=i.y){if("Exactly"===o.rowFormat.heightType&&o.y+L.convertPointToPixel(o.rowFormat.height)<i.y)continue;n=this.getLineWidgetRowWidget(o,i);var s=void 0;!t.isNullOrUndefined(n)&&n.paragraph.containerWidget instanceof Pe&&(s=n.paragraph.containerWidget);var a=0,l=0;if(!t.isNullOrUndefined(s)){u=s.ownerRow.containerWidget;a=L.convertPointToPixel(u.tableFormat.cellSpacing),l=s.cellFormat.rowSpan}var d=0,h=0,c=0,p=0;if(a>0){d=0===s.cellIndex?a:a/2,h=s.cellIndex===s.ownerRow.childWidgets.length-1?a:a/2;var g=void 0;s.containerWidget instanceof Fe&&(g=s.containerWidget);var u=void 0;s.containerWidget.containerWidget instanceof xe&&(u=s.containerWidget.containerWidget),t.isNullOrUndefined(g)||t.isNullOrUndefined(u)||(c=0===s.ownerRow.rowIndex?a:a/2,p=s.ownerRow.rowIndex+l===s.ownerTable.childWidgets.length?a:a/2)}if(!t.isNullOrUndefined(n)&&n.paragraph.x<=i.x&&n.paragraph.x+n.width>=i.x&&n.paragraph.y<=i.y&&this.getTop(n)+n.height>=i.y||!t.isNullOrUndefined(s)&&s.x-s.margin.left-d<=i.x&&s.x+s.width+s.margin.right+h>=i.x&&s.y-s.margin.top-c<=i.y&&s.y+s.height+s.margin.bottom+p>=i.y)break}}return n},e.prototype.getLineWidgetRowWidget=function(e,t){for(var i=0;i<e.childWidgets.length;i++){var n=0,r=0,o=0;if((n=L.convertPointToPixel(e.ownerTable.tableFormat.cellSpacing))>0&&(r=0===e.childWidgets[i].columnIndex?n:n/2,o=e.childWidgets[i].cellIndex===e.childWidgets[i].ownerRow.childWidgets.length-1?n:n/2),e.childWidgets[i].x-e.childWidgets[i].margin.left-r<=t.x&&e.childWidgets[i].x+e.childWidgets[i].width+e.childWidgets[i].margin.right+o>=t.x)return this.getLineWidgetCellWidget(e.childWidgets[i],t)}var s=void 0;return e.childWidgets.length>0&&(s=e.childWidgets[0].x<=t.x?this.getLineWidgetCellWidget(e.childWidgets[e.childWidgets.length-1],t):this.getLineWidgetCellWidget(e.childWidgets[0],t)),s},e.prototype.getFirstBlock=function(e){if(e.childWidgets.length>0)return e.childWidgets[0]},e.prototype.highlightCellWidget=function(e){var t=[];e.previousSplitWidget||e.nextSplitWidget?t=e.getSplitWidgets():t.push(e);for(var i=0;i<t.length;i++)e=t[i],this.clearChildSelectionHighlight(e),this.createHighlightBorderInsideTable(e)},e.prototype.clearSelectionHighlight=function(e){this.selectedWidgets.containsKey(e)&&(this.removeSelectionHighlight(e),this.selectedWidgets.remove(e))},e.prototype.getLineWidgetCellWidget=function(e,t){for(var i=0;i<e.childWidgets.length;i++)if(e.childWidgets[i].y<=t.y&&e.childWidgets[i].y+e.childWidgets[i].height>=t.y)return e.childWidgets[i]instanceof we?this.getLineWidgetParaWidget(e.childWidgets[i],t):this.getLineWidgetTableWidget(e.childWidgets[i],t);var n=void 0;return e.childWidgets.length>0&&e.childWidgets[0].y<=t.y&&(n=e.childWidgets[e.childWidgets.length-1]instanceof we?this.getLineWidgetParaWidget(e.childWidgets[e.childWidgets.length-1],t):this.getLineWidgetTableWidget(e.childWidgets[0],t)),n},e.prototype.updateTextPosition=function(e,i){var n=i,r=void 0,o=0,s=!1,a=this.updateTextPositionIn(e,r,o,i,!1);t.isNullOrUndefined(a)||(r=a.element,o=a.index,n=a.caretPosition,s=a.isImageSelected,this.isImageSelected=s),s?(this.selectInternal(e,r,o,n),0===o?this.extendForward():this.extendBackward()):this.selectInternal(e,r,o,n)},e.prototype.updateTextPositionIn=function(e,i,n,r,o){var s=!1,a=this.getTop(e),l=e.paragraph.x,d=this.getFirstElement(e,l),h=d.element,c=!1,p=!1;if(l=d.left,t.isNullOrUndefined(h)){var g=0,u=0,m=this.getParagraphMarkSize(e.paragraph,g,u);g=m.topMargin,u=m.bottomMargin,(N=!(this.documentHelper.mouseDownOffset.y>=a&&this.documentHelper.mouseDownOffset.y<a+e.height)||this.documentHelper.mouseDownOffset.x<l+m.width)&&o&&r.x>l+m.width/2&&(l+=m.width,e.children.length>0&&(n=(i=e.children[e.children.length-1]).length),n++),r=new R(l,g>0?a+g:a)}else if(!t.isNullOrUndefined(h)){if(r.x>l+h.margin.left||h instanceof Ge&&"Inline"!==h.textWrappingStyle){for(w=e.children.indexOf(h);w<e.children.length;w++)if((h=e.children[w])instanceof Ge&&"Inline"!==h.textWrappingStyle){if(this.documentHelper.isInShapeBorder(h,r)&&!this.documentHelper.isSelectionChangedOnMouseMoved){l=h.x,a=h.y;break}}else{var f=!1;if((h instanceof Qe||h instanceof Oe)&&(f=h.line.paragraph.paragraphFormat.bidi),r.x<l+h.margin.left+h.width+h.padding.left||w===e.children.length-1||e.children[w+1]instanceof Qe&&f)break;l+=h.margin.left+h.width+h.padding.left}if(h instanceof Oe&&(c=h.isRightToLeft,p=h.line.paragraph.paragraphFormat.bidi),r.x>l+h.margin.left+h.width+h.padding.left)n=h instanceof Oe?h.length:1,c&&p&&(n=0),(h instanceof Oe&&("\v"!==h.text||"\f"!==h.text)||o)&&(l+=h.margin.left+h.width+h.padding.left);else if(h instanceof Oe){h instanceof Oe&&c&&(l+=h.width+h.padding.left);var v=0;v=c?l+h.margin.left-r.x:r.x-l-h.margin.left-h.padding.left,l+=h.margin.left+h.padding.left;for(var y=0,b=0,w=1;w<=h.length;w++){I=0;if(w===h.length?I=h.width+h.padding.left:(I=this.documentHelper.textHelper.getWidth(h.text.substr(0,w),h.characterFormat),h.trimEndWidth=I),v<I||w===h.length){if(v-y>(I-y)/2)c?l-=I:l+=I,b=w;else if(c?l-=y:l+=y,b=w-1,1===w&&h!==e.children[0]&&!(e.children[0]instanceof Ge&&"Inline"!==e.children[0].textWrappingStyle)){C=e.children.indexOf(h);e.children[C-1]instanceof Qe||c||(b=(h=e.children[C-1])instanceof Oe?h.length:1)}break}y=I}n=b}else if(s=h instanceof Ze||h instanceof Ke,r.x-l-h.margin.left>h.width/2)n=1,l+=h.margin.left+h.width+h.padding.left;else if(h!==e.children[0]&&!s){var C=e.children.indexOf(h);e.children[C-1]instanceof Qe||(n=(h=e.children[C-1])instanceof Oe?h.length:1)}h instanceof Oe&&("\v"===h.text||"\f"===h.text)&&(n=0)}else c=h.isRightToLeft,p=h.line.paragraph.paragraphFormat.bidi,n=h instanceof Oe&&(p||c)&&r.x<l+h.margin.left+h.width+h.padding.left?this.getTextLength(h.line,h)+h.length:this.getTextLength(h.line,h),l+=h.margin.left;if(h instanceof Oe)a+=h.margin.top>0?h.margin.top:0;else{var x=this.documentHelper.textHelper.getHeight(h.characterFormat),F=h.height;h instanceof Ae&&!this.documentHelper.layout.hasValidElement(h.line.paragraph)&&(F=x.Height),a+=h.margin.top+F-x.BaselineOffset}(i=h)instanceof Ie&&2===i.fieldType&&!t.isNullOrUndefined(i.fieldBegin)&&(i=i.fieldBegin,n=0),i instanceof $e&&(n=0);var P=this.validateTextPosition(i,n);i=P.element,n=P.index;var T=t.isNullOrUndefined(i.nextNode)&&n===i.length,S=t.isNullOrUndefined(i.nextNode)&&i instanceof Oe&&"\v"===i.text;if(o&&i.nextNode instanceof Ie&&n===i.length&&(T=this.isLastRenderedInline(i,n)),o&&T||S){var I=0;if(T){I=this.documentHelper.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat);var N=!(this.documentHelper.mouseDownOffset.y>=a&&this.documentHelper.mouseDownOffset.y<a+e.height)||this.documentHelper.mouseDownOffset.x<l+I;N&&r.x>l+I/2&&(l+=I,n=i.length+1)}else S&&(l+=I=h.width+h.padding.left,n=i.length)}r=new R(l,a)}return{element:i,index:n,caretPosition:r,isImageSelected:s}},e.prototype.checkAllFloatingElements=function(e,i){var n,r,o=!1,s=!1;if(!t.isNullOrUndefined(e)){n=e.paragraph.bodyWidget,o=!1,s=!1;for(var a=0;a<n.floatingElements.length;a++)if(!(n.floatingElements[a]instanceof xe)&&(r=n.floatingElements[a],i.x<r.x+r.margin.left+r.width&&i.x>r.x&&i.y<r.y+r.margin.top+r.height&&i.y>r.y)){o=!0,this.documentHelper.isInShapeBorder(r,i)&&(s=!0);break}}return{element:r,caretPosition:i,isShapeSelected:o,isInShapeBorder:s}},e.prototype.getTextLength=function(e,t){var i=0,n=e.children.indexOf(t);e.children.length>0&&e.children[0]instanceof Qe&&(e.children[1]instanceof Qe?n-=2:n-=1);for(var r=1;r<n;r++)i+=e.children[r].length;return i},e.prototype.getLeft=function(e){var t=e.paragraph.x,i=e.paragraph.paragraphFormat;this.isParagraphFirstLine(e)&&!i.bidi&&"Right"!==i.textAlignment&&(t+=L.convertPointToPixel(i.firstLineIndent));for(var n=0;n<e.children.length;n++){var r=e.children[n];if(!(r instanceof Qe)||i.bidi){t+=r.margin.left;break}t+=0===n?r.margin.left+r.width:r.width}return t},e.prototype.getTop=function(e){for(var t=e.paragraph.y,i=e.paragraph.childWidgets.indexOf(e),n=0;n<i;n++){var r=e.paragraph.childWidgets[n];t=t+r.height+r.marginTop}return t+=e.marginTop},e.prototype.getFirstElement=function(e,t){var i=0;this.isParagraphFirstLine(e)&&!e.paragraph.paragraphFormat.bidi&&(i=L.convertPointToPixel(e.paragraph.paragraphFormat.firstLineIndent)),t+=i;for(var n=void 0,r=0;r<e.children.length&&((n=e.children[r])instanceof Qe||n instanceof vt);r++){if(e.paragraph.paragraphFormat.bidi){t+=n.margin.left,n=void 0;break}t+=n.margin.left+n.width,n=void 0}return{element:n,left:t}},e.prototype.getIndexInInline=function(e){var t=0;if(e instanceof Oe)for(var i=e.line.children.indexOf(e),n=0;n<i;n++){var r=e.line.children[n];r instanceof Ie||r instanceof Qe||(t+=r.length)}return t},e.prototype.isParagraphFirstLine=function(e){return!(!t.isNullOrUndefined(e.paragraph.previousSplitWidget)||e!==e.paragraph.firstChild)},e.prototype.isParagraphLastLine=function(e){return!(!t.isNullOrUndefined(e.paragraph.nextSplitWidget)||e!==e.paragraph.lastChild)},e.prototype.getWidth=function(e,i){var n=0,r=e.paragraph.paragraphFormat;this.isParagraphFirstLine(e)&&!r.bidi&&(n+=L.convertPointToPixel(r.firstLineIndent));for(var o=0;o<e.children.length;o++){var s=e.children[o];s instanceof Ge&&"Inline"!==s.textWrappingStyle||(n+=s.margin.left+s.width+s.padding.left)}return i&&e.paragraph.childWidgets.indexOf(e)===e.paragraph.childWidgets.length-1&&t.isNullOrUndefined(e.paragraph.nextSplitWidget)&&(n+=this.documentHelper.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat)),n},e.prototype.getLeftInternal=function(e,i,n){var r=e.paragraph.x,o=e.paragraph.paragraphFormat;this.isParagraphFirstLine(e)&&!o.bidi&&(r+=L.convertPointToPixel(e.paragraph.paragraphFormat.firstLineIndent));var s=!1,a=!1;i instanceof Oe&&(s=i.isRightToLeft,a=i.line.paragraph.paragraphFormat.bidi),a&&(s||(1===this.documentHelper.moveCaretPosition&&e.children.length>0?i=e.children[e.children.length-1]:2===this.documentHelper.moveCaretPosition&&(i=e.children[0]),i instanceof Qe&&e.children.length>2&&(i=e.children[e.children.length-3])));var l=e.children.indexOf(i);(1===e.children.length&&e.children[0]instanceof Qe||2===e.children.length&&e.children[0]instanceof Qe&&e.children[1]instanceof Qe)&&(l=e.children.length);for(var d=0;d<l;d++){var h=e.children[d];h instanceof Ge&&"Inline"!==h.textWrappingStyle||(1===d&&e.children[d]instanceof Qe?r+=e.children[d].width:e.children[d]instanceof De&&i===h?r+=e.children[d].margin.left:r+=e.children[d].margin.left+e.children[d].width+e.children[d].padding.left)}t.isNullOrUndefined(i)||(r+=i.margin.left+i.padding.left,i instanceof Ge&&!t.isNullOrUndefined(i.nextElement)&&(r+=i.nextElement.margin.left+i.nextElement.padding.left),(s||1===this.documentHelper.moveCaretPosition&&!s&&a)&&(r+=i.width));var c=0;if(i instanceof Oe){if(0!==this.documentHelper.moveCaretPosition&&(a||s))return(s&&a&&2===this.documentHelper.moveCaretPosition||s&&!a&&1===this.documentHelper.moveCaretPosition)&&(r-=i.width),this.documentHelper.moveCaretPosition=0,r;n!==i.length||s?n>i.length?(c=this.documentHelper.textHelper.getParagraphMarkWidth(i.line.paragraph.characterFormat),s?r-=i.width+c:r+=i.width+c):(c=this.documentHelper.textHelper.getWidth(i.text.substr(0,n),i.characterFormat),i.trimEndWidth=c,s?r-=c:r+=c):r+=i.width,this.documentHelper.moveCaretPosition=0}else if(n>0)if(t.isNullOrUndefined(i)||i instanceof Qe)r+=this.documentHelper.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat);else if(i instanceof Ge&&"Inline"!==i.textWrappingStyle||(r+=i.width),2===n){var p=i.line.paragraph;r+=this.documentHelper.textHelper.getParagraphMarkWidth(p.characterFormat)}return r},e.prototype.getLineStartLeft=function(e){var t=e.paragraph.x,i=e.paragraph.paragraphFormat;return this.isParagraphFirstLine(e)&&!i.bidi&&(t+=L.convertPointToPixel(i.firstLineIndent)),e.children.length>0&&(t+=e.children[0].margin.left),t},e.prototype.updateTextPositionWidget=function(e,t,i,n){var r,o=t,s=void 0,a=0;s=(r=this.updateTextPositionIn(e,s,a,o,n)).element,a=r.index,o=r.caretPosition,i.setPositionForSelection(e,s,a,o)},e.prototype.clearSelectionHighlightLineWidget=function(e){!t.isNullOrUndefined(this.owner)&&this.selectedWidgets.length>0&&this.clearSelectionHighlight(this)},e.prototype.getFirstElementInternal=function(e){for(var t=void 0,i=e.paragraph.paragraphFormat.bidi,n=e.children.length,r=i?n-1:0;(i?r>=0:r<n)&&(t=e.children[r])instanceof Qe;i?r--:r++)t=void 0;return t},e.prototype.selectRange=function(e,t){this.start.setPositionInternal(e),this.end.setPositionInternal(t),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0)},e.prototype.selectParagraphInternal=function(e,i){var n;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(e.firstChild))if(n=e.firstChild,i)this.start.setPosition(n,i);else{var r=n.getEndOffset();this.start.setPositionParagraph(n,r)}this.end.setPositionInternal(this.start),this.upDownSelectionLength=this.start.location.x,this.fireSelectionChanged(!0)},e.prototype.setPositionForBlock=function(e,t){var i;if(e instanceof xe&&(e=t?this.getFirstParagraphInFirstCell(e):this.getLastParagraphInLastCell(e)),e instanceof we)if(i=new kt(this.owner),t)i.setPosition(e.firstChild,!0);else{var n=e.lastChild;i.setPositionParagraph(n,n.getEndOffset())}return i},e.prototype.selectContent=function(e,i){if(t.isNullOrUndefined(e))throw new Error("textPosition is undefined.");this.start.setPositionInternal(e),this.end.setPositionInternal(e),this.upDownSelectionLength=this.end.location.x,this.fireSelectionChanged(!0)},e.prototype.selectInternal=function(e,t,i,n){this.start.setPositionForSelection(e,t,i,n),this.end.setPositionInternal(this.start),this.upDownSelectionLength=n.x,this.fireSelectionChanged(!0)},e.prototype.selects=function(e,t,i){this.documentHelper.clearSelectionHighlight(),this.start.setPositionForLineWidget(e,t),this.end.setPositionInternal(this.start),i||this.fireSelectionChanged(!0)},e.prototype.selectPosition=function(e,i){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i))throw new Error("TextPosition cannot be undefined");if(t.isNullOrUndefined(e.paragraph)||e.offset>this.getParagraphLength(e.paragraph)+1)throw new Error("Start TextPosition is not valid.");if(t.isNullOrUndefined(i.paragraph)||i.offset>this.getParagraphLength(i.paragraph)+1)throw new Error("End TextPosition is not valid.");e.isAtSamePosition(i)?this.selectRange(e,e):(e.isExistBefore(i)?i.validateForwardFieldSelection(e.getHierarchicalIndexInternal(),i.getHierarchicalIndexInternal()):e.validateForwardFieldSelection(i.getHierarchicalIndexInternal(),e.getHierarchicalIndexInternal()),this.selectRange(e,i))},e.prototype.fireSelectionChanged=function(e){this.isEmpty||(this.isForward?(this.start.updatePhysicalPosition(!0),this.end.updatePhysicalPosition(!1)):(this.start.updatePhysicalPosition(!1),this.end.updatePhysicalPosition(!0))),this.skipFormatRetrieval||this.retrieveCurrentFormatProperties(),this.documentHelper.clearSelectionHighlight(),this.hideToolTip(),this.owner.isLayoutEnabled&&!this.owner.isShiftingEnabled&&this.highlightSelection(!0),this.documentHelper.restrictEditingPane.isShowRestrictPane&&!this.skipEditRangeRetrieval&&this.documentHelper.restrictEditingPane.updateUserInformation(),e&&(this.start.paragraph.isInHeaderFooter&&!this.owner.enableHeaderAndFooter?this.owner.enableHeaderAndFooter=!0:!this.start.paragraph.isInHeaderFooter&&this.owner.enableHeaderAndFooter&&(this.owner.enableHeaderAndFooter=!1),this.owner.fireSelectionChange()),this.documentHelper.updateFocus(),this.documentHelper.isInlineFormFillProtectedMode&&e&&(this.triggerFormFillEvent(),this.previousSelectedFormField=this.getCurrentFormField())},e.prototype.retrieveCurrentFormatProperties=function(){this.isRetrieveFormatting=!0;var e=this.start,t=this.end;this.isForward||(e=this.end,t=this.start),this.retrieveImageFormat(e,t),this.retrieveCharacterFormat(e,t),this.retrieveParagraphFormat(e,t),this.retrieveSectionFormat(e,t),this.retrieveTableFormat(e,t),this.isImageSelected||this.imageFormat.clearImageFormat(),this.isRetrieveFormatting=!1,this.setCurrentContextType()},e.prototype.retrieveImageFormat=function(e,t){var i;if(e.currentWidget===t.currentWidget&&e.offset+1===t.offset){var n=t.currentWidget.getInline(t.offset,0);i=n.element;n.index;i instanceof Ze&&e.currentWidget.getOffset(i,0)!==e.offset&&(i=void 0)}i instanceof Ze?this.imageFormat.copyImageFormat(i):this.imageFormat.clearImageFormat()},e.prototype.getPreviousContextType=function(e){var t=this.start;if(t.offset>0){var i=t.currentWidget.getInline(t.offset,0).element;return i=e?i.previousElement:t.currentWidget.getInline(t.offset-1,0).element,this.getContextElement(i)}},e.prototype.getNextContextType=function(e){var t=this.start,i=t.currentWidget.getInline(t.offset,0).element;return i=e&&i.nextElement?i.nextElement:t.currentWidget.getInline(t.offset+1,0).element,this.getContextElement(i)},e.prototype.getContextElement=function(e){return e instanceof Oe?"Text":e instanceof Ie||e instanceof Be?"Field":e instanceof Ae?"Bookmark":e instanceof Ze?"Image":e instanceof Ke?"Shape":e instanceof yt||e instanceof vt?"Comment":e instanceof Qe?"List":e instanceof et||e instanceof $e?"EditRange":void 0},e.prototype.setCurrentContextType=function(){var e=!!this.imageFormat.image,i=!t.isNullOrUndefined(this.tableFormat)&&!t.isNullOrUndefined(this.tableFormat.table),n=this.start.paragraph.paragraphFormat.baseStyle;if(n instanceof U&&0===n.name.toLowerCase().indexOf("toc")){var r=this.getTocFieldInternal();if(!t.isNullOrUndefined(r))return void(this.contextTypeInternal="TableOfContents")}var o=this.getCurrentRevision();if(o?(this.owner.showRevisions=!0,this.owner.trackChangesPane.currentSelectedRevision=o[0]):t.isNullOrUndefined(this.owner.trackChangesPane.currentSelectedRevision)||(this.owner.trackChangesPane.currentSelectedRevision=void 0),this.start.paragraph.isInHeaderFooter){var s=-1!==this.start.paragraph.bodyWidget.headerFooterType.indexOf("Header");this.contextTypeInternal=i?e?s?"HeaderTableImage":"FooterTableImage":s?"HeaderTableText":"FooterTableText":e?s?"HeaderImage":"FooterImage":s?"HeaderText":"FooterText"}else this.contextTypeInternal=i?e?"TableImage":"TableText":e?"Image":"Text"},e.prototype.addItemRevisions=function(e,t){for(var i=0;i<e.revisions.length;i++){var n=e.revisions[i];this.selectRevision(n),t?n.accept():n.reject()}},e.prototype.hasRevisions=function(){return!!this.getCurrentRevision()},e.prototype.getCurrentRevision=function(){var e=this.start,i=this.end;this.isForward||(e=this.end,i=this.start);var n,r=e.currentWidget.getInline(e.offset,0).element,o=e.paragraph,s=e.currentWidget.getInline(e.offset+1,0).element;if(r&&r===s){var a=r.line.getOffset(r,r.length);if((n=new kt(this.owner)).setPositionParagraph(r.line,a),i.offset===n.offset)return}if(s!==r&&(r=s),!t.isNullOrUndefined(r)&&r.revisions.length>0)return r.revisions;if(o.isInsideTable){var l=o.associatedCell;if(!t.isNullOrUndefined(l.ownerRow)&&l.ownerRow.rowFormat.revisions.length>0)return l.ownerRow.rowFormat.revisions}return i.offset>i.paragraph.getLength()&&i.paragraph.characterFormat.revisions.length>0?i.paragraph.characterFormat.revisions:void 0},e.prototype.processLineRevisions=function(e,t){for(var i=0;i<e.children.length;i++){var n=e.children[i];n.revisions.length>0&&this.addItemRevisions(n,t)}},e.prototype.handleAcceptReject=function(e){if(this.isEmpty){var i=this.start.currentWidget.getInline(this.start.offset+1,0).element,n=this.start.paragraph;if(!t.isNullOrUndefined(i)&&i.revisions.length>0&&this.addItemRevisions(i,e),n.isInsideTable){var r=n.associatedCell;if(t.isNullOrUndefined(r)){if(!n.isEmpty())for(d=0;d<r.childWidgets.length;d++)for(var o=r.childWidgets[d],s=void 0;s<o.childWidgets.length;s++){var a=o.childWidgets[s];this.processLineRevisions(a,e)}}else r.ownerRow.rowFormat.revisions.length>0&&this.addItemRevisions(r.ownerRow.rowFormat,e)}}else for(var l=this.getselectedRevisionElements(),d=0;d<l.length;d++)this.acceptReject(l[d],e)},e.prototype.acceptReject=function(e,t){this.selectRevision(e),t?e.accept():e.reject()},e.prototype.getselectedRevisionElements=function(){var e=[],t=this.start,i=this.end;this.isForward||(t=this.end,i=this.start);for(var n=0;n<this.selectedWidgets.length;n++){var r=this.selectedWidgets.keys[n];if(r instanceof Te)e=this.getSelectedLineRevisions(r,t,i,e);else if(r instanceof Pe){r.ownerRow.rowFormat.revisions.length>0&&(e=this.addRevisionsCollec(r.ownerRow.rowFormat.revisions,e));for(var o=0;o<r.childWidgets.length;o++)for(var s=r.childWidgets[o],a=0;a<s.childWidgets.length;a++){var l=s.childWidgets[a];e=this.getSelectedLineRevisions(l,t,i,e)}}}return e},e.prototype.getSelectedLineRevisions=function(e,t,i,n){e.paragraph.characterFormat.revisions.length>0&&(n=this.addRevisionsCollec(e.paragraph.characterFormat.revisions,n));for(var r=0;r<e.children.length;r++){var o=e.children[r],s=o.line.getOffset(o,0),a=new kt(this.owner);a.setPositionParagraph(o.line,s),s=o.line.getOffset(o,o.length);var l=new kt(this.owner);l.setPositionParagraph(o.line,s),(l.isExistAfter(t)&&l.isExistBefore(i)||a.isExistAfter(t)&&a.isExistBefore(i)||a.isAtSamePosition(t)||t.isExistAfter(a)&&i.isExistBefore(l))&&o.revisions.length>0&&(n=this.addRevisionsCollec(o.revisions,n))}return n},e.prototype.addRevisionsCollec=function(e,t){for(var i=0;i<e.length;i++)-1===t.indexOf(e[i])&&t.push(e[i]);return t},e.prototype.retrieveTableFormat=function(e,i){var n=this.getTable(e,i);t.isNullOrUndefined(n)?this.tableFormat.clearFormat():(this.tableFormat.copyFormat(n.tableFormat),this.tableFormat.table=n,this.retrieveCellFormat(e,i),this.retrieveRowFormat(e,i))},e.prototype.retrieveCellFormat=function(e,t){e.paragraph.isInsideTable&&t.paragraph.isInsideTable?(this.cellFormat.copyFormat(e.paragraph.associatedCell.cellFormat),this.getCellFormat(e.paragraph.associatedCell.ownerTable,e,t)):this.cellFormat.clearCellFormat()},e.prototype.retrieveRowFormat=function(e,t){e.paragraph.isInsideTable&&t.paragraph.isInsideTable?(this.rowFormat.copyFormat(e.paragraph.associatedCell.ownerRow.rowFormat),this.getRowFormat(e.paragraph.associatedCell.ownerTable,e,t)):this.rowFormat.clearRowFormat()},e.prototype.getCellFormat=function(e,t,i){if(!t.paragraph.associatedCell.equals(i.paragraph.associatedCell))for(var n=!1,r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];if(o===t.paragraph.associatedCell.ownerRow&&(n=!0),n)for(var s=0;s<o.childWidgets.length;s++){var a=o.childWidgets[s];if(this.isCellSelected(a,t,i)&&this.cellFormat.combineFormat(a.cellFormat),a===i.paragraph.associatedCell)return void this.cellFormat.combineFormat(a.cellFormat)}}},e.prototype.getRowFormat=function(e,t,i){var n=t.paragraph.associatedCell.ownerRow;if(n!==i.paragraph.associatedCell.ownerRow)for(var r=e.childWidgets.indexOf(n)+1;r<e.childWidgets.length;r++){var o=e.childWidgets[r];if(this.rowFormat.combineFormat(o.rowFormat),o===i.paragraph.associatedCell.ownerRow)return}},e.prototype.getTable=function(e,i){if(!t.isNullOrUndefined(e.paragraph.associatedCell)&&!t.isNullOrUndefined(i.paragraph.associatedCell)){var n=e.paragraph.associatedCell.ownerTable,r=e.paragraph.associatedCell.ownerTable;if(n===r)return n;if(n.contains(e.paragraph.associatedCell))return n;if(r.contains(e.paragraph.associatedCell))return r;if(!n.isInsideTable||!r.isInsideTable)return;do{if((n=n.associatedCell.ownerTable)===r||n.contains(r.associatedCell))return n;if(r.contains(n.associatedCell))return r}while(!t.isNullOrUndefined(n.associatedCell))}},e.prototype.getContainerWidget=function(e){var t;if(e.containerWidget instanceof Xe)t=e.containerWidget.containerShape.line.paragraph.bodyWidget;else if(e.containerWidget instanceof me)t=e.containerWidget;else for(t=e.containerWidget;!(t instanceof me);)t instanceof Xe&&(t=t.containerShape.line.paragraph),t=t.containerWidget;return t},e.prototype.retrieveSectionFormat=function(e,i){var n=this.getContainerWidget(e.paragraph),r=this.getContainerWidget(i.paragraph);if(!t.isNullOrUndefined(n)){this.sectionFormat.copyFormat(n.sectionFormat);for(var o=this.documentHelper.pages.indexOf(n.page),s=this.documentHelper.pages.indexOf(r.page),a=o+1;a<=s;a++)this.sectionFormat.combineFormat(this.documentHelper.pages[a].bodyWidgets[0].sectionFormat)}},e.prototype.retrieveParagraphFormat=function(e,t){this.getParagraphFormatForSelection(e.paragraph,this,e,t)},e.prototype.getParagraphFormatForSelection=function(e,t,i,n){!i.paragraph.isInsideTable||n.paragraph.isInsideTable&&i.paragraph.associatedCell===n.paragraph.associatedCell&&!this.isCellSelected(i.paragraph.associatedCell,i,n)?this.getParagraphFormatInternalInParagraph(e,i,n):this.getParagraphFormatInternalInCell(i.paragraph.associatedCell,i,n)},e.prototype.getParagraphFormatInternalInParagraph=function(e,i,n){if(i.paragraph===e?this.paragraphFormat.copyFormat(e.paragraphFormat):this.paragraphFormat.combineFormat(e.paragraphFormat),n.paragraph!==e){var r=this.getNextRenderedBlock(e);t.isNullOrUndefined(r)||this.getParagraphFormatInternalInBlock(r,i,n)}},e.prototype.getParagraphFormatInternalInBlock=function(e,t,i){e instanceof we?this.getParagraphFormatInternalInParagraph(e,t,i):this.getParagraphFormatInternalInTable(e,t,i)},e.prototype.getParagraphFormatInternalInTable=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++){for(var r=e.childWidgets[n],o=0;o<r.childWidgets.length;o++)this.getParagraphFormatInCell(r.childWidgets[o]);if(i.paragraph.isInsideTable&&this.containsRow(r,i.paragraph.associatedCell))return}var s=this.getNextRenderedBlock(e);this.getParagraphFormatInternalInBlock(s,t,i)},e.prototype.getParagraphFormatInCell=function(e){for(var t=0;t<e.childWidgets.length;t++)this.getParagraphFormatInBlock(e.childWidgets[t])},e.prototype.getParagraphFormatInBlock=function(e){e instanceof we?this.getParagraphFormatInParagraph(e):this.getParagraphFormatInTable(e)},e.prototype.getParagraphFormatInTable=function(e){for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],n=0;n<i.childWidgets.length;n++)this.getParagraphFormatInCell(i.childWidgets[n])},e.prototype.getParagraphFormatInParagraph=function(e){this.paragraphFormat.combineFormat(e.paragraphFormat)},e.prototype.getParagraphFormatInternalInCell=function(e,t,i){if(i.paragraph.isInsideTable){var n=this.getContainerCellOf(e,i.paragraph.associatedCell);if(n.ownerTable.contains(i.paragraph.associatedCell)){var r=this.getSelectedCell(e,n),o=this.getSelectedCell(i.paragraph.associatedCell,n);this.containsCell(n,i.paragraph.associatedCell)?this.isCellSelected(n,t,i)?this.getParagraphFormatInCell(n):r===n?this.getParagraphFormatInternalInParagraph(t.paragraph,t,i):this.getParagraphFormatInRow(r.ownerRow,t,i):this.getParaFormatForCell(n.ownerTable,n,o)}else this.getParagraphFormatInRow(n.ownerRow,t,i)}else{var s=this.getContainerCell(e);this.getParagraphFormatInRow(s.ownerRow,t,i)}},e.prototype.getParaFormatForCell=function(e,t,i){var n=this.getCellLeft(t.ownerRow,t),r=n+t.cellFormat.cellWidth,o=this.getCellLeft(i.ownerRow,i),s=o+i.cellFormat.cellWidth;n>o&&(n=o),r<s&&(r=s),n>this.upDownSelectionLength&&(n=this.upDownSelectionLength),n<this.upDownSelectionLength&&(n=this.upDownSelectionLength);for(var a=e.childWidgets.indexOf(i.ownerRow),l=e.childWidgets.indexOf(t.ownerRow);l<=a;l++)for(var d=e.childWidgets[l],h=0;h<d.childWidgets.length;h++){var c=d.childWidgets[h],p=this.getCellLeft(d,c);L.round(n,2)<=L.round(p,2)&&L.round(p,2)<L.round(r,2)&&this.getParagraphFormatInCell(c)}},e.prototype.getParagraphFormatInRow=function(e,t,i){for(var n=e.rowIndex;n<e.ownerTable.childWidgets.length;n++){for(var r=e.ownerTable.childWidgets[n],o=0;o<r.childWidgets.length;o++)this.getParagraphFormatInCell(r.childWidgets[o]);if(i.paragraph.isInsideTable&&this.containsRow(r,i.paragraph.associatedCell))return}var s=this.getNextRenderedBlock(e.ownerTable);this.getParagraphFormatInternalInBlock(s,t,i)},e.prototype.retrieveCharacterFormat=function(e,i){if(this.characterFormat.copyFormat(e.paragraph.characterFormat),e.paragraph!==i.paragraph||!e.currentWidget.isLastLine()||e.offset!==this.getLineLength(e.currentWidget)||e.offset+1!==i.offset){var n=e.paragraph;if(e.paragraph===i.paragraph&&this.isSelectList){var r=this.getListLevel(e.paragraph);return void(r&&r.characterFormat.uniqueCharacterFormat&&this.characterFormat.copyFormat(r.characterFormat))}for(e.offset!==this.getParagraphLength(n)||this.isEmpty||(n=this.getNextParagraphBlock(n));!t.isNullOrUndefined(n)&&n!==i.paragraph&&n.isEmpty();)n=this.getNextParagraphBlock(n);var o=n===e.paragraph?e.offset:0;if(!t.isNullOrUndefined(n)&&!n.isEmpty()){var s=new kt(this.owner),a=e.currentWidget.getInline(o,0),l=this.getPhysicalPositionInternal(e.currentWidget,o,!0);s.setPositionForSelection(e.currentWidget,a.element,a.index,l),this.getCharacterFormatForSelection(n,this,s,i)}}},e.prototype.getCharacterFormatForSelection=function(e,t,i,n){i.paragraph instanceof we&&i.paragraph.isInsideTable&&(!n.paragraph.isInsideTable||i.paragraph.associatedCell!==n.paragraph.associatedCell||this.isCellSelected(i.paragraph.associatedCell,i,n))?this.getCharacterFormatInTableCell(i.paragraph.associatedCell,t,i,n):this.getCharacterFormat(e,i,n)},e.prototype.getCharacterFormatForTableRow=function(e,t,i){for(var n=e.rowIndex;n<e.ownerTable.childWidgets.length;n++){for(var r=e.ownerTable.childWidgets[n],o=0;o<r.childWidgets.length;o++)this.getCharacterFormatForSelectionCell(r.childWidgets[o],t,i);if(i.paragraph.isInsideTable&&this.containsRow(r,i.paragraph.associatedCell))return}var s=this.getNextRenderedBlock(e.ownerTable);this.getCharacterFormatForBlock(s,t,i)},e.prototype.getCharacterFormatInTableCell=function(e,t,i,n){if(n.paragraph.isInsideTable){var r=this.getContainerCellOf(e,n.paragraph.associatedCell);if(r.ownerTable.contains(n.paragraph.associatedCell)){var o=this.getSelectedCell(e,r),s=this.getSelectedCell(n.paragraph.associatedCell,r);this.containsCell(r,n.paragraph.associatedCell)?this.isCellSelected(r,i,n)?this.getCharacterFormatForSelectionCell(r,i,n):o===r?this.getCharacterFormat(i.paragraph,i,n):this.getCharacterFormatForTableRow(o.ownerRow,i,n):this.getCharacterFormatInternalInTable(r.ownerTable,r,s,i,n)}else this.getCharacterFormatForTableRow(r.ownerRow,i,n)}else{var a=this.getContainerCell(e);this.getCharacterFormatForTableRow(a.ownerRow,i,n)}},e.prototype.getCharacterFormatInternalInTable=function(e,t,i,n,r){var o=this.getCellLeft(t.ownerRow,t),s=o+t.cellFormat.cellWidth,a=this.getCellLeft(i.ownerRow,i),l=a+i.cellFormat.cellWidth;o>a&&(o=a),s<l&&(s=l),o>this.upDownSelectionLength&&(o=this.upDownSelectionLength),s<this.upDownSelectionLength&&(s=this.upDownSelectionLength);for(var d=e.childWidgets.indexOf(i.ownerRow),h=e.childWidgets.indexOf(t.ownerRow);h<=d;h++)for(var c=e.childWidgets[h],p=0;p<c.childWidgets.length;p++){var g=c.childWidgets[p],u=this.getCellLeft(c,g);L.round(o,2)<=L.round(u,2)&&L.round(u,2)<L.round(s,2)&&this.getCharacterFormatForSelectionCell(g,n,r)}},e.prototype.getCharacterFormat=function(e,i,n){if(e!==i.paragraph&&e!==n.paragraph&&!e.isEmpty())return void this.getCharacterFormatInternal(e,this);if(n.paragraph!==e||i.paragraph===e||0!==n.offset){var r=0,o=this.getParagraphLength(e);if(e!==i.paragraph||(r=i.offset,!this.setCharacterFormat(e,i,n,o))){var s=-1!==e.childWidgets.indexOf(i.currentWidget)?e.childWidgets.indexOf(i.currentWidget):0,a=-1!==e.childWidgets.indexOf(n.currentWidget)?e.childWidgets.indexOf(n.currentWidget):e.childWidgets.length-1,l=n.offset;e!==n.paragraph&&(l=o);for(var d=!1,h=s;h<=a;h++){var c=e.childWidgets[h];h!==s&&(r=this.getStartLineOffset(c)),l=c===n.currentWidget?n.offset:this.getLineLength(c);for(var p=0,g=0;g<c.children.length;g++){var u=c.children[g];if(!(u instanceof Qe))if(r>=p+u.length)p+=u.length;else{if(u instanceof Ie&&0===u.fieldType&&L.isLinkedFieldCharacter(u)){var m=t.isNullOrUndefined(u.fieldSeparator)?u.fieldEnd:u.fieldSeparator;do{p+=u.length,u=u.nextNode,h++}while(!t.isNullOrUndefined(u)&&u!==m);d=!0}if(u instanceof Ie&&1===u.fieldType&&L.isLinkedFieldCharacter(u)&&d){var f=u.fieldBegin;do{this.characterFormat.combineFormat(f.characterFormat),f=f.nextNode}while(!(f instanceof Ie))}if(u instanceof Oe&&this.characterFormat.combineFormat(u.characterFormat),t.isNullOrUndefined(u)||l<=p+u.length)break;p+=u.length}}}if(n.paragraph!==e){var v=this.getNextRenderedBlock(e);t.isNullOrUndefined(v)||this.getCharacterFormatForBlock(v,i,n)}}}},e.prototype.setCharacterFormat=function(e,i,n,r){var o=0,s=i.offset,a=i.currentWidget.getInline(s,o);o=a.index;var l=a.element;if(t.isNullOrUndefined(l)){i.paragraph.childWidgets.indexOf(i.currentWidget);if(i.currentWidget.previousLine)return l=i.currentWidget.previousLine.children[i.currentWidget.previousLine.children.length-1],this.characterFormat.copyFormat(l.characterFormat),!0}if(s<r){if(this.isEmpty){if(l instanceof Oe||l instanceof Ie&&(0===l.fieldType||1===l.fieldType)){var d=this.getPreviousTextElement(l);0===s&&d&&(l=d),this.characterFormat.copyFormat(l.characterFormat)}else t.isNullOrUndefined(this.getPreviousTextElement(l))?t.isNullOrUndefined(this.getNextTextElement(l))?this.characterFormat.copyFormat(e.characterFormat):this.characterFormat.copyFormat(this.getNextTextElement(l).characterFormat):this.characterFormat.copyFormat(this.getPreviousTextElement(l).characterFormat);return!0}o!==l.length||t.isNullOrUndefined(l.nextNode)?l instanceof Oe?this.characterFormat.copyFormat(l.characterFormat):l instanceof Ie&&this.characterFormat.copyFormat(this.getNextValidCharacterFormatOfField(l)):this.characterFormat.copyFormat(this.getNextValidCharacterFormat(l))}else if(r===n.offset)return l instanceof Oe||l instanceof Ie?this.characterFormat.copyFormat(l.characterFormat):t.isNullOrUndefined(l)?this.characterFormat.copyFormat(e.characterFormat):(l=this.getPreviousTextElement(l),t.isNullOrUndefined(l)||this.characterFormat.copyFormat(l.characterFormat)),!0;return!1},e.prototype.getCharacterFormatForBlock=function(e,t,i){e instanceof we?this.getCharacterFormat(e,t,i):this.getCharacterFormatInTable(e,t,i)},e.prototype.getCharacterFormatInTable=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++){for(var r=e.childWidgets[n],o=0;o<r.childWidgets.length;o++)this.getCharacterFormatForSelectionCell(r.childWidgets[o],t,i);if(i.paragraph.isInsideTable&&this.containsRow(r,i.paragraph.associatedCell))return}var s=this.getNextRenderedBlock(e);this.getCharacterFormatForBlock(s,t,i)},e.prototype.getCharacterFormatForSelectionCell=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++)this.getCharacterFormatForBlock(e.childWidgets[n],t,i)},e.prototype.getCharacterFormatInternal=function(e,t){for(var i=0;i<e.childWidgets.length;i++)for(var n=e.childWidgets[i],r=0;r<n.children.length;r++){var o=n.children[r];o instanceof Ze||o instanceof Ie||t.characterFormat.combineFormat(o.characterFormat)}},e.prototype.getNextValidCharacterFormat=function(e){var i=this.getNextTextElement(e);if(t.isNullOrUndefined(i))return e.characterFormat;var n=void 0;return i instanceof Ie&&0===n.fieldType&&(n=i),t.isNullOrUndefined(n)?i.characterFormat:this.getNextValidCharacterFormatOfField(n)},e.prototype.getNextValidCharacterFormatOfField=function(e){var i=e;L.isLinkedFieldCharacter(e)&&(i=t.isNullOrUndefined(e.fieldSeparator)?e.fieldEnd:e.fieldSeparator);var n=void 0;return t.isNullOrUndefined(i.nextNode)||(n=this.getNextValidElement(i.nextNode)),t.isNullOrUndefined(n)?i.characterFormat:n.characterFormat},e.prototype.checkCursorIsInSelection=function(e,i){if(t.isNullOrUndefined(this.start)||this.isEmpty||t.isNullOrUndefined(e))return!1;var n=!1;do{if(this.selectedWidgets.containsKey(e)){var r=void 0;e instanceof Te?(r=this.owner.selection.getTop(e),this.owner.selection.getLeft(e)):(r=e.y,e.x);var o=this.selectedWidgets.get(e);n=o.left<=i.x&&r<=i.y&&r+e.height>=i.y&&o.left+o.width>=i.x}e=e instanceof Te?e.paragraph:e.containerWidget}while(!t.isNullOrUndefined(e)&&!n);return n},e.prototype.copySelectionParagraphFormat=function(){var e=new I;return this.paragraphFormat.copyToFormat(e),e},e.prototype.getHyperlinkDisplayText=function(e,i,n,r,o){var s=e;if(s!==n.line.paragraph)return r=!0,{displayText:"<<Selection in Document>>",isNestedField:r,format:o};for(var a="",l=s.childWidgets.indexOf(i.line),d=s.childWidgets[l].children.indexOf(i),h=l;h<s.childWidgets.length;h++){var c=s.childWidgets[h];h!==l&&(d=-1);for(var p=d+1;p<c.children.length;p++){var g=c.children[p];if(g===n)return{displayText:a,isNestedField:r,format:o};if(g instanceof Oe)a+=g.text,o=g.characterFormat;else{if(!(g instanceof Ie))return r=!0,{displayText:"<<Selection in Document>>",isNestedField:r,format:o};g instanceof Ie&&0===g.fieldType&&!t.isNullOrUndefined(g.fieldEnd)&&(d=t.isNullOrUndefined(g.fieldSeparator)?c.children.indexOf(g.fieldEnd):c.children.indexOf(g.fieldSeparator))}}}return{displayText:a,isNestedField:r,format:o}},e.prototype.navigateHyperLinkOnEvent=function(e,i){var n=this,r=this.documentHelper.getLineWidget(e);if(!t.isNullOrUndefined(r)){var o=this.getHyperLinkFieldInCurrentSelection(r,e);t.isNullOrUndefined(o)||(this.documentHelper.updateTextPositionForSelection(e,1),this.fireRequestNavigate(o),setTimeout(function(){n.viewer&&(n.documentHelper.isTouchInput=i,n.documentHelper.updateFocus(),n.documentHelper.isTouchInput=!1)}))}},e.prototype.getLinkText=function(e){var i=new Rt(e,this),n=i.navigationLink;return i.localReference.length>0&&("_"!==i.localReference[0]||!t.isNullOrUndefined(n)&&0!==n.length?i.isCrossRef?n+=i.localReference:n+="#"+i.localReference:n="Current Document"),i.destroy(),n},e.prototype.setHyperlinkContentToToolTip=function(e,i,n,r){if(e){if(this.owner.contextMenuModule&&"block"===this.owner.contextMenuModule.contextMenuInstance.element.style.display)return;this.toolTipElement||(this.toolTipElement=t.createElement("div",{className:"e-de-tooltip"}),this.documentHelper.viewerContainer.appendChild(this.toolTipElement)),this.toolTipElement.style.display="block";var o=new t.L10n("documenteditor",this.owner.defaultLocale);o.setLocale(this.owner.locale);var s=o.getConstant("Click to follow link");this.owner.useCtrlClickToFollowHyperlink&&(s="Ctrl+"+s);var a=this.getLinkText(e);if(r){var l=e.formFieldData.helpText;if(t.isNullOrUndefined(l)||""===l)return;this.toolTipElement.innerHTML=l}else this.toolTipElement.innerHTML=a+"</br><b>"+s+"</b>";var d=this.getTooltipPosition(e.line,n,this.toolTipElement,!1);this.showToolTip(d.x,d.y),t.isNullOrUndefined(this.toolTipField)||e===this.toolTipField||(this.toolTipObject.position={X:d.x,Y:d.y}),this.toolTipObject.show(),this.toolTipField=e}else this.hideToolTip()},e.prototype.setFootnoteContentToToolTip=function(e,i,n){if(e){if("block"===this.owner.contextMenuModule.contextMenuInstance.element.style.display&&this.owner.contextMenuModule)return;this.toolTipElement||(this.toolTipElement=t.createElement("div",{className:"e-de-tooltip"}),this.documentHelper.viewerContainer.appendChild(this.toolTipElement)),this.toolTipElement.style.display="block";var r=new t.L10n("documenteditor",this.owner.defaultLocale);r.setLocale(this.owner.locale);var o=void 0;"Endnote"===e.footnoteType?o=r.getConstant("Click to View/Edit Endnote"):"Footnote"===e.footnoteType&&(o=r.getConstant("Click to View/Edit Footnote")),this.toolTipElement.innerHTML="<b>"+o+"</b>";var s=this.getTooltipPosition(e.line,n,this.toolTipElement,!1);this.showToolTip(s.x,s.y),t.isNullOrUndefined(this.toolTipField)||(this.toolTipObject.position={X:s.x,Y:s.y}),this.toolTipObject.show()}else this.hideToolTip()},e.prototype.setLockInfoTooptip=function(e,i,n){if(e){if(this.owner.contextMenuModule&&"block"===this.owner.contextMenuModule.contextMenuInstance.element.style.display)return;var r=this.toolTipElement;this.toolTipElement||(r=t.createElement("div",{className:"e-de-tooltip"}),this.documentHelper.viewerContainer.appendChild(r),this.toolTipElement=r),r.style.display="block";var o=new t.L10n("documenteditor",this.owner.defaultLocale);o.setLocale(this.owner.locale);var s=o.getConstant("This region is locked by");r.innerHTML=s+" <b>"+n+"</b>";var a=this.getTooltipPosition(e,i,r,!1);this.showToolTip(a.x,a.y),t.isNullOrUndefined(this.toolTipField)||n===this.toolTipField||(this.toolTipObject.position={X:a.x,Y:a.y}),this.toolTipObject.show(),this.toolTipField=n}else this.hideToolTip()},e.prototype.getTooltipPosition=function(e,t,i,n){var r=this.getTop(e)*this.documentHelper.zoomFactor,o=this.getPage(e.paragraph),s=this.documentHelper.viewerContainer.getBoundingClientRect().width+this.documentHelper.viewerContainer.scrollLeft,a=o.boundingRectangle.x+t*this.documentHelper.zoomFactor;a+i.clientWidth+10>s&&(a-=i.clientWidth-(s-a)+15);var l=n?0:i.offsetHeight,d=this.getPageTop(o)+(r-l);return d=d>this.documentHelper.viewerContainer.scrollTop?d:d+e.height+l,new R(a,d)},e.prototype.createPasteElement=function(e,i){var n,r=new t.L10n("documenteditor",this.owner.defaultLocale);if(r.setLocale(this.owner.locale),"DefaultPaste"===this.currentPasteAction)n=[{text:r.getConstant("Keep source formatting"),iconCss:"e-icons e-de-paste-source"},{text:r.getConstant("Match destination formatting"),iconCss:"e-icons e-de-paste-merge"},{text:r.getConstant("Text only"),iconCss:"e-icons e-de-paste-text"}];else if(n=[{text:r.getConstant("NestTable"),iconCss:"e-icons e-de-paste-nested-table"},{text:r.getConstant("InsertAsRows"),iconCss:"e-icons e-de-paste-row"}],"InsertAsColumns"===this.currentPasteAction){o={text:r.getConstant("InsertAsColumns"),iconCss:"e-icons e-de-paste-column"};n.unshift(o)}else if("OverwriteCells"===this.currentPasteAction){var o={text:r.getConstant("OverwriteCells"),iconCss:"e-icons e-de-paste-overwrite-cells"};n.splice(2,0,o)}if(this.pasteElement)this.pasteDropDwn.items=n;else{this.pasteElement=t.createElement("div",{className:"e-de-tooltip"}),this.documentHelper.viewerContainer.appendChild(this.pasteElement);var s=t.createElement("button",{id:this.owner.containerId+"_iconsplitbtn"});this.pasteElement.appendChild(s),this.pasteDropDwn=new d.DropDownButton({items:n,iconCss:"e-icons e-de-paste",select:this.pasteOptions}),this.pasteDropDwn.appendTo(s)}this.pasteElement.style.display="block",this.pasteElement.style.position="absolute",this.pasteElement.style.left=i,this.pasteElement.style.top=e,this.pasteDropDwn.dataBind()},e.prototype.showToolTip=function(e,t){this.toolTipObject||(this.toolTipObject=new n.Popup(this.toolTipElement,{height:"auto",width:"auto",relateTo:this.documentHelper.viewerContainer.parentElement,position:{X:e,Y:t}}))},e.prototype.hideToolTip=function(){this.toolTipField=void 0,this.toolTipObject&&(this.toolTipElement.style.display="none",this.toolTipObject.hide(),this.toolTipObject.destroy(),this.toolTipObject=void 0)},e.prototype.getHyperLinkFieldInCurrentSelection=function(e,i,n){var r=void 0,o=this.getTop(e),s=this.getLineStartLeft(e);if(!(i.y<o||i.y>o+e.height||i.x<s||i.x>s+e.paragraph.width)){var a=e.paragraph.x,l=this.getFirstElement(e,a);a=l.left;var d=l.element;if(t.isNullOrUndefined(d)){g=this.documentHelper.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat);if(i.x<=s+g||i.x>=s+g){var h=[],c=this.getHyperLinkFields(e.paragraph,h,!1,n);return h=[],h=void 0,c}}else{if(i.x>a+d.margin.left)for(var p=e.children.indexOf(d);p<e.children.length&&(d=e.children[p],!(i.x<a+d.margin.left+d.width||p===e.children.length-1));p++)a+=d.margin.left+d.width;r=d;var g=d.margin.left+d.width;if(t.isNullOrUndefined(r.nextNode)&&(g+=this.documentHelper.textHelper.getParagraphMarkWidth(r.line.paragraph.characterFormat)),i.x<=a+g){var h=[],c=this.getHyperLinkFieldInternal(r.line.paragraph,r,h,!1,n);return h=[],h=void 0,c}}}},e.prototype.getFootNoteElementInCurrentSelection=function(e,i){var n=void 0,r=this.getTop(e),o=this.getLineStartLeft(e);if(!(i.y<r||i.y>r+e.height||i.x<o||i.x>o+e.paragraph.width)){var s=e.paragraph.x,a=this.getFirstElement(e,s);s=a.left;var l=a.element;if(t.isNullOrUndefined(l)){c=this.documentHelper.textHelper.getParagraphMarkWidth(e.paragraph.characterFormat);if(i.x<=o+c||i.x>=o+c){var d=this.documentHelper.selection.start.currentWidget.getInline(this.documentHelper.selection.start.offset,0).element;return d instanceof Le?d:void 0}}else{if(i.x>s+l.margin.left)for(var h=e.children.indexOf(l);h<e.children.length&&(l=e.children[h],!(i.x<s+l.margin.left+l.width||h===e.children.length-1));h++)s+=l.margin.left+l.width;l instanceof Le&&(n=l);var c=l.margin.left+l.width;if(t.isNullOrUndefined(l.nextNode)&&(c+=this.documentHelper.textHelper.getParagraphMarkWidth(l.line.paragraph.characterFormat)),i.x<=s+c)return n}}},e.prototype.getHyperlinkField=function(e){if(!t.isNullOrUndefined(this.end)){var i=0,n=this.documentHelper.selection,r=(n.start,n.end);n.isForward||(n.end,r=n.start);var o=this.end.currentWidget.getInline(r.offset,i);i=o.index;var s=o.element,a=[],l=void 0;if(t.isNullOrUndefined(s))l=this.getHyperLinkFields(this.end.paragraph,a,e);else if(this.documentHelper.isFormFillProtectedMode&&s instanceof Ae&&s.previousNode instanceof Ie&&1===s.previousNode.fieldType)l=void 0;else{var d=s.line.paragraph;l=this.getHyperLinkFieldInternal(d,s,a,e,!1)}return a=[],l}},e.prototype.getHyperLinkFields=function(e,i,n,r){for(var o=0;o<this.documentHelper.fields.length;o++)if(-1===i.indexOf(this.documentHelper.fields[o])&&!t.isNullOrUndefined(this.documentHelper.fields[o].fieldSeparator)){i.push(this.documentHelper.fields[o]);var s=this.getFieldCode(this.documentHelper.fields[o]);s=s.trim().toLowerCase();var a=this.paragraphIsInFieldResult(this.documentHelper.fields[o],e);if((n||!n&&s.match("hyperlink "))&&a)return this.documentHelper.fields[o];if(a&&r&&this.documentHelper.fields[o].formFieldData)return this.documentHelper.fields[o];if((n||!n&&s.match("ref "))&&a)return this.documentHelper.fields[o]}},e.prototype.getHyperLinkFieldInternal=function(e,i,n,r,o){for(var s=0;s<this.documentHelper.fields.length;s++)if(-1===n.indexOf(this.documentHelper.fields[s])&&!t.isNullOrUndefined(this.documentHelper.fields[s].fieldSeparator)){n.push(this.documentHelper.fields[s]);var a=this.getFieldCode(this.documentHelper.fields[s]);a=a.trim().toLowerCase();var l=this.documentHelper.fields[s],d=l.fieldEnd;r&&l.nextNode instanceof Ae&&(d=l.nextNode.reference);var h=this.inlineIsInFieldResult(l,d,l.fieldSeparator,i,r)||this.isImageField();if((r||!r&&a.match("hyperlink "))&&h)return this.documentHelper.fields[s];if(h&&o&&this.documentHelper.fields[s].formFieldData)return this.documentHelper.fields[s];if((r||!r&&a.match("ref "))&&h)return this.documentHelper.fields[s]}if(e.containerWidget instanceof fe&&!(e instanceof ve))return this.getHyperLinkFieldInternal(e.containerWidget,i,n,r,o)},e.prototype.getBlock=function(e){if(""!==e&&!t.isNullOrUndefined(e)){var i={index:e},n=this.start.getPage(i),r=i.index.indexOf(";"),o=i.index.substring(0,r);i.index=i.index.substring(r).replace(";","");var s=n.bodyWidgets[parseInt(o,10)];return this.getBlockInternal(s,i.index)}},e.prototype.getBlockInternal=function(e,i){if(""!==i&&!t.isNullOrUndefined(i)){var n=i.indexOf(";"),r=i.substring(0,n);i=i.substring(n).replace(";","");var o=e;if(!((n=parseInt(r,10))>=0&&n<e.childWidgets.length))return o;var s=e.childWidgets[n];return i.indexOf(";")>=0?s instanceof we?(i.indexOf(";")>=0&&(i="0"),s):s instanceof ye?this.getBlockInternal(s,i):o:s}},e.prototype.inlineIsInFieldResult=function(e,i,n,r,o){return!(t.isNullOrUndefined(i)||t.isNullOrUndefined(n)||!this.isExistBeforeInline(n,r))&&this.isExistAfterInline(i,r,o)},e.prototype.paragraphIsInFieldResult=function(e,i){if(!t.isNullOrUndefined(e.fieldEnd)&&!t.isNullOrUndefined(e.fieldSeparator)){var n=e.fieldSeparator.line.paragraph;if(e.fieldSeparator.line.paragraph===i||this.isExistBefore(n,i))return e.fieldEnd.line.paragraph!==i&&this.isExistAfter(n,i)}return!1},e.prototype.isImageField=function(){if(this.start.paragraph.isEmpty()||this.end.paragraph.isEmpty())return!1;var e=this.start,t=this.end;this.isForward||(e=this.end,t=this.start);var i=0,n=e.paragraph.getInline(e.offset,i),r=n.element;(i=n.index)===r.length&&(r=this.getNextRenderedElementBox(r,i));var o=(n=t.paragraph.getInline(t.offset,i)).element;if(i=n.index,r instanceof Ie&&0===r.fieldType&&o instanceof Ie&&1===o.fieldType&&r.fieldSeparator){var s=r.fieldSeparator.nextNode;if(s instanceof Ze&&s.nextNode===o)return!0}return!1},e.prototype.isFormField=function(){var e=this.getCurrentFormField();return!!(e instanceof Ie&&e.formFieldData)},e.prototype.isReferenceField=function(e){if(t.isNullOrUndefined(e)&&(e=this.getHyperlinkField(!0)),e){var i=this.getFieldCode(e);if(i=i.toLowerCase(),e instanceof Ie&&i.match("ref "))return!0}return!1},e.prototype.isInlineFormFillMode=function(e){return!!(this.documentHelper.isInlineFormFillProtectedMode&&(t.isNullOrUndefined(e)&&(e=this.getCurrentFormField()),e&&e.formFieldData instanceof Ee&&"Text"===e.formFieldData.type))},e.prototype.getFormFieldType=function(e){if(t.isNullOrUndefined(e)&&(e=this.getCurrentFormField()),e instanceof Ie){if(e.formFieldData instanceof Ee)return"Text";if(e.formFieldData instanceof He)return"CheckBox";if(e.formFieldData instanceof We)return"DropDown"}},e.prototype.getCurrentFormField=function(e){var i;if(e||this.documentHelper.isFormFillProtectedMode&&this.owner.documentEditorSettings.formFieldSettings&&"Inline"===this.owner.documentEditorSettings.formFieldSettings.formFillingMode)for(var n=0;n<this.documentHelper.formFields.length;n++){var r=this.documentHelper.formFields[n];if(L.isLinkedFieldCharacter(r)){var o=r.fieldSeparator.line.getOffset(r.fieldSeparator,1),s=new kt(this.owner);s.setPositionParagraph(r.fieldSeparator.line,o);var a=r.fieldEnd;o=a.line.getOffset(a,0);var l=new kt(this.owner);l.setPositionParagraph(a.line,o);var d=this.start,h=this.end;if(this.isForward||(d=this.end,h=this.start),(d.isExistAfter(s)||d.isAtSamePosition(s))&&(h.isExistBefore(l)||h.isAtSamePosition(l))){i=r;break}}}else i=this.getHyperlinkField(!0);if(i instanceof Ie&&0===i.fieldType&&!t.isNullOrUndefined(i.formFieldData))return i},e.prototype.getCurrentTextFrame=function(){var e=this.start.paragraph.containerWidget;do{if(e instanceof Xe)return e;e&&(e=e.containerWidget)}while(e);return null},e.prototype.isTableSelected=function(){var e=this.start,i=this.end;if(this.isForward||(e=this.end,i=this.start),t.isNullOrUndefined(e.paragraph.associatedCell)||t.isNullOrUndefined(i.paragraph.associatedCell))return!1;var n=e.paragraph.associatedCell.ownerTable.getSplitWidgets(),r=this.getFirstBlockInFirstCell(n[0]),o=this.getLastBlockInLastCell(n[n.length-1]);return e.paragraph.associatedCell.equals(r.associatedCell)&&i.paragraph.associatedCell.equals(o.associatedCell)&&(!r.associatedCell.equals(o.associatedCell)||0===e.offset&&i.offset===this.getLineLength(o.lastChild)+1)},e.prototype.selectListText=function(){var e=this.documentHelper.selectionLineWidget.getHierarchicalIndex("0"),t=this.getTextPosition(e),i=this.getTextPosition(e);this.isSelectList=!0,this.selectRange(t,i),this.isSelectList=!1,this.highlightListText(this.documentHelper.selectionLineWidget),this.contextTypeInternal="List"},e.prototype.highlightListText=function(e){var t=e.children[0].width,i=this.documentHelper.getLeftValue(e),n=e.paragraph.y;this.createHighlightBorder(e,t,i,n,!1),this.documentHelper.isListTextSelected=!0},e.prototype.updateImageSize=function(e){this.owner.isShiftingEnabled=!0;var t=this.start,i=this.end;this.isForward||(t=this.end,i=this.start);var n=null,r=0,o=t.paragraph;if(o===i.paragraph&&t.offset+1===i.offset){var s=o.getInline(i.offset,r);n=s.element,r=s.index}if(n instanceof Ze||n instanceof Ke){var a=n.width,l=n.height;if(n.width=e.width,n.height=e.height,e.width=a,e.height=l,null!==o&&null!==o.containerWidget&&this.owner.editorModule){var d=o.childWidgets.indexOf(n.line),h=n.line.children.indexOf(n);this.documentHelper.layout.reLayoutParagraph(o,d,h),this.highlightSelection(!1)}}},e.prototype.getSelectedCellsInTable=function(e,t,i){for(var n=t.columnIndex,r=i.columnIndex+i.cellFormat.columnSpan-1,o=t.ownerRow.index,s=i.ownerRow.index,a=[],l=0;l<e.childWidgets.length;l++){var d=e.childWidgets[l];if(d.index>=o&&d.index<=s)for(var h=0;h<d.childWidgets.length;h++){var c=d.childWidgets[h];c.columnIndex>=n&&c.columnIndex<=r&&a.push(c)}if(d.index>s)break}return a},e.prototype.copy=function(){this.isEmpty||this.copySelectedContent(!1)},e.prototype.copySelectedContent=function(e){t.isNullOrUndefined(this.owner.sfdtExportModule)||(this.copyToClipboard(this.getHtmlContent()),e&&this.owner.editorModule&&this.owner.editorModule.handleCut(this),this.documentHelper.updateFocus())},e.prototype.getHtmlContent=function(){var e=this.start,t=this.end;this.isForward||(e=this.end,t=this.start);var i=this.owner.sfdtExportModule.write(e.currentWidget,e.offset,t.currentWidget,t.offset,!0);return this.owner.editorModule&&(this.owner.editorModule.copiedData=JSON.stringify(i)),this.htmlWriter.writeHtml(i)},e.prototype.copyToClipboard=function(e){window.getSelection().removeAllRanges();var t=document.createElement("div");t.style.left="-10000px",t.style.top="-10000px",t.style.position="relative",t.innerHTML=e,this.htmlWriter.isMergeField&&(t.innerText="",this.htmlWriter.isMergeField=!1),document.body.appendChild(t),-1!==navigator.userAgent.indexOf("Firefox")&&(t.tabIndex=0,t.focus());var i=document.createRange();i.selectNodeContents(t),window.getSelection().addRange(i);var n=!1;try{n=document.execCommand("copy")}catch(e){}finally{window.getSelection().removeAllRanges(),t.parentNode.removeChild(t)}return n},e.prototype.showCaret=function(){var e=t.isNullOrUndefined(this.documentHelper.currentPage)?this.documentHelper.currentRenderingPage:this.documentHelper.currentPage;if(!(t.isNullOrUndefined(e)||this.documentHelper.isRowOrCellResizing||this.owner.enableImageResizerMode&&this.owner.imageResizerModule.isImageResizerVisible&&!this.owner.imageResizerModule.isShapeResize)){var i,n=e.boundingRectangle.x;if(i=this.viewer instanceof le?e.boundingRectangle.width*this.documentHelper.zoomFactor+n:e.boundingRectangle.width-this.owner.viewer.padding.right-this.documentHelper.scrollbarWidth,!this.owner.enableImageResizerMode||!this.owner.imageResizerModule.isImageResizerVisible||this.owner.imageResizerModule.isShapeResize)if(this.isHideSelection(this.start.paragraph))this.caret.style.display="none";else if(this.isEmpty&&(!this.owner.isReadOnlyMode||this.owner.enableCursorOnReadOnly||this.isInlineFormFillMode())){var r=parseInt(this.caret.style.left.replace("px",""),10);this.caret.style.display=r<n||r>i?"none":"block"}else this.isImageSelected&&!this.owner.enableImageResizerMode?this.caret.style.display="block":("block"===this.caret.style.display||t.isNullOrUndefined(this))&&(this.documentHelper.isComposingIME||(this.caret.style.display="none"));if(t.isNullOrUndefined(this)||!this.documentHelper.isTouchInput||this.owner.isReadOnlyMode)this.documentHelper.touchStart.style.display="none",this.documentHelper.touchEnd.style.display="none";else{var o=parseInt(this.documentHelper.touchStart.style.left.replace("px",""),10)+14,s=parseInt(this.documentHelper.touchEnd.style.left.replace("px",""),10)+14,a=this.getSelectionPage(this.start);a&&(this.documentHelper.touchEnd.style.display=s<n||s>i?"none":"block",this.isEmpty||(n=a.boundingRectangle.x,i=a.boundingRectangle.width*this.documentHelper.zoomFactor+n),this.documentHelper.touchStart.style.display=o<n||o>i?"none":"block")}}},e.prototype.setEditableDivCaretPosition=function(e){this.documentHelper.editableDiv.focus();var t=this.documentHelper.editableDiv.childNodes[this.documentHelper.editableDiv.childNodes.length-1];if(t){var i=document.createRange();i.setStart(t,e),i.collapse(!0),window.getSelection().removeAllRanges(),window.getSelection().addRange(i)}},e.prototype.initCaret=function(){this.caret=t.createElement("div",{styles:"position:absolute",className:"e-de-blink-cursor e-de-cursor-animation"}),this.owner.documentHelper.viewerContainer.appendChild(this.caret)},e.prototype.updateCaretPosition=function(){var e=this.end.location,i=this.getSelectionPage(this.end);if(i&&!t.isNullOrUndefined(this.caret)){this.caret.style.left=i.boundingRectangle.x+Math.round(e.x)*this.documentHelper.zoomFactor+"px";var n=this.updateCaretSize(this.owner.selection.end),r=n.topMargin,o=this.viewer,s=(i.boundingRectangle.y-o.pageGap*(this.documentHelper.pages.indexOf(i)+1))*this.documentHelper.zoomFactor+o.pageGap*(this.documentHelper.pages.indexOf(i)+1);this.caret.style.top=s+Math.round(e.y+r)*this.documentHelper.zoomFactor+"px","Subscript"===this.owner.selection.characterFormat.baselineAlignment&&(this.caret.style.top=parseFloat(this.caret.style.top)+parseFloat(this.caret.style.height)/2+"px"),(this.documentHelper.isTouchInput||"none"!==this.documentHelper.touchStart.style.display)&&(this.documentHelper.touchStart.style.left=i.boundingRectangle.x+(Math.round(e.x)*this.documentHelper.zoomFactor-14)+"px",this.documentHelper.touchStart.style.top=s+(e.y+n.height)*this.documentHelper.zoomFactor+"px",this.documentHelper.touchEnd.style.left=i.boundingRectangle.x+(Math.round(e.x)*this.documentHelper.zoomFactor-14)+"px",this.documentHelper.touchEnd.style.top=s+(e.y+n.height)*this.documentHelper.zoomFactor+"px")}this.showHidePasteOptions(this.caret.style.top,this.caret.style.left)},e.prototype.showHidePasteOptions=function(e,i){if(!t.Browser.isIE)if(this.isViewPasteOptions){if(this.pasteElement&&"block"===this.pasteElement.style.display)return;this.createPasteElement(e,i)}else this.pasteElement&&(this.pasteElement.style.display="none")},e.prototype.getRect=function(e){var t=e.location,i=this.getSelectionPage(e);if(i){var n=this.owner.documentHelper,r=i.boundingRectangle.x+Math.round(t.x)*n.zoomFactor,o=this.viewer.pageGap,s=(i.boundingRectangle.y-o*(i.index+1))*n.zoomFactor+o*(i.index+1)+Math.round(t.y)*n.zoomFactor;return new R(r,s)}return new R(0,0)},e.prototype.getSelectionPage=function(e){var t=this.getLineWidgetInternal(e.currentWidget,e.offset,!0);if(t)return this.getPage(t.paragraph)},e.prototype.updateCaretSize=function(e,i){var n,r=0,o=!1,s=0,a=0;if(this.characterFormat.italic&&(o=this.characterFormat.italic),e.paragraph.isEmpty()){var l=e.paragraph,d=0,h=this.getParagraphMarkSize(l,r,d);r=h.topMargin,d=h.bottomMargin;var c=h.height;a=r<0?r+c:c,i||(this.caret.style.height=a*this.documentHelper.zoomFactor+"px"),r=0}else{var p=e.currentWidget.getInline(e.offset,s);s=p.index;var g=p.element;t.isNullOrUndefined(g)||(a=(n=this.getCaretHeight(g,s,g.characterFormat,!0,r,o)).height,i||(this.caret.style.height=n.height*this.documentHelper.zoomFactor+"px"))}return i||(this.caret.style.transform=o?"rotate(13deg)":""),{topMargin:r,height:a}},e.prototype.updateCaretToPage=function(e,i){if(!t.isNullOrUndefined(i))if(this.documentHelper.selectionEndPage=i,this.owner.selection.isEmpty)this.documentHelper.selectionStartPage=i;else{var n=this.getLineWidgetParagraph(e.offset,e.paragraph.childWidgets[0]),r=this.getPage(n.paragraph);t.isNullOrUndefined(r)||(this.documentHelper.selectionStartPage=r)}this.checkForCursorVisibility()},e.prototype.getCaretBottom=function(e,t){var i=e.location.y;if(e.paragraph.isEmpty()){var n=e.paragraph,r=0,o=0,s=this.getParagraphMarkSize(n,r,o);r=s.topMargin,o=s.bottomMargin,i+=s.height,i+=r,t||(i+=o)}else{var a=0,l=e.paragraph.getInline(e.offset,a),d=l.element;a=l.index;var r=0,h=!1,c=this.getCaretHeight(d,a,d.characterFormat,!1,r,h);r=c.topMargin,h=c.isItalic,i+=c.height,t&&(i-=L.convertPointToPixel(this.documentHelper.layout.getAfterSpacing(e.paragraph)))}return i},e.prototype.checkForCursorVisibility=function(){this.showCaret()},e.prototype.onKeyDownInternal=function(e,i,n,r){var o=e.which||e.keyCode;if(!i||n||r)if(!n||i||r)if(n&&i&&!r)switch(o){case 32:this.owner.editor.insertText(String.fromCharCode(160));break;case 35:this.handleControlShiftEndKey();break;case 36:this.handleControlShiftHomeKey();break;case 37:this.handleControlShiftLeftKey();break;case 38:this.handleControlShiftUpKey();break;case 39:this.handleControlShiftRightKey();break;case 40:this.handleControlShiftDownKey()}else switch(o){case 33:e.preventDefault(),this.documentHelper.viewerContainer.scrollTop-=this.documentHelper.visibleBounds.height;break;case 34:e.preventDefault(),this.documentHelper.viewerContainer.scrollTop+=this.documentHelper.visibleBounds.height;break;case 35:this.handleEndKey(),e.preventDefault();break;case 36:this.handleHomeKey(),e.preventDefault();break;case 37:this.handleLeftKey(),e.preventDefault();break;case 38:this.handleUpKey(),e.preventDefault();break;case 39:this.handleRightKey(),e.preventDefault();break;case 40:this.handleDownKey(),e.preventDefault()}else switch(o){case 35:this.handleShiftEndKey(),e.preventDefault();break;case 36:this.handleShiftHomeKey(),e.preventDefault();break;case 37:this.handleShiftLeftKey(),e.preventDefault();break;case 38:this.handleShiftUpKey(),e.preventDefault();break;case 39:this.handleShiftRightKey(),e.preventDefault();break;case 40:this.handleShiftDownKey(),e.preventDefault()}else switch(this.documentHelper.isControlPressed=!0,o){case 35:this.handleControlEndKey();break;case 36:this.handleControlHomeKey();break;case 37:this.handleControlLeftKey();break;case 38:this.handleControlUpKey();break;case 39:this.handleControlRightKey();break;case 40:this.handleControlDownKey();break;case 65:this.owner.selection.selectAll();break;case 67:e.preventDefault(),this.copy();break;case 70:e.preventDefault(),t.isNullOrUndefined(this.owner.optionsPaneModule)||this.owner.optionsPaneModule.showHideOptionsPane(!0)}if(this.isFormField()&&!this.documentHelper.isDocumentProtected){var s=this.getCurrentFormField(!0);if(s&&s.formFieldData instanceof We){s=37===e.keyCode||38===e.keyCode||40===e.keyCode?s:s.nextElement instanceof Ae?s.nextElement.reference:s.fieldEnd;var a=39===e.keyCode?1:0,l=s.line.getOffset(s,a),d=this.getPhysicalPositionInternal(s.line,l,!1);this.selectInternal(s.line,s,a,d)}}!this.owner.isReadOnlyMode||this.isInlineFormFillMode()?this.owner.editorModule.onKeyDownInternal(e,i,n,r):this.documentHelper.isDocumentProtected&&"FormFieldsOnly"===this.documentHelper.protectionType&&(9!==e.keyCode&&32!==e.keyCode||this.owner.editorModule.onKeyDownInternal(e,i,n,r)),this.owner.searchModule&&!t.isNullOrUndefined(this.owner.searchModule.searchHighlighters)&&this.owner.searchModule.searchHighlighters.length>0&&this.owner.searchModule.searchResults.clear(),27!==e.keyCode&&27!==e.which||(t.isNullOrUndefined(this.owner.optionsPaneModule)||this.owner.optionsPaneModule.showHideOptionsPane(!1),this.owner.enableHeaderAndFooter&&this.disableHeaderFooter())},e.prototype.checkAndEnableHeaderFooter=function(e,t){var i=this.documentHelper.currentPage;if(this.isCursorInsidePageRect(e,i)){if(this.isCursorInHeaderRegion(e,i))return!this.owner.enableHeaderAndFooter&&this.enableHeadersFootersRegion(i.headerWidget);if(this.isCursorInFooterRegion(e,i))return!this.owner.enableHeaderAndFooter&&this.enableHeadersFootersRegion(i.footerWidget)}return!!this.owner.enableHeaderAndFooter&&(this.owner.enableHeaderAndFooter=!1,this.documentHelper.updateTextPositionForSelection(t,1),!0)},e.prototype.isCursorInsidePageRect=function(e,t){return this.viewer.containerLeft+e.x>=t.boundingRectangle.x&&this.viewer.containerLeft+e.x<=t.boundingRectangle.x+t.boundingRectangle.width*this.documentHelper.zoomFactor&&this.viewer instanceof le||this.viewer.containerLeft+e.x>=t.boundingRectangle.x&&this.viewer.containerLeft+e.x<=t.boundingRectangle.x+t.boundingRectangle.width},e.prototype.isCursorInHeaderRegion=function(e,t){if(this.viewer instanceof le){var i=this.getPageTop(t),n=0,r=t.headerWidget;r&&(n=r.y+r.height);var o=r.isEmpty&&!this.owner.enableHeaderAndFooter,s=L.convertPointToPixel(t.bodyWidgets[0].sectionFormat.topMargin),a=L.convertPointToPixel(t.bodyWidgets[0].sectionFormat.pageHeight),l=o?s:Math.min(Math.max(n,s),a/100*40);if(l*=this.documentHelper.zoomFactor,this.viewer.containerTop+e.y>=i&&this.viewer.containerTop+e.y<=i+l)return!0}return!1},e.prototype.isCursorInFooterRegion=function(e,t){if(this.viewer instanceof le){var i=t.boundingRectangle,n=this.getPageTop(t),r=n+i.height*this.documentHelper.zoomFactor,o=L.convertPointToPixel(t.bodyWidgets[0].sectionFormat.footerDistance),s=0;t.footerWidget&&(s=t.footerWidget.height);var a=L.convertPointToPixel(t.bodyWidgets[0].sectionFormat.bottomMargin),l=t.footerWidget.isEmpty&&!this.owner.enableHeaderAndFooter,d=i.height;if(d=l?(d-a)*this.documentHelper.zoomFactor:(d-Math.min(i.height/100*40,Math.max(s+o,a)))*this.documentHelper.zoomFactor,this.viewer.containerTop+e.y<=r&&this.viewer.containerTop+e.y>=n+d)return!0}return!1},e.prototype.enableHeadersFootersRegion=function(e){return this.viewer instanceof le&&(this.owner.enableHeaderAndFooter=!0,this.updateTextPositionForBlockContainer(e),this.shiftBlockOnHeaderFooterEnableDisable(),!0)},e.prototype.shiftBlockOnHeaderFooterEnableDisable=function(){for(var e=0;e<this.documentHelper.headersFooters.length;e++)for(var t=this.documentHelper.headersFooters[e],i=this.getBodyWidgetInternal(e,0).sectionFormat,n=0,r=Object.keys(t);n<r.length;n++){var o=t[r[n]];o.isEmpty&&this.owner.editor.shiftPageContent(o.headerFooterType,i)}},e.prototype.updateTextPositionForBlockContainer=function(e){var t=e.firstChild;t instanceof xe&&(t=this.getFirstBlockInFirstCell(t))instanceof xe&&(t=this.getFirstBlockInFirstCell(t)),this.selectParagraphInternal(t,!0)},e.prototype.disableHeaderFooter=function(){var e=this.getPage(this.start.paragraph);this.updateTextPositionForBlockContainer(e.bodyWidgets[0]),this.owner.enableHeaderAndFooter=!1,this.shiftBlockOnHeaderFooterEnableDisable()},e.prototype.destroy=function(){t.isNullOrUndefined(this.contextTypeInternal)||(this.contextTypeInternal=void 0),this.pasteDropDwn&&(this.pasteDropDwn.destroy(),this.pasteDropDwn=void 0),this.caret=void 0,this.contextTypeInternal=void 0,this.upDownSelectionLength=void 0,this.owner=void 0},e.prototype.navigateBookmark=function(e,t){var i=this.documentHelper.bookmarks;if(i.containsKey(e)){var n=i.get(e),r=n.line.getOffset(n,0),o=new kt(this.owner);if(o.setPositionParagraph(n.line,r),t)this.documentHelper.selection.selectRange(o,o);else{var s=n.reference,a=s.line.getOffset(s,1),l=new kt(this.owner);l.setPositionParagraph(s.line,a),this.documentHelper.selection.selectRange(o,l)}}},e.prototype.selectBookmark=function(e){this.navigateBookmark(e)},e.prototype.getTocField=function(){for(var e=this.start.paragraph,t=void 0;void 0!==e&&this.isTocStyle(e);)t=e,e=e.previousRenderedWidget;if(void 0!==t){var i=t.childWidgets[0];if(void 0!==i)return i.children[0]}},e.prototype.isTocStyle=function(e){var t=e.paragraphFormat.baseStyle;return void 0!==t&&-1!==t.name.toLowerCase().indexOf("toc")},e.prototype.isTOC=function(){for(var e=this.getParagraphInfo(this.start).paragraph,t=0;t<e.childWidgets[0].children.length;t++){var i=e.childWidgets[0].children[t];if(i instanceof Ie){var n=this.owner.selection.getFieldCode(i);if(n.match("TOC ")||n.match("Toc"))return!0}}return!1},e.prototype.getElementsForward=function(e,i,n,r){if(!t.isNullOrUndefined(i)){for(var o=[];r&&i&&i!==n&&i.nextElement&&!i.isRightToLeft;)i=i.nextElement;for(;r&&n&&i!==n&&n.previousElement&&!n.isRightToLeft;)n=n.previousElement;for(var s=e.children.indexOf(i);s>=0;){for(var a=s;a>-1&&a<e.children.length;r?a--:a++){var l=e.children[a];if(l.line!==e){s=-1;break}if(l===n){o.push(l),s=-1;break}o.push(l)}s=-1}return 0===o.length?void 0:o}},e.prototype.getElementsBackward=function(e,t,i,n){for(var r=[];n&&t&&t.previousElement&&(!t.isRightToLeft||t instanceof Oe&&this.documentHelper.textHelper.isRTLText(t.text));)t=t.previousElement;for(var o=e.children.indexOf(t);o>=0;){for(var s=o;s>-1&&s<e.children.length;n?s++:s--){var a=e.children[s];if(a.line!==e){o=-1;break}r.push(a)}o=-1}return r},e.prototype.navigatePreviousComment=function(){this.commentNavigateInternal(!1)},e.prototype.navigateNextComment=function(){this.commentNavigateInternal(!0)},e.prototype.commentNavigateInternal=function(e){if(!this.documentHelper.currentSelectedComment){if(0===this.documentHelper.comments.length)return;this.documentHelper.currentSelectedComment=this.documentHelper.comments[0]}if(this.documentHelper.currentSelectedComment){var t=this.documentHelper.comments,i=this.documentHelper.currentSelectedComment,n=t.indexOf(i);i=e?n===t.length-1?t[0]:t[n+1]:0===n?t[t.length-1]:t[n-1],this.documentHelper.currentSelectedComment=i,this.selectComment(i)}},e.prototype.navigatePreviousRevision=function(){this.revisionNavigateInternal(!1)},e.prototype.navigateNextRevision=function(){this.revisionNavigateInternal(!0)},e.prototype.revisionNavigateInternal=function(e){if(!this.documentHelper.currentSelectedRevisionInternal){if(0===this.documentHelper.owner.revisions.length)return;this.documentHelper.currentSelectedRevision=this.documentHelper.owner.revisions.get(0)}if(this.documentHelper.currentSelectedRevision){var t=this.documentHelper.owner.revisions.changes,i=this.documentHelper.currentSelectedRevision,n=t.indexOf(i);i=e?n===t.length-1?t[0]:t[n+1]:0===n?t[t.length-1]:t[n-1],this.documentHelper.currentSelectedRevision=i,this.selectRevision(i)}this.owner.trackChangesPane.currentSelectedRevision=this.documentHelper.currentSelectedRevision},e.prototype.selectComment=function(e){if(!t.isNullOrUndefined(e)){var i=this.getElementPosition(e.commentStart).startPosition,n=this.getElementPosition(e.commentEnd).startPosition;this.selectPosition(i,n),this.owner.commentReviewPane&&this.owner.commentReviewPane.selectComment(e)}},e.prototype.selectRevision=function(e){if(!t.isNullOrUndefined(e)&&e.range.length>0){var i=e.range[0],n=e.range[e.range.length-1];if(i instanceof H){var r=i.ownerBase,o=r.childWidgets[0],s=r.childWidgets[r.childWidgets.length-1],a=this.getFirstParagraph(o),l=this.getLastParagraph(s);this.start.setPosition(a.firstChild,!0),this.end.setPositionParagraph(l.lastChild,l.lastChild.getEndOffset()+1),this.selectPosition(this.start,this.end)}else if(i&&n){var d=new kt(this.owner),h=0;i instanceof k?(h=(p=i.ownerBase).getLength(),d.setPositionParagraph(p.lastChild,h)):(h=i.line.getOffset(i,0),d.setPositionForLineWidget(i.line,h));var c=new kt(this.owner);if(n instanceof k){var p=n.ownerBase;p.isEndsWithPageBreak?(this.owner.trackChangesPane.isTrackingPageBreak=!0,c.setPositionParagraph(p.nextRenderedWidget.childWidgets[0],0)):(h=p.getLength(),c.setPositionParagraph(p.lastChild,h+1))}else h=n.line.getOffset(n,0)+n.length,this.isTOC()&&(h+=1),c.setPositionForLineWidget(n.line,h);var g=d.clone();d.isExistBefore(c)||(d=c,c=g),this.selectPosition(d,c)}}},e.prototype.updateEditRangeCollection=function(){this.editRangeCollection.length>0&&(this.editRangeCollection=[]);var e,t;if(this.documentHelper.isDocumentProtected){if(this.documentHelper.editRanges.containsKey(this.owner.currentUser)){e=this.documentHelper.editRanges.get(this.owner.currentUser);for(r=0;r<e.length;r++)this.editRangeCollection.push(e[r])}if(this.documentHelper.editRanges.containsKey("Everyone")){n="Everyone";t=this.documentHelper.editRanges.get(n);for(r=0;r<t.length;r++)this.editRangeCollection.push(t[r])}}else for(var i=0;i<this.documentHelper.editRanges.length;i++){var n=this.documentHelper.editRanges.keys[i];e=this.documentHelper.editRanges.get(n);for(var r=0;r<e.length;r++)this.editRangeCollection.push(e[r])}},e.prototype.onHighlight=function(){this.isHighlightEditRegion?this.highlightEditRegion():this.unHighlightEditRegion(),this.viewer.renderVisiblePages()},e.prototype.highlightEditRegion=function(){if(this.updateEditRangeCollection(),!this.owner.enableLockAndEdit){if(!this.isHighlightEditRegion)return void this.unHighlightEditRegion();this.isHightlightEditRegionInternal=!0,t.isNullOrUndefined(this.editRegionHighlighters)&&(this.editRegionHighlighters=new u),this.editRegionHighlighters.clear();for(var e=0;e<this.editRangeCollection.length;e++)this.highlightEditRegionInternal(this.editRangeCollection[e]);this.isHightlightEditRegionInternal=!1,this.viewer.updateScrollBars()}},e.prototype.highlightFormFields=function(){t.isNullOrUndefined(this.formFieldHighlighters)&&(this.formFieldHighlighters=new u),this.formFieldHighlighters.clear();var e=this.documentHelper.formFields;if(!t.isNullOrUndefined(e)&&e.length>0){for(var i=0;i<e.length;i++){var n=e[i];if(L.isLinkedFieldCharacter(n)){var r=n.line.getOffset(n,0),o=new kt(this.owner);o.setPositionParagraph(n.line,r);var s=n.fieldEnd;r=s.line.getOffset(s,1);var a=new kt(this.owner);a.setPositionParagraph(s.line,r),this.isHighlightFormFields=!0,this.highlight(o.paragraph,o,a),this.isHighlightNext&&(this.highlightNextBlock(this.hightLightNextParagraph,o,a),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0)}}this.isHighlightFormFields=!1,this.viewer.updateScrollBars()}},e.prototype.unHighlightEditRegion=function(){t.isNullOrUndefined(this.editRegionHighlighters)||(this.editRegionHighlighters.clear(),this.editRegionHighlighters=void 0),this.isHightlightEditRegionInternal=!1},e.prototype.highlightEditRegionInternal=function(e){var t=this.getPosition(e),i=t.startPosition,n=t.endPosition;this.isCurrentUser=!0,this.highlightEditRegions(e,i,n),this.isCurrentUser=!1},e.prototype.showAllEditingRegion=function(){0===this.editRangeCollection.length&&this.updateEditRangeCollection(),this.documentHelper.clearSelectionHighlight();for(var e=0;e<this.editRangeCollection.length;e++){var t=this.editRangeCollection[e],i=this.getPosition(t),n=i.startPosition,r=i.endPosition;this.highlightEditRegions(t,n,r)}},e.prototype.highlightEditRegions=function(e,t,i){if(!e.line.paragraph.isInsideTable||e.line.paragraph.isInsideTable&&!e.editRangeEnd.line.paragraph.isInsideTable)this.highlight(e.line.paragraph,t,i),this.isHighlightNext&&(this.highlightNextBlock(this.hightLightNextParagraph,t,i),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0);else{var n=e.line.paragraph.associatedCell.ownerRow.childWidgets[e.columnFirst];if(n)for(var r=0;r<n.childWidgets.length;r++)n.childWidgets[r]instanceof we&&(this.highlight(n.childWidgets[r],t,i),this.isHighlightNext&&(this.highlightNextBlock(this.hightLightNextParagraph,t,i),this.isHighlightNext=!1,this.hightLightNextParagraph=void 0))}},e.prototype.navigateToNextEditingRegion=function(){for(var e=this.getEditRangeStartElement(),t=this.editRangeCollection.length-1;t>=0;t--)for(var i=1;i<=t;i++){var n=this.getPosition(this.editRangeCollection[i-1]).startPosition,r=this.getPosition(this.editRangeCollection[i]).startPosition;if(n.isExistAfter(r)){var o=this.editRangeCollection[i-1];this.editRangeCollection[i-1]=this.editRangeCollection[i],this.editRangeCollection[i]=o}}var s=this.editRangeCollection.indexOf(e),a=s<this.editRangeCollection.length-1?this.editRangeCollection[s+1]:this.editRangeCollection[0],l=this.getPosition(a),d=l.startPosition,h=l.endPosition;this.selectRange(d,h)},e.prototype.toggleEditingRegionHighlight=function(){this.isHighlightEditRegion=!this.isHighlightEditRegion},e.prototype.getEditRangeStartElement=function(){for(var e=0;e<this.editRangeCollection.length;e++){var t=this.editRangeCollection[e],i=this.getPosition(t),n=i.startPosition,r=i.endPosition;if((this.start.isExistAfter(n)||this.start.isAtSamePosition(n))&&(this.end.isExistBefore(r)||this.end.isAtSamePosition(r)))return t}},e.prototype.isSelectionInEditRegion=function(){return!!this.documentHelper.isDocumentProtected&&this.checkSelectionIsAtEditRegion()},e.prototype.checkSelectionIsAtEditRegion=function(e,i){for(var n=0;n<this.editRangeCollection.length;n++){var r=this.editRangeCollection[n],o=this.getPosition(r),s=o.startPosition,a=o.endPosition;if(t.isNullOrUndefined(e)&&t.isNullOrUndefined(i)&&(e=this.start,i=this.end,this.isForward||(e=this.end,i=this.start)),(e.isExistAfter(s)||e.isAtSamePosition(s))&&(i.isExistBefore(a)||i.isAtSamePosition(a)))return!0}return!1},e.prototype.getPosition=function(e){var t=e.line.getOffset(e,1),i=new kt(this.owner);i.setPositionParagraph(e.line,t);var n;e instanceof et?n=e.editRangeEnd:e instanceof Me?n=e.reference:e instanceof Ae?n=e.reference:e instanceof vt&&(n=e.comment.commentEnd),t=n.line.getOffset(n,1);var r=new kt(this.owner);return r.setPositionParagraph(n.line,t),{startPosition:i,endPosition:r}},e.prototype.checkContentControlLocked=function(e){this.owner.editorModule.isXmlMapped=!1;for(var i=0;i<this.documentHelper.contentControlCollection.length;i++){var n=this.documentHelper.contentControlCollection[i],r=this.getPosition(n),o=r.startPosition,s=r.endPosition,a=this.start,l=this.end;if(this.isForward||(a=this.end,l=this.start),t.isNullOrUndefined(e)){var d=(o.isExistAfter(a)||o.isAtSamePosition(a))&&(o.isExistBefore(l)||o.isAtSamePosition(l)),h=(s.isExistAfter(a)||s.isAtSamePosition(a))&&(s.isExistBefore(l)||s.isAtSamePosition(l));if(d&&h)return!!n.contentControlProperties.lockContentControl&&(this.owner.trigger("contentControl"),!0);if((d||h)&&!o.isAtSamePosition(a)&&!s.isAtSamePosition(a))return!0}if((a.isExistAfter(o)||a.isAtSamePosition(o))&&(l.isExistBefore(s)||l.isAtSamePosition(s))){if(n.contentControlProperties.xmlMapping&&n.contentControlProperties.xmlMapping.isMapped&&(this.owner.editorModule.isXmlMapped=!0),n.contentControlProperties.lockContents)return this.owner.trigger("contentControl"),!0;if(t.isNullOrUndefined(e)&&("CheckBox"===n.contentControlProperties.type||"ComboBox"===n.contentControlProperties.type||"DropDownList"===n.contentControlProperties.type||"Date"===n.contentControlProperties.type))return this.owner.trigger("contentControl"),!0}}return!1},e.prototype.getElementPosition=function(e,t){var i=e.line.getOffset(e,t?0:1),n=new kt(this.owner);return n.setPositionParagraph(e.line,i),{startPosition:n,endPosition:void 0}},e.prototype.updateRefField=function(e){if(t.isNullOrUndefined(e)&&(e=this.getHyperlinkField(!0)),!t.isNullOrUndefined(e)){if(!this.isReferenceField(e))return;var i=this.getFieldCode(e).replace(/\s+/g," ");if(0===(i=i.trim()).toLowerCase().indexOf("ref")){var n=i.split(" ");if(n.length>1){var r=n[1];if(this.documentHelper.bookmarks.containsKey(r)){var o=this.start,s=this.end;this.isForward||(o=this.end,s=this.start);var a=this.documentHelper.bookmarks.get(r),l=a.reference,d=a.previousNode;!t.isNullOrUndefined(d)&&d instanceof Ie||!(l.previousNode instanceof Ie)||1!==l.previousNode.fieldType||t.isNullOrUndefined(l.previousNode.fieldBegin)||t.isNullOrUndefined(l.previousNode.fieldBegin.formFieldData)?d instanceof Ie&&0===d.fieldType&&!t.isNullOrUndefined(d.formFieldData)&&(a=d.fieldSeparator,l=d.fieldEnd):(a=l.previousNode.fieldBegin.fieldSeparator,l=l.previousNode.fieldBegin.fieldEnd);var h=a.line.getOffset(a,1);o.setPositionParagraph(a.line,h),s.setPositionParagraph(l.line,l.line.getOffset(l,0));var c=this.owner.sfdtExportModule.write(o.currentWidget,o.offset,s.currentWidget,s.offset,!1,!0),p=e.fieldSeparator,g=e.fieldEnd;o.setPositionParagraph(p.line,p.line.getOffset(p,1)),s.setPositionParagraph(g.line,g.line.getOffset(g,0)),this.owner.editor.pasteContents(c)}}}}},e.prototype.footnoteReferenceElement=function(e,i,n){var r=0;if(this.getContainerWidget(e.paragraph)instanceof be)for(var o=this.start.paragraph.footNoteReference,s=0;s<this.documentHelper.pages.length;s++){r=0;for(var a=this.documentHelper.pages[s],l=0;l<a.bodyWidgets.length;l++)for(var d=a.bodyWidgets[l],h=0;h<d.childWidgets.length;h++)for(var c=d.childWidgets[h],p=0;p<c.childWidgets.length;p++){var g=c.childWidgets[p];if(r=0,!t.isNullOrUndefined(g.children))for(var u=0;u<g.children.length;u++){var m=g.children[u];r+=m.length,m instanceof Le&&m===o&&(e.setPositionParagraph(g,r-1),i.setPositionParagraph(g,r),this.selectRange(e,i))}}}},e}(),At=function(){function e(e){this.wordBefore="\\b",this.wordAfter="\\b",this.isHeader=!1,this.isFooter=!1,this.owner=e,this.documentHelper=this.owner.documentHelper}return e.prototype.find=function(e,t){return this.findNext(e,t,"0;0;0")},e.prototype.findNext=function(e,t,i){"string"==typeof e&&(e=this.stringToRegex(e,t)),void 0===i&&(i="0;0;0"),this.owner.searchModule.textSearchResults.clearResults();var n=this.owner.searchModule.textSearchResults;return this.findDocument(n,e,!0,t,i),n.length,n.currentSearchResult},e.prototype.stringToRegex=function(e,t){if(e.indexOf("\\")>-1&&(e=e.split("\\").join("\\\\")),e.indexOf("(")>-1||e.indexOf(")")>-1||e.indexOf(".")>-1||e.indexOf("[")>-1||e.indexOf("]")>-1||e.indexOf("$")>-1||e.indexOf("{")>-1||e.indexOf("}")>-1||e.indexOf("*")>-1||e.indexOf("|")>-1||e.indexOf("^")>-1||e.indexOf("?")>-1){for(var i="",n=0;n<e.length;n++)"("===e[n]||")"===e[n]||"."===e[n]||"["===e[n]||"]"===e[n]||"$"===e[n]||"{"===e[n]||"}"===e[n]||"*"===e[n]||"|"===e[n]||"^"===e[n]||"?"===e[n]?i+="\\"+e[n]:i+=e[n];e=i}return"WholeWord"!==t&&"CaseSensitiveWholeWord"!==t||(e=this.wordBefore+e+this.wordAfter),new RegExp(e,"CaseSensitive"===t||"CaseSensitiveWholeWord"===t?"g":"ig")},e.prototype.isPatternEmpty=function(e){var t=this.wordBefore+this.wordAfter,i=e.toString();return 0===i.length||i===t},e.prototype.findAll=function(e,i,n){"string"==typeof e&&(e=this.stringToRegex(e,i)),void 0===n&&(n="0;0;0"),this.owner.searchModule.textSearchResults.clearResults();var r=this.owner.searchModule.textSearchResults;if(this.findDocument(r,e,!1,i,n),r.length>0&&r.currentIndex<0&&(r.currentIndex=0),!t.isNullOrUndefined(r.currentSearchResult)){var o={source:this.documentHelper.owner};return this.documentHelper.owner.trigger("searchResultsChange",o),r}},e.prototype.getElementInfo=function(e,i,n){for(var r=e,o="",s=new u;;){if(e instanceof Oe&&!t.isNullOrUndefined(e.text)&&""!==e.text)s.add(e,o.length),o+=e===r?e.text.substring(i):e.text;else if(e instanceof Ie){var a=e;t.isNullOrUndefined(a.fieldEnd)||(e=t.isNullOrUndefined(a.fieldSeparator)?a.fieldEnd:a.fieldSeparator)}if(!t.isNullOrUndefined(e)&&t.isNullOrUndefined(e.nextNode))break;if(!t.isNullOrUndefined(e))if(t.isNullOrUndefined(n)||n)e=e.nextNode;else{var l=e.line.children,d=e.line.children.length;if(!(l.indexOf(e)<d-1)){e=void 0;break}e=e.nextNode}}return{elementsWithOffset:s,fullText:o.toString()}},e.prototype.updateMatchedTextLocation=function(e,i,n,r,o,s,a,l){for(var d=0;d<e.length;d++){var h=e[d],c=void 0;if(t.isNullOrUndefined(l)||!(h.index<l)){for(var p=i.addResult(),g=n.keys,u=0;u<g.length;u++){var m=g[u],f=n.get(m),v=m.length;if(m===o&&(v-=r),t.isNullOrUndefined(p.start)&&h.index<f+v){y=h.index-f;m===o&&(y+=r);b=m.line.getOffset(m,y);p.start=this.getTextPosition(m.line,b.toString()),p.start.location=this.owner.selection.getPhysicalPositionInternal(m.line,b,!0),p.start.setPositionParagraph(m.line,b)}if(h.index+h[0].length<=f+v){var y=h.index+h[0].length-f;m===o&&(y+=r);var b=m.line.getOffset(m,y);p.end=this.getTextPosition(m.line,b.toString()),p.end.location=this.owner.selection.getPhysicalPositionInternal(m.line,b,!0),p.end.setPositionParagraph(m.line,b),c=!0;break}}if(p.isHeader=this.isHeader,p.isFooter=this.isFooter,s){i.currentIndex=0;break}if(i.currentIndex<0&&!t.isNullOrUndefined(a)&&(a.isExistBefore(p.start)||a.isAtSamePosition(p.start))&&(i.currentIndex=i.indexOf(p)),!t.isNullOrUndefined(l)&&c)break}}},e.prototype.findDocument=function(e,i,n,r,o){if(!this.isPatternEmpty(i)){void 0===r&&(r="None");var s=void 0,a=void 0;if(void 0!==o&&(a=this.owner.selection.end),void 0!==o&&n&&void 0!==a&&void 0!==a.paragraph&&a.paragraph instanceof we){var l=0,d=a.currentWidget.getInline(this.owner.selection.start.offset,l);if(s=d.element,l=d.index,!t.isNullOrUndefined(s)){var h=void 0;for(h=this.findInline(s,i,r,l,n,e,a);0===e.length&&!t.isNullOrUndefined(h);){for(;!t.isNullOrUndefined(h)&&0===h.childWidgets.length;)h=this.owner.selection.getNextParagraph(h.containerWidget);if(t.isNullOrUndefined(h))break;var c=h.childWidgets[0];if(s=c.children[0]instanceof Qe?c.children[2]instanceof Oe?c.children[2]:void 0:c.children[0],t.isNullOrUndefined(s))break;h=this.findInline(s,i,r,0,n,e,a)}if(e.length>0)return}}var p;for(p=this.documentHelper.pages[0].bodyWidgets[0];!t.isNullOrUndefined(p)&&0===p.childWidgets.length;)p=p.nextWidget;if(!t.isNullOrUndefined(p)&&0!==p.childWidgets.length){this.isHeader=!1,this.isFooter=!1,this.findInlineText(p,i,r,n,e,a);for(u=0;u<this.documentHelper.pages.length;u++){var g=this.documentHelper.pages[u].headerWidget;t.isNullOrUndefined(g)||(this.isHeader=!0,this.isFooter=!1,this.findInlineText(g,i,r,n,e,a))}for(var u=0;u<this.documentHelper.pages.length;u++){var m=this.documentHelper.pages[u].footerWidget;t.isNullOrUndefined(m)||(this.isHeader=!1,this.isFooter=!0,this.findInlineText(m,i,r,n,e,a))}n&&!t.isNullOrUndefined(e)&&e.length}}},e.prototype.findInlineText=function(e,i,n,r,o,s){for(var a=this.owner.selection.getFirstParagraphBlock(e.childWidgets[0]);!t.isNullOrUndefined(a)&&1===a.childWidgets.length&&0===a.childWidgets[0].children.length;)a=this.owner.selection.getNextParagraphBlock(a);for(;!t.isNullOrUndefined(a)&&a.childWidgets.length>0;){var l=a.childWidgets[0].children[0];if(t.isNullOrUndefined(l))break;for(this.findInline(l,i,n,0,r,o,s),a=this.owner.selection.getNextParagraphBlock(a);!t.isNullOrUndefined(a)&&1===a.childWidgets.length&&0===a.childWidgets[0].children.length;)a=this.owner.selection.getNextParagraphBlock(a)}r&&!t.isNullOrUndefined(o)&&o.length},e.prototype.findInline=function(e,i,n,r,o,s,a){for(var l,d=e,h=this.getElementInfo(e,r),c=h.fullText,p=[],g=h.elementsWithOffset;!t.isNullOrUndefined(l=i.exec(c));)p.push(l);if(this.updateMatchedTextLocation(p,s,g,r,d,o,a),!o)return this.owner.selection.getNextParagraphBlock(e.line.paragraph)},e.prototype.getTextPosition=function(e,t){var i=new kt(this.owner),n=i.getHierarchicalIndex(e,t);return i.setPositionForCurrentIndex(n),i},e}(),Mt=function(){function e(e,t){this.leftInternal=0,this.widthInternal=0,this.leftInternal=e,this.widthInternal=t}return Object.defineProperty(e.prototype,"left",{get:function(){return this.leftInternal},set:function(e){this.leftInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.widthInternal},set:function(e){this.widthInternal=e},enumerable:!0,configurable:!0}),e}(),Ut=function(){function e(e){this.startIn=void 0,this.endIn=void 0,this.owner=e,this.documentHelper=this.owner.documentHelper}return Object.defineProperty(e.prototype,"start",{get:function(){return this.startIn},set:function(e){this.startIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.endIn},set:function(e){this.endIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.documentHelper.selection.getTextInternal(this.start,this.end,!1)},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.start=void 0,this.end=void 0},e}(),zt=function(){function e(e){this.currentIndex=-1,this.owner=e}return Object.defineProperty(e.prototype,"length",{get:function(){return void 0===this.innerList?0:this.innerList.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentSearchResult",{get:function(){if(!(void 0===this.innerList||this.currentIndex<0||this.currentIndex>=this.length))return this.innerList[this.currentIndex]},enumerable:!0,configurable:!0}),e.prototype.addResult=function(){var e=new Ut(this.owner);return t.isNullOrUndefined(this.innerList)&&(this.innerList=[]),this.innerList.push(e),e},e.prototype.clearResults=function(){if(this.currentIndex=-1,!t.isNullOrUndefined(this.innerList))for(var e=this.innerList.length-1;e>=0;e--)this.innerList[e].destroy(),this.innerList.splice(e,1)},e.prototype.indexOf=function(e){return t.isNullOrUndefined(this.innerList)?-1:this.innerList.indexOf(e)},e.prototype.destroy=function(){t.isNullOrUndefined(this.innerList)||this.clearResults(),this.innerList=void 0},e}(),Vt=function(){function e(e){this.searchModule=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this.searchModule.textSearchResults.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"index",{get:function(){return this.searchModule.textSearchResults.currentIndex},set:function(e){0===this.length||e<0||e>this.searchModule.textSearchResults.length-1||(this.searchModule.textSearchResults.currentIndex=e,this.navigate())},enumerable:!0,configurable:!0}),e.prototype.getTextSearchResultsOffset=function(){for(var e,t=[],i=0;i<this.searchModule.textSearchResults.innerList.length;i++)e=this.getOffset(this.searchModule.textSearchResults.innerList[i]),t.push(e);return t},e.prototype.getOffset=function(e){var t=e.start,i=e.end,n=this.searchModule.documentHelper.owner.selection.getParagraphInfo(t),r=this.searchModule.documentHelper.owner.selection.getHierarchicalIndex(n.paragraph,n.offset.toString());return n=this.searchModule.documentHelper.owner.selection.getParagraphInfo(i),{startOffset:r,endOffset:this.searchModule.documentHelper.owner.selection.getHierarchicalIndex(n.paragraph,n.offset.toString())}},e.prototype.getModuleName=function(){return"SearchResults"},e.prototype.replace=function(e){-1!==this.index&&this.searchModule.replaceInternal(e)},e.prototype.replaceAll=function(e){-1!==this.index&&this.searchModule.replaceAllInternal(e)},e.prototype.navigate=function(){this.searchModule.navigate(this.searchModule.textSearchResults.currentSearchResult),this.searchModule.highlight(this.searchModule.textSearchResults)},e.prototype.clear=function(){this.searchModule.textSearchResults.clearResults(),this.searchModule.clearSearchHighlight(),this.searchModule.viewer.renderVisiblePages()},e}(),_t=function(){function e(e){this.searchHighlighters=void 0,this.isHandledOddPageHeader=void 0,this.isHandledEvenPageHeader=void 0,this.isHandledOddPageFooter=void 0,this.isHandledEvenPageFooter=void 0,this.owner=e,this.searchHighlighters=new u,this.textSearch=new At(this.owner),this.textSearchResults=new zt(this.owner),this.searchResultsInternal=new Vt(this)}return Object.defineProperty(e.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"searchResults",{get:function(){return this.searchResultsInternal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"Search"},e.prototype.find=function(e,i){t.isNullOrUndefined(i)&&(i="None");var n=this.textSearch.find(e,i);t.isNullOrUndefined(n)||this.navigate(n)},e.prototype.findAll=function(e,i){if(!t.isNullOrUndefined(e||""===e)){t.isNullOrUndefined(i)&&(i="None");var n=this.textSearch.findAll(e,i);!t.isNullOrUndefined(n)&&n.length>0&&(this.navigate(n.innerList[n.currentIndex]),this.highlight(n))}},e.prototype.replace=function(e,i,n){if(t.isNullOrUndefined(this.viewer.owner)||this.viewer.owner.isReadOnlyMode||t.isNullOrUndefined(n))return 0;t.isNullOrUndefined(this.viewer)||this.clearSearchHighlight(),this.navigate(i);var r=this.documentHelper.selection.start;if(this.owner.enableTrackChanges&&this.documentHelper.selection.start.currentWidget){this.documentHelper.selection.end.currentWidget.getInline(this.owner.selection.start.offset,0).element.revisions.length>0&&(this.isRepalceTracking=!0)}if(n.indexOf(i)<0)return 0;this.owner.editorModule.insertTextInternal(e,!0);var o=i.end,s=new kt(this.viewer.owner);s.setPositionParagraph(o.currentWidget,r.offset-e.length),this.documentHelper.selection.selectRange(r,s);var a={source:this.viewer.owner};return this.viewer.owner.trigger("searchResultsChange",a),1},e.prototype.replaceInternal=function(e,i){if(""!==e&&!t.isNullOrUndefined(e)){t.isNullOrUndefined(i)&&(i="None");var n=this.textSearchResults.currentSearchResult.text,r=this.viewer.owner.searchModule.textSearch.stringToRegex(n,i),o=this.owner.selection.end.getHierarchicalIndexInternal(),s=this.viewer.owner.searchModule.textSearch.findNext(r,i,o);t.isNullOrUndefined(s)||(this.navigate(s),this.textSearchResults.addResult(),this.textSearchResults.innerList[0]=s,this.replace(e,s,this.textSearchResults),o=this.owner.selection.end.getHierarchicalIndexInternal(),(s=this.textSearch.findNext(n,i,o))&&(this.textSearchResults.addResult(),this.textSearchResults.innerList[0]=s,this.navigate(s)))}},e.prototype.replaceAll=function(e,i){if(t.isNullOrUndefined(this.viewer.owner)||this.viewer.owner.isReadOnlyMode||t.isNullOrUndefined(i))return 0;this.owner.editorHistory&&this.owner.editorHistory.initComplexHistory(this.owner.selection,"ReplaceAll");var n=i.length;this.viewer.owner.isLayoutEnabled=!1;for(var r=n-1;r>=0;r--){var o=i.innerList[r];this.navigate(i.innerList[r]),this.owner.editorModule.insertTextInternal(e,!0),(o.isHeader||o.isFooter)&&this.documentHelper.layout.updateHeaderFooterToParent(this.documentHelper.selection.start.paragraph.bodyWidget),i.innerList[r].destroy()}return this.owner.editorHistory&&!t.isNullOrUndefined(this.owner.editorHistory.currentHistoryInfo)?this.owner.editorHistory.updateComplexHistory():this.owner.editorModule.updateComplexWithoutHistory(2),this.searchResults.clear(),n},e.prototype.replaceAllInternal=function(e,i){t.isNullOrUndefined(e)||(t.isNullOrUndefined(i)&&(i="None"),this.textSearchResults.length>0&&(this.navigate(this.textSearchResults.innerList[this.textSearchResults.currentIndex]),this.highlight(this.textSearchResults),this.replaceAll(e,this.textSearchResults)))},e.prototype.navigate=function(e){if(e){var i=e.start,n=e.end;t.isNullOrUndefined(this.owner)||t.isNullOrUndefined(this.owner.selection)||t.isNullOrUndefined(i)||t.isNullOrUndefined(n)||t.isNullOrUndefined(i.paragraph)||t.isNullOrUndefined(n.paragraph)||this.owner.selection.selectRange(i,n)}},e.prototype.highlight=function(e){this.searchHighlighters=new u;for(var t=0;t<e.innerList.length;t++){var i=e.innerList[t];this.highlightResult(i)}this.viewer.renderVisiblePages()},e.prototype.highlightResult=function(e){this.highlightSearchResult(e.start.paragraph,e.start,e.end)},e.prototype.highlightSearchResult=function(e,i,n){var r=0,o=0,s=null,a=null,l=this.documentHelper.selection.getStartLineWidget(e,i,s,r);r=l.index;var d=(s=l.element)?s.line:e.childWidgets[0],h=this.documentHelper.selection.getEndLineWidget(n,a,o);o=h.index;var c=(a=h.element)?a.line:n.paragraph.childWidgets[n.paragraph.childWidgets.length-1],p=this.documentHelper.selection.getTop(d),g=this.documentHelper.selection.getLeftInternal(d,s,r);if(t.isNullOrUndefined(d)||d!==c){if(!t.isNullOrUndefined(d)){e!==d.paragraph&&(e=d.paragraph);x=this.documentHelper.selection.getWidth(d,!0)-(g-d.paragraph.x);if(e.bidi||s instanceof Oe&&s.isRightToLeft){var u=0,m=this.documentHelper.selection.getElementsForward(d,s,a,e.bidi);if(m)for(var f=!1,v=0;v<m.length;v++){var y=m[v],b=y instanceof Oe?y.length:1;u=this.documentHelper.selection.getLeftInternal(d,y,b),f=!1,g=y===s?this.documentHelper.selection.getLeftInternal(d,y,r):this.documentHelper.selection.getLeftInternal(d,y,0),y instanceof Oe&&(f=y.isRightToLeft),x=Math.abs(u-g),this.createHighlightBorder(d,x,f?u:g,p)}}else this.createHighlightBorder(d,x,g,p);for(var w=d.paragraph.childWidgets.indexOf(d),v=0;v<e.childWidgets.length;v++){if(e===d.paragraph&&(w+=1),this.highlightSearchResultParaWidget(e,w,c,a,o),e===c.paragraph)return;w=0}}}else{var u=this.documentHelper.selection.getLeftInternal(c,a,o),C=!1;a instanceof Oe&&(C=a.isRightToLeft);var x=0;if(x=Math.abs(u-g),!C&&s instanceof Oe&&(C=s.isRightToLeft),C||e.bidi){var F=this.documentHelper.selection.getElementsForward(d,s,a,e.bidi);if(F&&F.length>1)for(v=0;v<F.length;v++){var f=!1,b=(y=F[v])instanceof Oe?y.length:1;y===s?(g=this.documentHelper.selection.getLeftInternal(d,y,r),u=this.documentHelper.selection.getLeftInternal(d,y,b)):y===a?(g=this.documentHelper.selection.getLeftInternal(d,y,0),u=this.documentHelper.selection.getLeftInternal(d,y,o)):(g=this.documentHelper.selection.getLeftInternal(d,y,0),u=this.documentHelper.selection.getLeftInternal(d,y,b)),y instanceof Oe&&(f=y.isRightToLeft),x=Math.abs(u-g),this.createHighlightBorder(d,x,f?u:g,p)}else this.createHighlightBorder(d,x,C?u:g,p)}else this.createHighlightBorder(d,x,g,p)}},e.prototype.createHighlightBorder=function(e,t,i,n){var r=this.addSearchHighlightBorder(e),o=this.viewer.owner.selection.getPage(e.paragraph);o.boundingRectangle.y,o.boundingRectangle.x;r.left=Math.ceil(i),n=Math.ceil(n),r.width=Math.floor(t);Math.floor(e.height),this.documentHelper.containerContext},e.prototype.addSearchHighlightBorder=function(e){var t=void 0,i=this.searchHighlighters;i.containsKey(e)?t=i.get(e):(t=[],i.add(e,t));var n=new Mt(0,0);return t.push(n),n},e.prototype.highlightSearchResultParaWidget=function(e,t,i,n,r){for(var o=0,s=0,a=!1,l=t;l<e.childWidgets.length;l++){var d=e.childWidgets[l];l===t&&(o=this.documentHelper.selection.getTop(d));var h=this.documentHelper.selection.getLeft(d);if(n instanceof Oe&&(a=n.isRightToLeft),d===i){var c=0;if(a||e.bidi){for(var p=this.documentHelper.selection.getElementsBackward(d,n,n,e.bidi),g=0;g<p.length;g++){var u=p[g],m=!1;if(h=this.documentHelper.selection.getLeftInternal(d,u,0),u===n)c=this.documentHelper.selection.getLeftInternal(d,u,r);else{var f=u instanceof Oe?u.length:1;c=this.documentHelper.selection.getLeftInternal(d,u,f)}u instanceof Oe&&(m=u.isRightToLeft),s=Math.abs(c-h),this.createHighlightBorder(d,s,m?c:h,o)}return}return c=this.documentHelper.selection.getLeftInternal(i,n,r),s=Math.abs(c-h),void this.createHighlightBorder(d,s,a?c:h,o)}s=this.documentHelper.selection.getWidth(d,!0)-(h-e.x),this.createHighlightBorder(d,s,h,o),o+=d.height}},e.prototype.addSearchResultItems=function(e){t.isNullOrUndefined(e)||""===e||(t.isNullOrUndefined(this.owner.findResultsList)&&(this.owner.findResultsList=[]),this.owner.findResultsList.push(e))},e.prototype.addFindResultView=function(e){for(var t=0;t<e.innerList.length;t++){var i=e.innerList[t];this.addFindResultViewForSearch(i)}this.isHandledOddPageHeader=!0,this.isHandledOddPageFooter=!0,this.isHandledEvenPageHeader=!0,this.isHandledEvenPageFooter=!0},e.prototype.addFindResultViewForSearch=function(e){if(null!=e.start&&null!=e.end&&null!=e.start.paragraph&&null!=e.end.paragraph){var i=void 0,n=0,r=e.start.currentWidget.getInline(e.start.offset,n),o=r.element;n=r.index;var s="",a=0;if(o instanceof Ie){var l=this.owner.selection.getRenderedInline(o,n);l.element.nextNode instanceof Oe?(o=l.element.nextNode,n=l.index):(o=l.element,n=l.index)}var d=this.owner.selection.getElementBoxInternal(o,n),h=d.element;if(n=d.index,null!=h){h instanceof Oe&&n>0&&(s=h.text.substring(0,n));m=h.line.children.indexOf(h);for(a=s.lastIndexOf(" ");a<0&&m>0&&h.line.children[m-1]instanceof Oe;)s=h.line.children[m-1].text+s,m--,a=s.lastIndexOf(" ")}var c=s.lastIndexOf("\v");c>0?s=s.substring(0,c):(a=s.lastIndexOf(" "))<0?s:s.substring(a+1),e.text;var p=0,g=e.end.currentWidget.getInline(e.end.offset,p),u=g.element;if(p=g.index,i="",null!=d&&(h=(d=this.owner.selection.getElementBoxInternal(u,p)).element,p=d.index),null!=h){h instanceof Oe&&p<h.length&&(i=h.text.substring(p));for(var m=h.line.children.indexOf(h);m+1<h.line.children.length&&h.line.children[m+1]instanceof Oe||h.line.children[m+1]instanceof Ie;)h.line.children[m+1]instanceof Ie?m+=2:(i+=h.line.children[m+1].text,m+=1)}a=i.lastIndexOf(" "),i="\v"===i?i="":i;var f="";e.isHeader?f='<span class="e-de-header-footer-list">Header: </span>':e.isFooter?f='<span class="e-de-header-footer-list">Footer: </span>':(f="",f="",this.isHandledOddPageHeader=!0,this.isHandledEvenPageHeader=!0,this.isHandledOddPageFooter=!0,this.isHandledEvenPageFooter=!0);var v="",y=e.documentHelper.selection.getPage(e.start.paragraph);t.isNullOrUndefined(this.isHandledEvenPageHeader)&&t.isNullOrUndefined(this.isHandledEvenPageFooter)?(this.isHandledEvenPageHeader=!0,this.isHandledEvenPageFooter=!0):t.isNullOrUndefined(this.isHandledOddPageHeader)&&t.isNullOrUndefined(this.isHandledOddPageFooter)&&(this.isHandledOddPageHeader=!0,this.isHandledOddPageFooter=!0),e.isHeader?"FirstPageHeader"===y.headerWidget.headerFooterType&&y.bodyWidgets[0].sectionFormat.differentFirstPage?v='<li tabindex=0 class="e-de-search-result-item e-de-op-search-txt">'+f+s+'<span class="e-de-op-search-word" style="pointer-events:none">'+e.text+"</span>"+i+"</li>":"EvenHeader"===y.headerWidget.headerFooterType&&this.isHandledEvenPageHeader?(v='<li tabindex=0 class="e-de-search-result-item e-de-op-search-txt">'+f+s+'<span class="e-de-op-search-word" style="pointer-events:none">'+e.text+"</span>"+i+"</li>",this.isHandledEvenPageHeader=!1):"OddHeader"===y.headerWidget.headerFooterType&&this.isHandledOddPageHeader&&(v='<li tabindex=0 class="e-de-search-result-item e-de-op-search-txt">'+f+s+'<span class="e-de-op-search-word" style="pointer-events:none">'+e.text+"</span>"+i+"</li>",this.isHandledOddPageHeader=!1):e.isFooter?"FirstPageFooter"===y.footerWidget.headerFooterType&&y.bodyWidgets[0].sectionFormat.differentFirstPage?v='<li tabindex=0 class="e-de-search-result-item e-de-op-search-txt">'+f+s+'<span class="e-de-op-search-word" style="pointer-events:none">'+e.text+"</span>"+i+"</li>":"EvenFooter"===y.footerWidget.headerFooterType&&this.isHandledEvenPageFooter?(v='<li tabindex=0 class="e-de-search-result-item e-de-op-search-txt">'+f+s+'<span class="e-de-op-search-word" style="pointer-events:none">'+e.text+"</span>"+i+"</li>",this.isHandledEvenPageFooter=!1):"OddFooter"===y.footerWidget.headerFooterType&&this.isHandledOddPageFooter&&(v='<li tabindex=0 class="e-de-search-result-item e-de-op-search-txt">'+f+s+'<span class="e-de-op-search-word" style="pointer-events:none">'+e.text+"</span>"+i+"</li>",this.isHandledOddPageFooter=!1):e.isHeader||e.isFooter||(v='<li tabindex=0 class="e-de-search-result-item e-de-op-search-txt">'+f+s+'<span class="e-de-op-search-word" style="pointer-events:none">'+e.text+"</span>"+i+"</li>"),this.addSearchResultItems(v)}},e.prototype.clearSearchHighlight=function(){t.isNullOrUndefined(this.searchHighlighters)||(this.searchHighlighters.clear(),this.searchHighlighters=void 0);var e={source:this.viewer.owner};this.viewer.owner.trigger("searchResultsChange",e)},e.prototype.destroy=function(){this.textSearchResults&&this.textSearchResults.destroy()},e}(),jt=function(){function e(e){var i=this;this.isOptionsPaneShow=!1,this.findOption="None",this.matchCase=void 0,this.wholeWord=void 0,this.searchText="Navigation",this.resultsText="Results",this.messageDivText="No matches",this.replaceButtonText="Replace",this.replaceAllButtonText="Replace All",this.focusedIndex=-1,this.focusedElement=[],this.isOptionsPane=!0,this.replacePaneText="Replace",this.findPaneText="Find",this.matchDivReplaceText="No matches",this.tabInstance=void 0,this.isReplace=!1,this.searchOptionChange=function(){i.clearSearchResultItems(),i.documentHelper.owner.searchModule.clearSearchHighlight();var e=i.searchInput.value;if(""!==e){var t=i.documentHelper.owner.searchModule.textSearch.stringToRegex(e,i.findOption),n=i.documentHelper.selection.end.getHierarchicalIndexInternal();i.results=i.documentHelper.owner.searchModule.textSearch.findAll(t,i.findOption,n),null!=i.results&&i.results.length>0?i.navigateSearchResult(!1):(i.viewer.renderVisiblePages(),i.messageDiv.innerHTML=i.localeValue.getConstant("No matches"),i.resultContainer.style.display="block",i.resultsListBlock.style.display="none",i.clearFocusElement(),i.resultsListBlock.innerHTML="")}},this.onEnableDisableReplaceButton=function(){0!==i.searchInput.value.length?(i.replaceButton.disabled=!1,i.replaceAllButton.disabled=!1):(i.replaceButton.disabled=!0,i.replaceAllButton.disabled=!0)},this.onKeyDownOnOptionPane=function(e){if(9===e.keyCode){e.preventDefault();var n=void 0;n=e.shiftKey?0===i.focusedIndex||t.isNullOrUndefined(i.focusedIndex)?i.focusedElement.length-1:i.focusedIndex-1:i.focusedElement.length-1===i.focusedIndex||t.isNullOrUndefined(i.focusedIndex)?0:i.focusedIndex+1,(s=i.focusedElement[n]).focus(),s instanceof HTMLInputElement&&s.select(),i.focusedIndex=n,s instanceof HTMLLIElement&&i.scrollToPosition(s)}else if(13===e.keyCode){if(i.hideMatchDiv(),e.target!==i.searchInput&&e.target!==i.closeButton&&(e.preventDefault(),-1!==(o=i.focusedElement.indexOf(e.target)))){var r=i.focusedElement[o];r.click(),r.focus(),i.focusedIndex=o}}else if((40===e.keyCode||38===e.keyCode)&&"none"!==i.resultsListBlock.style.display){var o=void 0,s=void 0;40===e.keyCode?i.focusedIndex>7?i.focusedIndex+1<i.focusedElement.length&&((s=i.focusedElement[i.focusedIndex+1]).focus(),i.focusedIndex=i.focusedIndex+1):(o=i.focusedElement.length-i.resultsListBlock.children.length+i.results.currentIndex+1)<i.focusedElement.length&&((s=i.focusedElement[o]).focus(),i.focusedIndex=o):i.focusedIndex>6&&(o=i.focusedIndex-1,(s=i.focusedElement[o]).focus(),i.focusedIndex=o)}},this.onReplaceButtonClick=function(){i.optionsPane;var e=i.searchInput.value,n=i.replaceWith.value,r=i.documentHelper.owner.searchModule.textSearchResults;if(""!==e&&!t.isNullOrUndefined(e)&&null!=i.documentHelper.owner.selection){var o=i.documentHelper.owner.selection.text;if(i.documentHelper.owner.selection.isEmpty||(i.documentHelper.owner.selection.isForward?i.documentHelper.owner.selection.selectContent(i.documentHelper.owner.selection.start,!0):i.documentHelper.owner.selection.selectContent(i.documentHelper.owner.selection.end,!0)),t.isNullOrUndefined(r)||t.isNullOrUndefined(r.currentSearchResult))i.documentHelper.owner.search.findAll(e,i.findOption),i.messageDiv.style.display="block",i.messageDiv.innerHTML=i.localeValue.getConstant(i.matchDivReplaceText);else{var s=r.currentSearchResult;if(i.documentHelper.owner.searchModule.navigate(s),s.text===o){var a=t.isNullOrUndefined(n)?"":n;i.documentHelper.owner.searchModule.replace(a,s,r);var l=i.documentHelper.owner.searchModule.textSearch.stringToRegex(e,i.findOption),d=i.documentHelper.selection.end.getHierarchicalIndexInternal();i.results=i.documentHelper.owner.searchModule.textSearch.findAll(l,i.findOption,d),t.isNullOrUndefined(i.results)||t.isNullOrUndefined(i.results.currentSearchResult)?(i.messageDiv.style.display="block",i.messageDiv.innerHTML=i.localeValue.getConstant(i.matchDivReplaceText)):i.documentHelper.owner.searchModule.navigate(i.results.currentSearchResult),i.documentHelper.owner.findResultsList=[],!t.isNullOrUndefined(i.results)&&i.results.innerList.length>0?i.navigateSearchResult(!0):i.resultsListBlock.innerHTML=""}else i.documentHelper.owner.search.findAll(e,i.findOption)}}},this.onReplaceAllButtonClick=function(){i.replaceAll(),i.resultsListBlock.style.display="none",i.messageDiv.innerHTML=""},this.searchIconClickInternal=function(){var e=document.getElementById(i.documentHelper.owner.containerId+"_option_search_text_box"),t=e.value;if(""!==t){if(i.hideMatchDiv(),i.searchIcon.classList.contains("e-de-op-search-close-icon"))return i.searchIcon.classList.add("e-de-op-search-icon"),i.searchIcon.classList.remove("e-de-op-search-close-icon"),e.value="",i.messageDiv.innerHTML=i.localeValue.getConstant("No matches"),i.resultContainer.style.display="block",i.resultsListBlock.style.display="none",i.matchDiv.style.display="none",i.occurrenceDiv.style.display="none",i.onEnableDisableReplaceButton(),i.clearFocusElement(),i.resultsListBlock.innerHTML="",i.clearSearchResultItems(),i.documentHelper.owner.searchModule.clearSearchHighlight(),void i.viewer.renderVisiblePages();i.searchIcon.classList.contains("e-de-op-search-icon")&&t.length>=1&&(i.searchIcon.classList.add("e-de-op-search-close-icon"),i.searchIcon.classList.remove("e-de-op-search-icon"),i.onEnableDisableReplaceButton()),i.clearSearchResultItems(),i.documentHelper.owner.searchModule.clearSearchHighlight();var n=i.documentHelper.owner.searchModule.textSearch.stringToRegex(t,i.findOption),r=i.documentHelper.selection.end.getHierarchicalIndexInternal();if(i.results=i.documentHelper.owner.searchModule.textSearch.findAll(n,i.findOption,r),null!=i.results&&i.results.length>0){var o=i.results.innerList[i.results.currentIndex].start,s=i.results.innerList[i.results.currentIndex].end;i.documentHelper.scrollToPosition(o,s,!0),i.navigateSearchResult(!1),i.getMessageDivHeight();var a=i.isOptionsPane?215:292,l=i.documentHelper.owner.getDocumentEditorElement().offsetHeight-a;i.resultsListBlock.style.height=l+"px"}else i.messageDiv.innerHTML=i.localeValue.getConstant("No matches"),i.resultContainer.style.display="block",i.resultsListBlock.style.display="none",i.clearFocusElement(),i.resultsListBlock.innerHTML=""}},this.navigateNextResultButtonClick=function(){if(null!=document.getElementById(i.documentHelper.owner.containerId+"_list_box_container")&&"none"!==document.getElementById(i.documentHelper.owner.containerId+"_list_box_container").style.display){var e=i.documentHelper.owner.selection.end,n=void 0,r=0;e.isExistAfter(i.results.currentSearchResult.start)&&(r=i.results.currentIndex);for(var o=r;o<i.results.length;o++){var s=i.results.innerList[o];if(e.isExistBefore(s.start)||e.isAtSamePosition(s.start)){n=s,i.results.currentIndex=o;break}}t.isNullOrUndefined(n)&&(i.results.currentIndex=0,n=i.results.innerList[0]),i.messageDiv.innerHTML=i.localeValue.getConstant("Result")+" "+(i.results.currentIndex+1)+" "+i.localeValue.getConstant("of")+" "+i.resultsListBlock.children.length,i.updateListItems(n),i.focusedIndex=i.focusedElement.indexOf(i.navigateToNextResult)}},this.navigatePreviousResultButtonClick=function(){if(null!=document.getElementById(i.documentHelper.owner.containerId+"_list_box_container")&&"none"!==document.getElementById(i.documentHelper.owner.containerId+"_list_box_container").style.display){var e=void 0,n=i.documentHelper.owner.selection.start,r=i.results.currentIndex;n.isExistAfter(i.results.currentSearchResult.start)&&(r=i.results.length-1);for(var o=r;o>=0;o--){var s=i.results.innerList[o];if(n.isExistAfter(s.start)||i.documentHelper.owner.selection.end.isAtSamePosition(s.start)){e=s,i.results.currentIndex=o;break}}t.isNullOrUndefined(e)&&(i.results.currentIndex=i.results.length-1,e=i.results.innerList[i.results.currentIndex]),i.messageDiv.innerHTML=i.localeValue.getConstant("Result")+" "+(i.results.currentIndex+1)+" "+i.localeValue.getConstant("of")+" "+i.resultsListBlock.children.length,i.updateListItems(e),i.focusedIndex=i.focusedElement.indexOf(i.navigateToPreviousResult)}},this.onKeyDown=function(e){var t=e.which||e.keyCode;13===t&&9!==e.keyCode&&40!==e.keyCode?(e.preventDefault(),i.findDiv.style.height="",i.onKeyDownInternal()):8===t&&0===i.searchInput.value.length?i.resultContainer.style.display="block":9!==e.keyCode&&40!==e.keyCode&&27!==e.keyCode?(i.documentHelper.owner.searchModule.clearSearchHighlight(),i.clearSearchResultItems(),i.viewer.renderVisiblePages(),i.resultsListBlock.style.display="none",i.messageDiv.innerHTML=i.localeValue.getConstant("No matches"),i.resultContainer.style.display="none",i.clearFocusElement(),i.resultsListBlock.innerHTML="",i.searchIcon.classList.contains("e-de-op-search-close-icon")&&(i.searchIcon.classList.add("e-de-op-search-icon"),i.searchIcon.classList.remove("e-de-op-search-close-icon"))):27===t&&27===e.keyCode&&i.showHideOptionsPane(!1)},this.close=function(){i.clearFocusElement(),i.showHideOptionsPane(!1),i.resultsListBlock.innerHTML="",i.focusedIndex=1,i.isOptionsPane=!0},this.resultListBlockClick=function(e){for(var t=e.target,n=i.resultsListBlock.children,r=0,o=0;o<n.length;o++){var s=n[o];s.classList.contains("e-de-search-result-hglt")&&(s.classList.remove("e-de-search-result-hglt"),s.children[0].classList.remove("e-de-op-search-word-text"),s.classList.add("e-de-search-result-item"))}for(var a,o=0;o<n.length;o++)t===n[o]&&(r=o,(a=n[o]).classList.contains("e-de-search-result-item")&&(a.classList.remove("e-de-search-result-item"),a.classList.add("e-de-search-result-hglt"),a.children[0].classList.add("e-de-op-search-word-text"),i.focusedIndex=i.focusedElement.indexOf(a)));var l=i.results.innerList[r];i.results.currentIndex=r,i.messageDiv.innerHTML=i.localeValue.getConstant("Result")+" "+(r+1)+" "+i.localeValue.getConstant("of")+" "+i.resultsListBlock.children.length,i.documentHelper.owner.searchModule.navigate(l),i.documentHelper.owner.searchModule.highlight(i.results),a&&a.focus()},this.documentHelper=e}return Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"OptionsPane"},e.prototype.initOptionsPane=function(e,n){this.viewer;this.localeValue=e,this.optionsPane=t.createElement("div",{className:"e-de-op",styles:"display:none;"}),this.optionsPane.addEventListener("keydown",this.onKeyDownOnOptionPane),this.searchDiv=t.createElement("div",{className:this.documentHelper.owner.containerId+"_searchDiv e-de-op-header",innerHTML:e.getConstant(this.searchText)}),this.optionsPane.appendChild(this.searchDiv),this.closeButton=t.createElement("button",{className:"e-de-op-close-button e-de-close-icon e-de-op-icon-btn e-btn e-flat e-icon-btn",id:"close",attrs:{type:"button"}}),this.optionsPane.appendChild(this.closeButton);var o=t.createElement("span",{className:"e-de-op-close-icon e-de-close-icon e-btn-icon e-icons"});this.closeButton.appendChild(o),this.focusedElement.push(this.closeButton),this.findTab=t.createElement("div",{id:this.documentHelper.owner.containerId+"_findTabDiv",className:"e-de-op-tab"}),this.optionsPane.appendChild(this.findTab),this.findTabButton=t.createElement("div",{innerHTML:e.getConstant(this.findPaneText)}),this.replaceTabButton=t.createElement("div",{innerHTML:e.getConstant(this.replacePaneText)});var s=t.createElement("div");this.findTabContentDiv=t.createElement("div",{className:"e-de-search-tab-content"}),this.searchTextBoxContainer=t.createElement("div",{className:"e-input-group e-de-op-input-group"}),this.findTabContentDiv.appendChild(this.searchTextBoxContainer),this.searchInput=t.createElement("input",{className:"e-input e-de-search-input",id:this.documentHelper.owner.containerId+"_option_search_text_box",attrs:{placeholder:e.getConstant("Search for")}}),this.searchTextBoxContainer.appendChild(this.searchInput),this.searchIcon=t.createElement("span",{className:"e-de-op-icon e-de-op-search-icon e-input-group-icon e-icon",id:this.documentHelper.owner.containerId+"_search-icon"}),this.searchIcon.tabIndex=0,this.searchTextBoxContainer.appendChild(this.searchIcon),this.focusedElement.push(this.searchIcon),this.navigateToPreviousResult=t.createElement("span",{className:"e-de-op-icon e-de-op-nav-btn e-arrow-up e-spin-up e-btn-icon e-icon e-input-group-icon"}),this.navigateToPreviousResult.tabIndex=0,this.searchTextBoxContainer.appendChild(this.navigateToPreviousResult),this.focusedElement.push(this.navigateToPreviousResult),this.navigateToNextResult=t.createElement("span",{className:"e-de-op-icon e-de-op-nav-btn e-arrow-down e-spin-down e-btn-icon e-icon e-input-group-icon"}),this.navigateToNextResult.tabIndex=0,this.searchTextBoxContainer.appendChild(this.navigateToNextResult),this.focusedElement.push(this.navigateToNextResult);var a=t.createElement("div",{className:"e-de-op-more-less"});this.matchInput=t.createElement("input",{attrs:{type:"checkbox"},id:this.documentHelper.owner.containerId+"_matchCase"}),a.appendChild(this.matchInput),this.matchCase=new r.CheckBox({label:e.getConstant("Match case"),enableRtl:n,checked:!1,change:this.matchChange.bind(this)}),this.matchCase.appendTo(this.matchInput),this.focusedElement.push(this.matchInput),this.matchInput.tabIndex=0;var l;l=n?"_e-de-rtl":"_e-de-ltr",this.wholeInput=t.createElement("input",{attrs:{type:"checkbox"},id:this.documentHelper.owner.containerId+"_wholeWord"+l}),a.appendChild(this.wholeInput),this.wholeWord=new r.CheckBox({label:e.getConstant("Whole words"),enableRtl:n,checked:!1,change:this.wholeWordsChange.bind(this)}),this.wholeWord.appendTo(this.wholeInput),this.focusedElement.push(this.wholeInput),this.wholeInput.tabIndex=0,this.findTabContentDiv.appendChild(a);var d=t.createElement("div");this.replaceTabContentDiv=t.createElement("div",{className:"e-de-op-replacetabcontentdiv",styles:"display:none;"}),this.findTabContentDiv.appendChild(this.replaceTabContentDiv),this.createReplacePane(n),this.findDiv=t.createElement("div",{className:"findDiv",styles:"display:block;"}),s.appendChild(this.findTabContentDiv),this.resultContainer=t.createElement("div",{styles:"width:85%;display:block;",className:"e-de-op-result-container"}),this.findDiv.appendChild(this.resultContainer),this.messageDiv=t.createElement("div",{className:this.documentHelper.owner.containerId+"_messageDiv e-de-op-msg",innerHTML:this.localeValue.getConstant(this.messageDivText),id:this.documentHelper.owner.containerId+"_search_status"}),this.resultContainer.appendChild(this.messageDiv),this.resultsListBlock=t.createElement("div",{id:this.documentHelper.owner.containerId+"_list_box_container",styles:"display:none;width:270px;list-style:none;padding-right:5px;overflow:auto;",className:"e-de-result-list-block"}),this.findDiv.appendChild(this.resultsListBlock),this.findTabContentDiv.appendChild(this.findDiv);var h=[{header:{text:this.findTabButton},content:s},{header:{text:this.replaceTabButton},content:d}];this.tabInstance=new i.Tab({items:h,enableRtl:n,selected:this.selectedTabItem.bind(this)}),this.tabInstance.isStringTemplate=!0,this.tabInstance.appendTo(this.findTab),this.onWireEvents(),n&&(this.optionsPane.classList.add("e-de-rtl"),this.closeButton.classList.add("e-de-rtl"),this.searchDiv.classList.add("e-de-rtl"))},e.prototype.createReplacePane=function(e){this.replaceDiv=t.createElement("div"),this.replaceTabContentDiv.appendChild(this.replaceDiv),this.replaceWith=t.createElement("input",{className:"e-de-op-replacewith e-input",attrs:{placeholder:this.localeValue.getConstant("Replace with")}}),this.replaceDiv.appendChild(this.replaceWith);var i,n;e?(i="text-align:left",n="margin-left:10px"):(i="text-align:right",n="margin-right:10px");var r=t.createElement("div",{styles:i,className:"e-de-op-dlg-footer"});this.replaceDiv.appendChild(r),this.replaceButton=t.createElement("button",{className:"e-control e-btn e-flat e-replace",styles:n,innerHTML:this.localeValue.getConstant(this.replaceButtonText),attrs:{type:"button"}}),r.appendChild(this.replaceButton),this.replaceAllButton=t.createElement("button",{className:"e-control e-btn e-flat e-replaceall",innerHTML:this.localeValue.getConstant(this.replaceAllButtonText),attrs:{type:"button"}}),r.appendChild(this.replaceAllButton),this.matchDiv=t.createElement("div",{styles:"display:none;padding-top:10px;"}),this.replaceDiv.appendChild(this.matchDiv);var o=t.createElement("div",{className:"e-de-op-search-replacediv"});this.replaceDiv.appendChild(o),this.occurrenceDiv=t.createElement("div",{styles:"display:none;"}),this.replaceDiv.appendChild(this.occurrenceDiv)},e.prototype.selectedTabItem=function(e){var i=this.findTab.getElementsByClassName("e-content").item(0);if(e.previousIndex!==e.selectedIndex){var n=i.children[0],r=i.children[1],o=n.firstElementChild;o&&(o.parentElement&&o.parentElement.removeChild(o),r.appendChild(o))}var s=i.children[0];t.isNullOrUndefined(s)||(0===e.selectedIndex?(this.isOptionsPane=!0,this.onFindPane()):(this.isOptionsPane=!1,this.onReplacePane()))},e.prototype.navigateSearchResult=function(e){e&&this.documentHelper.owner.searchModule.navigate(this.results.innerList[this.results.currentIndex]),this.documentHelper.owner.searchModule.highlight(this.results),this.documentHelper.owner.searchModule.addFindResultView(this.results),this.resultsListBlock.style.display="block",this.resultContainer.style.display="block";for(var t=this.documentHelper.owner.findResultsList,i="",n=0;n<t.length;n++)i+=t[n];this.clearFocusElement(),this.resultsListBlock.innerHTML=i;for(n=0;n<this.resultsListBlock.children.length;n++)this.focusedElement.push(this.resultsListBlock.children[n]);var r=this.results.currentIndex;this.messageDiv.innerHTML=this.localeValue.getConstant("Result")+" "+(r+1)+" "+this.localeValue.getConstant("of")+" "+this.resultsListBlock.children.length;var o=this.resultsListBlock.children[r];o.classList.contains("e-de-search-result-item")&&(o.classList.remove("e-de-search-result-item"),o.classList.add("e-de-search-result-hglt"),o.children[0].classList.add("e-de-op-search-word-text"),this.scrollToPosition(o))},e.prototype.wholeWordsChange=function(){this.matchInput.checked&&this.wholeInput.checked?this.findOption="CaseSensitiveWholeWord":this.matchInput.checked&&!this.wholeInput.checked?this.findOption="CaseSensitive":!this.matchInput.checked&&this.wholeInput.checked?this.findOption="WholeWord":this.findOption="None",this.searchOptionChange()},e.prototype.matchChange=function(){this.matchInput.checked&&this.wholeInput.checked?this.findOption="CaseSensitiveWholeWord":!this.matchInput.checked&&this.wholeInput.checked?this.findOption="WholeWord":this.matchInput.checked&&!this.wholeInput.checked?this.findOption="CaseSensitive":this.findOption="None",this.searchOptionChange()},e.prototype.onWireEvents=function(){this.searchIcon.addEventListener("click",this.searchIconClickInternal),this.navigateToNextResult.addEventListener("click",this.navigateNextResultButtonClick),this.navigateToPreviousResult.addEventListener("click",this.navigatePreviousResultButtonClick),this.searchInput.addEventListener("keydown",this.onKeyDown),this.searchInput.addEventListener("keyup",this.onEnableDisableReplaceButton),this.resultsListBlock.addEventListener("click",this.resultListBlockClick),this.closeButton.addEventListener("click",this.close),this.replaceButton.addEventListener("click",this.onReplaceButtonClick),this.replaceAllButton.addEventListener("click",this.onReplaceAllButtonClick)},e.prototype.onKeyDownInternal=function(){var e=document.getElementById(this.documentHelper.owner.containerId+"_option_search_text_box");e.blur();var i=e.value;if(""!==i){i.length>=1&&this.searchIcon.classList.contains("e-de-op-search-icon")&&(this.searchIcon.classList.add("e-de-op-search-close-icon"),this.searchIcon.classList.remove("e-de-op-search-icon"));var n=this.isOptionsPane?215:292,r=this.documentHelper.owner.getDocumentEditorElement().offsetHeight-n;this.clearSearchResultItems(),this.documentHelper.owner.searchModule.clearSearchHighlight();var o=this.documentHelper.owner.searchModule.textSearch.stringToRegex(i,this.findOption),s=this.documentHelper.selection.end.getHierarchicalIndexInternal();this.results=this.documentHelper.owner.searchModule.textSearch.findAll(o,this.findOption,s);var a=this.results;if(t.isNullOrUndefined(a)&&this.viewer.renderVisiblePages(),null!=a&&a.length>0){-1===this.focusedElement.indexOf(this.navigateToPreviousResult)&&this.isOptionsPane&&this.focusedElement.push(this.navigateToPreviousResult),-1===this.focusedElement.indexOf(this.navigateToNextResult)&&this.isOptionsPane&&this.focusedElement.push(this.navigateToNextResult),this.documentHelper.owner.searchModule.navigate(this.results.innerList[this.results.currentIndex]),this.documentHelper.owner.searchModule.highlight(a),this.documentHelper.owner.searchModule.addFindResultView(a),this.resultsListBlock.style.display="block",this.resultsListBlock.style.height=r+"px",this.resultContainer.style.display="block";var l=this.documentHelper.owner.findResultsList,d="";this.clearFocusElement(),this.resultsListBlock.innerHTML="";for(h=0;h<l.length;h++)d+=l[h];this.resultsListBlock.innerHTML=d;for(var h=0;h<this.resultsListBlock.children.length;h++)this.focusedElement.push(this.resultsListBlock.children[h]);this.resultsListBlock.children;var c=this.results.currentIndex;this.messageDiv.innerHTML=this.localeValue.getConstant("Result")+" "+(c+1)+" "+this.localeValue.getConstant("of")+" "+this.resultsListBlock.children.length;var p=this.resultsListBlock.children[c];p.classList.contains("e-de-search-result-item")&&(p.classList.remove("e-de-search-result-item"),p.classList.add("e-de-search-result-hglt"),p.children[0].classList.add("e-de-op-search-word-text")),this.navigateToNextResult.focus(),this.focusedIndex=this.focusedElement.indexOf(this.navigateToNextResult),this.getMessageDivHeight()}else this.messageDiv.innerHTML=this.localeValue.getConstant("No matches"),this.resultContainer.style.display="block",this.resultsListBlock.style.display="none",this.clearFocusElement(),this.resultsListBlock.innerHTML=""}},e.prototype.onFindPane=function(){this.replaceDiv.style.display="none",this.occurrenceDiv.style.display="none",t.isNullOrUndefined(this.results)||0!==this.results.length||(this.resultsListBlock.innerHTML="",this.resultsListBlock.style.display="none",this.messageDiv.innerHTML=this.localeValue.getConstant("No matches"));var e=this.isOptionsPane?215:292,i=this.documentHelper.owner.getDocumentEditorElement().offsetHeight-e;this.resultsListBlock.style.height=i+"px",this.replaceTabContentDiv.style.display="none",this.findDiv.style.display="block",this.messageDiv.style.display="block",this.focusedElement=[],this.focusedElement.push(this.closeButton,this.searchInput,this.searchIcon,this.navigateToPreviousResult,this.navigateToNextResult,this.matchInput,this.wholeInput),this.focusedIndex=1,this.searchInput.select(),this.getMessageDivHeight()},e.prototype.getMessageDivHeight=function(){!this.isOptionsPane&&this.messageDiv.classList.contains("e-de-op-msg")?(this.messageDiv.classList.add("e-de-op-replace-messagediv"),this.messageDiv.classList.remove("e-de-op-msg")):this.isOptionsPane&&this.messageDiv.classList.contains("e-de-op-replace-messagediv")&&(this.messageDiv.classList.add("e-de-op-msg"),this.messageDiv.classList.remove("e-de-op-replace-messagediv"))},e.prototype.onReplacePane=function(){this.findDiv.style.display="block",this.replaceDiv.style.display="block",this.replaceTabContentDiv.style.display="block";var e=this.isOptionsPane?215:292,t=this.documentHelper.owner.getDocumentEditorElement().offsetHeight-e;this.resultsListBlock.style.height=t+"px",this.isOptionsPane=!1,0!==this.searchInput.value.length?(this.replaceButton.disabled=!1,this.replaceAllButton.disabled=!1):(this.replaceButton.disabled=!0,this.replaceAllButton.disabled=!0),this.focusedElement=[],this.focusedElement.push(this.closeButton,this.searchInput,this.searchIcon,this.navigateToPreviousResult,this.navigateToNextResult,this.matchInput,this.wholeInput,this.replaceWith,this.replaceButton,this.replaceAllButton),this.focusedIndex=1,""===this.searchInput.value?this.searchInput.select():this.replaceWith.select(),this.getMessageDivHeight()},e.prototype.replaceAll=function(){this.optionsPane;var e=this.searchInput.value,i=this.replaceWith.value;if(""!==e&&!t.isNullOrUndefined(e)){var n=this.documentHelper.owner.searchModule.textSearch.stringToRegex(e,this.findOption),r=this.documentHelper.selection.end.getHierarchicalIndexInternal(),o=this.documentHelper.owner.searchModule.textSearch.findAll(n,this.findOption,r),s=t.isNullOrUndefined(i)?"":i,a=t.isNullOrUndefined(o)?0:o.length;this.documentHelper.owner.searchModule.replaceAll(s,o),this.matchDiv.style.display="block",this.matchDiv.innerHTML=this.localeValue.getConstant("All Done")+"!",this.occurrenceDiv.style.display="block",this.occurrenceDiv.innerHTML=this.localeValue.getConstant("We replaced all")+" "+a+" "+this.localeValue.getConstant("instances")+" "+this.localeValue.getConstant("of")+' "'+e+'" '+this.localeValue.getConstant("with")+' "'+i+'" '}},e.prototype.hideMatchDiv=function(){this.matchDiv.style.display="none",this.occurrenceDiv.style.display="none"},e.prototype.updateListItems=function(e){for(var i=this.resultsListBlock.getElementsByClassName("e-de-search-result-hglt"),n=0;n<i.length;n++){var r=i[n];t.classList(r,["e-de-search-result-item"],["e-de-search-result-hglt"]),t.classList(r.children[0],[],["e-de-op-search-word-text"])}var o=this.resultsListBlock.children[this.results.currentIndex];t.classList(o,["e-de-search-result-hglt"],["e-de-search-result-item"]),t.classList(o.children[0],["e-de-op-search-word-text"],[]),this.scrollToPosition(o),this.documentHelper.owner.searchModule.navigate(e),this.documentHelper.owner.searchModule.highlight(this.results)},e.prototype.scrollToPosition=function(e){var t,i=e.getBoundingClientRect();i.top>0?(t=i.top-e.parentElement.getBoundingClientRect().top,e.parentElement.offsetHeight-t<=e.offsetHeight?(Math.ceil(t+e.offsetHeight)===e.parentElement.scrollHeight&&(e.parentElement.scrollTop=t),e.parentElement.scrollTop=e.parentElement.scrollTop+e.parentElement.offsetHeight/100*30):t<0&&(e.parentElement.scrollTop=e.parentElement.scrollTop-e.parentElement.offsetHeight/100*30)):e.parentElement.scrollTop=0},e.prototype.clearFocusElement=function(){for(var e=0;e<this.resultsListBlock.children.length;e++){var t=this.focusedElement.indexOf(this.resultsListBlock.children[e]);-1!==t&&this.focusedElement.splice(t,1)}this.focusedIndex=1},e.prototype.showHideOptionsPane=function(e){if(!t.isNullOrUndefined(this.documentHelper.owner.selectionModule))if(e){if(this.localeValue=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale),this.localeValue.setLocale(this.documentHelper.owner.locale),t.isNullOrUndefined(this.optionsPane)){this.initOptionsPane(this.localeValue,this.documentHelper.owner.enableRtl);var i=void 0;i=this.documentHelper.owner.enableRtl?"display:inline-flex;direction:rtl;":"display:inline-flex;",this.documentHelper.optionsPaneContainer.setAttribute("style",i),this.documentHelper.optionsPaneContainer.insertBefore(this.documentHelper.owner.optionsPaneModule.optionsPane,this.documentHelper.viewerContainer)}this.optionsPane.style.display="block",this.documentHelper.owner.isReadOnlyMode?this.tabInstance.hideTab(1):this.tabInstance.hideTab(1,!1),this.isReplace&&!this.documentHelper.owner.isReadOnlyMode?(this.tabInstance.select(1),this.isReplace=!1,this.isOptionsPane=!1):this.tabInstance.select(0),this.searchDiv.innerHTML=this.localeValue.getConstant(this.searchText),this.isOptionsPaneShow=!0;var n=document.getElementById(this.documentHelper.owner.getDocumentEditorElement().id+"_option_search_text_box"),r=this.documentHelper.owner.selection.text;if(!t.isNullOrUndefined(r)){var o=["\v","\r"],s=L.indexOfAny(r,o);r=s<0?r:r.substring(0,s)}n.value=r,n.select(),this.messageDiv.innerHTML="",this.searchIcon.classList.contains("e-de-op-search-close-icon")&&(this.searchIcon.classList.add("e-de-op-search-icon"),this.searchIcon.classList.remove("e-de-op-search-close-icon")),this.documentHelper.selection.caret.style.display="none",this.focusedIndex=1,this.focusedElement=[],this.isOptionsPane?this.focusedElement.push(this.closeButton,this.searchInput,this.searchIcon,this.navigateToPreviousResult,this.navigateToNextResult,this.matchInput,this.wholeInput):this.focusedElement.push(this.closeButton,this.searchInput,this.searchIcon,this.navigateToPreviousResult,this.navigateToNextResult,this.matchInput,this.wholeInput,this.replaceWith,this.replaceButton,this.replaceAllButton),this.documentHelper.updateViewerSize()}else{if(!t.isNullOrUndefined(this.optionsPane)){this.clearSearchResultItems(),this.documentHelper.owner.searchModule.clearSearchHighlight(),this.isOptionsPaneShow=!1;var a=document.getElementById(this.documentHelper.owner.containerId+"_list_box_container"),l=document.getElementById(this.documentHelper.owner.containerId+"_search_status");t.isNullOrUndefined(a)||t.isNullOrUndefined(l)||(a.style.display="none",this.clearFocusElement(),a.innerHTML="",l.innerHTML=this.localeValue.getConstant("No matches"))}this.documentHelper.updateViewerSize(),t.isNullOrUndefined(this.optionsPane)||"none"!==this.optionsPane.style.display&&(this.documentHelper.selection.updateCaretPosition(),this.optionsPane.style.display="none"),this.documentHelper.updateFocus(),this.documentHelper.selection.caret.style.display="block"}},e.prototype.clearSearchResultItems=function(){t.isNullOrUndefined(this.documentHelper.owner.findResultsList)||(this.documentHelper.owner.findResultsList=[])},e.prototype.destroy=function(){this.optionsPane&&(this.optionsPane.innerHTML="",this.optionsPane=void 0),this.resultsListBlock&&(this.resultsListBlock.innerHTML="",this.resultsListBlock=void 0),this.messageDiv&&(this.messageDiv.innerHTML="",this.messageDiv=void 0),this.resultContainer&&(this.resultContainer.innerHTML=""),this.resultContainer=void 0,this.searchInput&&(this.searchInput.value="",this.searchInput=void 0),this.searchDiv&&(this.searchDiv.innerHTML="",this.searchDiv=void 0),this.searchTextBoxContainer&&(this.searchTextBoxContainer.innerHTML="",this.searchTextBoxContainer=void 0),this.replaceWith&&(this.replaceWith.innerHTML="",this.replaceWith=void 0),this.findDiv&&(this.findDiv.innerHTML="",this.findDiv=void 0),this.replaceButton&&(this.replaceButton.innerHTML="",this.replaceButton=void 0),this.replaceAllButton&&(this.replaceAllButton.innerHTML="",this.replaceAllButton=void 0),this.matchInput&&(this.matchInput.innerHTML="",this.matchCase=void 0),this.wholeInput&&(this.wholeInput.innerHTML="",this.wholeWord=void 0),t.isNullOrUndefined(this.results)||this.results.destroy(),this.focusedElement&&(this.focusedElement=[]),this.focusedElement=void 0,this.destroyInternal()},e.prototype.destroyInternal=function(){this.searchText&&(this.searchText=void 0),this.resultsText&&(this.resultsText=void 0),this.messageDivText&&(this.messageDivText=void 0),this.replaceButtonText&&(this.replaceButtonText=void 0),this.replaceAllButtonText&&(this.replaceAllButtonText=void 0)},e}(),qt=function(){function e(e,t){this.ownerListLevelIn=void 0,this.modifiedListLevelIn=void 0,this.ownerListLevel=e,this.modifiedListLevel=t}return Object.defineProperty(e.prototype,"ownerListLevel",{get:function(){return this.ownerListLevelIn},set:function(e){this.ownerListLevelIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"modifiedListLevel",{get:function(){return this.modifiedListLevelIn},set:function(e){this.modifiedListLevelIn=e},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.ownerListLevel=void 0,this.modifiedListLevel=void 0},e}(),Gt=function(){function e(e,t){this.ownerFormatIn=void 0,this.modifiedFormatIn=void 0,this.ownerFormat=e,this.modifiedFormat=t}return Object.defineProperty(e.prototype,"ownerFormat",{get:function(){return this.ownerFormatIn},set:function(e){this.ownerFormatIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"modifiedFormat",{get:function(){return this.modifiedFormatIn},set:function(e){this.modifiedFormatIn=e},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.ownerFormat=void 0,this.modifiedFormat.destroy(),this.modifiedFormat=void 0},e}(),Kt=function(){function e(e,t){this.startingPoint=e,this.rowFormat=t,this.rowHeightType=t.heightType}return e.prototype.revertChanges=function(e,t){var i=this.rowFormat.heightType;t.editorModule.tableResize.updateRowHeight(this.rowFormat.ownerBase,e?this.displacement:-this.displacement),t.documentHelper.layout.reLayoutTable(this.rowFormat.ownerBase.ownerTable),this.rowFormat.heightType!==this.rowHeightType&&(this.rowFormat.heightType=this.rowHeightType),this.rowHeightType=i},e}(),Xt=function(){function e(e,t){this.tableHolder=new wt,this.tableFormat=new Yt,this.rows=[],this.owner=t,this.copyProperties(e)}return e.prototype.copyProperties=function(e){e.tableHolder&&(this.tableHolder=e.tableHolder.clone()),e.tableFormat&&(this.tableFormat.leftIndent=e.tableFormat.leftIndent,this.tableFormat.preferredWidth=e.tableFormat.preferredWidth,this.tableFormat.preferredWidthType=e.tableFormat.preferredWidthType,this.tableFormat.allowAutoFit=e.tableFormat.allowAutoFit);for(var t=0;t<e.childWidgets.length;t++){var i=e.childWidgets[t],n=new Jt;n.gridBefore=i.rowFormat.gridBefore,n.gridBeforeWidth=i.rowFormat.gridBeforeWidth,n.gridBeforeWidthType=i.rowFormat.gridBeforeWidthType,n.gridAfter=i.rowFormat.gridAfter,n.gridAfterWidth=i.rowFormat.gridAfterWidth,n.gridAfterWidthType=i.rowFormat.gridAfterWidthType;for(var r=0;r<i.childWidgets.length;r++){var o=i.childWidgets[r],s=new Zt;s.columnIndex=o.columnIndex,s.columnSpan=o.cellFormat.columnSpan,s.preferredWidth=o.cellFormat.preferredWidth,s.preferredWidthType=o.cellFormat.preferredWidthType,n.cells.push(s)}this.rows.push(n)}this.tableHierarchicalIndex=this.owner.selection.getHierarchicalIndex(e,"0")},e.prototype.destroy=function(){this.tableHierarchicalIndex=void 0,this.tableHolder&&(this.tableHolder.destroy(),this.tableHolder=void 0),this.tableFormat&&(this.tableFormat=null),this.rows&&(this.rows=[],this.rows=void 0)},e}(),Yt=function(){function e(){}return e}(),Jt=function(){function e(){this.cells=[]}return e}(),Zt=function(){function e(){}return e}(),Qt=function(){function e(e){this.startingPoint=e}return e}(),$t=function(){function e(e){this.ownerIn=e,this.documentHelper=e.documentHelper,this.modifiedPropertiesIn=[],this.modifiedNodeLength=[],this.removedNodesIn=[]}return Object.defineProperty(e.prototype,"owner",{get:function(){return this.ownerIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editorHistory",{get:function(){return this.owner.editorHistory},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"action",{get:function(){return this.actionIn},set:function(e){this.actionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"modifiedProperties",{get:function(){return this.modifiedPropertiesIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"removedNodes",{get:function(){return this.removedNodesIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionStart",{get:function(){return this.selectionStartIn},set:function(e){this.selectionStartIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionEnd",{get:function(){return this.selectionEndIn},set:function(e){this.selectionEndIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"insertPosition",{get:function(){return this.insertPositionIn},set:function(e){this.insertPositionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endPosition",{get:function(){return this.endPositionIn},set:function(e){this.endPositionIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){return this.ownerIn.viewer},enumerable:!0,configurable:!0}),e.prototype.updateSelection=function(){var e=this.owner.selection.getParagraphInfo(this.owner.selection.start);this.selectionStart=this.owner.selection.getHierarchicalIndex(e.paragraph,e.offset.toString()),e=this.owner.selection.getParagraphInfo(this.owner.selection.end),this.selectionEnd=this.owner.selection.getHierarchicalIndex(e.paragraph,e.offset.toString())},e.prototype.setBookmarkInfo=function(e){this.removedNodes.push({bookmark:e,startIndex:e.indexInOwner,endIndex:e.reference.indexInOwner})},e.prototype.setFormFieldInfo=function(e,t){this.removedNodes.push({formField:e,value:t})},e.prototype.setEditRangeInfo=function(e){this.removedNodes.push({editStart:e,startIndex:e.indexInOwner,endIndex:e.editRangeEnd.indexInOwner})},e.prototype.revertFormTextFormat=function(){var e=this.removedNodes[0],t=e.value,i=e.formField;this.editorHistory.isUndoing?(this.owner.editorModule.applyTextFormatInternal(i,t),this.editorHistory.recordChanges(this)):(t=L.formatText(i.formFieldData.format,t),this.owner.editorModule.applyTextFormatInternal(i,t),this.editorHistory.undoStack.push(this))},e.prototype.revertFormField=function(){var e=this.removedNodes[0],t=e.formField;t.formFieldData instanceof He?this.owner.editorModule.toggleCheckBoxFormField(t,!0,e.value):this.owner.editorModule.updateFormField(t,e.value)},e.prototype.revertBookmark=function(){var e=this.removedNodes[0],i=e.bookmark;if(this.editorHistory.isUndoing){this.documentHelper.bookmarks.add(i.name,i),i.line.children.splice(e.startIndex,0,i);var n=i.previousNode;n instanceof Ie&&!t.isNullOrUndefined(n.formFieldData)&&(n.formFieldData.name=i.name),i.reference.line.children.splice(e.endIndex,0,i.reference),this.editorHistory.recordChanges(this)}else this.owner.editorModule.deleteBookmarkInternal(i),this.editorHistory.undoStack.push(this)},e.prototype.revertComment=function(){var e=this.insertPosition,t=this.removedNodes[0],i=!1;if("InsertCommentWidget"===this.action?i=this.editorHistory.isRedoing:"DeleteCommentWidget"===this.action&&(i=this.editorHistory.isUndoing),i)t&&(t.isReply?this.owner.editor.addReplyComment(t,this.insertPosition):this.owner.editor.addCommentWidget(t,!1,!0,!0));else{var n=this.owner.editor.getCommentElementBox(e);this.owner.editor.deleteCommentWidget(n)}},e.prototype.revertEditRangeRegion=function(){var e=this.removedNodes[0],t=e.editStart;if(this.editorHistory.isUndoing){var i=""===t.user?t.group:t.user;this.owner.editor.updateRangeCollection(t,i),t.line.children.splice(e.startIndex,0,t),t.editRangeEnd.line.children.splice(e.endIndex,0,t.editRangeEnd),this.editorHistory.recordChanges(this)}else this.owner.editorModule.removeUserRestrictionsInternal(t),this.editorHistory.undoStack.push(this);this.owner.editor.fireContentChange()},e.prototype.revert=function(){if("FormTextFormat"===this.action)return void this.revertFormTextFormat();if("UpdateFormField"===this.action)return void this.revertFormField();if("DeleteBookmark"===this.action)return void this.revertBookmark();if("RemoveEditRange"===this.action)return void this.revertEditRangeRegion();if("InsertCommentWidget"===this.action||"DeleteCommentWidget"===this.action)return void this.revertComment();if("ListFormat"===this.action&&""!==this.owner.editor.listNumberFormat){var e=this.documentHelper.lists[0].abstractList.levels[this.owner.editor.listLevelNumber],i=e.listLevelPattern,n=e.numberFormat;e.listLevelPattern=this.owner.editor.listLevelPattern,e.numberFormat=this.owner.editor.listNumberFormat,this.owner.editor.listLevelPattern=i,this.owner.editor.listNumberFormat=n}this.owner.isShiftingEnabled=!0;var r=void 0,o=void 0,s=this.selectionStart,a=this.selectionEnd,l=kt.isForwardSelection(s,a);if(this.modifiedProperties.length>0||"Selection"===this.action||"ClearCharacterFormat"===this.action||"ClearParagraphFormat"===this.action)r=this.owner.selection.getTextPosBasedOnLogicalIndex(s),o=this.owner.selection.getTextPosBasedOnLogicalIndex(a),this.revertModifiedProperties(r,o);else{var d=this.owner.selection,h=this.removedNodes;this.removedNodesIn=[];var c=kt.isForwardSelection(this.insertPosition,this.endPosition),p=d.getTextPosBasedOnLogicalIndex(c?this.insertPosition:this.endPosition),g=d.getTextPosBasedOnLogicalIndex(c?this.endPosition:this.insertPosition);if(this.lastElementRevision&&this.editorHistory.isUndoing&&t.isNullOrUndefined(this.endRevisionLogicalIndex)&&this.updateEndRevisionInfo(),"ClearRevisions"===this.action&&(this.undoRevisionForElements(p,g,h[h.length-1]),h=[]),"Uppercase"===this.action){d.selectPosition(p,g),this.editorHistory.currentBaseHistoryInfo=this;var u=this.owner.editorModule;return u.changeSelectedTextCase(d,p,g,this.action.toString(),h),void u.reLayout(d)}if(p.isAtSamePosition(g)?d.selectContent(p,!0):d.selectPosition(p,g),"InsertHyperlink"===this.action&&this.editorHistory.isRedoing){var m=this.owner.selection.getHyperlinkField();if(!t.isNullOrUndefined(m)){var f=m.line.getOffset(m,0);p.setPositionParagraph(m.line,f),this.owner.selection.start.setPositionInternal(p),f=m.fieldEnd.line.getOffset(m.fieldEnd,1),g.setPositionParagraph(m.fieldEnd.line,f)}}this.editorHistory.currentBaseHistoryInfo=this,this.selectionStart=this.insertPosition,this.insertPosition=void 0,this.selectionEnd=this.endPosition,this.endPosition=void 0;var v=!1;if(this.endRevisionLogicalIndex&&h.length>0){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing&&p.isAtSamePosition(g)){var y=d.getTextPosBasedOnLogicalIndex(this.endRevisionLogicalIndex);d.selectPosition(p,y)}this.editorHistory.isUndoing&&this.owner.editor.deleteSelectedContents(d,!0)}if(!p.isAtSamePosition(g)){v="BackSpace"===this.action||"Delete"===this.action||"ClearCells"===this.action||"DeleteCells"===this.action;var b=h.length>0&&"ParaMarkTrack"===this.action||"ClearRevisions"===this.action||"AcceptTOC"===this.action;v||"MergeCells"===this.action||"InsertRowAbove"===this.action||"InsertRowBelow"===this.action||"InsertColumnLeft"===this.action||"InsertColumnRight"===this.action||"Borders"===this.action||"DeleteTable"===this.action||"DeleteColumn"===this.action||"DeleteRow"===this.action||(d.end.setPositionInternal(g),this.owner.selection.isEmpty||b||(this.editorHistory.isRedoing&&"Accept Change"!==this.action&&"ParaMarkTrack"!==this.action&&"ParaMarkReject"!==this.action&&"RemoveRowTrack"!==this.action?this.owner.editorModule.removeSelectedContents(d):this.owner.editorModule.deleteSelectedContents(d,!0),!t.isNullOrUndefined(this.editorHistory.currentHistoryInfo)&&"PageBreak"===this.editorHistory.currentHistoryInfo.action&&this.documentHelper.blockToShift&&this.documentHelper.layout.shiftLayoutedItems(!1)))}var w=this.editorHistory.isRedoing&&!v;v=!this.lastElementRevision&&v,this.revertModifiedNodes(h,w,l?s:a,s===a),v&&this.removeContent(p,g)}var C=!1,x=!1;t.isNullOrUndefined(this.editorHistory.currentHistoryInfo)||"Reject All"!==this.editorHistory.currentHistoryInfo.action&&"Accept All"!==this.editorHistory.currentHistoryInfo.action||(x=!0),(!this.owner.trackChangesPane.isTrackingPageBreak&&((this.editorHistory.isUndoing||this.endRevisionLogicalIndex||"RemoveRowTrack"===this.action||x)&&t.isNullOrUndefined(this.editorHistory.currentHistoryInfo)||x)||("InsertRowAbove"===this.action||"Borders"===this.action||"InsertRowBelow"===this.action||"InsertColumnLeft"===this.action||"InsertColumnRight"===this.action||"Accept Change"===this.action||"PasteColumn"===this.action||"PasteRow"===this.action||"PasteOverwrite"===this.action||"PasteNested"===this.action)&&(this.editorHistory.isRedoing||"Paste"===this.editorHistory.currentHistoryInfo.action))&&("RemoveRowTrack"===this.action&&this.editorHistory.isRedoing?(r=this.owner.selection.getTextPosBasedOnLogicalIndex(this.selectionStart),o=this.owner.selection.getTextPosBasedOnLogicalIndex(this.selectionEnd)):(r=this.owner.selection.getTextPosBasedOnLogicalIndex(s),o=this.owner.selection.getTextPosBasedOnLogicalIndex(a)),this.owner.selection.selectRange(r,o),C=!0),this.owner.trackChangesPane.isTrackingPageBreak=!1,this.insertPosition=s,this.endPosition=a,t.isNullOrUndefined(this.editorHistory.currentHistoryInfo)||"Accept All"!==this.editorHistory.currentHistoryInfo.action&&"Reject All"!==this.editorHistory.currentHistoryInfo.action||this.owner.documentHelper.blockToShift&&this.owner.documentHelper.layout.shiftLayoutedItems(!1),this.owner.editorModule.reLayout(this.owner.selection,this.owner.selection.isEmpty),C&&this.documentHelper.scrollToPosition(this.owner.selection.start,this.owner.selection.end),this.highlightListText()},e.prototype.highlightListText=function(){if(!t.isNullOrUndefined(this.editorHistory.currentHistoryInfo)&&("ListCharacterFormat"===this.action||"ListSelect"===this.editorHistory.currentHistoryInfo.action&&"ListFormat"===this.action)){var e=this.owner.selection.getTextPosBasedOnLogicalIndex(this.selectionStart).currentWidget;this.documentHelper.selection.highlightListText(e)}},e.prototype.removeContent=function(e,i){if(!t.isNullOrUndefined(e.paragraph.containerWidget)&&e.paragraph.containerWidget instanceof fe&&!t.isNullOrUndefined(i.paragraph.containerWidget)&&i.paragraph.containerWidget instanceof fe||!t.isNullOrUndefined(e.paragraph.containerWidget)&&!t.isNullOrUndefined(i.paragraph.containerWidget)&&e.paragraph.containerWidget instanceof Pe&&i.paragraph.containerWidget instanceof Pe&&!t.isNullOrUndefined(e.paragraph.bodyWidget)||!t.isNullOrUndefined(e.paragraph.containerWidget)&&!t.isNullOrUndefined(i.paragraph.containerWidget)&&e.paragraph.containerWidget instanceof Xe&&i.paragraph.containerWidget instanceof Xe){this.owner.selection.selectRange(e,i);var n=!1;"BackSpace"!==this.action&&"Uppercase"!==this.action&&"RemoveRowTrack"!==this.action||(n=!0),this.owner.editorModule.deleteSelectedContents(this.owner.selection,n)}},e.prototype.updateEndRevisionInfo=function(){this.lastElementRevision=this.checkAdjacentNodeForMarkedRevision(this.lastElementRevision);var e=this.retrieveEndPosition(this.lastElementRevision),t=this.owner.selection.getParagraphInfo(e);this.endRevisionLogicalIndex=this.owner.selection.getHierarchicalIndex(t.paragraph,t.offset.toString()),this.lastElementRevision.isMarkedForRevision=!1},e.prototype.retrieveEndPosition=function(e){var t=new kt(this.owner),i=e.line.getOffset(e,0)+e.length;return t.setPositionFromLine(e.line,i),t},e.prototype.checkAdjacentNodeForMarkedRevision=function(e){for(var i,n=e.nextNode;!t.isNullOrUndefined(n)&&n.isMarkedForRevision;)i=n,n=n.nextNode;return t.isNullOrUndefined(i)?e:i},e.prototype.revertModifiedProperties=function(e,t){"CellFormat"!==this.action&&"CellOptions"!==this.action&&"TableOptions"!==this.action||(this.owner.isShiftingEnabled=!1),this.owner.selection.selectRange(e,t),"RowResizing"===this.action||"CellResizing"===this.action?this.revertResizing():"CellOptions"===this.action||"TableOptions"===this.action?this.revertTableDialogProperties(this.action):"Selection"!==this.action&&this.revertProperties()},e.prototype.redoAction=function(){var e=this.owner.editorModule;switch(this.action){case"BackSpace":e.singleBackspace(this.owner.selection,!0);break;case"Delete":e.singleDelete(this.owner.selection,!0);break;case"DeleteTable":e.deleteTable();break;case"DeleteColumn":e.deleteColumn();break;case"DeleteRow":e.deleteRow();break;case"MergeCells":e.mergeSelectedCellsInTable();break;case"InsertRowAbove":e.insertRow(!0);break;case"InsertRowBelow":e.insertRow(!1);break;case"InsertColumnLeft":case"InsertColumnRight":e.insertColumn(!0);break;case"SectionBreak":e.insertSection(this.owner.selection,!0);break;case"TableAutoFitToContents":e.autoFitTable("FitToContents");break;case"TableAutoFitToWindow":e.autoFitTable("FitToWindow");break;case"TableFixedColumnWidth":e.autoFitTable("FixedColumnWidth");break;case"RemoveRowTrack":this.owner.selection.handleAcceptReject(!0)}},e.prototype.revertModifiedNodes=function(e,i,n,r){if((!i||"BackSpace"!==this.action&&"Delete"!==this.action&&"DeleteTable"!==this.action&&"DeleteColumn"!==this.action&&"DeleteRow"!==this.action&&"InsertRowAbove"!==this.action&&"InsertRowBelow"!==this.action&&"InsertColumnLeft"!==this.action&&"InsertColumnRight"!==this.action&&"MergeCells"!==this.action&&"SectionBreak"!==this.action&&"TableAutoFitToContents"!==this.action&&"TableAutoFitToWindow"!==this.action&&"TableFixedColumnWidth"!==this.action&&"PasteColumn"!==this.action&&"PasteOverwrite"!==this.action&&"PasteNested"!==this.action||(this.redoAction(),"SectionBreak"!==this.action))&&e.length>0)if(this.editorHistory.isUndoing&&("RemoveRowTrack"===this.action||"DeleteCells"===this.action||"DeleteColumn"===this.action||"DeleteRow"===this.action||"MergeCells"===this.action)||"InsertRowAbove"===this.action||"InsertRowBelow"===this.action||"InsertColumnLeft"===this.action||"ClearCells"===this.action||"InsertColumnRight"===this.action||"Borders"===this.action||"TableAutoFitToContents"===this.action||"TableAutoFitToWindow"===this.action||"TableFixedColumnWidth"===this.action||"RemoveRowTrack"===this.action||"PasteColumn"===this.action||"PasteRow"===this.action||"PasteOverwrite"===this.action||"PasteNested"===this.action){var o=this.selectionStart,s=this.owner.editorModule.getBlock({index:o}).node,a=e[e.length-1];(s instanceof xe||s.previousRenderedWidget instanceof xe||s.isInsideTable)&&a instanceof xe?(s instanceof we&&!s.isInsideTable?s=s.previousRenderedWidget:s instanceof we&&s.isInsideTable&&(s=s.associatedCell.ownerTable),s=s.combineWidget(this.viewer),this.owner.editorModule.insertTableInternal(s,a,!1),"PasteColumn"===this.action||"PasteRow"===this.action||"PasteOverwrite"===this.action||"PasteNested"===this.action?this.removedNodes.push(s):e.splice(e.indexOf(a),1)):a instanceof xe&&this.owner.editorModule.insertBlock(a)}else{var l=n,s=this.owner.editorModule.getBlock({index:l}).node;if(e.length>0&&("BackSpace"===this.action&&r||!(s instanceof xe)&&!(s instanceof ve))){a=e[0];if(("TrackingPageBreak"===this.action||"SectionBreak"===this.action&&a instanceof fe||!t.isNullOrUndefined(this.editorHistory.currentHistoryInfo)&&"PageBreak"===this.editorHistory.currentHistoryInfo.action)&&(a=e[1]),a instanceof we&&this.owner.selection.start.offset>0&&(this.owner.editorModule.insertNewParagraphWidget(a,!0),a.characterFormat.removedIds.length>0&&this.owner.editor.constructRevisionFromID(a.characterFormat,void 0),e.splice(e.indexOf(a),1),t.isNullOrUndefined(s))){h=this.documentHelper.selection.getNextParagraphBlock(a.getSplitWidgets().pop());this.owner.selection.getNextRenderedBlock(a),t.isNullOrUndefined(h)&&this.owner.selection.selectParagraphInternal(a,!0)}if(a instanceof xe&&this.owner.selection.start.offset>0){var d=e[e.length-1];if(d instanceof we&&(this.owner.editorModule.insertNewParagraphWidget(d,!0),e.splice(e.indexOf(d),1),t.isNullOrUndefined(s))){var h=this.documentHelper.selection.getNextParagraphBlock(d.getSplitWidgets().pop());t.isNullOrUndefined(h)&&this.owner.selection.selectParagraphInternal(d,!0)}}}if(e.length>0){var c=e[e.length-1];if(s instanceof xe&&(s=s.combineWidget(this.viewer),c instanceof xe)){this.owner.editorModule.insertTableInternal(s,c,!0),e.splice(e.indexOf(c),1),this.insertPosition=n;var p=c.getSplitWidgets().pop();p.nextRenderedWidget instanceof xe?s=p.nextRenderedWidget:(l=n,s=this.owner.editorModule.getBlock({index:l}).node)}if(c instanceof we&&this.owner.selection.start.offset>0&&this.owner.selection.start.offset===this.owner.selection.getLineLength(this.owner.selection.start.paragraph.lastChild)){var g=this.owner.editorModule;g.insertNewParagraphWidget(c,!1),c.characterFormat.removedIds.length>0&&this.owner.editor.constructRevisionFromID(c.characterFormat,void 0),e.splice(e.indexOf(c),1),"Paste"!==this.action&&g.removeBlock(this.owner.selection.start.paragraph);var u=this.documentHelper.selection.getNextParagraphBlock(c.getSplitWidgets().pop());t.isNullOrUndefined(u)||this.owner.selection.selectParagraphInternal(u,!0)}else if(e[0]instanceof xe&&1!==e.length){var m=e[1];m instanceof we&&m.isEmpty()&&e.splice(e.indexOf(m),1)}}e.length>0&&(s instanceof xe&&(s=s.combineWidget(this.viewer)),this.insertRemovedNodes(e,s))}},e.prototype.insertRemovedNodes=function(e,t){for(var i=e.length-1;i>-1;i--){var n=e[i];if(n instanceof Se)this.owner.editorModule.insertInlineInSelection(this.owner.selection,n);else if(n instanceof ye)n instanceof Fe?t instanceof xe&&(t.childWidgets.splice(0,0,n),this.owner.editorModule.updateNextBlocksIndex(n,!0),0!==i&&e[i-1]instanceof Fe||this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1)):t instanceof xe?this.owner.editorModule.insertBlockTable(this.owner.selection,n,t):this.owner.editorModule.insertBlock(n);else if(n instanceof k){var r=this.selectionStart,o=this.owner.editorModule.getBlock({index:r}).node;o instanceof we&&(n.removedIds.length>0?(o.characterFormat.removedIds=n.removedIds.slice(),this.owner.editor.constructRevisionFromID(o.characterFormat,!0)):o.characterFormat.revisions.length>0&&(o.characterFormat=n.cloneFormat()))}else if(n instanceof fe)this.owner.editorModule.insertSection(this.owner.selection,!1);else if("string"==typeof n&&"AcceptTOC"===this.action){var r=this.selectionStart,s=this.owner.editorModule.getBlock({index:r}).node,a=this.owner.editorModule.getBlock({index:this.selectionEnd}).node,l=this.owner.documentHelper.revisionsInternal.get(n);if(this.editorHistory.isUndoing){for(;s instanceof we&&s!==a;)this.owner.editor.insertRevisionForBlock(s,l.revisionType,!0,l),s=this.documentHelper.selection.getNextParagraphBlock(s.getSplitWidgets().pop());this.owner.editor.insertRevisionForBlock(a,l.revisionType,!0,l)}else for(;l.range.length>0;){var d=l.range[0],h=d.revisions.indexOf(l);if(h>=0){d.revisions.splice(h,1);var c=l.range.indexOf(d);l.range.splice(c,1)}0===l.range.length&&this.owner.revisions.remove(l)}this.owner.editor.addRemovedNodes(l.revisionID)}}e=[]},e.prototype.undoRevisionForElements=function(e,t,i){var n=e.paragraph,r=t.paragraph,o=this.documentHelper.revisionsInternal.get(i),s=this.owner.selection.getParagraphInfo(e).offset,a=this.owner.selection.getParagraphInfo(t).offset,l=e.paragraph===t.paragraph;if(this.editorHistory.isUndoing){for(;n!==r;)this.owner.editor.applyRevisionForCurrentPara(n,s,n.getLength(),i,!0),(n=this.documentHelper.selection.getNextParagraphBlock(n.getSplitWidgets().pop()))!==r&&(s=0);n===r&&(l||(s=0),this.owner.editor.applyRevisionForCurrentPara(n,s,a,i,!1))}else for(;o.range.length>0;){var d=o.range[0],h=d.revisions.indexOf(o);if(h>=0){d.revisions.splice(h,1);var c=o.range.indexOf(d);o.range.splice(c,1)}0===o.range.length&&this.owner.revisions.remove(o)}this.removedNodes.push(i)},e.prototype.revertResizing=function(){if(this.editorHistory.currentBaseHistoryInfo=this,"RowResizing"===this.action)this.modifiedProperties[0]instanceof Kt&&this.modifiedProperties[0].revertChanges(this.editorHistory.isRedoing,this.owner);else if(this.modifiedProperties[0]instanceof Xt){0===this.owner.selection.selectedWidgets.length&&this.owner.selection.highlightSelection(!0);var e=this.modifiedProperties[0],t=e.tableHierarchicalIndex,i=this.owner.editorModule.getBlock({index:t}).node;if(i instanceof xe){var n=this.owner.editorModule.tableResize;if(this.owner.editor.setOffsetValue(this.owner.selection),i=i.combineWidget(this.owner.viewer),n.currentResizingTable=i,this.modifiedProperties.splice(0,1),this.editorHistory.isUndoing||this.editorHistory.isRedoing){var r=new Xt(i,this.owner);this.modifiedProperties.splice(0,0,r),this.owner.isLayoutEnabled=!1,n.applyProperties(n.currentResizingTable,e),n.currentResizingTable.isGridUpdated=!0,this.owner.isLayoutEnabled=!0,n.updateGridValue(n.currentResizingTable,!1),e.destroy(),e=void 0}}}},e.prototype.revertTableDialogProperties=function(e){if(this.owner.isShiftingEnabled=!1,this.editorHistory.currentBaseHistoryInfo=this,this.currentPropertyIndex=0,"CellOptions"===e){var t=this.owner.selection,i=this.modifiedProperties[0];this.owner.editorModule.updateCellMargins(t,i)}else"TableOptions"===e&&this.owner.tableOptionsDialogModule.applyTableOptionsHelper(this.modifiedProperties[0]);this.currentPropertyIndex=0,this.owner.isShiftingEnabled=!0},e.prototype.addModifiedPropertiesForSection=function(e,i,n){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var r=this.modifiedProperties,o=this.currentPropertyIndex<r.length?r[this.currentPropertyIndex]:r[r.length-1];t.isNullOrUndefined(i)?(n=o,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat()):(n=o.getPropertyValue(i),o.copyFormat(e)),this.currentPropertyIndex++}else if(t.isNullOrUndefined(i))this.modifiedProperties.push(e.cloneFormat());else{var s=new x;s.copyFormat(e),this.modifiedProperties.push(s)}return n},e.prototype.addModifiedProperties=function(e,i,n){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var r=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1],o=!1;if(e.ownerBase instanceof Se){var s=this.modifiedNodeLength[this.currentPropertyIndex];if(e.ownerBase.length<s){o=!0,this.modifiedNodeLength[this.currentPropertyIndex]=e.ownerBase.length,this.modifiedNodeLength.splice(this.currentPropertyIndex+1,0,s-e.ownerBase.length);var a=new k(void 0);a.copyFormat(r),this.modifiedProperties.splice(this.currentPropertyIndex+1,0,a)}}"ClearCharacterFormat"===this.action?this.editorHistory.isUndoing?(n=r,o||(this.modifiedProperties.splice(this.currentPropertyIndex,1),this.currentPropertyIndex--)):this.modifiedProperties.push(e.cloneFormat()):(n=r,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat()),this.currentPropertyIndex++}else{if(t.isNullOrUndefined(i))this.modifiedProperties.push(e.cloneFormat());else{var l=new k(void 0);l.copyFormat(e),this.modifiedProperties.push(l)}e.ownerBase instanceof Se?this.modifiedNodeLength.push(e.ownerBase.length):this.modifiedNodeLength.push(0)}return n},e.prototype.addModifiedPropertiesForParagraphFormat=function(e,i,n){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var r=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1];if("ClearParagraphFormat"===this.action)return this.editorHistory.isUndoing?(n=r,this.modifiedProperties.splice(this.currentPropertyIndex,1),this.currentPropertyIndex--):this.modifiedProperties.push(e.cloneFormat()),this.currentPropertyIndex++,n;if(t.isNullOrUndefined(i))return n=r,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat(),this.currentPropertyIndex++,n;if("listFormat"===i)return(n=new I(void 0)).copyFormat(r),r.listFormat=new T,r.listFormat.copyFormat(e.listFormat),this.currentPropertyIndex++,n;if("styleName"===i)return t.isNullOrUndefined(r.baseStyle)?void(t.isNullOrUndefined(e.baseStyle)||(r.baseStyle=new U,r.baseStyle.copyStyle(e.baseStyle))):((n=new U).copyStyle(r.baseStyle),this.currentPropertyIndex++,t.isNullOrUndefined(e.baseStyle)||(r.baseStyle=new U,r.baseStyle.copyStyle(e.baseStyle)),n);n=r.getPropertyValue(i),r.copyFormat(e),this.currentPropertyIndex++}else if(t.isNullOrUndefined(i))this.modifiedProperties.push(e.cloneFormat());else{var o=new I(void 0);o.copyFormat(e),this.modifiedProperties.push(o)}return n},e.prototype.addModifiedPropertiesForContinueNumbering=function(e,t){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing)return t=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1],this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat(),this.currentPropertyIndex++,t;var i=new I;return i.copyFormat(e),this.modifiedProperties.push(i),t},e.prototype.addModifiedPropertiesForRestartNumbering=function(e,t){return this.editorHistory.isUndoing||this.editorHistory.isRedoing?(t=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1],this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.listId:this.modifiedProperties[this.modifiedProperties.length-1]=e.listId,this.currentPropertyIndex++,t):(this.modifiedProperties.push(e.listId),t)},e.prototype.addModifiedPropertiesForList=function(e){var t;if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var i=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1];t=i,i=new qt(e,this.owner.editorModule.cloneListLevel(e)),this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=i:this.modifiedProperties[this.modifiedProperties.length-1]=i,this.currentPropertyIndex++}else this.modifiedProperties.push(new qt(e,this.owner.editorModule.cloneListLevel(e))),t=e;return t},e.prototype.revertProperties=function(){this.editorHistory.currentBaseHistoryInfo=this,this.currentPropertyIndex=0;var e=this.getProperty();if(this.viewer.owner.editorModule.setOffsetValue(this.documentHelper.selection),"ClearCharacterFormat"===this.action||this.modifiedProperties[0]instanceof k){if("ListCharacterFormat"===this.action)return void this.owner.editorModule.updateListCharacterFormat(this.documentHelper.selection,e,void 0);this.owner.editorModule.updateSelectionCharacterFormatting(e,void 0,!1)}else if("ClearParagraphFormat"===this.action||this.modifiedProperties[0]instanceof I){if("ContinueNumbering"===this.action)return void this.owner.editorModule.revertContinueNumbering(this.owner.selection,this.modifiedProperties[0]);if("StyleName"===this.action&&this.modifiedProperties[0]instanceof I)return void this.owner.editorModule.updateSelectionParagraphFormatting(e,this.modifiedProperties[0].baseStyle,!1);var t=this.owner.documentHelper.selection,i=(t.paragraphFormat.bidi||(this.modifiedProperties[0]instanceof I&&this.modifiedProperties[0]).bidi)&&(-1!==t.paragraphFormat.listId||"listFormat"===e);i||(this.owner.documentHelper.layout.isBidiReLayout=!0),this.owner.editorModule.updateSelectionParagraphFormatting(e,void 0,!1),i||(this.owner.documentHelper.layout.isBidiReLayout=!1)}else if(this.modifiedProperties[0]instanceof x)this.owner.editorModule.updateSectionFormat(e,void 0);else{if("RestartNumbering"===this.action)return void this.owner.editorModule.restartListAtInternal(this.owner.selection,this.modifiedProperties[0]);if(this.modifiedProperties[0]instanceof Bt)this.owner.selection.updateImageSize(this.modifiedProperties[0]);else if(this.modifiedProperties[0]instanceof qt){for(var n=new u,r=0;r<this.modifiedProperties.length;r++){var o=this.modifiedProperties[r];n.add(r,o)}this.editorHistory.updateListChanges(n),n.destroy(),n=void 0}else this.modifiedProperties[0]instanceof j?this.owner.editorModule.updateTableFormat(this.owner.selection,e,void 0):this.modifiedProperties[0]instanceof q?(this.owner.isShiftingEnabled=!0,this.owner.editorModule.updateCellFormat(this.owner.selection,e,void 0)):this.modifiedProperties[0]instanceof H&&this.owner.editorModule.updateRowFormat(this.owner.selection,e,void 0)}this.currentPropertyIndex=0,"ClearCharacterFormat"!==this.action&&"ClearParagraphFormat"!==this.action||this.owner.editorModule.getOffsetValue(this.documentHelper.selection)},e.prototype.addModifiedCellOptions=function(e,i,n){var r;return r=t.isNullOrUndefined(e.bottomMargin)&&t.isNullOrUndefined(e.topMargin)&&t.isNullOrUndefined(e.rightMargin)&&t.isNullOrUndefined(e.leftMargin)?this.copyCellOptions(n.tableFormat):this.copyCellOptions(e),this.editorHistory.isUndoing||this.editorHistory.isRedoing?(i=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1],this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=this.copyCellOptions(e):this.modifiedProperties[this.modifiedProperties.length-1]=this.copyCellOptions(e),this.currentPropertyIndex++,i):(this.modifiedProperties.push(r),i)},e.prototype.copyCellOptions=function(e){var t=new q;return t.topMargin=e.topMargin,t.rightMargin=e.rightMargin,t.bottomMargin=e.bottomMargin,t.leftMargin=e.leftMargin,t},e.prototype.addModifiedTableOptions=function(e){var t=this.copyTableOptions(e);if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1];this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties.splice(this.currentPropertyIndex,1,t):this.modifiedProperties.splice(this.modifiedProperties.length-1,1,t),this.currentPropertyIndex++}else this.modifiedProperties.push(t)},e.prototype.copyTableOptions=function(e){var t=new j;return t.topMargin=e.topMargin,t.rightMargin=e.rightMargin,t.bottomMargin=e.bottomMargin,t.leftMargin=e.leftMargin,t.cellSpacing=e.cellSpacing,t},e.prototype.getProperty=function(){switch(this.action){case"Bold":return"bold";case"Italic":return"italic";case"FontColor":return"fontColor";case"FontFamily":return"fontFamily";case"FontSize":return"fontSize";case"HighlightColor":return"highlightColor";case"BaselineAlignment":return"baselineAlignment";case"Strikethrough":return"strikethrough";case"Underline":return"underline";case"AfterSpacing":return"afterSpacing";case"BeforeSpacing":return"beforeSpacing";case"LeftIndent":return"leftIndent";case"RightIndent":return"rightIndent";case"FirstLineIndent":return"firstLineIndent";case"LineSpacingType":return"lineSpacingType";case"LineSpacing":return"lineSpacing";case"TextAlignment":return"textAlignment";case"ListFormat":return"listFormat";case"PageHeight":return"pageHeight";case"PageWidth":return"pageWidth";case"TableAlignment":return"tableAlignment";case"TableLeftIndent":return"leftIndent";case"DefaultCellSpacing":return"cellSpacing";case"LeftMargin":case"CellLeftMargin":case"DefaultCellLeftMargin":return"leftMargin";case"RightMargin":case"CellRightMargin":case"DefaultCellRightMargin":return"rightMargin";case"TopMargin":case"CellTopMargin":case"DefaultCellTopMargin":return"topMargin";case"BottomMargin":case"CellBottomMargin":case"DefaultCellBottomMargin":return"bottomMargin";case"CellContentVerticalAlignment":return"verticalAlignment";case"RowHeight":return"height";case"RowHeightType":return"heightType";case"RowHeader":return"isHeader";case"AllowBreakAcrossPages":return"allowBreakAcrossPages";case"TablePreferredWidth":case"CellPreferredWidth":return"preferredWidth";case"TablePreferredWidthType":case"CellPreferredWidthType":return"preferredWidthType";case"Shading":return"shading";case"StyleName":return"styleName";case"ParagraphBidi":case"TableBidi":return"bidi";case"ContextualSpacing":return"contextualSpacing"}},e.prototype.getCharacterPropertyValue=function(e,t){var i;return"bold"===e?i=t.bold:"italic"===e?i=t.italic:"fontColor"===e?i=t.fontColor:"fontFamily"===e?i=t.fontFamily:"fontSize"===e?i=t.fontSize:"highlightColor"===e?i=t.highlightColor:"baselineAlignment"===e?i=t.baselineAlignment:"strikethrough"===e?i=t.strikethrough:"underline"===e&&(i=t.underline),i},e.prototype.addModifiedTableProperties=function(e,i,n){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var r=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1];if(t.isNullOrUndefined(i))return n=r,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat(),this.currentPropertyIndex++,n;n="shading"===i?r.shading:r.getPropertyValue(i),r.copyFormat(e),this.currentPropertyIndex++}else{var o=new j;o.copyFormat(e),this.modifiedProperties.push(o)}return n},e.prototype.addModifiedRowProperties=function(e,i,n){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var r=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1];if(t.isNullOrUndefined(i))return n=r,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat(),this.currentPropertyIndex++,n;n=r.getPropertyValue(i),r.copyFormat(e),this.currentPropertyIndex++}else{var o=new H;o.copyFormat(e),this.modifiedProperties.push(o)}return n},e.prototype.addModifiedCellProperties=function(e,i,n){if(this.editorHistory.isUndoing||this.editorHistory.isRedoing){var r=this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]:this.modifiedProperties[this.modifiedProperties.length-1];if(t.isNullOrUndefined(i))return n=r,this.currentPropertyIndex<this.modifiedProperties.length?this.modifiedProperties[this.currentPropertyIndex]=e.cloneFormat():this.modifiedProperties[this.modifiedProperties.length-1]=e.cloneFormat(),this.currentPropertyIndex++,n;n="shading"===i?r.shading:r.getPropertyValue(i),r.copyFormat(e),this.currentPropertyIndex++}else{var o=new q;o.copyFormat(e),this.modifiedProperties.push(o)}return n},e.prototype.destroy=function(){if(this.selectionStart=void 0,this.selectionEnd=void 0,this.insertPosition=void 0,this.endPosition=void 0,t.isNullOrUndefined(this.modifiedNodeLength)||(this.modifiedNodeLength=[],this.modifiedNodeLength=void 0),!t.isNullOrUndefined(this.modifiedProperties)){for(i=0;i<this.modifiedProperties.length;i++){var e=this.modifiedProperties[i];e instanceof k?e.destroy():e instanceof I?e.destroy():e instanceof x?e.destroy():e instanceof qt&&e.destroy(),this.modifiedProperties.splice(this.modifiedProperties.indexOf(e),1),i--}this.modifiedPropertiesIn=void 0}if(!t.isNullOrUndefined(this.removedNodes)){for(var i=0;i<this.removedNodes.length;i++){var n=this.removedNodes[i];n instanceof we?n.destroyInternal(this.viewer):n instanceof Se&&n.destroy(),this.removedNodes.splice(this.removedNodes.indexOf(n),1),i--}this.removedNodesIn=void 0}this.ownerIn=void 0},e}(),ei=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ti=function(e){function i(t,i){var n=e.call(this,t)||this;return n.isChildHistoryInfo=!1,n.editRangeStart=void 0,n.documentHelper=t.documentHelper,n.isChildHistoryInfo=i,n}return ei(i,e),Object.defineProperty(i.prototype,"hasAction",{get:function(){return!t.isNullOrUndefined(this.modifiedActions)},enumerable:!0,configurable:!0}),i.prototype.addModifiedAction=function(e){this.editorHistory.isUndoing||this.editorHistory.isRedoing||(t.isNullOrUndefined(this.modifiedActions)&&(this.modifiedActions=[]),this.modifiedActions.push(e))},i.prototype.revert=function(){if(this.editorHistory.currentHistoryInfo=this,"BordersAndShading"===this.action&&(this.owner.editorModule.isBordersAndShadingDialog=!0),!t.isNullOrUndefined(this.modifiedActions))if(this.editorHistory.isUndoing)for(e=this.modifiedActions.length;e>0;)(i=this.modifiedActions[e-1]).revert(),e-=1;else for(var e=0;e<this.modifiedActions.length;){var i=this.modifiedActions[e];i.revert(),e+=1}if("RestrictEditing"===this.action){var n=""!==this.editRangeStart.user?this.editRangeStart.user:this.editRangeStart.group;if(this.editorHistory.isUndoing){var r=this.owner.documentHelper.editRanges.get(n).indexOf(this.editRangeStart);-1!==r&&this.owner.documentHelper.editRanges.get(n).splice(r,1)}else this.owner.editor.updateRangeCollection(this.editRangeStart,n);this.owner.selection.updateEditRangeCollection()}this.isChildHistoryInfo?this.editorHistory.updateComplexHistoryInternal():this.editorHistory.updateComplexHistory()},i.prototype.destroy=function(){if(!t.isNullOrUndefined(this.modifiedActions)){for(;this.modifiedActions.length>0;){var i=this.modifiedActions[this.modifiedActions.length-1];i.destroy(),this.modifiedActions.splice(this.modifiedActions.indexOf(i),1)}this.modifiedActions=void 0}e.prototype.destroy.call(this)},i}($t),ii=function(){function e(e){this.undoStackIn=[],this.redoStackIn=[],this.historyInfoStack=[],this.isUndoing=!1,this.isRedoing=!1,this.owner=e,this.documentHelper=e.documentHelper,this.modifiedParaFormats=new u,this.undoLimitIn=500,this.redoLimitIn=500}return Object.defineProperty(e.prototype,"currentHistoryInfo",{get:function(){return this.historyInfoStack&&this.historyInfoStack.length>0?this.historyInfoStack[this.historyInfoStack.length-1]:void 0},set:function(e){e instanceof ti?this.historyInfoStack.push(e):this.historyInfoStack.pop()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"undoStack",{get:function(){return this.undoStackIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"redoStack",{get:function(){return this.redoStackIn},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"undoLimit",{get:function(){return t.isNullOrUndefined(this.undoLimitIn)?0:this.undoLimitIn},set:function(e){if(e<0)throw new Error("The limit should be greater than or equal to zero.");this.undoLimitIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"redoLimit",{get:function(){return t.isNullOrUndefined(this.redoLimitIn)?0:this.redoLimitIn},set:function(e){if(e<0)throw new Error("The limit should be greater than or equal to zero.");this.redoLimitIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"EditorHistory"},e.prototype.canUndo=function(){return!t.isNullOrUndefined(this.undoStack)&&this.undoStack.length>0},e.prototype.canRedo=function(){return!t.isNullOrUndefined(this.redoStack)&&this.redoStack.length>0},e.prototype.initializeHistory=function(e){this.currentBaseHistoryInfo=new $t(this.owner),this.currentBaseHistoryInfo.action=e,this.currentBaseHistoryInfo.updateSelection()},e.prototype.initComplexHistory=function(e,i){this.currentHistoryInfo=new ti(e.owner,!t.isNullOrUndefined(this.currentHistoryInfo)),this.currentHistoryInfo.action=i,this.currentHistoryInfo.updateSelection()},e.prototype.initResizingHistory=function(e,i){if(1===i.resizeNode)this.initializeHistory("RowResizing"),t.isNullOrUndefined(this.currentBaseHistoryInfo)||this.currentBaseHistoryInfo.modifiedProperties.push(new Kt(e,i.currentResizingTable.childWidgets[i.resizerPosition].rowFormat));else if(this.initializeHistory("CellResizing"),this.currentBaseHistoryInfo){i.currentResizingTable=i.currentResizingTable.combineWidget(this.viewer);var n=new Xt(i.currentResizingTable,this.owner);n.startingPoint=e,this.currentBaseHistoryInfo.modifiedProperties.push(n)}},e.prototype.updateResizingHistory=function(e,i){if(1===i.resizeNode){if(!t.isNullOrUndefined(this.currentBaseHistoryInfo)){var n=this.currentBaseHistoryInfo.modifiedProperties[0];n.startingPoint.y===e.y?this.currentBaseHistoryInfo.modifiedProperties.length=0:(n.displacement=L.convertPixelToPoint(e.y-n.startingPoint.y),this.recordChanges(this.currentBaseHistoryInfo),this.currentBaseHistoryInfo=void 0)}}else if(!t.isNullOrUndefined(this.currentBaseHistoryInfo)){var r=this.currentBaseHistoryInfo.modifiedProperties[0];r.startingPoint.x===e.x?this.currentBaseHistoryInfo.modifiedProperties.length=0:(r.displacement=L.convertPixelToPoint(e.x-r.startingPoint.x),r.endIndex=i.getCellReSizerPosition(e),this.owner.editorHistory.recordChanges(this.currentBaseHistoryInfo),this.currentBaseHistoryInfo=void 0)}},e.prototype.recordChanges=function(e){if(this.owner.enableHistoryMode)if(this.isUndoing){if(t.isNullOrUndefined(this.redoStack)&&(this.redoStackIn=[]),this.redoStack.length===this.redoLimit&&this.redoLimit>0){i=this.undoLimit>20?10:1;this.redoStackIn.splice(0,i)}this.redoStack.length<this.redoLimit&&this.redoStack.push(e)}else{if(this.isRedoing||this.clearRedoStack(),t.isNullOrUndefined(this.undoStack)&&(this.undoStackIn=[]),this.undoStack.length===this.undoLimit&&this.undoLimit>0){var i=this.undoLimit>20?10:1;this.undoStackIn.splice(0,i)}this.undoStack.length<this.undoLimit&&this.undoStackIn.push(e)}},e.prototype.updateHistory=function(){this.documentHelper.owner.enableHistoryMode&&!t.isNullOrUndefined(this.currentBaseHistoryInfo)&&(!t.isNullOrUndefined(this.currentBaseHistoryInfo)&&t.isNullOrUndefined(this.currentBaseHistoryInfo.endPosition)&&(this.currentBaseHistoryInfo.endPosition=this.currentBaseHistoryInfo.insertPosition),t.isNullOrUndefined(this.currentHistoryInfo)?this.recordChanges(this.currentBaseHistoryInfo):this.currentHistoryInfo.addModifiedAction(this.currentBaseHistoryInfo),this.currentBaseHistoryInfo=void 0)},e.prototype.isHandledComplexHistory=function(){var e=!1;return this.isUndoing||this.isRedoing||(e=this.owner.editorModule.insertRemoveBookMarkElements()),this.documentHelper.owner.enableHistoryMode&&!t.isNullOrUndefined(this.currentHistoryInfo)?(this.updateHistory(),e=!0):this.owner.editorModule.isHandledComplex&&(e=!0),e},e.prototype.updateComplexHistory=function(){var e=this.documentHelper.selection;if(this.currentHistoryInfo.hasAction){if("AutoFormatHyperlink"===this.currentHistoryInfo.action||"SkipCommentInline"===this.currentHistoryInfo.action||"DeleteCommentInline"===this.currentHistoryInfo.action){t=new kt(e.owner);this.owner.editorModule.setPositionForCurrentIndex(t,this.currentHistoryInfo.insertPosition),e.owner.editorHistory.isUndoing?(this.owner.editorModule.setPositionForCurrentIndex(e.start,this.currentHistoryInfo.selectionStart),this.owner.editorModule.setPositionForCurrentIndex(e.end,this.currentHistoryInfo.selectionEnd)):(this.owner.editorModule.setPositionForCurrentIndex(e.start,this.currentHistoryInfo.endPosition),this.owner.editorModule.setPositionForCurrentIndex(e.end,this.currentHistoryInfo.endPosition))}if("InsertHyperlink"===this.currentHistoryInfo.action){var t=new kt(e.owner);this.owner.editorModule.setPositionForCurrentIndex(t,this.currentHistoryInfo.insertPosition);var i=new kt(e.owner);this.owner.editorModule.setPositionForCurrentIndex(i,this.currentHistoryInfo.endPosition),this.documentHelper.layout.reLayoutParagraph(t.paragraph,0,0),i.paragraph!==t.paragraph&&this.documentHelper.layout.reLayoutParagraph(i.paragraph,0,0)}"ReplaceAll"===this.currentHistoryInfo.action?this.owner.editorModule.layoutWholeDocument():e.owner.isShiftingEnabled&&(this.documentHelper.layout.shiftLayoutedItems(!1),this.owner.enableHeaderAndFooter&&this.owner.editorModule.updateHeaderFooterWidget(),this.documentHelper.removeEmptyPages())}this.owner.showRevisions&&this.owner.trackChangesPane.updateTrackChanges(),e.owner.isShiftingEnabled=!1,e.owner.isLayoutEnabled=!0,"ApplyStyle"===this.currentHistoryInfo.action?this.owner.editor.getOffsetValue(e):(e.start.updatePhysicalPosition(!0),e.isEmpty?e.end.setPositionInternal(e.start):e.end.updatePhysicalPosition(!0)),e.upDownSelectionLength=e.end.location.x,this.documentHelper.isScrollHandler=!0,this.viewer.updateScrollBars(),e.fireSelectionChanged(!0),this.documentHelper.isScrollHandler=!1,this.documentHelper.updateFocus(),this.updateComplexHistoryInternal(),this.owner.editorModule.fireContentChange()},e.prototype.updateComplexHistoryInternal=function(){t.isNullOrUndefined(this.currentHistoryInfo)||(t.isNullOrUndefined(this.currentHistoryInfo.endPosition)&&(this.currentHistoryInfo.endPosition=this.currentHistoryInfo.insertPosition),this.historyInfoStack.length>1?this.historyInfoStack[this.historyInfoStack.length-2].addModifiedAction(this.currentHistoryInfo):this.recordChanges(this.currentHistoryInfo),this.currentHistoryInfo=void 0)},e.prototype.updateListChangesInHistory=function(e,i){this.currentBaseHistoryInfo=new $t(this.documentHelper.owner),this.currentBaseHistoryInfo.action="List",this.currentBaseHistoryInfo.updateSelection();for(var n=new u,r=0;r<e.levels.length;r++){var o=this.documentHelper.getAbstractListById(i.abstractListId).levels[r];this.currentBaseHistoryInfo.addModifiedPropertiesForList(o);var s=new qt(o,e.levels[r]);t.isNullOrUndefined(o)||this.documentHelper.owner.editorModule.copyListLevel(o,e.levels[r]),n.add(r,s)}return n},e.prototype.applyListChanges=function(e,i){t.isNullOrUndefined(this.modifiedParaFormats)&&(this.modifiedParaFormats=new u);for(var n=[],r=0;r<this.documentHelper.listParagraphs.length;r++){var o=this.documentHelper.listParagraphs[r].paragraphFormat,s=this.documentHelper.getListById(o.listFormat.listId),a=this.documentHelper.layout.getListLevel(s,o.listFormat.listLevelNumber);if(i.containsKey(o.listFormat.listLevelNumber)&&i.get(o.listFormat.listLevelNumber).ownerListLevel===a){var l=new I(null);l.leftIndent=o.leftIndent,l.firstLineIndent=o.firstLineIndent;var d=new Gt(o,l);n.push(d),this.owner.editorModule.copyFromListLevelParagraphFormat(o,a.paragraphFormat)}}this.modifiedParaFormats.add(this.currentBaseHistoryInfo,n)},e.prototype.updateListChanges=function(e){this.documentHelper.owner.isLayoutEnabled=!1,this.owner.editorModule.updateListParagraphs();for(var i=0;i<e.keys.length;i++){var n=e.keys[0],r=e.get(n);t.isNullOrUndefined(this.currentBaseHistoryInfo)||(r=this.currentBaseHistoryInfo.addModifiedPropertiesForList(r.ownerListLevel)),this.owner.editorModule.copyListLevel(r.ownerListLevel,r.modifiedListLevel)}this.revertListChanges(),this.documentHelper.owner.isLayoutEnabled=!0,this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[],this.documentHelper.pages=[],this.documentHelper.layout.layout();var o=this.documentHelper.selection;o.start.updatePhysicalPosition(!0),o.isEmpty?o.end.setPositionInternal(o.start):o.end.updatePhysicalPosition(!0),o.upDownSelectionLength=o.end.location.x,o.fireSelectionChanged(!1),this.updateHistory()},e.prototype.revertListChanges=function(){if(!t.isNullOrUndefined(this.currentBaseHistoryInfo)&&this.documentHelper.owner.editorHistory.modifiedParaFormats.containsKey(this.currentBaseHistoryInfo))for(var e=this.modifiedParaFormats.get(this.currentBaseHistoryInfo),i=0;i<e.length;i++){var n=new I(null);n.leftIndent=e[i].ownerFormat.leftIndent,n.firstLineIndent=e[i].ownerFormat.firstLineIndent,e[i].ownerFormat.copyFormat(e[i].modifiedFormat),e[i].modifiedFormat.leftIndent=n.leftIndent,e[i].modifiedFormat.firstLineIndent=n.firstLineIndent}},e.prototype.undo=function(){if((!this.owner.isReadOnlyMode||"FormFieldsOnly"===this.owner.documentHelper.protectionType)&&this.canUndo()&&this.owner.enableHistoryMode){var e=this.undoStack.pop();this.isUndoing=!0,e.revert(),this.isUndoing=!1,this.owner.selection.checkForCursorVisibility(),this.owner.editorModule.isBordersAndShadingDialog=!1}},e.prototype.redo=function(){if((!this.owner.isReadOnlyMode||"FormFieldsOnly"===this.owner.documentHelper.protectionType)&&this.canRedo()&&this.owner.enableHistoryMode){var e=this.redoStack.pop();"BordersAndShading"===e.action&&(this.owner.editorModule.isBordersAndShadingDialog=!0),this.isRedoing=!0,e.revert(),this.isRedoing=!1,this.owner.selection.checkForCursorVisibility(),this.owner.editorModule.isBordersAndShadingDialog=!1}},e.prototype.destroy=function(){this.clearHistory(),this.undoStackIn=void 0,this.redoStackIn=void 0},e.prototype.clearHistory=function(){this.clearUndoStack(),this.clearRedoStack()},e.prototype.clearUndoStack=function(){if(this.canUndo())for(;this.undoStack.length>0;){var e=this.undoStack.pop();e.destroy(),e=void 0}},e.prototype.clearRedoStack=function(){if(this.canRedo())for(;this.redoStack.length>0;){var e=this.redoStack.pop();e.destroy(),e=void 0}},e}(),ni=function(){function e(e){this.resizeNode=0,this.resizerPosition=-1,this.currentResizingTable=void 0,this.owner=e,this.documentHelper=this.owner.documentHelper,this.startingPoint=new R(0,0)}return Object.defineProperty(e.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"TableResizer"},e.prototype.updateResizingHistory=function(e){this.owner.editorHistory&&this.owner.editorHistory.updateResizingHistory(e,this),this.documentHelper.isRowOrCellResizing=!1,this.resizerPosition=-1},e.prototype.handleResize=function(e){this.owner.documentHelper.isRowOrCellResizing=!0,this.startingPoint.x=e.x,this.startingPoint.y=e.y,this.owner.editorHistory.initResizingHistory(e,this)},e.prototype.isInRowResizerArea=function(e){var t=this.getRowReSizerPosition(void 0,e);return-1!==t&&(this.resizeNode=1,this.resizerPosition=t,!0)},e.prototype.isInCellResizerArea=function(e){var t=this.getCellReSizerPosition(e);return-1!==t&&(this.resizeNode=0,this.resizerPosition=t,!0)},e.prototype.getCellReSizerPosition=function(e){var i=-1,n=this.getTableWidget(e),r=this.getTableCellWidget(e),o=t.isNullOrUndefined(n)?0:n.tableFormat.cellSpacing;if(n&&o>0){if(this.currentResizingTable=n,this.documentHelper.isInsideRect(n.x-L.convertPointToPixel(n.leftBorderWidth)-.25,n.y,L.convertPointToPixel(n.leftBorderWidth)+.5,n.height,e))return i=0;for(var s=n.x,a=0;a<n.tableHolder.columns.length;a++){var l=L.convertPointToPixel(n.tableHolder.columns[a].preferredWidth);if(this.documentHelper.isInsideRect(s-1,n.y,n.leftBorderWidth+2,n.height,e))return i=a>0?a:0;if(a>0&&this.documentHelper.isInsideRect(s+l-1,n.y,2,n.height,e))return i=a+1;s+=l}}else if(!t.isNullOrUndefined(r)){if(this.currentResizingTable=r.ownerTable,this.documentHelper.isInsideRect(r.x-r.margin.left-1,r.y-r.margin.top,2,r.height+r.margin.top+r.margin.bottom,e))return i=r.columnIndex;if(t.isNullOrUndefined(r.nextRenderedWidget)&&this.documentHelper.isInsideRect(r.x+r.margin.right+r.width-1,r.y-r.margin.top,2,r.height+r.margin.top+r.margin.bottom,e))return i=r.columnIndex+r.cellFormat.columnSpan;if(r.childWidgets.length>0)return this.getCellReSizerPositionInternal(r,e)}return i},e.prototype.getCellReSizerPositionInternal=function(e,i){var n=-1,r=this.getTableWidgetFromWidget(i,e),o=void 0;if(!t.isNullOrUndefined(r)&&r.tableFormat.cellSpacing>0){if(this.currentResizingTable=r,this.documentHelper.isInsideRect(r.x-r.leftBorderWidth-.25,r.y,r.leftBorderWidth+.5,r.height,i))return n=0;for(var s=r.x,a=0;a<r.tableHolder.columns.length;a++){var l=L.convertPointToPixel(r.tableHolder.columns[a].preferredWidth);if(this.documentHelper.isInsideRect(s-1,r.y,r.leftBorderWidth+2,r.height,i))return n=a>0?a:0;if(a>0&&this.documentHelper.isInsideRect(s+l-1,r.y,2,r.height,i))return n=a+1;s+=l}}else if(t.isNullOrUndefined(r)||(o=r.getTableCellWidget(i)),!t.isNullOrUndefined(o)){if(this.currentResizingTable=o.ownerTable,this.documentHelper.isInsideRect(o.x-o.margin.left-1,o.y-o.margin.top,2,o.height,i))return n=o.columnIndex;if(t.isNullOrUndefined(o.nextRenderedWidget)&&this.documentHelper.isInsideRect(o.x+o.margin.right+o.width-1,o.y-o.margin.top,2,o.height,i))return n=o.columnIndex+o.cellFormat.columnSpan;if(o.childWidgets.length>0)return this.getCellReSizerPositionInternal(o,i)}return n},e.prototype.getRowReSizerPosition=function(e,i){var n=void 0,r=void 0;t.isNullOrUndefined(e)?(n=this.getTableWidget(i),r=this.getTableCellWidget(i)):n=this.getTableWidgetFromWidget(i,e);var o=t.isNullOrUndefined(n)?0:n.tableFormat.cellSpacing;if(n&&o>0){if(this.currentResizingTable=n,this.owner.documentHelper.isInsideRect(n.x,n.y+n.height-o,this.getActualWidth(n.lastChild),t.isNullOrUndefined(n.nextSplitWidget)?n.bottomBorderWidth+o:0,i))return n.lastChild.rowIndex;for(var s=0;s<n.childWidgets.length;s++){var a=n.childWidgets[s];if(n.childWidgets.indexOf(a)>-1&&this.owner.documentHelper.isInsideRect(a.x,a.y+a.height+o/2,this.getActualWidth(a),o/2,i))return a.rowIndex}}else if(n&&r&&(r=this.getTableCellWidget(i)),r){var l=0;if(l=(a=r.containerWidget).rowIndex===a.ownerTable.childWidgets.length-1?a.bottomBorderWidth+2:a.nextRenderedWidget.topBorderWidth+2,this.owner.documentHelper.isInsideRect(a.x,a.y+a.height-l,a.width,2*l,i))return this.currentResizingTable=a.ownerTable,a.rowIndex;if(r.childWidgets.length>0)return this.getRowReSizerPosition(r,i)}return-1},e.prototype.handleResizing=function(e){var t=0;0===this.resizeNode?(t=e.x-this.startingPoint.x,this.resizeTableCellColumn(t)):(t=e.y-this.startingPoint.y,this.resizeTableRow(t))},e.prototype.resizeTableRow=function(e){var i=this.currentResizingTable;if(!t.isNullOrUndefined(i)&&0!==e&&-1!==this.resizerPosition){var n=this.owner.selection;i.isInsideTable&&(this.owner.isLayoutEnabled=!1);var r=void 0;if(this.resizerPosition>-1&&((r=i.childWidgets[this.resizerPosition])&&this.updateRowHeight(r,e),n.selectPosition(n.start,n.end)),i.isInsideTable){var o=this.owner.documentHelper.layout.getParentTable(i);this.owner.isLayoutEnabled=!0,i=o}this.startingPoint.y+=L.convertPointToPixel(e),this.owner.documentHelper.layout.reLayoutTable(i),this.owner.editorModule.reLayout(this.owner.selection),r&&this.getRowReSizerPosition(void 0,this.startingPoint),!this.currentResizingTable||void 0!==this.currentResizingTable.childWidgets&&void 0!==this.currentResizingTable.childWidgets[this.resizerPosition]||(this.resizerPosition=-1)}},e.prototype.getTableWidget=function(e){var i=void 0,n=this.owner.documentHelper.currentPage;if(!t.isNullOrUndefined(n))for(var r=0;r<n.bodyWidgets.length;r++){var o=n.bodyWidgets[r];if(i=this.getTableWidgetFromWidget(e,o),!t.isNullOrUndefined(i))break}return i},e.prototype.getTableWidgetFromWidget=function(e,t){for(var i=0;i<t.childWidgets.length;i++)if(t.childWidgets[i]instanceof xe){var n=t.childWidgets[i];if(n.y<=e.y&&n.y+n.height>=e.y)return n}},e.prototype.getTableCellWidget=function(e){var i=void 0,n=this.owner.documentHelper.currentPage;if(!t.isNullOrUndefined(n))for(var r=0;r<n.bodyWidgets.length&&(i=n.bodyWidgets[r].getTableCellWidget(e),t.isNullOrUndefined(i));r++);return i},e.prototype.updateRowHeight=function(e,t){var i=e.rowFormat;if("Auto"===i.heightType){i.heightType="AtLeast";var n=i.ownerBase,r=this.owner.documentHelper.layout.getRowHeight(n,[n]);r+t>=2.7&&i.height!==r+t&&(i.height=r+t)}else i.height+t>=2.7&&i.height!==i.height+t&&(i.height=i.height+t)},e.prototype.resizeTableCellColumn=function(e){var i=this.currentResizingTable;if(!(t.isNullOrUndefined(i)||0===e||t.isNullOrUndefined(i.childWidgets)||this.resizerPosition<0)){var n=!0,r=this.owner.selection;this.owner.editor.setOffsetValue(r),i=i.combineWidget(this.viewer),this.owner.isLayoutEnabled=!1,this.setPreferredWidth(i);var o=i.getOwnerWidth(!0),s=i.leftIndent,a=i.tableFormat.tableAlignment;if(r.isEmpty||(n=this.resizeColumnWithSelection(r,i,e)),!n)return void(this.owner.isLayoutEnabled=!0);if(0===this.resizerPosition){var l=this.resizerPosition,d=i.tableHolder.columns[l],h=d.preferredWidth;if(e>0){c=e;do{if((p=L.round(d.preferredWidth-e,1))>=d.minWidth){d.preferredWidth=p,s=(s=i.leftIndent+e)>=-1440?s<=1440?s:1440:-1440;break}c=e,e+=p-d.minWidth}while(e!==c)}else{var c=e;do{var p=L.round(d.preferredWidth-e,1);if(p<=2112){d.preferredWidth=p,s=(s=i.leftIndent+e)>=-1440?s<=1440?s:1440:-1440;break}c=e,e-=p-2112}while(e!==c)}var g=e;"Left"!==a&&i.tableHolder.getTotalWidth(0)>o&&"Auto"===i.tableFormat.preferredWidthType&&(i.tableHolder.isFitColumns(o,i.tableHolder.tableWidth,"Auto"===i.tableFormat.preferredWidthType)?i.tableHolder.fitColumns(o,i.tableHolder.tableWidth,"Auto"===i.tableFormat.preferredWidthType):d.preferredWidth=h,g=0),"Center"===a&&(i.tableHolder.getTotalWidth(0)<o||"Auto"!==i.tableFormat.preferredWidthType)&&(g/=2),i.tableFormat.leftIndent="Left"===a?s:0,i.tableHolder.tableWidth=i.tableHolder.getTotalWidth(0),this.updateCellPreferredWidths(i),this.updateGridValue(i,!0,g)}else if(null!==i&&this.resizerPosition===i.tableHolder.columns.length)this.resizeColumnAtLastColumnIndex(i,e,o);else{if(-1===this.resizerPosition)return void(this.owner.isLayoutEnabled=!0);this.resizeCellAtMiddle(i,e)}this.owner.isLayoutEnabled=!0,r.selectPosition(r.start,r.end)}},e.prototype.resizeColumnWithSelection=function(e,t,i){var n=this.getTableCellWidget(this.startingPoint);if(n&&(e.selectedWidgets.containsKey(n)||n.previousWidget&&e.selectedWidgets.containsKey(n.previousWidget))){var r=e.getSelectedCells();if(0===this.resizerPosition)this.resizeColumnAtStart(t,i,r);else if(null!==t&&this.resizerPosition===t.tableHolder.columns.length){for(var o=this.getColumnCells(t,this.resizerPosition,!0),s=0;s<o.length;s++){var a=o[s];-1!==r.indexOf(a)&&this.increaseOrDecreaseWidth(a,i,!0)}this.updateRowsGridAfterWidth(t),t.updateWidth(i),t.tableFormat.allowAutoFit=!1,this.updateGridValue(t,!0,i)}else{if(-1===this.resizerPosition)return!1;var l=this.resizerPosition,o=this.getColumnCells(t,l,!0),d=this.getColumnCells(t,l,!1),h=this.isColumnSelected(t,l);if(o.length>0&&!h)for(s=0;s<o.length;s++)-1===r.indexOf(o[s])&&(o.splice(s,1),s--);if(d.length>0&&!h)for(s=0;s<d.length;s++)-1===r.indexOf(d[s])&&(d.splice(s,1),s--);if(0===o.length&&d.length>0)for(s=0;s<d.length;s++)(a=d[s]).previousWidget&&o.push(a.previousWidget);else if(0===d.length&&o.length>0)for(s=0;s<o.length;s++)(a=o[s]).nextWidget&&d.push(a.nextWidget);this.changeWidthOfCells(t,o,d,i),t.tableFormat.allowAutoFit&&t.updateWidth(i),t.tableFormat.allowAutoFit=!1,this.updateGridValue(t,!0,i)}e.selectPosition(e.start,e.end)}return!1},e.prototype.resizeColumnAtStart=function(e,t,i){var n=e.leftIndent,r=i[0].ownerRow,o=r.rowFormat;if(o.beforeWidth>0){var s=o.beforeWidth+t;if(s>0)this.updateGridBefore(r,t);else if(s<(a=this.getLeastGridBefore(e,r))&&0!==s){n=e.leftIndent+s,e.tableFormat.leftIndent=n>=-1440?n<=1440?n:1440:-1440;for(l=0;l<e.childWidgets.length;l++)r!==(d=e.childWidgets[l])&&this.updateGridBefore(d,-s)}}else if(t<0)n=e.leftIndent+t,e.tableFormat.leftIndent=n>=-1440?n<=1440?n:1440:-1440,this.updateWidthForCells(e,i,t);else{var a=this.getLeastGridBefore(e,r);if(0===e.tableFormat.leftIndent)for(l=0;l<e.childWidgets.length;l++){d=e.childWidgets[l];-1!==i.indexOf(d.childWidgets[0])&&(this.updateGridBefore(d,t),this.increaseOrDecreaseWidth(d.childWidgets[0],t,!1))}else if(a-t>0)n=e.leftIndent+t,e.tableFormat.leftIndent=n>=-1440?n<=1440?n:1440:-1440,this.updateWidthForCells(e,i,t);else{n=e.leftIndent+a,e.tableFormat.leftIndent=n>=-1440?n<=1440?n:1440:-1440;for(var l=0;l<e.childWidgets.length;l++){var d=e.childWidgets[l];-1!==i.indexOf(d.childWidgets[0])?(this.increaseOrDecreaseWidth(d.childWidgets[0],t,!1),this.updateGridBefore(d,t-a)):this.updateGridBefore(d,-a)}}}e.tableFormat.allowAutoFit=!1,this.updateGridValue(e,!0,t)},e.prototype.updateWidthForCells=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++){var r=e.childWidgets[n];-1!==t.indexOf(r.childWidgets[0])?this.increaseOrDecreaseWidth(r.childWidgets[0],i,!1):this.updateGridBefore(r,-i)}},e.prototype.resizeColumnAtLastColumnIndex=function(e,t,i){for(var n=e.tableFormat.tableAlignment,r=e.tableFormat.preferredWidth,o=this.resizerPosition,s=e.tableHolder.columns[o-1],a=0;t!==a;){var l=L.round(s.preferredWidth+t,1);l>=s.minWidth?(s.preferredWidth=l,a=t):(a=t,t-=l-s.minWidth)}this.updateCellPreferredWidths(e),(r||e.tableHolder.getTotalWidth(0)>i)&&(e.tableFormat.allowAutoFit=!1,e.updateWidth(t),e.tableHolder.tableWidth=e.tableHolder.getTotalWidth(0));var d=t;"Right"===n?d=0:"Center"===n&&(d/=2),this.updateGridValue(e,!0,d)},e.prototype.resizeCellAtMiddle=function(e,t){var i=this.resizerPosition,n=e.tableHolder.columns[i-1],r=e.tableHolder.columns[i];if(t>0)for(o=!0;o;)(s=L.round(r.preferredWidth-t,1))>=r.minWidth?(r.preferredWidth=s,n.preferredWidth=n.preferredWidth+t,o=!1):t+=s-r.minWidth;else for(var o=!0;o;){var s=L.round(n.preferredWidth+t,1);s>=n.minWidth?(n.preferredWidth=s,r.preferredWidth=r.preferredWidth-t,o=!1):t-=s-n.minWidth}this.updateCellPreferredWidths(e),e.tableFormat.allowAutoFit&&e.updateWidth(t),e.tableFormat.allowAutoFit=!1,e.tableHolder.tableWidth=e.tableHolder.getTotalWidth(0),this.updateGridValue(e,!1,t)},e.prototype.updateGridValue=function(e,t,i){if(t&&(e.calculateGrid(),e.isGridUpdated=!1),e.buildTableColumns(),e.isGridUpdated=!0,this.viewer.owner.isLayoutEnabled=!0,e.isInsideTable){var n=this.documentHelper.layout.getParentTable(e);this.documentHelper.layout.reLayoutTable(n)}else this.documentHelper.layout.reLayoutTable(e);this.owner.editor.getOffsetValue(this.documentHelper.selection),this.owner.editorModule.reLayout(this.owner.selection),i&&(this.startingPoint.x+=L.convertPointToPixel(i),this.resizerPosition=this.getCellReSizerPosition(this.startingPoint))},e.prototype.getColumnCells=function(e,t,i){for(var n=[],r=0;r<e.childWidgets.length;r++)for(var o=e.childWidgets[r],s=0;s<o.childWidgets.length;s++){var a=o.childWidgets[s];i?a.columnIndex+a.cellFormat.columnSpan===t&&n.push(a):a.columnIndex===t&&n.push(a)}return n},e.prototype.updateGridBefore=function(e,t){e.rowFormat.beforeWidth+t!==e.rowFormat.beforeWidth&&(e.rowFormat.beforeWidth=e.rowFormat.beforeWidth+t,e.rowFormat.gridBeforeWidth=e.rowFormat.beforeWidth)},e.prototype.getLeastGridBefore=function(e,t){for(var i=0,n=0,r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];o!==t&&(0===n&&(i=o.rowFormat.beforeWidth,n++),o.rowFormat.beforeWidth<=i&&(i=o.rowFormat.beforeWidth))}return i},e.prototype.increaseOrDecreaseWidth=function(e,t,i){var n=e.cellFormat.preferredWidth;"Auto"===e.cellFormat.preferredWidthType&&(n=e.cellFormat.cellWidth,e.cellFormat.preferredWidthType="Point");var r=e.ownerColumn.minWidth;"Percent"===e.cellFormat.preferredWidthType&&(r=e.convertPointToPercent(r)),e.cellFormat.preferredWidth=i?n+t>r?n+t:r:n-t>r?n-t:r},e.prototype.changeWidthOfCells=function(e,t,i,n){if(t.length>0){for(var r=!1,o=0;o<t.length;o++){var s=t[o];this.increaseOrDecreaseWidth(s,n,!0),s.cellIndex===s.ownerRow.childWidgets.length-1&&(r=!0)}r&&this.updateRowsGridAfterWidth(e)}if(i.length>0){for(var a=0,o=0;o<i.length;o++){if(0===(s=i[o]).cellIndex){var l=s.ownerRow.rowFormat.beforeWidth+n;l>=0?this.updateGridBefore(s.ownerRow,n):(a!==l&&(a=l),s.ownerRow.rowFormat.gridBeforeWidth=0,s.ownerRow.rowFormat.gridBeforeWidthType="Auto")}this.increaseOrDecreaseWidth(s,n,!1)}if(0!==a){var d=e.leftIndent+a;e.tableFormat.leftIndent=d>=-1440?d<=1440?d:1440:-1440;for(var h=0;h<e.childWidgets.length;h++){var c=e.childWidgets[h];-1===i.indexOf(c.childWidgets[0])&&this.updateGridBefore(c,a>0?a:-a)}}}},e.prototype.updateRowsGridAfterWidth=function(e){for(var t=this.getMaxRowWidth(e,!0),i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i],r=this.getRowWidth(n,!0);if(t>=r&&n.rowFormat.afterWidth!==t-r){var o=t-r;n.rowFormat.gridAfterWidth=o,n.rowFormat.afterWidth=o}}},e.prototype.getRowWidth=function(e,t){var i=0;t&&(i+=e.rowFormat.beforeWidth);for(var n=0;n<e.childWidgets.length;n++)i+=e.childWidgets[n].cellFormat.cellWidth;return i},e.prototype.getMaxRowWidth=function(e,t){for(var i=0,n=0;n<e.childWidgets.length;n++){var r=e.childWidgets[n],o=0;t&&(o+=r.rowFormat.beforeWidth);for(var s=0;s<r.childWidgets.length;s++)o+=r.childWidgets[s].cellFormat.cellWidth;i<o&&(i=o)}return i},e.prototype.isColumnSelected=function(e,t){for(var i=this.owner.selection.getSelectedCells(),n=this.getColumnCells(e,t,!0),r=this.getColumnCells(e,t,!1),o=!1,s=0;s<n.length;s++){a=n[s];o=-1!==i.indexOf(a)}if(!o)for(s=0;s<r.length;s++){var a=r[s];o=-1!==i.indexOf(a)}return o},e.prototype.applyProperties=function(e,i){if(!t.isNullOrUndefined(i)){i.tableHolder&&(e.tableHolder=i.tableHolder.clone()),null!==i.tableFormat&&(e.tableFormat.leftIndent=i.tableFormat.leftIndent,e.tableFormat.preferredWidth=i.tableFormat.preferredWidth,e.tableFormat.preferredWidthType=i.tableFormat.preferredWidthType,e.tableFormat.allowAutoFit=i.tableFormat.allowAutoFit);for(var n=0;n<e.childWidgets.length;n++){var r=e.childWidgets[n],o=i.rows[n];r.rowFormat.gridBefore=o.gridBefore,r.rowFormat.gridBeforeWidth=o.gridBeforeWidth,r.rowFormat.gridBeforeWidthType=o.gridBeforeWidthType,r.rowFormat.gridAfter=o.gridAfter,r.rowFormat.gridAfterWidth=o.gridAfterWidth,r.rowFormat.gridAfterWidthType=o.gridAfterWidthType;for(var s=0;s<r.childWidgets.length;s++){var a=r.childWidgets[s],l=o.cells[s];a.columnIndex=l.columnIndex,a.cellFormat.columnSpan=l.columnSpan,a.cellFormat.preferredWidth=l.preferredWidth,a.cellFormat.preferredWidthType=l.preferredWidthType}}var d=e.getOwnerWidth(!0),h=e.getTableClientWidth(d);e.setWidthToCells(h,"Auto"===e.tableFormat.preferredWidthType)}},e.prototype.getActualWidth=function(e){var t=0;if(e.childWidgets.length>0)for(var i=0;i<e.childWidgets.length;i++)t+=e.childWidgets[i].cellFormat.cellWidth;return t},e.prototype.setPreferredWidth=function(e){for(var t=0;t<e.childWidgets.length;t++){var i=e.childWidgets[t],n=i.rowFormat;n.gridBefore>0&&(n.gridBeforeWidth=n.beforeWidth,n.gridBeforeWidthType="Point");for(var r=0;r<i.childWidgets.length;r++){var o=i.childWidgets[r];o.cellFormat.preferredWidth=o.cellFormat.cellWidth,o.cellFormat.preferredWidthType="Point"}n.gridAfter>0&&(n.gridAfterWidth=n.afterWidth,n.gridAfterWidthType="Point")}},e.prototype.updateCellPreferredWidths=function(e){for(var t=e.tableHolder.tableWidth,i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];if(n.rowFormat.gridBefore>0){var r=e.tableHolder.getCellWidth(0,n.rowFormat.gridBefore,t);this.updateGridBeforeWidth(r,n)}for(var o=0;o<n.childWidgets.length;o++){var s=n.childWidgets[o];s.updateWidth(e.tableHolder.getCellWidth(s.columnIndex,s.cellFormat.columnSpan,t))}n.rowFormat.gridAfter>0&&this.updateGridAfterWidth(e.tableHolder.getCellWidth(n.childWidgets.length,n.rowFormat.gridAfter,t),n)}},e.prototype.updateGridBeforeWidth=function(e,t){var i=t.rowFormat;if(e!==i.beforeWidth)if(i.beforeWidth=e,"Auto"===i.gridBeforeWidthType&&(i.gridBeforeWidthType="Point"),"Point"===i.gridBeforeWidthType)i.gridBeforeWidth=i.beforeWidth;else{var n=t.ownerTable.getTableClientWidth(t.ownerTable.getOwnerWidth(!0)),r=t.ownerTable.convertPointToPercent(i.beforeWidth,n);i.gridBeforeWidth=r}},e.prototype.updateGridAfterWidth=function(e,t){var i=t.rowFormat;if(e!==i.afterWidth&&(i.afterWidth=e),"Auto"===i.gridAfterWidthType&&(i.gridAfterWidthType="Point"),"Point"===i.gridAfterWidthType)i.gridAfterWidth=i.afterWidth;else{var n=t.ownerTable.getTableClientWidth(t.ownerTable.getOwnerWidth(!0)),r=t.ownerTable.convertPointToPercent(i.afterWidth,n);i.gridAfterWidth=r}},e}(),ri=function(){function e(e){var i=this;this.nodes=[],this.editHyperlinkInternal=!1,this.startParagraph=void 0,this.endParagraph=void 0,this.removeEditRange=!1,this.formFieldCounter=1,this.skipFieldDeleteTracking=!1,this.isForHyperlinkFormat=!1,this.isTrackingFormField=!1,this.isCmtDeleteStarted=!1,this.removeCommentCharacters=[],this.isRemoveRevision=!1,this.isHandledComplex=!1,this.isUserInsert=!1,this.tableResize=void 0,this.tocStyles={},this.chartType=!1,this.refListNumber=void 0,this.incrementListNumber=-1,this.removedBookmarkElements=[],this.tocBookmarkId=0,this.copiedData=void 0,this.pageRefFields={},this.delBlockContinue=!1,this.delBlock=void 0,this.delSection=void 0,this.isInsertingTOC=!1,this.editStartRangeCollection=[],this.skipReplace=!1,this.skipTableElements=!1,this.listNumberFormat="",this.listLevelNumber=0,this.isXmlMapped=!1,this.copiedContent="",this.copiedTextContent="",this.previousParaFormat=void 0,this.previousCharFormat=void 0,this.previousSectionFormat=void 0,this.pasteTextPosition=void 0,this.isSkipHistory=!1,this.isPaste=!1,this.isPasteListUpdated=!1,this.isInsertField=!1,this.isBordersAndShadingDialog=!1,this.onTextInputInternal=function(){if(t.Browser.isDevice){var e=i.documentHelper,n=new RegExp(String.fromCharCode(160),"g"),r=new RegExp(String.fromCharCode(10),"g");e.prefix=e.prefix.replace(n," ").replace(r," ");var o=(s=e.editableDiv.textContent.replace(n," ").replace(r," ")).substring(2);if(e.isCompositionStart&&e.isCompositionUpdated)return e.isCompositionUpdated=!1,void(!e.owner.isReadOnlyMode&&e.owner.isDocumentLoaded&&i.canEditContentControl&&e.prefix.substring(2)!==o&&(i.selection.isEmpty?(i.selection.start.setPositionForLineWidget(e.selection.start.currentWidget,i.selection.start.offset-(e.prefix.length-2)),i.handleTextInput(o),e.prefix="@"+String.fromCharCode(160)+o):(i.handleTextInput(o),e.prefix="@"+String.fromCharCode(160)+o)));if(e.isCompositionStart&&e.isCompositionEnd&&""===e.suffix)return e.prefix.substring(2)!==o?i.selection.isEmpty&&e.isCompositionStart?(e.isCompositionStart=!1,i.selection.start.setPositionForLineWidget(e.selection.start.currentWidget,i.selection.start.offset-e.prefix.substring(2).length),i.selection.retrieveCurrentFormatProperties(),""!==e.suffix&&""!==o||i.handleTextInput(o)):i.selection.isEmpty||(e.isCompositionStart=!1,i.handleTextInput(o)):""===o?(e.isCompositionStart=!1,i.handleBackKey()):e.prefix.substring(2)===o&&""===e.suffix&&(e.isCompositionStart=!1,i.handleTextInput(" ")),void(e.isCompositionEnd=!1);if(e.isCompositionEnd||e.isCompositionStart&&!e.isCompositionUpdated){if(o.length<e.prefix.length&&o===e.prefix.substring(2,e.prefix.length-1)||e.editableDiv.innerText.length<2)return void i.handleBackKey();if(""!==e.suffix&&e.editableDiv.innerText[e.editableDiv.innerText.length-1]!==String.fromCharCode(160))return e.isCompositionStart=!1,i.selection.start.setPositionForLineWidget(e.selection.start.currentWidget,i.selection.start.offset-(e.prefix.length-2)),i.selection.end.setPositionForLineWidget(e.selection.end.currentWidget,i.selection.end.offset+e.suffix.length),i.selection.retrieveCurrentFormatProperties(),void i.handleTextInput(o)}"\r"!==s&&"\b"!==s&&""!==s&&!e.owner.isReadOnlyMode&&!1===e.isControlPressed&&i.canEditContentControl&&("@"===s||"@"!==s[0]||""===s||s.length<e.prefix.length&&o===e.prefix.substring(2,e.prefix.length-1)?(i.handleBackKey(),e.editableDiv.innerText.length<2&&i.predictText()):0===s.indexOf(e.prefix)&&s.length>e.prefix.length?i.handleTextInput(s.substring(e.prefix.length)):-1===s.indexOf(e.prefix)&&s[s.length-1]!==String.fromCharCode(160)&&" "!==s[s.length-1]?(o.charAt(0).toLowerCase()+o.slice(1)===e.prefix.substring(2)&&i.selection.start.setPositionParagraph(e.selection.start.currentWidget,i.selection.start.offset-(e.prefix.length-2)),i.handleTextInput(o)):2!==s.length&&i.handleTextInput(" "))}else{var s=i.documentHelper.editableDiv.innerText;s!==String.fromCharCode(160)?"\r"!==s&&"\b"!==s&&""!==s&&!i.owner.isReadOnlyMode&&!1===i.documentHelper.isControlPressed&&i.canEditContentControl&&i.handleTextInput(s):i.handleTextInput(" "),i.documentHelper.editableDiv.innerText=""}},this.onPaste=function(e){!i.owner.isReadOnlyMode&&i.canEditContentControl&&i.pasteInternal(e),e.preventDefault()},this.documentHelper=e,this.tableResize=new ni(this.documentHelper.owner),this.base64=new B}return Object.defineProperty(e.prototype,"restrictFormatting",{get:function(){return this.documentHelper.isDocumentProtected&&(this.documentHelper.restrictFormatting||!this.documentHelper.restrictFormatting&&!this.selection.isSelectionInEditRegion())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restrictEditing",{get:function(){return this.documentHelper.isDocumentProtected&&("ReadOnly"===this.documentHelper.protectionType&&!this.selection.isSelectionInEditRegion()||"FormFieldsOnly"===this.documentHelper.protectionType)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canEditContentControl",{get:function(){return!this.owner.isReadOnlyMode&&!this.selection.checkContentControlLocked()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){if(!t.isNullOrUndefined(this.owner))return this.owner.viewer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editorHistory",{get:function(){return this.documentHelper.owner.editorHistory},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){if(this.documentHelper)return this.documentHelper.selection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"owner",{get:function(){return this.documentHelper.owner},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"Editor"},e.prototype.insertField=function(e,i){this.isInsertField=!0;var n=e;if(t.isNullOrUndefined(i)&&"MERGEFIELD"===(n=L.trimStart(n)).substring(0,10)){var r=(n=n.substring(10).trim()).indexOf("\\*");i="«"+n.substring(0,r).trim()+"»"}var o=new we,s=new k,a=this.copyInsertFormat(s,!1),l=new Te(o),d=new Ie(0);d.characterFormat.mergeFormat(a),l.children.push(d);var h=new Oe;h.text=e,l.children.push(h);var c=new Ie(2);c.fieldBegin=d,d.fieldSeparator=c,l.children.push(c);var p=new Oe;p.text=i,p.characterFormat.mergeFormat(a),l.children.push(p);var g=new Ie(1);g.characterFormat.mergeFormat(a),g.fieldSeparator=c,g.fieldBegin=d,d.fieldEnd=g,c.fieldEnd=g,l.children.push(g),d.line=l,o.childWidgets.push(l),this.documentHelper.fields.push(d);var u=new fe;u.sectionFormat=new x(u),u.childWidgets.push(o),this.pasteContentsInternal([u],!1),this.isInsertField=!1},e.prototype.applyStyle=function(e,i){var n=void 0,r=void 0;if(i=!t.isNullOrUndefined(i)&&i){this.initComplexHistory("ApplyStyle"),this.setOffsetValue(this.selection),n=this.startOffset,r=this.endOffset;var o=this.selection.isEmpty;this.clearFormatting(),o&&!this.selection.isEmpty&&this.selection.end.setPositionInternal(this.selection.start)}var s=this.documentHelper.styles.findByName(e);void 0!==s?this.onApplyParagraphFormat("styleName",s,!1,!0):(this.documentHelper.owner.parser.parseStyle(JSON.parse(this.getCompleteStyles()),JSON.parse(this.documentHelper.preDefinedStyles.get(e)),this.documentHelper.styles),this.applyStyle(e)),this.editorHistory&&this.editorHistory.currentHistoryInfo&&"ApplyStyle"===this.editorHistory.currentHistoryInfo.action&&(this.startOffset=n,this.endOffset=r,this.editorHistory.updateComplexHistory()),this.startParagraph=void 0,this.endParagraph=void 0},e.prototype.cut=function(){this.owner.isReadOnlyMode||this.selection.isEmpty||!this.canEditContentControl||(this.selection.copySelectedContent(!0),this.documentHelper.owner.parser.isCutPerformed=!0)},e.prototype.insertEditingRegion=function(e){this.insertEditRangeElement(e&&""!==e?e:"Everyone")},e.prototype.enforceProtection=function(e,t,i){var n,r;"boolean"==typeof t?(n=i?"ReadOnly":this.documentHelper.protectionType,r=t):(r=!0,n=t),this.documentHelper.restrictFormatting=r,this.documentHelper.protectionType=n,this.selection.isHighlightEditRegion=!0,this.addProtection(e,this.documentHelper.protectionType)},e.prototype.getCommentHierarchicalIndex=function(e){for(var i="";e.ownerComment;)t.isNullOrUndefined(e.ownerComment)?(i=e.replyComments.indexOf(e)+";"+i,e=e):(i=e.ownerComment.replyComments.indexOf(e)+";"+i,e=e.ownerComment);return i="C;"+this.documentHelper.comments.indexOf(e)+";"+i},e.prototype.alertBox=function(){var e=new t.L10n("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),n.DialogUtility.alert(e.getConstant("Multiple Comment"))},e.prototype.insertComment=function(e){if(!(t.isNullOrUndefined(this.selection.start)||this.owner.isReadOnlyMode||this.viewer.owner.enableHeaderAndFooter)&&this.viewer.owner.enableComment){if(this.viewer.owner.commentReviewPane.commentPane.isEditMode)return this.alertBox();t.isNullOrUndefined(e)&&(e=""),this.insertCommentInternal(e)}},e.prototype.insertCommentInternal=function(e){if(this.selection.isEmpty){if(this.selection.start.isAtSamePosition(this.selection.end)&&this.selection.start.isAtParagraphEnd){var i=this.selection.start.offset;this.selection.start.offset=i-1!=-1?i-1:i}this.selection.selectCurrentWord(),this.selection.isParagraphLastLine(this.selection.end.currentWidget)&&this.selection.end.offset===this.selection.getLineLength(this.selection.end.currentWidget)+1&&(this.selection.end.offset-=1)}var n=this.selection.getParagraphInfo(this.selection.start),r=(this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),this.selection.getParagraphInfo(this.selection.end));this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString());this.initComplexHistory("InsertComment");var o=this.selection.start,s=this.selection.end,a=new kt(this.owner);this.selection.isForward||(o=this.selection.end,s=this.selection.start),a.setPositionInternal(s);var l=new vt(0),d=new vt(1),h=o.isInSameParagraphIndex(s);if(s.setPositionInternal(o),this.initInsertInline(l),t.isNullOrUndefined(a.paragraph)){var c=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString()),p=this.selection.getTextPosBasedOnLogicalIndex(c);a.setPositionInternal(p)}h&&a.setPositionParagraph(a.currentWidget,a.offset+l.length),o.setPositionInternal(a),s.setPositionInternal(a),this.initInsertInline(d);var g=new yt((new Date).toISOString());this.owner.editorHistory&&(this.initHistory("InsertCommentWidget"),this.owner.editorHistory.currentBaseHistoryInfo.removedNodes.push(g)),g.author=this.owner.currentUser?this.owner.currentUser:"Guest user",g.initial=this.constructCommentInitial(g.author),g.text=e,g.commentId=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),l.comment=g,l.commentId=g.commentId,d.comment=g,d.commentId=g.commentId,g.commentStart=l,g.commentEnd=d,this.addCommentWidget(g,!0,!0,!0),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=this.getCommentHierarchicalIndex(g),this.editorHistory.updateHistory()),this.editorHistory&&this.editorHistory.updateComplexHistory(),this.reLayout(this.selection,!1),this.isUserInsert||this.owner.commentReviewPane.commentPane.comments.get(g).postComment()},e.prototype.deleteAllComments=function(){if(0!==this.documentHelper.comments.length){this.initComplexHistory("DeleteAllComments"),this.owner.isLayoutEnabled=!1;var e;for(this.editorHistory&&this.editorHistory.currentHistoryInfo&&(e=this.editorHistory.currentHistoryInfo);this.documentHelper.comments.length>0;){var t=this.documentHelper.comments[0];this.initComplexHistory("DeleteComment"),this.deleteCommentInternal(t),this.editorHistory&&this.editorHistory.currentHistoryInfo&&e.addModifiedAction(this.editorHistory.currentHistoryInfo)}this.selection.selectContent(this.owner.documentStart,!0),this.editorHistory&&(this.editorHistory.currentHistoryInfo=e,this.editorHistory.updateComplexHistory())}},e.prototype.deleteComment=function(){this.owner.isReadOnlyMode||t.isNullOrUndefined(this.owner)||t.isNullOrUndefined(this.owner.viewer)||t.isNullOrUndefined(this.owner.documentHelper.currentSelectedComment)||this.owner.enableHeaderAndFooter||!this.viewer.owner.enableComment||this.deleteCommentInternal(this.owner.documentHelper.currentSelectedComment)},e.prototype.deleteCommentInternal=function(e){if(this.isCmtDeleteStarted=!0,this.initComplexHistory("DeleteComment"),e){if(e.replyComments.length>0)for(var t=e.replyComments.length-1;t>=0;t--)this.deleteCommentInternal(e.replyComments[t]);this.isCmtDeleteStarted=!0,this.deleteCommentWidgetInternal(e);var i=e.commentStart,n=e.commentEnd;this.removeInline(n),this.removeInline(i),i.removeCommentMark()}this.editorHistory&&this.editorHistory.updateComplexHistory(),this.isCmtDeleteStarted=!1},e.prototype.deleteCommentWidgetInternal=function(e){this.owner.editorHistory&&(this.initHistory("DeleteCommentWidget"),this.owner.editorHistory.currentBaseHistoryInfo.insertPosition=this.getCommentHierarchicalIndex(e),this.owner.editorHistory.currentBaseHistoryInfo.removedNodes.push(e)),this.deleteCommentWidget(e),this.editorHistory&&this.editorHistory.updateHistory()},e.prototype.deleteCommentWidget=function(e){var t=this.documentHelper.comments.indexOf(e);-1!==t?this.documentHelper.comments.splice(t,1):e.isReply&&e.ownerComment&&(t=e.ownerComment.replyComments.indexOf(e),e.ownerComment.replyComments.splice(t,1)),this.owner.commentReviewPane&&(this.owner.commentReviewPane.deleteComment(e),this.documentHelper.currentSelectedComment===e&&(this.documentHelper.currentSelectedComment=void 0))},e.prototype.resolveComment=function(e){if(!this.owner.isReadOnlyMode){var t={author:e.author,cancel:!1,type:"Resolve"};this.owner.trigger("beforeCommentAction",t),t.cancel&&"Resolve"===t.type||(this.resolveOrReopenComment(e,!0),this.owner.commentReviewPane&&this.owner.commentReviewPane.resolveComment(e))}},e.prototype.reopenComment=function(e){if(!this.owner.isReadOnlyMode){var t={author:e.author,cancel:!1,type:"Reopen"};this.owner.trigger("beforeCommentAction",t),t.cancel&&"Reopen"===t.type||(this.resolveOrReopenComment(e,!1),this.owner.commentReviewPane&&this.owner.commentReviewPane.reopenComment(e))}},e.prototype.resolveOrReopenComment=function(e,t){e.isResolved=t;for(var i=0;i<e.replyComments.length;i++)e.replyComments[i].isResolved=t},e.prototype.replyComment=function(e,t){if(!this.owner.isReadOnlyMode){var i=e;if(e){this.initComplexHistory("InsertComment");var n=i.commentStart,r=i.commentEnd,o=n.line.getOffset(n,1),s=new kt(this.documentHelper.owner);s.setPositionParagraph(n.line,o);var a=r.line.getOffset(r,1),l=new kt(this.documentHelper.owner);l.setPositionParagraph(r.line,a),this.selection.start.setPositionInternal(s),this.selection.end.setPositionInternal(l),s=this.selection.start,l=this.selection.end;var d=new kt(this.owner);d.setPositionInternal(l);var h=new vt(0),c=new vt(1),p=s.isInSameParagraph(l);l.setPositionInternal(s),this.initInsertInline(h),p&&d.setPositionParagraph(d.currentWidget,d.offset+h.length),s.setPositionInternal(d),l.setPositionInternal(d),this.initInsertInline(c);var g=new yt((new Date).toISOString());g.author=this.owner.currentUser?this.owner.currentUser:"Guest user",g.text=t||"",g.commentId=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),g.isReply=!0,i.replyComments.push(g),g.ownerComment=i,this.owner.editorHistory&&(this.initHistory("InsertCommentWidget"),this.owner.editorHistory.currentBaseHistoryInfo.removedNodes.push(g)),h.comment=g,h.commentId=g.commentId,c.comment=g,c.commentId=g.commentId,g.commentStart=h,g.commentEnd=c,this.owner.commentReviewPane&&this.owner.commentReviewPane.addReply(g,!1,!0),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=this.getCommentHierarchicalIndex(g),this.editorHistory.updateHistory()),this.editorHistory&&this.editorHistory.updateComplexHistory(),this.reLayout(this.selection)}}},e.prototype.removeInline=function(e){this.selection.start.setPositionParagraph(e.line,e.line.getOffset(e,0)),this.selection.end.setPositionParagraph(this.selection.start.currentWidget,this.selection.start.offset+e.length),this.initHistory("RemoveInline"),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.updateHistoryPosition(this.selection.start,!0),this.removeSelectedContents(this.documentHelper.selection),this.editorHistory&&this.editorHistory.updateHistory(),this.fireContentChange()},e.prototype.addCommentWidget=function(e,t,i,n){if(-1===this.documentHelper.comments.indexOf(e)){var r=!1;if(this.documentHelper.comments.length>0)for(var o=this.selection.getElementPosition(e.commentStart).startPosition,s=0;s<this.documentHelper.comments.length;s++){var a=this.selection.getElementPosition(this.documentHelper.comments[s].commentStart).startPosition;if(o.isExistBefore(a)){r=!0,this.documentHelper.comments.splice(s,0,e);break}}r||this.documentHelper.comments.push(e),this.owner.commentReviewPane&&(this.owner.showComments=i,this.owner.commentReviewPane.selectedTab=0,this.owner.commentReviewPane.addComment(e,t,n),n&&this.owner.selection.selectComment(e))}},e.prototype.addReplyComment=function(e,t){var i=t.split(";"),n=this.documentHelper.comments[parseInt(i[1],10)];""!==i[2]&&(n.replyComments.splice(parseInt(i[2],10),0,e),e.ownerComment=n),this.owner.commentReviewPane&&(this.owner.showComments=!0,this.owner.commentReviewPane.addReply(e,!1,!0),this.owner.selection.selectComment(e))},e.prototype.addProtection=function(e,t){if(""===e)this.protectDocument(t);else{this.currentProtectionType=t;var i=new v,n={passwordBase64:this.base64.encodeString(e),saltBase64:"",spinCount:1e5},r=this.owner.serviceUrl+this.owner.serverActionSettings.restrictEditing;i.url=r,i.contentType="application/json;charset=UTF-8",i.onSuccess=this.enforceProtectionInternal.bind(this),i.onFailure=this.protectionFailureHandler.bind(this),i.onError=this.protectionFailureHandler.bind(this),i.customHeaders=this.owner.headers,i.send(n)}},e.prototype.protectionFailureHandler=function(e){var i=new t.L10n("documenteditor",this.owner.defaultLocale);i.setLocale(this.documentHelper.owner.locale),"onError"===e.name?n.DialogUtility.alert(i.getConstant("Error in establishing connection with web server")):(this.owner.fireServiceFailure(e),console.error(e.statusText))},e.prototype.enforceProtectionInternal=function(e){var t=JSON.parse(e.data);this.documentHelper.saltValue=t[0],this.documentHelper.hashValue=t[1],this.protectDocument(this.currentProtectionType)},e.prototype.protectDocument=function(e){this.protect(e);var t=this.documentHelper.restrictEditingPane.restrictPane;t&&"block"===t.style.display&&(this.documentHelper.restrictEditingPane.showStopProtectionPane(!0),this.documentHelper.restrictEditingPane.loadPaneValue(),this.documentHelper.dialog.hide())},e.prototype.stopProtection=function(e){if(this.documentHelper.isDocumentProtected){var t=new v,i={passwordBase64:this.base64.encodeString(e),saltBase64:this.documentHelper.saltValue,spinCount:1e5};t.url=this.owner.serviceUrl+this.owner.serverActionSettings.restrictEditing,t.contentType="application/json;charset=UTF-8",t.customHeaders=this.owner.headers,t.onSuccess=this.onUnProtectionSuccess.bind(this),t.onFailure=this.protectionFailureHandler.bind(this),t.onError=this.protectionFailureHandler.bind(this),t.send(i)}},e.prototype.onUnProtectionSuccess=function(e){var t=JSON.parse(e.data);this.validateHashValue(t[1])},e.prototype.validateHashValue=function(e){var i=new t.L10n("documenteditor",this.owner.defaultLocale);i.setLocale(this.documentHelper.owner.locale);var r=this.base64.decodeString(e),o=this.documentHelper.hashValue,s=this.base64.decodeString(o),a=!0;if(r.length===s.length){for(var l=0;l<r.length;l++)if(r[l]!==s[l]){a=!1;break}}else a=!1;a?this.unProtectDocument():n.DialogUtility.alert(i.getConstant("The password is incorrect"))},e.prototype.unProtectDocument=function(){this.documentHelper.isDocumentProtected=!1,this.documentHelper.restrictFormatting=!1,this.documentHelper.selection.highlightEditRegion();var e=this.documentHelper.restrictEditingPane.restrictPane;e&&"block"===e.style.display&&this.documentHelper.restrictEditingPane.showStopProtectionPane(!1),this.documentHelper.dialog.hide()},e.prototype.fireContentChange=function(){this.selection.isHighlightEditRegion&&(this.owner.enableLockAndEdit?this.owner.collaborativeEditingModule.updateLockRegion():this.selection.onHighlight()),this.selection.highlightFormFields(),this.isPaste||(this.copiedContent=void 0,this.copiedTextContent="",this.previousSectionFormat=void 0,this.previousParaFormat=void 0,this.previousCharFormat=void 0,this.selection.isViewPasteOptions=!1,this.isPasteListUpdated&&(this.isPasteListUpdated=!1),this.selection.showHidePasteOptions(void 0,void 0)),this.documentHelper.owner.isLayoutEnabled&&!this.documentHelper.owner.isShiftingEnabled&&this.documentHelper.owner.fireContentChange()},e.prototype.updateSelectionTextPosition=function(e){this.getOffsetValue(this.selection),this.selection.start.updatePhysicalPosition(!0),this.selection.isEmpty?this.selection.end.setPositionInternal(this.selection.start):this.selection.end.updatePhysicalPosition(!0),this.selection.upDownSelectionLength=this.selection.end.location.x,this.selection.fireSelectionChanged(e)},e.prototype.predictText=function(){this.documentHelper.suffix="",this.selection.start.paragraph.isEmpty()||0===this.selection.start.offset&&this.selection.start.currentWidget.isFirstLine()||0===this.selection.end.offset&&this.selection.end.currentWidget.isFirstLine()?this.documentHelper.prefix="":this.getPrefixAndSuffix(),this.documentHelper.prefix="@"+String.fromCharCode(160)+this.documentHelper.prefix,this.documentHelper.editableDiv.innerText=this.documentHelper.prefix,this.documentHelper.selection.setEditableDivCaretPosition(this.documentHelper.prefix.length)},e.prototype.getPrefixAndSuffix=function(){var e=this.owner.documentHelper;if(""!==this.selection.text)return void(e.prefix="");var i=0,n=this.selection.start.currentWidget.getInline(this.selection.start.offset,i),r=n.element;if(i=n.index,void 0!==r){var o=this.selection.getElementBoxInternal(r,i),s=o.element;i=o.index;var a=0;if(!t.isNullOrUndefined(s)){var l=!1;for(s instanceof Oe&&i>0&&s.line.isFirstLine()&&(e.prefix=""),r instanceof Oe||(r=this.selection.getPreviousTextElement(r));(a=e.prefix.lastIndexOf(" "))<0&&r instanceof Oe;)if(r.previousNode instanceof Oe&&-1===e.prefix.indexOf(" ")){if(l?e.prefix=r.text+e.prefix:(e.prefix=r.text.substring(0,i),l=!0),(r=r.previousNode)instanceof Qe)break;r instanceof Oe||(r=this.selection.getPreviousTextElement(r))}else if(!(r.previousNode instanceof Oe)){l?e.prefix=r.text+e.prefix:(e.prefix=r.text.substring(0,i),l=!0);break}e.prefix.length>1&&" "===e.prefix[e.prefix.length-1]&&"."===e.prefix[e.prefix.length-2]?(a=-1,e.prefix=""):a=e.prefix.lastIndexOf(" "),e.prefix=a<0?e.prefix:e.prefix.substring(a),0===e.prefix.indexOf(" ")&&e.prefix.length>=1&&(e.prefix=e.prefix.substring(1));var d=0,h=this.selection.end.currentWidget.getInline(this.selection.end.offset,d),c=h.element;if(d=h.index,o=this.selection.getElementBoxInternal(c,d),s=o.element,d=o.index,s){var p=!1;for(s instanceof Oe&&d<s.length&&(e.suffix="");(a=e.suffix.indexOf(" "))<0&&c instanceof Oe;)if(c.nextNode instanceof Oe&&-1===e.suffix.indexOf(" "))p?e.suffix=e.suffix+c.text:(e.suffix=s.text.substring(d),p=!0),c=c.nextNode;else if(!(c.nextNode instanceof Oe)){p?e.suffix=e.suffix+c.text:(e.suffix=s.text.substring(d),p=!0);break}a=e.suffix.indexOf(" "),e.suffix=a<0?e.suffix:e.suffix.substring(0,a)}}}},e.prototype.onKeyDownInternal=function(e,t,i,n){var r=e.which||e.keyCode;if(!t||i||n)if(!i||t||n)if(i&&t&&!n)switch(r){case 68:this.owner.isReadOnlyMode||this.owner.selection.toggleUnderline("Double");break;case 77:this.owner.isReadOnlyMode||this.owner.selection.decreaseIndent(),e.preventDefault();break;case 188:e.preventDefault(),this.owner.isReadOnlyMode||this.onApplyCharacterFormat("fontSize","decrement",!0);break;case 190:e.preventDefault(),this.owner.isReadOnlyMode||this.onApplyCharacterFormat("fontSize","increment",!0);break;case 187:e.preventDefault(),this.owner.isReadOnlyMode||this.toggleBaselineAlignment("Superscript");break;case 69:if(e.preventDefault(),!this.owner.isReadOnlyMode){var o={isTrackChangesEnabled:!this.owner.enableTrackChanges};this.owner.trigger("trackChange",o)}}else if(!i&&t&&n)switch(r){case 72:e.preventDefault(),!this.owner.isReadOnlyMode&&this.owner.isDocumentLoaded&&this.toggleHighlightColor();break;case 70:e.preventDefault(),!this.owner.isReadOnlyMode&&this.owner.isDocumentLoaded&&this.insertFootnote();break;case 68:e.preventDefault(),!this.owner.isReadOnlyMode&&this.owner.isDocumentLoaded&&this.insertEndnote()}else switch(r){case 8:e.preventDefault(),this.handleBackKey();break;case 9:e.preventDefault(),this.owner.acceptTab&&this.selection.handleTabKey(!0,!1);break;case 13:e.preventDefault(),this.documentHelper.triggerSpellCheck=!0,this.handleEnterKey(),this.documentHelper.triggerSpellCheck=!1;break;case 27:e.preventDefault(),this.isPaste||(this.copiedContent=void 0,this.copiedTextContent="",this.previousParaFormat=void 0,this.previousCharFormat=void 0,this.previousSectionFormat=void 0,this.selection.isViewPasteOptions=!1,this.isPasteListUpdated&&(this.isPasteListUpdated=!1),this.selection.showHidePasteOptions(void 0,void 0));break;case 46:this.handleDelete(),e.preventDefault();break;case 32:this.selection.handleSpaceBarKey();break;case 120:var s=this.selection.getDocumentEnd();s.offset=this.selection.getDocumentEnd().offset+1,this.selection.start.isAtSamePosition(this.selection.getDocumentStart())&&this.selection.end.isAtSamePosition(s)?this.owner.updateFields():this.selection.updateRefField()}else switch(r){case 9:e.preventDefault(),this.owner.acceptTab&&this.selection.handleTabKey(!1,!0);break;case 13:this.handleShiftEnter(),e.preventDefault()}else switch(this.documentHelper.isControlPressed=!0,r){case 8:e.preventDefault(),this.handleCtrlBackKey();break;case 46:e.preventDefault(),this.handleCtrlDelete();break;case 9:e.preventDefault(),this.owner.acceptTab&&this.selection.handleTabKey(!1,!1);break;case 13:e.preventDefault(),this.insertPageBreak();break;case 48:e.preventDefault(),this.onApplyParagraphFormat("beforeSpacing",0,!1,!1);break;case 49:e.preventDefault(),this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.onApplyParagraphFormat("lineSpacing",1,!1,!1);break;case 50:e.preventDefault(),this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.onApplyParagraphFormat("lineSpacing",2,!1,!1);break;case 53:e.preventDefault(),this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.onApplyParagraphFormat("lineSpacing",1.5,!1,!1);break;case 66:e.preventDefault(),this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.toggleBold();break;case 68:e.preventDefault(),!this.owner.isReadOnlyMode&&this.owner.fontDialogModule&&this.owner.fontDialogModule.showFontDialog();break;case 69:this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.toggleTextAlignment("Center"),e.preventDefault();break;case 72:e.preventDefault(),!this.owner.isReadOnly&&this.owner.optionsPaneModule&&(this.owner.optionsPaneModule.isReplace=!0,this.owner.optionsPaneModule.showHideOptionsPane(!0));break;case 73:e.preventDefault(),this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.toggleItalic();break;case 74:this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.toggleTextAlignment("Justify"),e.preventDefault();break;case 75:e.preventDefault(),this.owner.hyperlinkDialogModule&&!this.owner.isReadOnlyMode&&this.owner.hyperlinkDialogModule.show();break;case 76:this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.toggleTextAlignment("Left"),e.preventDefault();break;case 77:this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.owner.selection.increaseIndent(),e.preventDefault();break;case 78:e.preventDefault(),this.owner.isReadOnlyMode||this.owner.openBlank();break;case 82:this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.toggleTextAlignment("Right"),e.preventDefault();break;case 85:e.preventDefault(),this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.owner.selection.toggleUnderline("Single");break;case 88:e.preventDefault(),this.owner.isReadOnlyMode||this.owner.editor.cut();break;case 89:this.owner.enableEditorHistory&&(this.editorHistory.redo(),e.preventDefault());break;case 90:this.owner.enableEditorHistory&&(this.editorHistory.undo(),e.preventDefault());break;case 219:e.preventDefault(),this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.onApplyCharacterFormat("fontSize","decrement",!0);break;case 221:e.preventDefault(),this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.onApplyCharacterFormat("fontSize","increment",!0);break;case 187:e.preventDefault(),this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.toggleBaselineAlignment("Subscript")}},e.prototype.handleShiftEnter=function(){this.owner.isReadOnlyMode||this.handleTextInput("\v"),this.selection.checkForCursorVisibility()},e.prototype.handleBackKey=function(){(!this.owner.isReadOnlyMode&&this.canEditContentControl||this.selection.isInlineFormFillMode())&&this.owner.editorModule.onBackSpace(),this.selection.checkForCursorVisibility()},e.prototype.handleDelete=function(){(!this.owner.isReadOnlyMode&&this.canEditContentControl||this.selection.isInlineFormFillMode())&&this.owner.editorModule.delete(),this.selection.checkForCursorVisibility()},e.prototype.handleEnterKey=function(){(!this.owner.isReadOnlyMode&&this.canEditContentControl||this.selection.isInlineFormFillMode())&&(t.Browser.isDevice&&(this.documentHelper.isCompositionStart=!1),this.owner.editorModule.onEnter()),this.selection.checkForCursorVisibility()},e.prototype.handleCtrlBackKey=function(){var e=this.selection.start,i=this.selection.end;if(!this.owner.isReadOnlyMode||this.selection.isInlineFormFillMode())if(this.selection.isForward||(e=i),this.selection.isEmpty)this.selection.handleControlShiftLeftKey(),this.owner.editorModule.onBackSpace();else{if((t.isNullOrUndefined(e.paragraph.previousRenderedWidget)||e.paragraph.previousRenderedWidget instanceof xe)&&0===e.offset)return;this.selection.handleLeftKey(),this.selection.handleControlShiftLeftKey(),this.owner.editorModule.onBackSpace()}},e.prototype.handleCtrlDelete=function(){if(!this.owner.isReadOnlyMode&&this.canEditContentControl||this.selection.isInlineFormFillMode())if(this.selection.isEmpty)this.selection.handleControlShiftRightKey(),this.owner.editorModule.delete();else{this.selection.handleLeftKey(),this.selection.handleControlShiftRightKey();var e=this.selection.text;L.endsWith(e)&&this.selection.handleShiftLeftKey(),this.owner.editorModule.delete()}},e.prototype.handleTextInput=function(e){var i=this;(!this.owner.isReadOnlyMode&&this.canEditContentControl||this.selection.isInlineFormFillMode())&&(this.animationTimer&&clearTimeout(this.animationTimer),t.classList(this.selection.caret,[],["e-de-cursor-animation"]),this.owner.editorModule.insertText(e),this.animationTimer=setTimeout(function(){i.animationTimer&&clearTimeout(i.animationTimer),i.selection&&i.selection.caret&&t.classList(i.selection.caret,["e-de-cursor-animation"],[])},600)),this.selection.checkForCursorVisibility()},e.prototype.copyInsertFormat=function(e,i){var n=new k,r=this.selection.characterFormat;return i&&n.copyFormat(e),t.isNullOrUndefined(r.bold)||e.bold===r.bold||(n.bold=r.bold),t.isNullOrUndefined(r.italic)||e.italic===r.italic||(n.italic=r.italic),r.fontSize>0&&e.fontSize!==r.fontSize&&(n.fontSize=r.fontSize),t.isNullOrUndefined(r.fontFamily)||e.fontFamily===r.fontFamily||(n.fontFamily=r.fontFamily),t.isNullOrUndefined(r.highlightColor)||e.highlightColor===r.highlightColor||(n.highlightColor=r.highlightColor),t.isNullOrUndefined(r.baselineAlignment)||e.baselineAlignment===r.baselineAlignment||(n.baselineAlignment=r.baselineAlignment),t.isNullOrUndefined(r.fontColor)||e.fontColor===r.fontColor||(n.fontColor=r.fontColor),t.isNullOrUndefined(r.underline)||e.underline===r.underline||(n.underline=r.underline),t.isNullOrUndefined(r.strikethrough)||e.strikethrough===r.strikethrough||(n.strikethrough=r.strikethrough),n},e.prototype.getResultContentControlText=function(e){for(var i=e.nextNode,n="";!(i instanceof Me||(i instanceof Oe&&(n+=i.text),t.isNullOrUndefined(i)));)if(t.isNullOrUndefined(i.nextNode)){if(!i.paragraph.nextRenderedWidget)break;i=i.paragraph.nextRenderedWidget.firstChild.children[0]}else i=i.nextNode;return n},e.prototype.updateXmlMappedContentControl=function(){if(this.isXmlMapped){var e=this.getContentControl();e&&e.contentControlProperties&&this.updateCustomXml(e.contentControlProperties.xmlMapping.storeItemId,e.contentControlProperties.xmlMapping.xPath,this.getResultContentControlText(e))}},e.prototype.updateCustomXml=function(e,t,i){if(this.documentHelper.customXmlData.containsKey(e)){var n=this.documentHelper.customXmlData.get(e),r=(new DOMParser).parseFromString(n,"text/xml"),o=t.substring(t.lastIndexOf("/")+1);o=(o=(o=o.split("[")[0]).substring(o.lastIndexOf(":")+1)).substring(o.lastIndexOf("@")+1);var s=r.getElementsByTagName(o);if(s.length>0)s[0].childNodes[0].nodeValue=i;else{if(!(r.documentElement.attributes.length>0&&null!==r.documentElement.attributes.getNamedItem(o)))return;r.documentElement.attributes.getNamedItem(o).value=i}var a=(new XMLSerializer).serializeToString(r);this.documentHelper.customXmlData.set(e,a)}},e.prototype.insertText=function(e){t.isNullOrUndefined(e)||""===e||this.insertTextInternal(e,!1)},e.prototype.insertTextInternal=function(e,i,n){if("FormFieldsOnly"===this.documentHelper.protectionType&&this.selection.isInlineFormFillMode()){var r=this.selection.getCurrentFormField(),o=this.getFormFieldText(),s=new RegExp(this.owner.documentHelper.textHelper.getEnSpaceCharacter(),"gi");o.length>0&&""===o.replace(s,"")&&(o="",this.selection.selectFieldInternal(r));var a=r.formFieldData.maxLength;if(0!==a&&o.length>=a)return}var l,d=this.documentHelper.selection,h=!0;n=this.owner.enableTrackChanges&&t.isNullOrUndefined(n)?"Insertion":n,this.isListTextSelected(),(t.isNullOrUndefined(n)||"Insertion"===n)&&this.initHistory("Insert");var c=this.selection.getParagraphInfo(d.start),p=c.paragraph.paragraphFormat;d.editPosition=d.getHierarchicalIndex(c.paragraph,c.offset.toString());var g=d.start.paragraph.paragraphFormat.bidi;if(!d.isEmpty&&!d.isImageSelected||this.documentHelper.isListTextSelected&&"List"===d.contextType){d.isSkipLayouting=!0,d.skipFormatRetrieval=!0;var u=void 0;this.owner.enableTrackChanges&&(u=this.selection.start.isExistBefore(this.selection.end)?this.selection.end.clone():this.selection.start.clone(),this.skipReplace=!0),h=this.removeSelectedContents(d),this.skipReplace=!1,t.isNullOrUndefined(u)||(this.owner.search.isRepalceTracking&&(this.owner.search.isRepalceTracking=!1),this.selection.start.setPositionInternal(this.selection.start),this.selection.end.setPositionInternal(u)),d.skipFormatRetrieval=!1,d.isSkipLayouting=!1}else!d.isEmpty||this.documentHelper.isListTextSelected||i||(this.documentHelper.isTextInput=!0);(c=this.selection.getParagraphInfo(d.start)).paragraph.paragraphFormat.copyFormat(p);var m=this.documentHelper.textHelper.containsSpecialCharAlone(e);if(h){if(d.owner.isShiftingEnabled=!0,this.updateInsertPosition(),(l=d.start).paragraph.isEmpty()){var f=new Oe,v=this.copyInsertFormat(l.paragraph.characterFormat,!0);f.characterFormat.copyFormat(v),f.text=e;C=this.documentHelper.textHelper.getRtlLanguage(e).isRtl;if(f.characterFormat.bidi=C,f.isRightToLeft=C,f.line=l.paragraph.childWidgets[0],f.margin=new ge(0,0,0,0),f.line.children.push(f),this.owner.enableTrackChanges)if(f.paragraph.characterFormat.revisions.length>0){var y=this.getMatchedRevisionsToCombine(f.paragraph.characterFormat.revisions,n);y.length>0&&this.mapMatchedRevisions(y,f.paragraph.characterFormat,f,!0)}else this.checkToCombineRevisionWithPrevPara(f,n)||this.insertRevision(f,n);"Center"!==l.paragraph.paragraphFormat.textAlignment&&"Right"!==l.paragraph.paragraphFormat.textAlignment||-1!==l.paragraph.paragraphFormat.listFormat.listId||(l.paragraph.x=this.owner.viewer.clientActiveArea.x),this.documentHelper.layout.reLayoutParagraph(l.paragraph,0,0)}else{var b=0,w=l.currentWidget.getInline(l.offset,b,g,!i),r=w.element;b=w.index,r.ischangeDetected=!0,r instanceof Oe&&" "!==e&&this.documentHelper.owner.isSpellCheck&&(this.owner.spellChecker.removeErrorsFromCollection({element:r,text:r.text}),i||(r.ignoreOnceItems=[])),r.canTrigger&&r.text.length<=1&&(r.canTrigger=!1);var v=this.copyInsertFormat(r.characterFormat,!0),C=this.documentHelper.textHelper.getRtlLanguage(e).isRtl,x=this.documentHelper.textHelper.getRtlLanguage(e).id,F=0,P=!1,T=!1;if(r instanceof Oe&&(F=this.documentHelper.textHelper.getRtlLanguage(r.text).id,P=this.documentHelper.textHelper.getRtlLanguage(r.text).isRtl,T=this.documentHelper.textHelper.containsSpecialCharAlone(r.text)),!C&&this.documentHelper.owner.isSpellCheck||(v.bidi=C),(!this.documentHelper.owner.isSpellCheck||" "!==e&&" "!==r.text)&&v.isSameFormat(r.characterFormat)&&this.canInsertRevision(r,n)&&x===F||""===e.trim()&&!C&&r.characterFormat.bidi||P&&v.isSameFormat(r.characterFormat)&&m)this.insertTextInline(r,d,e,b);else{var S=this.documentHelper.layout.isContainsRtl(d.start.currentWidget),I=new Oe;I.text=e,I.line=r.line,I.isRightToLeft=P,I.characterFormat.copyFormat(v),r instanceof Le&&(I.characterFormat.baselineAlignment="Normal");var N=!1,E=r.indexInOwner,H=I.revisions.length;if(b===r.length){var W=r.line.paragraph.bidi;W&&r instanceof Ie&&1===r.fieldType&&(E=(r=r.fieldBegin).indexInOwner);var O=-1;O=W||r instanceof $e||S&&T||P&&C?E:E+1,!this.owner.enableTrackChanges||r instanceof Ae||(N=this.checkToMapRevisionWithInlineText(r,b,I,C,n))||I.revisions.length!==H||(N=this.checkToMapRevisionWithNextNode(r.nextNode,I,C,n)),N||(r.line.children.splice(O,0,I),this.checkToCombineRevisionsinBlocks(I,H===I.revisions.length,!0,n))}else if(0===b)this.owner.enableTrackChanges&&((N=this.checkToMapRevisionWithInlineText(r,b,I,C,n))||0!==I.revisions.length||this.checkToMapRevisionWithPreviousNode(r.previousNode,I,C,n)),N||(P&&!C?r.line.children.splice(E+1,0,I):r.line.children.splice(E,0,I),this.checkToCombineRevisionsinBlocks(I,H===I.revisions.length,!0,n));else{if(r instanceof Oe){var k=new Oe;k.line=r.line,k.characterFormat.copyFormat(r.characterFormat),g&&P&&!C?(k.text=r.text.slice(0,b),this.owner.enableTrackChanges||this.updateRevisionForSpittedTextElement(r,k),r.text=r.text.substring(b)):(k.text=r.text.substring(b),this.owner.enableTrackChanges||this.selection.isInField||this.updateRevisionForSpittedTextElement(r,k),r.text=r.text.slice(0,b)),this.owner.enableTrackChanges?(N=this.checkToMapRevisionWithInlineText(r,b,I,C,n))||I.revisions.length>H?this.copyElementRevision(r,k,!0):I.revisions.length===H&&(this.updateRevisionForSpittedTextElement(r,k),this.insertRevision(I,n)):this.selection.isInField&&(this.copyElementRevision(r,k,!1),this.updateElementInFieldRevision(r,I,r.revisions,!0)),this.owner.isSpellCheck&&this.owner.spellChecker.updateSplittedElementError(r,k),r.line.children.splice(E+1,0,k)}N||r.line.children.splice(E+1,0,I)}!g&&this.documentHelper.layout.isContainsRtl(d.start.currentWidget)&&this.documentHelper.layout.reArrangeElementsForRtl(d.start.currentWidget,g),this.documentHelper.layout.reLayoutParagraph(l.paragraph,r.line.indexInOwner,0)}}this.setPositionParagraph(c.paragraph,c.offset+e.length,!0),this.updateEndPosition(),t.isNullOrUndefined(this.editorHistory)||t.isNullOrUndefined(this.editorHistory.currentHistoryInfo)||"ListSelect"!==this.editorHistory.currentHistoryInfo.action||!this.documentHelper.isListTextSelected||(this.editorHistory.updateHistory(),this.editorHistory.updateComplexHistory()),(t.isNullOrUndefined(n)||"Insertion"===n)&&this.reLayout(d),this.documentHelper.isTextInput=!1}if(this.updateXmlMappedContentControl(),!i&&h&&(" "===e||"\t"===e||"\v"===e)){var L=!1;if("\v"!==e&&(L=this.checkAndConvertList(d,"\t"===e)),!L){if(!t.isNullOrUndefined(d.getHyperlinkField()))return;this.checkAndConvertToHyperlink(d,!1)}}},e.prototype.updateElementInFieldRevision=function(e,t,i,n){for(var r=0;r<i.length;r++){var o=i[r],s=o.range.indexOf(e);o.range.splice(n?s+1:s,0,t)}},e.prototype.retrieveFieldResultantText=function(e){var i="";if(1===e.fieldType)for(var n=e.previousElement;!t.isNullOrUndefined(n)&&n instanceof Oe;)i=n.text+i,n=t.isNullOrUndefined(n.previousNode)?void 0:n.previousNode.previousValidNodeForTracking;return i},e.prototype.checkToCombineRevisionsinBlocks=function(e,t,i,n){if(t&&this.owner.enableTrackChanges&&!(e instanceof Ae||e instanceof vt||e instanceof et||e instanceof $e)){(i?this.combineRevisionWithNextPara(e,n):this.combineRevisionWithPrevPara(e,n))||this.insertRevision(e,n)}},e.prototype.checkToMapRevisionWithNextNode=function(e,i,n,r){if(t.isNullOrUndefined(e))return!1;var o=e.nextValidNodeForTracking;return!t.isNullOrUndefined(o)&&this.checkToMapRevisionWithInlineText(o,0,i,n,r)},e.prototype.checkToMapRevisionWithPreviousNode=function(e,i,n,r){if(t.isNullOrUndefined(e))return!1;var o=e.previousValidNodeForTracking;return!t.isNullOrUndefined(o)&&this.checkToMapRevisionWithInlineText(o,o.length,i,n,r)},e.prototype.checkToMapRevisionWithInlineText=function(e,i,n,r,o){if(!t.isNullOrUndefined(e))if("Deletion"===o&&this.updateLastElementRevision(n),e.length===i){if(e=e.previousValidNodeForTracking,i=e.length,e.revisions.length>0)return this.applyMatchedRevisionInorder(e,n,i,!1,r,o)}else if(0===i&&(e=e.nextValidNodeForTracking,!t.isNullOrUndefined(e)&&e.revisions.length>0))return this.applyMatchedRevisionInorder(e,n,i,!0,r,o);return!1},e.prototype.combineElementRevisions=function(e,t){if(0!==e.revisions.length&&0!==t.revisions.length)for(var i=0;i<e.revisions.length;i++)for(var n=e.revisions[i],r=0;r<t.revisions.length;r++){var o=t.revisions[i];-1===n.range.indexOf(t)&&o.revisionType===n.revisionType&&o.author===n.author&&(t.revisions.splice(r,1),n.range.push(t),t.revisions.splice(r,0,n))}},e.prototype.applyMatchedRevisionInorder=function(e,t,i,n,r,o){var s=this.getMatchedRevisionsToCombine(e.revisions,o);return s.length>0&&this.mapMatchedRevisions(s,e,t,n),!1},e.prototype.copyElementRevision=function(e,t,i){if(!this.isTrackingFormField)for(var n=0;n<e.revisions.length;n++){var r=e.revisions[n],o=r.range.indexOf(e);t.revisions.splice(0,0,r),r.range.splice(o+(i?2:1),0,t)}},e.prototype.mapMatchedRevisions=function(e,t,i,n){for(var r=0;r<e.length;r++){var o=e[r];if(!this.isRevisionAlreadyIn(i,o)||i instanceof k){i.revisions.splice(0,0,o);var s=o.range.indexOf(t);o.range.splice(n?s:s+1,0,i)}}},e.prototype.isRevisionAlreadyIn=function(e,t){if(e.revisions.length>0)for(var i=0;i<e.revisions.length;i++)if(e.revisions[i].revisionID===t.revisionID)return!0;return!1},e.prototype.getMatchedRevisionsToCombine=function(e,t){for(var i=[],n=0;n<e.length;n++)this.isRevisionMatched(e[n],t)&&i.push(e[n]);return i},e.prototype.decideInlineForTrackChanges=function(e,i){var n=!1;if(this.owner.enableTrackChanges&&!this.canInsertRevision(e,i)){var r=e.nextValidNodeForTracking;!t.isNullOrUndefined(r)&&this.canInsertRevision(r,i)&&(e=r,n=!0)}return{element:e,isMatched:n}},e.prototype.insertIMEText=function(e,t){if(this.documentHelper.lastComposedText!==e||!t){var i=this.selection.getParagraphInfo(this.selection.start),n=this.selection.getHierarchicalIndex(i.paragraph,i.offset.toString());this.insertText(e),this.documentHelper.lastComposedText=e;var r=this.selection.start;this.setPositionForCurrentIndex(r,n);var o=new kt(this.owner);o.setPositionForLineWidget(r.currentWidget,r.offset+e.length),this.selection.selectPosition(t?r:o,o)}},e.prototype.insertSectionBreak=function(){var e=this.documentHelper.selection;t.isNullOrUndefined(e)||this.owner.isReadOnlyMode||e.start.paragraph.isInHeaderFooter||(this.initHistory("SectionBreak"),e.isEmpty||e.selectContent(e.isForward?e.start:e.end,!0),this.documentHelper.owner.isShiftingEnabled=!0,this.updateInsertPosition(),this.insertSection(e,!0),this.updateEndPosition(),this.reLayout(e,!0),"Continuous"===this.owner.layoutType&&this.layoutWholeDocument())},e.prototype.combineRevisionWithBlocks=function(e,i){if(this.owner.enableTrackChanges&&!t.isNullOrUndefined(e)){for(;e instanceof Ae||e instanceof vt;)e=e.nextElement;if(!t.isNullOrUndefined(e)){var n=e.paragraph.previousRenderedWidget;if(!(n instanceof xe)){if(!t.isNullOrUndefined(n)&&!n.isEmpty()&&n.characterFormat.revisions.length>0){var r=n.lastChild;if(t.isNullOrUndefined(r)||0===r.children.length)return;for(var o=r.children[r.children.length-1];o instanceof Ae||o instanceof vt;)o=o.previousElement;if(o.revisions.length>0&&this.compareElementRevision(n.characterFormat,e)){var s=e.revisions[e.revisions.length-1];this.compareElementRevision(o,e)&&s!==(c=o.revisions[o.revisions.length-1])&&this.clearAndUpdateRevisons(s.range,c,c.range.indexOf(o)+1)}}n=null;var a=e.paragraph.lastChild,l=(e=a.children[a.children.length-1]).paragraph.nextRenderedWidget;if(!(l instanceof xe)){if(!t.isNullOrUndefined(l)&&!l.isEmpty()&&e.paragraph.characterFormat.revisions.length>0){for(var d=l.firstChild.children[0];d instanceof Ae||d instanceof vt;)d=d.previousElement;if(t.isNullOrUndefined(d))return;if(d.revisions.length>0){var h=d.revisions[d.revisions.length-1];if(this.compareElementRevision(e.paragraph.characterFormat,d)&&this.compareElementRevision(e,d)){var c=e.revisions[e.revisions.length-1];h!==c&&this.clearAndUpdateRevisons(h.range,c,c.range.indexOf(e)+1)}}}0===e.revisions.length&&this.insertRevision(e,i)}}}}},e.prototype.checkToCombineRevisionWithNextPara=function(e,i){var n=e.paragraph.nextRenderedWidget;if(n instanceof xe)return!1;if(!t.isNullOrUndefined(n)&&!n.isEmpty()){for(var r=n.firstChild.children[0];r instanceof Ae||r instanceof vt;)r=r.previousElement;if(t.isNullOrUndefined(r))return!1;if(r.revisions.length>0){var o=this.getMatchedRevisionsToCombine(r.revisions,i);if(o.length>0)return this.mapMatchedRevisions(o,r,e,!0),!0}}return!1},e.prototype.checkToCombineRevisionWithPrevPara=function(e,i){var n=e.paragraph.previousRenderedWidget;if(n instanceof xe)return!1;if(!t.isNullOrUndefined(n)&&n.characterFormat.revisions.length>0){if(!this.isRevisionMatched(n.characterFormat,i))return!1;var r=this.getMatchedRevisionsToCombine(n.characterFormat.revisions,i);if(r.length>0)return this.mapMatchedRevisions(r,n.characterFormat,e,!1),!0}return!1},e.prototype.combineRevisionWithNextPara=function(e,i){var n=e.line.isLastLine(),r=e.nextNode;return!(!n||!t.isNullOrUndefined(r))&&this.checkToCombineRevisionWithNextPara(e,i)},e.prototype.combineRevisionWithPrevPara=function(e,i){var n=e.line.isFirstLine(),r=e.previousNode;return!(!n||!t.isNullOrUndefined(r))&&this.checkToCombineRevisionWithPrevPara(e,i)},e.prototype.removeRevision=function(e){var t=this.selection.start.currentWidget.getInline(this.selection.start.offset+1,0),i=t.element;if(t.element.revisions.length>0)for(var n=0;n<i.revisions.length;n++)if(i.revisions[n].revisionType===e.revisionType)for(var r=i.revisions[n],o=r.range.indexOf(i),s=o;o<r.range.length;o++)r.range[s].revisions.splice(n,1),r.range.splice(s,1)},e.prototype.clearElementRevision=function(e){if(!t.isNullOrUndefined(e))for(var i=0;i<e.range.length;i++)if(e.range[i]instanceof Se){var n=e.range[i];n.revisions.splice(n.revisions.length-1,1),e.range.splice(i,1)}},e.prototype.insertRevision=function(e,i,n,r,o){n=t.isNullOrUndefined(n)?this.owner.currentUser?this.owner.currentUser:"Guest user":n;var s=t.isNullOrUndefined(r)?(new Date).toISOString():r;if(e instanceof Se&&!t.isNullOrUndefined(e.line)&&e.line.paragraph.associatedCell||e instanceof k&&e.ownerBase instanceof we&&e.ownerBase.associatedCell){var a=void 0;if(e instanceof Se?a=e.line.paragraph.associatedCell:e instanceof k&&(a=e.ownerBase.associatedCell),a.ownerRow.rowFormat.revisions.length>0){var l=a.ownerRow.rowFormat,d=this.getMatchedRevisionsToCombine(l.revisions,i);if(d.length>0){for(var h=0;h<d.length;h++)e.revisions.splice(0,0,d[h]),d[h].range.push(e);return}}}var c=new W(this.owner,n,s);c.revisionType=i,c.revisionID=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),!t.isNullOrUndefined(o)&&o.length>0?this.clearAndUpdateRevisons(o,c,o.indexOf(e)):(e.revisions.push(c),c.range.push(e)),this.updateRevisionCollection(c)},e.prototype.clearAndUpdateRevisons=function(e,t,i){for(var n=0;n<e.length;n++)if(e[n]instanceof Se){var r=e[n];r.revisions.splice(r.revisions.length-1,1),r.revisions.push(t),t.range.splice(i+n,0,r)}},e.prototype.splitRevisionByElement=function(e,t){if(e.revisions.length>0){var i=t.range,n=i.indexOf(e);return t.range=i.splice(0,n+1),i}},e.prototype.updateRevisionForSpittedTextElement=function(e,t){for(var i=0;i<e.revisions.length;i++){var n=e.revisions[i],r=this.splitRevisionByElement(e,n);this.insertRevision(t,n.revisionType,n.author,n.date,r)}},e.prototype.isRevisionMatched=function(e,i){var n=this.owner.currentUser?this.owner.currentUser:"Guest user";if(e instanceof W){if((t.isNullOrUndefined(i)||i===e.revisionType)&&e.author===n)return!0}else if(e.revisions.length>0)for(var r=0;r<e.revisions.length;r++){var o=e.revisions[r];if((t.isNullOrUndefined(i)||i===o.revisionType)&&o.author===n)return!0}return!1},e.prototype.compareElementRevision=function(e,t){if(0===e.revisions.length||0===t.revisions.length)return!1;for(var i=0;i<e.revisions.length;i++)for(var n=e.revisions[i],r=0;r<t.revisions.length;r++)if(n.author===t.revisions[i].author&&n.revisionType===t.revisions[i].revisionType)return!0;return!1},e.prototype.canInsertRevision=function(e,i){var n=t.isNullOrUndefined(i)?"Insertion":i;return"Deletion"!==n&&(this.owner.enableTrackChanges?this.isRevisionMatched(e,n):!(e.revisions.length>0))},e.prototype.insertRevisionAtEnd=function(e,i,n){return!(i instanceof Ae||i instanceof vt||i instanceof et||i instanceof $e)&&(e=e.previousValidNodeForTracking,!t.isNullOrUndefined(e)&&this.insertRevisionAtPosition(e,i,!0,n))},e.prototype.insertRevisionAtPosition=function(e,t,i,n){var r=t.revisions.length,o=this.checkToMapRevisionWithInlineText(e,i?e.length:0,t,!1,n);return i?o||t.revisions.length!==r||(o=this.checkToMapRevisionWithNextNode(e.nextNode,t,!1,n)):o||t.revisions.length!==r||(o=this.checkToMapRevisionWithPreviousNode(e.previousNode,t,!1,n)),o},e.prototype.insertRevisionAtBegining=function(e,i,n){return!(i instanceof Ae||i instanceof vt||i instanceof et||i instanceof $e)&&(e=e.nextValidNodeForTracking,!t.isNullOrUndefined(e)&&this.insertRevisionAtPosition(e,i,!1,n))},e.prototype.splitRevisionForSpittedElement=function(e,t){for(var i=e.revisions.length-1;i>=0;i--){var n=e.revisions[i],r=this.splitRevisionByElement(e,n);this.insertRevision(t,n.revisionType,n.author,n.date,r)}},e.prototype.combineElementRevision=function(e,t){for(var i=0;i<e.length;i++)for(var n=0;n<t.length;n++){var r=e[i],o=t[i];if(r.author===o.author&&r.revisionType===o.revisionType){for(var s=o.range.length,a=0;a<s;a++){var l=o.range[0];l.revisions.splice(l.revisions.indexOf(o),1),o.range.splice(0,1),r.range.push(l),l.revisions.push(r)}0===o.range.length&&this.owner.revisions.remove(o)}}},e.prototype.combineRevisions=function(e,i,n){if(this.owner.enableTrackChanges){var r=this.selection.getLineInfo(e,i.offset).line.getInline(i.offset,0).element;if(r.revisions.length>0&&this.isRevisionMatched(r,"Insertion")){var o=r.nextElement;if(!t.isNullOrUndefined(o)&&o.revisions.length>0){var s=r.revisions[r.revisions.length-1],a=o.revisions[o.revisions.length-1].range;this.clearAndUpdateRevisons(a,s,s.range.indexOf(r)+1)}}}},e.prototype.insertRevisionForBlock=function(e,i,n,r){if(0!==e.childWidgets.length&&this.owner.enableTrackChanges)if("Deletion"===i){for(var o=this.selection.editPosition,s=this.selection.start.clone(),a=this.selection.end.clone(),l=0;l<e.childWidgets.length;l++){var d=e.childWidgets[l];this.removeContent(d,0,this.documentHelper.selection.getLineLength(d))}this.selection.editPosition=o,this.selection.start.setPositionInternal(s),this.selection.end.setPositionInternal(a),this.removeEmptyLine(e)}else{var h=!1;if(t.isNullOrUndefined(r)){var c=this.owner.currentUser?this.owner.currentUser:"Guest user",p=(new Date).toISOString();(r=new W(this.owner,c,p)).revisionID=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),r.revisionType=i}for(l=0;l<e.childWidgets.length;l++){var g=e.childWidgets[l].children;if(0===g.length){var u=e.containerWidget.childWidgets.indexOf(e),m=void 0;if(u>0&&(m=e.containerWidget.childWidgets[u-1]),!t.isNullOrUndefined(m)&&m instanceof we&&m.characterFormat.revisions.length>0&&this.isRevisionMatched(m.characterFormat,i)){var f=this.getMatchedRevisionsToCombine(m.characterFormat.revisions,i);f.length>0&&(this.mapMatchedRevisions(f,m.characterFormat,e.characterFormat,!1),h=!0,r=void 0)}}for(var v=0;v<g.length;v++)if(0!==v||n)g[v].revisions.push(r),r.range.push(g[v]);else{var y=g[l].revisions.length;this.checkToCombineRevisionsinBlocks(g[l],!0,!1,"Insertion"),g[l].revisions.length>y?r=g[l].revisions[g[l].revisions.length-1]:(g[v].revisions.push(r),r.range.push(g[v]))}}n||h||(e.characterFormat.revisions.push(r),r.range.push(e.characterFormat)),t.isNullOrUndefined(r)||this.updateRevisionCollection(r)}},e.prototype.updateRevisionCollection=function(e){var i=!1,n=void 0;if(this.owner.revisions.changes.indexOf(e)<0){if(this.documentHelper.revisionsInternal.containsKey(e.revisionID)||this.documentHelper.revisionsInternal.add(e.revisionID,e),this.owner.revisions.changes.length>0)for(var r=this.owner.selection.start,o=0;o<this.owner.revisions.changes.length;o++){var s=this.owner.revisions.changes[o].range[0];if(s instanceof Se&&!t.isNullOrUndefined(s.line)&&s.line.paragraph.bodyWidget)n=this.selection.getElementPosition(this.owner.revisions.changes[o].range[0]).startPosition;else if(s instanceof H){var a=s.ownerBase.childWidgets[0];if(this.selection.getFirstParagraph(a).bodyWidget){var l=this.documentHelper.selection;this.updateEditPosition(a,l),n=this.selection.getTextPosBasedOnLogicalIndex(l.editPosition)}}else if(s instanceof k){var d=s.ownerBase;if(d.lastChild&&d.lastChild.paragraph.bodyWidget){var h=d.getLength(),c=new kt(this.owner);c.setPositionParagraph(d.lastChild,h),n=c}}if(!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(r)&&r.isExistBefore(n)){i=!0,this.owner.revisions.changes.splice(o,0,e);break}}i||this.owner.revisions.changes.push(e),this.documentHelper.updateAuthorIdentity()}},e.prototype.insertSection=function(e,i){var n,r,o=this.selection.start.paragraph.bodyWidget.sectionFormat.cloneFormat();if(e.start.paragraph.isInsideTable){var s=this.documentHelper.layout.getParentTable(e.start.paragraph);s=s.combineWidget(this.owner.viewer);var a=!1;0===e.start.paragraph.associatedCell.rowIndex&&(a=!0);var l=new we,d=s.previousRenderedWidget;a?n=s:(n=this.splitTable(s,e.start.paragraph.associatedCell.ownerRow),this.documentHelper.layout.layoutBodyWidgetCollection(n.index,n.containerWidget,n,!1),n=n.getSplitWidgets().pop());var h=0;!t.isNullOrUndefined(d)&&d.bodyWidget.equals(n.bodyWidget)||!a?(h=n.indexInOwner+1,l.index=n.index+1):(h=0,l.index=0),n.containerWidget.childWidgets.splice(h,0,l),l.containerWidget=n.containerWidget,this.updateNextBlocksIndex(l,!0),this.documentHelper.layout.layoutBodyWidgetCollection(l.index,l.containerWidget,l,!1),n=l}else{var c=this.selection.getParagraphInfo(e.start),p=this.selection.getHierarchicalIndex(c.paragraph,c.offset.toString());this.splitParagraphInternal(e,e.start.paragraph,e.start.currentWidget,e.start.offset),this.setPositionForCurrentIndex(e.start,p),n=e.start.paragraph.getSplitWidgets().pop()}return(r=this.splitBodyWidget(n.bodyWidget,o,n).firstChild)instanceof xe&&r.updateRowIndex(0),this.documentHelper.layout.layoutBodyWidgetCollection(r.index,r.containerWidget,r,!1),r instanceof xe&&(r=e.getFirstParagraphInFirstCell(r)),i&&e.selectParagraphInternal(r,!0),r},e.prototype.splitBodyWidget=function(e,t,i){var n=this.documentHelper.layout.moveBlocksToNextPage(i);return this.updateSectionIndex(t,n,!0),this.insertRemoveHeaderFooter(n.sectionIndex,!0),this.documentHelper.viewer instanceof le&&this.documentHelper.layout.layoutHeaderFooter(n,this.owner.viewer,n.page),this.updateBlockIndex(0,n.firstChild),this.owner.viewer.updateClientArea(n.sectionFormat,n.page),n},e.prototype.insertRemoveHeaderFooter=function(e,t){this.documentHelper.headersFooters[e]||(this.documentHelper.headersFooters[e]={})},e.prototype.updateBlockIndex=function(e,i){var n,r=i.bodyWidget.sectionIndex;do{n=i.getSplitWidgets();for(var o=0;o<n.length;o++)n[o].index=e;e++,i=n.pop().nextRenderedWidget}while(!t.isNullOrUndefined(i)&&i.bodyWidget.sectionIndex===r)},e.prototype.updateSectionIndex=function(e,t,i){var n=t.sectionIndex,r=t;do{r.index===n&&e&&(r.sectionFormat=e),i?r.index++:r.index--,r=r.nextRenderedWidget}while(r)},e.prototype.checkAndConvertList=function(e,i){var n=e.paragraphFormat.getList();if(!t.isNullOrUndefined(n)||e.start.paragraph.containerWidget instanceof be)return!1;var r=!1,o=!1,s=0,a=e.start.currentWidget.getInline(e.start.offset-1,s),l=a.element;if(s=a.index,!(l instanceof Oe))return!1;for(var d=l,h=d.text.substring(0,s),c=0,p=0;!t.isNullOrUndefined(d.previousNode);){if(!(d.previousNode instanceof Oe)||"\t"!==d.previousNode.text&&0!==d.previousNode.text.trim().length)return!1;"\t"===d.previousNode.text?c+=36:p=2.5*d.previousNode.text.length,d=d.previousNode}d=l;var g=0,u=h.lastIndexOf("\t");for(g=u>=0?u+1:h.lastIndexOf(" ")+1;d.previousNode instanceof Oe&&0===g;){var m=(d=d.previousNode).text;g=(u=m.lastIndexOf("\t"))>=0?u+1:m.lastIndexOf(" ")+1,h=(h=d.text+h).substring(g)}var f=(h=L.trimStart(h)).substring(1,2),v=void 0,y=this.getListLevelPattern(h.substring(0,1));if("None"!==y&&this.checkNumberFormat(f,"Bullet"===y,h)?r=!0:this.checkLeadingZero(h)?(o=!0,r=!0):(v=this.checkNextLevelAutoList(h),t.isNullOrUndefined(v)||(r=!0)),r){this.initComplexHistory("AutoList");var b=l.paragraph;e.start.setPositionParagraph(b.childWidgets[0],b.childWidgets[0].getOffset(l,s+1)),e.end.setPositionParagraph(b.childWidgets[0],0),this.initHistory("Delete"),this.deleteSelectedContents(e,!1),this.reLayout(e,!1);var w=i?"Tab":"Space";f=o?"%1"+h.substring(h.length-1,h.length):"%1"+f;var C=h.substring(h.length-3,h.length-1);y=o?this.getListLevelPattern(C):y;var x=new K(void 0);x.listLevelPattern=y,"Bullet"===y?"*"===h?(x.numberFormat="",x.characterFormat.fontFamily="Symbol"):"-"===h&&(x.numberFormat="-"):x.numberFormat=f,x.followCharacter=w;var F=e.paragraphFormat.leftIndent;x.paragraphFormat.leftIndent=0!==c||0!==p?F+18+c+p:s>2?F+2.5*(s-2)+18:F>0?F+18:36,x.paragraphFormat.firstLineIndent=-18,!o&&"0"===h.substring(0,1)||"00"===C?x.startAt=0:x.startAt=1,t.isNullOrUndefined(v)?this.autoConvertList(e,x):e.paragraphFormat.setList(v),this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentHistoryInfo)?this.editorHistory.updateComplexHistory():this.reLayout(e)}return r},e.prototype.checkNextLevelAutoList=function(e){for(var i=this.documentHelper.selection,n=void 0,r=!1,o=i.start.paragraph,s=i.getPreviousParagraphBlock(o),a=!1;!t.isNullOrUndefined(s)&&s instanceof we;){if(s.paragraphFormat.listFormat&&-1!==s.paragraphFormat.listFormat.listId){a=!0;break}s=i.getPreviousParagraphBlock(s)}if(a){var l=this.documentHelper.layout.getListNumber(s.paragraphFormat.listFormat,!0),d=l.substring(0,l.length-1),h=e.substring(0,e.length-1),c=void 0;if(l.substring(l.length-1)!==e.substring(e.length-1))r=!1;else if(h.match(/^[0-9]+$/)&&d.match(/^[0-9]+$/))c=parseInt(h,10),parseInt(d,10)!==c&&parseInt(d,10)+1!==c&&parseInt(d,10)+2!==c||(r=!0);else if(h.match(/^[a-zA-Z]+$/)&&d.match(/^[a-zA-Z]+$/))if(d.charCodeAt(0)===e.charCodeAt(0)||d.charCodeAt(0)+1===e.charCodeAt(0)||d.charCodeAt(0)+2===e.charCodeAt(0))r=!0;else if(h.match(/^[MDCLXVImdclxvi]+$/)&&d.match(/^[MDCLXVImdclxvi]+$/)){var p=this.getNumber(d.toUpperCase()),g=this.getNumber(h.toUpperCase());p!==g&&p+1!==g&&p+2!==g||(r=!0)}r&&(n=this.documentHelper.getListById(s.paragraphFormat.listFormat.listId))}return n},e.prototype.getNumber=function(e){for(var t={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1},i=e.split(""),n=0,r=0;r<i.length;r++){var o=t[i[r]];o<t[i[r+1]]?n-=o:n+=o}return n},e.prototype.getListLevelPattern=function(e){switch(e){case"0":case"1":return"Arabic";case"I":return"UpRoman";case"i":return"LowRoman";case"A":return"UpLetter";case"a":return"LowLetter";case"*":case"-":return"Bullet";case"00":case"01":return"LeadingZero";default:return"None"}},e.prototype.autoConvertList=function(e,t){e.start;e.isForward||e.end;var i=new P;this.documentHelper.lists.length>0?i.listId=this.documentHelper.lists[this.documentHelper.lists.length-1].listId+1:i.listId=0;var n=new G,r=this.documentHelper;r.abstractLists.length>0?n.abstractListId=r.abstractLists[r.abstractLists.length-1].abstractListId+1:n.abstractListId=0,i.abstractListId=n.abstractListId,i.abstractList=n,r.abstractLists.push(n),n.levels.push(t),t.ownerBase=n,e.paragraphFormat.setList(i),e.paragraphFormat.listLevelNumber=0},e.prototype.checkNumberFormat=function(e,t,i){if(t)return""===e;var n=i.indexOf(e);return("."===e||")"===e||">"===e||"-"===e)&&""===i.substring(n,i.length-1)},e.prototype.checkLeadingZero=function(e){for(var t,i=!1,n=0;n<=e.length-1;n++){if("0"!==e.charAt(n)){t=n;break}i=!0}var r=void 0;return r="1"===e.charAt(t)?e.charAt(t+1):e.charAt(t),i&&this.checkNumberFormat(r,!1,e)},e.prototype.getPageFromBlockWidget=function(e){var t=void 0;return e.containerWidget instanceof fe?t=e.containerWidget.page:e.containerWidget instanceof ve?t=e.containerWidget.page:e.containerWidget instanceof Pe&&(t=e.containerWidget.bodyWidget.page),t},e.prototype.insertTextInline=function(e,i,n,r,o){if(e instanceof Oe){e.text=L.insert(e.text,r,n);var s=e.line.paragraph,a=s.childWidgets.indexOf(e.line),l=e.line.children.indexOf(e);(e.line.paragraph.bidi||this.documentHelper.layout.isContainsRtl(e.line))&&this.documentHelper.layout.reArrangeElementsForRtl(e.line,e.line.paragraph.bidi),!t.isNullOrUndefined(o)&&o||this.documentHelper.layout.reLayoutParagraph(s,a,l,e.line.paragraph.bidi)}else e instanceof Ze?this.insertImageText(e,i,n,r):e instanceof Ie?0===e.fieldType?this.insertFieldBeginText(e,i,n,r):2===e.fieldType?this.insertFieldSeparatorText(e,i,n,r):this.insertFieldEndText(e,i,n,r):(e instanceof Ae||e instanceof et||e instanceof $e)&&this.insertBookMarkText(e,n)},e.prototype.insertFieldBeginText=function(e,t,i,n){var r=new Oe;r.text=i;var o=e.line.paragraph.childWidgets.indexOf(e.line),s=e.line.children.indexOf(e);r.characterFormat.copyFormat(e.characterFormat),e.line.children.splice(s,0,r),r.line=e.line,this.documentHelper.layout.reLayoutParagraph(e.line.paragraph,o,s)},e.prototype.insertBookMarkText=function(e,t){var i=new Oe;i.text=t;var n=e.line.paragraph.childWidgets.indexOf(e.line),r=e.line.children.indexOf(e);i.characterFormat.copyFormat(e.characterFormat),e instanceof $e||e instanceof Ae?e.line.children.splice(r,0,i):e.line.children.splice(r+1,0,i),i.line=e.line,this.documentHelper.layout.reLayoutParagraph(e.line.paragraph,n,r)},e.prototype.insertFieldSeparatorText=function(e,i,n,r){var o=i.getPreviousTextInline(e),s=i.getNextTextInline(e),a=new Oe;a.text=n;var l=e.line.children.indexOf(e);r===e.length&&l++,t.isNullOrUndefined(o)&&t.isNullOrUndefined(s)?a.characterFormat.copyFormat(e.line.paragraph.characterFormat):t.isNullOrUndefined(o)?a.characterFormat.copyFormat(s.characterFormat):a.characterFormat.copyFormat(o.characterFormat),e.line.children.splice(l,0,a),a.line=e.line;var d=e.line.paragraph.childWidgets.indexOf(e.line);this.documentHelper.layout.reLayoutParagraph(e.line.paragraph,d,l)},e.prototype.insertFieldEndText=function(e,t,i,n){var r=new Oe;r.text=i;var o=e.line.children.indexOf(e);r.characterFormat.copyFormat(e.characterFormat),e.line.children.splice(o+1,0,r),r.line=e.line;var s=e.line.paragraph.childWidgets.indexOf(e.line);if(this.owner.enableTrackChanges){var a=this.documentHelper.textHelper.getRtlLanguage(i).isRtl,l=this.checkToMapRevisionWithInlineText(e,n,r,a,"Insertion");l||0!==r.revisions.length||(l=this.checkToMapRevisionWithNextNode(e.nextNode,r,a,"Insertion"))}this.documentHelper.layout.reLayoutParagraph(e.line.paragraph,s,o)},e.prototype.insertImageText=function(e,i,n,r){var o=i.getPreviousTextInline(e),s=i.getNextTextInline(e),a=e.line,l=new Oe,d=a.paragraph,h=d.childWidgets.indexOf(a);l.text=n;var c=a.children.indexOf(e);r===e.length&&c++,t.isNullOrUndefined(o)&&t.isNullOrUndefined(s)?l.characterFormat.copyFormat(d.characterFormat):t.isNullOrUndefined(o)?l.characterFormat.copyFormat(s.characterFormat):l.characterFormat.copyFormat(o.characterFormat),a.children.splice(c,0,l),l.line=a,this.documentHelper.layout.reLayoutParagraph(d,h,c)},e.prototype.isListTextSelected=function(){this.documentHelper.isListTextSelected&&(this.initComplexHistory("ListSelect"),this.documentHelper.selection.start.paragraph.paragraphFormat.listFormat&&-1!==this.documentHelper.selection.start.paragraph.paragraphFormat.listFormat.listId&&this.onApplyList(void 0))},e.prototype.checkAndConvertToHyperlink=function(e,t,i){var n,r;if(t)n=(r=i.lastChild.children[i.lastChild.children.length-1]).text;else{var o=0,s=e.start.currentWidget.getInline(e.start.offset-1,o),a=s.element;if(o=s.index,!(a instanceof Oe))return;n=(r=a).text.substring(0,o)}var l=0,d=n.lastIndexOf("\t");for(l=d>=0?d+1:n.lastIndexOf(" ")+1;r.previousElement instanceof Oe&&0===l;){var h=(r=r.previousNode).text;l=(d=h.lastIndexOf("\t"))>=0?d+1:h.lastIndexOf(" ")+1,n=r.text+n}var c=(n=n.substring(l)).toLowerCase(),p=!1;if("file:///"===c.substring(0,8)||"http://"===c.substring(0,7)&&c.length>7||"https://"===c.substring(0,8)&&c.length>8||"www."===c.substring(0,4)&&c.length>4||"\\"===c.substring(0,3)&&c.length>3||"mailto:"===c.substring(0,7)&&c.length>7)p=!0,"www."===c.substring(0,4)&&c.length>4&&(n="http://"+n);else{var g=n.indexOf("@"),u=n.indexOf(".");g>0&&g<u&&u<n.length-1&&(p=!0,n="mailto:"+n)}if(p){var m=new kt(this.documentHelper.owner);m.setPositionParagraph(r.line,r.line.getOffset(r,l));var f=new kt(this.documentHelper.owner);if(t)f.setPositionParagraph(r.line,r.line.getEndOffset());else if(0===e.end.currentWidget.children.length&&0===e.end.offset){var v=e.end.currentWidget.previousLine;f.setPositionParagraph(v,v.getEndOffset())}else f.setPositionParagraph(e.end.currentWidget,e.end.offset-1);this.autoFormatHyperlink(e,n,m,f)}},e.prototype.autoFormatHyperlink=function(e,t,i,n){this.initComplexHistory("AutoFormatHyperlink");var r=this.selection.getParagraphInfo(i),o=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString());this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.insertPosition=o),e.start.setPositionInternal(i),e.end.setPositionInternal(n);var s=this.getCharacterFormat(e),a=new k;a.copyFormat(s);var l=this.createHyperlinkElement(t,i,n,a);e.start.setPositionParagraph(l.line,l.line.getOffset(l,1)),e.start.moveNextPosition(),e.end.setPositionInternal(e.start),r=this.selection.getParagraphInfo(e.end);var d=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString());this.editorHistory&&this.editorHistory.currentHistoryInfo?(this.editorHistory.currentHistoryInfo.endPosition=d,this.editorHistory.updateComplexHistory(),this.reLayout(e)):this.updateComplexWithoutHistory(0,o,d)},e.prototype.appylingHyperlinkFormat=function(e){this.initHistory("Underline"),this.updateCharacterFormatWithUpdate(e,"underline","Single",!1),this.editorHistory&&this.editorHistory.updateHistory(),this.reLayout(e,!1),this.initHistory("FontColor"),this.isForHyperlinkFormat=!0,this.updateCharacterFormatWithUpdate(e,"fontColor","#0563c1",!1),this.isForHyperlinkFormat=!1,this.editorHistory&&this.editorHistory.updateHistory(),this.reLayout(e,!1)},e.prototype.createHyperlinkElement=function(e,t,i,n){var r=this.selection;this.documentHelper.layout.allowLayout=!1,this.appylingHyperlinkFormat(r),this.documentHelper.layout.allowLayout=!0;var o=new Ie(1);o.characterFormat.copyFormat(n),o.line=r.end.currentWidget,r.start.setPositionInternal(r.end),this.initInsertInline(o),r.start.setPositionInternal(t),r.end.setPositionInternal(r.start);var s=this.insertHyperlinkfield(r,n,e),a=r.start.paragraph.childWidgets.indexOf(s.line),l=s.line.children.indexOf(s);return o.linkFieldCharacter(this.documentHelper),this.documentHelper.layout.reLayoutParagraph(r.start.paragraph,a,l),o},e.prototype.insertHyperlinkfield=function(e,t,i,n){var r=new Ie(0);r.characterFormat.copyFormat(t),r.line=e.start.currentWidget,this.initInsertInline(r);var o=new Oe;o.characterFormat.copyFormat(t),o.text=n?' HYPERLINK \\l "'+i+'" ':' HYPERLINK "'+i+'" ',o.line=e.start.currentWidget,this.initInsertInline(o);var s=new Ie(2);return s.characterFormat.copyFormat(t),s.line=e.start.currentWidget,this.initInsertInline(s),r},e.prototype.unlinkRangeFromRevision=function(e,t){for(var i=0;i<e.revisions.length;i++){var n=e.revisions[i],r=n.range.indexOf(e);r>=0&&n.range.splice(r,1),0===n.range.length&&t&&(this.owner.revisions.remove(n),this.isRemoveRevision&&this.documentHelper.revisionsInternal.containsKey(n.revisionID)&&this.documentHelper.revisionsInternal.remove(n.revisionID))}},e.prototype.unlinkWholeRangeInRevision=function(e,t){var i=t;e.revisions.splice(e.revisions.indexOf(e),1);for(var n=i.range.length,r=0;r<n;r++)i.range.splice(0,1);0===i.range.length&&(this.owner.revisions.remove(i),this.isRemoveRevision&&this.documentHelper.revisionsInternal.containsKey(i.revisionID)&&this.documentHelper.revisionsInternal.remove(i.revisionID))},e.prototype.unLinkFieldCharacter=function(e){if(e instanceof Ie&&0===e.fieldType&&e.fieldEnd&&(this.documentHelper&&(this.documentHelper.fieldToLayout=e,this.documentHelper.fieldEndParagraph=e.line.paragraph),e.fieldEnd&&(e.fieldEnd.fieldBegin=void 0),e.fieldEnd=void 0),e instanceof Ie&&2===e.fieldType)t.isNullOrUndefined(e.fieldEnd)||(this.documentHelper&&(this.documentHelper.fieldToLayout=e.fieldBegin,this.documentHelper.fieldEndParagraph=e.line.paragraph),e.fieldBegin.fieldSeparator=void 0,e.fieldEnd.fieldSeparator=void 0);else if(e instanceof Ie&&1===e.fieldType&&e.fieldBegin){t.isNullOrUndefined(this.documentHelper)||(this.documentHelper.fieldToLayout=e.fieldBegin,this.documentHelper.fieldEndParagraph=e.line.paragraph);var i=this.documentHelper.fields.indexOf(e.fieldBegin);-1!==i&&this.documentHelper.fields.splice(i,1);var n=this.documentHelper.formFields.indexOf(e.fieldBegin);-1!==n&&this.documentHelper.formFields.splice(n,1),e.fieldBegin.fieldEnd=void 0,e.fieldBegin=void 0}},e.prototype.getCharacterFormat=function(e){return e.start.paragraph.isEmpty()?e.start.paragraph.characterFormat:e.start.currentWidget.getInline(e.start.offset,0).element.characterFormat},e.prototype.insertHyperlink=function(e,i){t.isNullOrUndefined(i)&&(i=e),this.insertHyperlinkInternal(e,i,this.owner.selection.text!==i,!1)},e.prototype.insertHyperlinkInternal=function(e,t,i,n){var r=this.documentHelper.selection;if(r.start.paragraph.associatedCell===r.end.paragraph.associatedCell)if(i)this.insertHyperlinkInternalInternal(r,e,t,n);else{var o=r.start,s=r.end;r.isForward||(o=r.end,s=r.start);var a=new kt(this.documentHelper.owner);a.setPositionInternal(o);var l=this.getCharacterFormat(r),d=new k(void 0);d.copyFormat(l),this.initComplexHistory("InsertHyperlink");var h=this.selection.getParagraphInfo(o),c=this.selection.getHierarchicalIndex(h.paragraph,h.offset.toString());this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.insertPosition=this.selection.getHierarchicalIndex(h.paragraph,h.offset.toString())),this.appylingHyperlinkFormat(r),this.documentHelper.layout.allowLayout=!0,o.setPositionInternal(s);var p=new Ie(1);p.characterFormat.copyFormat(d),p.line=r.end.currentWidget,o.setPositionInternal(s),this.initInsertInline(p),o.setPositionInternal(a),s.setPositionInternal(o);var g=this.insertHyperlinkfield(r,d,e,n);p.linkFieldCharacter(this.documentHelper);var u=r.start.paragraph.childWidgets.indexOf(g.line),m=g.line.children.indexOf(g);this.documentHelper.layout.reLayoutParagraph(r.start.paragraph,u,m);var f=p.line;r.selects(f,f.getOffset(p,p.length),!0),h=this.selection.getParagraphInfo(s);var v=this.selection.getHierarchicalIndex(h.paragraph,h.offset.toString());this.editorHistory&&this.editorHistory.currentHistoryInfo?(this.editorHistory.currentHistoryInfo.endPosition=this.selection.getHierarchicalIndex(h.paragraph,h.offset.toString()),this.editorHistory.updateComplexHistory()):this.updateComplexWithoutHistory(1,c,v)}},e.prototype.insertHyperlinkInternalInternal=function(e,i,n,r){if(!t.isNullOrUndefined(e.start)&&!this.editHyperlink(e,i,n)){this.initHistory("InsertHyperlink");var o=!0;if(!e.isEmpty){var s=this.owner.enableTrackChanges;this.owner.enableTrackChanges=!1,o=this.removeSelectedContents(e),this.owner.enableTrackChanges=s}if(o){var a=this.getCharacterFormat(e),l=new k;l.copyFormat(a),this.insertHyperlinkByFormat(e,i,n,l,r)}}},e.prototype.insertHyperlinkByFormat=function(e,i,n,r,o){this.updateInsertPosition(),e.owner.isShiftingEnabled=!0;var s=[],a=new Ie(0);s.push(a);var l=new Oe;l.text=o?' HYPERLINK \\l "'+i+'" ':' HYPERLINK "'+i+'" ',s.push(l);var d=new Ie(2);s.push(d),t.isNullOrUndefined(n)||""===n||((l=new Oe).characterFormat.underline="Single",l.characterFormat.fontColor="#0563c1",l.text=n,s.push(l));var h=new Ie(1);s.push(h),this.insertElement(s),h.linkFieldCharacter(this.documentHelper),-1===this.documentHelper.fields.indexOf(a)&&this.documentHelper.fields.push(a),e.selects(h.line,h.line.getOffset(h,h.length),!0),this.updateEndPosition(),this.reLayout(e,!0)},e.prototype.initInsertInline=function(e,t){this.initHistory("InsertInline"),this.insertInlineInSelection(this.documentHelper.selection,e),this.editorHistory&&this.editorHistory.updateHistory()},e.prototype.insertElementInCurrentLine=function(e,t){this.checkIsNotRedoing()&&(e.owner.isShiftingEnabled=!0),e.isEmpty||this.removeSelectedContents(e),this.updateInsertPosition(),this.insertElement([t]),this.checkEndPosition(e)&&this.updateHistoryPosition(e.start,!1),this.fireContentChange()},e.prototype.editHyperlink=function(e,i,n,r){var o=e.getHyperlinkField();if(t.isNullOrUndefined(o))return!1;this.initHistory("InsertHyperlink"),this.editHyperlinkInternal=t.isNullOrUndefined(this.editorHistory)||this.editorHistory&&t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo);var s="",a=!1,l=this.getCharacterFormat(e),d=new k;d.copyFormat(l);var h=void 0;if(!t.isNullOrUndefined(o.fieldSeparator)){h=o.fieldSeparator;var c=e.getHyperlinkDisplayText(o.fieldSeparator.line.paragraph,o.fieldSeparator,o.fieldEnd,a,d);s=c.displayText,a=c.isNestedField,d=c.format}var p=o.line.getOffset(o,0);if(e.start.setPositionParagraph(o.line,p),p=o.fieldEnd.line.getOffset(o.fieldEnd,1),e.end.setPositionParagraph(o.fieldEnd.line,p),this.skipFieldDeleteTracking=!0,this.deleteSelectedContents(e,!1),!a&&s!==n||t.isNullOrUndefined(h))this.insertHyperlinkByFormat(e,i,n,d,r);else{this.updateInsertPosition();var g=new Ie(0);g.characterFormat.copyFormat(o.characterFormat),g.line=e.start.currentWidget,this.insertInlineInternal(g);var u=new Oe;u.characterFormat.copyFormat(o.characterFormat),u.text=r?' HYPERLINK \\l "'+i+'" ':' HYPERLINK "'+i+'" ',u.line=e.start.currentWidget,this.insertInlineInternal(u);var m=this.editorHistory&&this.editorHistory.currentBaseHistoryInfo?this.editorHistory.currentBaseHistoryInfo.removedNodes:this.nodes;this.insertClonedFieldResult(e,m,h),e.end.currentWidget.getInline(e.end.offset,0).element.linkFieldCharacter(this.documentHelper),this.skipFieldDeleteTracking=!1;var f=g.line.paragraph,v=g.line.paragraph.childWidgets.indexOf(g.line),y=g.line.children.indexOf(g);this.documentHelper.layout.reLayoutParagraph(f,v,y),e.selects(g.fieldEnd.line,p,!0),this.updateEndPosition(),this.reLayout(e,!0)}return this.editHyperlinkInternal=!1,this.nodes=[],!0},e.prototype.insertClonedFieldResult=function(e,t,i){for(var n=!1,r=t.length-1;r>-1;r--){var o=t[r];if(!n){if(i!==o){if(o instanceof we&&o===i.line.paragraph){n=!0;var s=void 0;if(r===t.length-1){s=e.start.paragraph;var a=i.line.paragraph;this.getClonedFieldResultWithSel(a,e,i)}else s=this.getClonedFieldResult(i.line.paragraph,i),this.insertParagraph(s,!0);e.selectParagraphInternal(e.getNextParagraphBlock(s),!0)}continue}n=!0}o instanceof Se?this.insertInlineInternal(o.clone()):o instanceof ye&&this.insertBlock(o.clone())}},e.prototype.getClonedFieldResultWithSel=function(e,t,i){for(var n=e.childWidgets.indexOf(i.line),r=e.childWidgets[n].children.indexOf(i),o=n;o<e.childWidgets.length;o++){var s=e.childWidgets[o];o!==n&&(r=0);for(var a=r;a<s.children.length;a++)this.insertInlineInternal(s.children[a].clone())}},e.prototype.getClonedFieldResult=function(e,t){var i=new we;i.characterFormat.copyFormat(e.characterFormat),i.paragraphFormat.copyFormat(e.paragraphFormat);for(var n=e.childWidgets.indexOf(t.line),r=e.childWidgets[n].children.indexOf(t),o=n;o<e.childWidgets.length;o++){var s=e.childWidgets[o];o!==n&&(r=0);for(var a=r;a<s.children.length;a++)i.childWidgets[0].children.push(s.children[a])}return i},e.prototype.removeHyperlink=function(){if(!this.owner.isReadOnlyMode){var e=this.selection,i=e.getHyperlinkField();if(!t.isNullOrUndefined(i)){var n=i.fieldEnd,r=i.fieldSeparator,o=new kt(e.owner);o.setPositionParagraph(i.line,i.line.getOffset(i,0));var s=this.selection.getParagraphInfo(o),a=this.selection.getHierarchicalIndex(s.paragraph,s.offset.toString()),l=new kt(e.owner);l.setPositionParagraph(r.line,r.line.getOffset(r,r.length)),s=this.selection.getParagraphInfo(l);var d=this.selection.getHierarchicalIndex(s.paragraph,s.offset.toString());this.initComplexHistory("RemoveHyperlink"),e.start.setPositionParagraph(n.line,n.line.getOffset(n,0)),s=this.selection.getParagraphInfo(e.start);var h=this.selection.getHierarchicalIndex(s.paragraph,s.offset.toString());e.end.setPositionInternal(e.start),this.delete(),e.start.setPositionInternal(this.selection.getTextPosBasedOnLogicalIndex(d)),this.initHistory("Underline"),this.updateCharacterFormatWithUpdate(e,"underline","None",!1),this.editorHistory&&this.editorHistory.updateHistory(),e.end.setPositionInternal(this.selection.getTextPosBasedOnLogicalIndex(h)),this.initHistory("FontColor"),this.updateCharacterFormatWithUpdate(e,"fontColor",void 0,!1),this.editorHistory&&this.editorHistory.updateHistory(),this.reLayout(e,!1),e.end.setPositionInternal(e.start),e.start.setPositionInternal(this.selection.getTextPosBasedOnLogicalIndex(a)),this.initHistory("Delete"),this.deleteSelectedContents(e,!1),this.reLayout(e,!0),this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentHistoryInfo)&&this.editorHistory.updateComplexHistory()}}},e.prototype.pasteInternal=function(e,i){if(this.currentPasteOptions=this.owner.defaultPasteOption,this.documentHelper.owner.enableLocalPaste)this.paste();else{this.selection.isViewPasteOptions=!0,this.selection.pasteElement&&(this.selection.pasteElement.style.display="none"),t.isNullOrUndefined(i)&&(i=window);var n="",r="",o="",s=i.clipboardData?i.clipboardData:e.clipboardData;if("msie"!==t.Browser.info.name&&(o=s.getData("Text/Rtf"),r=s.getData("Text/Html")),this.copiedTextContent=n=s.getData("Text"),this.previousCharFormat=new k,this.previousCharFormat.copyFormat(this.selection.start.paragraph.characterFormat),this.previousParaFormat=new I,this.previousParaFormat.copyFormat(this.selection.start.paragraph.paragraphFormat),"FormFieldsOnly"===this.documentHelper.protectionType&&this.documentHelper.selection.isInlineFormFillMode()&&(r="",o=""),""!==o)this.pasteAjax(o,".rtf");else if(""!==r){var a=(new DOMParser).parseFromString(r,"text/html"),l=(new XMLSerializer).serializeToString(a);l=(l=(l=l.replace(/<!--StartFragment-->/gi,"")).replace(/<!--EndFragment-->/gi,"")).replace('xmlns="http://www.w3.org/1999/xhtml"',""),this.pasteAjax(l,".html")}else null!==n&&""!==n?(this.pasteContents(n),this.applyPasteOptions(this.currentPasteOptions),this.documentHelper.editableDiv.innerHTML=""):"msie"!==t.Browser.info.name&&void 0!==s.items&&0!==s.items.length&&"image/png"===s.items[0].type?this.pasteImage(s.items[0].getAsFile()):"msie"===t.Browser.info.name&&void 0!==s.files&&0!==s.files.length&&"image/png"===s.files[0].type&&this.pasteImage(s.files[0])}},e.prototype.pasteImage=function(e){var t=this,i=new FileReader;i.onload=function(){t.onPasteImage(i.result)},i.readAsDataURL(e)},e.prototype.onPasteImage=function(e){var t=document.createElement("img"),i=this;t.addEventListener("load",function(){i.insertImage(e,this.width,this.height)}),t.src=e},e.prototype.pasteAjax=function(e,t){var i=this,r={content:e,type:t};this.pasteRequestHandler=new v,this.owner.documentHelper.viewerContainer.focus(),n.showSpinner(this.owner.element),this.pasteRequestHandler.url=i.owner.serviceUrl+this.owner.serverActionSettings.systemClipboard,this.pasteRequestHandler.responseType="json",this.pasteRequestHandler.contentType="application/json;charset=UTF-8",this.pasteRequestHandler.customHeaders=i.owner.headers,this.pasteRequestHandler.onSuccess=this.pasteFormattedContent.bind(this),this.pasteRequestHandler.onFailure=this.onPasteFailure.bind(this),this.pasteRequestHandler.onError=this.onPasteFailure.bind(this),this.pasteRequestHandler.send(r)},e.prototype.pasteFormattedContent=function(e){var i=this;this.isPasteListUpdated&&(this.isPasteListUpdated=!1),this.pasteContents(t.isNullOrUndefined(e.data)?this.copiedTextContent:e.data),"KeepSourceFormatting"!==this.currentPasteOptions&&this.applyPasteOptions(this.currentPasteOptions),n.hideSpinner(this.owner.element),setTimeout(function(){t.isNullOrUndefined(i.viewer)||i.viewer.updateScrollBars()},0)},e.prototype.onPasteFailure=function(e){this.owner.fireServiceFailure(e),console.error(e.status,e.statusText),n.hideSpinner(this.owner.element),this.documentHelper.updateFocus()},e.prototype.paste=function(e,i){var n=this;if(t.isNullOrUndefined(e)&&(e=this.owner.enableLocalPaste?this.copiedData:void 0),t.isNullOrUndefined(i)||(this.currentPasteOptions=i),e){var r=JSON.parse(e);this.pasteContents(r),this.applyPasteOptions(this.currentPasteOptions),this.chartType&&(setTimeout(function(){t.isNullOrUndefined(n.viewer)||n.viewer.updateScrollBars()},30),this.chartType=!1)}},e.prototype.getUniqueListOrAbstractListId=function(e){if(e&&this.documentHelper.lists.length){var t=this.documentHelper.lists.slice().sort(function(e,t){return e.listId-t.listId});return t[t.length-1].listId+1}if(this.documentHelper.abstractLists.length){var i=this.documentHelper.abstractLists.slice().sort(function(e,t){return e.abstractListId-t.abstractListId});return i[i.length-1].abstractListId+1}return 0},e.prototype.checkSameLevelFormat=function(e,t,i){return t.levels[e].listLevelPattern===i.abstractList.levels[e].listLevelPattern&&t.levels[e].numberFormat===i.abstractList.levels[e].numberFormat&&("Bullet"===t.levels[e].listLevelPattern||t.levels[e].startAt===i.abstractList.levels[e].startAt)},e.prototype.listLevelPatternInCollection=function(e,t){var i=this;return this.documentHelper.lists.filter(function(n){return n.abstractList.levels[e].listLevelPattern===t.listLevelPattern&&n.abstractList.levels[e].numberFormat===t.numberFormat&&("Bullet"===t.listLevelPattern||n.abstractList.levels[e].startAt===t.startAt)&&i.isEqualParagraphFormat(n.abstractList.levels[e].paragraphFormat,t.paragraphFormat)})[0]},e.prototype.isEqualParagraphFormat=function(e,i){return!(t.isNullOrUndefined(i.leftIndent)&&0!==e.leftIndent||!t.isNullOrUndefined(i.leftIndent)&&Math.round(e.leftIndent)!==Math.round(i.leftIndent))&&(!(t.isNullOrUndefined(i.rightIndent)&&0!==e.rightIndent||!t.isNullOrUndefined(i.rightIndent)&&Math.round(e.rightIndent)!==Math.round(i.rightIndent))&&(!(t.isNullOrUndefined(i.firstLineIndent)&&0!==e.firstLineIndent||!t.isNullOrUndefined(i.firstLineIndent)&&Math.round(e.firstLineIndent)!==Math.round(i.firstLineIndent))&&(!(t.isNullOrUndefined(i.beforeSpacing)&&0!==e.beforeSpacing||!t.isNullOrUndefined(i.beforeSpacing)&&Math.round(e.beforeSpacing)!==Math.round(i.beforeSpacing))&&(!(t.isNullOrUndefined(i.afterSpacing)&&0!==e.afterSpacing||!t.isNullOrUndefined(i.afterSpacing)&&Math.round(e.afterSpacing)!==Math.round(i.afterSpacing))&&(!(t.isNullOrUndefined(i.textAlignment)&&"Left"!==e.textAlignment||!t.isNullOrUndefined(i.textAlignment)&&e.textAlignment!==i.textAlignment)&&(!(t.isNullOrUndefined(i.bidi)&&!1!==e.bidi||!t.isNullOrUndefined(i.bidi)&&e.bidi!==i.bidi)&&(!(t.isNullOrUndefined(i.contextualSpacing)&&!1!==e.contextualSpacing||!t.isNullOrUndefined(i.contextualSpacing)&&e.contextualSpacing!==i.contextualSpacing)&&(!(t.isNullOrUndefined(i.outlineLevel)&&"BodyText"!==e.outlineLevel||!t.isNullOrUndefined(i.outlineLevel)&&e.outlineLevel!==i.outlineLevel)&&(!(t.isNullOrUndefined(i.lineSpacing)&&1!==e.lineSpacing||!t.isNullOrUndefined(i.lineSpacing)&&Math.round(e.lineSpacing)!==Math.round(i.lineSpacing))&&!(t.isNullOrUndefined(i.lineSpacingType)&&"Multiple"!==e.lineSpacingType||!t.isNullOrUndefined(i.lineSpacingType)&&e.lineSpacingType!==i.lineSpacingType))))))))))},e.prototype.getBlocksToUpdate=function(e){for(var t=[],i=0;i<e.length;i++){var n=e[i];if(n.paragraphFormat&&n.paragraphFormat.listFormat&&Object.keys(n.paragraphFormat.listFormat).length>0)t.push(n);else if(n.rows)for(var r=0;r<n.rows.length;r++)for(var o=n.rows[r],s=0;s<o.cells.length;s++){var a=o.cells[s];t=t.concat(this.getBlocksToUpdate(a.blocks))}}return t},e.prototype.updateListIdForBlocks=function(e,i,n,r,o){for(var s=!1,a=0;a<e.length;a++){var l=e[a];if(l.paragraphFormat&&l.paragraphFormat.listFormat&&Object.keys(l.paragraphFormat.listFormat).length>0){var d=l.paragraphFormat.listFormat,h=this.listLevelPatternInCollection(d.listLevelNumber,i.levels[d.listLevelNumber]);d.listId===r&&(t.isNullOrUndefined(h)&&(!n||n&&!this.checkSameLevelFormat(d.listLevelNumber,i,n))?(s=!0,d.listId=o):!t.isNullOrUndefined(h)&&this.checkSameLevelFormat(d.listLevelNumber,i,h)&&(d.isUpdated||(d.listId=h.listId,d.isUpdated=!0),s=!1))}else if(l.rows)for(var c=0;c<l.rows.length;c++)for(var p=l.rows[c],g=0;g<p.cells.length;g++){var u=p.cells[g],m=this.updateListIdForBlocks(u.blocks,i,n,r,o);s||(s=m)}}return s},e.prototype.updatePasteContent=function(e,i){var n=this.getUniqueListOrAbstractListId(!0);if(e.lists.filter(function(e){return e.listId===n}).length>0){var r=e.lists.slice().sort(function(e,t){return e.listId-t.listId});n=r[r.length-1].listId+1}var o=this.getUniqueListOrAbstractListId(!1);if(e.abstractLists.filter(function(e){return e.abstractListId===o}).length>0){var s=e.abstractLists.slice().sort(function(e,t){return e.abstractListId-t.abstractListId});o=s[s.length-1].abstractListId+1}for(var a,l=this,d=0;d<e.lists.length;d++)!function(r){var s=e.lists[r],d=e.abstractLists.filter(function(e){return e.abstractListId===s.abstractListId})[0],h=l.documentHelper.lists.filter(function(e){return e.listId===s.listId});t.isNullOrUndefined(d)||(l.updateListIdForBlocks(e.sections[i].blocks,d,h[0],s.listId,n)?(d.abstractListId=o,s.listId=n,s.abstractListId=o,n++,o++):(e.lists.splice(r,1),e.abstractLists.splice(e.abstractLists.indexOf(d),1),r--)),a=r}(d),d=a;for(var h=this.getBlocksToUpdate(e.sections[i].blocks),c=0;c<h.length;c++)delete h[c].paragraphFormat.listFormat.isUpdated},e.prototype.getBlocks=function(e,i,n,r,o){var s=[];if("string"==typeof e){var a=this.selection.start.paragraph;this.selection.isForward||(a=this.selection.end.paragraph);var l=[],d=e;d=d.replace(/\r\n/g,"\r"),l=-1!==navigator.userAgent.indexOf("Firefox")?d.split("\n"):d.split("\r");var h=[];(N=new fe).sectionFormat=new x(N),N.childWidgets=h;for(b=0;b<l.length;b++)if(b!==l.length-1||0!==l[b].length){var c=this.selection.start.currentWidget.getInline(this.selection.start.offset,0),p=this.selection.getPreviousValidElement(c.element);p!==c.element&&(p=this.selection.getNextValidElement(c.element));var g=p&&p===c.element?a.characterFormat:p?p.characterFormat:this.copyInsertFormat(a.characterFormat,!1);t.isNullOrUndefined(this.previousCharFormat)||(g=this.previousCharFormat);var m=this.documentHelper.selection.copySelectionParagraphFormat();t.isNullOrUndefined(this.previousParaFormat)||(m=this.previousParaFormat);var f=new we;f.paragraphFormat.copyFormat(m);var v=new Te(f);if(l[b].length>0){var y=new Oe;y.characterFormat.copyFormat(g),y.text=l[b],v.children.push(y),y.line=v}f.childWidgets.push(v),f.containerWidget=N,h.push(f)}s.push(N)}else{this.viewer.owner.parser.addCustomStyles(e),!i&&e.comments.length>0&&(this.documentHelper.owner.parser.commentsCollection=new u,this.documentHelper.owner.parser.parseComments(e,r));for(var b=0;b<e.sections.length;b++){var w=this.documentHelper.owner.parser;if(w.isPaste=i,this.isPasteListUpdated||t.isNullOrUndefined(e.lists)||(this.documentHelper.lists.length>0&&this.updatePasteContent(e,b),this.isPasteListUpdated=!0,t.isNullOrUndefined(e.abstractLists)||w.parseAbstractList(e,this.documentHelper.abstractLists),t.isNullOrUndefined(e.lists)||w.parseList(e,this.documentHelper.lists)),!t.isNullOrUndefined(e.revisions))if(i){var C=this.viewer.owner.revisionsInternal.changes;t.isNullOrUndefined(w.revisionCollection)||(w.revisionCollection=void 0),w.revisionCollection=new u;var F=w.revisionCollection;if((!this.documentHelper.owner.sfdtExportModule.copyWithTrackChange||!w.isCutPerformed)&&e.revisions.length>=1)for(var P=0;P<e.revisions.length;P++){var T=!0;if(F.containsKey(e.revisions[P].revisionId)){if(C.length>0)for(var S=0;S<C.length;S++)C[S].revisionID===e.revisions[P].revisionId&&(T=!1);if(T){var I=F.get(e.revisions[P].revisionId);C.push(I)}}else w.parseRevisions(e,C)}this.documentHelper.owner.sfdtExportModule.copyWithTrackChange=!1}else w.revisionCollection=this.documentHelper.revisionsInternal,w.parseRevisions(e,o);var N=new fe;N.sectionFormat=new x(N),w.parseSectionFormat(e.sections[b].sectionFormat,N.sectionFormat),i?s.push(N):n.unshift(N),w.parseBody(e.sections[b].blocks,N.childWidgets),w.isPaste=!1}}return"MergeWithExistingFormatting"===this.currentPasteOptions&&this.applyMergeFormat(s),s},e.prototype.applyMergeFormat=function(e){for(var t=this.selection.start.paragraph,i=this.selection.start.currentWidget.getInline(this.selection.start.offset,0),n=this.selection.getPreviousValidElement(i.element),r=n?n.characterFormat:this.copyInsertFormat(t.characterFormat,!1),o=this.documentHelper.selection.copySelectionParagraphFormat(),s=0;s<e.length;s++)for(var a=e[s].childWidgets,l=0;l<a.length;l++){var d=a[l];if(d instanceof we)d.paragraphFormat.copyFormat(o),this.applyFormatInternal(d,r);else for(var h=0;h<d.childWidgets.length;h++)for(var c=d.childWidgets[h],p=0;p<c.childWidgets.length;p++)for(var g=c.childWidgets[p],u=0;u<g.childWidgets.length;u++)this.applyFormatInternal(g.childWidgets[u],r)}},e.prototype.applyFormatInternal=function(e,i){if(e instanceof we)for(s=0;s<e.childWidgets.length;s++)for(var n=e.childWidgets[s],r=0;r<n.children.length;r++){var o=n.children[r].characterFormat.cloneFormat();t.isNullOrUndefined(i.uniqueCharacterFormat)?n.children[r].characterFormat=i:(n.children[r].characterFormat.uniqueCharacterFormat=void 0,n.children[r].characterFormat.copyFormat(i)),o.bold&&(n.children[r].characterFormat.bold=o.bold),o.italic&&(n.children[r].characterFormat.italic=o.italic),"None"!==o.underline&&(n.children[r].characterFormat.underline=o.underline)}else for(var s=0;s<e.childWidgets.length;s++)for(var a=e.childWidgets[s],r=0;r<a.childWidgets.length;r++)for(var l=a.childWidgets[r],d=0;d<l.childWidgets.length;d++)this.applyFormatInternal(l.childWidgets[d],i)},e.prototype.applyPasteOptions=function(e){if(!t.isNullOrUndefined(this.copiedContent)&&""!==this.copiedTextContent){switch(this.isSkipHistory=!0,this.currentPasteOptions=e,this.selection.start.setPositionInternal(this.pasteTextPosition.startPosition),this.selection.end.setPositionInternal(this.pasteTextPosition.endPosition),e){case"KeepSourceFormatting":this.pasteContents(""!==this.copiedContent?this.copiedContent:this.copiedTextContent);break;case"MergeWithExistingFormatting":var i=(this.selection.isForward?this.selection.start:this.selection.end).paragraph.paragraphFormat;this.pasteContents(""!==this.copiedContent?this.copiedContent:this.copiedTextContent,i);break;case"KeepTextOnly":this.pasteContents(this.copiedTextContent)}this.isSkipHistory=!1}},e.prototype.applyTablePasteOptions=function(e){if(!t.isNullOrUndefined(this.copiedContent)&&""!==this.copiedTextContent){this.isPaste=!0;var i=""!==this.copiedContent?this.copiedContent:this.copiedTextContent;this.editorHistory&&this.editorHistory.canUndo()&&(this.editorHistory.undo(),this.editorHistory.redoStack.pop());var n=this.getBlocks(i,!0),r=this.selection.start.paragraph.paragraphFormat;switch(e){case"NestTable":this.pasteAsNestedTable(n,r);break;case"InsertAsRows":this.pasteAsNewRow(n[0].childWidgets[0]);break;case"InsertAsColumns":this.pasteAsNewColumn(n[0].childWidgets[0]);break;case"OverwriteCells":this.pasteOverwriteCell(n[0].childWidgets[0])}this.isPaste=!1}},e.prototype.pasteContents=function(e,t){if("string"!=typeof e&&(this.copiedContent=e),"FormFieldsOnly"===this.documentHelper.protectionType&&this.documentHelper.selection.isInlineFormFillMode()){var i=this.selection.getCurrentFormField(),n=this.getFormFieldText(),r=i.formFieldData.maxLength,o=this.documentHelper.selection.text.length;if(r>0)if(0===o){var s=r-n.length;e=e.substring(0,s)}else o>0&&(e=e.substring(0,o))}this.pasteContentsInternal(this.getBlocks(e,!0),!0,t),this.isInsertField=!1},e.prototype.pasteContentsInternal=function(e,t,i){this.isPaste=t;var n=this.documentHelper.selection;if(n.start.paragraph.isInsideTable&&n.end.paragraph.isInsideTable){var r=!1;if(1===e.length){var o=e[0].childWidgets;o.length<3&&(1===o.length&&o[0]instanceof xe||2===o.length&&o[0]instanceof xe&&o[1].isEmpty())&&(r=!0)}if(r){var s=n.start.paragraph.associatedCell,a=n.end.paragraph.associatedCell,l=e[0].childWidgets[0];if(s.ownerTable.equals(a.ownerTable))return 0===n.start.paragraph.associatedCell.rowIndex&&0===n.end.paragraph.associatedCell.rowIndex&&s.equals(a)&&!this.selection.isCellSelected(s,n.start,n.end)?(this.selection.currentPasteAction="InsertAsColumns",this.pasteAsNewColumn(l)):(this.selection.currentPasteAction="OverwriteCells",this.pasteOverwriteCell(l)),void(this.isPaste=!1)}}this.selection.currentPasteAction="DefaultPaste",this.defaultPaste(e,i)},e.prototype.defaultPaste=function(e,t){var i=this.documentHelper.selection,n=!0;if(this.isSkipHistory||this.initComplexHistory("Paste"),this.documentHelper.isListTextSelected){var r=i.start.paragraph;r.paragraphFormat.listFormat&&-1!==r.paragraphFormat.listFormat.listId&&this.onApplyList(void 0)}this.isSkipHistory||this.initHistory("Paste"),i.isEmpty&&!this.documentHelper.isListTextSelected||(n=this.removeSelectedContentInternal(i,i.start,i.end)),n?this.pasteContent(e,t):this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo=void 0),this.editorHistory&&this.editorHistory.currentHistoryInfo?(this.editorHistory.updateHistory(),this.editorHistory.updateComplexHistory()):this.reLayout(i,i.isEmpty),this.isPaste=!1},e.prototype.pasteAsNewColumn=function(e){if(!this.owner.isReadOnlyMode&&this.canEditContentControl&&this.selection.start.paragraph.isInsideTable){this.checkIsNotRedoing()&&this.initHistory("PasteColumn");var i=this.getOwnerCell(this.selection.isForward),n=i.ownerRow.ownerTable.combineWidget(this.owner.viewer);if(this.editorHistory)this.cloneTableToHistoryInfo(n);this.selection.owner.isLayoutEnabled=!1;var r=e.clone(),o=r.childWidgets[0],s=r.childWidgets.length,a=o.childWidgets.length,l=i.columnIndex,d=void 0,h=void 0,c=a,p=[];s>n.childWidgets.length?(this.addRows(s-n.childWidgets.length,n),this.tableUpdate(n)):n.childWidgets.length>s&&(this.addRows(n.childWidgets.length-s,r,n),this.tableUpdate(n));for(var g=0;g<c;g++)for(var u=0;u<n.childWidgets.length;u++){var m=n.childWidgets[u],f=r.childWidgets[u].childWidgets[g],v=m.childWidgets[i.columnIndex];(h=this.createColumn(this.selection.getLastParagraph(i))).index=u,h.rowIndex=m.index,h.containerWidget=m;var y=m.previousWidget,b=this.rowspannedCollection(m,p);if(null!=v)h.cellFormat.copyFormat(v.cellFormat),h.cellFormat.rowSpan=1;else if(b.length>0)for(var w=0;w<b.length;w++)y.rowIndex+(b[w].cellFormat.rowSpan-1)>=m.rowIndex&&(h.cellFormat.copyFormat(b[w].cellFormat),h.cellFormat.rowSpan=1);f.containerWidget=h.containerWidget,h.childWidgets=f.childWidgets,t.isNullOrUndefined(d)&&(d=this.selection.getFirstParagraph(h)),0===l?m.childWidgets.splice(g,0,h):this.insertSpannedCells(m,p,h,l)}this.tableReLayout(n,d,h)}},e.prototype.pasteAsNestedTable=function(e,i){var n=e[0].childWidgets[0];if(this.selection.start.paragraph.isInsideTable){this.checkIsNotRedoing()&&this.initHistory("PasteNested");var r=this.getOwnerCell(this.selection.isForward),o=r.ownerRow.ownerTable.combineWidget(this.owner.viewer);this.editorHistory&&this.cloneTableToHistoryInfo(o);var s=void 0,a=n.clone(),l=this.selection.end.paragraph.containerWidget,d=void 0;if(r!=l){for(var h=r.ownerRow;h!=l.ownerRow.nextRow;){for(var c=r.columnIndex;c<=l.columnIndex;c++){d=h.childWidgets[c];var p=a.clone(),g=new we;d.childWidgets=[],d.childWidgets[0]=p,d.childWidgets[1]=g,g.containerWidget=d,p.containerWidget=d,p.index=0,g.index=1,h.childWidgets[c]=d,t.isNullOrUndefined(s)&&(s=this.selection.getFirstParagraph(d))}h=h.nextRow}this.tableReLayout(o,s,d)}else this.defaultPaste(e,i)}},e.prototype.pasteOverwriteCell=function(e){if(this.selection.start.paragraph.isInsideTable){this.checkIsNotRedoing()&&this.initHistory("PasteOverwrite");var i=this.getOwnerCell(this.selection.isForward),n=i.ownerRow.ownerTable.combineWidget(this.owner.viewer);this.editorHistory&&this.cloneTableToHistoryInfo(n);var r=e.clone(),o=r.childWidgets.length,s=this.getOwnerCell(!this.selection.isForward),a=(i.columnIndex,i.rowIndex),l=void 0,d=this.selection.start.paragraph.associatedCell.ownerRow,h=r.childWidgets[0],c=void 0,p=(h.childWidgets.length,i.ownerRow);if(i!=s){for(var g=0,u=void 0,m=void 0,f=void 0,v=void 0;p!=s.ownerRow.nextRow;){for(var y=(h=r.childWidgets[g]||r.childWidgets[g=0]).childWidgets.length,b=0,w=i.columnIndex;w<=s.columnIndex;w++){h=r.childWidgets[g],u>1&&m===w&&(w++,u--,m=null),f>1&&b>=y-(f-1)&&(w+=(f=1)-1,b=0),v=(c=h.childWidgets[b]||h.childWidgets[b=0]).clone();for(var C=p.childWidgets[w],x=0;x<v.childWidgets.length;x++)(N=v.childWidgets[x]).containerWidget=C,v.childWidgets[x]=N;C.childWidgets=v.childWidgets,c.cellFormat.rowSpan>1&&(u=c.cellFormat.rowSpan,m=w),c.cellFormat.columnSpan>1&&(f=c.cellFormat.columnSpan),p.childWidgets[w]=C,t.isNullOrUndefined(l)&&(l=this.selection.getFirstParagraph(v)),b++}p=p.nextRow,g++}this.tableReLayout(n,l,v)}else{var F=void 0,u=void 0,m=void 0,C=void 0;o>n.childWidgets.length-a&&(F=o-n.childWidgets.length+a,this.addRows(F,n));for(var P=0;P<o;P++){for(var w=i.columnIndex,T=(h=r.childWidgets[P]).childWidgets.length,S=0;S<T;S++){v=(c=h.childWidgets[S]).clone();u>1&&m===w&&(w++,u--,m=null),(C=d.childWidgets[w])||((C=v).containerWidget=d,C.index=w);for(var I=0;I<v.childWidgets.length;I++){var N=v.childWidgets[I];N.containerWidget=C,v.childWidgets[I]=N}C.childWidgets=v.childWidgets,c.cellFormat.rowSpan>1&&(u=c.cellFormat.rowSpan,m=w),d.childWidgets.splice(w++,1,C),t.isNullOrUndefined(l)&&(l=this.selection.getFirstParagraph(C))}d=d.nextRow}this.tableReLayout(n,l,C)}}},e.prototype.pasteAsNewRow=function(e){if(!this.owner.isReadOnlyMode&&this.canEditContentControl){this.checkIsNotRedoing()&&this.initHistory("PasteRow"),this.documentHelper.owner.isShiftingEnabled=!0;var t=this.getOwnerCell(this.selection.isForward).getSplitWidgets()[0],i=this.getOwnerCell(!this.selection.isForward).getSplitWidgets()[0],n=t.ownerTable.combineWidget(this.owner.viewer),r=i.ownerRow;this.editorHistory&&this.cloneTableToHistoryInfo(n);this.getRowCountToInsert(),this.getColumnCountToInsert();var o=[],s=r.rowIndex;s++;for(var a=e.childWidgets.length,l=0;l<a;l++){var d=e.childWidgets[l].clone();this.owner.enableTrackChanges&&this.insertRevision(d.rowFormat,"Insertion"),o.push(d)}n.insertTableRowsInternal(o,s,!1);var h=void 0,c=void 0;if(n.childWidgets[s]instanceof Fe)h=n.childWidgets[s].firstChild,c=this.selection.getFirstParagraph(h);else{for(var p=void 0;!(p instanceof xe);)p=n.nextRenderedWidget;c=this.selection.getFirstParagraphInFirstCell(p)}this.documentHelper.layout.reLayoutTable(n),this.selection.selectParagraphInternal(c,!0),this.reLayout(this.selection,!0)}},e.prototype.tableUpdate=function(e){e.isGridUpdated=!1,e.calculateGrid(),e.buildTableColumns(),e.isGridUpdated=!0},e.prototype.rowspannedCollection=function(e,t){for(var i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];n.cellFormat.rowSpan>1&&t.push(n)}return t},e.prototype.insertSpannedCells=function(e,t,i,n){for(var r=!1,o=0;o<e.childWidgets.length;o++){var s=e.childWidgets[o];if(s.cellFormat.rowSpan>1&&t.push(s),s.columnIndex+s.cellFormat.columnSpan===n?(e.childWidgets.splice(s.cellIndex+1,0,i),r=!0):n>s.columnIndex&&s.columnIndex+s.cellFormat.columnSpan>n&&n<s.columnIndex+s.cellFormat.columnSpan&&(e.childWidgets.splice(s.cellIndex+1,0,i),r=!0),r)break}if(!r&&t.length>0)for(var a=0;a<t.length;a++){var l=t[a];if(l.ownerRow!==e&&e.rowIndex<=l.ownerRow.rowIndex+l.cellFormat.rowSpan-1&&(l.columnIndex+l.cellFormat.columnSpan===n?(l.cellIndex>e.childWidgets.length?e.childWidgets.push(i):e.childWidgets.splice(l.cellIndex,0,i),r=!0):n>l.columnIndex&&l.columnIndex+l.cellFormat.columnSpan>n&&n<l.columnIndex+l.cellFormat.columnSpan&&(e.childWidgets.splice(l.columnIndex,0,i),r=!0)),r)break}},e.prototype.addRows=function(e,t,i){if(!this.owner.isReadOnlyMode&&this.canEditContentControl){var n=this.selection.isForward?this.selection.start:this.selection.end,r=(this.selection.isForward?this.selection.end:this.selection.start,t.childWidgets.length),o=t.childWidgets[r-1],s=o.childWidgets.length;if(n.paragraph.isInsideTable){var a=this.getOwnerCell(this.selection.isForward).getSplitWidgets()[0],l=o.childWidgets[s-1],d=l.ownerRow;this.rowInsertion(e,"Below",a,l,d,t,!1)}}},e.prototype.pasteContent=function(e,t){this.documentHelper.owner.isShiftingEnabled=!0;var i="";if(this.updateInsertPosition(),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo)i=this.editorHistory.currentBaseHistoryInfo.insertPosition;else{var n=this.selection.start;this.selection.isForward||(n=this.selection.end);o=this.selection.getParagraphInfo(n);i=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString())}this.documentHelper.owner.isLayoutEnabled=!0,this.documentHelper.owner.isPastingContent=!0,this.pasteCopiedData(e,t);var r="";if(this.updateEndPosition(),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo)r=this.editorHistory.currentBaseHistoryInfo.endPosition;else{var o=this.selection.getParagraphInfo(this.selection.start);r=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString())}var s=new kt(this.documentHelper.owner);this.setPositionForCurrentIndex(s,i);var a=new kt(this.documentHelper.owner);this.setPositionForCurrentIndex(a,r),this.pasteTextPosition={startPosition:s,endPosition:a},this.documentHelper.owner.isPastingContent=!1,this.documentHelper.selection.fireSelectionChanged(!0)},e.prototype.pasteCopiedData=function(e,i){if(this.documentHelper.layout.isBidiReLayout&&(this.documentHelper.layout.isBidiReLayout=!1),this.isPaste&&this.isSectionEmpty(this.selection)&&!this.selection.start.paragraph.isInHeaderFooter&&(this.previousSectionFormat=new x,this.previousSectionFormat.copyFormat(this.selection.start.paragraph.bodyWidget.sectionFormat),this.selection.start.paragraph.bodyWidget.sectionFormat.copyFormat(e[0].sectionFormat),this.selection.start.paragraph.bodyWidget.sectionFormat.footerDistance=this.previousSectionFormat.footerDistance,this.selection.start.paragraph.bodyWidget.sectionFormat.headerDistance=this.previousSectionFormat.headerDistance,this.owner.viewer instanceof le)){var n=this.selection.start.paragraph.bodyWidget.page;this.owner.viewer.updatePageBoundingRectangle(this.selection.start.paragraph.bodyWidget,n,n.boundingRectangle.y),this.owner.viewer.updateClientArea(this.selection.start.paragraph.bodyWidget.sectionFormat,n)}for(var r=0;r<e.length;r++)for(var o=e[r].childWidgets,s=0;s<o.length;s++){var a=o[s];if(a instanceof we&&0===a.childWidgets.length&&(a.childWidgets[0]=new Te(a)),a instanceof we&&!t.isNullOrUndefined(i)){a.paragraphFormat.copyFormat(i);var l=this.copyInsertFormat(this.selection.start.paragraph.characterFormat,!1);a.characterFormat.mergeFormat(l)}if(s===o.length-1&&a instanceof we){var d=a;if(d.childWidgets.length>0&&d.childWidgets[0].children.length>0){var h=this.selection.start;if("Center"!==h.paragraph.paragraphFormat.textAlignment&&"Right"!==h.paragraph.paragraphFormat.textAlignment||-1!==h.paragraph.paragraphFormat.listFormat.listId||(h.paragraph.x=this.owner.viewer.clientActiveArea.x),"KeepTextOnly"===this.currentPasteOptions){var c=new I;this.selection.start.paragraph.paragraphFormat=c}this.insertElement(d.childWidgets[0].children,d.paragraphFormat)}}else if(a instanceof ye){var p=this.selection.start.paragraph;if(a instanceof xe){var g=a;if(this.generateTableRevision(g),p.isInsideTable){var u=p.getContainerWidth();g.fitCellsToClientArea(u)}if(p.isEmpty()&&p.previousWidget instanceof xe)return this.insertTableRows(g,p.previousWidget)}this.insertBlockInternal(a)}}},e.prototype.generateTableRevision=function(e){if(this.owner.enableTrackChanges&&!t.isNullOrUndefined(e))for(var i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];this.insertRevision(n.rowFormat,"Insertion");for(var r=0;r<n.childWidgets.length;r++)for(var o=n.childWidgets[r],s=0;s<o.childWidgets.length;s++){var a=o.childWidgets[s];t.isNullOrUndefined(a)||this.insertRevisionForBlock(a,"Insertion")}}},e.prototype.isSectionEmpty=function(e){var i=e.start.paragraph;if(i){if(i.isInsideTable||i.isInHeaderFooter||i!==e.end.paragraph)return!1;var n=i.bodyWidget;if(n){var r=n.page;if(r&&(t.isNullOrUndefined(r.previousPage)||r.previousPage.sectionIndex!==r.sectionIndex)&&t.isNullOrUndefined(r.nextPage)&&i.isEmpty()&&1===n.childWidgets.length)return!0}}return!1},e.prototype.insertTableInternal=function(e,t,i){var n=e.getIndex();if(i)for(var r=0,o=0;r<e.childWidgets.length;r++,o++){var s=e.childWidgets[r];t.childWidgets.splice(o,0,s),s.containerWidget=t,e.childWidgets.splice(r,1),r--}var a=e.containerWidget;this.constructRevisionsForTable(e,!1),this.removeBlock(e,!0),a.childWidgets.splice(n,0,t),t.index=e.index,e.containerWidget=void 0,t.containerWidget=a,this.documentHelper.layout.clearTableWidget(t,!0,!0,!0),t.buildTableColumns(),this.constructRevisionsForTable(t,!0),t.isGridUpdated=!0,this.updateNextBlocksIndex(t,!0),this.documentHelper.layout.linkFieldInTable(t),this.documentHelper.layout.layoutBodyWidgetCollection(t.index,a,t,!1)},e.prototype.canConstructRevision=function(e){return e.revisions.length>0&&0===e.revisions[0].range.length||e.removedIds.length>0},e.prototype.constructRevisionsForTable=function(e,t){for(var i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];if(t){this.canConstructRevision(n.rowFormat)&&this.constructRevisionFromID(n.rowFormat,!0);for(var r=0;r<n.childWidgets.length;r++)for(var o=n.childWidgets[r],s=0;s<o.childWidgets.length;s++)o.childWidgets[s]instanceof we&&this.constructRevisionsForBlock(o.childWidgets[s],t)}else this.removeDeletedCellRevision(n)}},e.prototype.constructRevisionsForBlock=function(e,t){for(var i=0;i<e.childWidgets.length;i++)for(var n=e.childWidgets[i],r=0;r<n.children.length;r++)t&&n.children[r]instanceof Se&&this.canConstructRevision(n.children[r])&&this.constructRevisionFromID(n.children[r],!0);this.canConstructRevision(e.characterFormat)&&this.constructRevisionFromID(e.characterFormat,!0)},e.prototype.applyRevisionForCurrentPara=function(e,i,n,r,o){var s=e.getInline(i+1,0).element,a=!1;i===e.getLength()&&(a=!0);var l=e.getInline(n,0).element;if(n>e.getLength()&&(o=!0),t.isNullOrUndefined(s)||t.isNullOrUndefined(l))t.isNullOrUndefined(s)||a?t.isNullOrUndefined(l)||(l.removedIds.push(r),this.constructRevisionFromID(l,!0)):(s.removedIds.push(r),this.constructRevisionFromID(s,!0));else if(a||s!==l){for(;!t.isNullOrUndefined(s)&&s!==l;)a||(s.removedIds.push(r),this.constructRevisionFromID(s,!0)),t.isNullOrUndefined(s.nextNode)||(s=s.nextNode.nextValidNodeForTracking),a=!1;t.isNullOrUndefined(s)||a||(s.removedIds.push(r),this.constructRevisionFromID(s,!0))}else s.removedIds.push(r),this.constructRevisionFromID(s,!0);o&&(e.characterFormat.removedIds.push(r),this.constructRevisionFromID(e.characterFormat,!0))},e.prototype.insertBlockTable=function(e,t,i){var n=e.start.offset;e.start.paragraph.childWidgets.indexOf(e.start.currentWidget);t instanceof we&&n>0&&(this.moveInlines(e.start.paragraph,t,0,0,e.start.paragraph.firstChild,n,e.start.currentWidget),e.selectParagraphInternal(e.start.paragraph,!0),this.checkInsertPosition(e)&&this.updateHistoryPosition(this.selection.getHierarchicalIndex(t,n.toString()),!0)),n>0&&this.checkInsertPosition(e)&&this.updateHistoryPosition(e.start,!0);var r=i.indexInOwner;if(i.containerWidget.childWidgets.splice(r,0,t),t.containerWidget=i.containerWidget,t.index=i.index,this.updateNextBlocksIndex(t,!0),this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1),this.checkInsertPosition(e)){var o=void 0;t instanceof we&&(o=t),t instanceof xe&&(o=e.getFirstParagraphInFirstCell(t)),this.updateHistoryPosition(this.selection.getHierarchicalIndex(o,"0"),!0)}},e.prototype.handleCut=function(e){var t=e.start,i=e.end;e.isForward||(t=e.end,i=e.start);var n=this.selection.getParagraphInfo(t);if(e.editPosition=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString()),t.paragraph===i.paragraph&&t.offset+1===i.offset)t.paragraph.getInline(i.offset,0).element;this.initHistory("Cut"),e.owner.isShiftingEnabled=!0,this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.checkInsertPosition(e)&&this.updateHistoryPosition(e.editPosition,!0),this.deleteSelectedContent(i.paragraph,e,t,i,3);var r=new kt(e.owner);this.setPositionForCurrentIndex(r,e.editPosition),e.selectContent(r,!0),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.checkEndPosition(e)&&this.updateHistoryPosition(e.end,!1),this.reLayout(e)},e.prototype.insertInlineInternal=function(e,i){var n=this.selection,r=e.length,o=this.selection.getParagraphInfo(n.start);if(i=t.isNullOrUndefined(i)?"Insertion":i,n.start.paragraph.isEmpty()){var s=n.start.paragraph;"Center"!==s.paragraphFormat.textAlignment&&"Right"!==s.paragraphFormat.textAlignment||-1!==s.paragraphFormat.listFormat.listId||(s.x=this.owner.viewer.clientActiveArea.x);var a=!t.isNullOrUndefined(this.editorHistory)&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing);s.childWidgets[0].children.push(e),e.line=s.childWidgets[0],this.owner.enableTrackChanges&&e.isValidNodeForTracking&&!a&&this.insertRevision(e,i),(e.removedIds.length>0||a)&&this.constructRevisionFromID(e,!0),e.linkFieldCharacter(this.documentHelper),e instanceof Le&&("Footnote"===e.footnoteType&&this.updateFootnoteCollection(e),"Endnote"===e.footnoteType&&this.updateEndnoteCollection(e)),this.documentHelper.layout.reLayoutParagraph(s,0,0,void 0,void 0)}else{var l=0,d=n.start.currentWidget.getInline(n.start.offset,l),h=d.element;l=d.index,this.insertElementInternal(h,e,l,i,!0)}this.setPositionParagraph(o.paragraph,o.offset+r,!0)},e.prototype.insertElement=function(e,i){var n=this.selection,r=0,o=void 0,s=-1,a=void 0,l=0,d=void 0,h=this.selection.getParagraphInfo(n.start),c=this.owner.enableTrackChanges,p=void 0,g=void 0,u=0;if(n.start.paragraph.isEmpty())a=(o=n.start.paragraph).childWidgets[0],s=0;else{var m=n.start.paragraph.paragraphFormat.bidi,f=n.start.currentWidget.getInline(n.start.offset,u,m);p=f.element,u=f.index,s=(o=p.line.paragraph).childWidgets.indexOf(p.line),l=p.indexInOwner,a=p.line;var v=!1;p instanceof Oe&&(v=this.documentHelper.textHelper.getRtlLanguage(p.text).isRtl),u===p.length?(m||l++,d=!1):0===u?(v&&m&&this.isInsertField?l++:t.isNullOrUndefined(p.previousNode)&&(l=0),d=!0):(l++,(g=new Oe).characterFormat.copyFormat(p.characterFormat),m&&this.isInsertField&&v?(g.text=p.text.slice(0,u),p.text=p.text.substring(u)):(g.text=p.text.substring(u),p.text=p.text.slice(0,u)),p.revisions.length>0&&!this.owner.enableTrackChanges&&this.splitRevisionForSpittedElement(p,g),a.children.splice(l,0,g),g.line=p.line)}for(var y=0;y<e.length;y++){r+=e[y].length,e[y]instanceof Oe&&e[y].text.indexOf(" ")>=0&&(this.documentHelper.triggerSpellCheck=!0);var b=e[y].revisions.length;e[y].ischangeDetected=!0,a.children.splice(l,0,e[y]),e[y].line=a,e[y].linkFieldCharacter(this.documentHelper);var w=this.updateRevisionForElement(p,e[y],u,0===y,g,d);c&&!w&&e[y].revisions.length===b&&this.checkToCombineRevisionsinBlocks(e[y],b===e[y].revisions.length,y>0&&y===e.length-1,"Insertion"),p=e[y],l++}i&&(t.isNullOrUndefined(o.paragraphFormat.listFormat.list)||!t.isNullOrUndefined(o.paragraphFormat.listFormat)&&-1===o.paragraphFormat.listFormat.listId)&&o.paragraphFormat.copyFormat(i),this.documentHelper.layout.reLayoutParagraph(o,s,0,this.isInsertField?void 0:o.paragraphFormat.bidi),this.setPositionParagraph(h.paragraph,h.offset+r,!0)},e.prototype.updateRevisionForElement=function(e,i,n,r,o,s){if(!this.owner.enableTrackChanges)return!1;if(t.isNullOrUndefined(e)&&t.isNullOrUndefined(o))return!1;var a=!!t.isNullOrUndefined(s),l=i.revisions.length;return r?a?(this.checkToMapRevisionWithInlineText(e,n,i,!1,"Insertion")||i.revisions.length>l?this.copyElementRevision(e,o,!0):0===i.revisions.length&&(this.splitRevisionForSpittedElement(e,o),this.insertRevision(i,"Insertion")),!1):s?this.insertRevisionAtBegining(e,i,"Insertion"):this.insertRevisionAtEnd(e,i,"Insertion"):this.insertRevisionAtEnd(e,i,"Insertion")},e.prototype.insertElementInternal=function(e,i,n,r,o){var s=e.line,a=s.paragraph,l=s.indexInOwner,d=e.indexInOwner,h=a.paragraphFormat.bidi&&e.isRightToLeft,c=!1;r=t.isNullOrUndefined(r)?"Insertion":r;var p=this.skipTracking(),g=this.owner.enableTrackChanges,u=!1,m=i.revisions.length;if(this.owner.editorHistory&&(this.owner.editorHistory.isUndoing||this.owner.editorHistory.isRedoing)&&i instanceof Oe&&(c=e.characterFormat.isEqualFormat(i.characterFormat)&&this.documentHelper.textHelper.isRTLText(i.text)),c)e.text=e.text.substring(0,n)+i.text+e.text.substring(n);else if(n===e.length)h||this.owner.editorHistory&&this.owner.editorHistory&&this.owner.editorHistory.currentHistoryInfo&&(!this.owner.editorHistory||!this.owner.editorHistory.currentHistoryInfo||"SkipCommentInline"===this.owner.editorHistory.currentHistoryInfo.action&&("SkipCommentInline"!==this.owner.editorHistory.currentHistoryInfo.action||this.owner.editorHistory.currentHistoryInfo.modifiedActions[0]!==this.editorHistory.currentBaseHistoryInfo&&(this.owner.editorHistory.currentHistoryInfo.modifiedActions[0]===this.editorHistory.currentBaseHistoryInfo||e instanceof vt)))||d++,i.removedIds.length>0||p?this.constructRevisionFromID(i,!0,e):!g||p||this.skipFieldDeleteTracking||(u=this.insertRevisionAtEnd(e,i,r)),s.children.splice(d,0,i);else if(0===n)i.removedIds.length>0?this.constructRevisionFromID(i,!1):!g||p||this.skipFieldDeleteTracking||(u=this.insertRevisionAtBegining(e,i,r)),t.isNullOrUndefined(e.previousNode)?(e.line.children.splice(0,0,i),d=0):e.line.children.splice(d,0,i);else{h||this.owner.editorHistory&&this.owner.editorHistory&&this.owner.editorHistory.currentHistoryInfo&&(!this.owner.editorHistory||!this.owner.editorHistory.currentHistoryInfo||"SkipCommentInline"===this.owner.editorHistory.currentHistoryInfo.action&&("SkipCommentInline"!==this.owner.editorHistory.currentHistoryInfo.action||this.owner.editorHistory.currentHistoryInfo.modifiedActions[0]!==this.editorHistory.currentBaseHistoryInfo&&(this.owner.editorHistory.currentHistoryInfo.modifiedActions[0]===this.editorHistory.currentBaseHistoryInfo||e instanceof vt)))||d++;var f=new Oe;f.characterFormat.copyFormat(e.characterFormat),f.text=e.text.substring(n),e.revisions.length>0&&!g&&!p&&0===i.removedIds.length&&this.splitRevisionForSpittedElement(e,f),e.text=e.text.substr(0,n),s.children.splice(d,0,f),f.line=e.line,u=!0,this.isTrackingFormField=e.previousElement instanceof Ie,i.removedIds.length>0&&!this.isTrackingFormField?(this.constructRevisionFromID(i,!1),this.copyElementRevision(e,f,!0)):this.owner.enableTrackChanges&&(i instanceof Ae||i instanceof vt||i instanceof et||i instanceof $e?this.copyElementRevision(e,f,!1):this.checkToMapRevisionWithInlineText(e,n,i,h,r)||i.revisions.length>m?this.copyElementRevision(e,f,!0):i.revisions.length===m&&(this.splitRevisionForSpittedElement(e,f),this.insertRevision(i,r))),s.children.splice(h?d+1:d,0,i),d-=1}i.line=e.line,i.linkFieldCharacter(this.documentHelper),i instanceof Me&&0===i.type&&this.documentHelper.contentControlCollection.push(i),i instanceof Ge&&"Inline"!==i.textWrappingStyle&&(-1===a.floatingElements.indexOf(i)&&a.floatingElements.push(i),-1===a.bodyWidget.floatingElements.indexOf(i)&&a.bodyWidget.floatingElements.push(i)),!g||u||p||this.skipFieldDeleteTracking||this.checkToCombineRevisionsinBlocks(i,m===i.revisions.length,n===e.length,r),i instanceof Le&&(p&&(i.isLayout=!1),"Footnote"===i.footnoteType&&this.updateFootnoteCollection(i),"Endnote"===i.footnoteType&&this.updateEndnoteCollection(i)),o&&this.documentHelper.layout.reLayoutParagraph(a,l,d,void 0,void 0)},e.prototype.constructRevisionFromID=function(e,i,n){if(e.removedIds.length>0){for(s=0;s<e.removedIds.length;s++){var r=void 0;if(this.documentHelper.revisionsInternal.containsKey(e.removedIds[s])){if(r=this.documentHelper.revisionsInternal.get(e.removedIds[s]),e.revisions.push(r),(i=!!i||this.skipTracking())&&this.editorHistory.isRedoing&&this.owner.editorHistory.currentBaseHistoryInfo&&"BackSpace"===this.owner.editorHistory.currentBaseHistoryInfo.action&&(i=!1),t.isNullOrUndefined(n))r.range.splice(i?r.range.length:0,0,e);else{var o=r.range.indexOf(n);o>=0?r.range.splice(o+(i?1:0),0,e):r.range.splice(i?r.range.length:0,0,e)}this.updateRevisionCollection(r)}}e.removedIds=[]}else for(var s=0;s<e.revisions.length;s++){var a=e.revisions[s];this.documentHelper.revisionsInternal.containsKey(a.revisionID)&&((a=this.documentHelper.revisionsInternal.get(a.revisionID)).range.splice(i?a.range.length:0,0,e),this.updateRevisionCollection(a))}},e.prototype.insertBlock=function(e){var t=!0,i=this.selection;if(i.isEmpty||(t=this.removeSelectedContents(i)),t||i.selectContent(i.start,!1),this.insertBlockInternal(e),this.checkInsertPosition(i)){var n=void 0;n=e instanceof we?e:this.selection.getFirstParagraphInFirstCell(e),this.updateHistoryPosition(this.selection.getHierarchicalIndex(n,"0"),!0)}this.fireContentChange()},e.prototype.insertBlockInternal=function(e){var i=this.selection,n=this.selection.start.paragraph;if(!i.start.isAtParagraphStart){if(e instanceof we){var r=i.start.clone();return this.insertNewParagraphWidget(e,!1),void(this.isInsertingTOC||this.combineRevisions(e,r,this.selection.end))}this.updateInsertPosition(),n=n.combineWidget(this.owner.viewer),this.splitParagraph(n,n.firstChild,0,i.start.currentWidget,i.start.offset,!1),i.selectParagraphInternal(this.selection.start.paragraph,!0)}var o=i.start.paragraph.containerWidget,s=i.start.paragraph.index,a=o.childWidgets.indexOf(i.start.paragraph);t.isNullOrUndefined(o)||(o.childWidgets.splice(a,0,e),e.containerWidget=o,e.index=s,e.height=0,e instanceof xe&&(e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0),this.updateNextBlocksIndex(e,!0),!this.isInsertingTOC&&this.owner.enableTrackChanges&&!this.skipTracking()&&e instanceof we?this.insertRevisionForBlock(e,"Insertion"):e instanceof we?this.constructRevisionsForBlock(e,!0):e instanceof xe&&this.constructRevisionsForTable(e,!0),this.documentHelper.layout.layoutBodyWidgetCollection(s,o,e,!1))},e.prototype.insertImage=function(e,i,n){var r=this;!this.owner.isReadOnlyMode&&this.canEditContentControl&&(t.isNullOrUndefined(i)&&(i=100),t.isNullOrUndefined(n)&&(n=100),this.insertPicture(e,i,n),setTimeout(function(){t.isNullOrUndefined(r.viewer)||r.viewer.updateScrollBars()},30))},e.prototype.insertTable=function(e,t){var i=this.selection.start;if(!this.owner.isReadOnlyMode&&this.canEditContentControl){e=e||1,t=t||1;var n=this.createTable(e,t),r=i.paragraph.getContainerWidth()-n.tableFormat.leftIndent;n.splitWidthToTableCells(r);var o=i.paragraph.previousWidget;if(i.currentWidget.isFirstLine()&&0===i.offset&&o instanceof xe)return this.insertTableRows(n,o),void n.destroy();this.initHistory("InsertTable"),this.documentHelper.owner.isShiftingEnabled=!0,this.insertBlock(n);var s=this.selection.getFirstParagraphInFirstCell(n).childWidgets[0];i.setPosition(s,!0),this.selection.end.setPositionInternal(i);var a=this.selection.getLastParagraphInLastCell(n.getSplitWidgets().pop()),l=a.getLength()+1;this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.endPosition=this.selection.getHierarchicalIndex(a,l.toString())),this.reLayout(this.selection)}},e.prototype.insertRow=function(e,t){var i=e?"Above":"Below";if(!this.owner.isReadOnlyMode&&this.canEditContentControl){var n=this.selection.isForward?this.selection.start:this.selection.end;this.selection.isForward?this.selection.end:this.selection.start;if(n.paragraph.isInsideTable){this.checkIsNotRedoing()&&this.initHistory("Above"===i?"InsertRowAbove":"InsertRowBelow"),this.documentHelper.owner.isShiftingEnabled=!0;var r=this.getOwnerCell(this.selection.isForward).getSplitWidgets()[0],o=this.getOwnerCell(!this.selection.isForward).getSplitWidgets()[0],s=r.ownerTable.combineWidget(this.owner.viewer),a="Below"===i?o.ownerRow:r.ownerRow;if(this.editorHistory)this.cloneTableToHistoryInfo(s);this.rowInsertion(t,i,r,o,a,s,!0)}this.reLayout(this.selection,!0)}},e.prototype.rowInsertion=function(e,i,n,r,o,s,a){var l=e||this.getRowCountToInsert(),d=[],h=o.rowIndex;if("Below"===i){h++;var c=t.isNullOrUndefined(r.previousWidget)||r.columnIndex===r.previousWidget.columnIndex+1;r.cellIndex!==r.columnIndex&&c&&o.rowIndex+n.cellFormat.rowSpan-1===r.ownerRow.rowIndex||r.cellFormat.rowSpan>1&&!t.isNullOrUndefined(o.nextWidget)&&o.nextWidget instanceof Fe&&(r.cellFormat.rowSpan+=l,o=o.nextWidget),o.bottomBorderWidth=0}for(var p=0;p<l;p++){var g=this.updateRowspan(o,"Below"===i?r:n,i),u=this.createRowAndColumn(g.count,p);u.rowFormat.copyFormat(o.rowFormat),this.owner.enableTrackChanges&&this.insertRevision(u.rowFormat,"Insertion"),this.updateCellFormatForInsertedRow(u,g.cellFormats),d.push(u)}s.insertTableRowsInternal(d,h,a);var m=void 0,f=void 0;if(s.childWidgets[h]instanceof Fe)m=s.childWidgets[h].firstChild,f=this.selection.getFirstParagraph(m);else{for(var v=void 0;!(v instanceof xe);)v=s.nextRenderedWidget;f=this.selection.getFirstParagraphInFirstCell(v)}a&&this.documentHelper.layout.reLayoutTable(s),this.selection.selectParagraphInternal(f,!0)},e.prototype.autoFitTable=function(e){if(!this.documentHelper.owner.isReadOnlyMode&&this.canEditContentControl){var i=this.selection.start,n=this.selection.end;this.selection.isForward||(i=this.selection.end,n=this.selection.start);var r=this.selection.getTable(i,n);r=r.getSplitWidgets()[0];var o=this.documentHelper.layout.getParentTable(r);t.isNullOrUndefined(o)||(this.setOffsetValue(this.selection),o=o.combineWidget(this.owner.viewer),this.initHistory("FitToContents"===e?"TableAutoFitToContents":"FitToWindow"===e?"TableAutoFitToWindow":"TableFixedColumnWidth"),this.documentHelper.owner.editorHistoryModule&&this.cloneTableToHistoryInfo(o),o.updateProperties(!0,r,e),this.documentHelper.owner.isShiftingEnabled=!0,this.documentHelper.layout.reLayoutTable(r),this.reLayout(this.selection,!0))}},e.prototype.updateCellFormatForInsertedRow=function(e,t){for(var i=0;i<e.childWidgets.length;i++)e.childWidgets[i].cellFormat.copyFormat(t[i]),e.childWidgets[i].cellFormat.rowSpan=1},e.prototype.updateRowspan=function(e,i,n){for(var r=e.getPreviousRowSpannedCells(!0),o=0,s=[],a=0;a<e.childWidgets.length;a++){for(var l=e.childWidgets[a],d=!1,h=t.isNullOrUndefined(l.previousWidget)||l.columnIndex!==l.previousWidget.columnIndex+1,c=0;c<r.length;c++)if(h){var p=r[c],g=p.ownerRow.rowIndex+p.cellFormat.rowSpan-1;if(l.columnIndex<p.columnIndex&&l.cellIndex!==l.columnIndex&&(d=!0,o++,s.push(l.cellFormat)),1===i.cellFormat.rowSpan)if(g>l.ownerRow.rowIndex){if("Above"===n&&p.ownerRow===i.ownerRow)continue;p.cellFormat.rowSpan+=1,r.splice(c,1),c--}else l.cellIndex!==l.columnIndex&&h&&g===l.ownerRow.rowIndex&&("Above"===n?(p.cellFormat.rowSpan+=1,r.splice(c,1),c--):(o++,s.push(p.cellFormat),r.splice(c,1),c--));else if(p!==i){if("Above"===n&&(p.ownerRow===i.ownerRow||p.columnIndex===i.columnIndex))continue;p.columnIndex!==i.columnIndex&&p.ownerRow.rowIndex!==l.ownerRow.rowIndex&&(g>i.ownerRow.rowIndex||"Above"===n&&g===i.ownerRow.rowIndex)&&(p.cellFormat.rowSpan+=1,r.splice(c,1),c--)}}-1===r.indexOf(l)&&l.cellFormat.rowSpan>1&&(d=!0),d||(o++,s.push(l.cellFormat))}return{count:o,cellFormats:s}},e.prototype.insertTableRows=function(e,t){this.initHistory("InsertTableBelow"),e.containerWidget=t.containerWidget;var i=(t=t.combineWidget(this.owner.viewer)).childWidgets[t.childWidgets.length-1];t.insertTableRowsInternal(e.childWidgets,t.childWidgets.length,!0);var n=this.selection.getFirstParagraph(i.nextWidget.childWidgets[0]);this.checkInsertPosition(this.selection)&&this.updateHistoryPosition(this.selection.getHierarchicalIndex(n,"0"),!0),t.isDefaultFormatUpdated=!1,this.documentHelper.layout.reLayoutTable(t),this.selection.start.setPosition(n.firstChild,!0),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.updateHistoryPosition(this.selection.end,!1),this.selection.end.setPosition(n.firstChild,!0),this.reLayout(this.selection)},e.prototype.insertColumn=function(e,i){if(!this.owner.isReadOnlyMode&&this.canEditContentControl){var n=e?"Left":"Right";if(this.selection.start.paragraph.isInsideTable){this.checkIsNotRedoing()&&this.initHistory("Left"===n?"InsertColumnLeft":"InsertColumnRight"),this.selection.owner.isShiftingEnabled=!0;var r=this.getOwnerCell(this.selection.isForward),o=this.getOwnerCell(!this.selection.isForward),s=r.ownerRow.ownerTable.combineWidget(this.owner.viewer);this.editorHistory&&this.cloneTableToHistoryInfo(s),this.selection.owner.isLayoutEnabled=!1;var a=r.columnIndex;"Right"===n&&(a=o.columnIndex+o.cellFormat.columnSpan);for(var l=void 0,d=void 0,h=i||this.getColumnCountToInsert(),c=[],p=0;p<h;p++)for(var g=0;g<s.childWidgets.length;g++){var u=s.childWidgets[g];(d=this.createColumn(this.selection.getLastParagraph(r))).index=g,d.rowIndex=u.rowIndex,d.containerWidget=u,d.cellFormat.copyFormat(r.cellFormat),d.cellFormat.rowSpan=1,t.isNullOrUndefined(l)&&(l=this.selection.getFirstParagraph(d)),0===a?u.childWidgets.splice(a,0,d):this.insertSpannedCells(u,c,d,a)}this.tableReLayout(s,l,d)}}},e.prototype.tableReLayout=function(e,i,n){e.updateRowIndex(0);var r=this.documentHelper.layout.getParentTable(e);r?r.fitChildToClientArea():e.fitChildToClientArea(),this.selection.owner.isLayoutEnabled=!0,e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0,this.documentHelper.skipScrollToPosition=!0,this.documentHelper.layout.reLayoutTable(e),this.selection.start.setPosition(i.firstChild,!0),this.selection.end.setPosition(this.selection.getLastParagraph(n).firstChild,!1),(this.checkIsNotRedoing()||t.isNullOrUndefined(this.editorHistory))&&this.reLayout(this.selection)},e.prototype.createTable=function(e,t){this.selection.start.paragraph;var i=new xe;i.tableFormat=new j(i),i.tableFormat.preferredWidthType="Auto",i.tableFormat.leftIndent=this.selection.start.paragraph.leftIndent,i.tableFormat.initializeTableBorders();for(var n=0;n<e;){var r=this.createRowAndColumn(t,n);r.rowFormat.heightType="Auto",this.owner.enableTrackChanges&&this.insertRevision(r.rowFormat,"Insertion"),r.containerWidget=i,i.childWidgets.push(r),n++}return i},e.prototype.createRowAndColumn=function(e,t){var i=this.selection.start.paragraph,n=new Fe;n.rowFormat=new H(n),n.index=t;for(var r=0;r<e;r++){var o=this.createColumn(i);o.index=r,o.rowIndex=t,o.containerWidget=n,n.childWidgets.push(o)}return n},e.prototype.createColumn=function(e){var t=new Pe,i=new we;return i.paragraphFormat.copyFormat(e.paragraphFormat),i.paragraphFormat.leftIndent=0,i.characterFormat.copyFormat(e.characterFormat),i.containerWidget=t,t.childWidgets.push(i),t.cellFormat=new q(t),t},e.prototype.getColumnCountToInsert=function(){var e=1,t=this.selection.start,i=this.selection.end;if(this.selection.isForward||(t=this.selection.end,i=this.selection.start),t&&i&&this.selection.getTable(t,i)){if(t.paragraph.associatedCell===i.paragraph.associatedCell)return e=1;if(t.paragraph.associatedCell.ownerRow===i.paragraph.associatedCell.ownerRow)return e=e+i.paragraph.associatedCell.cellIndex-t.paragraph.associatedCell.cellIndex;e=0;for(var n=t.paragraph.associatedCell.ownerTable.getColumnCellsForSelection(t.paragraph.associatedCell,i.paragraph.associatedCell),r=0;r<n.length;r++)t.paragraph.associatedCell.ownerRow===n[r].ownerRow&&e++}return 0===e?1:e},e.prototype.getRowCountToInsert=function(){var e=1,i=this.selection.start,n=this.selection.end;return this.selection.isForward||(i=this.selection.end,n=this.selection.start),t.isNullOrUndefined(i)||t.isNullOrUndefined(n)||t.isNullOrUndefined(this.selection.getTable(i,n))?0===e?1:e:e=i.paragraph.associatedCell===n.paragraph.associatedCell||i.paragraph.associatedCell.ownerRow===n.paragraph.associatedCell.ownerRow?1:e+this.getOwnerRow(!this.selection.isForward).rowIndex-this.getOwnerRow(this.selection.isForward).rowIndex},e.prototype.getOwnerCell=function(e){for(var i=void 0,n=e?this.selection.start.paragraph.associatedCell:this.selection.end.paragraph.associatedCell,r=e?this.selection.end.paragraph.associatedCell:this.selection.start.paragraph.associatedCell,o=(i=n).ownerTable;!t.isNullOrUndefined(o)&&o.containerWidget instanceof Pe&&o!==r.ownerTable;)o=(i=o.containerWidget).ownerTable;return i},e.prototype.getOwnerRow=function(e){for(var i,n=e?this.selection.start.paragraph.associatedCell.ownerRow:this.selection.end.paragraph.associatedCell.ownerRow,r=e?this.selection.end.paragraph.associatedCell.ownerRow:this.selection.start.paragraph.associatedCell.ownerRow,o=(i=n).ownerTable;!t.isNullOrUndefined(o)&&o.containerWidget instanceof Pe&&o!==r.ownerTable;)o=(i=o.containerWidget.ownerRow).ownerTable;return i},e.prototype.getOwnerTable=function(e){var t=void 0,i=this.selection.start.paragraph.associatedCell.ownerTable,n=this.selection.end.paragraph.associatedCell.ownerTable;for(t=e?i:n;t.containerWidget instanceof Pe&&t!==(e?n:i);)t=t.containerWidget.ownerTable;return t},e.prototype.mergeSelectedCellsInTable=function(){if(this.canMergeCells())if(this.owner.enableTrackChanges){var e=new t.L10n("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),this.alertDialog=n.DialogUtility.alert({title:e.getConstant("UnTrack"),content:e.getConstant("Merge Track"),showCloseIcon:!0,okButton:{text:"Ok",click:this.confirmCellMerge.bind(this)},closeOnEscape:!0,position:{X:"center",Y:"center"},animationSettings:{effect:"Zoom"}})}else this.confirmCellMerge()},e.prototype.confirmCellMerge=function(){this.checkIsNotRedoing()&&this.initHistory("MergeCells"),this.selection.owner.isShiftingEnabled=!0;var e=this.selection.start,i=this.selection.end;this.selection.isForward||(e=this.selection.end,i=this.selection.start);var n=this.getOwnerCell(this.selection.isForward),r=this.getOwnerCell(!this.selection.isForward),o=this.selection.getContainerCellOf(n,r);if(o.ownerTable.contains(r)&&!this.selection.containsCell(o,r)){var s=n.ownerTable.combineWidget(this.owner.viewer);n=this.selection.getSelectedCell(n,o),r=this.selection.getSelectedCell(r,o);var a=this.mergeSelectedCells(s,n,r),l=this.selection.getFirstParagraph(a);e.setPosition(l.firstChild,!0);var d=this.selection.getLastParagraph(a);i.setPosition(d.lastChild,!1)}(this.checkIsNotRedoing()||t.isNullOrUndefined(this.editorHistory))&&this.reLayout(this.selection,!1),t.isNullOrUndefined(this.alertDialog)||(this.alertDialog.close(),this.alertDialog=void 0)},e.prototype.mergeSelectedCells=function(e,i,n){this.cloneTableToHistoryInfo(e);this.selection.owner.isLayoutEnabled=!1;var r=this.selection.getCellLeft(i.ownerRow,i),o=r+i.cellFormat.cellWidth,s=this.selection.getCellLeft(n.ownerRow,n),a=s+n.cellFormat.cellWidth,l=this.updateSelectedCellsInTable(r,o,s,a);r=l.start,o=l.end;for(var d,h=e.childWidgets.indexOf(n.ownerRow),c=e.childWidgets.indexOf(i.ownerRow),p=void 0,g=c;g<=h;g++){for(var u=e.childWidgets[g],m=0;m<u.childWidgets.length;m++){var f=u.childWidgets[m],v=this.selection.getCellLeft(u,f);if(L.round(r,2)<=L.round(v,2)&&L.round(v,2)<L.round(o,2)){var y=f.lastChild;if(y instanceof we&&y.isEmpty()&&f.childWidgets.pop(),t.isNullOrUndefined(p))p=f,d=y;else{g===c&&(p.cellFormat.preferredWidth+=f.cellFormat.preferredWidth,p.cellFormat.columnSpan+=f.cellFormat.columnSpan,this.mergeBorders(p,f));for(var b=0;b<f.childWidgets.length;b++)(w=f.childWidgets[b].clone()).containerWidget=p,p.childWidgets.push(w);u.childWidgets.splice(m,1),f.destroy(),m--}}}if((0===p.childWidgets.length||1===p.childWidgets.length&&p.childWidgets[0]instanceof xe)&&d){var w=d.clone();p.childWidgets.push(w),w.containerWidget=p}if(0===u.childWidgets.length){var C=e.childWidgets.indexOf(u);u.updateRowBySpannedCells(),e.childWidgets.splice(C,1),u.destroy(),h--,g--}}return!t.isNullOrUndefined(p)&&c<h&&(p.cellFormat.rowSpan=h-c+1),this.updateBlockIndexAfterMerge(p),e.updateRowIndex(0),e.calculateGrid(),e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0,this.documentHelper.layout.reLayoutTable(e),this.selection.owner.isLayoutEnabled=!0,p},e.prototype.mergeBorders=function(e,i){var n=void 0,r=null;if(t.isNullOrUndefined(e.cellFormat.borders)||(n=e.cellFormat.borders),t.isNullOrUndefined(i.cellFormat.borders)||(r=i.cellFormat.borders),!t.isNullOrUndefined(n)||!t.isNullOrUndefined(r))if(t.isNullOrUndefined(n))(n=new E(e.cellFormat)).copyFormat(r);else{if(t.isNullOrUndefined(r))return;e.ownerRow.rowIndex===i.ownerRow.rowIndex&&(n.top=e.getBorderBasedOnPriority(n.top,r.bottom),n.bottom=e.getBorderBasedOnPriority(n.bottom,r.bottom))}},e.prototype.updateBlockIndexAfterMerge=function(e){for(var t=0;t<e.childWidgets.length;t++)e.childWidgets[t].index=t},e.prototype.canMergeCells=function(){if(this.selection.isEmpty||!this.selection.start.paragraph.isInsideTable||!this.selection.end.paragraph.isInsideTable)return!1;this.selection.start,this.selection.end;this.selection.isForward||(this.selection.end,this.selection.start);var e=this.getOwnerCell(this.selection.isForward),i=this.getOwnerCell(!this.selection.isForward),n=this.selection.getContainerCellOf(e,i);if(n.ownerTable.contains(i)&&!this.selection.containsCell(n,i)){e=this.selection.getSelectedCell(e,n),i=this.selection.getSelectedCell(i,n);var r=1;if(e.ownerRow===i.ownerRow){for(var o=e.ownerRow.childWidgets.indexOf(e),s=o;s<=e.ownerRow.childWidgets.indexOf(i);s++){var a=e.ownerRow.childWidgets[s],l=a.previousWidget;if(s!==o){if(a.cellFormat.rowSpan!==r)return!1;if(!t.isNullOrUndefined(l)&&a.columnIndex!==l.cellFormat.columnSpan+l.columnIndex)return!1}r=a.cellFormat.rowSpan}return!0}return this.canMergeSelectedCellsInTable(e.ownerTable,e,i)}return!1},e.prototype.canMergeSelectedCellsInTable=function(e,i,n){var r=e.childWidgets.indexOf(n.ownerRow),o=e.childWidgets.indexOf(i.ownerRow),s=this.selection.getCellLeft(i.ownerRow,i),a=s+i.cellFormat.cellWidth,l=this.selection.getCellLeft(n.ownerRow,n),d=l+n.cellFormat.cellWidth,h=this.updateSelectedCellsInTable(s,a,l,d);s=h.start,a=h.end;for(var c=0,p=0,g=!1,u=!1,m=[],f=o;f<=r;f++){for(var v=e.childWidgets[f],y=0,b=0,w=!1,C=0;C<v.childWidgets.length;C++){var x=v.childWidgets[C],F=this.selection.getCellLeft(v,x);if(this.checkCellWithInSelection(s,a,F)){g=!1,u=!1,x.cellFormat.rowSpan>1&&m.push(x),w||(y=F,b=F,w=!0);var P=x.previousWidget;0!==b&&L.round(b,0)!==L.round(F,0)&&(b=F),b+=L.convertPointToPixel(x.cellFormat.cellWidth);var T=this.checkPrevOrNextCellIsWithinSel(s,a,x,!0),S=this.checkPrevOrNextCellIsWithinSel(s,a,x,!1),I=0===m.length||1===m.length&&m[0]===x,N=this.checkCurrentCell(m,x,T,S);if(f===r&&!t.isNullOrUndefined(P)&&x.cellFormat.rowSpan>P.cellFormat.rowSpan&&!N)return!1;if(f!==o)for(var E=0;E<m.length;E++){var H=m[E].ownerRow.rowIndex+m[E].cellFormat.rowSpan-1;if(H>=v.rowIndex){if(m[E].columnIndex>x.columnIndex?u=!0:g=!0,f===r&&m[E]!==x&&H>x.ownerRow.rowIndex+x.cellFormat.rowSpan-1)return!1;H!==v.rowIndex||this.checkPrevOrNextCellIsWithinSel(s,a,x,!1)||m.splice(m.indexOf(m[E]),1)}}if(T&&!t.isNullOrUndefined(P)&&I&&x.columnIndex!==P.columnIndex+1&&this.checkCellWidth(x))return!1}}if(f===o)c=y,p=b;else{if(b>0&&y>0&&(!g&&Math.round(c)!==Math.round(y)||!u&&Math.round(p)!==Math.round(b)))return!1;if(f===r)return!0}}return!1},e.prototype.checkCellWidth=function(e){var t=e.previousWidget,i=this.documentHelper.selection.getCellLeft(e.ownerRow,e),n=this.documentHelper.selection.getCellLeft(e.ownerRow,t)+L.convertPointToPixel(t.cellFormat.cellWidth);return L.round(n,2)!==L.round(i,2)},e.prototype.checkCellWithInSelection=function(e,t,i){return L.round(e,2)<=L.round(i,2)&&L.round(i,2)<L.round(t,2)},e.prototype.checkPrevOrNextCellIsWithinSel=function(e,i,n,r){var o=r?n.previousWidget:n.nextWidget,s=0;return!t.isNullOrUndefined(o)&&(s=this.documentHelper.selection.getCellLeft(o.ownerRow,o),this.checkCellWithInSelection(e,i,s))},e.prototype.checkCurrentCell=function(e,t,i,n){var r=t.ownerRow;if(e.length>0)for(var o=0;o<e.length;o++){var s=e[o].ownerRow,a=s.rowIndex+e[o].cellFormat.rowSpan-1;if(e[o]===t&&(1===e.length||this.checkRowSpannedCells(e,t))&&!n&&!i)return!0;if(e[o]!==t&&s.rowIndex<r.rowIndex&&a===r.rowIndex+t.cellFormat.rowSpan-1)return!0}return!1},e.prototype.checkRowSpannedCells=function(e,t){for(var i=0;i<e.length;i++)if(e[i]!==t&&e[i].columnIndex===t.columnIndex)return!0;return!1},e.prototype.insertNewParagraphWidget=function(e,i){if(this.updateInsertPosition(),this.insertParagraph(e,i),!i){var n=void 0,r=e;do{r=n=this.selection.getNextParagraphBlock(r)}while(n&&n.equals(e));t.isNullOrUndefined(n)?this.selection.selectParagraphInternal(e,!0):this.selection.selectParagraphInternal(n,!0)}this.fireContentChange()},e.prototype.insertParagraph=function(e,t){var i=this.selection.start.currentWidget,n=this.selection.start.offset;this.editorHistory&&this.editorHistory.isUndoing&&"InsertTextParaReplace"===this.editorHistory.currentBaseHistoryInfo.action&&(n=0);var r=this.selection.start.paragraph;if(r=r.combineWidget(this.owner.viewer),t){var o=this.selection.getLineLength(r.lastChild),s=e.firstChild?e.firstChild.children.length:0;this.moveInlines(r,e,s,n,i,o,r.lastChild)}else n>0&&this.moveInlines(r,e,0,0,r.firstChild,n,i);var a=r.getSplitWidgets(),l=(r=t?a[a.length-1]:a[0]).containerWidget.childWidgets.indexOf(r);t&&l++;var d=r.containerWidget;e.index=r.index,e.containerWidget=d,d.childWidgets.splice(l,0,e),this.constructRevisionsForBlock(e,!0),this.updateNextBlocksIndex(t?r:e,!0),e.height=0,this.documentHelper.layout.layoutBodyWidgetCollection(e.index,d,e,!1)},e.prototype.moveInlines=function(e,t,i,n,r,o,s){if(0===t.childWidgets.length){var a=new Te(t);t.childWidgets.push(a)}var l=!1;this.documentHelper.layout.clearListElementBox(e),this.documentHelper.layout.clearListElementBox(t);for(var d=0;d<e.childWidgets.length;d++){var h=e.childWidgets[d];if(r===h&&s===h){i=this.moveContent(h,n,o,i,t);break}if(s===h){i=this.moveContent(h,0,o,i,t);break}r===h?(l=!0,i=this.moveContent(h,n,this.documentHelper.selection.getLineLength(h),i,t)):l&&(i=this.moveContent(h,0,this.documentHelper.selection.getLineLength(h),i,t))}this.removeEmptyLine(e),e.isInsideTable||this.documentHelper.layout.reLayoutParagraph(e,0,0)},e.prototype.moveContent=function(e,t,i,n,r){for(var o=0,s=0;s<e.children.length;s++){var a=e.children[s];if(t>=o+a.length||a instanceof Qe)a instanceof Qe||(o+=a.length);else{var l=0;t>o&&(l=t-o);var d=i-o;if(d>a.length&&(d=a.length),l>0&&(o+=l),0===l&&d===a.length){if(a instanceof Ke){var h=e.paragraph.floatingElements.indexOf(a);-1!==h&&e.paragraph.floatingElements.splice(h,1)}r.firstChild.children.splice(n,0,a),a.line=r.firstChild,n++,e.children.splice(s,1),s--}else if(a instanceof Oe){var c=new Oe;c.characterFormat.copyFormat(a.characterFormat),c.text=a.text.substr(l,d-l),a.ischangeDetected=!0,c.ischangeDetected=!0,r.firstChild.children.splice(n,0,c),c.line=r.firstChild,n++,this.updateRevisionForMovedContent(a,c),a.text=a.text.slice(0,l)+a.text.slice(d),a.ischangeDetected=!0}if(i<=o+d-l)break;o+=d-l}}return n},e.prototype.updateRevisionForMovedContent=function(e,t){for(var i=0;i<e.revisions.length;i++){var n=e.revisions[i],r=n.range.indexOf(e);t.revisions.splice(0,0,n),n.range.splice(r,0,t)}},e.prototype.updateComplexWithoutHistory=function(e,t,i){var n=this.documentHelper.selection;if(0===e){r=new kt(n.owner);this.setPositionForCurrentIndex(r,t),this.documentHelper.layout.reLayoutParagraph(r.paragraph,0,0),this.setPositionForCurrentIndex(n.start,i),this.setPositionForCurrentIndex(n.end,i)}if(1===e){var r=new kt(n.owner);this.setPositionForCurrentIndex(r,t);var o=new kt(n.owner);this.setPositionForCurrentIndex(o,i),this.documentHelper.layout.reLayoutParagraph(r.paragraph,0,0),o.paragraph!==r.paragraph&&this.documentHelper.layout.reLayoutParagraph(o.paragraph,0,0)}n.owner.isShiftingEnabled&&(this.documentHelper.layout.shiftLayoutedItems(!1),this.documentHelper.owner.enableHeaderAndFooter&&this.updateHeaderFooterWidget()),n.owner.isShiftingEnabled=!1,n.start.updatePhysicalPosition(!0),n.isEmpty?n.end.setPositionInternal(n.start):n.end.updatePhysicalPosition(!0),n.upDownSelectionLength=n.end.location.x,n.fireSelectionChanged(!0),this.documentHelper.updateFocus(),this.owner.viewer.updateScrollBars(),this.fireContentChange(),this.isHandledComplex=!0},e.prototype.reLayout=function(e,i){if(!this.documentHelper.isComposingIME&&this.editorHistory&&this.editorHistory.isHandledComplexHistory())return this.editorHistory.currentHistoryInfo&&"ClearFormat"!==this.editorHistory.currentHistoryInfo.action&&"ApplyStyle"!==this.editorHistory.currentHistoryInfo.action&&(this.startParagraph=void 0,this.endParagraph=void 0),void(this.isHandledComplex=!1);t.isNullOrUndefined(this.documentHelper.blockToShift)&&(this.documentHelper.removeEmptyPages(),this.documentHelper.layout.updateFieldElements(),this.owner.viewer.updateScrollBars(),e.owner.isShiftingEnabled||(e.fireSelectionChanged(!0),this.startParagraph=void 0,this.endParagraph=void 0)),t.isNullOrUndefined(i)&&(i=e.isEmpty),this.owner.showRevisions&&this.owner.trackChangesPane.updateTrackChanges(),e.owner.isShiftingEnabled&&(e.owner.isShiftingEnabled=!1,e.owner.isLayoutEnabled=!0,this.documentHelper.layout.shiftLayoutedItems(!0),this.documentHelper.owner.enableHeaderAndFooter&&this.updateHeaderFooterWidget(),t.isNullOrUndefined(e.start.paragraph)||e.start.paragraph.containerWidget instanceof be&&("Footnote"===e.start.paragraph.containerWidget.footNoteType?(this.documentHelper.layout.isRelayoutFootnote=!0,this.shiftFootnotePageContent(e.start.paragraph.containerWidget)):(this.documentHelper.layout.isRelayoutFootnote=!1,this.shiftFootnotePageContent())),this.getOffsetValue(e),e.upDownSelectionLength=e.end.location.x,e.fireSelectionChanged(!0),this.documentHelper.updateFocus(),this.startParagraph=void 0,this.endParagraph=void 0,this.documentHelper.layout.allowLayout=!0),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&("RowResizing"!==this.editorHistory.currentBaseHistoryInfo.action&&"CellResizing"!==this.editorHistory.currentBaseHistoryInfo.action||this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&(this.editorHistory.currentBaseHistoryInfo.modifiedProperties.length>0&&this.editorHistory.currentBaseHistoryInfo.updateSelection(),this.editorHistory.undoStack&&this.editorHistory.undoStack.length>0&&this.editorHistory.undoStack[this.editorHistory.undoStack.length-1]instanceof ti&&this.editorHistory.undoStack[this.editorHistory.undoStack.length-1].modifiedActions[this.editorHistory.undoStack[this.editorHistory.undoStack.length-1].modifiedActions.length-1]===this.editorHistory.currentBaseHistoryInfo?this.editorHistory.currentBaseHistoryInfo=void 0:this.editorHistory.updateHistory()),this.fireContentChange(),this.owner.enableLockAndEdit&&this.owner.viewer.updateScrollBars(),this.owner.documentHelper.layout.isRelayout=!1},e.prototype.updateHeaderFooterWidget=function(e){t.isNullOrUndefined(e)&&(e=this.selection.start.paragraph.bodyWidget),this.updateHeaderFooterWidgetToPage(e),this.shiftPageContent(e.headerFooterType,e.sectionFormat)},e.prototype.updateHeaderFooterWidgetToPage=function(e){for(var t=e.page,i="EvenHeader"===(e=this.documentHelper.layout.updateHeaderFooterToParent(e)).headerFooterType||"EvenFooter"===e.headerFooterType,n=0;n<this.documentHelper.pages.length;n++){var r=this.documentHelper.pages[n];if(n+1===1&&r.bodyWidgets[0].sectionFormat.differentFirstPage&&-1!==e.headerFooterType.indexOf("FirstPage"))return;0===r.index&&r.bodyWidgets[0].sectionFormat.differentFirstPage&&-1===e.headerFooterType.indexOf("FirstPage")||t!==r&&(r.bodyWidgets[0].sectionFormat.differentOddAndEvenPages?i&&(n+1)%2==0?this.updateHeaderFooterWidgetToPageInternal(r,e,-1!==e.headerFooterType.indexOf("Header")):i||(n+1)%2==0||(n>0||!r.bodyWidgets[0].sectionFormat.differentFirstPage)&&this.updateHeaderFooterWidgetToPageInternal(r,e,-1!==e.headerFooterType.indexOf("Header")):this.updateHeaderFooterWidgetToPageInternal(r,e,-1!==e.headerFooterType.indexOf("Header")))}},e.prototype.updateHeaderFooterWidgetToPageInternal=function(e,t,i){if(t.page!==e){var n=t.clone();n.page=e,this.owner.viewer.updateHFClientArea(n.sectionFormat,i),n=this.documentHelper.layout.layoutHeaderFooterItems(this.owner.viewer,n);var r=void 0;i?(r=e.headerWidget,e.headerWidget=n):(r=e.footerWidget,e.footerWidget=n),this.removeFieldInWidget(r),this.removeFieldInWidget(r,void 0,!0),r.destroy()}},e.prototype.removeFieldInWidget=function(e,i,n){t.isNullOrUndefined(i)&&(i=!1);for(var r=0;r<e.childWidgets.length;r++)this.removeFieldInBlock(e.childWidgets[r],i,n)},e.prototype.removeFieldInBlock=function(e,t,i){e instanceof xe?this.removeFieldTable(e,t,i):this.removeField(e,t,i)},e.prototype.removeFieldTable=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++)for(var r=e.childWidgets[n],o=0;o<r.childWidgets.length;o++)this.removeFieldInWidget(r.childWidgets[o],t,i)},e.prototype.shiftFootnotePageContent=function(e){var i=this.documentHelper.pages[0].bodyWidgets[0];if(!t.isNullOrUndefined(e)){var n=this.documentHelper.pages.indexOf(e.page);i=this.documentHelper.pages[n].bodyWidgets[0]}t.isNullOrUndefined(i.page.footnoteWidget)||this.checkAndShiftFromBottom(i.page,i.page.footnoteWidget),t.isNullOrUndefined(i.page.endnoteWidget),this.documentHelper.blockToShift&&(this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[],this.documentHelper.layout.shiftLayoutedItems(!1))},e.prototype.shiftPageContent=function(e,i){var n;if(-1!==e.indexOf("First"))n=0;else if(i.differentOddAndEvenPages){var r=-1!==e.indexOf("Even");n=i.differentFirstPage?r?1:2:r?1:0}else 1===(n=i.differentFirstPage?1:0)&&1===this.documentHelper.pages.length&&(n=0);var o=this.documentHelper.pages[n].bodyWidgets[0];do{if(-1!==e.indexOf("Header")){var s=o.page.headerWidget,a=!s.isEmpty||s.isEmpty&&this.owner.enableHeaderAndFooter,l=o.firstChild,d=L.convertPointToPixel(i.topMargin),h=L.convertPointToPixel(i.headerDistance);if(a&&(d=Math.max(h+o.page.headerWidget.height,d)),l.y!==d){this.owner.viewer.updateClientArea(o.sectionFormat,o.page);var c=(l=l.combineWidget(this.owner.viewer)).previousRenderedWidget;c&&l.containerWidget.equals(c.containerWidget)&&(this.owner.viewer.cutFromTop(c.y+c.height),this.documentHelper.layout.updateContainerWidget(l,c.containerWidget,c.indexInOwner+1,!1)),this.documentHelper.blockToShift=l}}else this.checkAndShiftFromBottom(o.page,o.page.footerWidget);for(this.documentHelper.blockToShift&&(this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[],this.documentHelper.layout.shiftLayoutedItems(!1));o;){var p=o.getSplitWidgets();if(o=p[p.length-1].nextRenderedWidget){if(0===n)break;if(o.page.index+1===0&&1===n||o.page.index+1!==0&&2===n)break;var g=o.page.nextPage;if(!t.isNullOrUndefined(g)&&g.bodyWidgets[0].equals(o)){o=g.bodyWidgets[0];break}}}}while(o)},e.prototype.checkAndShiftFromBottom=function(e,t){for(var i,n=e.bodyWidgets[0],r=0;r<n.childWidgets.length;r++){var o=n.childWidgets[r];if(o.y+o.height>t.y){i=o;break}if(n.childWidgets.length-1===r&&o.y+o.height<t.y){i=o;break}}this.owner.viewer.updateClientArea(n.sectionFormat,e,!0),this.owner.viewer.cutFromTop(i.y),this.documentHelper.blockToShift=i},e.prototype.allowFormattingInFormFields=function(e){if("FormFieldsOnly"===this.documentHelper.protectionType&&this.selection.isInlineFormFillMode()&&!t.isNullOrUndefined(this.owner.documentEditorSettings.formFieldSettings.formattingExceptions))for(var i=0;i<this.owner.documentEditorSettings.formFieldSettings.formattingExceptions.length;i++)if(e.toLowerCase()===this.owner.documentEditorSettings.formFieldSettings.formattingExceptions[i].toLowerCase())return!0;return!1},e.prototype.getContentControl=function(){for(var e=0;e<this.documentHelper.contentControlCollection.length;e++){var t=this.documentHelper.contentControlCollection[e],i=this.selection.getPosition(t),n=i.startPosition,r=i.endPosition,o=this.selection.start,s=this.selection.end;if(this.selection.isForward||(o=this.selection.end,s=this.selection.start),(o.isExistAfter(n)||o.isAtSamePosition(n))&&(s.isExistBefore(r)||s.isAtSamePosition(r)))return t}},e.prototype.checkPlainTextContentControl=function(){var e=this.selection.start,i=this.selection.end;this.selection.isForward||(i=this.selection.start,e=this.selection.end);var n=0,r=0,o=e.currentWidget.getInline(e.offset,n),s=i.currentWidget.getInline(i.offset,r);n=o.index,r=s.index;var a,l,d=o.element,h=s.element;if(d&&d.contentControlProperties&&"Text"===d.contentControlProperties.type||h&&h.contentControlProperties&&"Text"===h.contentControlProperties.type){if((d=this.getContentControl()).contentControlProperties&&!t.isNullOrUndefined(d)){var c=d.line.getOffset(d,1);(a=new kt(this.owner)).setPositionParagraph(d.line,c)}else a=e;if(h.contentControlProperties&&d.reference){var p=(h=d.reference).line.getOffset(h,h.length);(l=new kt(this.owner)).setPositionParagraph(h.line,p)}else l=i;this.selection.selectRange(a,l)}else e.paragraph.contentControlProperties&&"Text"===e.paragraph.contentControlProperties.type&&this.selection.selectParagraph()},e.prototype.onApplyCharacterFormat=function(e,i,n){var r=this.documentHelper.isFormFillProtectedMode&&this.documentHelper.selection.isInlineFormFillMode()&&this.allowFormattingInFormFields(e);if(!(this.restrictFormatting&&!r||this.selection.checkContentControlLocked(!0))){this.documentHelper.layout.isBidiReLayout=!0;var o=this.documentHelper.selection;if((!o.owner.isReadOnlyMode||r)&&o.owner.isDocumentLoaded){n=!t.isNullOrUndefined(n)&&n;var s=e[0].toUpperCase()+e.slice(1),a=o.start.paragraph;a.childWidgets[a.childWidgets.length-1];if(this.checkPlainTextContentControl(),o.isEmpty&&"List"!==o.contextType)return o.skipFormatRetrieval=!0,o.end.isAtParagraphEnd?(this.initHistory(s),this.documentHelper.owner.isShiftingEnabled=!0,this.applyCharFormatValue(a.characterFormat,e,i,n),this.reLayout(this.documentHelper.selection),this.documentHelper.updateFocus()):o.fireSelectionChanged(!0),void(o.skipFormatRetrieval=!1);if("highlightColor"===e&&o.start.isInSameParagraph(o.end)){var l=o.start,d=o.end;if(this.selection.isForward||(d=o.start,l=o.end),d.offset===o.getLineLength(d.currentWidget)+1&&d.offset-1===l.offset)return}this.setOffsetValue(o),this.initHistory(s),"List"===o.contextType?this.applyCharacterFormatForListText(o,e,i,n):this.updateSelectionCharacterFormatting(e,i,n),this.documentHelper.layout.isBidiReLayout=!1}}},e.prototype.applyCharacterFormatForListText=function(e,i,n,r){var o=e.getListLevel(e.start.paragraph);if(!t.isNullOrUndefined(o)){var s=o.characterFormat;switch(i){case"bold":this.applyListCharacterFormatByValue(e,s,"bold",!s.bold);break;case"italic":this.applyListCharacterFormatByValue(e,s,"italic",!s.italic);break;case"fontColor":this.applyListCharacterFormatByValue(e,s,"fontColor",n);break;case"fontFamily":this.applyListCharacterFormatByValue(e,s,"fontFamily",n);break;case"fontSize":this.applyListCharacterFormatByValue(e,s,"fontSize",n);break;case"highlightColor":this.applyListCharacterFormatByValue(e,s,"highlightColor",n);break;case"baselineAlignment":s.baselineAlignment===n&&(n="Normal"),this.applyListCharacterFormatByValue(e,s,"baselineAlignment",n);break;case"strikethrough":s.strikethrough===n&&(n="None"),this.applyListCharacterFormatByValue(e,s,"strikethrough",n);break;case"underline":s.underline===n&&(n="None"),this.applyListCharacterFormatByValue(e,s,"underline",n);break;case"characterFormat":this.applyListCharacterFormatByValue(e,s,void 0,n)}}},e.prototype.applyListCharacterFormatByValue=function(e,t,i,n){this.initHistory("ListCharacterFormat"),this.applyCharFormatValue(t,i,n,!1),this.editorHistory.updateHistory(),this.reLayout(e),this.fireContentChange()},e.prototype.updateListCharacterFormat=function(e,t,i){this.updateListTextSelRange(e,t,i,!1)},e.prototype.updateListTextSelRange=function(e,t,i,n){this.documentHelper.owner.isShiftingEnabled=!0;var r=e.start,o=e.end;e.isForward||(r=e.end,o=e.start),this.initHistoryPosition(e,r);var s=e.getListLevel(e.start.paragraph);this.applyCharFormatValue(s.characterFormat,t,i,n),this.startSelectionReLayouting(r.paragraph,e,r,o)},e.prototype.updateInsertPosition=function(){var e=this.documentHelper.selection,i=e.start;e.isForward||(i=e.end),!this.editorHistory||t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)||t.isNullOrUndefined(i)||t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo.insertPosition)&&this.updateHistoryPosition(i,!0)},e.prototype.setOffsetValue=function(e){var t=this.selection.getParagraphInfo(e.start);this.startParagraph=t.paragraph,this.startOffset=t.offset,t=this.selection.getParagraphInfo(e.end),this.endParagraph=t.paragraph,this.endOffset=t.offset},e.prototype.toggleHighlightColor=function(e){var i=this.documentHelper.selection;(t.isNullOrUndefined(e)||"NoColor"===e)&&(e="Yellow"),i.characterFormat.highlightColor===e&&(e="NoColor"),this.selection.characterFormat.highlightColor=e},e.prototype.toggleSubscript=function(){if(!this.owner.isReadOnlyMode){var e="Subscript"===this.selection.characterFormat.baselineAlignment?"Normal":"Subscript";this.selection.characterFormat.baselineAlignment=e}},e.prototype.toggleSuperscript=function(){if(!this.owner.isReadOnlyMode){var e="Superscript"===this.selection.characterFormat.baselineAlignment?"Normal":"Superscript";this.selection.characterFormat.baselineAlignment=e}},e.prototype.increaseIndent=function(){this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.onApplyParagraphFormat("leftIndent",this.documentHelper.defaultTabWidth,!0,!1)},e.prototype.decreaseIndent=function(){this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.onApplyParagraphFormat("leftIndent",-this.documentHelper.defaultTabWidth,!0,!1)},e.prototype.clearList=function(){this.selection.owner.editorModule.onApplyList(void 0)},e.prototype.applyBullet=function(e,t){this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.applyBulletOrNumbering(e,"Bullet",t)},e.prototype.applyNumbering=function(e,t){this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.applyBulletOrNumbering(e,t,"Verdana")},e.prototype.toggleBaselineAlignment=function(e){this.updateProperty(2,e)},e.prototype.clearFormatting=function(){var e=this.documentHelper.selection;this.initComplexHistory("ClearFormat"),e.isEmpty&&(e.start.moveToParagraphStartInternal(e,!1),e.end.moveToParagraphEndInternal(e,!1)),this.setOffsetValue(e),this.editorHistory&&this.editorHistory.initializeHistory("ClearCharacterFormat"),this.updateSelectionCharacterFormatting("ClearCharacterFormat",void 0,!1),this.getOffsetValue(e),this.editorHistory&&this.editorHistory.updateHistory(),this.setOffsetValue(e),this.editorHistory&&this.editorHistory.initializeHistory("ClearParagraphFormat"),this.updateParagraphFormatInternal("ClearParagraphFormat",void 0,!1),this.editorHistory&&this.editorHistory.updateHistory(),this.getOffsetValue(e),this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentHistoryInfo)&&this.editorHistory.updateComplexHistory(),this.startParagraph=void 0,this.endParagraph=void 0},e.prototype.updateProperty=function(e,i){var n=this.selection;if((!n.owner.isReadOnlyMode||this.selection.isInlineFormFillMode())&&n.owner.isDocumentLoaded){var r=n.start;n.end;n.isForward||(r=n.end,n.start);var o=0,s=r.currentWidget.getInline(r.offset,o),a=s.element;o=s.index;var l=r.paragraph;if(t.isNullOrUndefined(a)||a.length!==o||this.selection.isEmpty||(a=a.nextNode),1===e){var d="None";t.isNullOrUndefined(a)?t.isNullOrUndefined(l)||(d=l.characterFormat.underline):d=a.characterFormat.underline,this.selection.characterFormat.underline=i===d?"None":i}else{var h="Normal";t.isNullOrUndefined(a)?t.isNullOrUndefined(l)||(h=l.characterFormat.baselineAlignment):h=a.characterFormat.baselineAlignment,h===i&&(i="Normal"),this.selection.characterFormat.baselineAlignment=i}}},e.prototype.getCompleteStyles=function(){for(var e='{"styles":[',t=0,i=this.documentHelper.preDefinedStyles.keys;t<i.length;t++){var n=i[t];e+=this.documentHelper.preDefinedStyles.get(n)+","}return e.slice(0,-1)+"]}"},e.prototype.intializeDefaultStyles=function(){for(var e=this.owner.getStyleNames("Paragraph"),t=0,i=["Normal","Heading 1","Heading 2","Heading 3","Heading 4","Heading 5","Heading 6"].filter(function(t){return-1===e.indexOf(t)});t<i.length;t++){var n=i[t];this.createStyle(this.documentHelper.preDefinedStyles.get(n))}},e.prototype.createStyle=function(e){this.createStyleIn(e)},e.prototype.createStyleIn=function(e){var t=JSON.parse(e);return void 0!==this.documentHelper.styles.findByName(t.name)&&(t.name=this.getUniqueStyleName(t.name)),this.documentHelper.owner.parser.parseStyle(JSON.parse(this.getCompleteStyles()),t,this.documentHelper.styles),this.documentHelper.styles.findByName(t.name)},e.prototype.getUniqueStyleName=function(e){for(var i=this.getUniqueName(e),n=this.documentHelper.styles.findByName(i);!t.isNullOrUndefined(n);)i=this.getUniqueStyleName(n.name),n=this.documentHelper.styles.findByName(i);return i},e.prototype.getUniqueName=function(e){var i=e.match(/\d+$/);return!t.isNullOrUndefined(i)&&i.length>0?e.replace(i[0],(parseInt(i[0],10)+1).toString()):e+"_1"},e.prototype.updateSelectionCharacterFormatting=function(e,i,n){switch(t.isNullOrUndefined(e)&&(e="CharacterFormat"),e){case"bold":this.updateCharacterFormat("bold",i);break;case"italic":this.updateCharacterFormat("italic",i);break;case"fontColor":this.updateCharacterFormat("fontColor",i);break;case"fontFamily":this.updateCharacterFormat("fontFamily",i);break;case"fontSize":this.documentHelper.layout.isBidiReLayout=!1,this.updateCharacterFormatWithUpdate(this.documentHelper.selection,"fontSize",i,n);break;case"highlightColor":this.updateCharacterFormat("highlightColor",i);break;case"baselineAlignment":this.updateCharacterFormat("baselineAlignment",i);break;case"strikethrough":this.updateCharacterFormat("strikethrough",i);break;case"underline":this.updateCharacterFormat("underline",i);break;case"styleName":this.updateCharacterFormatWithUpdate(this.documentHelper.selection,"styleName",i,!0);break;case"CharacterFormat":case"ClearCharacterFormat":this.updateCharacterFormat(void 0,i);break;case"allCaps":this.updateCharacterFormat("allCaps",i)}this.reLayout(this.documentHelper.selection)},e.prototype.updateCharacterFormat=function(e,t){this.updateCharacterFormatWithUpdate(this.documentHelper.selection,e,t,!1)},e.prototype.updateCharacterFormatWithUpdate=function(e,t,i,n){this.documentHelper.owner.isShiftingEnabled=!0;var r=e.start,o=e.end;e.isForward||(r=e.end,o=e.start),this.applyCharFormatSelectedContent(r.paragraph,e,r,o,t,i,n)},e.prototype.applyCharFormatSelectedContent=function(e,t,i,n,r,o,s){if(!i.paragraph.isInsideTable||n.paragraph.isInsideTable&&i.paragraph.associatedCell===n.paragraph.associatedCell&&!t.isCellSelected(i.paragraph.associatedCell,i,n))this.applyCharFormat(e,t,i,n,r,o,s);else{var a=void 0;i.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),this.checkInsertPosition(t)&&this.updateHistoryPosition(i,!0),a=i.paragraph.associatedCell,this.applyCharFormatCell(a,t,i,n,r,o,s);var l=a.ownerTable;this.documentHelper.layout.layoutBodyWidgetCollection(l.index,l.containerWidget,l,!1)}},e.prototype.applyCharFormatForSelectedPara=function(e,t,i,n,r){for(var o=0;o<e.childWidgets.length;o++)for(var s=e.childWidgets[o],a=0;a<s.children.length;a++){var l=s.children[a];this.applyCharFormatValue(l.characterFormat,i,n,r)}this.applyCharFormatValue(e.characterFormat,i,n,r)},e.prototype.splittedLastParagraph=function(e){var t=e.getSplitWidgets();return t[t.length-1]},e.prototype.getNextParagraphForCharacterFormatting=function(e,i,n,r,o,s){var a=e.getSplitWidgets();e=a[a.length-1],e=this.documentHelper.selection.getNextRenderedBlock(e),t.isNullOrUndefined(e)||(e instanceof we?this.applyCharFormat(e,this.documentHelper.selection,i,n,r,o,s):this.applyCharFormatForTable(0,e,this.documentHelper.selection,i,n,r,o,s))},e.prototype.applyCharFormat=function(e,i,n,r,o,s,a){e=e.combineWidget(this.owner.viewer);var l=0,d=i.getParagraphLength(e),h=-1!==e.childWidgets.indexOf(n.currentWidget)?e.childWidgets.indexOf(n.currentWidget):0,c=r.offset,p=-1!==e.childWidgets.indexOf(r.currentWidget)?e.childWidgets.indexOf(r.currentWidget):e.childWidgets.length-1;if(t.isNullOrUndefined(i)||e===n.paragraph&&(l=n.offset),e.equals(r.paragraph)){g=e.childWidgets[e.childWidgets.length-1];i.isParagraphLastLine(g)&&r.currentWidget===g&&(c===i.getLineLength(g)+1||i.isEmpty&&i.end.isAtParagraphEnd)&&this.applyCharFormatValue(e.characterFormat,o,s,a)}else{var g=e.childWidgets[e.childWidgets.length-1];"highlightColor"===o&&i.isParagraphLastLine(g)&&n.currentWidget===g&&n.offset===i.getLineLength(g)||this.applyCharFormatValue(e.characterFormat,o,s,a),c=d}for(var u=h;u<=p;u++){var m=e.childWidgets[u];u!==h&&(l=i.getStartLineOffset(m)),c=m===r.currentWidget?r.offset:i.getLineLength(m);for(var f=0,v=m.paragraph.paragraphFormat.bidi,y=this.documentHelper.layout.isContainsRtl(m),b=!0,w=void 0,C=-1,x=!0,F=v?m.children.length-1:0;v?F>=0:F<m.children.length;v?F--:x?F++:F--){var P=m.children[F];if(!v&&y)for(;(b||t.isNullOrUndefined(w))&&P instanceof Oe&&(this.documentHelper.textHelper.isRTLText(P.text)||this.documentHelper.textHelper.containsSpecialCharAlone(P.text))&&P.nextElement;)w||(w=P),-1===C&&(C=m.children.indexOf(P)),F=P.line.children.indexOf(P),P=P.nextElement,x=!1;if(b=!1,!(P instanceof Qe))if(w===P&&(w=void 0,F=C,C=-1,x=!0),l>=f+P.length)f+=P.length;else{var T=0;l>f&&(T=l-f);var S=c-f,I=P.length;S>I&&(S=I);var N=this.applyCharFormatInline(P,i,T,S,o,s,a);if(v||y&&!x?F-=N:F+=N,c<=f+I)break;f+=I}}}var E=r.paragraph;!e.bidi&&this.documentHelper.layout.isContainsRtl(e.childWidgets[h])?this.documentHelper.layout.reLayoutParagraph(e,h,0,!1,!0):this.documentHelper.layout.reLayoutParagraph(e,h,0),e.equals(E)||this.getNextParagraphForCharacterFormatting(e,n,r,o,s,a)},e.prototype.toggleBold=function(){if(!this.documentHelper.owner.isReadOnlyMode||this.selection.isInlineFormFillMode()){var e=this.getCurrentSelectionValue("bold");this.selection.characterFormat.bold=e}},e.prototype.toggleItalic=function(){if(!this.documentHelper.owner.isReadOnlyMode||this.selection.isInlineFormFillMode()){var e=this.getCurrentSelectionValue("italic");this.selection.characterFormat.italic=e}},e.prototype.changeCase=function(e){if(!(this.selection.isEmpty||this.documentHelper.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode())){this.initHistory("Uppercase"),this.documentHelper.owner.isShiftingEnabled=!0;var t=this.selection,i=t.start,n=t.end;t.isForward||(i=t.end,n=t.start),this.changeSelectedTextCase(t,i,n,e),this.reLayout(t)}},e.prototype.changeSelectedTextCase=function(e,i,n,r,o){var s=this.selection.getParagraphInfo(i);e.editPosition=this.selection.getHierarchicalIndex(s.paragraph,s.offset.toString()),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.checkInsertPosition(e)&&this.updateHistoryPosition(i,!0);var a=this.editorHistory.isUndoing;a&&!t.isNullOrUndefined(o)&&o.length>0&&(this.removedTextNodes=o);var l=n.selection.endOffset;this.changeTextCase(i.paragraph,e,i,n,r,a),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(n.selection.endOffset!==l&&(n=e.getTextPosBasedOnLogicalIndex(l)),this.checkEndPosition(e)&&this.updateHistoryPosition(n,!1),e.selectPosition(i,n))},e.prototype.changeTextCase=function(e,t,i,n,r,o){if(!i.paragraph.isInsideTable||n.paragraph.isInsideTable&&i.paragraph.associatedCell===n.paragraph.associatedCell&&!t.isCellSelected(i.paragraph.associatedCell,i,n))this.changeCaseParagraph(e,t,i,n,r,o);else{var s=void 0;i.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),this.checkInsertPosition(t)&&this.updateHistoryPosition(i,!0),s=i.paragraph.associatedCell,this.changeCaseParaFormatInCell(s,i,n,r,o);var a=s.ownerTable;this.documentHelper.layout.layoutBodyWidgetCollection(a.index,a.containerWidget,a,!1)}},e.prototype.changeCaseParagraph=function(e,i,n,r,o,s){e=e.combineWidget(this.owner.viewer);var a=0,l=i.getParagraphLength(e),d=-1!==e.childWidgets.indexOf(n.currentWidget)?e.childWidgets.indexOf(n.currentWidget):0,h=r.offset,c=-1!==e.childWidgets.indexOf(r.currentWidget)?e.childWidgets.indexOf(r.currentWidget):e.childWidgets.length-1;t.isNullOrUndefined(i)||e===n.paragraph&&(a=n.offset),e.equals(r.paragraph)||(h=l);for(var p=d;p<=c;p++){var g=e.childWidgets[p];p!==d&&(a=i.getStartLineOffset(g)),h=g===r.currentWidget?r.offset:i.getLineLength(g);for(var u=0,m=g.paragraph.paragraphFormat.bidi,f=this.documentHelper.layout.isContainsRtl(g),v=!0,y=void 0,b=-1,w=!0,C=m?g.children.length-1:0;m?C>=0:C<g.children.length;m?C--:w?C++:C--){var x=g.children[C];if(!m&&f)for(;(v||t.isNullOrUndefined(y))&&x instanceof Oe&&(this.documentHelper.textHelper.isRTLText(x.text)||this.documentHelper.textHelper.containsSpecialCharAlone(x.text))&&x.nextElement;)y||(y=x),-1===b&&(b=g.children.indexOf(x)),C=x.line.children.indexOf(x),x=x.nextElement,w=!1;if(v=!1,!(x instanceof Qe))if(y===x&&(y=void 0,C=b,b=-1,w=!0),a>=u+x.length)u+=x.length;else{var F=0;a>u&&(F=a-u);var P=h-u,T=x.length;P>T&&(P=T);var S=this.changeCaseInline(x,i,F,P,o,s);if(m||f&&!w?C-=S:C+=S,h<=u+T)break;u+=T}}}var I=r.paragraph;!e.bidi&&this.documentHelper.layout.isContainsRtl(e.childWidgets[d])?this.documentHelper.layout.reLayoutParagraph(e,d,0,!1,!0):this.documentHelper.layout.reLayoutParagraph(e,d,0),e.equals(I)||this.changeCaseNextBlock(e,n,r,o,s)},e.prototype.changeCaseInline=function(e,t,i,n,r,o){if(e instanceof Oe){if(0!==i||n!==e.length)return this.changeCaseInlineInternal(e,t,i,n,r,o);this.changeCaseInlineInternal(e,t,i,n,r,o)}return 0},e.prototype.addRemovedTextNodes=function(e,i){if(e instanceof Oe&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)){var n=this.editorHistory.currentBaseHistoryInfo.removedNodes[0];t.isNullOrUndefined(n)&&((n=new Oe).text="",this.editorHistory.currentBaseHistoryInfo.removedNodes.push(n)),n.text+=i}},e.prototype.changeCaseInlineInternal=function(e,t,i,n,r,o){var s,a=0,l=e.line.children.indexOf(e),d=e.paragraph;d.childWidgets.indexOf(e.line);if(i>0){var h=e.text.substr(i,n-i);this.addRemovedTextNodes(e,h),(s=new Oe).characterFormat.copyFormat(e.characterFormat),s.line=e.line,s.text=this.getChangeCaseText(h,r,o),s.isRightToLeft=e.isRightToLeft,d.paragraphFormat.bidi||this.documentHelper.layout.isContainsRtl(e.line)||l++,e.line.children.splice(l,0,s),a++}n<e.length&&((s=new Oe).characterFormat.copyFormat(e.characterFormat),s.text=e.text.substring(n),s.line=e.line,s.isRightToLeft=e.isRightToLeft,d.paragraphFormat.bidi||this.documentHelper.layout.isContainsRtl(e.line)||l++,e.line.children.splice(l,0,s),a++);var c=e;if(0===i){var p=c.text.substr(0,n);this.addRemovedTextNodes(e,p),c.text=this.getChangeCaseText(p,r,o)}else{var g=c.text.substr(0,i);c.text=g}return a},e.prototype.changeCaseNextBlock=function(e,i,n,r,o){e=this.getNextBlockForChangeCase(e,i,n,r,o),t.isNullOrUndefined(e)||(e instanceof we?this.changeCaseParagraph(e,this.documentHelper.selection,i,n,r,o):this.changeCaseForTable(0,e,this.documentHelper.selection,i,n,r,o))},e.prototype.getNextBlockForChangeCase=function(e,t,i,n,r){var o=e.getSplitWidgets();return e=o[o.length-1],e=this.documentHelper.selection.getNextRenderedBlock(e)},e.prototype.getChangeCaseText=function(e,i,n){if(n){if(!t.isNullOrUndefined(this.removedTextNodes)&&this.removedTextNodes.length>0){var r=this.removedTextNodes[0],o=r.text.substr(0,e.length);r.text=r.text.substr(o.length,r.length-o.length),e=o,""===r.text&&this.removedTextNodes.splice(0,1)}}else switch(i){case"Uppercase":e=e.toUpperCase()}return e},e.prototype.changeCaseForTable=function(e,t,i,n,r,o,s){t=t.combineWidget(this.owner.viewer);for(var a=e;a<t.childWidgets.length;a++){for(var l=t.childWidgets[a],d=0;d<l.childWidgets.length;d++)this.changeCaseForSelectedCell(l.childWidgets[d],i,o,s);if(r.paragraph.isInsideTable&&i.containsRow(l,r.paragraph.associatedCell))return void this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1)}this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1),this.changeCaseNextBlock(t,n,r,o,s)},e.prototype.changeCaseForSelectedCell=function(e,t,i,n){for(var r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];o instanceof we?this.changeCaseForSelectedPara(o,t,i,n):this.changeCaseForSelTable(o,t,i,n)}},e.prototype.changeCaseForSelectedPara=function(e,i,n,r){for(var o=0;o<e.childWidgets.length;o++)for(var s=e.childWidgets[o],a=0;a<s.children.length;a++){var l=s.children[a];!t.isNullOrUndefined(l)&&l instanceof Oe&&(this.addRemovedTextNodes(l,l.text),l.text=this.getChangeCaseText(l.text,n,r))}},e.prototype.changeCaseForSelTable=function(e,t,i,n){for(var r=0;r<e.childWidgets.length;r++)for(var o=e.childWidgets[r],s=0;s<o.childWidgets.length;s++)this.changeCaseForSelectedCell(o.childWidgets[s],t,i,n)},e.prototype.changeCaseParaFormatInCell=function(e,t,i,n,r){var o=this.documentHelper.selection;if(i.paragraph.isInsideTable){var s=o.getContainerCellOf(e,i.paragraph.associatedCell);if(s.ownerTable.contains(i.paragraph.associatedCell)){var a=o.getSelectedCell(e,s),l=o.getSelectedCell(i.paragraph.associatedCell,s);o.containsCell(s,i.paragraph.associatedCell)?o.isCellSelected(s,t,i)?this.changeCaseParaForCellInternal(s,o,n,r):a===s?this.changeCaseParagraph(t.paragraph,o,t,i,n,r):this.changeCaseParaForRow(a.ownerRow,o,t,i,n,r):this.changeCaseParaForTableCell(s.ownerTable,s,l,n,r)}else this.changeCaseParaForRow(s.ownerRow,o,t,i,n,r)}else{var d=o.getContainerCell(e);this.changeCaseParaForRow(d.ownerRow,o,t,i,n,r)}},e.prototype.changeCaseParaForTableCell=function(e,t,i,n,r){var o=this.documentHelper.selection,s=o.getCellLeft(t.ownerRow,t),a=s+t.cellFormat.cellWidth,l=o.getCellLeft(i.ownerRow,i),d=l+i.cellFormat.cellWidth,h=this.updateSelectedCellsInTable(s,a,l,d);s=h.start,a=h.end;for(var c=e.childWidgets.indexOf(i.ownerRow),p=e.childWidgets.indexOf(t.ownerRow);p<=c;p++)for(var g=e.childWidgets[p],u=0;u<g.childWidgets.length;u++){var m=o.getCellLeft(g,g.childWidgets[u]);Math.round(s)<=Math.round(m)&&Math.round(m)<Math.round(a)&&this.changeCaseParaForCellInternal(g.childWidgets[u],o,n,r)}},e.prototype.changeCaseParaForCellInternal=function(e,t,i,n){for(var r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];o instanceof we?this.changeCaseForSelectedPara(o,t,i,n):this.changeCaseParaFormatTableInternal(o,t,i,n)}},e.prototype.changeCaseParaFormatTableInternal=function(e,t,i,n){for(var r=0;r<e.childWidgets.length;r++)for(var o=e.childWidgets[r],s=0;s<o.childWidgets.length;s++)this.changeCaseParaForCellInternal(o.childWidgets[s],t,i,n)},e.prototype.changeCaseParaForRow=function(e,t,i,n,r,o){for(var s=e.rowIndex;s<e.ownerTable.childWidgets.length;s++){for(var a=e.ownerTable.childWidgets[s],l=0;l<a.childWidgets.length;l++)this.changeCaseParaForCellInternal(a.childWidgets[l],t,r,o);if(n.paragraph.isInsideTable&&this.documentHelper.selection.containsRow(a,n.paragraph.associatedCell))return}this.changeCaseNextBlock(e.ownerTable,i,n,r,o)},e.prototype.toggleAllCaps=function(){if(!this.documentHelper.owner.isReadOnlyMode||this.selection.isInlineFormFillMode()){var e=this.getCurrentSelectionValue("allCaps");this.selection.characterFormat.allCaps=e}},e.prototype.getCurrentSelectionValue=function(e){var t=!1;if("bold"===e||"italic"===e){var i=this.getSelectedCharacterFormat();"bold"===e&&(t=!i.bold),"italic"===e&&(t=!i.italic)}return t},e.prototype.getSelectedCharacterFormat=function(){var e=0,i=this.selection.start;this.selection.isForward||(i=this.selection.end);var n=i.currentWidget,r=n.getInline(i.offset,e),o=r.element;e=r.index;var s=n.paragraph.characterFormat;if(!t.isNullOrUndefined(o))if(this.selection.isEmpty&&"List"===this.selection.contextType){var a=this.selection.getListLevel(this.selection.start.paragraph);a.characterFormat.uniqueCharacterFormat&&(s=a.characterFormat)}else s=this.selection.isEmpty||e!==o.length?o.characterFormat:t.isNullOrUndefined(o.nextNode)?n.paragraph.characterFormat:o.nextNode.characterFormat;return s},e.prototype.toggleUnderline=function(e){this.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||this.updateProperty(1,e)},e.prototype.toggleStrikethrough=function(e){if(!this.owner.isReadOnlyMode||this.selection.isInlineFormFillMode()){var i=void 0;i=t.isNullOrUndefined(e)?"SingleStrike"===this.selection.characterFormat.strikethrough?"None":"SingleStrike":e,this.selection.characterFormat.strikethrough=i}},e.prototype.updateFontSize=function(e,t){if("number"==typeof t&&!(t<0&&1===e.fontSize))return e.fontSize+t;var i=[8,9,10,11,12,14,16,18,20,24,26,28,36,48,72];if("string"==typeof t&&"increment"===t){if(e.fontSize<8)return e.fontSize+1;if(e.fontSize>=72&&e.fontSize<80)return 80;if(e.fontSize>=80)return e.fontSize+10;for(n=0;n<i.length;n++)if(e.fontSize<i[n])return i[n]}else if("string"==typeof t&&"decrement"===t&&e.fontSize>1){if(e.fontSize<=8)return e.fontSize-1;if(e.fontSize>72&&e.fontSize<=80)return 72;if(e.fontSize>80)return e.fontSize-10;for(var n=0;n<i.length;n++)if(e.fontSize<=i[n])return i[n-1]}return e.fontSize},e.prototype.applyCharFormatInline=function(e,t,i,n,r,o,s){return 0===i&&n===e.length?(this.applyCharFormatValue(e.characterFormat,r,o,s),0):e instanceof Oe?this.formatInline(e,t,i,n,r,o,s):0},e.prototype.formatInline=function(e,t,i,n,r,o,s){var a,l=0,d=e,h=e.line.children.indexOf(d),c=e.paragraph;c.childWidgets.indexOf(e.line);return i>0&&((a=new Oe).characterFormat.copyFormat(e.characterFormat),a.line=e.line,a.text=e.text.substr(i,n-i),a.isRightToLeft=e.isRightToLeft,this.applyCharFormatValue(a.characterFormat,r,o,s),c.paragraphFormat.bidi||this.documentHelper.layout.isContainsRtl(e.line)||h++,d.line.children.splice(h,0,a),l++),n<d.length&&((a=new Oe).characterFormat.copyFormat(e.characterFormat),a.text=d.text.substring(n),a.line=e.line,a.isRightToLeft=e.isRightToLeft,c.paragraphFormat.bidi||this.documentHelper.layout.isContainsRtl(e.line)||h++,d.line.children.splice(h,0,a),l++),0===i?(e.text=e.text.substr(0,n),this.applyCharFormatValue(e.characterFormat,r,o,s)):e.text=e.text.substr(0,i),l},e.prototype.applyCharFormatCell=function(e,t,i,n,r,o,s){if(n.paragraph.isInsideTable){var a=t.getContainerCellOf(e,n.paragraph.associatedCell);if(a.ownerTable.contains(n.paragraph.associatedCell)){var l=t.getSelectedCell(e,a),d=t.getSelectedCell(n.paragraph.associatedCell,a);t.containsCell(a,n.paragraph.associatedCell)?t.isCellSelected(a,i,n)?(o=this.getCharacterFormatValueOfCell(e,t,o,r),this.applyCharFormatForSelectedCell(a,t,r,o,s)):l===a?this.applyCharFormat(i.paragraph,t,i,n,r,o,s):this.applyCharFormatRow(l.ownerRow,t,i,n,r,o,s):this.applyCharFormatForTableCell(a.ownerTable,t,a,d,r,o,s)}else this.applyCharFormatRow(a.ownerRow,t,i,n,r,o,s)}else{var h=t.getContainerCell(e);this.applyCharFormatRow(h.ownerRow,t,i,n,r,o,s)}},e.prototype.applyCharFormatForSelectedCell=function(e,t,i,n,r){for(var o=0;o<e.childWidgets.length;o++){var s=e.childWidgets[o];s instanceof we?this.applyCharFormatForSelectedPara(s,t,i,n,r):this.applyCharFormatForSelTable(s,t,i,n,r)}},e.prototype.applyCharFormatRow=function(e,t,i,n,r,o,s){o=this.getCharacterFormatValueOfCell(e.childWidgets[0],t,o,r),this.applyCharFormatForTable(e.rowIndex,e.ownerTable,t,i,n,r,o,s)},e.prototype.applyCharFormatForTable=function(e,t,i,n,r,o,s,a){t=t.combineWidget(this.owner.viewer);for(var l=e;l<t.childWidgets.length;l++){for(var d=t.childWidgets[l],h=0;h<d.childWidgets.length;h++)this.applyCharFormatForSelectedCell(d.childWidgets[h],i,o,s,a);if(r.paragraph.isInsideTable&&i.containsRow(d,r.paragraph.associatedCell))return void this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1)}this.documentHelper.layout.layoutBodyWidgetCollection(t.index,t.containerWidget,t,!1),this.getNextParagraphForCharacterFormatting(t,n,r,o,s,a)},e.prototype.applyCharFormatForSelTable=function(e,t,i,n,r){for(var o=0;o<e.childWidgets.length;o++)for(var s=e.childWidgets[o],a=0;a<s.childWidgets.length;a++)this.applyCharFormatForSelectedCell(s.childWidgets[a],t,i,n,r)},e.prototype.applyCharFormatForTableCell=function(e,t,i,n,r,o,s){var a=t.getCellLeft(i.ownerRow,i),l=a+i.cellFormat.cellWidth,d=t.getCellLeft(n.ownerRow,n),h=d+n.cellFormat.cellWidth,c=this.updateSelectedCellsInTable(a,l,d,h);a=c.start,l=c.end;for(var p=e.childWidgets.indexOf(n.ownerRow),g=!1,u=e.childWidgets.indexOf(i.ownerRow);u<=p;u++)for(var m=e.childWidgets[u],f=0;f<m.childWidgets.length;f++){var v=t.getCellLeft(m,m.childWidgets[f]);L.round(a,2)<=L.round(v,2)&&L.round(v,2)<L.round(l,2)&&(g||(o=this.getCharacterFormatValueOfCell(m.childWidgets[f],t,o,r),g=!0),this.applyCharFormatForSelectedCell(m.childWidgets[f],t,r,o,s))}},e.prototype.updateSelectedCellsInTable=function(e,t,i,n){var r=this.documentHelper.selection;return e>i&&(e=i),t<n&&(t=n),e>r.upDownSelectionLength&&(e=r.upDownSelectionLength),t<r.upDownSelectionLength&&(t=r.upDownSelectionLength),{start:e,end:t}},e.prototype.getCharacterFormatValueOfCell=function(e,t,i,n){if("boolean"==typeof i||void 0===i&&("bold"===n||"italic"===n)){var r=t.getFirstParagraph(e),o=r.characterFormat;r.childWidgets.length>0&&r.childWidgets[0].children.length>0&&(o=r.childWidgets[0].children[0].characterFormat),i=!o.getPropertyValue(n)}return i},e.prototype.applyCharFormatValueInternal=function(e,t,i,n){this.applyCharFormatValue(t,i,n,!1)},e.prototype.copyInlineCharacterFormat=function(e,t){t.uniqueCharacterFormat=e.uniqueCharacterFormat,t.baseCharStyle=e.baseCharStyle},e.prototype.applyCharFormatValue=function(e,i,n,r){if(r&&"fontSize"===i&&(n=this.updateFontSize(e,n)),this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&(n=this.editorHistory.currentBaseHistoryInfo.addModifiedProperties(e,i,n)),n instanceof k)return void(this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)?this.copyInlineCharacterFormat(n,e):e.copyFormat(n));if(this.isForHyperlinkFormat&&this.owner.enableTrackChanges&&e.ownerBase instanceof Se){var o=e.ownerBase,s=o.previousNode;if(t.isNullOrUndefined(s)){var a=o.paragraph.previousWidget;if(!t.isNullOrUndefined(a)&&!a.isEmpty()){var l=a.lastChild;s=l.children[l.children.length-1]}}for(;!(t.isNullOrUndefined(s)||s instanceof Oe);)s=s.previousNode;if(!t.isNullOrUndefined(s)&&s.revisions.length>0){var d=s.revisions[s.revisions.length-1];this.isRevisionAlreadyIn(o,d)||(o.revisions.push(d),d.range.push(o))}else this.insertRevision(o,"Insertion")}if(t.isNullOrUndefined(n))return void e.clearFormat();"bold"===i?e.bold=n:"italic"===i?e.italic=n:"fontColor"===i?e.fontColor=n:"fontFamily"===i?e.fontFamily=n:"fontSize"===i?e.fontSize=n:"highlightColor"===i?e.highlightColor=n:"baselineAlignment"===i?e.baselineAlignment=n:"strikethrough"===i?e.strikethrough=n:"underline"===i?e.underline=n:"styleName"===i?e.baseCharStyle=n:"allCaps"===i&&(e.allCaps=n)},e.prototype.onImageFormat=function(e,t,i){var n=new Bt(e);this.editorHistory&&(this.editorHistory.initializeHistory("ImageResizing"),this.editorHistory.currentBaseHistoryInfo.modifiedProperties.push(n)),this.setOffsetValue(this.selection),e.width=t,e.height=i,this.documentHelper.layout.reLayoutParagraph(e.line.paragraph,e.line.indexInOwner,0),this.reLayout(this.selection,!1),this.documentHelper.owner.imageResizerModule&&this.documentHelper.owner.imageResizerModule.positionImageResizer(e)},e.prototype.toggleTextAlignment=function(e){this.documentHelper.owner.isReadOnlyMode&&!this.selection.isInlineFormFillMode()||!this.documentHelper.owner.isDocumentLoaded||(t.isNullOrUndefined(this.documentHelper.selection.paragraphFormat.textAlignment)||this.documentHelper.selection.paragraphFormat.textAlignment!==e?this.onApplyParagraphFormat("textAlignment",e,!1,!0):"Left"===e?this.onApplyParagraphFormat("textAlignment","Justify",!1,!0):this.onApplyParagraphFormat("textAlignment","Left",!1,!0))},e.prototype.onApplyParagraphFormat=function(e,t,i,n){var r=this.documentHelper.isFormFillProtectedMode&&this.documentHelper.selection.isInlineFormFillMode()&&this.allowFormattingInFormFields(e);if(!this.restrictFormatting||r){var o="bidi"===e?"ParagraphBidi":e[0].toUpperCase()+e.slice(1);this.documentHelper.owner.isShiftingEnabled=!0;var s=this.documentHelper.selection;if(this.initHistory(o),(!this.owner.isReadOnlyMode||r)&&this.owner.isDocumentLoaded){if("leftIndent"===e&&-1!==s.paragraphFormat.listId&&i)return void this.updateListLevel(t>0);if(s.isEmpty){this.setOffsetValue(s);var a=s.paragraphFormat.bidi&&("listFormat"===e||-1!==s.paragraphFormat.listId);a||(this.documentHelper.layout.isBidiReLayout=!0),i&&"leftIndent"===e&&(t=this.getIndentIncrementValue(s.start.paragraph,t));var l=s.start.paragraph,d=this.documentHelper.layout,h=d.getFootNodeWidgetsToShiftToPage(l);l=l.combineWidget(this.owner.viewer),this.applyParaFormatProperty(l,e,t,i),this.layoutItemBlock(l,!1),h.footNoteWidgets.length>0&&(d.moveFootNotesToPage(h.footNoteWidgets,h.fromBodyWidget,h.toBodyWidget),d.layoutfootNote(h.toBodyWidget.page.footnoteWidget)),a||(this.documentHelper.layout.isBidiReLayout=!1)}else"ParagraphBidi"!==o&&this.setOffsetValue(s),this.updateSelectionParagraphFormatting(e,t,i);this.reLayout(s)}}},e.prototype.updateListLevel=function(e){var i,n=this.documentHelper,r=(this.documentHelper.selection.start.paragraph.paragraphFormat.listFormat,this.documentHelper.selection.start.paragraph.paragraphFormat),o=n.getListById(r.listFormat.listId);n.layout.getListLevel(o,r.listFormat.listLevelNumber);i=e?r.listFormat.listLevelNumber+1:r.listFormat.listLevelNumber-1;var s=n.layout.getListLevel(o,i);t.isNullOrUndefined(s)||(this.onApplyListInternal(o,i),n.selection.start.updatePhysicalPosition(!0),n.selection.end.updatePhysicalPosition(!0),n.selection.updateCaretPosition())},e.prototype.onApplyListInternal=function(e,i){var n=new T;!t.isNullOrUndefined(e)&&i>=0&&i<9&&(n.listId=e.listId,n.listLevelNumber=i),this.onApplyParagraphFormat("listFormat",n,!1,!1)},e.prototype.updateSelectionParagraphFormatting=function(e,i,n){var r=this.documentHelper.selection;"leftIndent"===e&&n&&(i=!t.isNullOrUndefined(r.start)&&r.start.isExistBefore(r.end)?this.getIndentIncrementValue(r.start.paragraph,i):this.getIndentIncrementValue(r.end.paragraph,i)),this.updateParagraphFormatInternal(e,i,n)},e.prototype.getIndentIncrementValue=function(e,t){var i=e.paragraphFormat.leftIndent;if(i<0){if(t<0||i+t>=0)return-i;var n=-this.getIndentIncrementValueInternal(-i,-t);return n%t==0?n:n+t}return this.getIndentIncrementValueInternal(i,t)},e.prototype.getIndentIncrementValueInternal=function(e,t){var i=Math.abs(t);if(0===e||0===i)return t>0?i:0;var n=100*Math.round(e)%(100*Math.round(i))/100,r=(Math.round(e)-n)/Math.round(i)*i;return t>0&&(r+=i),r-e==0?t:r-e},e.prototype.updateParagraphFormatInternal=function(e,i,n){switch(t.isNullOrUndefined(e)&&(e="ParagraphFormat"),e){case"afterSpacing":this.updateParagraphFormat("afterSpacing",i,!1);break;case"beforeSpacing":this.updateParagraphFormat("beforeSpacing",i,!1);break;case"rightIndent":this.updateParagraphFormat("rightIndent",i,!1);break;case"leftIndent":this.updateParagraphFormat("leftIndent",i,n);break;case"firstLineIndent":this.updateParagraphFormat("firstLineIndent",i,!1);break;case"lineSpacing":this.updateParagraphFormat("lineSpacing",i,!1);break;case"lineSpacingType":this.updateParagraphFormat("lineSpacingType",i,!1);break;case"textAlignment":this.updateParagraphFormat("textAlignment",i,!1);break;case"listFormat":this.updateParagraphFormat("listFormat",i,!1);break;case"ParagraphFormat":this.updateParagraphFormat(void 0,i,!1);break;case"styleName":this.updateParagraphFormat("styleName",i,!1);break;case"ClearParagraphFormat":this.updateParagraphFormat(void 0,i,!1);break;case"bidi":var r=-1!==this.selection.paragraphFormat.listId;r||(this.documentHelper.layout.isBidiReLayout=!0),this.updateParagraphFormat("bidi",i,!1),r||(this.documentHelper.layout.isBidiReLayout=!1);break;case"contextualSpacing":this.updateParagraphFormat("contextualSpacing",i,!1)}},e.prototype.updateParagraphFormat=function(e,t,i){var n=this.documentHelper.selection,r=n.start,o=n.end;n.isForward||(r=n.end,o=n.start),this.applyParaFormatSelectedContent(r,o,e,t,i)},e.prototype.applyParaFormatSelectedContent=function(e,i,n,r,o){var s=this.documentHelper.selection;if(!e.paragraph.isInsideTable||i.paragraph.isInsideTable&&e.paragraph.associatedCell===i.paragraph.associatedCell&&!s.isCellSelected(e.paragraph.associatedCell,e,i)){if(!t.isNullOrUndefined(r)&&!this.selection.isEmpty&&"styleName"===n&&this.applyCharacterStyle(e.paragraph,e,i,n,r,o))return;this.applyParaFormat(e.paragraph,e,i,n,r,o)}else{var a=void 0;e.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),this.checkInsertPosition(s)&&this.updateHistoryPosition(e,!0),a=e.paragraph.associatedCell,this.applyParaFormatInCell(a,e,i,n,r,o);var l=a.ownerTable;this.documentHelper.layout.layoutBodyWidgetCollection(l.index,l.containerWidget,l,!1)}},e.prototype.applyParaFormatProperty=function(e,i,n,r){var o=e.paragraphFormat;if(r&&"leftIndent"===i&&(n=o.leftIndent+n),"listFormat"===i&&n instanceof T){var s=n;s.hasValue("listLevelNumber")||(s.listLevelNumber=o.listFormat.listLevelNumber)}if(this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&(n=this.editorHistory.currentBaseHistoryInfo.addModifiedPropertiesForParagraphFormat(o,i,n)),n instanceof I&&(t.isNullOrUndefined(i)?this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)?this.copyParagraphFormat(n,o):o.copyFormat(n):"listFormat"===i&&(o.listFormat=n.listFormat)),t.isNullOrUndefined(n))return o.clearFormat(),void this.documentHelper.layout.reLayoutParagraph(o.ownerBase,0,0);if("afterSpacing"===i)o.afterSpacing=n;else if("beforeSpacing"===i)o.beforeSpacing=n;else if("leftIndent"===i)o.leftIndent=n;else if("lineSpacingType"===i)o.lineSpacingType=n;else if("lineSpacing"===i)o.lineSpacing=n;else if("rightIndent"===i)o.rightIndent=n;else if("firstLineIndent"===i)o.firstLineIndent=n;else if("textAlignment"===i)o.textAlignment=n,this.documentHelper.layout.allowLayout=!1;else if("styleName"===i)"string"==typeof n&&(n=this.documentHelper.styles.findByName(n)),o.applyStyle(n);else{if("listFormat"===i)return n instanceof I&&(this.copyFromListLevelParagraphFormat(o,n),n=n.listFormat),o.listFormat.copyFormat(n),this.documentHelper.layout.clearListElementBox(o.ownerBase),this.onListFormatChange(o.ownerBase,n,o),void this.layoutItemBlock(o.ownerBase,!1);"bidi"===i?o.bidi=n:"contextualSpacing"===i&&(o.contextualSpacing=n)}},e.prototype.copyParagraphFormat=function(e,t){t.uniqueParagraphFormat=e.uniqueParagraphFormat,t.listFormat=e.listFormat,t.baseStyle=e.baseStyle},e.prototype.onListFormatChange=function(e,t,i){t instanceof T&&this.updateListParagraphFormat(e,t)},e.prototype.updateListParagraphFormat=function(e,i){var n=this.documentHelper.getListById(i.listId),r=void 0;t.isNullOrUndefined(n)||(r=this.documentHelper.layout.getListLevel(n,i.listLevelNumber)),(!this.editorHistory||this.editorHistory&&!this.editorHistory.isUndoing)&&(e instanceof we&&!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(r.paragraphFormat)&&!t.isNullOrUndefined(e.containerWidget)?this.copyFromListLevelParagraphFormat(e.paragraphFormat,r.paragraphFormat):t.isNullOrUndefined(n)&&(e.paragraphFormat.leftIndent=void 0,e.paragraphFormat.firstLineIndent=void 0))},e.prototype.copyFromListLevelParagraphFormat=function(e,i){t.isNullOrUndefined(i.leftIndent)||(e.leftIndent=i.leftIndent),t.isNullOrUndefined(i.firstLineIndent)||(e.firstLineIndent=i.firstLineIndent)},e.prototype.applyContinueNumbering=function(){var e=this.selection;this.editorHistory&&this.editorHistory.initializeHistory("ContinueNumbering"),this.applyContinueNumberingInternal(e)},e.prototype.applyContinueNumberingInternal=function(e){var t=e.start.paragraph,i=this.getContinueNumberingInfo(t),n=this.getParagraphFormat(t,i.listLevelNumber,i.listPattern);this.changeListId(i.currentList,t,n,i.listLevelNumber,i.listPattern),this.reLayout(e,!1),this.documentHelper.updateFocus()},e.prototype.getContinueNumberingInfo=function(e){var i=void 0,n=0,r="None";t.isNullOrUndefined(e.paragraphFormat)||t.isNullOrUndefined(e.paragraphFormat.listFormat)||(i=this.documentHelper.getListById(e.paragraphFormat.listFormat.listId),n=e.paragraphFormat.listFormat.listLevelNumber);var o=this.documentHelper;if(0!==n&&!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(o.getAbstractListById(i.abstractListId))&&!t.isNullOrUndefined(o.getAbstractListById(i.abstractListId).levels[n])){var s=this.documentHelper.layout.getListLevel(i,n);t.isNullOrUndefined(s)||(r=s.listLevelPattern)}return{currentList:i,listLevelNumber:n,listPattern:r}},e.prototype.revertContinueNumbering=function(e,i){var n=e.start.paragraph,r=this.getContinueNumberingInfo(n);this.changeListId(r.currentList,n,i,r.listLevelNumber,r.listPattern),this.reLayout(e,!1),this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&this.editorHistory.updateHistory()},e.prototype.changeListId=function(e,i,n,r,o){if(!t.isNullOrUndefined(i)){if(i instanceof we&&e.listId===i.paragraphFormat.listFormat.listId&&r===i.paragraphFormat.listFormat.listLevelNumber){if(this.editorHistory){var s=this.editorHistory.currentBaseHistoryInfo;t.isNullOrUndefined(s)||(n=s.addModifiedPropertiesForContinueNumbering(i.paragraphFormat,n))}i.paragraphFormat.copyFormat(n),this.documentHelper.layout.reLayoutParagraph(i,0,0)}return this.changeListId(e,i.nextRenderedWidget,n,r,o)}},e.prototype.getParagraphFormat=function(e,i,n){if(!t.isNullOrUndefined(e.previousRenderedWidget)&&e.previousRenderedWidget instanceof we){if(t.isNullOrUndefined(e.previousRenderedWidget.paragraphFormat.listFormat)||-1===e.previousRenderedWidget.paragraphFormat.listFormat.listId)return this.getParagraphFormat(e.previousRenderedWidget,i,n);var r=this.selection.getListLevel(e.previousRenderedWidget);return 0===i?e.previousRenderedWidget.paragraphFormat:n===r.listLevelPattern||this.checkNumberArabic(n,r.listLevelPattern)?e.previousRenderedWidget.paragraphFormat:this.getParagraphFormat(e.previousRenderedWidget,i,n)}},e.prototype.checkNumberArabic=function(e,t){return"Number"===e&&"Arabic"===t||"Number"===t&&"Arabic"===e},e.prototype.applyRestartNumbering=function(e){this.editorHistory&&this.editorHistory.initializeHistory("RestartNumbering"),this.restartListAt(e)},e.prototype.restartListAt=function(e){var t=e.paragraphFormat.getList(),i=t.clone();i.listId=this.documentHelper.lists[this.documentHelper.lists.length-1].listId+1,this.documentHelper.lists.push(i);var n=t.abstractList.clone();n.abstractListId=this.documentHelper.abstractLists[this.documentHelper.abstractLists.length-1].abstractListId+1,i.abstractListId=n.abstractListId,i.abstractList=n,this.documentHelper.abstractLists.push(n),this.restartListAtInternal(e,i.listId)},e.prototype.restartListAtInternal=function(e,t){var i=this.getContinueNumberingInfo(e.start.paragraph);this.changeRestartNumbering(i.currentList,e.start.paragraph,t),this.reLayout(e,!1),this.incrementListNumber=-1,this.refListNumber=void 0,this.documentHelper.updateFocus()},e.prototype.changeRestartNumbering=function(e,i,n){if(!t.isNullOrUndefined(i)){if(i instanceof we&&e.listId===i.paragraphFormat.listFormat.listId){if(this.editorHistory){var r=this.editorHistory.currentBaseHistoryInfo;t.isNullOrUndefined(r)||(n=r.addModifiedPropertiesForRestartNumbering(i.paragraphFormat.listFormat,n))}i.paragraphFormat.listFormat.listId=n,void 0===this.refListNumber&&-1===this.incrementListNumber&&(this.incrementListNumber=i.paragraphFormat.listFormat.listLevelNumber-1),this.refListNumber!==i.paragraphFormat.listFormat.listLevelNumber&&(this.incrementListNumber+=1,this.refListNumber=i.paragraphFormat.listFormat.listLevelNumber),i.paragraphFormat.listFormat.listLevelNumber=this.incrementListNumber,this.documentHelper.layout.reLayoutParagraph(i,0,0)}return this.changeRestartNumbering(e,i.nextRenderedWidget,n)}},e.prototype.applyParaFormat=function(e,t,i,n,r,o){this.setOffsetValue(this.selection),e=e.combineWidget(this.owner.viewer),this.applyParaFormatProperty(e,n,r,o),this.layoutItemBlock(e,!1),this.getOffsetValue(this.selection),e.equals(i.paragraph)||this.getNextParagraphForFormatting(e,t,i,n,r,o)},e.prototype.applyCharacterStyle=function(e,t,i,n,r,o){var s=e.getSplitWidgets(),a=i.owner.selection,l=i.currentWidget;if(!(0===t.offset&&(a.isParagraphLastLine(l)&&i.currentWidget===l&&i.offset===a.getLineLength(l)+1||i.isAtParagraphEnd))&&(i.paragraph===e||-1!==s.indexOf(i.paragraph))&&("Paragraph"===r.type&&r.link instanceof z||"Character"===r.type)){var d="Character"===r.type?r:r.link;return this.updateSelectionCharacterFormatting(n,d,o),!0}return!1},e.prototype.applyParaFormatInCell=function(e,t,i,n,r,o){var s=this.documentHelper.selection;if(i.paragraph.isInsideTable){var a=s.getContainerCellOf(e,i.paragraph.associatedCell);if(a.ownerTable.contains(i.paragraph.associatedCell)){var l=s.getSelectedCell(e,a),d=s.getSelectedCell(i.paragraph.associatedCell,a);s.containsCell(a,i.paragraph.associatedCell)?s.isCellSelected(a,t,i)?(r=this.getParaFormatValueInCell(a,n,r),this.applyParaFormatCellInternal(a,n,r,o)):l===a?this.applyParaFormat(t.paragraph,t,i,n,r,o):this.applyParagraphFormatRow(l.ownerRow,t,i,n,r,o):this.applyParaFormatTableCell(a.ownerTable,a,d,n,r,o)}else this.applyParagraphFormatRow(a.ownerRow,t,i,n,r,o)}else{var h=s.getContainerCell(e);this.applyParagraphFormatRow(h.ownerRow,t,i,n,r,o)}},e.prototype.applyParaFormatCellInternal=function(e,t,i,n){for(var r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];o instanceof we?this.applyParaFormatProperty(o,t,i,n):this.applyParagraphFormatTableInternal(o,t,i,n)}},e.prototype.getParaFormatValueInCell=function(e,t,i){return"boolean"==typeof i&&(i=!this.documentHelper.selection.getFirstParagraph(e).paragraphFormat.getPropertyValue(t)),i},e.prototype.applyParagraphFormatRow=function(e,t,i,n,r,o){r=this.getParaFormatValueInCell(e.childWidgets[0],n,r);for(var s=e.rowIndex;s<e.ownerTable.childWidgets.length;s++){for(var a=e.ownerTable.childWidgets[s],l=0;l<a.childWidgets.length;l++)this.applyParaFormatCellInternal(a.childWidgets[l],n,r,o);if(i.paragraph.isInsideTable&&this.documentHelper.selection.containsRow(a,i.paragraph.associatedCell))return}this.getNextParagraphForFormatting(e.ownerTable,t,i,n,r,o)},e.prototype.applyParaFormatTableCell=function(e,t,i,n,r,o){var s=this.documentHelper.selection,a=s.getCellLeft(t.ownerRow,t),l=a+t.cellFormat.cellWidth,d=s.getCellLeft(i.ownerRow,i),h=d+i.cellFormat.cellWidth,c=this.updateSelectedCellsInTable(a,l,d,h);a=c.start,l=c.end;for(var p=e.childWidgets.indexOf(i.ownerRow),g=!1,u=e.childWidgets.indexOf(t.ownerRow);u<=p;u++)for(var m=e.childWidgets[u],f=0;f<m.childWidgets.length;f++){var v=s.getCellLeft(m,m.childWidgets[f]);Math.round(a)<=Math.round(v)&&Math.round(v)<Math.round(l)&&(g||(r=this.getParaFormatValueInCell(m.childWidgets[f],n,r),g=!0),this.applyParaFormatCellInternal(m.childWidgets[f],n,r,o))}},e.prototype.applyParaFormatTable=function(e,t,i,n,r,o){e=e.combineWidget(this.owner.viewer);for(var s=this.documentHelper.selection,a=0;a<e.childWidgets.length;a++){for(var l=e.childWidgets[a],d=0;d<l.childWidgets.length;d++)this.applyParaFormatCellInternal(l.childWidgets[d],n,r,o);if(i.paragraph.isInsideTable&&s.containsRow(l,i.paragraph.associatedCell))return void this.documentHelper.layout.layoutBodyWidgetCollection(e.index,e.containerWidget,e,!1)}this.documentHelper.layout.layoutBodyWidgetCollection(e.index,e.containerWidget,e,!1),this.getNextParagraphForFormatting(e,t,i,n,r,o)},e.prototype.getNextParagraphForFormatting=function(e,i,n,r,o,s){var a=e.getSplitWidgets();e=a[a.length-1],e=this.documentHelper.selection.getNextRenderedBlock(e),t.isNullOrUndefined(e)||(e instanceof we?this.applyParaFormat(e,i,n,r,o,s):this.applyParaFormatTable(e,i,n,r,o,s))},e.prototype.applyParagraphFormatTableInternal=function(e,t,i,n){for(var r=0;r<e.childWidgets.length;r++)for(var o=e.childWidgets[r],s=0;s<o.childWidgets.length;s++)this.applyParaFormatCellInternal(o.childWidgets[s],t,i,n)},e.prototype.onApplySectionFormat=function(e,i){if(!this.restrictFormatting){if(t.isNullOrUndefined(e))this.initHistory("SectionFormat");else{var n=e[0].toUpperCase()+e.slice(1);this.initHistory(n)}this.updateSectionFormat(e,i)}},e.prototype.updateSectionFormat=function(e,t){var i=this.documentHelper.selection;i.owner.isShiftingEnabled=!0;var n=i.start,r=i.end;i.isForward||(n=i.end,r=i.start);var o,s;this.documentHelper.clearContent();for(var a=n.paragraph.bodyWidget.sectionIndex,l=r.paragraph.bodyWidget.sectionIndex,d=0;d<this.documentHelper.pages.length;d++)if(this.documentHelper.pages[d].bodyWidgets[0].index===a){o=d;break}for(d=o;d<this.documentHelper.pages.length;d++){var h=this.documentHelper.pages[d].bodyWidgets[0];if(s=d,h.index!==a&&!(h.index>=a&&h.index<=l)){s=d-1;break}}for(var c=!0,p=0,d=o;d<=s;d++)p===this.documentHelper.pages[d].bodyWidgets[0].index||c||(c=!0),this.applyPropertyValueForSection(this.documentHelper.pages[d].bodyWidgets[0].sectionFormat,e,t,c),p=this.documentHelper.pages[d].bodyWidgets[0].index,c=!1;this.layoutWholeDocument(),this.fireContentChange()},e.prototype.onApplyTableFormat=function(e,t){if(!this.restrictFormatting){var i=this.getTableFormatAction(e);this.viewer.owner.isShiftingEnabled=!0;var n=this.documentHelper.selection,r=n.start.paragraph.associatedCell.ownerTable;r=r.combineWidget(this.owner.viewer),n.isEmpty?(this.initHistory(i),this.applyTablePropertyValue(n,e,t,r)):this.updateSelectionTableFormat(this.selection,i,t),r.calculateGrid(),this.selection.owner.isLayoutEnabled=!0,this.documentHelper.layout.reLayoutTable(r),this.reLayout(n,!1)}},e.prototype.getTableFormatAction=function(e){switch(e){case"tableAlignment":return"TableAlignment";case"leftIndent":return"TableLeftIndent";case"leftMargin":return"DefaultCellLeftMargin";case"rightMargin":return"DefaultCellRightMargin";case"bottomMargin":return"DefaultCellBottomMargin";case"topMargin":return"DefaultCellTopMargin";case"preferredWidth":return"TablePreferredWidth";case"preferredWidthType":return"TablePreferredWidthType";case"shading":return"Shading";case"bidi":return"TableBidi";default:return"DefaultCellSpacing"}},e.prototype.onApplyTableRowFormat=function(e,t){if(!this.restrictFormatting){var i=this.getRowAction(e);this.documentHelper.owner.isShiftingEnabled=!0;var n=this.documentHelper.selection;if(n.isEmpty){this.initHistory(i);n.start.paragraph.associatedCell.ownerRow.ownerTable;this.applyRowPropertyValue(n,e,t,n.start.paragraph.associatedCell.ownerRow)}else this.updateSelectionTableFormat(this.selection,i,t);this.reLayout(n,!1)}},e.prototype.getRowAction=function(e){switch(e){case"height":return"RowHeight";case"heightType":return"RowHeightType";case"isHeader":return"RowHeader";default:return"AllowBreakAcrossPages"}},e.prototype.onApplyTableCellFormat=function(e,t){if(!this.restrictFormatting){var i=this.getTableCellAction(e);this.documentHelper.owner.isShiftingEnabled=!0;var n=this.documentHelper.selection,r=n.start.paragraph.associatedCell.ownerTable;r=r.combineWidget(this.owner.viewer),n.isEmpty?(this.initHistory(i),this.applyCellPropertyValue(n,e,t,n.start.paragraph.associatedCell.cellFormat),r.calculateGrid(),this.selection.owner.isLayoutEnabled=!0,this.documentHelper.layout.reLayoutTable(r)):this.updateSelectionTableFormat(this.selection,i,t),this.reLayout(n,!1)}},e.prototype.getTableCellAction=function(e){switch(e){case"verticalAlignment":return"CellContentVerticalAlignment";case"leftMargin":return"CellLeftMargin";case"rightMargin":return"CellRightMargin";case"bottomMargin":return"CellBottomMargin";case"topMargin":return"CellTopMargin";case"preferredWidth":return"CellPreferredWidth";case"shading":return"Shading";default:return"CellPreferredWidthType"}},e.prototype.applyPropertyValueForSection=function(e,i,n,r){if(r&&this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&(n=this.editorHistory.currentBaseHistoryInfo.addModifiedPropertiesForSection(e,i,n)),!t.isNullOrUndefined(n))return n instanceof x?void(t.isNullOrUndefined(i)&&e.copyFormat(n,this.editorHistory)):void("pageHeight"===i?e.pageHeight=n:"pageWidth"===i?e.pageWidth=n:"leftMargin"===i?e.leftMargin=n:"rightMargin"===i?e.rightMargin=n:"topMargin"===i?e.topMargin=n:"bottomMargin"===i?e.bottomMargin=n:"differentFirstPage"===i?e.differentFirstPage=n:"differentOddAndEvenPages"===i?e.differentOddAndEvenPages=n:"headerDistance"===i?e.headerDistance=n:"footerDistance"===i?e.footerDistance=n:"pageStartingNumber"===i?e.pageStartingNumber=n:"restartPageNumbering"===i?e.restartPageNumbering=n:"endnoteNumberFormat"===i?e.endnoteNumberFormat=n:"footNoteNumberFormat"===i?e.footNoteNumberFormat=n:"restartIndexForEndnotes"===i?e.restartIndexForEndnotes=n:"restartIndexForFootnotes"===i?e.restartIndexForFootnotes=n:"initialFootNoteNumber"===i?e.initialFootNoteNumber=n:"initialEndNoteNumber"===i&&(e.initialEndNoteNumber=n))},e.prototype.layoutWholeDocument=function(){this.documentHelper.layout.isLayoutWhole=!0;var e=this.documentHelper.selection.start,t=this.documentHelper.selection.end;e.isExistAfter(t)&&(e=this.documentHelper.selection.end,t=this.documentHelper.selection.start);var i=this.selection.getParagraphInfo(e),n=this.selection.getParagraphInfo(t),r=this.selection.getHierarchicalIndex(i.paragraph,i.offset.toString()),o=this.selection.getHierarchicalIndex(n.paragraph,n.offset.toString());this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[];var s=this.combineSection();this.documentHelper.clearContent(),this.documentHelper.layout.layoutItems(s,!0),this.documentHelper.owner.isShiftingEnabled=!1,this.setPositionForCurrentIndex(e,r),this.setPositionForCurrentIndex(t,o),this.documentHelper.selection.selectPosition(e,t),this.reLayout(this.documentHelper.selection),this.documentHelper.layout.isLayoutWhole=!1},e.prototype.combineSection=function(){var e=[],t=this.documentHelper.pages[0].bodyWidgets[0];do{t=this.combineSectionChild(t,e)}while(t);return e},e.prototype.combineSectionChild=function(e,t){var i=e,n=new fe;n.sectionFormat=e.sectionFormat,n.index=i.index;do{i=e,e.lastChild&&e.lastChild.combineWidget(this.owner.viewer),e=e.nextRenderedWidget;for(var r=0;r<i.childWidgets.length;r++){var o=i.childWidgets[r];o instanceof xe?this.documentHelper.layout.clearTableWidget(o,!0,!0,!0):(o.x=0,o.y=0,o.width=0,o.height=0),n.childWidgets.push(o),i.childWidgets.splice(r,1),r--,o.containerWidget=n}i.page.destroy()}while(e&&i.equals(e));return t.push(n),e},e.prototype.updateSelectionTableFormat=function(e,t,i){switch(t){case"TableAlignment":this.editorHistory.initializeHistory("TableAlignment"),this.updateTableFormat(e,"tableAlignment",i);break;case"TableLeftIndent":this.editorHistory.initializeHistory("TableLeftIndent"),this.updateTableFormat(e,"leftIndent",i);break;case"DefaultCellSpacing":this.editorHistory.initializeHistory("DefaultCellSpacing"),this.updateTableFormat(e,"cellSpacing",i);break;case"DefaultCellLeftMargin":this.editorHistory.initializeHistory("DefaultCellLeftMargin"),this.updateTableFormat(e,"leftMargin",i);break;case"DefaultCellRightMargin":this.editorHistory.initializeHistory("DefaultCellRightMargin"),this.updateTableFormat(e,"rightMargin",i);break;case"DefaultCellTopMargin":this.editorHistory.initializeHistory("DefaultCellTopMargin"),this.updateTableFormat(e,"topMargin",i);break;case"TablePreferredWidth":this.editorHistory.initializeHistory("TablePreferredWidth"),this.updateTableFormat(e,"preferredWidth",i);break;case"TablePreferredWidthType":this.editorHistory.initializeHistory("TablePreferredWidthType"),this.updateTableFormat(e,"preferredWidthType",i);break;case"DefaultCellBottomMargin":this.editorHistory.initializeHistory("DefaultCellBottomMargin"),this.updateTableFormat(e,"bottomMargin",i);break;case"CellContentVerticalAlignment":this.editorHistory.initializeHistory("CellContentVerticalAlignment"),this.updateCellFormat(e,"verticalAlignment",i);break;case"CellLeftMargin":this.editorHistory.initializeHistory("CellLeftMargin"),this.updateCellFormat(e,"leftMargin",i);break;case"CellRightMargin":this.editorHistory.initializeHistory("CellRightMargin"),this.updateCellFormat(e,"rightMargin",i);break;case"CellTopMargin":this.editorHistory.initializeHistory("CellTopMargin"),this.updateCellFormat(e,"topMargin",i);break;case"CellBottomMargin":this.editorHistory.initializeHistory("CellBottomMargin"),this.updateCellFormat(e,"bottomMargin",i);break;case"CellPreferredWidth":this.editorHistory.initializeHistory("CellPreferredWidth"),this.updateCellFormat(e,"preferredWidth",i);break;case"CellPreferredWidthType":this.editorHistory.initializeHistory("CellPreferredWidthType"),this.updateCellFormat(e,"preferredWidthType",i);break;case"Shading":this.editorHistory.initializeHistory("Shading"),this.updateCellFormat(e,"shading",i);break;case"RowHeight":this.editorHistory.initializeHistory("RowHeight"),this.updateRowFormat(e,"height",i);break;case"RowHeightType":this.editorHistory.initializeHistory("RowHeightType"),this.updateRowFormat(e,"heightType",i);break;case"RowHeader":this.editorHistory.initializeHistory("RowHeader"),this.updateRowFormat(e,"isHeader",i);break;case"AllowBreakAcrossPages":this.editorHistory.initializeHistory("AllowBreakAcrossPages"),this.updateRowFormat(e,"allowBreakAcrossPages",i);break;case"TableBidi":this.editorHistory.initializeHistory(t),this.updateTableFormat(e,"bidi",i)}},e.prototype.updateTableFormat=function(e,t,i){var n=e.start;e.end;e.isForward||(n=e.end,e.start),this.initHistoryPosition(e,n),this.applyTablePropertyValue(e,t,i,n.paragraph.associatedCell.ownerTable),this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&this.documentHelper.layout.reLayoutTable(n.paragraph.associatedCell.ownerTable)},e.prototype.updateCellFormat=function(e,t,i){e.owner.isShiftingEnabled=!0;var n=e.start;e.end;e.isForward||(n=e.end,e.start),this.initHistoryPosition(e,n),this.updateFormatForCell(e,t,i)},e.prototype.updateRowFormat=function(e,t,i){var n=e.start,r=e.end;e.isForward||(n=e.end,r=e.start),this.initHistoryPosition(e,n),this.applyRowFormat(n.paragraph.associatedCell.ownerRow,n,r,t,i)},e.prototype.initHistoryPosition=function(e,i){this.documentHelper.owner.editorHistoryModule&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&(t.isNullOrUndefined(i)?t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo.insertPosition)&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=e.start.getHierarchicalIndexInternal()):t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo.insertPosition)&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=i.getHierarchicalIndexInternal()))},e.prototype.startSelectionReLayouting=function(e,t,i,n){if(t.owner.isLayoutEnabled=!0,i.paragraph.isInsideTable){for(var r=i.paragraph.associatedCell.ownerTable;r.isInsideTable;)r=r.associatedCell.ownerTable;this.reLayoutSelectionOfTable(r,t,i,n)}else this.reLayoutSelection(e,t,i,n)},e.prototype.reLayoutSelectionOfTable=function(e,i,n,r){var o=!1;if(this.documentHelper.layout.layoutBodyWidgetCollection(e.index,e.containerWidget,e,!1),!t.isNullOrUndefined(r.paragraph.associatedCell)&&e.contains(r.paragraph.associatedCell))return!0;var s=i.getNextRenderedBlock(e);return t.isNullOrUndefined(s)||(o=this.reLayoutSelectionOfBlock(s,i,n,r)),o},e.prototype.reLayoutSelection=function(e,i,n,r){if(n.paragraph===e){n.offset,i.getParagraphLength(e);var o=0,s=0,a=e.getInline(n.offset,o),l=a.element;o=a.index,t.isNullOrUndefined(l)||(o!==l.length||t.isNullOrUndefined(l.nextNode)||(l=l.nextNode),s=l.line.children.indexOf(l));var d=0;n.currentWidget.paragraph===e&&(d=e.childWidgets.indexOf(n.currentWidget),s=n.currentWidget.children.indexOf(l)),l instanceof Oe&&!l.line&&s>0?this.documentHelper.layout.reLayoutParagraph(e,d,s-1):this.documentHelper.layout.reLayoutParagraph(e,d,s)}else this.documentHelper.layout.reLayoutParagraph(e,0,0);if(r.paragraph===e)return!0;var h=i.getNextRenderedBlock(e);return!t.isNullOrUndefined(h)&&this.reLayoutSelectionOfBlock(h,i,n,r)},e.prototype.reLayoutSelectionOfBlock=function(e,t,i,n){return e instanceof we?this.reLayoutSelection(e,t,i,n):void 0},e.prototype.layoutItemBlock=function(e,i){var n=void 0;if(e.containerWidget instanceof me){(n=e.containerWidget).childWidgets.indexOf(e);!t.isNullOrUndefined(this.documentHelper.owner)&&this.documentHelper.owner.isLayoutEnabled&&this.documentHelper.layout.layoutBodyWidgetCollection(e.index,n,e,!1)}else if(e.containerWidget instanceof Pe){var r=e.containerWidget;r=this.documentHelper.selection.getContainerCell(r),!t.isNullOrUndefined(this.documentHelper.owner)&&this.documentHelper.owner.isLayoutEnabled&&this.documentHelper.layout.reLayoutTable(e)}},e.prototype.removeSelectedContents=function(e){return this.removeSelectedContentInternal(e,e.start,e.end)},e.prototype.removeSelectedContentInternal=function(e,t,i){var n=t,r=i;if(t.isExistBefore(i)||(n=i,r=t),n.paragraph===r.paragraph&&n.paragraph.childWidgets.indexOf(n.currentWidget)===n.paragraph.childWidgets.length-1&&n.offset===e.getParagraphLength(n.paragraph)&&n.offset+1===r.offset)return e.owner.isShiftingEnabled=!0,e.selectContent(n,!0),!0;var o=this.selection.getParagraphInfo(n);e.editPosition=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString());var s=this.removeSelectedContent(r.paragraph,e,n,r),a=new kt(e.owner);return this.setPositionForCurrentIndex(a,e.editPosition),e.selectContent(a,!0),s},e.prototype.removeSelectedContent=function(e,t,i,n){return!(n.paragraph.isInsideTable&&n.paragraph!==t.getLastParagraphInLastCell(n.paragraph.associatedCell.ownerTable)&&(!i.paragraph.isInsideTable||i.paragraph.associatedCell.ownerTable.index!==n.paragraph.associatedCell.ownerTable.index))&&(t.owner.isShiftingEnabled=!0,this.deleteSelectedContent(e,t,i,n,2),!0)},e.prototype.deleteSelectedContent=function(e,t,i,n,r){var o=0,s=i.currentWidget.getInline(i.offset,o);s.element;if(o=s.index,o=0,s=n.currentWidget.getInline(n.offset,o),s.element,o=s.index,n.paragraph!==e)return void this.deleteSelectedContent(n.paragraph,t,i,n,r);if(!n.paragraph.isInsideTable||i.paragraph.isInsideTable&&i.paragraph.associatedCell===n.paragraph.associatedCell&&!t.isCellSelected(n.paragraph.associatedCell,i,n)){if(this.deletePara(e,i,n,r),this.delBlockContinue&&this.delBlock){if(this.delSection){var a=e.bodyWidget instanceof fe?e.bodyWidget:void 0;this.deleteSection(t,this.delSection,a,r),this.delSection=void 0}this.deleteBlock(this.delBlock,t,i,n,r),this.delBlockContinue=!1,this.delBlock=void 0}}else n.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer),this.deleteTableCell(n.paragraph.associatedCell,t,i,n,r);if(this.removeCommentCharacters.length>0&&!this.isCmtDeleteStarted){for(var l=0;l<this.removeCommentCharacters.length;l++){var d=this.editorHistory.currentBaseHistoryInfo,h=this.removeCommentCharacters[l];this.isCmtDeleteStarted=!0,h.commentMark&&h.removeCommentMark(),h.line&&h.line.paragraph&&h.line.paragraph.bodyWidget&&d&&(this.removeInline(h),this.selection.editPosition=d.insertPosition,this.isCmtDeleteStarted=!1,this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.insertPosition=d.insertPosition,this.editorHistory.currentHistoryInfo.endPosition=d.insertPosition,this.editorHistory.currentHistoryInfo.selectionStart=d.selectionStart,this.editorHistory.currentHistoryInfo.selectionEnd=d.selectionEnd,d.endPosition=d.insertPosition,this.editorHistory.updateComplexHistory(),this.editorHistory.currentBaseHistoryInfo=void 0))}this.isCmtDeleteStarted=!1,this.removeCommentCharacters=[],this.editorHistory.currentHistoryInfo&&(this.editorHistory.updateComplexHistory(),this.editorHistory.currentBaseHistoryInfo=void 0),this.selection.owner.isShiftingEnabled=!1}},e.prototype.mergeCells=function(){!this.owner.isReadOnlyMode&&this.canEditContentControl&&this.owner.isDocumentLoaded&&(t.isNullOrUndefined(this.documentHelper)||this.selection.isEmpty||this.mergeSelectedCellsInTable())},e.prototype.deleteTable=function(){if(!this.owner.isReadOnlyMode&&this.canEditContentControl){var e=this.selection.isForward?this.selection.start:this.selection.end;if(e.paragraph.isInsideTable){var i=this.getOwnerTable(this.selection.isForward).combineWidget(this.owner.viewer);this.selection.owner.isShiftingEnabled=!0,this.checkIsNotRedoing()&&(this.initHistory("DeleteTable"),this.updateHistoryPosition(e,!0));var n=this.getParagraphForSelection(i);if(this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.currentBaseHistoryInfo.removedNodes.push(i.clone()),this.owner.enableTrackChanges)for(var r=0;r<i.childWidgets.length;r++){if(0===r){var o=i.childWidgets[0];n=this.selection.getFirstParagraph(o)}this.trackRowDeletion(i.childWidgets[r])}else this.removeBlock(i);this.selection.selectParagraphInternal(n,!0),(this.checkIsNotRedoing()||t.isNullOrUndefined(this.editorHistory))&&this.reLayout(this.selection)}}},e.prototype.deleteColumn=function(){if(!this.owner.isReadOnlyMode&&this.canEditContentControl)if(this.owner.enableTrackChanges){var e=new t.L10n("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),this.alertDialog=n.DialogUtility.alert({title:e.getConstant("UnTrack"),content:e.getConstant("Merge Track"),showCloseIcon:!0,okButton:{text:"Ok",click:this.onDeleteColumnConfirmed.bind(this)},closeOnEscape:!0,position:{X:"center",Y:"center"},animationSettings:{effect:"Zoom"}})}else this.onDeleteColumnConfirmed()},e.prototype.onDeleteColumnConfirmed=function(){var e=this.selection.isForward?this.selection.start:this.selection.end;this.selection.isForward?this.selection.end:this.selection.start;if(e.paragraph.isInsideTable){this.selection.owner.isShiftingEnabled=!0,this.checkIsNotRedoing()&&this.initHistory("DeleteColumn");var i=this.getOwnerCell(this.selection.isForward),n=this.getOwnerCell(!this.selection.isForward),r=i.ownerTable.combineWidget(this.owner.viewer);this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.cloneTableToHistoryInfo(r);var o=void 0;if(n.nextWidget){var s=n.nextWidget;o=this.selection.getFirstParagraph(s)}else if(i.previousWidget){var a=i.previousWidget;o=this.selection.getFirstParagraph(a)}t.isNullOrUndefined(o)&&(o=this.getParagraphForSelection(r));for(var l=r.getColumnCellsForSelection(i,n),d=0;d<r.childWidgets.length;d++){var h=r.childWidgets[d];if(1===h.childWidgets.length)l.indexOf(h.childWidgets[0])>=0&&(r.childWidgets.splice(r.childWidgets.indexOf(h),1),h.destroy(),d--);else{for(var c=0;c<h.childWidgets.length;c++){var p=h.childWidgets[c];l.indexOf(p)>=0&&(h.childWidgets.splice(c,1),p.destroy(),c--)}0===h.childWidgets.length&&(r.childWidgets.splice(r.childWidgets.indexOf(h),1),h.destroy(),d--)}}0===r.childWidgets.length?(o=this.getParagraphForSelection(r),this.removeBlock(r),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.action="DeleteTable"),r.destroy()):(r.isGridUpdated=!1,r.buildTableColumns(),r.isGridUpdated=!0,this.documentHelper.layout.reLayoutTable(r)),this.selection.selectParagraphInternal(o,!0),(t.isNullOrUndefined(this.editorHistory)||this.checkIsNotRedoing())&&this.reLayout(this.selection,!0),t.isNullOrUndefined(this.alertDialog)||(this.alertDialog.close(),this.alertDialog=void 0)}},e.prototype.deleteRow=function(){if(!this.owner.isReadOnlyMode&&this.canEditContentControl){var e=this.selection.isForward?this.selection.start:this.selection.end,i=(this.selection.isForward?this.selection.end:this.selection.start,this.selection.getParagraphInfo(e)),n=this.selection.getHierarchicalIndex(i.paragraph,i.offset.toString());if(e.paragraph.isInsideTable){var r=this.getOwnerCell(this.selection.isForward),o=this.getOwnerCell(!this.selection.isForward);this.checkIsNotRedoing()&&this.initHistory("DeleteRow"),this.selection.owner.isShiftingEnabled=!0;var s=r.ownerTable.combineWidget(this.owner.viewer),a=this.getOwnerRow(!0);this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.cloneTableToHistoryInfo(s);var l=void 0;if(a.nextWidget){c=a.nextWidget.childWidgets[0];l=this.selection.getFirstParagraph(c)}if(t.isNullOrUndefined(l)&&(l=this.getParagraphForSelection(s)),e=e.clone(),this.selection.isEmpty)this.owner.enableTrackChanges?this.trackRowDeletion(a,!0,!1):this.removeRow(a);else{var d=this.selection.getContainerCellOf(r,o);if(d.ownerTable.contains(o))if(r=this.selection.getSelectedCell(r,d),o=this.selection.getSelectedCell(o,d),this.selection.containsCell(d,o))a=r.ownerRow,this.removeRow(a);else{a=r.ownerRow;var h=o.ownerRow;if(l=void 0,h.nextWidget){var c=h.nextWidget.childWidgets[0];l=this.selection.getFirstParagraph(c)}t.isNullOrUndefined(l)&&(l=this.getParagraphForSelection(s));for(var p=0;p<s.childWidgets.length;p++){var g=s.childWidgets[p];g.rowIndex>=a.rowIndex&&g.rowIndex<=h.rowIndex&&(this.owner.enableTrackChanges&&this.checkIsNotRedoing()?this.trackRowDeletion(g,!0,!1):(s.childWidgets.splice(p,1),g.destroy(),p--))}0===s.childWidgets.length?(this.removeBlock(s),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.action="DeleteTable"),s.destroy()):this.updateTable(s)}}if(!this.owner.enableTrackChanges||t.isNullOrUndefined(s.childWidgets))this.selection.selectParagraphInternal(l,!0);else{var u=this.selection.getTextPosBasedOnLogicalIndex(n);this.selection.selectContent(u,!0)}(t.isNullOrUndefined(this.editorHistory)||this.checkIsNotRedoing())&&this.reLayout(this.selection,!0)}}},e.prototype.trackRowDeletion=function(e,i,n){var r=e.rowFormat;if(!t.isNullOrUndefined(r)){if(r.revisions.length>0){var o=this.retrieveRevisionInOder(r);if("Insertion"===o.revisionType){if(this.isRevisionMatched(r,void 0))return t.isNullOrUndefined(i)||i?this.removeRow(e):this.removeRevisionsInRow(e),!0}else"Deletion"===o.revisionType&&this.unlinkWholeRangeInRevision(r,o)}(t.isNullOrUndefined(n)||n)&&this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.action="RemoveRowTrack"),this.insertRevision(r,"Deletion");for(var s=0;s<e.childWidgets.length;s++)for(var a=e.childWidgets[s],l=0;l<a.childWidgets.length;l++)if(a.childWidgets[l]instanceof xe)this.trackInnerTable(a.childWidgets[s],i,n);else{var d=a.childWidgets[l];this.skipTableElements=!0,this.insertRevisionForBlock(d,"Deletion"),this.skipTableElements=!1}}return!1},e.prototype.trackInnerTable=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++)this.trackRowDeletion(e.childWidgets[n],t,i)},e.prototype.returnDeleteRevision=function(e){for(var t=0;t<e.length;t++)if("Deletion"===e[t].revisionType)return e[t]},e.prototype.removeRow=function(e){var t=e.ownerTable;e.rowFormat.revisions.length>0&&this.removeRevisionsInRow(e),1===t.childWidgets.length?(this.removeBlock(t),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.currentBaseHistoryInfo.action="Delete"),t.destroy()):(t.childWidgets.splice(t.childWidgets.indexOf(e),1),e.destroy(),this.updateTable(t))},e.prototype.updateTable=function(e){e.updateRowIndex(0),e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0,this.documentHelper.layout.reLayoutTable(e)},e.prototype.getParagraphForSelection=function(e){var t=void 0,i=e.nextWidget?e.nextWidget:e.nextRenderedWidget,n=e.previousWidget?e.previousWidget:e.previousRenderedWidget;return i?t=i instanceof we?i:this.selection.getFirstParagraphInFirstCell(i):n&&(t=n instanceof we?n:this.selection.getLastParagraphInLastCell(n)),t},e.prototype.deletePara=function(e,i,n,r){e=e.combineWidget(this.owner.viewer);var o=this.documentHelper.selection,s=o.getStartOffset(e),a=o.getStartOffset(n.paragraph),l=s,d=0,h=!1,c=this.selection.getLineLength(e.lastChild),p=e,g=e.bodyWidget instanceof fe?e.bodyWidget:void 0,u=void 0,m=void 0;e===i.paragraph?(l=i.offset,u=i.currentWidget,n.paragraph.isInsideTable&&(h=this.isEndInAdjacentTable(e,n.paragraph))):u=e.firstChild,e!==i.paragraph&&o.isSkipLayouting&&(o.isSkipLayouting=!1),e===n.paragraph?(m=n.currentWidget,d=n.offset):(m=e.lastChild,d=this.documentHelper.selection.getLineLength(e.lastChild));var f=e.previousRenderedWidget?e.previousRenderedWidget.combineWidget(this.documentHelper.viewer):void 0;(l>s&&i.currentWidget===e.lastChild&&l===c&&(e===n.paragraph&&n.offset===l+1||e.nextRenderedWidget===n.paragraph&&n.offset===a)||this.editorHistory&&this.editorHistory.isUndoing&&this.editorHistory.currentHistoryInfo&&"PageBreak"===this.editorHistory.currentHistoryInfo.action&&f&&f.isPageBreak()&&(0===l&&!i.currentWidget.isFirstLine||l>0))&&(h=!0);var v=n.clone();v.offset=v.offset-1;var y=i.paragraph===e&&i.isAtParagraphStart&&v.isAtParagraphEnd&&this.editorHistory&&"Insert"===this.editorHistory.currentBaseHistoryInfo.action;if(y&&(this.editorHistory.currentBaseHistoryInfo.action="InsertTextParaReplace"),n.paragraph===e&&n.currentWidget!==e.lastChild||n.currentWidget===e.lastChild&&n.offset<=o.getLineLength(e.lastChild)||y){var b=i.paragraph===e;if((n.currentWidget.isFirstLine()&&n.offset>s||!n.currentWidget.isFirstLine()||y)&&this.removeInlines(e,u,l,m,d,r),t.isNullOrUndefined(f)||b||y)this.delBlockContinue=!1,this.delBlock=void 0;else{this.delBlockContinue=!0,this.delBlock=f;var w=f.bodyWidget instanceof fe?f.bodyWidget:void 0;w&&!g.equals(w)&&g.index!==w.index?this.delSection=w:this.delSection=void 0}}else{if(i.paragraph===e&&(i.currentWidget!==e.firstChild||i.currentWidget===e.firstChild&&l>s))return this.delBlockContinue=!1,this.delBlock=void 0,4===r?void 0:void(this.skipTracking()&&"ParaMarkTrack"===this.editorHistory.currentBaseHistoryInfo.action?(this.addRemovedNodes(e.characterFormat.cloneFormat()),e.characterFormat.revisions.length>0&&this.unlinkRangeFromRevision(e.characterFormat,!0),e.characterFormat.revisions=[]):this.owner.enableTrackChanges&&!this.skipTracking()&&"TOC"!==this.editorHistory.currentBaseHistoryInfo.action&&"Reject Change"!==this.editorHistory.currentBaseHistoryInfo.action?h?(p=this.splitParagraph(e,e.firstChild,0,u,l,!0),this.deleteParagraphMark(p,o,r,!0),this.addRemovedNodes(e)):this.removeInlines(e,u,l,m,d,r):(p=this.splitParagraph(e,e.firstChild,0,u,l,!0),this.insertParagraphPaste(e,p,i,n,h,r),this.removeRevisionForBlock(e,void 0,!1,!0),this.addRemovedNodes(e)));var C=void 0,x=e.previousWidget,F=x instanceof we?x:void 0,P=e.nextRenderedWidget;if(r<4){if(this.owner.enableTrackChanges&&!this.skipTracking()&&this.editorHistory.currentBaseHistoryInfo&&"TOC"!==this.editorHistory.currentBaseHistoryInfo.action){if(this.insertRevisionForBlock(e,"Deletion"),!e.isEmpty()||n.paragraph.previousRenderedWidget instanceof xe?this.combineRevisionWithBlocks(e.firstChild.children[0]):(C=this.checkAndInsertBlock(e,i,n,r,F),this.removeBlock(e)),e===n.paragraph&&"Delete"===this.editorHistory.currentBaseHistoryInfo.action){var T=this.selection.getParagraphInfo(n);this.selection.editPosition=this.selection.getHierarchicalIndex(T.paragraph,T.offset.toString())}if(i.paragraph!==e&&!t.isNullOrUndefined(f))return this.delBlockContinue=!0,void(this.delBlock=f)}else C=this.checkAndInsertBlock(e,i,n,r,F),this.removeRevisionForBlock(e,void 0,!1,!0),this.addRemovedNodes(e),this.removeBlock(e);if(this.documentHelper.blockToShift===e&&(this.documentHelper.blockToShift=void 0),t.isNullOrUndefined(C)){if(e===i.paragraph&&t.isNullOrUndefined(P)&&!t.isNullOrUndefined(F)){S=this.selection.getParagraphLength(F);o.editPosition=this.selection.getHierarchicalIndex(F,S.toString()),this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&(this.updateHistoryPosition(o.editPosition,!0),this.editorHistory.currentBaseHistoryInfo.endPosition=o.editPosition)}}else{o.editPosition=this.selection.getHierarchicalIndex(C,"0");var S=o.getParagraphLength(C)+1;this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&(this.editorHistory.currentBaseHistoryInfo.endPosition=this.selection.getHierarchicalIndex(C,S.toString()))}}i.paragraph===e||t.isNullOrUndefined(f)?(this.delBlockContinue=!1,this.delBlock=void 0):(this.delBlockContinue=!0,this.delBlock=f)}this.insertParagraphPaste(e,p,i,n,h,r)},e.prototype.deleteSection=function(e,t,i,n){n<4&&this.combineSectionInternal(e,t,i),n>2&&t.sectionFormat.copyFormat(i.sectionFormat)},e.prototype.combineSectionInternal=function(e,t,i){var n=t.getSplitWidgets()[0],r=[];this.combineSectionChild(n,r);var o=(n=r[0]).lastChild.index;this.updateBlockIndex(o+1,i.firstChild);for(var s=0,a=i,l=0;l<n.childWidgets.length;l++){var d=n.childWidgets.splice(l,1)[0];a.childWidgets.splice(s,0,d),d.containerWidget=a,this.documentHelper.layout.layoutBodyWidgetCollection(d.index,d.bodyWidget,d,!1),a=(d=d.getSplitWidgets().pop()).containerWidget,s=d.indexInOwner+1,l--}this.updateSectionIndex(void 0,i,!1),this.addRemovedNodes(n)},e.prototype.checkAndInsertBlock=function(e,i,n,r,o){if(e instanceof we&&e===i.paragraph||e instanceof xe){var s=void 0;if(t.isNullOrUndefined(e.nextWidget)&&(t.isNullOrUndefined(o)||o.nextRenderedWidget instanceof xe)){if(s=new we,1===r&&e instanceof we&&!t.isNullOrUndefined(e.paragraphFormat.baseStyle)&&"Normal"===e.paragraphFormat.baseStyle.name&&(s.characterFormat.copyFormat(e.characterFormat),s.paragraphFormat.copyFormat(e.paragraphFormat)),s.index=e.index+1,s.containerWidget=e.containerWidget,e instanceof we){s.paragraphFormat.lineSpacing=e.paragraphFormat.lineSpacing,s.paragraphFormat.lineSpacingType=e.paragraphFormat.lineSpacingType;var a=this.documentHelper.styles.findByName("Normal");t.isNullOrUndefined(a)||(s.paragraphFormat.baseStyle=new U,s.paragraphFormat.baseStyle.copyStyle(a))}this.documentHelper.layout.layoutBodyWidgetCollection(s.index,s.bodyWidget,s,!1),e.containerWidget instanceof ue&&e.containerWidget.childWidgets.push(s)}return s}},e.prototype.splitParagraph=function(e,t,i,n,r,o){var s=new we;s.paragraphFormat=new I(s),s.characterFormat=new k(s),s.paragraphFormat.copyFormat(e.paragraphFormat),s.characterFormat.copyFormat(e.characterFormat);var a=new Te(s);s.childWidgets.push(a);var l=e.index,d=e.indexInOwner;return this.moveInlines(e,s,0,i,t,r,n),e.containerWidget.childWidgets.splice(d,0,s),s.index=l,s.containerWidget=e.containerWidget,this.updateNextBlocksIndex(s,!0),o&&this.removeBlock(e),this.documentHelper.layout.layoutBodyWidgetCollection(l,s.containerWidget,s,!1),s},e.prototype.removeCommentsInBlock=function(e){if(e instanceof xe)for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],n=0;n<i.childWidgets.length;n++)for(var r=i.childWidgets[n],o=0;o<r.childWidgets.length;o++){var s=r.childWidgets[o];this.removeCommentsInBlock(s)}else this.removeCommentInPara(e)},e.prototype.removeCommentInPara=function(e){for(var t=0;t<e.childWidgets.length;t++)for(var i=e.childWidgets[t],n=0;n<i.children.length;n++)this.removeCommentsInline(i.children[n]);!this.editorHistory||!this.editorHistory.currentHistoryInfo||0!==this.removeCommentCharacters.length||this.isCmtDeleteStarted||this.editorHistory.isUndoing||this.editorHistory.isRedoing||this.editorHistory.updateComplexHistoryInternal()},e.prototype.removeCommentsInline=function(e){if(e instanceof vt&&1===e.commentType){if(!e.comment.isReply)for(var t=0;t<e.comment.replyComments.length;t++)this.removeCommentsInline(e.comment.replyComments[t].commentEnd);e.comment.commentStart&&e.comment.commentStart.commentMark&&e.comment.commentStart.removeCommentMark(),(!e.comment.isReply&&this.documentHelper.comments.indexOf(e.comment)>=0||e.comment.isReply&&this.documentHelper.comments.indexOf(e.comment.ownerComment)>=0)&&this.deleteCommentWidgetInline(e)}},e.prototype.removeBlock=function(e,t){var i,n;if(this.removeFieldInBlock(e),this.removeFieldInBlock(e,!0),this.removeFieldInBlock(e,void 0,!0),this.removeCommentsInBlock(e),e.isInsideTable)n=e.associatedCell,i=e.associatedCell.childWidgets.indexOf(e),e.associatedCell.childWidgets,this.updateNextBlocksIndex(e,!1),e.associatedCell.childWidgets.splice(i,1),e.containerWidget=void 0,this.documentHelper.layout.layoutBodyWidgetCollection(e.index,n,e,!1);else{n=e.containerWidget;for(var r=0;r<e.childWidgets.length;r++){var o=void 0;if(this.isPasteRevertAction()||(o=this.skipTracking()),e.childWidgets[r]instanceof Fe&&!o){var s=e.childWidgets[r];this.removeDeletedCellRevision(s)}}i=n.childWidgets.indexOf(e),n.childWidgets,this.updateNextBlocksIndex(e,!1),n.childWidgets.splice(i,1),e.containerWidget=void 0,n.height-=e.height,this.documentHelper.layout.layoutBodyWidgetCollection(e.index,n,e,!1,t)}},e.prototype.removePrevParaMarkRevision=function(e,i){if(i=!t.isNullOrUndefined(i)&&i,this.owner.enableTrackChanges){var n=e,r=-1,o=void 0,s=n,a=0;if(n.isEmpty()||(i||t.isNullOrUndefined(s.previousRenderedWidget)||(s=s.previousRenderedWidget,a++),i&&!t.isNullOrUndefined(s.nextRenderedWidget)&&(s=s.nextRenderedWidget,a++)),i)for(;s.isEmpty()&&!t.isNullOrUndefined(s.nextRenderedWidget);)s=s.nextRenderedWidget,a++;else for(;s.isEmpty()&&!t.isNullOrUndefined(s.previousRenderedWidget);)s=s.previousRenderedWidget,a++;var l=s.childWidgets[0];if(!t.isNullOrUndefined(l)&&l.children.length>0){var d=l.children[0];!t.isNullOrUndefined(d)&&d.revisions.length>0&&(o=d.revisions[d.revisions.length-1],r=i?o.range.indexOf(d)-a:o.range.indexOf(d)+a)}else s.isEmpty()&&(o=s.characterFormat.revisions[s.characterFormat.revisions.length-1],r=a-1);r>=0&&!t.isNullOrUndefined(o)&&o.range[r]instanceof k&&(o.range.splice(r,1),0==o.range.length&&this.owner.revisionsInternal.remove(o))}},e.prototype.isPasteRevertAction=function(){return!(t.isNullOrUndefined(this.editorHistory)||!this.editorHistory.currentBaseHistoryInfo||"Paste"!==this.editorHistory.currentBaseHistoryInfo.action)},e.prototype.toCheckForTrack=function(e){if(this.owner.enableTrackChanges&&!this.skipTracking()&&e instanceof xe&&e.childWidgets.length>0){var t=e.childWidgets[0].rowFormat;if(t.revisions.length>0&&"Insertion"!==t.revisions[0].revisionType&&t.revisions[0].author===(""===this.owner.currentUser?"Guest user":this.owner.currentUser)||0===t.revisions.length)return!0}return!1},e.prototype.removeFootnote=function(e,t){if(e.paragraph.bodyWidget.page.footnoteWidget){for(var i=e.paragraph.bodyWidget.page.footnoteWidget,n=0;n<i.childWidgets.length;n++)e===i.childWidgets[n].footNoteReference&&(i.height-=i.childWidgets[n].height,i.childWidgets.splice(n,1),n--);1===i.childWidgets.length&&(e.paragraph.bodyWidget.page.footnoteWidget=void 0)}this.documentHelper.footnoteCollection.splice(this.documentHelper.footnoteCollection.indexOf(e),1)},e.prototype.removeEndnote=function(e,t){if(e.paragraph.bodyWidget.page.endnoteWidget){for(var i=e.paragraph.bodyWidget.page.endnoteWidget,n=0;n<i.childWidgets.length;n++)e===i.childWidgets[n].footNoteReference&&(i.height-=i.childWidgets[n].height,i.childWidgets.splice(n,1),n--);1===i.childWidgets.length&&(e.paragraph.bodyWidget.page.endnoteWidget=void 0)}this.documentHelper.endnoteCollection.splice(this.documentHelper.endnoteCollection.indexOf(e),1)},e.prototype.removeAutoShape=function(e){var t=e.line.paragraph.floatingElements.indexOf(e);e.line.paragraph.bodyWidget.floatingElements.splice(e.line.paragraph.bodyWidget.floatingElements.indexOf(e),1),e.line.paragraph.floatingElements.splice(t,1)},e.prototype.removeField=function(e,t,i){var n=this.documentHelper.fields;if(t?n=this.documentHelper.bookmarks.keys:i&&(n=this.documentHelper.contentControlCollection),e.floatingElements.length>0)for(var r=0;r<e.floatingElements.length;r++){var o=e.floatingElements[r];this.removeAutoShape(o)}for(l=0;l<n.length;l++)(d=t?this.documentHelper.bookmarks.get(n[l]):n[l]).line.paragraph===e&&(t?this.documentHelper.bookmarks.remove(n[l]):i?this.documentHelper.contentControlCollection.splice(l,1):(this.documentHelper.fields.splice(l,1),-1!==this.documentHelper.formFields.indexOf(d)&&this.documentHelper.formFields.splice(this.documentHelper.formFields.indexOf(d),1)),l--);if(this.documentHelper.footnoteCollection.length>0)for(l=0;l<this.documentHelper.footnoteCollection.length;l++)if((d=this.documentHelper.footnoteCollection[l]).line.paragraph===e){if(d.paragraph.bodyWidget.page.footnoteWidget){for(var s=d.paragraph.bodyWidget.page.footnoteWidget,a=0;a<s.childWidgets.length;a++)d===s.childWidgets[a].footNoteReference&&(s.height-=s.childWidgets[a].height,s.childWidgets.splice(a,1),a--);1===s.childWidgets.length&&(d.paragraph.bodyWidget.page.footnoteWidget=void 0)}this.documentHelper.footnoteCollection.splice(l,1),l--}if(this.documentHelper.endnoteCollection.length>0)for(var l=0;l<this.documentHelper.endnoteCollection.length;l++){var d=this.documentHelper.endnoteCollection[l];if(d.line.paragraph===e){if(d.paragraph.bodyWidget.page.endnoteWidget){for(var h=d.paragraph.bodyWidget.page.endnoteWidget,a=0;a<h.childWidgets.length;a++)d===h.childWidgets[a].footNoteReference&&(h.height-=h.childWidgets[a].height,h.childWidgets.splice(a,1),a--);1===h.childWidgets.length&&(d.paragraph.bodyWidget.page.endnoteWidget=void 0)}this.documentHelper.endnoteCollection.splice(l,1),l--}}},e.prototype.addRemovedNodes=function(e){e instanceof vt&&0===e.commentType&&e.commentMark&&e.removeCommentMark(),e instanceof Me&&0===e.type&&this.documentHelper.contentControlCollection.splice(this.documentHelper.contentControlCollection.indexOf(e),1),e instanceof Ie&&0===e.fieldType&&(-1!==this.documentHelper.fields.indexOf(e)&&this.documentHelper.fields.splice(this.documentHelper.fields.indexOf(e),1),-1!==this.documentHelper.formFields.indexOf(e)&&this.documentHelper.formFields.splice(this.documentHelper.formFields.indexOf(e),1)),this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)?this.editorHistory.currentBaseHistoryInfo.removedNodes.push(e):this.editHyperlinkInternal&&this.nodes.push(e)},e.prototype.deleteBlock=function(e,t,i,n,r){if(e instanceof we){if(this.deletePara(e,i,n,r),this.delBlockContinue&&this.delBlock){if(this.delSection){var o=e.bodyWidget instanceof fe?e.bodyWidget:void 0;this.deleteSection(t,this.delSection,o,r),this.delSection=void 0}-1!==this.delBlock.indexInOwner&&this.deleteBlock(this.delBlock,t,i,n,r),this.delBlockContinue=!1,this.delBlock=void 0}}else this.deleteTableBlock(e,t,i,n,r)},e.prototype.deleteTableCell=function(e,i,n,r,o){var s=!(n.paragraph.isInsideTable&&e.ownerTable.contains(n.paragraph.associatedCell)),a=e.ownerTable.previousRenderedWidget;if(n.paragraph.isInsideTable){var l=i.getContainerCellOf(e,n.paragraph.associatedCell);if(l.ownerTable.contains(n.paragraph.associatedCell)){var d=i.getSelectedCell(e,l);i.getSelectedCell(n.paragraph.associatedCell,l);if(i.containsCell(l,n.paragraph.associatedCell))if(i.isCellSelected(l,n,r))if(this.updateEditPosition(l,i),1===o)this.deleteCellsInTable(e.ownerRow.ownerTable,i,n,r,o);else{var h=this.deleteCell(l,i,o,!0);!h&&2!==o&&this.editorHistory?this.editorHistory.currentBaseHistoryInfo=void 0:h&&this.documentHelper.layout.reLayoutTable(l.ownerRow.ownerTable)}else if(d===l){if(this.deletePara(r.paragraph,n,r,o),this.delBlockContinue&&this.delBlock){if(this.delSection){var c=r.paragraph,p=c.bodyWidget instanceof fe?c.bodyWidget:void 0;this.deleteSection(i,this.delSection,p,o),this.delSection=void 0}this.deleteBlock(this.delBlock,i,n,r,o),this.delBlockContinue=!1,this.delBlock=void 0}}else this.deleteContainer(d,i,n,r,o);else 2===o?this.deleteCell(e,i,2,!1):this.deleteCellsInTable(l.ownerTable,i,n,r,o)}else this.deleteContainer(l,i,n,r,o)}else{var g=i.getContainerCell(e);this.deleteContainer(g,i,n,r,o)}if(s){a.bodyWidget instanceof fe&&a.bodyWidget;t.isNullOrUndefined(a)||this.deleteBlock(a,i,n,r,o)}},e.prototype.deleteCellsInTable=function(e,i,r,o,s,a){var l="Delete",d=!1,h=r.paragraph.associatedCell,c=o.paragraph.associatedCell;if(t.isNullOrUndefined(a)||(c=a),this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)){if(l=this.editorHistory.currentBaseHistoryInfo.action,d="BackSpace"===this.editorHistory.currentBaseHistoryInfo.action||"DeleteCells"===this.editorHistory.currentBaseHistoryInfo.action||"InsertTable"===this.editorHistory.currentBaseHistoryInfo.action||"RemoveRowTrack"===this.editorHistory.currentBaseHistoryInfo.action||t.isNullOrUndefined(h.ownerRow.previousWidget)&&t.isNullOrUndefined(c.ownerRow.nextWidget)&&"Cut"===this.editorHistory.currentBaseHistoryInfo.action,this.cloneTableToHistoryInfo(e),"RemoveRowTrack"===this.editorHistory.currentBaseHistoryInfo.action)return;this.editorHistory.currentBaseHistoryInfo.action=d?"DeleteCells":"ClearCells",i.owner.isLayoutEnabled=!1}var p=h.columnIndex,g=c.columnIndex+c.cellFormat.columnSpan-1,u=h.rowIndex,m=c.rowIndex,f=this.isWholeRowSelected(h.ownerRow,p,g);if(this.owner.enableTrackChanges&&!this.skipTracking())if(f)this.onConfirmedTableCellsDeletion(e,i,u,m,p,g,d,s,f,l);else{var v=new t.L10n("documenteditor",this.owner.defaultLocale),y=v.getConstant("UnTrack"),b=v.getConstant("Merge Track");v.setLocale(this.owner.locale),this.alertDialog=n.DialogUtility.alert({title:y,content:b,showCloseIcon:!0,okButton:{text:"Ok",click:this.onConfirmedTableCellsDeletion.bind(this,e,i,u,m,p,g,d,s,f,l)},closeOnEscape:!0,position:{X:"center",Y:"center"},animationSettings:{effect:"Zoom"}})}else this.onConfirmedTableCellsDeletion(e,i,u,m,p,g,d,s,f,l)},e.prototype.removeDeletedCellRevision=function(e){e.rowFormat.revisions.length>0&&this.unlinkRangeFromRevision(e.rowFormat,!0);for(var i=0;i<e.childWidgets.length;i++)for(var n=e.childWidgets[i],r=0;r<n.childWidgets.length;r++){var o=n.childWidgets[r];if(!t.isNullOrUndefined(o)&&o instanceof we){for(var s=0;s<o.childWidgets.length;s++){var a=o.childWidgets[s];if(!t.isNullOrUndefined(a.children))for(var l=0;l<a.children.length;l++){var d=a.children[l];d.revisions.length>0&&this.unlinkRangeFromRevision(d,!0)}}this.unlinkRangeFromRevision(o.characterFormat,!0)}}},e.prototype.onConfirmedTableCellsDeletion=function(e,i,n,r,o,s,a,l,d,h){for(var c=0;c<e.childWidgets.length;c++){var p=e.childWidgets[c],g=!1;if(p.index>=n&&p.index<=r&&(this.owner.enableTrackChanges&&!this.skipTracking()&&d?(g=this.trackRowDeletion(p,!1))&&this.onConfirmedCellDeletion(p,i,n,r,o,s,a,l):this.onConfirmedCellDeletion(p,i,n,r,o,s,a,l)),!g&&0===p.childWidgets.length){for(var u=e.childWidgets[c],m=u.previousRenderedWidget;!t.isNullOrUndefined(m);){for(var f=0;f<m.childWidgets.length;f++){var v=m.childWidgets[f];u.rowIndex<v.ownerRow.rowIndex+v.cellFormat.rowSpan&&v.cellFormat.rowSpan--}m=m.previousRenderedWidget}this.updateNextBlocksIndex(u,!1),e.childWidgets.splice(c,1),c--,r--}}if(i.owner.isLayoutEnabled=!0,0===e.childWidgets.length?(i.editPosition=this.selection.getHierarchicalIndex(e,"0"),this.setActionInternal(i,h),this.removeBlock(e)):(e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0,this.documentHelper.layout.reLayoutTable(e)),!t.isNullOrUndefined(this.alertDialog)){var y=i.getTextPosBasedOnLogicalIndex(i.editPosition);i.selectContent(y,!0),this.reLayout(i),this.alertDialog.close(),this.alertDialog=void 0}},e.prototype.onConfirmedCellDeletion=function(e,t,i,n,r,o,s,a){var l=!1;this.removeDeletedCellRevision(e);for(var d=0;d<e.childWidgets.length;d++){var h=e.childWidgets[d];if(h.columnIndex>=r&&h.columnIndex<=o)if(l||(this.updateEditPosition(h,t),l=!0),s){var c=e.childWidgets[d];this.updateNextBlocksIndex(c,!1),e.childWidgets.splice(d,1),d--}else a<4&&this.deleteCell(h,t,a,!1)}},e.prototype.removeRevisionForRow=function(e){e.rowFormat.revisions.length>0&&this.skipTracking()&&(this.unlinkRangeFromRevision(e.rowFormat,!0),this.addRemovedRevisionInfo(e.rowFormat,void 0))},e.prototype.removeRevisionsInRow=function(e){if(e.rowFormat.revisions.length>0)for(var t=0;t<e.rowFormat.revisions.length;t++){var i=e.rowFormat.revisions[t];this.unlinkWholeRangeInRevision(e.rowFormat,i)}},e.prototype.removeRevisionForCell=function(e,i){for(var n=0;n<e.childWidgets.length;n++)if(e.childWidgets[n]instanceof we)for(var r=e.childWidgets[n],o=0;o<r.childWidgets.length;o++)for(var s=r.childWidgets[o],a=0;a<s.children.length;a++){var l=s.children[a];!t.isNullOrUndefined(l)&&l.revisions.length>0&&(this.unlinkRangeFromRevision(l,i),this.addRemovedRevisionInfo(l,void 0))}else e.childWidgets[n]instanceof xe&&this.removeRevisionForInnerTable(e.childWidgets[n])},e.prototype.removeRevisionForInnerTable=function(e){if(e.childWidgets.length>0)for(var i=0;i<e.childWidgets.length;i++){var n=e.childWidgets[i];t.isNullOrUndefined(n)||this.removeRevisionForRow(n)}},e.prototype.removeRevisionForBlock=function(e,i,n,r){if(e.characterFormat.revisions.length>0&&!n&&(r&&this.addRemovedRevisionInfo(e.characterFormat,void 0,!1),t.isNullOrUndefined(i)?this.unlinkRangeFromRevision(e.characterFormat,!0):this.unlinkRangeByRevision(e.characterFormat,i),e.characterFormat.revisions=[]),!t.isNullOrUndefined(e))for(var o=0;o<e.childWidgets.length;o++)for(var s=e.childWidgets[o],a=0;a<s.children.length;a++){var l=s.children[a];!t.isNullOrUndefined(l)&&l.revisions.length>0&&(r&&this.addRemovedRevisionInfo(l,void 0,!1),t.isNullOrUndefined(i)?this.unlinkRangeFromRevision(l,!0):this.unlinkRangeByRevision(l,i),l.revisions=[])}},e.prototype.unlinkRangeByRevision=function(e,t){for(var i=0;i<e.revisions.length;i++){var n=e.revisions[i];if(n.author===t.author&&n.revisionType===t.revisionType){e.revisions.splice(e.revisions.indexOf(t),1);var r=t.range.indexOf(e);t.range.splice(r,1)}}},e.prototype.isWholeRowSelected=function(e,t,i){var n=t+i;return 0===t&&e.childWidgets.length-1===n},e.prototype.deleteCell=function(e,t,i,n){var r=e.childWidgets[0],o=[];if(1===e.childWidgets.length&&r instanceof we&&r.isEmpty())return!1;for(var s=0;s<e.childWidgets.length;s++)if(r=e.childWidgets[s],i<4){if(r instanceof we&&1===e.childWidgets.length){var a=r;o=this.paragrapghBookmarkCollection(a,o);for(c=0;c<a.childWidgets.length;c++){for(var l=a.childWidgets[c],d=0;d<l.children.length;d++){var h=l.children[d];this.unLinkFieldCharacter(h),l.children.splice(d,1),d--,this.checkClearCells(t)&&this.addRemovedNodes(h)}a.childWidgets.length>1&&(a.childWidgets.splice(c,1),c--)}this.checkClearCells(t)&&(t.editPosition=this.selection.getHierarchicalIndex(a,"0"),this.updateHistoryPosition(t.editPosition,!0));break}r instanceof we&&(o=this.paragrapghBookmarkCollection(r,o)),this.removeBlock(r),s--,this.checkClearCells(t)&&this.addRemovedNodes(r)}for(var c=0;c<o.length;c++)e.childWidgets[0].childWidgets[0].children.push(o[c]),e.childWidgets[0].childWidgets[0].children.push(o[c].reference),o[c].line=e.childWidgets[0].childWidgets[0],o[c].reference.line=e.childWidgets[0].childWidgets[0],this.documentHelper.bookmarks.add(o[c].name,o[c]);return!0},e.prototype.paragrapghBookmarkCollection=function(e,t){for(var i=this.documentHelper.bookmarks,n=0;n<i.length;n++){var r=this.documentHelper.bookmarks.get(i.keys[n]);r.paragraph===e&&t.push(r)}return t},e.prototype.deleteContainer=function(e,t,i,n,r){var o=e.ownerTable;if(t.containsRow(o.lastChild,n.paragraph.associatedCell))this.deleteContent(o,t,r);else if(this.toCheckForTrack(o))for(a=0;a<o.childWidgets.length;a++){var s=o.childWidgets[a];if(this.trackRowDeletion(s),n.paragraph.isInsideTable&&t.containsRow(s,n.paragraph.associatedCell))return void this.documentHelper.layout.reLayoutTable(o)}else for(var a=0;a<o.childWidgets.length;a++){var l=o.childWidgets[a];if(r<4&&(this.updateNextBlocksIndex(l,!1),o.childWidgets.splice(a,1),this.addRemovedNodes(l),a--),n.paragraph.isInsideTable&&t.containsRow(l,n.paragraph.associatedCell))return void this.documentHelper.layout.reLayoutTable(o)}},e.prototype.deleteTableBlock=function(e,i,n,r,o){if(e=e.combineWidget(this.owner.viewer),n.paragraph.isInsideTable&&e.contains(n.paragraph.associatedCell)){var s=e.previousRenderedWidget,a=this.checkAndInsertBlock(e,n,r,o,s instanceof we?s:void 0);if(i.containsRow(e.firstChild,n.paragraph.associatedCell))this.deleteContent(e,i,o);else if(this.owner.enableTrackChanges){if(t.isNullOrUndefined(r.paragraph.associatedCell)&&!r.paragraph.isInsideTable){var l=r.paragraph.previousRenderedWidget.lastChild.lastChild;this.deleteCellsInTable(e,i,n,r,o,l)}}else{var d=this.splitTable(e,n.paragraph.associatedCell.ownerRow);this.deleteContent(e,i,o),this.documentHelper.layout.layoutBodyWidgetCollection(d.index,d.containerWidget,d,!1)}t.isNullOrUndefined(a)||(i.editPosition=this.selection.getHierarchicalIndex(a,"0"),this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&(this.editorHistory.currentBaseHistoryInfo.endPosition=i.editPosition))}else{var h=e.previousRenderedWidget;e.bodyWidget instanceof fe&&e.bodyWidget;if(this.owner.enableTrackChanges)for(var c=0;c<e.childWidgets.length;c++)this.trackRowDeletion(e.childWidgets[c]);else this.deleteContent(e,i,o);t.isNullOrUndefined(h)||this.deleteBlock(h,i,n,r,o)}},e.prototype.splitTable=function(e,t){var i=new xe;i.tableFormat.copyFormat(e.tableFormat),i.index=e.index;for(var n=0;n<e.childWidgets.length;n++){var r=e.childWidgets[n];if(r===t)break;i.childWidgets.push(r),r.containerWidget=i,e.childWidgets.splice(n,1),n--}var o=e.getIndex();return e.containerWidget.childWidgets.splice(o,0,i),i.containerWidget=e.containerWidget,this.updateNextBlocksIndex(i,!0),i},e.prototype.updateEditPosition=function(e,t){var i=t.getFirstParagraphInCell(e);t.editPosition=this.selection.getHierarchicalIndex(i,"0")},e.prototype.deleteContent=function(e,t,i){i<4&&(this.removeBlock(e),this.addRemovedNodes(e))},e.prototype.setActionInternal=function(e,i){this.documentHelper.owner.enableHistoryMode&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&(this.editorHistory.currentBaseHistoryInfo.action=i)},e.prototype.checkClearCells=function(e){return this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&"ClearCells"!==this.editorHistory.currentBaseHistoryInfo.action},e.prototype.isEndInAdjacentTable=function(e,t){var i=this.selection.getHierarchicalIndex(e,""),n=this.selection.getHierarchicalIndex(t,""),r=i.split(";"),o=n.split(";");return r.length<o.length},e.prototype.cloneTableToHistoryInfo=function(e){if(this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)){var i=e.clone();return this.editorHistory.currentBaseHistoryInfo.removedNodes.push(i),this.documentHelper.selection.start.paragraph.isInsideTable&&this.documentHelper.selection.start.paragraph.associatedCell.ownerTable===e&&this.updateHistoryPosition(this.selection.getHierarchicalIndex(e,"0"),!0),i}},e.prototype.insertParagraphPaste=function(e,i,n,r,o,s){if(this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&"Paste"===this.editorHistory.currentBaseHistoryInfo.action){var a=this.selection.getNextParagraphBlock(i);if(a&&n.offset>0&&a===r.paragraph&&e===n.paragraph&&"Paste"===this.editorHistory.currentBaseHistoryInfo.action){var l=0;this.removeBlock(i),this.documentHelper.layout.clearListElementBox(a),this.documentHelper.layout.clearListElementBox(i);for(var d=0;d<i.childWidgets.length;d++){var h=i.childWidgets[d];a.childWidgets.splice(l,0,h),i.childWidgets.splice(d,1),d--,l++,h.paragraph=a}this.documentHelper.layout.reLayoutParagraph(a,0,0),o=!1;var c=this.selection.editPosition.substring(this.selection.editPosition.lastIndexOf(";")+1);this.selection.editPosition=this.selection.getHierarchicalIndex(a,c)}}o&&this.deleteParagraphMark(i,this.selection,s)},e.prototype.removeInlines=function(e,t,i,n,r,o){var s=!1;this.documentHelper.layout.clearListElementBox(e);e.childWidgets.indexOf(t);for(var a=this.selection.start.clone(),l=this.selection.end.clone(),d=this.selection.editPosition,h=e.childWidgets.length-1;h>=0;h--){var c=e.childWidgets[h];if(t===c&&n===c){this.removeContent(c,i,r,o),s=!0;break}if(n===c)s=!0,this.removeContent(c,0,r,o);else{if(t===c){this.removeContent(c,i,this.documentHelper.selection.getLineLength(c),o);break}s&&this.removeContent(c,0,this.documentHelper.selection.getLineLength(c),o)}}if(this.owner.enableTrackChanges&&!this.skipTracking()){if(this.selection.start.setPositionInternal(a),this.selection.end.setPositionInternal(l),this.editorHistory.currentBaseHistoryInfo&&"Delete"===this.editorHistory.currentBaseHistoryInfo.action){a.offset>l.offset&&(l=a);var p=this.selection.getParagraphInfo(l);d=this.selection.getHierarchicalIndex(p.paragraph,p.offset.toString())}this.skipReplace&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=void 0,this.updateInsertPosition()),this.selection.editPosition=d}s&&(this.removeEmptyLine(e),this.documentHelper.layout.reLayoutParagraph(e,0,0))},e.prototype.skipTracking=function(){return!(t.isNullOrUndefined(this.editorHistory)||!this.editorHistory.isUndoing&&!this.editorHistory.isRedoing)||!(t.isNullOrUndefined(this.editorHistory)||!this.editorHistory.currentBaseHistoryInfo||"Reject Change"!==this.editorHistory.currentBaseHistoryInfo.action&&"Accept Change"!==this.editorHistory.currentBaseHistoryInfo.action)},e.prototype.canHandleDeletion=function(){return!(t.isNullOrUndefined(this.editorHistory)||!this.editorHistory.currentBaseHistoryInfo||"DeleteRow"!==this.editorHistory.currentBaseHistoryInfo.action)},e.prototype.deleteCommentInSelection=function(e){var t=this.editorHistory.currentBaseHistoryInfo;!this.editorHistory||!this.editorHistory.currentBaseHistoryInfo||this.editorHistory.currentHistoryInfo||this.editorHistory.isUndoing||this.editorHistory.isRedoing||this.initComplexHistory("DeleteCommentInline"),this.deleteCommentInternal(e),this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing||this.editorHistory.currentHistoryInfo.addModifiedAction(t),this.selection.editPosition=t.insertPosition,this.editorHistory.currentHistoryInfo.insertPosition=this.selection.editPosition,this.editorHistory.currentBaseHistoryInfo=t)},e.prototype.removeContent=function(e,i,n,r){for(var o=this.selection.getLineLength(e),s=e.paragraph.paragraphFormat.bidi,a=void 0,l=0,d=void 0,h=[],c=s?0:e.children.length-1;s?c<e.children.length:c>=0;s?c++:c--){var p=e.children[c];if(t.isNullOrUndefined(r)||2!==r)for(var g=0;g<e.children.length;g++){var u=e.children[g];if(u instanceof Oe){var m=u.text;m.length+l>i&&!(l>i)&&(a=m[i-l-1],t.isNullOrUndefined(a)&&i-l==0&&(a=d)),m.length+l>n&&(" "===m[n-l]&&0===i||" "===a&&" "===m[n-l])&&(n+=1),d=m[m.length-1]}l+=u.length}if(n<=o-p.length)o-=p.length;else{var f=p.length;o>n&&o-f<n&&(f=n-(o-p.length));var v=0;if(o-p.length<i&&(v=i-(o-p.length)),o>n&&(o-=p.length-f),0===v&&f===p.length){if(this.editorHistory&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing)||(p instanceof Ae&&this.removedBookmarkElements.push(p),!this.isCmtDeleteStarted&&p instanceof vt&&1===p.commentType&&(this.deleteCommentWidgetInline(p),h.push(p))),!this.isCmtDeleteStarted&&p instanceof vt&&0==p.commentType&&-1===h.indexOf(p.comment.commentEnd)&&this.editorHistory&&(!this.editorHistory||!this.editorHistory.currentHistoryInfo||this.editorHistory&&this.editorHistory.currentHistoryInfo&&"DeleteComment"!=this.editorHistory.currentHistoryInfo.action)){this.skipCommentCharacter(p),this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.insertPosition=this.selection.editPosition),i++;continue}if(p instanceof Ae&&this.documentHelper.bookmarks.containsKey(p.name)&&this.documentHelper.bookmarks.remove(p.name),p instanceof Ge&&"Inline"!==p.textWrappingStyle&&this.removeAutoShape(p),this.skipFieldDeleteTracking&&p.revisions.length>0){var y=p;y instanceof Ie&&(1!==y.fieldType&&2!==y.fieldType||(y=y.fieldBegin),this.clearFieldElementRevisions(y,p.revisions))}this.canHandleDeletion()||this.owner.enableTrackChanges&&!this.skipTracking()&&!this.skipFieldDeleteTracking?(this.skipTableElements||this.addRemovedNodes(p.clone()),this.handleDeleteTracking(p,i,n,c)):(this.unLinkFieldCharacter(p),this.unlinkRangeFromRevision(p,!0),this.addRemovedRevisionInfo(p,void 0),this.addRemovedNodes(p),e.children.splice(c,1)),s&&(this.isSkipHistory?c--:c++)}else if(p instanceof Oe){var b=this.handleDeleteTracking(p,v,f);t.isNullOrUndefined(b)||this.skipTableElements||(p.revisions.length>0&&this.addRemovedRevisionInfo(p,b),this.addRemovedNodes(b))}if(p instanceof Le&&("Footnote"===p.footnoteType?this.removeFootnote(p):this.removeEndnote(p)),i>=o-(f-v))break;o-=f-v,this.documentHelper.layout.clearListElementBox(e.paragraph)}}h=[],!this.editorHistory||!this.editorHistory.currentHistoryInfo||0!=this.removeCommentCharacters.length||this.isCmtDeleteStarted||this.editorHistory.isUndoing||this.editorHistory.isRedoing||this.editorHistory.updateComplexHistoryInternal()},e.prototype.skipCommentCharacter=function(e){var t=this.editorHistory.currentBaseHistoryInfo;if(!this.editorHistory.currentBaseHistoryInfo||this.editorHistory.currentHistoryInfo||this.editorHistory.isUndoing||this.editorHistory.isRedoing||(this.initComplexHistory("SkipCommentInline"),this.editorHistory.updateHistory(),this.initHistory(t.action)),this.editorHistory.currentHistoryInfo&&"DeleteComment"!==this.editorHistory.currentHistoryInfo.action&&!this.editorHistory.isUndoing&&!this.editorHistory.isRedoing){var i=e.line.getOffset(e,1),n=new kt(this.owner);n.setPositionParagraph(e.line,i);var r=this.selection.getHierarchicalIndexByPosition(n);this.selection.isForward?(this.editorHistory.currentBaseHistoryInfo.selectionEnd=r,t.selectionStart=r,this.editorHistory.currentHistoryInfo.selectionEnd=t.selectionEnd):(this.editorHistory.currentBaseHistoryInfo.selectionStart=r,t.selectionEnd=r,this.editorHistory.currentHistoryInfo.selectionStart=t.selectionStart),t.insertPosition=this.selection.isForward?t.selectionStart:t.selectionEnd,t.endPosition=t.insertPosition,this.editorHistory.currentHistoryInfo.insertPosition=t.insertPosition;var o=this.editorHistory.currentBaseHistoryInfo;o.insertPosition=this.selection.isForward?o.selectionStart:o.selectionEnd,o.endPosition=o.insertPosition,this.editorHistory.currentHistoryInfo.addModifiedAction(o)}},e.prototype.deleteCommentWidgetInline=function(e){var t=this.editorHistory.currentBaseHistoryInfo;if(this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&!this.editorHistory.currentHistoryInfo&&this.initComplexHistory("DeleteCommentInline"),this.selection.isElementInSelection(e.comment.commentStart)||this.removeCommentCharacters.push(e.comment.commentStart),this.deleteCommentWidgetInternal(e.comment),this.editorHistory&&this.editorHistory.currentHistoryInfo)this.editorHistory.currentHistoryInfo.modifiedActions[0];this.editorHistory.currentHistoryInfo.addModifiedAction(t),this.editorHistory.currentBaseHistoryInfo=t,this.selection.editPosition=t.insertPosition,this.editorHistory.currentHistoryInfo.insertPosition=t.insertPosition,this.editorHistory.currentHistoryInfo.endPosition=t.insertPosition,this.editorHistory.currentHistoryInfo.selectionStart=t.selectionStart,this.editorHistory.currentHistoryInfo.selectionEnd=t.selectionEnd},e.prototype.clearFieldElementRevisions=function(e,t){for(var i=t,n=0;n<i.length;n++)for(var r=i[n],o=0;o<r.range.length;o++)if(r.range[o]===e)for(var s=o;s<r.range.length;s){if(r.range[o]instanceof Ie&&1===r.range[o].fieldType&&r.range[o].fieldBegin===e){r.removeRangeRevisionForItem(r.range[o]),0===r.range.length&&this.owner.revisions.remove(r);break}r.removeRangeRevisionForItem(r.range[o])}},e.prototype.addRemovedRevisionInfo=function(e,i,n){for(var r=0;r<e.revisions.length;r++){var o=e.revisions[r].revisionID;t.isNullOrUndefined(i)?e.removedIds.push(o):i.removedIds.push(o)}t.isNullOrUndefined(i)&&(t.isNullOrUndefined(n)||n)&&(e.revisions=[])},e.prototype.removeEmptyLine=function(e){if(e.childWidgets.length>1)for(var t=0;t<e.childWidgets.length;t++)0===e.childWidgets[t].children.length&&e.childWidgets.length>1&&(e.childWidgets.splice(t,1),t--)},e.prototype.cloneListLevel=function(e){var t=new K(void 0);return this.copyListLevel(t,e),t},e.prototype.copyListLevel=function(e,i){t.isNullOrUndefined(i.paragraphFormat)||(e.paragraphFormat=new I(e),e.paragraphFormat.copyFormat(i.paragraphFormat)),t.isNullOrUndefined(i.characterFormat)||(e.characterFormat=new k(e),e.characterFormat.copyFormat(i.characterFormat)),t.isNullOrUndefined(i.followCharacter)||(e.followCharacter=i.followCharacter),t.isNullOrUndefined(i.listLevelPattern)||(e.listLevelPattern=i.listLevelPattern),t.isNullOrUndefined(i.numberFormat)||(e.numberFormat=i.numberFormat),t.isNullOrUndefined(i.restartLevel)||(e.restartLevel=i.restartLevel),t.isNullOrUndefined(i.startAt)||(e.startAt=i.startAt)},e.prototype.cloneLevelOverride=function(e){var i=new F;return t.isNullOrUndefined(e.startAt)||(i.startAt=e.startAt),t.isNullOrUndefined(e.overrideListLevel)||(i.overrideListLevel=e.overrideListLevel),t.isNullOrUndefined(e.levelNumber)||(i.levelNumber=e.levelNumber),i},e.prototype.updateListParagraphs=function(){this.documentHelper.listParagraphs=[];for(var e=0;e<this.documentHelper.pages.length;e++)for(var t=this.documentHelper.pages[e].bodyWidgets[0],i=0;i<t.childWidgets.length;i++)this.updateListParagraphsInBlock(t.childWidgets[i])},e.prototype.updateListParagraphsInBlock=function(e){if(e instanceof we)t.isNullOrUndefined(e.paragraphFormat)||t.isNullOrUndefined(e.paragraphFormat.listFormat)||t.isNullOrUndefined(e.paragraphFormat.listFormat.listId)||(t.isNullOrUndefined(this.documentHelper.listParagraphs)&&(this.documentHelper.listParagraphs=[]),this.documentHelper.listParagraphs.push(e));else if(e instanceof xe)for(var i=0;i<e.childWidgets.length;i++)for(var n=0;n<e.childWidgets[i].childWidgets.length;n++)for(var r=e.childWidgets[i].childWidgets[n],o=0;o<r.childWidgets.length;o++)this.updateListParagraphsInBlock(r.childWidgets[o])},e.prototype.onApplyList=function(e){var i=this.documentHelper.selection;this.setOffsetValue(this.documentHelper.selection),this.initHistory("ListFormat");var n=new T;t.isNullOrUndefined(e)||(n.listId=e.listId),this.documentHelper.owner.isShiftingEnabled=!0,i.isEmpty?(this.applyParaFormatProperty(i.start.paragraph,"listFormat",n,!1),this.layoutItemBlock(i.start.paragraph,!1)):this.updateSelectionParagraphFormatting("listFormat",n,!1),this.reLayout(i)},e.prototype.applyBulletOrNumbering=function(e,i,n){var r=this.documentHelper.selection,o=r.paragraphFormat.getList(),s=!1,a=r.start;r.isForward||(a=r.end);var l=a.paragraph;if(t.isNullOrUndefined(o)){for(;!t.isNullOrUndefined(l.previousWidget)&&l.previousWidget instanceof we&&l.previousWidget.isEmpty()&&-1===l.previousWidget.paragraphFormat.listFormat.listId;)l=l.previousWidget;if(l.previousWidget&&l.previousWidget instanceof we&&-1!==l.previousWidget.paragraphFormat.listFormat.listId&&(l=l.previousWidget,o=this.documentHelper.getListById(l.paragraphFormat.listFormat.listId),s=!0),!s){for(;!t.isNullOrUndefined(l.nextWidget)&&l.nextWidget instanceof we&&l.nextWidget.isEmpty()&&-1===l.nextWidget.paragraphFormat.listFormat.listId;)l=l.nextWidget;l.nextWidget&&l.nextWidget instanceof we&&-1!==l.nextWidget.paragraphFormat.listFormat.listId&&(l=l.nextWidget,o=this.documentHelper.getListById(l.paragraphFormat.listFormat.listId),s=!0)}}var d=void 0,h=-1,c=void 0,p=!1;if(-1===l.paragraphFormat.listFormat.listId||t.isNullOrUndefined(l.paragraphFormat.listFormat.listLevel)||(this.listNumberFormat=l.paragraphFormat.listFormat.listLevel.numberFormat,this.listLevelPattern=l.paragraphFormat.listFormat.listLevel.listLevelPattern,this.listLevelNumber=l.paragraphFormat.listFormat.listLevelNumber),!t.isNullOrUndefined(o)){h=l.paragraphFormat.listFormat.listLevelNumber;u=this.documentHelper.getListById(l.paragraphFormat.listFormat.listId);if(d=this.documentHelper.layout.getListLevel(u,h),h>0&&(c=this.documentHelper.layout.getListLevel(u,0),p=!t.isNullOrUndefined(c)&&h>0&&r.start.isInSameParagraph(r.end)),(g=u.abstractList)||(g=this.documentHelper.getAbstractListById(o.abstractListId)),0===g.levels.length&&(d=this.documentHelper.layout.getListLevel(u,l.paragraphFormat.listFormat.listLevelNumber)),s){if("Bullet"!==i&&d.listLevelPattern===i&&(d.numberFormat===e||-1!==d.numberFormat.indexOf(e)))return r.paragraphFormat.listId=o.listId,r.paragraphFormat.listLevelNumber=h,void r.paragraphFormat.setList(o);d=g.levels[0]}}if(t.isNullOrUndefined(o)||!t.isNullOrUndefined(o)&&0===h&&(d.listLevelPattern!==i||d.numberFormat!==e||d.characterFormat.fontFamily!==n&&"Bullet"===d.listLevelPattern)){s=!1,o=new P,this.documentHelper.lists.length>0?o.listId=this.documentHelper.lists[this.documentHelper.lists.length-1].listId+1:o.listId=0;var g=new G;this.documentHelper.abstractLists.length>0?g.abstractListId=this.documentHelper.abstractLists[this.documentHelper.abstractLists.length-1].abstractListId+1:g.abstractListId=0,o.abstractListId=g.abstractListId,o.abstractList=g,this.documentHelper.abstractLists.push(g),"bullet"===e||"multiLevel"===e||"numbering"===e?this.addListLevels(g,e,r):((m=new K(g)).listLevelPattern=i,m.numberFormat=e,"Bullet"!==i?m.startAt=1:m.characterFormat.fontFamily=n,m.paragraphFormat.leftIndent=36,m.paragraphFormat.firstLineIndent=-18,g.levels.push(m),r.paragraphFormat.listLevelNumber=0),r.paragraphFormat.setList(o)}else if(p&&!t.isNullOrUndefined(o)){var u=this.documentHelper.getListById(l.paragraphFormat.listFormat.listId),m=this.documentHelper.layout.getListLevel(u,h);if("Bullet"===i)m.numberFormat=e,m.characterFormat.fontFamily=n;else{m.listLevelPattern=i,m.characterFormat.fontFamily=n;var f=m.numberFormat.substring(m.numberFormat.length-1);m.numberFormat.length!==e.length&&h>0?m.numberFormat=e:e.substring(e.length-1)!==m.numberFormat.substring(m.numberFormat.length-1)&&(m.numberFormat=m.numberFormat.replace(f,e.substring(e.length-1)))}r.paragraphFormat.setList(u)}else!t.isNullOrUndefined(o)&&s?r.paragraphFormat.setList(o):r.paragraphFormat.setList(void 0)},e.prototype.addListLevels=function(e,t,i){for(var n=["","","","",""],r=e.levels.length;r<9;r++){var o=new K(e);if(t.match("bullet"))o.listLevelPattern="Bullet",o.numberFormat=n[r<5?r%5:r%5+1],o.characterFormat.fontFamily=r<3||5===r?"Wingdings":"Symbol";else{if(t.match("multiLevel")){for(var s=0;s<r+1;s++)o.numberFormat+="%"+(s+1).toString()+".";o.listLevelPattern="Number"}else o.numberFormat="%"+(r+1).toString()+")",o.listLevelPattern=r%3==0?"Number":r%3==1?"LowLetter":"LowRoman";o.startAt=1,o.restartLevel=r}o.paragraphFormat.leftIndent=0===r?36:36*r,o.paragraphFormat.firstLineIndent=-18,e.levels.push(o),i.paragraphFormat.listLevelNumber=r}},e.prototype.insertPageBreak=function(){if(!this.owner.isReadOnlyMode){if(this.documentHelper.selection.start.paragraph.isInsideTable||this.documentHelper.selection.start.paragraph.isInHeaderFooter)return;this.initComplexHistory("PageBreak"),this.onEnter(!0),this.editorHistory&&null!==this.editorHistory.currentHistoryInfo&&this.editorHistory.updateComplexHistory(),this.selection.checkForCursorVisibility()}},e.prototype.onEnter=function(e){var i=this.documentHelper.selection,n=new Tt(this.selection);if(n.cloneFormat(this.selection.characterFormat),!this.isXmlMapped){if(i.isEmpty){var r=i.getHyperlinkField();if(!t.isNullOrUndefined(r))return void i.fireRequestNavigate(r);if((f=i.start.paragraph).isEmpty()&&-1!==f.paragraphFormat.listFormat.listId)return void this.onApplyListInternal(this.documentHelper.getListById(f.paragraphFormat.listFormat.listId),f.paragraphFormat.listFormat.listLevelNumber-1)}this.initHistory("Enter");var o=!0;if(i.isEmpty||(o=this.removeSelectedContents(i)),o){i.owner.isShiftingEnabled=!0,this.updateInsertPosition();var s=this.selection.getParagraphInfo(i.start),a=this.selection.getHierarchicalIndex(s.paragraph,s.offset.toString());if(this.splitParagraphInternal(i,i.start.paragraph,i.start.currentWidget,i.start.offset),this.setPositionForCurrentIndex(i.start,a),e){var l=i.start.paragraph,d=new we;d.characterFormat.copyFormat(l.characterFormat),d.paragraphFormat.copyFormat(l.paragraphFormat);var h=new Oe;h.text="\f";var c=new Te(d);if(c.children.push(h),h.line=c,d.childWidgets.push(c),this.owner.enableTrackChanges&&l.characterFormat.revisions.length>0){var p=this.retrieveRevisionInOder(l.characterFormat);p.range.push(d.characterFormat),d.characterFormat.revisions.push(p),d.characterFormat.removedIds=[]}this.insertParagraph(d,!0),i.selectParagraphInternal(d,!0)}var g=i.start.paragraph.nextWidget;t.isNullOrUndefined(g)&&(g=i.getNextRenderedBlock(i.start.paragraph)),i.selectParagraphInternal(g,!0),this.updateEndPosition(),e&&this.editorHistory&&this.owner.editorHistory.updateHistory(),this.reLayout(i);var u=this.selection.start.paragraph.containerWidget.firstChild;if(!t.isNullOrUndefined(u)){u.isChangeDetected=!1;for(var m=u.nextRenderedWidget;this.owner.isSpellCheck&&!t.isNullOrUndefined(m);)(u=m).isChangeDetected=!1,m=u.nextRenderedWidget}var f=i.start.paragraph.previousWidget;!t.isNullOrUndefined(f)&&!f.isEmpty()&&f.lastChild.children[f.lastChild.children.length-1]instanceof Oe&&this.checkAndConvertToHyperlink(i,!0,f)}!t.isNullOrUndefined(i.start.paragraph)&&i.start.paragraph.isEmpty()&&this.selection.characterFormat.cloneFormat(n)}},e.prototype.splitParagraphInternal=function(e,i,n,r){var o=0,s=i.index,a=i;for(a.isChangeDetected=0===r;this.owner.isSpellCheck&&!t.isNullOrUndefined(a.nextRenderedWidget);)(a=a.nextRenderedWidget).isChangeDetected=!0;var l=new we,d=new Te(l);if(l.childWidgets.push(d),l.paragraphFormat.ownerBase=l,l.footNoteReference=i.footNoteReference,n===i.lastChild&&r===e.getLineLength(n)){if(i.paragraphFormat.baseStyle&&"Normal"!==i.paragraphFormat.baseStyle.name&&i.paragraphFormat.baseStyle.next instanceof U?(i.paragraphFormat.baseStyle.name===i.paragraphFormat.baseStyle.next.name?(l.paragraphFormat.copyFormat(i.paragraphFormat),l.characterFormat.copyFormat(i.characterFormat)):l.paragraphFormat.baseStyle=i.paragraphFormat.baseStyle.next,this.selection.skipFormatRetrieval=!1):(l.paragraphFormat.copyFormat(i.paragraphFormat),l.characterFormat.copyFormat(i.characterFormat)),i.lastChild.children.length>0&&i.characterFormat.copyFormat(i.lastChild.children[i.lastChild.children.length-1].characterFormat),this.owner.enableTrackChanges){var h=i.lastChild;if(!t.isNullOrUndefined(h)&&h.children.length>0){var c=h.children[h.children.length-1].previousValidNodeForTracking;this.checkParaMarkMatchedWithElement(c,i.characterFormat,!1,"Insertion")||this.insertParaRevision(i)}}o++,s++}else{if(l.paragraphFormat.copyFormat(i.paragraphFormat),l.characterFormat.copyFormat(i.characterFormat),r>0||!n.isFirstLine())i=i.combineWidget(this.owner.viewer),this.moveInlines(i,l,0,0,i.firstChild,r,n),this.insertParaRevision(l,i.firstChild);else if(this.owner.enableTrackChanges){var p=i.firstChild.children[0].previousValidNodeForTracking;this.checkParaMarkMatchedWithElement(p,l.characterFormat,!0,"Insertion")||this.insertParaRevision(l)}i=i.getSplitWidgets()[0]}o+=i.getIndex();var g=i.containerWidget;g.childWidgets.splice(o,0,l),this.owner.enableTrackChanges&&0===l.characterFormat.revisions.length&&0===i.characterFormat.revisions.length&&(this.checkToMatchEmptyParaMark(i)||this.insertParaRevision(i)),l.containerWidget=g,l.index=s,this.updateNextBlocksIndex(l,!0),this.documentHelper.layout.layoutBodyWidgetCollection(s,g,l,!1)},e.prototype.insertParaRevision=function(e,i){if(this.owner.enableTrackChanges&&t.isNullOrUndefined(i)&&!this.isRevisionMatched(e.characterFormat,"Insertion")&&(e.characterFormat.revisions=[],this.insertRevision(e.characterFormat,"Insertion")),!t.isNullOrUndefined(i)){if(i.paragraph.isInsideTable)return void this.insertRevision(e.characterFormat,"Insertion");this.applyRevisionForParaMark(e,i,"Insertion",!0)}},e.prototype.applyRevisionForParaMark=function(e,i,n,r){var o=i.children[0];if(!t.isNullOrUndefined(o)){o=o.nextValidNodeForTracking;var s=e.lastChild,a=0===s.children.length?void 0:s.children[s.children.length-1].previousValidNodeForTracking,l=!1,d=e.characterFormat.revisions.length;if(t.isNullOrUndefined(a)||(l=this.checkParaMarkMatchedWithElement(a,e.characterFormat,!1,n)),!t.isNullOrUndefined(o))if(e.characterFormat.revisions.length>d){if(this.isRevisionMatched(o,n))for(var h=e.characterFormat.revisions[0],c=this.getMatchedRevisionsToCombine(o.revisions,n),p=0;p<c.length;p++)c[p]!==h&&(l=!0,this.clearAndUpdateRevisons(c[p].range,h,h.range.indexOf(e.characterFormat)+1))}else l=this.checkParaMarkMatchedWithElement(o,e.characterFormat,!0,n);!l&&(this.owner.enableTrackChanges||i.paragraph.characterFormat.revisions.length>0)&&(this.insertRevision(e.characterFormat,n),r&&a.revisions.length>0&&o.revisions.length>0&&this.updateRevisionForSpittedTextElement(a,o))}},e.prototype.checkParaMarkMatchedWithElement=function(e,t,i,n){var r=this.getMatchedRevisionsToCombine(e.revisions,n);return r.length>0&&(this.mapMatchedRevisions(r,e,t,i),!0)},e.prototype.checkToMatchEmptyParaMark=function(e){var i=e.previousRenderedWidget;if(!t.isNullOrUndefined(i)&&i instanceof we&&i.characterFormat.revisions.length>0){var n=this.getMatchedRevisionsToCombine(i.characterFormat.revisions,"Insertion");if(n.length>0)return this.mapMatchedRevisions(n,i.characterFormat,e.characterFormat,!1),!0}return!1},e.prototype.updateNextBlocksIndex=function(e,t){var i=e.containerWidget.childWidgets.indexOf(e)+1;if(e.containerWidget instanceof fe)for(var n=e.containerWidget.index,r=this.documentHelper.pages.indexOf(e.containerWidget.page);r<this.documentHelper.pages.length;r++){var o=this.documentHelper.pages[r];if(o.bodyWidgets[0].index!==n)return;for(var s=i;s<o.bodyWidgets[0].childWidgets.length;s++){var a=o.bodyWidgets[0].childWidgets[s];this.updateIndex(a,t)}i=0}else if(e.containerWidget instanceof Pe)for(var l=e.containerWidget.getSplitWidgets(),d=l.indexOf(e.containerWidget),h=d;h<l.length;h++){for(var c=l[h].childWidgets,p=i;p<c.length;p++)this.updateIndex(c[p],t);d=0,i=0}else if(e.containerWidget instanceof Fe)for(m=i;m<e.containerWidget.childWidgets.length;m++)(u=e.containerWidget.childWidgets[m]).rowIndex===e.containerWidget.index&&this.updateIndex(u,t);else if(e.containerWidget instanceof xe)for(m=i;m<e.containerWidget.childWidgets.length;m++){var g=e.containerWidget.childWidgets[m];this.updateIndex(g,t);for(r=0;r<g.childWidgets.length;r++){var u=g.childWidgets[r];u.rowIndex=g.index,u.index=r}}else if(e.containerWidget instanceof ve||e.containerWidget instanceof Xe||e.containerWidget instanceof be)for(var m=i;m<e.containerWidget.childWidgets.length;m++){var f=e.containerWidget.childWidgets[m];this.updateIndex(f,t)}},e.prototype.updateIndex=function(e,t){t?e.index++:e.index--},e.prototype.updateEndPosition=function(){var e=this.documentHelper.selection;this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&this.updateHistoryPosition(e.start,!1)},e.prototype.onBackSpace=function(){this.removeEditRange=!0;var e=this.documentHelper.selection;if(this.documentHelper.triggerSpellCheck=!0,e.isEmpty)this.singleBackspace(e,!1);else{this.initHistory("BackSpace");var t=this.deleteSelectedContents(e,!0);this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&(t?this.editorHistory.currentBaseHistoryInfo=void 0:(this.checkEndPosition(e)&&this.updateHistoryPosition(e.end,!1),this.reLayout(e),this.insertSpaceInFormField())),this.documentHelper.triggerSpellCheck=!1}this.removeEditRange=!1,this.updateXmlMappedContentControl()},e.prototype.insertRemoveBookMarkElements=function(){for(var e=!1,t=0;t<this.removedBookmarkElements.length;t++){var i=this.removedBookmarkElements[t];if(0===i.bookmarkType){this.documentHelper.bookmarks.containsKey(i.name)||this.documentHelper.bookmarks.add(i.name,i);var n=i;if(n&&n.reference&&-1!==this.removedBookmarkElements.indexOf(n.reference)){var r=this.removedBookmarkElements.indexOf(n.reference),o=this.removedBookmarkElements.indexOf(n);this.removedBookmarkElements.splice(r,1),this.removedBookmarkElements.splice(o,1),t--}else this.editorHistory.currentBaseHistoryInfo&&(this.editorHistory.updateHistory(),this.initComplexHistory(this.editorHistory.currentBaseHistoryInfo.action)),this.initInsertInline(n.clone()),this.editorHistory.currentHistoryInfo&&(this.editorHistory.updateComplexHistory(),e=!0)}else{var s=i;if(s&&s.reference&&-1!==this.removedBookmarkElements.indexOf(s.reference)){var r=this.removedBookmarkElements.indexOf(s.reference),o=this.removedBookmarkElements.indexOf(s);this.removedBookmarkElements.splice(r,1),this.removedBookmarkElements.splice(o,1),t--}else this.editorHistory.currentBaseHistoryInfo&&(this.initComplexHistory(this.editorHistory.currentBaseHistoryInfo.action),this.editorHistory.updateHistory()),this.initInsertInline(s.clone()),this.editorHistory.currentHistoryInfo&&(this.editorHistory.updateComplexHistory(),e=!0)}}return this.removedBookmarkElements=[],e},e.prototype.deleteSelectedContents=function(e,t){var i=this.deleteSelectedContentInternal(e,t,e.start,e.end),n=e.getTextPosBasedOnLogicalIndex(e.editPosition);return e.selectContent(n,!0),i},e.prototype.removeWholeElement=function(e){this.initHistory("BackSpace"),this.deleteSelectedContents(e,!0),this.checkEndPosition(e)&&this.updateHistoryPosition(e.end,!1),this.reLayout(e)},e.prototype.singleBackspace=function(e,i){var n=this.editorHistory;if(n&&!i&&!n.canRedo()&&n.canUndo()){var r=n.undoStack[n.undoStack.length-1],o=this.selection.getParagraphInfo(e.start),s=this.selection.getParagraphInfo(e.end);if("AutoFormatHyperlink"===r.action&&r.insertPosition===this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString())&&r.endPosition===this.selection.getHierarchicalIndex(s.paragraph,s.offset.toString()))return void n.undo()}var a=e.start.paragraph,l=e.start.currentWidget,d=e.start.offset,h=0,c=l.getInline(d,h),p=c.element;if(this.selection.isInlineFormFillMode()){if(p instanceof Ie&&2===p.fieldType)return;if(1===this.getFormFieldText().length)return this.selection.selectFieldInternal(this.selection.getCurrentFormField()),this.insertTextInternal(this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5),!0),void this.selection.selectTextElementStartOfField(this.selection.getCurrentFormField())}if(h=c.index,p instanceof Oe&&(p.ignoreOnceItems=[]),p instanceof Oe&&(p.ignoreOnceItems=[]),p instanceof Ie&&2===p.fieldType&&L.isLinkedFieldCharacter(p)){var g=p.fieldBegin,u=p.fieldEnd;return g.nextNode instanceof Ae&&(u=g.nextNode.reference),e.start.setPositionParagraph(g.line,g.line.getOffset(g,0)),e.end.setPositionParagraph(u.line,u.line.getOffset(u,0)+1),void e.fireSelectionChanged(!0)}if(p instanceof Le&&("Footnote"===p.footnoteType?this.removeFootnote(p):this.removeEndnote(p)),p&&(p instanceof Me||p.previousNode instanceof Me)&&(p instanceof Me&&p.previousNode&&(a=(p=p.previousNode).line.paragraph,d=p.line.getOffset(p,p.length)),p&&1===p.length&&p.nextNode instanceof Me&&p.previousNode instanceof Me)){var m=p.previousNode,u=p.nextNode;if(!m.contentControlProperties.lockContentControl)return e.start.setPositionParagraph(m.line,m.line.getOffset(m,0)),e.end.setPositionParagraph(u.line,u.line.getOffset(u,0)+1),void this.removeWholeElement(e)}if(p&&(p instanceof Ae||p.previousNode instanceof Ae)){if(p instanceof Ae&&1===p.bookmarkType){if(p.previousNode)a=(p=p.previousNode).line.paragraph,d=p.line.getOffset(p,p.length);else if(a.previousRenderedWidget instanceof we){var f=a.previousRenderedWidget.lastChild;return e.start.setPositionParagraph(p.line,p.line.getOffset(p,0)),e.end.setPositionParagraph(f,f.getEndOffset()),void this.removeWholeElement(e)}}else if(p.nextNode instanceof Ae&&p instanceof Ae&&0===p.bookmarkType&&p.reference===p.nextNode)return void this.deleteBookmark(p.name);if(1===p.length&&p.nextNode instanceof Ae&&p.previousNode instanceof Ae){var g=p.previousNode,u=p.nextNode;return e.start.setPositionParagraph(g.line,g.line.getOffset(g,0)),e.end.setPositionParagraph(u.line,u.line.getOffset(u,0)+1),void this.removeWholeElement(e)}}if(p instanceof vt&&1===p.commentType){p.comment.commentStart;var v=p.comment;for(v.isReply&&(v=v.ownerComment);p instanceof vt;)p=p.previousNode;this.deleteCommentInternal(v),a=p.line.paragraph,d=p.line.getOffset(p,p.length),e.start.setPositionParagraph(p.line,d),e.end.setPositionParagraph(p.line,d)}if(p instanceof Ie&&1===p.fieldType){var y=e.getPreviousValidElement(p);if(y instanceof Ie){if(p=y.fieldBegin,a=p.line.paragraph,d=p.line.getOffset(p,0),p.nextNode instanceof Ae){m=p.nextNode.reference;e.start.setPositionParagraph(m.line,m.line.getOffset(m,0))}return e.end.setPositionParagraph(p.line,d),void e.fireSelectionChanged(!0)}y!==p&&(a=(p=y).line.paragraph,d=p.line.getOffset(p,p.length))}if(p instanceof et||p instanceof $e){if(p.nextNode instanceof $e&&p.editRangeEnd===p.nextNode||p.previousNode instanceof et&&p.editRangeStart===p.previousNode)return;if(p instanceof et&&!(p.previousNode instanceof $e))return;if(p instanceof $e&&(t.isNullOrUndefined(p.previousNode)||(a=(p=p.previousNode).line.paragraph,d=p.line.getOffset(p,p.length))),1===p.length&&p.nextNode instanceof $e&&p.previousNode instanceof et){var m=p.previousNode,u=p.nextNode;return e.start.setPositionParagraph(m.line,m.line.getOffset(m,0)),e.end.setPositionParagraph(u.line,u.line.getOffset(u,0)+1),void this.removeWholeElement(e)}}if(i||this.initHistory("BackSpace"),d===e.getStartOffset(a)&&e.start.currentWidget.isFirstLine()){if(a.paragraphFormat.listFormat&&-1!==a.paragraphFormat.listFormat.listId)return void this.onApplyList(void 0);if(0!==a.paragraphFormat.firstLineIndent)return void this.onApplyParagraphFormat("firstLineIndent",0,!1,!1);if(0!==a.paragraphFormat.leftIndent)return void this.onApplyParagraphFormat("leftIndent",0,!1,!1);if(!a.paragraphFormat.bidi&&"Left"!==a.paragraphFormat.textAlignment)return void this.onApplyParagraphFormat("textAlignment","Left",!1,!0);if(a.previousRenderedWidget instanceof we){e.owner.isShiftingEnabled=!0;var b=a.previousRenderedWidget;if(b.isEmpty())this.removePrevParaMarkRevision(a),this.removeBlock(b),this.addRemovedNodes(b);else{this.removePrevParaMarkRevision(a),this.removeBlock(a);var w=this.documentHelper.selection.getLineLength(b.lastChild),C=b.childWidgets.length-1,x=void 0;if(!a.isEmpty())for(var F=0;F<a.childWidgets.length;F++)x=a.childWidgets[F],b.childWidgets.push(x),a.childWidgets.splice(F,1),F--,x.paragraph=b;this.documentHelper.layout.reLayoutParagraph(b,C,0),e.selects(b.childWidgets[C],w,!0),this.addRemovedNodes(a)}if(this.setPositionForHistory(),this.documentHelper.layout.getFootNoteWidgetsOf(a).length>0){var P=this.documentHelper.layout,T=a.containerWidget;P.layoutfootNote(T.page.footnoteWidget)}this.reLayout(e)}else this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo=void 0)}else{i||(e.owner.isShiftingEnabled=!0);var S=this.selection.getParagraphInfo(e.start),x=e.start.currentWidget,I=d-1;I<0&&(x=x.previousLine,I=this.documentHelper.selection.getLineLength(x)+I),this.removeAtOffset(x,e,I),this.setPositionParagraph(S.paragraph,S.offset-1,!1),this.setPositionForHistory(),i?this.fireContentChange():this.reLayout(e)}},e.prototype.setPositionForHistory=function(e){var i=this.documentHelper.selection;this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&(t.isNullOrUndefined(e)?(this.updateHistoryPosition(i.start,!0),this.editorHistory.currentBaseHistoryInfo.endPosition=this.editorHistory.currentBaseHistoryInfo.insertPosition):(this.editorHistory.currentBaseHistoryInfo.insertPosition=e,this.editorHistory.currentBaseHistoryInfo.endPosition=e))},e.prototype.removeAtOffset=function(e,i,n){var r=0,o=e.paragraph.childWidgets.indexOf(e),s=e.paragraph.paragraphFormat.bidi,a=e.children.length;if(!s&&this.viewer.documentHelper.layout.isContainsRtl(e))for(var l=e.children[0],d=void 0,h=-1,c=!0;l;){for(;(c||t.isNullOrUndefined(d))&&l instanceof Oe&&(this.documentHelper.textHelper.isRTLText(l.text)||this.documentHelper.textHelper.containsSpecialCharAlone(l.text))&&l.nextElement;)d||(d=l),-1===h&&(h=e.children.indexOf(l)),l=l.nextElement;c=!1;var p=e.children.indexOf(l);if(u=this.removeCharacter(l,n,r,e,o,p,!0))break;r+=l.length,d===l?(-1!==h&&(l=e.children[h+1]),d=void 0,h=-1):l=d?l.previousElement:l.nextElement}else for(var g=s?a-1:0;s?g>=0:g<a;s?g--:g++)if(!((l=e.children[g])instanceof Qe||l instanceof vt&&(l.commentType,r++,g!=a-1))){var u=this.removeCharacter(l,n,r,e,o,g);if(u)break;r+=l.length}},e.prototype.removeCharacter=function(e,i,n,r,o,s,a){var l=!1;if(e instanceof Ae&&e.line!==e.reference.line)return t.isNullOrUndefined(e.line.previousLine)?t.isNullOrUndefined(e.line.paragraph.previousRenderedWidget)?t.isNullOrUndefined(e.line.paragraph.nextRenderedWidget)||(e.line.paragraph.nextRenderedWidget.firstChild.children.splice(e.line.paragraph.nextRenderedWidget.firstChild.children.length,0,e),e.line=e.line.paragraph.nextRenderedWidget.firstChild):(e.line.paragraph.previousRenderedWidget.lastChild.children.splice(e.line.paragraph.previousRenderedWidget.lastChild.children.length,0,e),e.line=e.line.paragraph.previousRenderedWidget.lastChild):(e.line.previousLine.children.splice(e.line.previousLine.children.length,0,e),e.line=e.line.previousLine),r.children.splice(s,1),!0;if(i<n+e.length){var d=i-n;if(e.ischangeDetected=!0,this.owner.isSpellCheck&&this.owner.spellChecker.removeErrorsFromCollection({element:e,text:e.text}),e.canTrigger||(this.documentHelper.triggerSpellCheck=!1),i===n&&1===e.length)this.owner.enableTrackChanges&&!this.skipTracking()?(this.addRemovedNodes(e.clone()),this.handleDeleteTracking(e,d,1,s)):(this.unLinkFieldCharacter(e),this.unlinkRangeFromRevision(e,!0),this.addRemovedRevisionInfo(e,void 0),this.addRemovedNodes(e),r.children.splice(s,1)),this.documentHelper.layout.reLayoutParagraph(r.paragraph,o,s,void 0,a);else{var h=this.handleDeleteTracking(e,d,1);this.documentHelper.layout.reLayoutParagraph(r.paragraph,o,s,void 0,a),t.isNullOrUndefined(h)||(e.revisions.length>0&&this.addRemovedRevisionInfo(e,h),this.addRemovedNodes(h))}l=!0}return l},e.prototype.removeCharacterInLine=function(e,t,i){var n=new Oe;if(e instanceof Oe){n.characterFormat.copyFormat(e.characterFormat);var r=1===i?1:i-t;n.text=e.text.substr(t,r);var o=e.text;e.text=o.substring(0,t)+o.substring(t+r,o.length),e.contentControlProperties&&(n.contentControlProperties=e.contentControlProperties.clone())}return n},e.prototype.removeRevisionsInformation=function(e,t,i,n){var r=e.previousElement;"Insertion"===this.retrieveRevisionInOder(r).revisionType&&this.isRevisionMatched(r,void 0)&&e.line.children.splice(n,1)},e.prototype.handleDeleteTracking=function(e,i,n,r,o,s){var a=this.owner.enableTrackChanges,l=(!t.isNullOrUndefined(this.editorHistory)&&(this.editorHistory.isUndoing||this.editorHistory.isRedoing),void 0);if(this.canHandleDeletion()||a&&!this.skipTracking()){if(e instanceof Ae||e instanceof vt||e instanceof et||e instanceof $e)return void(e instanceof Ae&&e.previousElement instanceof Ie&&e.previousElement.formFieldData?e.previousElement.revisions.length>0&&this.removeRevisionsInformation(e,i,n,r):e.line.children.splice(e.indexInOwner,1));var d=!1;if(this.owner.editorHistory&&(d=!t.isNullOrUndefined(this.owner.editorHistory.currentBaseHistoryInfo)&&"Delete"===this.owner.editorHistory.currentBaseHistoryInfo.action),this.skipTableElements||this.updateEndRevisionIndex(),e.revisions.length>0){var h=this.retrieveRevisionInOder(e),c=this.owner.revisions.changes.indexOf(h);if("Insertion"===h.revisionType)if(this.isRevisionMatched(e,void 0))if(t.isNullOrUndefined(r))l=this.removeCharacterInLine(e,i,n);else{var p=h.range.indexOf(e),g=1;h.range.length>p+1&&h.range[p+1]instanceof k&&(g+=1),h.range.splice(p,g),0===h.range.length&&this.owner.revisionsInternal.remove(h),this.unLinkFieldCharacter(e),e.line.children.splice(r,1)}else if(t.isNullOrUndefined(r)){var u=this.removeCharacterInLine(e,i,n);if(0===i){var m=e.previousElement;this.handleDeletionForInsertRevision(m,e,u,n,i,!0)}else if(e.length!==i)for(var f=e.revisions.length-1;f>=0;f--){var v=e.revisions[f],y=v.range.indexOf(e),b=new Oe;b.characterFormat.copyFormat(e.characterFormat),b.line=e.line,b.text=e.text.substr(i),b.revisions.splice(0,0,v),v.range.splice(y+1,0,b),u.revisions.splice(0,0,v),u.line=e.line,v.range.splice(y+1,0,u),e.text=e.text.substr(0,i);var w=e.indexInOwner;e.line.children.splice(w+1,0,b),e.line.children.splice(w+1,0,u),this.addRemovedNodes(u.clone()),this.insertRevision(u,"Deletion"),this.updateLastElementRevision(u)}else if(e.length===i){var C=e.nextElement;this.handleDeletionForInsertRevision(C,e,u,n,i,!1)}else 1===n?d||(this.selection.start.movePreviousPosition(),this.selection.end.setPositionInternal(this.selection.start)):this.updateCursorForInsertRevision(e,i,n),this.addRemovedNodes(u.clone()),this.insertInlineInternal(u,"Deletion")}else this.checkToCombineRevisionsInSides(e,"Deletion")?this.updateLastElementRevision(e):(this.insertRevision(e,"Deletion"),this.updateLastElementRevision(e));else if("Deletion"===h.revisionType){if(-1!==c&&h.author!==this.owner.currentUser){var x=h.range,F=x[0].line.getOffset(x[0],0),P=x[x.length-1],T=P.line.getOffset(P,P.length);F===i&&T===n&&(e.revisions.splice(e.revisions.indexOf(h),1),this.checkToCombineRevisionsInSides(e,"Deletion")?this.combineElementRevision(e.revisions,e.revisions):(this.insertRevision(e,"Deletion"),this.updateLastElementRevision(e)),e.line.getOffset(e,0)===F&&this.owner.revisions.changes.splice(c,1))}if(1===n)d?(this.selection.start.moveNextPosition(),this.selection.end.setPositionInternal(this.selection.start)):(this.selection.start.movePreviousPosition(),this.selection.end.setPositionInternal(this.selection.start));else if(this.isRevisionMatched(e,"Deletion"))this.updateCursorForInsertRevision(e,i,n);else{var S=h.range.indexOf(e);(T=e.line.getOffset(e,e.length))>=n&&h.range.length>S+1?(this.updateRevisionForSpittedTextElement(e,h.range[S+1]),h.range.splice(h.range.indexOf(e),1),this.toCombineOrInsertRevision(e,"Deletion")):1===h.range.length||0===i?(this.handleDeleteBySplitting(e,i,n),-1!==S&&1!==h.range.length&&(this.updateRevisionForSpittedTextElement(h.range[S-1],h.range[S]),h.range.splice(h.range.indexOf(e),1))):(h.range.splice(h.range.indexOf(e),1),this.toCombineOrInsertRevision(e,"Deletion"))}this.updateLastElementRevision(e)}}else t.isNullOrUndefined(r)?this.handleDeleteBySplitting(e,i,n):(this.checkToCombineRevisionsInSides(e,"Deletion")||this.insertRevision(e,"Deletion"),this.updateLastElementRevision(e))}else l=this.removeCharacterInLine(e,i,n);return l},e.prototype.toCombineOrInsertRevision=function(e,t){this.checkToCombineRevisionsInSides(e,t)?this.combineElementRevision(e.revisions,e.revisions):(this.insertRevision(e,t),this.updateLastElementRevision(e))},e.prototype.updateLastElementRevision=function(e){this.skipTableElements||!this.editorHistory||!this.editorHistory.currentBaseHistoryInfo||this.skipReplace||!t.isNullOrUndefined(this.owner.search)&&this.owner.search.isRepalceTracking||t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo.lastElementRevision)&&(this.editorHistory.currentBaseHistoryInfo.lastElementRevision=e,e.isMarkedForRevision=!0)},e.prototype.updateEndRevisionIndex=function(){if(!t.isNullOrUndefined(this.editorHistory.undoStack)&&this.editorHistory.undoStack.length>0){var e=this.editorHistory.undoStack[this.editorHistory.undoStack.length-1];e.lastElementRevision&&t.isNullOrUndefined(e.endRevisionLogicalIndex)&&e.updateEndRevisionInfo()}},e.prototype.retrieveRevisionInOder=function(e){if(1===e.revisions.length)return e.revisions[0];for(var t=0;t<e.revisions.length;t++)if("Deletion"===e.revisions[t].revisionType)return e.revisions[t];return e.revisions[e.revisions.length-1]},e.prototype.handleDeletionForInsertRevision=function(e,i,n,r,o,s){if(!t.isNullOrUndefined(e)&&0===i.revisions.length&&this.isRevisionMatched(e,"Deletion"))this.addRemovedNodes(n.clone()),this.insertTextInline(e,this.selection,n.text,0);else{var a=i.revisions[i.revisions.length-1],l=a.range.indexOf(i);a.range.splice(s?l:l+1,0,n),n.revisions.splice(0,0,a);var d=!1;this.owner.editorHistory&&(d=!t.isNullOrUndefined(this.owner.editorHistory.currentBaseHistoryInfo)&&"Delete"===this.owner.editorHistory.currentBaseHistoryInfo.action),1!==r||d?this.updateCursorForInsertRevision(i,o,r):(this.selection.start.movePreviousPosition(),this.selection.end.setPositionInternal(this.selection.start)),this.addRemovedNodes(n.clone()),this.insertInlineInternal(n,"Deletion")}},e.prototype.handleDeleteBySplitting=function(e,i,n){var r=!1;if(this.owner.editorHistory&&(r=!t.isNullOrUndefined(this.owner.editorHistory.currentBaseHistoryInfo)&&"Delete"===this.owner.editorHistory.currentBaseHistoryInfo.action),1===n){var o=e.line.getOffset(e,0);if(o>0){var s=new kt(this.owner);s.setPositionForLineWidget(e.line,o+i),this.selection.start.setPositionInternal(s),this.selection.end.setPositionInternal(this.selection.start)}else r||(this.selection.start.movePreviousPosition(),this.selection.end.setPositionInternal(this.selection.start))}else this.updateCursorForInsertRevision(e,i,n);var a=this.removeCharacterInLine(e,i,n);this.addRemovedNodes(a.clone()),this.insertTextInternal(a.text,!1,"Deletion")},e.prototype.updateCursorForInsertRevision=function(e,t,i){var n=e.line.getOffset(e,0);n>0&&(t=n+t,i=n+i);var r=new kt(this.owner);r.setPositionFromLine(e.line,t);var o=new kt(this.owner);o.setPositionFromLine(e.line,i),r.isExistBefore(o)?(this.selection.end.setPositionInternal(r),this.selection.start.setPositionInternal(r)):(this.selection.start.setPositionInternal(o),this.selection.end.setPositionInternal(o))},e.prototype.checkToCombineRevisionsInSides=function(e,i){var n=e.previousNode,r=e.nextNode,o=!1;if(t.isNullOrUndefined(n)||(n=n.previousValidNodeForTracking,t.isNullOrUndefined(n)||(s=this.getMatchedRevisionsToCombine(n.revisions,i)).length>0&&(this.mapMatchedRevisions(s,n,e,!1),o=!0)),!t.isNullOrUndefined(r)&&(r=r.nextValidNodeForTracking,!t.isNullOrUndefined(r))){var s=this.getMatchedRevisionsToCombine(r.revisions,i);s.length>0&&(o?this.combineElementRevision(e.revisions,r.revisions):this.mapMatchedRevisions(s,r,e,!0),o=!0)}return o},e.prototype.delete=function(){this.removeEditRange=!0;var e=this.documentHelper.selection;if(e.isEmpty)this.singleDelete(e,!1);else{this.initHistory("Delete"),this.deleteSelectedContentInternal(e,!1,e.start,e.end);var t=new kt(e.owner);this.setPositionForCurrentIndex(t,e.editPosition),e.selectContent(t,!0),this.reLayout(e),this.insertSpaceInFormField()}this.removeEditRange=!1,this.updateXmlMappedContentControl()},e.prototype.deleteEditElement=function(e){this.initHistory("Delete"),this.deleteSelectedContentInternal(e,!1,e.start,e.end);var t=new kt(e.owner);this.setPositionForCurrentIndex(t,e.editPosition),e.selectContent(t,!0),this.reLayout(e)},e.prototype.removeContentControlMark=function(e,t){return!e.contentControlProperties.lockContentControl&&(this.selection.start.setPositionParagraph(e.line,e.line.getOffset(e,0)),this.selection.end.setPositionParagraph(t.line,t.line.getOffset(t,0)+1),this.deleteEditElement(this.selection),!0)},e.prototype.singleDelete=function(e,i){var n=e.start.currentWidget,r=e.start.paragraph,o=e.start.offset,s=0,a=n.getInline(e.start.offset,s),l=a.element;if(this.selection.isInlineFormFillMode()){if(l instanceof Ie&&1===l.fieldType)return;var d=this.getFormFieldText();if(l instanceof Oe||(l=l.nextElement),1===d.length&&l instanceof Oe)return this.selection.selectFieldInternal(this.selection.getCurrentFormField()),this.insertTextInternal(this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5),!0),void this.selection.selectTextElementStartOfField(this.selection.getCurrentFormField());if(l instanceof Ie&&1===l.fieldType)return}if(s=a.index,r.paragraphFormat.listFormat&&-1!==r.paragraphFormat.listFormat.listId&&this.documentHelper.isListTextSelected&&"List"===e.contextType)return void this.onApplyList(void 0);if(!t.isNullOrUndefined(l)&&s===l.length&&!t.isNullOrUndefined(l.nextNode)){if((l=l.nextNode)instanceof Ie&&1===l.fieldType&&!t.isNullOrUndefined(l.fieldBegin.formFieldData))return;s=0}if(!t.isNullOrUndefined(l)&&s===l.length&&!t.isNullOrUndefined(l.nextNode)){if((l=l.nextNode)instanceof Le)return;s=0}if(l instanceof Le&&("Footnote"===l.footnoteType?this.removeFootnote(l):this.removeEndnote(l)),!t.isNullOrUndefined(l)){var h=void 0,c=e.getNextValidElement(l);if(c instanceof Se&&(h=c),!t.isNullOrUndefined(h)&&h instanceof Ie&&0===h.fieldType)return l=h.fieldEnd,r=l.line.paragraph,o=l.line.getOffset(l,1),e.end.setPositionParagraph(l.line,o),void e.fireSelectionChanged(!0);l!==h&&(r=(l=h).line.paragraph,o=l.line.getOffset(l,0),l instanceof Ie&&1===l.fieldType&&o++)}if(l instanceof et||l instanceof $e){if(l.nextNode instanceof $e&&l.editRangeEnd===l.nextNode||l.previousNode instanceof et&&l.editRangeStart===l.previousNode)return;if(this.documentHelper.isDocumentProtected&&"ReadOnly"===this.documentHelper.protectionType){if(l instanceof et||l instanceof $e)return}else l instanceof et?(o=(l=l.nextNode).line.getOffset(l,0),r=l.line.paragraph):l instanceof $e&&o++;if(1===l.length&&l.nextNode instanceof $e&&l.previousNode instanceof et){var p=l.previousNode,g=l.nextNode;return e.start.setPositionParagraph(p.line,p.line.getOffset(p,0)),e.end.setPositionParagraph(g.line,g.line.getOffset(g,0)+1),void this.deleteEditElement(e)}}if(l&&(l instanceof Me||l.nextNode instanceof Me)){if(l instanceof Me&&l.nextNode)return l=l.nextNode,r=l.line.paragraph,o=l.line.getOffset(l,0),e.start.setPositionParagraph(l.line,o),void e.end.setPositionParagraph(l.line,o);if(l&&1===l.length&&l.nextNode instanceof Me&&l.previousNode instanceof Me&&this.removeContentControlMark(l.previousNode,l.nextNode))return;if(l instanceof Me&&l.previousNode instanceof Me&&l.previousNode.reference===l&&this.removeContentControlMark(l.previousNode,l))return}if(l&&(l instanceof Ae&&0===l.bookmarkType||l.nextNode instanceof Ae)){if(l.nextNode&&l instanceof Ae&&(r=(l=l.nextNode).line.paragraph,o=l.line.getOffset(l,0)),1===l.length&&l.nextNode instanceof Ae&&l.previousNode instanceof Ae){var u=l.previousNode,m=l.nextNode;return e.start.setPositionParagraph(u.line,u.line.getOffset(u,0)),e.end.setPositionParagraph(m.line,m.line.getOffset(m,0)+1),void this.deleteEditElement(e)}l instanceof Ae&&(o=l.line.getOffset(l,1))}if(e.start.currentWidget.isLastLine()&&o===this.documentHelper.selection.getLineLength(e.start.currentWidget)){if(r.isInsideTable&&t.isNullOrUndefined(r.nextWidget))return;var f=void 0,v=e.getNextParagraphBlock(r);if(t.isNullOrUndefined(v)){if(o>0)return;if(r.previousWidget instanceof we&&(f=r.previousWidget),r.previousWidget instanceof be)return;if(r.previousWidget instanceof xe)return;if(t.isNullOrUndefined(f))return}if(i||this.initHistory("Delete"),r.isEndsWithPageBreak){var y=r.lastChild,b=y.children[y.children.length-1];this.selection.start.setPositionForSelection(y,b,0,this.selection.start.location)}var w=this.selection.getParagraphInfo(e.start);if(e.editPosition=this.selection.getHierarchicalIndex(w.paragraph,w.offset.toString()),this.checkInsertPosition(e)&&this.setPositionForHistory(e.editPosition),e.owner.isShiftingEnabled=!0,r.isEmpty())if(this.removePrevParaMarkRevision(r,!0),this.removeBlock(r),this.addRemovedNodes(r),t.isNullOrUndefined(v))if(t.isNullOrUndefined(f)){var C=e.getParagraphLength(void 0)+1;this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&(this.updateHistoryPosition(e.start,!0),this.editorHistory.currentBaseHistoryInfo.endPosition=this.selection.getHierarchicalIndex(void 0,C.toString()))}else e.selectParagraphInternal(f,!1),this.setPositionForHistory();else e.selectParagraphInternal(v,!0);else{r=r.combineWidget(this.owner.viewer);var x=this.splitParagraph(r,r.firstChild,0,e.start.currentWidget,e.start.offset,!0);this.removePrevParaMarkRevision(x,!0),this.deleteParagraphMark(x,e,0),this.addRemovedNodes(r),this.setPositionForCurrentIndex(e.start,e.editPosition),e.selectContent(e.start,!0)}this.reLayout(e)}else this.singleDeleteInternal(e,i,r)},e.prototype.singleDeleteInternal=function(e,t,i){t||(e.owner.isShiftingEnabled=!0,this.initHistory("Delete")),this.checkInsertPosition(e)&&(this.updateHistoryPosition(e.start,!0),this.editorHistory.currentBaseHistoryInfo.endPosition=this.editorHistory.currentBaseHistoryInfo.insertPosition);var n=this.selection.getParagraphInfo(e.start),r=e.start.currentWidget,o=e.start.offset,s=e.getLineLength(e.start.currentWidget);o>=s&&(r=r.nextLine,o-=s),this.removeAtOffset(r,e,o),this.owner.enableTrackChanges&&!this.skipTracking()?this.setPositionParagraph(n.paragraph,n.offset+1,!1):this.setPositionParagraph(n.paragraph,n.offset,!1),t?this.fireContentChange():this.reLayout(e)},e.prototype.deleteParagraphMark=function(e,i,n,r){if(!t.isNullOrUndefined(e.containerWidget)){e=e.combineWidget(this.owner.viewer);var o=i.getNextParagraphBlock(e);if(!(e.isInsideTable&&t.isNullOrUndefined(e.nextWidget)||t.isNullOrUndefined(o))){e.containerWidget instanceof fe&&e.containerWidget;var s=void 0;if(s=i.getNextRenderedBlock(e)instanceof xe?i.getNextRenderedBlock(e):void 0,o.isInsideTable&&!t.isNullOrUndefined(s)&&s.contains(o.associatedCell)){if(n<4){var a=0;this.removeBlock(e),this.documentHelper.layout.clearListElementBox(o),this.documentHelper.layout.clearListElementBox(e);for(g=e.childWidgets.length-1;g>=0;g--)for(var l=e.childWidgets[g],d=l.children.length-1;d>=0;d--){var h=l.children[d];a+=h.length,o.firstChild.children.unshift(h),h.line=o.firstChild}this.documentHelper.layout.reLayoutParagraph(o,0,0),a>0&&(i.editPosition=this.selection.getHierarchicalIndex(o,a.toString()))}}else if(n<4){e.childWidgets.length;var c=o.getSplitWidgets();if(o=o.combineWidget(this.owner.viewer),this.documentHelper.layout.clearListElementBox(o),this.documentHelper.layout.clearListElementBox(e),this.updateEditPositionOnMerge(e,o),!(!t.isNullOrUndefined(r)&&r)||this.handleDeleteParaMark(e,c[0])){for(var p=e.childWidgets.length-1,g=(e.childWidgets[p].children.length,0);g<o.childWidgets.length;g++){var u=o.childWidgets[g];if(o.characterFormat.revisions.length>0)for(var m=0;m<o.characterFormat.revisions.length;m++){for(d=0;d<o.characterFormat.revisions[m].range.length;d++)o.characterFormat.revisions[m].range[d].ownerBase=e;e.characterFormat.revisions.push(o.characterFormat.revisions[m])}o.childWidgets.splice(g,1),e.childWidgets.push(u),u.paragraph=e,g--}0===o.childWidgets.length&&o.childWidgets.push(new Te(o)),this.removeBlock(o),this.documentHelper.layout.reLayoutParagraph(e,0,0),this.addRemovedNodes(o)}}}}},e.prototype.handleDeleteParaMark=function(e,i){if(!this.owner.enableTrackChanges&&e.characterFormat.revisions.length>0)for(var n=0;n<e.characterFormat.revisions.length;n++){var r=e.characterFormat.revisions[n],o=r.range.indexOf(e.characterFormat);return r.range.splice(o,1),0===r.range.length&&this.owner.revisions.remove(r),!0}if(this.owner.enableTrackChanges){var s=!1;if(e.characterFormat.revisions.length>0){var a=this.retrieveRevisionByType(e.characterFormat,"Deletion");if(!t.isNullOrUndefined(a)&&this.isRevisionMatched(a,"Deletion")){var l=e.characterFormat.revisions.indexOf(a);e.characterFormat.revisions.splice(l,1),a.range.splice(a.range.indexOf(e.characterFormat),1),0===a.range.length&&this.owner.revisions.remove(a),s=!0}var d=this.retrieveRevisionByType(e.characterFormat,"Insertion");if(!t.isNullOrUndefined(d)&&this.isRevisionMatched(e.characterFormat,"Insertion")){o=d.range.indexOf(e.characterFormat);d.range.splice(o,1),0===d.range.length&&this.owner.revisions.remove(d),s=!0}return!!s||(this.applyRevisionForParaMark(e,i.firstChild,"Deletion",!1),!1)}return this.applyRevisionForParaMark(e,i.firstChild,"Deletion",!1),!1}return!0},e.prototype.insertDeleteParaMarkRevision=function(e,i){var n=e.lastChild,r=n.children.length>0?n.children[n.children.length-1].previousValidNodeForTracking:void 0;if(!t.isNullOrUndefined(r)){var o=this.getMatchedRevisionsToCombine(r.revisions,"Deletion");o.length>0&&this.mapMatchedRevisions(o,r,e.characterFormat,!1)}i.firstChild.children[0].nextValidNodeForTracking},e.prototype.retrieveRevisionByType=function(e,t){for(var i=0;i<e.revisions.length;i++)if(e.revisions[i].revisionType===t)return e.revisions[i]},e.prototype.combineRevisionOnDeleteParaMark=function(e,t,i){var n=e.childWidgets[t].children[i],r=n.nextNode;r=r.nextValidNodeForTracking,n=n.nextValidNodeForTracking,r.revisions.length>0&&n.revisions.length>0&&this.combineElementRevisions(n,r)},e.prototype.updateEditPositionOnMerge=function(e,t){this.documentHelper.selection.editPosition===this.selection.getHierarchicalIndex(t,"0")&&void 0===t.nextRenderedWidget&&(this.documentHelper.selection.editPosition=this.selection.getHierarchicalIndex(e,this.documentHelper.selection.getLineLength(e.lastChild).toString()))},e.prototype.checkEndPosition=function(e){return this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo.endPosition)},e.prototype.checkInsertPosition=function(e){return this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)&&t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo.insertPosition)},e.prototype.checkIsNotRedoing=function(){return this.documentHelper.owner.enableHistoryMode&&!this.editorHistory.isRedoing},e.prototype.deleteSelectedContentInternal=function(e,i,n,r){var o=n,s=r;n.isExistBefore(r)||(o=r,s=n);var a=this.selection.getParagraphInfo(o);e.editPosition=this.selection.getHierarchicalIndex(a.paragraph,a.offset.toString());var l=!1;if(i&&o.isInSameParagraph(s)&&(o.offset<s.offset&&o.offset===e.getParagraphLength(s.paragraph)&&(l=e.getNextRenderedBlock(o.paragraph)instanceof xe),!(1===s.offset&&s.offset>e.getParagraphLength(s.paragraph))||s.paragraph.isInsideTable&&t.isNullOrUndefined(s.paragraph.nextWidget)||(i=!1)),!l){e.owner.isShiftingEnabled=!0,this.checkInsertPosition(e)&&(this.editorHistory.currentBaseHistoryInfo.insertPosition=e.editPosition);var d=i?1:0;this.deleteSelectedContent(s.paragraph,e,o,s,d)}return l},e.prototype.initHistory=function(e){this.documentHelper.owner.enableHistoryMode&&this.editorHistory.initializeHistory(e)},e.prototype.initComplexHistory=function(e){this.documentHelper.owner.enableHistoryMode&&this.editorHistory.initComplexHistory(this.documentHelper.selection,e)},e.prototype.insertPicture=function(e,t,i){var n=new Ze(!0);n.imageString=e,n.width=t,n.height=i,n.textWrappingStyle="Inline",this.insertPictureInternal(n)},e.prototype.insertPictureInternal=function(e){var t=this.documentHelper.selection;this.initHistory("InsertInline"),this.fitImageToPage(t,e),this.insertInlineInSelection(t,e),this.reLayout(t)},e.prototype.fitImageToPage=function(e,t){var i=e.start.paragraph.bodyWidget,n=i.sectionFormat.pageWidth-i.sectionFormat.leftMargin-i.sectionFormat.rightMargin,r=i.sectionFormat.pageHeight-i.sectionFormat.topMargin-i.sectionFormat.topMargin;t.width>n&&(t.height=t.height*n/t.width,t.width=n),t.height>r&&(t.width=t.width*r/t.height,t.height=r)},e.prototype.insertInlineInSelection=function(e,t){this.checkIsNotRedoing()&&(e.owner.isShiftingEnabled=!0),e.isEmpty||this.removeSelectedContents(e),this.updateInsertPosition(),this.insertInlineInternal(t),this.checkEndPosition(e)&&this.updateHistoryPosition(e.start,!1),this.fireContentChange()},e.prototype.onPortrait=function(){var e=new x,t=this.documentHelper.selection.sectionFormat.pageWidth,i=this.documentHelper.selection.sectionFormat.pageHeight;t>i&&(e.pageWidth=i,e.pageHeight=t),this.onApplySectionFormat(void 0,e)},e.prototype.onLandscape=function(){var e=new x,t=this.documentHelper.selection.sectionFormat.pageWidth,i=this.documentHelper.selection.sectionFormat.pageHeight;t<i&&(e.pageWidth=i,e.pageHeight=t),this.onApplySectionFormat(void 0,e)},e.prototype.copyValues=function(){var e=new x;return e.bottomMargin=this.documentHelper.selection.sectionFormat.bottomMargin,e.topMargin=this.documentHelper.selection.sectionFormat.topMargin,e.leftMargin=this.documentHelper.selection.sectionFormat.leftMargin,e.rightMargin=this.documentHelper.selection.sectionFormat.rightMargin,e.pageHeight=this.documentHelper.selection.sectionFormat.pageHeight,e.pageWidth=this.documentHelper.selection.sectionFormat.pageWidth,e.footerDistance=this.documentHelper.selection.sectionFormat.footerDistance,e.headerDistance=this.documentHelper.selection.sectionFormat.headerDistance,e},e.prototype.changeMarginValue=function(e){var t=this.copyValues();"lastCustomSetting"===e||"normal"===e?(t.topMargin=72,t.bottomMargin=72,t.leftMargin=72,t.rightMargin=72):"narrow"===e?(t.topMargin=36,t.bottomMargin=36,t.leftMargin=36,t.rightMargin=36):"moderate"===e?(t.topMargin=72,t.bottomMargin=72,t.leftMargin=54,t.rightMargin=54):"wide"===e?(t.topMargin=72,t.bottomMargin=72,t.leftMargin=144,t.rightMargin=144):"mirrored"===e?(t.topMargin=72,t.bottomMargin=72,t.leftMargin=90,t.rightMargin=72):"office2003Default"===e&&(t.topMargin=72,t.bottomMargin=72,t.leftMargin=90,t.rightMargin=90),this.onApplySectionFormat(void 0,t)},e.prototype.onPaperSize=function(e){var t=this.copyValues(),i=this.documentHelper.selection.sectionFormat.pageWidth,n=this.documentHelper.selection.sectionFormat.pageHeight;"letter"===e?i<n?(t.pageWidth=611.9,t.pageHeight=791.9):(t.pageWidth=791.9,t.pageHeight=611.9):"tabloid"===e?i<n?(t.pageWidth=791.9,t.pageHeight=1223.9):(t.pageWidth=1223.9,t.pageHeight=791.9):"legal"===e?i<n?(t.pageWidth=611.9,t.pageHeight=1007.9):(t.pageWidth=1007.9,t.pageHeight=611.9):"statement"===e?i<n?(t.pageWidth=396,t.pageHeight=611.9):(t.pageWidth=611.9,t.pageHeight=396):"executive"===e?i<n?(t.pageWidth=521.9,t.pageHeight=755.9):(t.pageWidth=755.9,t.pageHeight=521.9):"a3"===e?i<n?(t.pageWidth=841.8,t.pageHeight=1190.4):(t.pageWidth=1190.4,t.pageHeight=841.8):"a4"===e?i<n?(t.pageWidth=595.2,t.pageHeight=841.8):(t.pageWidth=841.8,t.pageHeight=595.2):"a5"===e?i<n?(t.pageWidth=419.5,t.pageHeight=595.2):(t.pageWidth=595.2,t.pageHeight=419.5):"b4"===e?i<n?(t.pageWidth=728.4,t.pageHeight=1031.7):(t.pageWidth=1031.7,t.pageHeight=728.4):"b5"===e&&(i<n?(t.pageWidth=515.8,t.pageHeight=728.4):(t.pageWidth=728.4,t.pageHeight=515.8)),this.onApplySectionFormat(void 0,t)},e.prototype.updateListItemsTillEnd=function(e,i){for(var n=i?this.documentHelper.selection.getNextRenderedBlock(e):e;!t.isNullOrUndefined(n)&&!this.documentHelper.isTextInput;)this.updateRenderedListItems(n),n=n.getSplitWidgets().pop().nextRenderedWidget},e.prototype.updateWholeListItems=function(e){this.documentHelper.renderedLists.clear(),this.documentHelper.renderedLevelOverrides=[];for(var i,n=e.bodyWidget.index,r=0;r<this.documentHelper.pages.length;r++){var o=this.documentHelper.pages[r];if(o.bodyWidgets[0].index===n&&(i=this.getNextBlockForList(o.bodyWidgets[0].firstChild),!t.isNullOrUndefined(i)))break}do{if(this.updateListItems(i,e))break;i=i.getSplitWidgets().pop().nextRenderedWidget,t.isNullOrUndefined(i)||(i=this.getNextBlockForList(i))}while(i)},e.prototype.getNextBlockForList=function(e){if(e instanceof we&&this.documentHelper.layout.isFirstElementWithPageBreak(e)){var t=e.nextRenderedWidget;if(t.equals(e))return t}return e},e.prototype.updateListItems=function(e,t){return e instanceof we?this.updateListItemsForPara(e,t):this.updateListItemsForTable(e,t)},e.prototype.updateListItemsForTable=function(e,t){if(t instanceof xe&&e.equals(t))return!0;var i=e.firstChild;do{if(this.updateListItemsForRow(i,t))return!0;i=i.getSplitWidgets().pop().nextRenderedWidget}while(i);return!1},e.prototype.updateListItemsForRow=function(e,t){if(t.isInsideTable&&-1!==e.childWidgets.indexOf(this.documentHelper.selection.getContainerCell(t.associatedCell)))return!0;var i=e.firstChild;do{this.updateListItemsForCell(i,t),i=i.nextRenderedWidget}while(i);return!1},e.prototype.updateListItemsForCell=function(e,t){if(0!==e.childWidgets.length){var i=e.firstChild;do{this.updateListItems(i,t),i=i.getSplitWidgets().pop().nextRenderedWidget}while(i)}},e.prototype.updateRenderedListItems=function(e){e instanceof we?this.updateRenderedListItemsForPara(e):this.updateRenderedListItemsForTable(e)},e.prototype.updateRenderedListItemsForTable=function(e){var t=e.firstChild;do{this.updateRenderedListItemsForRow(t),t=t.getSplitWidgets().pop().nextRenderedWidget}while(t)},e.prototype.updateRenderedListItemsForRow=function(e){var t=e.firstChild;do{this.updateRenderedListItemsForCell(t),t=t.nextRenderedWidget}while(t)},e.prototype.updateRenderedListItemsForCell=function(e){if(0!==e.childWidgets.length){var t=e.firstChild;do{this.updateRenderedListItems(t),t=t.getSplitWidgets().pop().nextRenderedWidget}while(t)}},e.prototype.updateListItemsForPara=function(e,i){if(e.equals(i))return!0;var n=void 0,r=0;if(t.isNullOrUndefined(e.paragraphFormat)||t.isNullOrUndefined(e.paragraphFormat.listFormat)||(n=this.documentHelper.getListById(e.paragraphFormat.listFormat.listId),r=e.paragraphFormat.listFormat.listLevelNumber),!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(this.documentHelper.getAbstractListById(n.abstractListId))&&!t.isNullOrUndefined(this.documentHelper.getAbstractListById(n.abstractListId).levels[r])){var o=this.documentHelper.layout.getListLevel(n,r);this.updateListNumber(o,e,!1)}return!1},e.prototype.updateRenderedListItemsForPara=function(e){if(!t.isNullOrUndefined(this.documentHelper.getListById(e.paragraphFormat.listFormat.listId))){var i=this.documentHelper.getListById(e.paragraphFormat.listFormat.listId),n=e.paragraphFormat.listFormat.listLevelNumber;if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(this.documentHelper.getAbstractListById(i.abstractListId))&&!t.isNullOrUndefined(this.documentHelper.getAbstractListById(i.abstractListId).levels[e.paragraphFormat.listFormat.listLevelNumber])){var r=this.documentHelper.layout.getListLevel(i,n);this.updateListNumber(r,e,!0)}}},e.prototype.updateListNumber=function(e,i,n){if("Bullet"!==e.listLevelPattern){var r=void 0;if(i.childWidgets.length>0){var o=i.childWidgets[0];o.children.length>0&&(r=i.paragraphFormat.bidi?o.children[o.children.length-1]:o.children[0])}if(!t.isNullOrUndefined(r)&&r instanceof Qe){var s=this.documentHelper.layout.getListNumber(i.paragraphFormat.listFormat);if(n){var a=r.width;r.text=s;var l=this.documentHelper.textHelper.getTextSize(r,r.characterFormat);l>a&&(r.width=l)}}}},e.prototype.getOffsetValue=function(e){if(this.startParagraph){t=e.getLineInfoBasedOnParagraph(this.startParagraph,this.startOffset);e.start.setPositionFromLine(t.line,t.offset)}if(e.start.updatePhysicalPosition(!0),e.isEmpty)e.end.setPositionInternal(e.start);else{if(this.endParagraph){var t=e.getLineInfoBasedOnParagraph(this.endParagraph,this.endOffset);e.end.setPositionFromLine(t.line,t.offset)}e.end.updatePhysicalPosition(!0)}},e.prototype.setPositionParagraph=function(e,t,i){var n=this.documentHelper.selection,r=n.getLineInfoBasedOnParagraph(e,t);n.start.setPositionFromLine(r.line,r.offset),n.end.setPositionInternal(n.start),i||n.fireSelectionChanged(!0)},e.prototype.setPositionForCurrentIndex=function(e,t){var i=this.selection.getParagraph({index:t}),n=this.selection.getLineInfoBasedOnParagraph(i.paragraph,i.offset);e.setPositionForLineWidget(n.line,n.offset)},e.prototype.insertPageNumber=function(e){var i="PAGE "+(e=t.isNullOrUndefined(e)?"":" \\*"+e)+" \\* MERGEFORMAT";this.createFields(i)},e.prototype.insertPageCount=function(e){var i="NUMPAGES "+(e=t.isNullOrUndefined(e)?"":" *"+e)+" * MERGEFORMAT";this.createFields(i)},e.prototype.createFields=function(e){var t=new we,i=new Te(t),n=new Ie(0);i.children.push(n);var r=new Be;r.fieldBegin=n,r.text="1";var o=new Oe;o.text=e,i.children.push(o);var s=new Ie(2);s.fieldBegin=n,n.fieldSeparator=s,i.children.push(s),i.children.push(r);var a=new Ie(1);a.fieldBegin=n,a.fieldSeparator=s,s.fieldEnd=a,n.fieldEnd=a,i.children.push(a),n.line=i,t.childWidgets.push(i),this.documentHelper.fields.push(n);var l=new fe;l.sectionFormat=new x(l),l.childWidgets.push(t),this.pasteContentsInternal([l],!1)},e.prototype.insertBookmark=function(e){if(this.documentHelper.bookmarks.containsKey(e)){var t=this.documentHelper.bookmarks.get(e);t.line.children.splice(t.line.children.indexOf(t),1),t.reference.line.children.splice(t.reference.line.children.indexOf(t.reference),1),this.documentHelper.bookmarks.remove(e)}var i=new Ae(0);i.name=e;var n=new Ae(1);n.name=e,i.reference=n,n.reference=i,this.initComplexHistory("InsertBookmark"),this.insertElements([n],[i]),this.editorHistory&&this.editorHistory.updateComplexHistoryInternal(),this.documentHelper.owner.enableHeaderAndFooter&&this.updateHeaderFooterWidget(),this.documentHelper.bookmarks.add(e,i),this.selection.start.setPositionForSelection(i.line,i,1,this.selection.start.location),this.selection.end.setPositionForSelection(n.line,n,0,this.selection.end.location),this.selection.fireSelectionChanged(!0),this.fireContentChange()},e.prototype.deleteBookmark=function(e){var t=this.documentHelper.bookmarks.get(e);if(t instanceof Ae){t.reference;this.initHistory("DeleteBookmark"),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.setBookmarkInfo(t),this.editorHistory.updateHistory()),this.deleteBookmarkInternal(t)}this.fireContentChange()},e.prototype.deleteBookmarkInternal=function(e){var i=e.previousNode;i instanceof Ie&&0===i.fieldType&&!t.isNullOrUndefined(i.formFieldData)&&(i.formFieldData.name=""),this.documentHelper.bookmarks.remove(e.name),e.line.children.splice(e.indexInOwner,1),t.isNullOrUndefined(e.reference)||e.reference.line.children.splice(e.reference.indexInOwner,1);var n=e.line.paragraph;if(e.line.paragraph.isInHeaderFooter){var r=void 0;n.containerWidget instanceof Pe?r=n.containerWidget.getContainerTable().containerWidget:n.containerWidget instanceof ve&&(r=n.containerWidget),this.updateHeaderFooterWidget(r)}},e.prototype.getSelectionInfo=function(){var e=this.selection.start,t=this.selection.end;this.selection.isForward||(e=this.selection.end,t=this.selection.start),t.offset===this.selection.getLineLength(t.currentWidget)+1&&this.selection.isParagraphLastLine(t.currentWidget)||(t.offset+=1);var i=this.selection.getParagraphInfo(e),n=this.selection.getHierarchicalIndex(i.paragraph,i.offset.toString());return i=this.selection.getParagraphInfo(t),{start:n,end:this.selection.getHierarchicalIndex(i.paragraph,i.offset.toString())}},e.prototype.insertElements=function(e,i){var n=this.getSelectionInfo();t.isNullOrUndefined(i)||this.insertElementsInternal(this.selection.getTextPosBasedOnLogicalIndex(n.start),i),t.isNullOrUndefined(e)||this.insertElementsInternal(this.selection.getTextPosBasedOnLogicalIndex(n.end),e)},e.prototype.insertElementsInternal=function(e,t,i){this.selection.selectPosition(e,e),this.initHistory("InsertElements"),this.updateInsertPosition();var n=0,r=this.selection.getParagraphInfo(this.selection.start);if(this.selection.start.paragraph.isEmpty()){var o=this.selection.start.paragraph;o.childWidgets[0].children.push(t[0]),t[0].line=o.childWidgets[0],t[0].linkFieldCharacter(this.documentHelper),this.documentHelper.layout.reLayoutParagraph(o,0,0),this.setPositionParagraph(r.paragraph,r.offset+length,!0),e.setPositionForSelection(t[0].line,t[0],t[0].length,this.selection.start.location),this.selection.selectPosition(e,e)}else{var s=this.selection.start.currentWidget.getInline(this.documentHelper.selection.start.offset,n),a=s.element;n=s.index;var l=t[0];this.insertElementInternal(a,l,n,void 0,!0);for(var d=l.indexInOwner,h=l,c=1;c<t.length;c++)h=t[c],l.line.children.splice(d+c,0,h);e.setPositionForSelection(h.line,h,h.length,this.selection.start.location),this.selection.selectPosition(e,e)}this.editorHistory&&(this.checkEndPosition()&&this.updateHistoryPosition(this.selection.start,!1),this.editorHistory.updateHistory())},e.prototype.getCommentElementBox=function(e){var t=e.split(";"),i=this.documentHelper.comments[parseInt(t[1],10)];return t.length>2&&""!==t[2]?i.replyComments[parseInt(t[2],10)]:i},e.prototype.getBlock=function(e){var t=this.selection.getBodyWidget(e);return this.getBlockInternal(t,e)},e.prototype.getBlockInternal=function(e,i){if(""!==i.index&&!t.isNullOrUndefined(i)){var n=i.index.indexOf(";"),r=i.index.substring(0,n);i.index=i.index.substring(n).replace(";","");var o=e;n=parseInt(r,10);var s=this.selection.getBlockByIndex(e,n);if(!s)return{node:o,position:i};var a=s;if(!(i.index.indexOf(";")>=0))return{node:a,position:i};if(a instanceof we)return i.index.indexOf(";")>=0&&(i.index="0"),{node:a,position:i};if(a instanceof ue){var l=this.getBlockInternal(a,i);return{node:t.isNullOrUndefined(l)?void 0:l.node,position:t.isNullOrUndefined(l)?void 0:l.position}}return{node:o,position:i}}},e.prototype.updateHistoryPosition=function(e,i){if(this.editorHistory&&!t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)){var n=void 0;if(e instanceof kt){var r=this.selection.getParagraphInfo(e);n=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString())}else n=e;i?this.editorHistory.currentBaseHistoryInfo.insertPosition=n:this.editorHistory.currentBaseHistoryInfo.endPosition=n}},e.prototype.applyBorders=function(e){this.initHistory("Borders");var t=this.selection.isForward?this.selection.start:this.selection.end,i=this.selection.isForward?this.selection.end:this.selection.start,n=t.paragraph.associatedCell.ownerTable;if(n=n.combineWidget(this.owner.viewer),this.editorHistory)this.cloneTableToHistoryInfo(n);t.paragraph.associatedCell;var r,o=i.paragraph.associatedCell,s=this.getBorder(e.borderColor,e.lineWidth,e.borderStyle);if(this.selection.isEmpty)"OutsideBorders"!==e.type&&"AllBorders"!==e.type&&"LeftBorder"!==e.type||o.cellFormat.borders.left.copyFormat(s),"OutsideBorders"!==e.type&&"AllBorders"!==e.type&&"TopBorder"!==e.type||o.cellFormat.borders.top.copyFormat(s),"OutsideBorders"!==e.type&&"AllBorders"!==e.type&&"RightBorder"!==e.type||o.cellFormat.borders.right.copyFormat(s),"OutsideBorders"!==e.type&&"AllBorders"!==e.type&&"BottomBorder"!==e.type||o.cellFormat.borders.bottom.copyFormat(s),"AllBorders"!==e.type&&"InsideBorders"!==e.type&&"InsideVerticalBorder"!==e.type||o.cellFormat.borders.vertical.copyFormat(s),"AllBorders"!==e.type&&"InsideBorders"!==e.type&&"InsideHorizontalBorder"!==e.type||o.cellFormat.borders.horizontal.copyFormat(s),"NoBorder"===e.type&&this.clearAllBorderValues(o.cellFormat.borders);else{if("OutsideBorders"===e.type||"TopBorder"===e.type)for(var a=this.getTopBorderCellsOnSelection(),l=0;l<a.length;l++)a[l].cellFormat.borders.top.copyFormat(s);if("OutsideBorders"===e.type||"LeftBorder"===e.type)for(var a=this.getLeftBorderCellsOnSelection(),l=0;l<a.length;l++)a[l].cellFormat.borders.left.copyFormat(s);if("OutsideBorders"===e.type||"RightBorder"===e.type)for(var a=this.getRightBorderCellsOnSelection(),l=0;l<a.length;l++)a[l].cellFormat.borders.right.copyFormat(s);if("OutsideBorders"===e.type||"BottomBorder"===e.type)for(var a=this.getBottomBorderCellsOnSelection(),l=0;l<a.length;l++)a[l].cellFormat.borders.bottom.copyFormat(s)}if("BottomBorder"===e.type||"AllBorders"===e.type||"OutsideBorders"===e.type||"NoBorder"===e.type){r=this.getAdjacentCellToApplyBottomBorder();for(l=0;l<r.length;l++){d=r[l];"NoBorder"===e.type?d.cellFormat.borders.top.copyFormat(this.clearBorder()):d.cellFormat.borders.top.copyFormat(s)}}if("AllBorders"===e.type||"OutsideBorders"===e.type||"RightBorder"===e.type||"NoBorder"===e.type){r=this.getAdjacentCellToApplyRightBorder();for(l=0;l<r.length;l++){var d=r[l];"NoBorder"===e.type?d.cellFormat.borders.left.copyFormat(this.clearBorder()):d.cellFormat.borders.left.copyFormat(s)}}"AllBorders"!==e.type&&"NoBorder"!==e.type||this.applyAllBorders(s,e.type),"InsideBorders"!==e.type&&"InsideVerticalBorder"!==e.type&&"InsideHorizontalBorder"!==e.type&&"NoBorder"!==e.type||this.applyInsideBorders(s,e.type,n),this.updateGridForTableDialog(n,!1),this.reLayout(this.selection,!1),this.editorHistory.updateHistory()},e.prototype.applyAllBorders=function(e,t){for(var i=this.selection.getSelectedCells(),n=0;n<i.length;n++)"NoBorder"===t?(i[n].cellFormat.borders.left.copyFormat(this.clearBorder()),i[n].cellFormat.borders.right.copyFormat(this.clearBorder()),i[n].cellFormat.borders.top.copyFormat(this.clearBorder()),i[n].cellFormat.borders.bottom.copyFormat(this.clearBorder())):(i[n].cellFormat.borders.left.copyFormat(e),i[n].cellFormat.borders.right.copyFormat(e),i[n].cellFormat.borders.top.copyFormat(e),i[n].cellFormat.borders.bottom.copyFormat(e))},e.prototype.applyInsideBorders=function(e,t,i){for(var n=this.selection.getSelectedCells(),r=0;r<n.length;r++){var o=n[r],s=o.ownerRow===n[n.length-1].ownerRow,a=o.columnIndex+o.cellFormat.columnSpan-1===n[n.length-1].columnIndex;if("NoBorder"===t?(o.cellFormat.borders.right.copyFormat(this.clearBorder()),o.cellFormat.borders.bottom.copyFormat(this.clearBorder())):(a||"InsideHorizontalBorder"===t||o.cellFormat.borders.right.copyFormat(e),s||"InsideVerticalBorder"===t||o.cellFormat.borders.bottom.copyFormat(e)),!s&&"InsideVerticalBorder"!==t){var l=o.ownerRow.rowIndex+o.cellFormat.rowSpan,d=i.childWidgets[l];if(d)for(var h=this.getAdjacentBottomBorderOnEmptyCells(d,o,!0),c=0;c<h.length;c++)"NoBorder"===t?h[c].cellFormat.borders.top.copyFormat(this.clearBorder()):h[c].cellFormat.borders.top.copyFormat(e)}if(!a&&"InsideHorizontalBorder"!==t)for(var p=this.getSelectedCellsNextWidgets(o,i),g=0;g<p.length;g++)"NoBorder"===t?p[g].cellFormat.borders.left.copyFormat(this.clearBorder()):p[g].cellFormat.borders.left.copyFormat(e)}},e.prototype.getTopBorderCellsOnSelection=function(){for(var e=(this.selection.isForward?this.selection.start:this.selection.end).paragraph.associatedCell,t=[],i=this.selection.getSelectedCells(),n=0;n<i.length;n++)i[n].ownerRow===e.ownerRow&&t.push(i[n]);return t},e.prototype.getLeftBorderCellsOnSelection=function(){for(var e=(this.selection.isForward?this.selection.start:this.selection.end).paragraph.associatedCell,t=this.selection.getSelectedCells(),i=[],n=0;n<t.length;n++)t[n].columnIndex===e.columnIndex&&i.push(t[n]);return i},e.prototype.getRightBorderCellsOnSelection=function(){for(var e=this.selection.getSelectedCells(),t=[],i=0;i<e.length;i++)e[i].columnIndex+e[i].cellFormat.columnSpan-1===e[e.length-1].columnIndex&&t.push(e[i]);return t},e.prototype.getBottomBorderCellsOnSelection=function(){for(var e=(this.selection.isForward?this.selection.end:this.selection.start).paragraph.associatedCell,t=this.selection.getSelectedCells(),i=[],n=0;n<t.length;n++)t[n].ownerRow===e.ownerRow&&i.push(t[n]);return i},e.prototype.clearAllBorderValues=function(e){var t=this.clearBorder();e.bottom.copyFormat(t),e.left.copyFormat(t),e.right.copyFormat(t),e.top.copyFormat(t),e.vertical.copyFormat(t),e.horizontal.copyFormat(t)},e.prototype.clearBorder=function(){var e=new N;return e.lineStyle="Cleared",e},e.prototype.getAdjacentCellToApplyBottomBorder=function(){var e=[],t=this.selection.start,i=this.selection.end;this.selection.isForward||(t=this.selection.end,i=this.selection.start);var n=t.paragraph.associatedCell.ownerTable;n=n.combineWidget(this.owner.viewer);var r=t.paragraph.associatedCell,o=i.paragraph.associatedCell,s=o.ownerRow.rowIndex+o.cellFormat.rowSpan,a=n.childWidgets[s];if(a)if(o.cellFormat.columnSpan>1)for(l=o.columnIndex;l<o.columnIndex+o.cellFormat.columnSpan;l++)e.push(a.childWidgets[l]);else if(e=this.getAdjacentBottomBorderOnEmptyCells(a,o),!this.selection.isEmpty)for(var l=0;l<a.childWidgets.length;l++){var d=a.childWidgets[l].columnIndex;d>=r.columnIndex&&d<=o.columnIndex&&e.push(a.childWidgets[l])}return e},e.prototype.getAdjacentBottomBorderOnEmptyCells=function(e,t,i){var n=[];if(t.cellFormat.columnSpan>1)for(r=t.columnIndex;r<t.columnIndex+t.cellFormat.columnSpan;r++)n.push(e.childWidgets[r]);else if(this.selection.isEmpty||i)for(var r=0;r<e.childWidgets.length;r++)e.childWidgets[r].columnIndex===t.columnIndex&&n.push(e.childWidgets[r]);return n},e.prototype.getAdjacentCellToApplyRightBorder=function(){var e=[],t=this.selection.start,i=this.selection.end;this.selection.isForward||(t=this.selection.end,i=this.selection.start);var n=t.paragraph.associatedCell.ownerTable;n=n.combineWidget(this.owner.viewer);t.paragraph.associatedCell,i.paragraph.associatedCell;if(this.selection.isEmpty){var r=t.paragraph.associatedCell;e=this.getSelectedCellsNextWidgets(r,n)}else for(var o=this.getRightBorderCellsOnSelection(),s=0;s<o.length;s++){var a=o[s];e=e.concat(this.getSelectedCellsNextWidgets(a,n))}return e},e.prototype.getSelectedCellsNextWidgets=function(e,i){var n=[];if(!t.isNullOrUndefined(e.nextWidget)&&(n.push(e.nextWidget),e.cellFormat.rowSpan>1))for(var r=e.ownerRow.rowIndex+e.cellFormat.rowSpan,o=e.ownerRow.rowIndex+1;o<r;o++){var s=i.childWidgets[o];if(s)for(var a=0;a<s.childWidgets.length;a++)s.childWidgets[a].columnIndex===e.nextWidget.columnIndex&&n.push(s.childWidgets[a])}return n},e.prototype.getBorder=function(e,t,i){var n=new N;return n.color=e||"#000000",n.lineWidth=t||1,n.lineStyle=i||"Single",n},e.prototype.applyBordersInternal=function(e,i){t.isNullOrUndefined(e)||t.isNullOrUndefined(e)||(t.isNullOrUndefined(e.top)||this.applyBorder(e.top,i.top),t.isNullOrUndefined(e.bottom)||this.applyBorder(e.bottom,i.bottom),t.isNullOrUndefined(e.left)||this.applyBorder(e.left,i.left),t.isNullOrUndefined(e.right)||this.applyBorder(e.right,i.right),t.isNullOrUndefined(e.horizontal)||this.applyBorder(e.horizontal,i.horizontal),t.isNullOrUndefined(e.vertical)||this.applyBorder(e.vertical,i.vertical),t.isNullOrUndefined(e.diagonalUp)||this.applyBorder(e.diagonalUp,i.diagonalUp),t.isNullOrUndefined(e.diagonalDown)||this.applyBorder(e.diagonalDown,i.diagonalDown))},e.prototype.applyShading=function(e,i){t.isNullOrUndefined(i)||t.isNullOrUndefined(e)||(t.isNullOrUndefined(i.backgroundColor)||e.backgroundColor===i.backgroundColor||(e.backgroundColor=i.backgroundColor),t.isNullOrUndefined(i.foregroundColor)||e.foregroundColor===i.foregroundColor||(e.foregroundColor=i.foregroundColor),t.isNullOrUndefined(i.textureStyle)||e.textureStyle===i.textureStyle||(e.textureStyle=i.textureStyle))},e.prototype.applyBorder=function(e,i){t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||(t.isNullOrUndefined(i.color)||e.color===i.color||(e.color=i.color),t.isNullOrUndefined(i.lineStyle)||e.lineStyle===i.lineStyle||(e.lineStyle=i.lineStyle),t.isNullOrUndefined(i.lineWidth)||e.lineWidth===i.lineWidth||(e.lineWidth=i.lineWidth),t.isNullOrUndefined(i.shadow)||e.shadow===i.shadow||(e.shadow=i.shadow),t.isNullOrUndefined(i.space)||e.space===i.space||(e.space=i.space))},e.prototype.onTableFormat=function(e,i){if(!t.isNullOrUndefined(this.selection.tableFormat)){t.isNullOrUndefined(i)&&(i=!1),this.documentHelper.owner.isShiftingEnabled=!0,this.editorHistory.initializeHistory("TableFormat");var n=this.selection.start.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer);if(i)for(var r=0;r<n.childWidgets.length;r++)for(var o=n.childWidgets[r],s=0;s<o.childWidgets.length;s++)o.childWidgets[s].cellFormat.shading.copyFormat(e.shading);this.applyTableFormat(n,void 0,e),this.reLayout(this.selection,!1)}},e.prototype.applyTableFormat=function(e,t,i){this.applyTablePropertyValue(this.documentHelper.selection,void 0,i,e)},e.prototype.applyTablePropertyValue=function(e,i,n,r){var o=r.tableFormat;if(t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)||(n=this.editorHistory.currentBaseHistoryInfo.addModifiedTableProperties(o,i,n)),n instanceof j)return void(t.isNullOrUndefined(i)&&this.handleTableFormat(o,n));"preferredWidth"===i?o.preferredWidth=n:"leftIndent"===i?o.leftIndent=n:"tableAlignment"===i?o.tableAlignment=n:"cellSpacing"===i?o.cellSpacing=n:"leftMargin"===i?o.leftMargin=n:"rightMargin"===i?o.rightMargin=n:"topMargin"===i?o.topMargin=n:"bottomMargin"===i?o.bottomMargin=n:"preferredWidthType"===i?o.preferredWidthType=n:"bidi"===i&&(o.bidi=n),"shading"===i?o.shading=n:"borders"===i&&(o.borders=n)},e.prototype.handleTableFormat=function(e,i){(this.isBordersAndShadingDialog||this.editorHistory.isUndoing||this.editorHistory.isRedoing)&&(t.isNullOrUndefined(e.borders)||this.applyBordersInternal(e.borders,i.borders),t.isNullOrUndefined(e.shading)||this.applyShading(e.shading,i.shading)),this.isBordersAndShadingDialog||(i.hasValue("bidi")&&i.bidi!==e.bidi&&(e.bidi=i.bidi),i.hasValue("preferredWidth")&&i.preferredWidth!==e.preferredWidth&&(e.preferredWidth=i.preferredWidth),i.hasValue("preferredWidthType")&&i.preferredWidthType!==e.preferredWidthType&&(e.preferredWidthType=i.preferredWidthType),i.hasValue("tableAlignment")&&i.tableAlignment!==e.tableAlignment&&(e.tableAlignment=i.tableAlignment),i.hasValue("leftIndent")&&i.leftIndent!==e.leftIndent&&(e.leftIndent=i.leftIndent)),this.updateGridForTableDialog(e.ownerBase,!1)},e.prototype.updateGridForTableDialog=function(e,t){e.tableHolder&&(e.updateRowIndex(0),e.calculateGrid(),e.isGridUpdated=!1),this.documentHelper.layout.reLayoutTable(e)},e.prototype.onRowFormat=function(e){if(!t.isNullOrUndefined(this.selection)&&!t.isNullOrUndefined(e)){this.editorHistory.initializeHistory("RowFormat"),this.documentHelper.owner.isShiftingEnabled=!0;var i=this.selection.isForward?this.selection.start:this.selection.end,n=this.selection.isForward?this.selection.end:this.selection.start;i.paragraph.associatedCell.ownerTable.combineWidget(this.owner.viewer);this.applyRowFormat(i.paragraph.associatedCell.ownerRow,i,n,void 0,e),this.reLayout(this.selection,!1)}},e.prototype.applyRowFormat=function(e,i,n,r,o){if(this.applyRowPropertyValue(this.documentHelper.selection,r,o,e),n.paragraph.associatedCell.ownerRow!==e){var s=e.nextWidget;t.isNullOrUndefined(s)||this.applyRowFormat(s,i,n,r,o)}},e.prototype.applyRowPropertyValue=function(e,i,n,r){var o=r.rowFormat;if(t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)||(n=this.editorHistory.currentBaseHistoryInfo.addModifiedRowProperties(o,i,n)),n instanceof H)return void(t.isNullOrUndefined(i)&&this.handleRowFormat(n,o));"heightType"===i?o.heightType=n:"height"===i?o.height=n:"isHeader"===i?o.isHeader=n:"allowBreakAcrossPages"===i&&(o.allowBreakAcrossPages=n),t.isNullOrUndefined(r.ownerTable)||this.layoutItemBlock(r.ownerTable,!0)},e.prototype.handleRowFormat=function(e,t){e.hasValue("allowBreakAcrossPages")&&e.allowBreakAcrossPages!==t.allowBreakAcrossPages&&(t.allowBreakAcrossPages=e.allowBreakAcrossPages),e.hasValue("isHeader")&&e.isHeader!==t.isHeader&&(t.isHeader=e.isHeader),e.hasValue("heightType")&&e.heightType!==t.heightType&&(t.heightType=e.heightType),e.hasValue("height")&&e.height!==t.height&&(t.height=e.height),this.updateGridForTableDialog(t.ownerBase.ownerTable,!0)},e.prototype.onCellFormat=function(e){t.isNullOrUndefined(this.selection)||t.isNullOrUndefined(e)||(this.editorHistory.initializeHistory("CellFormat"),this.updateFormatForCell(this.selection,void 0,e),this.reLayout(this.selection,!1))},e.prototype.updateCellMargins=function(e,t){var i=e.start,n=e.end;e.isForward||(i=e.end,n=e.start),this.initHistoryPosition(e,i),this.documentHelper.owner.cellOptionsDialogModule.applyCellMarginValue(i.paragraph.associatedCell.ownerRow,i,n,t)},e.prototype.updateFormatForCell=function(e,t,i){var n=e.start,r=e.end;e.isForward||(n=e.end,r=e.start);for(var o,s=n.paragraph.associatedCell,a=r.paragraph.associatedCell,l=s.ownerTable.combineWidget(this.owner.viewer),d=s.columnIndex;d<=a.columnIndex;d++){o=this.getSelectedCellInColumn(s.ownerTable,s.ownerRow.rowIndex,d,a.ownerRow.rowIndex);for(var h=0;h<o.length;h++)this.applyCellPropertyValue(this.documentHelper.selection,t,i,o[h].cellFormat)}this.updateGridForTableDialog(l,!1)},e.prototype.getSelectedCellInColumn=function(e,t,i,n){for(var r=[],o=t;o<=n;o++)for(var s=e.childWidgets[o],a=0;a<s.childWidgets.length;a++)s.childWidgets[a].columnIndex===i&&r.push(s.childWidgets[a]);return r},e.prototype.getColumnCells=function(e,t,i){for(var n=[],r=0;r<e.childWidgets.length;r++)for(var o=e.childWidgets[r],s=0;s<o.childWidgets.length;s++){var a=o.childWidgets[s];i?a.columnIndex+a.cellFormat.columnSpan===t&&n.push(a):a.columnIndex===t&&n.push(a)}return n},e.prototype.getTableWidth=function(e){return 0!==e.tableFormat.preferredWidth||"Percent"===e.tableFormat.preferredWidthType?"Auto"===e.tableFormat.preferredWidthType||"Point"===e.tableFormat.preferredWidthType?e.tableFormat.preferredWidth:0===e.tableFormat.preferredWidth?0:L.convertPixelToPoint(this.owner.viewer.clientArea.width)/100*e.tableFormat.preferredWidth:L.convertPixelToPoint(this.documentHelper.layout.getTableWidth(e))},e.prototype.applyCellPropertyValue=function(e,i,n,r){if(t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo)||(n=this.editorHistory.currentBaseHistoryInfo.addModifiedCellProperties(r,i,n)),n instanceof q)return t.isNullOrUndefined(i)&&this.handleCellFormat(n,r),n;"leftMargin"===i?r.leftMargin=n:"topMargin"===i?r.topMargin=n:"rightMargin"===i?r.rightMargin=n:"bottomMargin"===i?r.bottomMargin=n:"preferredWidth"===i?(r.preferredWidth=n,r.cellWidth=n):"cellWidth"===i?r.cellWidth=n:"columnSpan"===i?r.columnSpan=n:"rowSpan"===i?r.rowSpan=n:"preferredWidthType"===i?r.preferredWidthType=n:"verticalAlignment"===i&&(r.verticalAlignment=n),"shading"===i?r.shading=n:"borders"===i&&(r.borders=n)},e.prototype.handleCellFormat=function(e,i){t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||(this.isBordersAndShadingDialog?(t.isNullOrUndefined(e.borders)||this.applyBordersInternal(i.borders,e.borders),t.isNullOrUndefined(e.shading)||this.applyShading(i.shading,e.shading)):(e.hasValue("preferredWidth")&&i.preferredWidth!==e.preferredWidth&&(i.preferredWidth=e.preferredWidth),e.hasValue("preferredWidthType")&&i.preferredWidthType!==e.preferredWidthType&&(i.preferredWidthType=e.preferredWidthType),e.hasValue("verticalAlignment")&&i.verticalAlignment!==e.verticalAlignment&&(i.verticalAlignment=e.verticalAlignment)))},e.prototype.destroy=function(){this.documentHelper=void 0,this.nodes=[]},e.prototype.updateToc=function(e){if(t.isNullOrUndefined(e)&&(e=this.selection.getTocFieldInternal()),this.documentHelper.layout.isTocField(e)){var i=this.selection.getFieldCode(e);-1!==i.toLocaleLowerCase().indexOf("toc")&&this.insertTableOfContents(this.validateTocSettings(this.getTocSettings(i,e)))}},e.prototype.getTocSettings=function(e,i){var n={};if(n.includePageNumber=!0,n.rightAlign=!0,"toc \\mergeformat"===e.toLowerCase())n.startLevel=1,n.endLevel=3;else for(var r=e.split("\\"),o=0;o<r.length;o++){var s=r[o];if(0!==s.length)switch(s[0]){case"o":if(t.isNullOrUndefined(s.match(/\d+/g)))n.startLevel=1,n.endLevel=9;else{var a=s.match(/\d+/g).map(Number);n.startLevel=a[0],n.endLevel=a[1]}break;case"h":n.includeHyperlink=!0;break;case"n":n.includePageNumber=!1;break;case"p":n.rightAlign=!1;break;case"u":n.includeOutlineLevels=!0;break;case"t":this.decodeTSwitch(n,s)}}var l=i.paragraph.paragraphFormat.getUpdatedTabs();return l.length>0&&(n.tabLeader=l[l.length-1].tabLeader),n.rightAlign&&t.isNullOrUndefined(n.tabLeader)&&(n.tabLeader="Dot"),n},e.prototype.decodeTSwitch=function(e,t){e.levelSettings={};for(var i=(t=(t=(t=(t=t.replace("t","")).replace('"',"")).replace('"',"")).trim()).split(","),n=0;n<i.length;n++)e.levelSettings[i[n]]=parseInt(i[n+1],10),n++},e.prototype.insertTableOfContents=function(e){this.isInsertingTOC=!0,this.initComplexHistory("TOC"),t.isNullOrUndefined(e)&&((e={}).startLevel=1,e.endLevel=3,e.includeHyperlink=!0,e.includeOutlineLevels=!0,e.includePageNumber=!0,e.rightAlign=!0,e.tabLeader="Dot");var i=void 0,r=void 0;if("TableOfContents"===this.selection.contextType&&(i=this.selection.getTocFieldInternal()),i instanceof Ie){this.selection.start.setPositionForSelection(i.line,i,0,this.selection.start.location);var o=2;i.fieldEnd.paragraph===i.fieldEnd.paragraph.bodyWidget.lastChild&&o--,this.selection.end.setPositionForSelection(i.fieldEnd.line,i.fieldEnd,o,this.selection.end.location),this.delete()}r=this.constructTocFieldCode(e);var s=this.selection.start.isAtParagraphStart,a=this.selection.getParagraphInfo(this.selection.start),l=this.selection.getHierarchicalIndex(a.paragraph,a.offset.toString()),d=this.buildToc(this.validateTocSettings(e),r,!0,s);if(d.length>0){var h=new we,c=new Te(h);h.childWidgets.push(c);var p=0;s||(p=1);var g=d[p].childWidgets[0].children[0];this.appendEndField(g,c),d.push(h),this.appendEmptyPara(d)}else{var u=new t.L10n("documenteditor",this.owner.defaultLocale);u.setLocale(this.owner.locale),n.DialogUtility.alert({title:u.getConstant("No Headings"),content:u.getConstant("Add Headings"),showCloseIcon:!0,closeOnEscape:!0,position:{X:"center",Y:"center"},animationSettings:{effect:"Zoom"}})}this.setPositionForCurrentIndex(this.selection.start,l),this.selection.end.setPositionInternal(this.selection.start);var m=new fe;m.sectionFormat=new x(m),m.childWidgets=d,this.pasteContentsInternal([m],!1),this.isInsertingTOC=!1,this.updatePageRef(),this.editorHistory&&this.editorHistory.updateComplexHistoryInternal(),0===d.length&&(this.owner.editorHistory.undo(),this.owner.editorHistory.redoStack.pop())},e.prototype.appendEmptyPara=function(e){var t=new we,i=new Te(t);t.childWidgets.push(i),e.push(t)},e.prototype.constructTocFieldCode=function(e){var i="TOC";t.isNullOrUndefined(e.startLevel)||0===e.startLevel||t.isNullOrUndefined(e.endLevel)||0===e.endLevel||(i=i+' \\o "'+e.startLevel+"-"+e.endLevel+'"'),e.includePageNumber&&!e.rightAlign&&(i+=' \\p " "'),e.includePageNumber||(i+=" \\n"),e.includeHyperlink&&(i+=" \\h \\z"),e.includeOutlineLevels&&(i+=" \\u");var n=this.constructTSwitch(e);return n.length>6&&(i+=n),i},e.prototype.constructTSwitch=function(e){var i="";if(!t.isNullOrUndefined(e.levelSettings))for(var n=0,r=Object.keys(e.levelSettings);n<r.length;n++){var o=r[n];i=i+o+","+e.levelSettings[o].toString()+","}return i=i.slice(0,-1),i=' \\t "'+i+'"'},e.prototype.appendEndField=function(e,t){var i=new Ie(1);if(i.fieldSeparator=e.fieldSeparator,e.fieldSeparator.fieldEnd=i,i.fieldBegin=e,i.fieldBegin.fieldEnd=i,i.line=t,e.revisions.length>0){var n=e.revisions[e.revisions.length-1];n.range.push(i),i.revisions.push(n)}t.children.push(i)},e.prototype.validateTocSettings=function(e){return(t.isNullOrUndefined(e.startLevel)||e.startLevel<1)&&(e.startLevel=1),(t.isNullOrUndefined(e.endLevel)||e.endLevel<e.endLevel)&&(e.endLevel=e.startLevel>3?e.startLevel:3),t.isNullOrUndefined(e.includeHyperlink)&&(e.includeHyperlink=!1),t.isNullOrUndefined(e.includePageNumber)&&(e.includePageNumber=!1),t.isNullOrUndefined(e.rightAlign)&&(e.rightAlign=!1),t.isNullOrUndefined(e.levelSettings)&&(e.levelSettings={}),e},e.prototype.buildToc=function(e,t,i,n){var r=this.documentHelper.pages[0].bodyWidgets[0],o=[];this.createHeadingLevels(e),e.includeOutlineLevels&&this.createOutlineLevels(e);for(var s=this.selection.start.paragraph.bodyWidget.sectionFormat,a=r.childWidgets[0];void 0!==a;){if(a instanceof we&&(this.isHeadingStyle(a)||e.includeOutlineLevels&&this.isOutlineLevelStyle(a))){var l=this.insertTocBookmark(a);this.createTOCWidgets(a,o,t,l,e,i,n,s),i=!1}a=this.selection.getNextParagraphBlock(a.getSplitWidgets().pop())}return this.tocStyles={},o},e.prototype.createOutlineLevels=function(e){for(var i=e.startLevel;i<=e.endLevel;i++){var n="Level"+i.toString();t.isNullOrUndefined(this.tocStyles[n])&&(this.tocStyles[n]=i)}},e.prototype.createHeadingLevels=function(e){for(var i=e.startLevel;i<=e.endLevel;i++){var n="Heading "+i.toString();t.isNullOrUndefined(this.tocStyles[n])&&(this.tocStyles[n]=i)}if(!t.isNullOrUndefined(e.levelSettings))for(var r=0,o=Object.keys(e.levelSettings);r<o.length;r++){var s=o[r];this.tocStyles[s]=e.levelSettings[s]}},e.prototype.isHeadingStyle=function(e){var i=e.paragraphFormat.baseStyle;return void 0!==i&&!t.isNullOrUndefined(this.tocStyles[i.name])},e.prototype.isOutlineLevelStyle=function(e){var i=e.paragraphFormat.outlineLevel;return!t.isNullOrUndefined(this.tocStyles[i])},e.prototype.createTocFieldElement=function(e,t,i){var n=new Ie(0);n.hasFieldEnd=!0,n.line=e,e.children.push(n);var r=new Oe;r.text=t,r.line=e,e.children.push(r);var o=new Ie(2);return o.fieldBegin=n,o.fieldBegin.fieldSeparator=o,o.line=e,e.children.push(o),n},e.prototype.createTOCWidgets=function(e,i,n,r,o,s,a,l){var d=void 0,h=void 0,c=void 0,p=!1;if(1!==i.length||3!==i[0].childWidgets[0].children.length||t.isNullOrUndefined(s)||s){h=new we;var g=void 0,u=e.paragraphFormat.baseStyle.name;g=o.includeOutlineLevels&&t.isNullOrUndefined(this.tocStyles[u])?e.paragraphFormat.outlineLevel:u;var m="Toc"+this.tocStyles[g],f=this.documentHelper.styles.findByName(m,"Paragraph");if(t.isNullOrUndefined(f)&&(this.documentHelper.owner.parser.parseStyle(JSON.parse(this.getCompleteStyles()),JSON.parse(this.documentHelper.preDefinedStyles.get(m)),this.documentHelper.styles),f=this.documentHelper.styles.findByName(m,"Paragraph")),h.paragraphFormat.applyStyle(f),o.rightAlign&&o.includePageNumber){var v=new S;v.position=l.pageWidth-(l.leftMargin+l.rightMargin),v.tabLeader=o.tabLeader,v.deletePosition=0,v.tabJustification="Right",h.paragraphFormat.tabs.push(v)}c=new Te(h),h.childWidgets.push(c)}else c=i[0].childWidgets[0];void 0!==s&&s&&(t.isNullOrUndefined(a)||a||(this.appendEmptyPara(i),p=!0),this.createTocFieldElement(c,n));for(var y="",b=!1,w=e;w instanceof we;){for(var C=0;C<w.childWidgets.length;C++)for(var x=w.childWidgets[C],F=0;F<x.children.length;F++){var P=x.children[F];if(!P.isPageBreak)if(P instanceof Ie||P instanceof Ae||b)P instanceof Ie&&(0===P.fieldType?b=!0:2===P.fieldType&&(b=!1));else if(P instanceof Oe||P instanceof Qe){var T=P.text;-1!==T.indexOf("\t")&&(T=T.replace(new RegExp("\t","g")," ")),y+=T}}w=w.nextSplitWidget}if(""!==y){if(o.includeHyperlink&&void 0!==r)d=this.insertTocHyperlink(c,r,y);else{var I=new Oe;I.text=y,I.line=c,c.children.push(I)}if(o.includePageNumber&&void 0!==r){if(o.rightAlign){var N=new De;N.text="\t",N.line=c,c.children.push(N)}var E=this.insertTocPageNumber(r,c,o.rightAlign,e);this.appendEndField(E,c)}o.includeHyperlink&&void 0!==d&&this.appendEndField(d,c)}if(t.isNullOrUndefined(h)||""===y&&!s||i.push(h),this.owner.enableTrackChanges&&!t.isNullOrUndefined(h))if(1===i.length||p)this.insertRevisionForBlock(h,"Insertion",!0);else{var H=this.owner.revisionsInternal.changes[0];this.insertRevisionForBlock(h,"Insertion",!0,H)}},e.prototype.insertTocHyperlink=function(e,t,i){var n=' HYPERLINK \\l "'+t+'" ',r=this.createTocFieldElement(e,n,!0),o=new Oe;return o.text=i,o.line=e,e.children.push(o),r},e.prototype.insertTocPageNumber=function(e,t,i,n){var r=" PAGEREF"+e+" \\h ",o=this.createTocFieldElement(t,r,!0),s=(this.documentHelper.pages.indexOf(n.bodyWidget.page)+1).toString(),a=new Be;return a.fieldBegin=o,i||(s=" "+s),a.text=s,a.line=t,t.children.push(a),this.pageRefFields[e]=a,o},e.prototype.updatePageRef=function(){for(var e=0,t=Object.keys(this.pageRefFields);e<t.length;e++){var i=t[e];if(this.documentHelper.bookmarks.containsKey(i)){var n=(this.documentHelper.bookmarks.get(i).paragraph.bodyWidget.page.index+1).toString(),r=this.pageRefFields[i];if(n!==r.text){r.text=n;var o=r.paragraph,s=o.childWidgets.indexOf(r.line),a=r.line.children.indexOf(r);this.documentHelper.layout.reLayoutParagraph(o,s,a)}}}},e.prototype.insertTocBookmark=function(e){var i=void 0;if(e.childWidgets.length>0){var n=e.getSplitWidgets(),r=n[0],o=n.pop(),s=r.childWidgets[0],a=o.childWidgets[o.childWidgets.length-1];if(void 0!==s&&void 0!==a){var l=s.children[0];if(l instanceof Qe||l instanceof vt)do{l=l.nextNode}while(l instanceof Qe||l instanceof vt);if(!t.isNullOrUndefined(l)&&l instanceof Ae&&0===l.bookmarkType&&l.name.toLowerCase().match("^_toc"))return l.name;var d=a.children[a.children.length-1];void 0!==l&&void 0!==d&&(this.selection.start.setPositionForSelection(s,l,0,this.selection.start.location),this.selection.end.setPositionForSelection(a,d,d.length,this.selection.end.location),i=this.generateBookmarkName(),this.insertBookmark(i))}}return i},e.prototype.generateBookmarkName=function(){for(var e=10-(++this.tocBookmarkId).toString().length,t="";e-1>0;)t="0"+t,e--;return"_Toc"+t+this.tocBookmarkId},e.prototype.onCellContentAlignment=function(e,i){this.owner.isShiftingEnabled=!0;var n=this.owner.selection;if(n.isEmpty&&n.start.paragraph.isInsideTable){this.owner.editorHistory&&this.owner.editorHistory.initComplexHistory(n,"MultiSelection"),n.selectTableCell(),this.initHistory("CellContentVerticalAlignment");var r=n.start.paragraph.associatedCell.cellFormat;this.applyCellPropertyValue(n,"verticalAlignment",e,r),this.reLayout(n,!1),this.initHistory("TextAlignment"),this.updateParagraphFormat("textAlignment",i,!1),this.reLayout(this.owner.selection,!1),this.owner.editorHistory&&this.owner.editorHistory.updateComplexHistory()}else this.owner.editorHistory&&this.owner.editorHistory.initComplexHistory(n,"MultiSelection"),t.isNullOrUndefined(n.getTable(n.start,n.end))||(this.updateSelectionTableFormat(n,"CellContentVerticalAlignment",e),this.reLayout(this.owner.selection,!1),this.initHistory("TextAlignment"),this.updateSelectionParagraphFormatting("textAlignment",i,!1),this.reLayout(n,!1)),this.owner.editorHistory&&this.owner.editorHistory.updateComplexHistory()},e.prototype.insertEditRangeElement=function(e){if(!this.documentHelper.isDocumentProtected&&!this.documentHelper.selection.isEmpty){this.initComplexHistory("RestrictEditing"),this.selection.skipEditRangeRetrieval=!0;var t=this.documentHelper.selection;this.selection.start,this.selection.end;if(this.selection.isForward||(this.selection.end,this.selection.start),t.start.paragraph.isInsideTable&&t.end.paragraph.isInsideTable&&t.start.paragraph.associatedCell.ownerTable.contains(t.end.paragraph.associatedCell)){var i=this.getOwnerCell(this.selection.isForward),n=this.getOwnerCell(!this.selection.isForward);if(i.rowIndex===n.rowIndex){for(var r=i.ownerRow.childWidgets.indexOf(i),o=i.ownerRow.childWidgets.indexOf(n),s=[],a=[],l=r;l<=o;l++){var d=this.addEditElement(e);d.columnFirst=l,d.columnLast=l,d.line=t.start.currentWidget;var h=d.editRangeEnd;h.line=t.end.currentWidget,s.push(d),a.push(h)}this.insertElements(a,s);g=s[0].line.getOffset(s[0],1);this.selection.start.setPositionParagraph(s[0].line,g),g=a[0].line.getOffset(a[0],1),this.selection.end.setPositionParagraph(a[0].line,g),this.selection.fireSelectionChanged(!0),this.fireContentChange()}else{this.insertEditRangeInsideTable(i,n,e);var c=this.selection.getFirstParagraphInCell(i).childWidgets[0],p=this.selection.getLastParagraph(n).childWidgets[0],g=c.getOffset(c.children[0],1);this.selection.start.setPositionParagraph(c,g),g=p.getOffset(p.children[0],1),this.selection.end.setPositionParagraph(p,g),this.selection.fireSelectionChanged(!0),this.fireContentChange()}}else this.addRestrictEditingForSelectedArea(e);this.selection.skipEditRangeRetrieval=!1}},e.prototype.insertEditRangeInsideTable=function(e,t,i){var n=e.ownerTable,r=n.childWidgets.indexOf(t.ownerRow),o=n.childWidgets.indexOf(e.ownerRow),s=this.selection.getCellLeft(e.ownerRow,e),a=s+e.cellFormat.cellWidth,l=this.selection.getCellLeft(t.ownerRow,t),d=l+t.cellFormat.cellWidth,h=this.updateSelectedCellsInTable(s,a,l,d);s=h.start,a=h.end;for(var c=[],p=o;p<=r;p++){for(var g=n.childWidgets[p],u=-1,m=-1,f=0;f<g.childWidgets.length;f++){var v=g.childWidgets[f],y=this.selection.getCellLeft(g,v);this.checkCellWithInSelection(s,a,y)&&(-1===u&&(u=f),m=f)}for(var b=[],w=u;w<=m;w++){var C=0,x=void 0,F=void 0;w===u&&(x=g.childWidgets[u],F=this.selection.getFirstParagraphInCell(x).childWidgets[0]);var P=this.addEditElement(i);P.columnFirst=w,P.columnLast=w,P.line=F,P.line.children.splice(C,0,P),C++;var T=P.editRangeEnd;if(b.push(T),c.length>0&&w===m){for(N=0;N<c.length;N++)c[N].line=P.line,P.line.children.splice(C,0,c[N]),C++;c=[]}}if(c=b,p===r&&c.length>0)for(var S=g.childWidgets[m],I=this.selection.getLastParagraph(S).lastChild,C=I.children.length-1,N=0;N<c.length;N++)c[N].line=I,I.children.splice(C,0,c[N]),C++}},e.prototype.addRestrictEditingForSelectedArea=function(e){var t=this.addEditElement(e),i=t.editRangeEnd;this.editorHistory&&this.editorHistory.currentHistoryInfo&&(this.editorHistory.currentHistoryInfo.editRangeStart=t),this.insertElements([i],[t]),this.editorHistory&&this.editorHistory.updateComplexHistoryInternal();var n=t.line.getOffset(t,1);this.selection.start.setPositionParagraph(t.line,n),n=i.line.getOffset(i,1),this.selection.end.setPositionParagraph(i.line,n),this.selection.fireSelectionChanged(!0),this.fireContentChange()},e.prototype.addEditElement=function(e){var t=new et;"everyone"===e.toLocaleLowerCase()?t.group=e:t.user=e;var i=new $e;return i.editRangeStart=t,t.editRangeEnd=i,this.editStartRangeCollection.push(t),this.addEditCollectionToDocument(),this.editStartRangeCollection=[],t},e.prototype.protect=function(e){this.documentHelper.isDocumentProtected=!0,this.documentHelper.protectionType=e,this.selection.highlightEditRegion(),this.editorHistory&&this.editorHistory.destroy()},e.prototype.addEditCollectionToDocument=function(){for(var e=0;e<this.editStartRangeCollection.length;e++){var t=this.editStartRangeCollection[e],i=""===t.user?t.group:t.user;if(this.documentHelper.editRanges.length>0&&this.documentHelper.editRanges.containsKey(i))this.documentHelper.editRanges.get(i).push(t);else{var n=[];n.push(t),this.documentHelper.editRanges.add(i,n)}}this.selection.updateEditRangeCollection()},e.prototype.updateRangeCollection=function(e,t){if(this.documentHelper.editRanges.length>0&&this.documentHelper.editRanges.containsKey(t))this.documentHelper.editRanges.get(t).push(e);else{var i=[];i.push(e),this.documentHelper.editRanges.add(t,i)}},e.prototype.removeUserRestrictions=function(e){if(this.selection.checkSelectionIsAtEditRegion()){this.selection.skipEditRangeRetrieval=!0;var t=this.selection.getEditRangeStartElement();this.initHistory("RemoveEditRange"),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.setEditRangeInfo(t),this.editorHistory.updateHistory()),t.user!==e&&t.group!==e||this.removeUserRestrictionsInternal(t,e),this.selection.updateEditRangeCollection(),this.fireContentChange(),this.selection.skipEditRangeRetrieval=!1}},e.prototype.removeUserRestrictionsInternal=function(e,i){var n=i;t.isNullOrUndefined(i)&&(n=""===e.user?e.group:e.user);var r=this.documentHelper.editRanges.get(n).indexOf(e);this.documentHelper.editRanges.get(n).splice(r,1),0===this.documentHelper.editRanges.get(n).length&&this.documentHelper.editRanges.remove(n),e.removeEditRangeMark(),e.editRangeEnd.line.children.splice(e.editRangeEnd.indexInOwner,1),e.line.children.splice(e.indexInOwner,1)},e.prototype.removeAllEditRestrictions=function(){this.selection.skipEditRangeRetrieval=!0;for(var e=this.selection.start,t=this.selection.end,i=[],n=this.documentHelper.editRanges.keys,r=0;r<n.length;r++){i=this.documentHelper.editRanges.get(n[r]);for(var o=0;o<i.length;o++)i[o].editRangeEnd.line.children.splice(i[o].editRangeEnd.indexInOwner,1),i[o].line.children.splice(i[o].indexInOwner,1)}this.documentHelper.editRanges.clear(),this.selection.updateEditRangeCollection(),this.selection.start.setPositionInternal(e),this.selection.end.setPositionInternal(t),this.selection.editRegionHighlighters.clear(),this.owner.viewer.updateScrollBars(),this.selection.fireSelectionChanged(!1),this.selection.skipEditRangeRetrieval=!1},e.prototype.insertFormField=function(e){if(!t.isNullOrUndefined(this.selection.start)&&!this.owner.enableHeaderAndFooter){this.initHistory("InsertHyperlink");var i=!0;this.selection.isEmpty||(i=this.removeSelectedContents(this.selection)),i&&this.insertFormFieldInternal(e)}},e.prototype.insertFormFieldInternal=function(e){this.updateInsertPosition();var t=[],i=this.getCharacterFormat(this.selection),n=new k(void 0);n.copyFormat(i);var r=new Ie(0);r.formFieldData=this.getFormFieldData(e),r.characterFormat.copyFormat(n),t.push(r);var o=new Ae(0);o.characterFormat.copyFormat(n),r.formFieldData.name=this.getBookmarkName(e,"Insert",this.formFieldCounter),o.name=r.formFieldData.name,t.push(o);var s=new Oe;s.text=this.getFormFieldCode(e),t.push(s);var a=new Ie(2);t.push(a);var l=new Oe;l.text="CheckBox"===e?String.fromCharCode(9744):this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5),l.characterFormat.copyFormat(n),t.push(l);var d=new Ie(1);d.characterFormat.copyFormat(n),t.push(d);var h=new Ae(1);h.characterFormat.copyFormat(n),h.name=r.formFieldData.name,h.reference=o,o.reference=h,t.push(h),this.insertElement(t);this.selection.start.paragraph;d.linkFieldCharacter(this.documentHelper),-1===this.documentHelper.fields.indexOf(r)&&this.documentHelper.fields.push(r),-1===this.documentHelper.formFields.indexOf(r)&&this.documentHelper.formFields.push(r);var c=h.line.getOffset(h,1);this.selection.selects(h.line,c,!0),this.updateEndPosition(),this.reLayout(this.selection,!0)},e.prototype.getFormFieldData=function(e){switch(e){case"Text":return new Ee;case"CheckBox":return new He;case"DropDown":return new We}},e.prototype.setFormField=function(e,i){var n,r;t.isNullOrUndefined(i.format)?t.isNullOrUndefined(i.sizeType)?t.isNullOrUndefined(i.dropdownItems)||(n="DropDown",r=new We):(n="CheckBox",r=new He):(n="Text",r=new Ee),t.isNullOrUndefined(n)||t.isNullOrUndefined(r)||(r.name=e.formFieldData.name,r.copyFieldInfo(i),this.editFormField(n,r))},e.prototype.editFormField=function(e,i){var n=this.selection.getCurrentFormField();if(t.isNullOrUndefined(n)||t.isNullOrUndefined(n.formFieldData))return!1;this.initComplexHistory("FormField");var r,o;""!==i.name&&(n.formFieldData.name!==i.name&&this.documentHelper.bookmarks.containsKey(i.name)&&this.deleteBookmark(i.name),(r=new Ae(0)).name=i.name,(o=new Ae(1)).name=i.name,r.reference=o,o.reference=r),this.initHistory("InsertHyperlink"),this.editHyperlinkInternal=t.isNullOrUndefined(this.editorHistory)||this.editorHistory&&t.isNullOrUndefined(this.editorHistory.currentBaseHistoryInfo);var s=n.characterFormat.cloneFormat(),a=new k;a.copyFormat(s);var l=n.fieldSeparator.nextElement.characterFormat.cloneFormat(),d=n.line.getOffset(n,0);this.selection.start.setPositionParagraph(n.line,d);var h=n.fieldEnd;n.nextNode&&n.nextNode instanceof Ae&&(h=n.nextNode.reference),d=h.line.getOffset(h,1),this.selection.end.setPositionParagraph(h.line,d),this.skipFieldDeleteTracking=!0,this.deleteSelectedContents(this.selection,!1),this.skipFieldDeleteTracking=!1,this.updateInsertPosition();var c=[],p=new Ie(0);p.formFieldData=i,c.push(p),p.characterFormat.copyFormat(a),t.isNullOrUndefined(r)||c.push(r);var g=new Oe;g.text=this.getFormFieldCode(e),c.push(g);var u=new Ie(2);u.characterFormat.copyFormat(a),c.push(u),(g=new Oe).characterFormat.copyFormat(l),g.text=this.getDefaultText(i),"CheckBox"===e?(g.characterFormat.copyFormat(p.characterFormat),"Exactly"===i.sizeType&&(g.characterFormat.fontSize=i.size)):i instanceof Ee&&""!==i.defaultValue&&("Text"===i.type?g.text=L.formatText(i.format,i.defaultValue):"Number"===i.type?g.text=L.formatNumber(i.format,i.defaultValue):g.text=L.formatDate(i.format,i.defaultValue)),c.push(g);var m=new Ie(1);m.characterFormat.copyFormat(a),c.push(m);var f=m;t.isNullOrUndefined(o)||(f=o,c.push(o)),this.insertElement(c);this.selection.start.paragraph;m.linkFieldCharacter(this.documentHelper),-1===this.documentHelper.fields.indexOf(p)&&this.documentHelper.fields.push(p);var v=f.line.getOffset(f,1);return this.selection.selects(f.line,v,!0),this.updateEndPosition(),this.editorHistory&&this.editorHistory.currentBaseHistoryInfo&&this.editorHistory.updateHistory(),this.editorHistory&&this.editorHistory.currentHistoryInfo&&this.editorHistory.updateComplexHistory(),this.reLayout(this.selection,!0),this.editHyperlinkInternal=!1,this.nodes=[],!0},e.prototype.getDefaultText=function(e){var t="";return e instanceof He?t=e.defaultValue?String.fromCharCode(9745):String.fromCharCode(9744):e instanceof We?t=e.dropdownItems.length>0?e.dropdownItems[0]:this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5):e instanceof Ee&&(t=""!==e.defaultValue?e.defaultValue:this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5)),t},e.prototype.getFormFieldCode=function(e){switch(e){case"Text":return"FORMTEXT";case"CheckBox":return"FORMCHECKBOX";case"DropDown":return"FORMDROPDOWN"}},e.prototype.toggleCheckBoxFormField=function(e,t,i){var n=e.formFieldData;if(n instanceof He&&n.enabled){if(this.initHistory("UpdateFormField"),this.editorHistory){var r=void 0;n instanceof He&&(r=n.checked),this.editorHistory.currentBaseHistoryInfo.setFormFieldInfo(e,r),this.editorHistory.updateHistory()}n.checked=t?i:!n.checked;var o=e.fieldSeparator.nextNode;n.checked?o.text=String.fromCharCode(9745):o.text=String.fromCharCode(9744),this.owner.documentHelper.layout.reLayoutParagraph(e.line.paragraph,0,0),this.reLayout(this.selection,!1)}},e.prototype.updateFormField=function(e,t,i){var n=e.formFieldData;if(n){if(this.initHistory("UpdateFormField"),this.editorHistory){var r=void 0;n instanceof Ee?r=e.resultText:n instanceof We&&(r=n.selectedIndex),this.editorHistory.currentBaseHistoryInfo.setFormFieldInfo(e,r),this.editorHistory.updateHistory()}this.updateFormFieldInternal(e,n,t,i)}},e.prototype.updateFormFieldInternal=function(e,t,i,n){if(t instanceof Ee){""===i&&(i=n?this.getDefaultText(t):this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5));var r=i;"Text"===t.type&&""!==t.format&&(r=L.formatText(t.format,i)),this.updateFormFieldResult(e,r)}else if(t instanceof We){var o=t.dropdownItems[i];t.selectedIndex=i,this.updateFormFieldResult(e,o)}var s=e.fieldEnd.line.getOffset(e.fieldEnd,1),a=new kt(this.owner);a.setPositionParagraph(e.fieldEnd.line,s),this.documentHelper.selection.selectRange(a,a),this.reLayout(this.selection,!1)},e.prototype.updateFormFieldResult=function(e,t){for(var i=e.fieldSeparator.nextNode;!(i instanceof Oe)&&(i=i.nextNode)!==e.fieldEnd;);if(i instanceof Oe){i.text=t,i=i.nextNode;do{var n=e.line.children.indexOf(i);if(i instanceof Oe)i=i.nextNode,e.line.children.splice(n,1);else{if(i===e.fieldEnd)break;i=i.nextNode}}while(i!==e.fieldEnd)}this.owner.documentHelper.layout.reLayoutParagraph(e.line.paragraph,0,0)},e.prototype.checkBookmarkAvailability=function(e,t){for(var i=this.documentHelper.bookmarks,n=0;n<i.length;n++)if(i.containsKey(e))return!1;return!0},e.prototype.getBookmarkName=function(e,t,i){for(var n,r=!1;!1===r;)n=e+i,r=this.checkBookmarkAvailability(n,t),i+=1;return n},e.prototype.applyFormTextFormat=function(e){if(!t.isNullOrUndefined(e)){var i=this.getFormFieldText(e),n=i;i=L.formatText(e.formFieldData.format,i),this.applyTextFormatInternal(e,i),this.initHistory("FormTextFormat"),this.editorHistory&&(this.editorHistory.currentBaseHistoryInfo.setFormFieldInfo(e,n),this.editorHistory.updateHistory())}},e.prototype.insertSpaceInFormField=function(){if(this.documentHelper.isInlineFormFillProtectedMode&&this.selection.isInlineFormFillMode()){var e=this.getFormFieldText();0!==e.length&&"\r"!==e||(this.insertTextInternal(this.documentHelper.textHelper.repeatChar(this.documentHelper.textHelper.getEnSpaceCharacter(),5),!0),this.selection.selectTextElementStartOfField(this.selection.getCurrentFormField()))}},e.prototype.getFormFieldText=function(e){t.isNullOrUndefined(e)&&(e=this.selection.getCurrentFormField());var i=e.fieldSeparator;return this.getNextRenderedWidgetText(i)},e.prototype.getNextRenderedWidgetText=function(e){var i="";if(e instanceof Ie&&2===e.fieldType){var n=e;do{if(!t.isNullOrUndefined(n)&&n instanceof Oe&&(i+=n.text),t.isNullOrUndefined(n.nextNode)){i+="\r";var r=n.paragraph.nextRenderedWidget;if(t.isNullOrUndefined(r))break;for(r instanceof xe&&(r=this.selection.getFirstParagraphBlock(r));r.isEmpty();)i+="\r",r=r.nextRenderedWidget;n=r.childWidgets[0].children[0]}else n=n.nextNode}while(!(n instanceof Ie&&1===n.fieldType&&n===e.fieldEnd))}return i},e.prototype.applyTextFormatInternal=function(e,i){var n=e.fieldSeparator.nextElement,r=0;i=i.replace(/\r/g,"");do{if(!t.isNullOrUndefined(n)&&n instanceof Oe&&(n.text=i.slice(r,r+n.text.length),r+=n.length),t.isNullOrUndefined(n.nextElement))if(t.isNullOrUndefined(n.line.nextLine)){this.documentHelper.layout.layoutBodyWidgetCollection(n.paragraph.index,n.paragraph.bodyWidget,n.paragraph,!0);var o=n.paragraph.nextRenderedWidget;if(t.isNullOrUndefined(o))break;for(o instanceof xe&&(o=this.selection.getFirstParagraphBlock(o));o.isEmpty();)o=o.nextRenderedWidget;n=o.childWidgets[0].children[0]}else n=n.line.nextLine.children[0];else n=n.nextElement}while(!(n instanceof Ie&&1===n.fieldType&&n.fieldBegin.formFieldData instanceof Ee));this.documentHelper.layout.layoutBodyWidgetCollection(n.paragraph.index,n.paragraph.bodyWidget,n.paragraph,!0),this.selection.isFormatUpdated=!0,this.reLayout(this.selection,!1),this.selection.isFormatUpdated=!1},e.prototype.constructCommentInitial=function(e){for(var t=e.split(" "),i="",n=0;n<t.length;n++)t[n].length>0&&""!==t[n]&&(i+=t[n][0]);return i},e.prototype.insertFootnote=function(){if(!this.selection.isinFootnote&&!this.selection.isinEndnote){var e=new Le;e.characterFormat.baselineAlignment="Superscript",e.footnoteType="Footnote",e.text="s";var t=new we,i=new Te(t),n=new Oe;n.characterFormat.baselineAlignment="Superscript",n.line=i,n.text="?",i.children.push(n);var r=new Oe;r.text=" ",r.line=i,i.children.push(r),t.childWidgets.push(i),t.footNoteReference=e,e.blocks.push(t),this.selection.isEmpty||this.selection.handleRightKey(),this.initInsertInline(e);var o;if(e.paragraph.bodyWidget.page.footnoteWidget)for(var s=0;s<e.paragraph.bodyWidget.page.footnoteWidget.childWidgets.length;s++)e.paragraph.bodyWidget.page.footnoteWidget.childWidgets[s].footNoteReference===e&&(o=e.paragraph.bodyWidget.page.footnoteWidget.childWidgets[s]);this.selection.start.setPositionForLineWidget(o.childWidgets[0],r.line.getOffset(r,e.text.length)),this.selection.end.setPositionInternal(this.selection.start),this.reLayout(this.selection,!1),this.separator("footnote"),this.continuationSeparator("footnote")}},e.prototype.updateFootnoteCollection=function(e){if(-1===this.documentHelper.footnoteCollection.indexOf(e)){var t=!1;if(this.documentHelper.footnoteCollection.length>0)for(var i=this.selection.getElementPosition(e).startPosition,n=0;n<this.documentHelper.footnoteCollection.length;n++){var r=this.selection.getElementPosition(this.documentHelper.footnoteCollection[n]).startPosition;if(i.isExistBefore(r)){t=!0,this.documentHelper.footnoteCollection.splice(n,0,e);break}}t||this.documentHelper.footnoteCollection.push(e)}},e.prototype.insertEndnote=function(){if(!this.selection.isinFootnote&&!this.selection.isinEndnote){this.documentHelper.layout.isEndnoteContentChanged=!0;var e=new Le;e.characterFormat.baselineAlignment="Superscript",e.footnoteType="Endnote",e.text="s";var t=new we,i=new Te(t),n=new Oe;n.characterFormat.baselineAlignment="Superscript",n.line=i,n.text="?",i.children.push(n);var r=new Oe;r.text=" ",r.line=i,i.children.push(r),t.childWidgets.push(i),t.footNoteReference=e,e.blocks.push(t),this.selection.isEmpty||this.selection.handleRightKey(),this.initInsertInline(e);var o,s=this.documentHelper.pages.length,a=this.documentHelper.pages[s-1].bodyWidgets[0];if(a.page.endnoteWidget)for(var l=0;l<a.page.endnoteWidget.childWidgets.length;l++)a.page.endnoteWidget.childWidgets[l].footNoteReference===e&&(o=a.page.endnoteWidget.childWidgets[l]);this.selection.start.setPositionForLineWidget(o.childWidgets[0],n.line.getOffset(r,e.text.length)),this.selection.end.setPositionInternal(this.selection.start),this.reLayout(this.selection,!1),this.separator("endnote"),this.continuationSeparator("endnote"),this.documentHelper.layout.isEndnoteContentChanged=!1}},e.prototype.updateEndnoteCollection=function(e){if(-1===this.documentHelper.endnoteCollection.indexOf(e)){var t=!1;if(this.documentHelper.endnoteCollection.length>0)for(var i=this.selection.getElementPosition(e).startPosition,n=0;n<this.documentHelper.endnoteCollection.length;n++){var r=this.selection.getElementPosition(this.documentHelper.endnoteCollection[n]).startPosition;if(i.isExistBefore(r)){t=!0,this.documentHelper.endnoteCollection.splice(n,0,e);break}}t||this.documentHelper.endnoteCollection.push(e);var o=this.documentHelper.pages.length;if(this.documentHelper.endnoteCollection.length>0){var s=!1,a=void 0,l=void 0,d=this.documentHelper.endnoteCollection.indexOf(e),h=1,c=void 0,p=this.documentHelper.pages[o-1].bodyWidgets[0];if(p.page.endnoteWidget)for(f=0;f<p.page.endnoteWidget.childWidgets.length;f++){var g=this.documentHelper.endnoteCollection.indexOf(p.page.endnoteWidget.childWidgets[f].footNoteReference);if(g>d&&g-d==1){h=f,s=!0;break}}if(a=e,p.page.endnoteWidget instanceof be&&"Endnote"===p.page.endnoteWidget.footNoteType)l=p.page.endnoteWidget;else{c=!0,(l=new be).footNoteType="Endnote",l.page=p.page;var u=new we;u.characterFormat=new k,u.paragraphFormat=new I,u.index=0;var m=new Te(u);u.childWidgets.push(m),l.childWidgets.push(u)}for(var f=0;f<a.blocks.length;f++)a.blocks[f];s?l.childWidgets.splice(h,0,a.blocks[0]):l.childWidgets.push(a.blocks[0]),h++,c&&(p.page.endnoteWidget=l),l.height+=0}}},e.prototype.separator=function(e){var t=new we,i=new Te(t),n=new Oe;n.characterFormat.fontColor="empty",n.line=i,n.text="",i.children.push(n),t.childWidgets.push(i),"footnote"===e&&this.documentHelper.footnotes.separator.length<1?this.documentHelper.footnotes.separator.push(t):"endnote"===e&&this.documentHelper.endnotes.separator.length<1&&this.documentHelper.endnotes.separator.push(t)},e.prototype.continuationSeparator=function(e){var t=new we,i=new Te(t),n=new Oe;n.characterFormat.fontColor="empty",n.line=i,n.text="",i.children.push(n),t.childWidgets.push(i),"footnote"===e&&this.documentHelper.footnotes.continuationSeparator.length<1?this.documentHelper.footnotes.continuationSeparator.push(t):"endnote"===e&&this.documentHelper.endnotes.continuationSeparator.length<1&&this.documentHelper.endnotes.continuationSeparator.push(t)},e}(),oi=function(){function e(e,i){this.resizeContainerDiv=void 0,this.topLeftRect=void 0,this.topMiddleRect=void 0,this.topRightRect=void 0,this.bottomLeftRect=void 0,this.bottomMiddleRect=void 0,this.bottomRightRect=void 0,this.leftMiddleRect=void 0,this.rightMiddleRect=void 0,this.topLeftRectParent=void 0,this.topMiddleRectParent=void 0,this.topRightRectParent=void 0,this.bottomLeftRectParent=void 0,this.bottomMiddleRectParent=void 0,this.bottomRightRectParent=void 0,this.leftMiddleRectParent=void 0,this.rightMiddleRectParent=void 0,this.resizeMarkSizeIn=7,this.selectedImageWidget=void 0,this.baseHistoryInfo=void 0,this.isImageResizing=!1,this.isImageResizerVisible=!1,this.isImageMoveToNextPage=!1,this.selectedResizeElement=void 0,this.topValue=void 0,this.leftValue=void 0,this.owner=e,this.selectedImageWidget=new u,this.documentHelper=i,this.imageResizerPoints=new si,t.isNullOrUndefined(this.imageResizerDiv)&&this.viewer&&this.documentHelper.pageContainer&&this.initializeImageResizer()}return Object.defineProperty(e.prototype,"currentImageElementBox",{get:function(){return this.currentImageElementBoxIn},set:function(e){this.currentImageElementBoxIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resizeMarkSize",{get:function(){return this.resizeMarkSizeIn},set:function(e){this.resizeMarkSizeIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isShapeResize",{get:function(){return this.currentImageElementBox instanceof Ke},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){return this.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"ImageResizer"},e.prototype.setImageResizerPositions=function(e,t,i,n){this.imageResizerDivElement.style.top=t.toString()+"px",this.imageResizerDivElement.style.left=e.toString()+"px",this.imageResizerDivElement.style.borderWidth="0px",this.imageResizerDivElement.style.height=n+"px",this.owner.viewer instanceof de?this.imageResizerDivElement.style.width=i-e-this.documentHelper.scrollbarWidth+"px":this.imageResizerDivElement.style.width=i+"px",this.imageResizerDivElement.style.backgroundColor="transparent",this.imageResizerDivElement.style.overflow="hidden",this.imageResizerDivElement.style.position="absolute"},e.prototype.initializeImageResizer=function(){this.imageResizerDivElement=document.createElement("div"),this.imageResizerDivElement.style.zIndex="1",this.imageResizerDivElement.style.display="none",this.documentHelper.pageContainer.appendChild(this.imageResizerDivElement)},e.prototype.positionImageResizer=function(e){this.selectedImageWidget.clear();var i;t.isNullOrUndefined(this.documentHelper.currentPage)||(i=this.imageResizerDivElement),t.isNullOrUndefined(i)||i.contains(this.imageResizerDiv)||(this.imageResizerDiv=this.initResizeMarks(i,this)),this.imageResizerDiv.style.width=e.width+"px",this.imageResizerDiv.style.height=e.height+"px",this.currentImageElementBox=e;var n,r,o=e.line;e instanceof Ze&&"Inline"!==e.textWrappingStyle?(n=e.y,r=e.x):(n=this.documentHelper.selection.getTop(o)+e.margin.top,r=this.documentHelper.selection.getLeftInternal(o,e,0));var s=this.documentHelper.selection.getPage(o.paragraph);this.currentPage=s;var a=0;t.isNullOrUndefined(i)||(this.owner.viewer instanceof de&&(this.imageResizerDivElement.style.width=s.boundingRectangle.width-s.boundingRectangle.x-r-this.documentHelper.scrollbarWidth+"px"),this.imageResizerDivElement.style.display="block",this.owner.viewer instanceof de?i.style.width=s.boundingRectangle.width-this.documentHelper.scrollbarWidth-s.boundingRectangle.x-r+"px":i.style.width=s.boundingRectangle.width+"px",i.style.height=s.boundingRectangle.height+"px",i.style.left=s.boundingRectangle.x+"px",i.style.top=s.boundingRectangle.y+"px",i.style.borderWidth="0px",i.style.backgroundColor="transparent",i.style.overflow="hidden",i.style.position="absolute");var l=0,d=this.documentHelper.getPageWidth(s);l=parseFloat(this.imageResizerDivElement.style.width),(a=(this.documentHelper.visibleBounds.width-l*this.documentHelper.zoomFactor)/2)<30&&(a=30),d<l&&(a+=(l-d)*this.documentHelper.zoomFactor/2);var h=this.imageResizerDivElement,c=parseFloat(h.style.width),p=parseFloat(h.style.height),g=parseFloat(this.imageResizerDiv.style.width),u=parseFloat(this.imageResizerDiv.style.height),m=(this.resizeMarkSize-1)/2,f=g+2*m,v=u+2*m;if(f>(c-r)*this.documentHelper.zoomFactor+m&&(f=(c-r)*this.documentHelper.zoomFactor),v>(p-n)*this.documentHelper.zoomFactor+m&&(v=(p-n)*this.documentHelper.zoomFactor),this.imageResizerDivElement.style.width=parseInt(this.imageResizerDivElement.style.width.replace("px",""),10)*this.documentHelper.zoomFactor+"px",this.imageResizerDivElement.style.height=parseInt(this.imageResizerDivElement.style.height.replace("px",""),10)*this.documentHelper.zoomFactor+"px",v=this.documentHelper.render.getScaledValue(e.height),f=this.documentHelper.render.getScaledValue(e.width),e instanceof Ze?(r=this.documentHelper.render.getScaledValue(r),n=this.documentHelper.render.getScaledValue(n)):(r=e.x*this.documentHelper.zoomFactor,n=e.y*this.documentHelper.zoomFactor),this.setImageResizerPosition(r,n,f,v,this),this.owner.selection.isInShape?this.resizeContainerDiv.style.borderStyle="dashed":this.resizeContainerDiv.style.borderStyle="solid",!this.selectedImageWidget.containsKey(o)){var y=new ai(e.height,e.width);this.selectedImageWidget.add(o,y)}},e.prototype.showImageResizer=function(){t.isNullOrUndefined(this.imageResizerDivElement)||(this.imageResizerDivElement.style.display=""),t.isNullOrUndefined(this.resizeContainerDiv)||(this.resizeContainerDiv.style.display=""),t.isNullOrUndefined(this.bottomLeftRect)||(this.bottomLeftRect.style.display="",this.bottomLeftRectParent.style.display=""),t.isNullOrUndefined(this.bottomRightRect)||(this.bottomRightRect.style.display="",this.bottomRightRectParent.style.display=""),t.isNullOrUndefined(this.bottomMiddleRect)||(this.bottomMiddleRect.style.display="",this.bottomMiddleRectParent.style.display=""),t.isNullOrUndefined(this.rightMiddleRect)||(this.rightMiddleRect.style.display="",this.rightMiddleRectParent.style.display=""),t.isNullOrUndefined(this.topRightRect)||(this.topRightRect.style.display="",this.topRightRectParent.style.display=""),t.isNullOrUndefined(this.topLeftRect)||(this.topLeftRect.style.display="",this.topLeftRectParent.style.display=""),t.isNullOrUndefined(this.leftMiddleRect)||(this.leftMiddleRect.style.display="",this.leftMiddleRectParent.style.display=""),t.isNullOrUndefined(this.topMiddleRect)||(this.topMiddleRect.style.display="",this.topMiddleRectParent.style.display=""),this.isImageResizerVisible=!0},e.prototype.hideImageResizer=function(){t.isNullOrUndefined(this.imageResizerDivElement)||(this.imageResizerDivElement.style.display="none"),t.isNullOrUndefined(this.resizeContainerDiv)||(this.resizeContainerDiv.style.display="none"),t.isNullOrUndefined(this.bottomLeftRect)||(this.bottomLeftRect.style.display="none",this.bottomLeftRectParent.style.display="none"),t.isNullOrUndefined(this.bottomRightRect)||(this.bottomRightRect.style.display="none",this.bottomRightRectParent.style.display="none"),t.isNullOrUndefined(this.bottomMiddleRect)||(this.bottomMiddleRect.style.display="none",this.bottomMiddleRectParent.style.display="none"),t.isNullOrUndefined(this.rightMiddleRect)||(this.rightMiddleRect.style.display="none",this.rightMiddleRectParent.style.display="none"),t.isNullOrUndefined(this.topRightRect)||(this.topRightRect.style.display="none",this.topRightRectParent.style.display="none"),t.isNullOrUndefined(this.topLeftRect)||(this.topLeftRect.style.display="none",this.topLeftRectParent.style.display="none"),t.isNullOrUndefined(this.leftMiddleRect)||(this.leftMiddleRect.style.display="none",this.leftMiddleRectParent.style.display="none"),t.isNullOrUndefined(this.topMiddleRect)||(this.topMiddleRect.style.display="none",this.topMiddleRectParent.style.display="none"),this.isImageResizerVisible=!1,this.currentPage=void 0},e.prototype.initResizeMarks=function(e,t){return this.initResizeContainerDiv(t),e.appendChild(t.resizeContainerDiv),t.topRightRectParent=document.createElement("div"),t.topRightRectParent.style.cursor="ne-resize",t.topRightRectParent.id=this.documentHelper.owner.containerId+"_TopRightRectParent",this.applyProperties(t.topRightRectParent),t.topRightRectParent.style.width=this.documentHelper.isTouchInput?"30px":"14px",t.topRightRectParent.style.height=this.documentHelper.isTouchInput?"30px":"14px",t.topRightRectParent.style.opacity="-1",e.appendChild(t.topRightRectParent),t.topRightRect=document.createElement("div"),t.topRightRect.id=this.documentHelper.owner.containerId+"_TopRightRect",t.topRightRect.style.cursor="ne-resize",this.applyProperties(t.topRightRect),e.appendChild(t.topRightRect),t.topLeftRectParent=document.createElement("div"),t.topLeftRectParent.style.cursor="nw-resize",t.topLeftRectParent.id=this.documentHelper.owner.containerId+"_TopLeftRectParent",this.applyProperties(t.topLeftRectParent),t.topLeftRectParent.style.width=this.documentHelper.isTouchInput?"30px":"14px",t.topLeftRectParent.style.height=this.documentHelper.isTouchInput?"30px":"14px",t.topLeftRectParent.style.opacity="-1",e.appendChild(t.topLeftRectParent),t.topLeftRect=document.createElement("div"),t.topLeftRect.id=this.documentHelper.owner.containerId+"_TopLeftRect",t.topLeftRect.style.cursor="nw-resize",this.applyProperties(t.topLeftRect),e.appendChild(t.topLeftRect),t.topMiddleRectParent=document.createElement("div"),t.topMiddleRectParent.style.cursor="n-resize",t.topMiddleRectParent.id=this.documentHelper.owner.containerId+"_TopMiddleRectParent",this.applyProperties(t.topMiddleRectParent),t.topMiddleRectParent.style.width=this.documentHelper.isTouchInput?"30px":"14px",t.topMiddleRectParent.style.height=this.documentHelper.isTouchInput?"30px":"14px",t.topMiddleRectParent.style.opacity="-1",e.appendChild(t.topMiddleRectParent),t.topMiddleRect=document.createElement("div"),t.topMiddleRect.id=this.documentHelper.owner.containerId+"_TopMiddleRect",t.topMiddleRect.style.cursor="n-resize",this.applyProperties(t.topMiddleRect),e.appendChild(t.topMiddleRect),t.bottomRightRectParent=document.createElement("div"),t.bottomRightRectParent.style.cursor="se-resize",t.bottomRightRectParent.id=this.documentHelper.owner.containerId+"_BottomRightRectParent",this.applyProperties(t.bottomRightRectParent),t.bottomRightRectParent.style.width=this.documentHelper.isTouchInput?"30px":"14px",t.bottomRightRectParent.style.height=this.documentHelper.isTouchInput?"30px":"14px",t.bottomRightRectParent.style.opacity="-1",e.appendChild(t.bottomRightRectParent),t.bottomRightRect=document.createElement("div"),t.bottomRightRect.id=this.documentHelper.owner.containerId+"_BottomRightRect",t.bottomRightRect.style.cursor="se-resize",this.applyProperties(t.bottomRightRect),e.appendChild(t.bottomRightRect),t.bottomLeftRectParent=document.createElement("div"),t.bottomLeftRectParent.style.cursor="sw-resize",t.bottomLeftRectParent.id=this.documentHelper.owner.containerId+"_BottomLeftRectParent",this.applyProperties(t.bottomLeftRectParent),t.bottomLeftRectParent.style.width=this.documentHelper.isTouchInput?"30px":"14px",t.bottomLeftRectParent.style.height=this.documentHelper.isTouchInput?"30px":"14px",t.bottomLeftRectParent.style.opacity="-1",e.appendChild(t.bottomLeftRectParent),t.bottomLeftRect=document.createElement("div"),t.bottomLeftRect.id=this.documentHelper.owner.containerId+"_BottomLeftRect",t.bottomLeftRect.style.cursor="sw-resize",this.applyProperties(t.bottomLeftRect),e.appendChild(t.bottomLeftRect),t.bottomMiddleRectParent=document.createElement("div"),t.bottomMiddleRectParent.style.cursor="s-resize",t.bottomMiddleRectParent.id=this.documentHelper.owner.containerId+"_BottomMiddleRectParent",this.applyProperties(t.bottomMiddleRectParent),t.bottomMiddleRectParent.style.width=this.documentHelper.isTouchInput?"30px":"14px",t.bottomMiddleRectParent.style.height=this.documentHelper.isTouchInput?"30px":"14px",t.bottomMiddleRectParent.style.opacity="-1",e.appendChild(t.bottomMiddleRectParent),t.bottomMiddleRect=document.createElement("div"),t.bottomMiddleRect.id=this.documentHelper.owner.containerId+"_BottomMiddleRect",t.bottomMiddleRect.style.cursor="s-resize",this.applyProperties(t.bottomMiddleRect),e.appendChild(t.bottomMiddleRect),t.rightMiddleRectParent=document.createElement("div"),t.rightMiddleRectParent.style.cursor="e-resize",t.rightMiddleRectParent.id=this.documentHelper.owner.containerId+"_RightMiddleRectParent",this.applyProperties(t.rightMiddleRectParent),t.rightMiddleRectParent.style.width=this.documentHelper.isTouchInput?"30px":"14px",t.rightMiddleRectParent.style.height=this.documentHelper.isTouchInput?"30px":"14px",t.rightMiddleRectParent.style.opacity="-1",e.appendChild(t.rightMiddleRectParent),t.rightMiddleRect=document.createElement("div"),t.rightMiddleRect.id=this.documentHelper.owner.containerId+"_RightMiddleRect",t.rightMiddleRect.style.cursor="e-resize",this.applyProperties(t.rightMiddleRect),e.appendChild(t.rightMiddleRect),t.leftMiddleRectParent=document.createElement("div"),t.leftMiddleRectParent.style.cursor="w-resize",t.leftMiddleRectParent.id=this.documentHelper.owner.containerId+"_LeftMiddleRectParent",this.applyProperties(t.leftMiddleRectParent),t.leftMiddleRectParent.style.width=this.documentHelper.isTouchInput?"30px":"14px",t.leftMiddleRectParent.style.height=this.documentHelper.isTouchInput?"30px":"14px",t.leftMiddleRectParent.style.opacity="-1",e.appendChild(t.leftMiddleRectParent),t.leftMiddleRect=document.createElement("div"),t.leftMiddleRect.id=this.documentHelper.owner.containerId+"_LeftMiddleRect",t.leftMiddleRect.style.cursor="w-resize",this.applyProperties(t.leftMiddleRect),e.appendChild(t.leftMiddleRect),t.resizeContainerDiv},e.prototype.setImageResizerPosition=function(e,t,i,n,r){r.resizeContainerDiv.style.width=i+"px",r.resizeContainerDiv.style.height=n+"px",r.resizeContainerDiv.style.left=e+"px",r.resizeContainerDiv.style.top=t+"px",r.topRightRect.style.left=e+i-5+"px",r.topRightRect.style.top=t-4+"px",r.topLeftRect.style.left=e-5+"px",r.topLeftRect.style.top=t-4+"px",r.topMiddleRect.style.left=parseFloat(r.topLeftRect.style.left)+i/2-4+"px",r.topMiddleRect.style.top=t-4+"px",r.bottomRightRect.style.left=r.topRightRect.style.left,r.bottomRightRect.style.top=parseFloat(r.topRightRect.style.top)+n+"px",r.bottomLeftRect.style.left=r.topLeftRect.style.left,r.bottomLeftRect.style.top=parseFloat(r.topLeftRect.style.top)+n+"px",r.bottomMiddleRect.style.left=r.topMiddleRect.style.left,r.bottomMiddleRect.style.top=parseFloat(r.topMiddleRect.style.top)+n+"px",r.rightMiddleRect.style.left=e+i-4+"px",r.rightMiddleRect.style.top=parseFloat(r.topRightRect.style.top)+n/2+"px",r.leftMiddleRect.style.left=r.topLeftRect.style.left,r.leftMiddleRect.style.top=parseFloat(r.topLeftRect.style.top)+n/2+"px",r.topRightRectParent.style.left=this.documentHelper.isTouchInput?e+i-15+"px":e+i-8+"px",r.topRightRectParent.style.top=this.documentHelper.isTouchInput?t-15+"px":t-7+"px",r.topLeftRectParent.style.left=this.documentHelper.isTouchInput?e-15+"px":e-8+"px",r.topLeftRectParent.style.top=this.documentHelper.isTouchInput?t-15+"px":t-7+"px",r.topMiddleRectParent.style.left=parseFloat(r.topLeftRectParent.style.left)+i/2-4+"px",r.topMiddleRectParent.style.top=this.documentHelper.isTouchInput?t-15+"px":t-7+"px",r.bottomRightRectParent.style.left=r.topRightRectParent.style.left,r.bottomRightRectParent.style.top=parseFloat(r.topRightRectParent.style.top)+n+"px",r.bottomLeftRectParent.style.left=r.topLeftRectParent.style.left,r.bottomLeftRectParent.style.top=parseFloat(r.topLeftRectParent.style.top)+n+"px",r.bottomMiddleRectParent.style.left=r.topMiddleRectParent.style.left,r.bottomMiddleRectParent.style.top=parseFloat(r.topMiddleRectParent.style.top)+n+"px",r.rightMiddleRectParent.style.left=this.documentHelper.isTouchInput?e+i-15+"px":e+i-7+"px",r.rightMiddleRectParent.style.top=parseFloat(r.topRightRectParent.style.top)+n/2+"px",r.leftMiddleRectParent.style.left=r.topLeftRectParent.style.left,r.leftMiddleRectParent.style.top=parseFloat(r.topLeftRectParent.style.top)+n/2+"px",this.setImageResizingPoints(r),this.documentHelper.isTouchInput?this.applyPropertiesForTouch():this.applyPropertiesForMouse()},e.prototype.setImageResizingPoints=function(e){this.imageResizerPoints.resizeContainerDiv.x=parseFloat(e.resizeContainerDiv.style.left),this.imageResizerPoints.resizeContainerDiv.y=parseFloat(e.resizeContainerDiv.style.top),this.imageResizerPoints.bottomLeftRectParent.x=parseFloat(e.bottomLeftRectParent.style.left),this.imageResizerPoints.bottomLeftRectParent.y=parseFloat(e.bottomLeftRectParent.style.top),this.imageResizerPoints.bottomRightRectParent.x=parseFloat(e.bottomRightRectParent.style.left),this.imageResizerPoints.bottomRightRectParent.y=parseFloat(e.bottomRightRectParent.style.top),this.imageResizerPoints.bottomMiddleRectParent.x=parseFloat(e.bottomMiddleRectParent.style.left),this.imageResizerPoints.bottomMiddleRectParent.y=parseFloat(e.bottomMiddleRectParent.style.top),this.imageResizerPoints.topLeftRectParent.x=parseFloat(e.topLeftRectParent.style.left),this.imageResizerPoints.topLeftRectParent.y=parseFloat(e.topLeftRectParent.style.top),this.imageResizerPoints.topRightRectParent.x=parseFloat(e.topRightRectParent.style.left),this.imageResizerPoints.topRightRectParent.y=parseFloat(e.topRightRectParent.style.top),this.imageResizerPoints.topMiddleRectParent.x=parseFloat(e.topMiddleRectParent.style.left),this.imageResizerPoints.topMiddleRectParent.y=parseFloat(e.topMiddleRectParent.style.top),this.imageResizerPoints.leftMiddleRectParent.x=parseFloat(e.leftMiddleRectParent.style.left),this.imageResizerPoints.leftMiddleRectParent.y=parseFloat(e.leftMiddleRectParent.style.top),this.imageResizerPoints.rightMiddleRectParent.x=parseFloat(e.rightMiddleRectParent.style.left),this.imageResizerPoints.rightMiddleRectParent.y=parseFloat(e.rightMiddleRectParent.style.top)},e.prototype.initResizeContainerDiv=function(e){e.resizeContainerDiv=document.createElement("div"),e.resizeContainerDiv.id=this.documentHelper.owner.containerId+"_ResizeDivElement",e.resizeContainerDiv.style.position="absolute",e.resizeContainerDiv.style.border="1px solid #bfbfbf",e.resizeContainerDiv.style.zIndex="30",e.resizeContainerDiv.style.backgroundColor="transparent",e.resizeContainerDiv.style.display="block"},e.prototype.applyProperties=function(e){e.style.position="absolute",e.style.width="8px",e.style.height="8px",e.style.fontSize="0px",e.style.zIndex=" 551",e.style.backgroundColor="#ffffff",e.style.border="1px solid #bfbfbf",e.style.boxShadow="0 1px 2px 0 #bfbfbf 0.35",e.style.color="#000000"},e.prototype.handleImageResizing=function(e,i,n){i/=this.documentHelper.zoomFactor,n/=this.documentHelper.zoomFactor,this.leftValue=t.isNullOrUndefined(this.leftValue)?i:this.leftValue,this.topValue=t.isNullOrUndefined(this.topValue)?n:this.topValue;var r,o=this.selectedResizeElement.id.split("_"),s=o[o.length-1];switch(s){case"TopRightRectParent":i=(r=this.topRightResizing(e)).left,n=r.top;break;case"TopLeftRectParent":i=-(r=this.topLeftResizing(e)).left,n=-r.top;break;case"TopMiddleRectParent":i=0,n=this.topMiddleResizing(e);break;case"BottomRightRectParent":i=(r=this.bottomRightResizing(e)).left,n=r.top;break;case"BottomLeftRectParent":i=-(r=this.bottomLeftResizing(e)).left,n=-r.top;break;case"BottomMiddleRectParent":n=e.y-n,i=0;break;case"RightMiddleRectParent":i=e.x-i,n=0;break;case"LeftMiddleRectParent":i=this.leftMiddleResizing(e),n=0}if(0!==i||0!==n){var a=this.currentImageElementBox.line.paragraph,l=this.currentImageElementBox;if(!t.isNullOrUndefined(a)&&a.isInsideTable){var d=a.containerWidget;if(!t.isNullOrUndefined(d)){var h=d.containerWidget,c=L.convertPointToPixel(l.height),p=h.height-c;n>0&&h.y+p+c+n>this.viewer.clientArea.bottom&&(this.isImageMoveToNextPage=!0)}}if(this.owner.enableHistoryMode&&this.initHistoryForImageResizer(this.currentImageElementBox),!t.isNullOrUndefined(this.currentImageElementBox)){var g=this.currentImageElementBox.width+i>10?this.currentImageElementBox.width+i:10,u=this.currentImageElementBox.height+n>10?this.currentImageElementBox.height+n:10;"BottomRightRectParent"!==s&&"TopRightRectParent"!==s&&"BottomLeftRectParent"!==s&&"TopLeftRectParent"!==s||(u=this.currentImageElementBox.height/this.currentImageElementBox.width*g,g=this.currentImageElementBox.width/this.currentImageElementBox.height*u),this.currentImageElementBox.width=g,this.currentImageElementBox.height=u;this.currentImageElementBox.line.paragraph;this.positionImageResizer(this.currentImageElementBox)}this.isImageResizing=!0}},e.prototype.handleImageResizingOnMouse=function(e){if(!t.isNullOrUndefined(this.selectedResizeElement)){var i=parseFloat(this.selectedResizeElement.style.left),n=parseFloat(this.selectedResizeElement.style.top),r=new R(e.offsetX,e.offsetY),o=this.viewer.findFocusedPage(r,!0);this.handleImageResizing(o,i,n)}},e.prototype.topMiddleResizing=function(e){var t;return this.topValue>=e.y?(t=this.topValue/e.y,this.topValue=e.y,this.viewer instanceof le&&this.topValue<=this.viewer.pageGap&&(t=1)):(t=-e.y/this.topValue,this.topValue=e.y,0===this.topValue&&(t=-1)),t},e.prototype.leftMiddleResizing=function(e){var t;return this.leftValue>=e.x?(t=this.leftValue/e.x,this.leftValue=e.x,0===this.leftValue&&(t=1,this.leftValue=parseFloat(this.selectedResizeElement.style.left))):(t=-e.x/this.leftValue,this.leftValue=e.x),t},e.prototype.topRightResizing=function(e){return this.leftValue<=e.x&&this.topValue>=e.y?this.getOuterResizingPoint(e):this.getInnerResizingPoint(e)},e.prototype.topLeftResizing=function(e){return this.leftValue>=e.x&&this.topValue>=e.y?this.getOuterResizingPoint(e):this.getInnerResizingPoint(e)},e.prototype.bottomRightResizing=function(e){return this.leftValue<=e.x&&this.topValue<=e.y?this.getOuterResizingPoint(e):this.getInnerResizingPoint(e)},e.prototype.bottomLeftResizing=function(e){return this.leftValue>=e.x&&this.topValue<=e.y?this.getOuterResizingPoint(e):this.getInnerResizingPoint(e)},e.prototype.getOuterResizingPoint=function(e){var t,i;return t=e.x-this.leftValue,this.leftValue=e.x,i=e.y-this.topValue,this.topValue=e.y,{left:t,top:i}},e.prototype.getInnerResizingPoint=function(e){var t,i;return t=-(this.leftValue-e.x),this.leftValue=e.x,i=-(this.topValue-e.y),this.topValue=e.y,{left:t,top:i}},e.prototype.handleImageResizingOnTouch=function(e){if(!t.isNullOrUndefined(this.selectedResizeElement)){var i=parseFloat(this.selectedResizeElement.style.left)+24,n=parseFloat(this.selectedResizeElement.style.top)+24,r=e.touches,o=new R(r[0].clientX,r[0].clientY),s=this.viewer.findFocusedPage(o,!0);if(t.isNullOrUndefined(this.currentImageElementBox)||t.isNullOrUndefined(this.currentImageElementBox))return;this.handleImageResizing(s,i,n)}},e.prototype.getImagePoint=function(e){var i=this.documentHelper.render.getScaledValue(e.x,1),n=this.documentHelper.render.getScaledValue(e.y,2);e=new R(i,n);var r=this.imageResizerPoints,o="",s=void 0,a=r.bottomMiddleRectParent,l=r.bottomRightRectParent,d=r.bottomLeftRectParent,h=r.topMiddleRectParent,c=r.topRightRectParent,p=r.topLeftRectParent,g=r.rightMiddleRectParent,u=r.leftMiddleRectParent;return t.isNullOrUndefined(this.bottomMiddleRectParent)||"none"===this.bottomMiddleRectParent.style.display||(e.x>a.x&&e.x<=a.x+15&&e.y>a.y&&e.y<=a.y+15?(s=this.bottomMiddleRectParent,o="s-resize"):e.x>l.x&&e.x<=l.x+15&&e.y>l.y&&e.y<=l.y+15?(s=this.bottomRightRectParent,o="se-resize"):e.x>d.x&&e.x<=d.x+15&&e.y>d.y&&e.y<=d.y+15?(s=this.bottomLeftRectParent,o="sw-resize"):e.x>h.x&&e.x<=h.x+15&&e.y>h.y&&e.y<=h.y+15?(s=this.topMiddleRectParent,o="n-resize"):e.x>c.x&&e.x<=c.x+15&&e.y>c.y&&e.y<=c.y+15?(s=this.topRightRectParent,o="ne-resize"):e.x>p.x&&e.x<=p.x+15&&e.y>p.y&&e.y<=p.y+15?(s=this.topLeftRectParent,o="nw-resize"):e.x>u.x&&e.x<=u.x+15&&e.y>u.y&&e.y<=u.y+15?(s=this.leftMiddleRectParent,o="w-resize"):e.x>g.x&&e.x<=g.x+15&&e.y>g.y&&e.y<=g.y+15?(s=this.rightMiddleRectParent,o="e-resize"):!t.isNullOrUndefined(this.resizeContainerDiv)&&e.x>parseFloat(this.resizeContainerDiv.style.left)&&e.x<=parseFloat(this.resizeContainerDiv.style.left)+parseFloat(this.resizeContainerDiv.style.width)&&e.y>parseFloat(this.resizeContainerDiv.style.top)&&e.y<=parseFloat(this.resizeContainerDiv.style.top)+parseFloat(this.resizeContainerDiv.style.height)&&(o="move")),{selectedElement:s,resizePosition:o}},e.prototype.applyPropertiesForMouse=function(){t.isNullOrUndefined(this.bottomLeftRectParent)||(this.bottomMiddleRectParent.style.width="14px",this.bottomMiddleRectParent.style.height="14px",this.bottomRightRectParent.style.width="14px",this.bottomRightRectParent.style.height="14px",this.bottomLeftRectParent.style.width="14px",this.bottomLeftRectParent.style.height="14px",this.topMiddleRectParent.style.width="14px",this.topMiddleRectParent.style.height="14px",this.topRightRectParent.style.width="14px",this.topRightRectParent.style.height="14px",this.topLeftRectParent.style.width="14px",this.topLeftRectParent.style.height="14px",this.leftMiddleRectParent.style.width="14px",this.leftMiddleRectParent.style.height="14px",this.rightMiddleRectParent.style.width="14px",this.rightMiddleRectParent.style.height="14px")},e.prototype.getImagePointOnTouch=function(e){var i=this.documentHelper.render.getScaledValue(e.x,1),n=this.documentHelper.render.getScaledValue(e.y,2);e=new R(i,n);var r=this.imageResizerPoints,o="",s=void 0,a=r.bottomMiddleRectParent,l=r.bottomRightRectParent,d=r.bottomLeftRectParent,h=r.topMiddleRectParent,c=r.topRightRectParent,p=r.topLeftRectParent,g=r.rightMiddleRectParent,u=r.leftMiddleRectParent;return t.isNullOrUndefined(this.bottomMiddleRectParent)||"none"===this.bottomMiddleRectParent.style.display||(e.x>a.x&&e.x<=a.x+25&&e.y>a.y&&e.y<=a.y+25?(s=this.bottomMiddleRectParent,o="s-resize"):e.x>l.x&&e.x<=l.x+25&&e.y>l.y&&e.y<=l.y+25?(s=this.bottomRightRectParent,o="se-resize"):e.x>d.x&&e.x<=d.x+25&&e.y>d.y&&e.y<=d.y+25?(s=this.bottomLeftRectParent,o="sw-resize"):e.x>h.x&&e.x<=h.x+25&&e.y>h.y&&e.y<=h.y+25?(s=this.topMiddleRectParent,o="n-resize"):e.x>c.x&&e.x<=c.x+25&&e.y>c.y&&e.y<=c.y+25?(s=this.topRightRectParent,o="ne-resize"):e.x>p.x&&e.x<=p.x+25&&e.y>p.y&&e.y<=p.y+25?(s=this.topLeftRectParent,o="nw-resize"):e.x>u.x&&e.x<=u.x+25&&e.y>u.y&&e.y<=u.y+25?(s=this.leftMiddleRectParent,o="w-resize"):e.x>g.x&&e.x<=g.x+25&&e.y>g.y&&e.y<=g.y+25?(s=this.rightMiddleRectParent,o="e-resize"):!t.isNullOrUndefined(this.resizeContainerDiv)&&e.x>parseFloat(this.resizeContainerDiv.style.left)&&e.x<=parseFloat(this.resizeContainerDiv.style.left)+parseFloat(this.resizeContainerDiv.style.width)&&e.y>parseFloat(this.resizeContainerDiv.style.top)&&e.y<=parseFloat(this.resizeContainerDiv.style.top)+parseFloat(this.resizeContainerDiv.style.height)&&(o="move")),{selectedElement:s,resizePosition:o}},e.prototype.applyPropertiesForTouch=function(){t.isNullOrUndefined(this.bottomLeftRectParent)||(this.bottomMiddleRectParent.style.width="30px",this.bottomMiddleRectParent.style.height="30px",this.bottomRightRectParent.style.width="30px",this.bottomRightRectParent.style.height="30px",this.bottomLeftRectParent.style.width="30px",this.bottomLeftRectParent.style.height="30px",this.topMiddleRectParent.style.width="30px",this.topMiddleRectParent.style.height="30px",this.topRightRectParent.style.width="30px",this.topRightRectParent.style.height="30px",this.topLeftRectParent.style.width="30px",this.topLeftRectParent.style.height="30px",this.leftMiddleRectParent.style.width="30px",this.leftMiddleRectParent.style.height="30px",this.rightMiddleRectParent.style.width="30px",this.rightMiddleRectParent.style.height="30px")},e.prototype.mouseUpInternal=function(){this.currentImageElementBox.width=parseFloat(this.imageResizerDiv.style.width)/this.documentHelper.zoomFactor,this.currentImageElementBox.height=parseFloat(this.imageResizerDiv.style.height)/this.documentHelper.zoomFactor,this.owner.isShiftingEnabled=!0,this.owner.editorModule.setOffsetValue(this.owner.selection),this.documentHelper.layout.reLayoutParagraph(this.currentImageElementBox.line.paragraph,0,0),this.updateHistoryForImageResizer(),this.owner.editorModule.reLayout(this.owner.selection,!0),this.viewer.updateScrollBars()},e.prototype.initHistoryForImageResizer=function(e){!t.isNullOrUndefined(this.owner)&&t.isNullOrUndefined(this.baseHistoryInfo)&&(this.baseHistoryInfo=new $t(this.owner),this.baseHistoryInfo.action="ImageResizing",this.baseHistoryInfo.updateSelection(),this.baseHistoryInfo.modifiedProperties.push(new Bt(e)))},e.prototype.updateHistoryForImageResizer=function(){if(!t.isNullOrUndefined(this.owner)&&!t.isNullOrUndefined(this.baseHistoryInfo)){var e=this.baseHistoryInfo.modifiedProperties[0];this.currentImageElementBox.width===e.width&&this.currentImageElementBox.height===e.height?this.baseHistoryInfo.modifiedProperties.pop():this.owner.editorHistory.recordChanges(this.baseHistoryInfo),this.baseHistoryInfo=void 0}},e.prototype.updateImageResizerPosition=function(){if(!t.isNullOrUndefined(this.currentImageElementBox)){var e,i=(this.currentImageElementBox,this.currentImageElementBox),n=i.line,r=void 0,o=void 0,s=void 0;this.currentImageElementBox instanceof Ze?(e=this.documentHelper.selection.getTop(n)+i.margin.top,r=this.documentHelper.selection.getLeftInternal(n,i,0),o=e*this.documentHelper.zoomFactor,s=r*this.documentHelper.zoomFactor):(s=i.x*this.documentHelper.zoomFactor,o=i.y*this.documentHelper.zoomFactor);var a=this.documentHelper.render.getScaledValue(i.height,2),l=this.documentHelper.render.getScaledValue(i.width,1);this.setImageResizerPosition(s,o,l,a,this)}},e.prototype.destroy=function(){t.isNullOrUndefined(this.resizeContainerDiv)||(this.resizeContainerDiv.innerHTML=""),t.isNullOrUndefined(this.topLeftRect)||(this.topLeftRect.innerHTML=""),t.isNullOrUndefined(this.topMiddleRect)||(this.topMiddleRect.innerHTML=""),t.isNullOrUndefined(this.topRightRect)||(this.topRightRect.innerHTML=""),t.isNullOrUndefined(this.bottomLeftRect)||(this.bottomLeftRect.innerHTML=""),t.isNullOrUndefined(this.bottomMiddleRect)||(this.bottomMiddleRect.innerHTML=""),t.isNullOrUndefined(this.bottomRightRect)||(this.bottomRightRect.innerHTML=""),t.isNullOrUndefined(this.leftMiddleRect)||(this.leftMiddleRect.innerHTML=""),t.isNullOrUndefined(this.rightMiddleRect)||(this.rightMiddleRect.innerHTML=""),t.isNullOrUndefined(this.imageResizerDiv)||(this.imageResizerDiv.innerHTML=""),t.isNullOrUndefined(this.selectedImageWidget)||this.selectedImageWidget.destroy(),t.isNullOrUndefined(this.imageResizerDivElement)||(this.imageResizerDivElement.innerHTML=""),this.imageResizerDivElement=void 0,this.resizeContainerDiv=void 0,this.topLeftRect=void 0,this.topMiddleRect=void 0,this.topRightRect=void 0,this.bottomLeftRect=void 0,this.bottomMiddleRect=void 0,this.bottomRightRect=void 0,this.leftMiddleRect=void 0,this.rightMiddleRect=void 0,this.imageResizerDiv=void 0,this.selectedImageWidget=void 0,this.isImageResizing=!1,this.isImageResizerVisible=!1,this.currentImageElementBoxIn=void 0,this.resizeMarkSizeIn=void 0,this.documentHelper=void 0,this.owner=void 0},e}(),si=function(){function e(){this.resizeContainerDiv=new R(0,0),this.topLeftRectParent=new R(0,0),this.topMiddleRectParent=new R(0,0),this.topRightRectParent=new R(0,0),this.bottomLeftRectParent=new R(0,0),this.bottomMiddleRectParent=new R(0,0),this.bottomRightRectParent=new R(0,0),this.leftMiddleRectParent=new R(0,0),this.rightMiddleRectParent=new R(0,0)}return e}(),ai=function(){function e(e,t){this.heightIn=0,this.widthIn=0,this.heightIn=e,this.widthIn=t}return Object.defineProperty(e.prototype,"height",{get:function(){return this.heightIn},set:function(e){this.heightIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.widthIn},set:function(e){this.widthIn=e},enumerable:!0,configurable:!0}),e}(),li=function(){function e(e){this.version=0,this.owner=e}return Object.defineProperty(e.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){return this.owner.selection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collaborativeEditingSettings",{get:function(){return this.owner.documentEditorSettings.collaborativeEditingSettings},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"CollaborativeEditing"},e.prototype.updateAction=function(e){Array.isArray(e)||(e=[e]);for(var t=0;t<e.length;t++){var i=e[t];switch(i.action){case"LockContent":this.transFormLockRegion(i),this.lockRegion(i.selectionInfo.start,i.selectionInfo.end,i.author);break;case"SaveContent":this.version=i.version,this.updateRegion(i.author,i.data);break;case"UnlockContent":this.version=i.version,this.updateRegion(i.author,i.data),this.removeEditRange(i.author)}}},e.prototype.transFormLockRegion=function(e){var i=e.selectionInfo.previousLockInfo;if(!t.isNullOrUndefined(i)){var n=i.author,r=0,o=0;if(this.documentHelper.editRanges.containsKey(n)){var s=this.documentHelper.editRanges.get(n);if(s.length>0){var a=this.selection.getPosition(s[0]),l=this.selection.getHierarchicalIndexByPosition(a.endPosition).split(";"),d=i.end.split(";");r=parseInt(l[0],10)-parseInt(d[0],10),o=parseInt(l[1],10)-parseInt(d[1],10),e.selectionInfo.start.split(";")[0]===i.end.split(";")[0]?(e.selectionInfo.start=this.tranformPosition(e.selectionInfo.start,r,o),e.selectionInfo.end=this.tranformPosition(e.selectionInfo.end,r,o)):(e.selectionInfo.start=this.tranformPosition(e.selectionInfo.start,r,0),e.selectionInfo.end=this.tranformPosition(e.selectionInfo.end,r,0))}}}},e.prototype.lockContent=function(e){var i=this;if(this.canLock()){var n=this.owner.selection.start,r=this.owner.selection.end;if(this.owner.selection.isForward||(n=this.owner.selection.end,r=this.owner.selection.start),n.paragraph.isInsideTable){var o=this.owner.documentHelper.layout.getParentTable(n.paragraph),s=this.owner.selection.getFirstParagraphBlock(o);n.setPosition(s.childWidgets[0],!0)}else n.paragraphStartInternal(this.owner.selection,!1);if(r.paragraph.isInsideTable){var o=this.owner.documentHelper.layout.getParentTable(r.paragraph),a=this.owner.selection.getLastParagraphBlock(o),l=a.lastChild.getEndOffset();r.setPositionParagraph(a.lastChild,l)}else r.moveToParagraphEndInternal(this.owner.selection,!1);var d=this.owner.selection.getHierarchicalIndexByPosition(n),h=this.owner.selection.getHierarchicalIndexByPosition(r),c={start:d,end:h,roomName:this.owner.documentEditorSettings.collaborativeEditingSettings.roomName,author:t.isNullOrUndefined(e)?this.owner.currentUser:e,version:this.version},p=this.selection.getParagraphInfo(n),g=this.selection.getParagraphInfo(r);this.owner.selection.select(d,h);var u=new v;u.url=this.owner.serviceUrl+this.owner.serverActionSettings.canLock,u.contentType="application/json;charset=UTF-8",u.onSuccess=function(e){i.successHandler(e,c,p,g)},u.onFailure=this.failureHandler.bind(this),u.onError=this.failureHandler.bind(this),u.customHeaders=this.owner.headers,u.send(c)}},e.prototype.canLock=function(){var e=this.documentHelper.editRanges;if(e.containsKey(this.owner.currentUser))return!1;for(var i=e.keys,n=0;n<i.length;n++){var r=e.get(i[n]);if(!t.isNullOrUndefined(r)&&r.length>0&&this.isSelectionInEditableRange(r[0]))return!1}return!0},e.prototype.getPreviousLockedRegion=function(){var e=this.documentHelper.editRanges;if(!e.containsKey(this.owner.currentUser)){for(var i,n=e.keys,r=0;r<n.length;r++){var o=e.get(n[r])[0],s=this.selection.getPosition(o).startPosition;s.isExistBefore(this.selection.start)&&(t.isNullOrUndefined(i)?i=o:s.isExistAfter(this.selection.getPosition(i).startPosition)&&(i=o))}return i}},e.prototype.unlockContent=function(e){if(this.documentHelper.editRanges.containsKey(e)){this.saveTimer&&clearTimeout(this.saveTimer);var t=JSON.stringify(this.serializeEditableRegion(e)),i={action:"UnlockContent",author:e,version:this.version,data:t,selectionInfo:{start:"",end:"",roomName:this.collaborativeEditingSettings.roomName,author:this.owner.currentUser,version:this.version},roomName:this.collaborativeEditingSettings.roomName};this.removeEditRange(e),this.owner.editorHistory.clearHistory(),this.owner.fireContentChange(),this.owner.trigger("actionComplete",i)}},e.prototype.removeEditRange=function(e){this.documentHelper.editRanges.containsKey(e)&&(this.updateLockRegion(e,!1),this.owner.editor.removeUserRestrictionsInternal(this.documentHelper.editRanges.get(e)[0]),this.documentHelper.clearContent(),this.selection.updateEditRangeCollection(),this.documentHelper.owner.viewer.updateScrollBars())},e.prototype.saveContent=function(){var e=this;this.saveTimer&&clearTimeout(this.saveTimer);var i=this.collaborativeEditingSettings.saveTimeout;t.isNullOrUndefined(i)&&(i=3e3),this.saveTimer=setTimeout(function(){e.saveContentInternal()},i)},e.prototype.saveContentInternal=function(){if(this.documentHelper.editRanges.containsKey(this.owner.currentUser)){var e=this.documentHelper.editRanges.get(this.owner.currentUser)[0],t=this.selection.getPosition(e),i={action:"SaveContent",author:this.owner.currentUser,version:this.version,data:JSON.stringify(this.serializeEditableRegion(this.owner.currentUser)),selectionInfo:{start:this.selection.getHierarchicalIndexByPosition(t.startPosition),end:this.selection.getHierarchicalIndexByPosition(t.endPosition),roomName:this.collaborativeEditingSettings.roomName,author:this.owner.currentUser,version:this.version},roomName:this.collaborativeEditingSettings.roomName};this.owner.trigger("actionComplete",i)}},e.prototype.serializeEditableRegion=function(e){var t=this.documentHelper.editRanges.get(e)[0],i=t.editRangeEnd,n=new kt(this.owner);n.setPosition(t.line,!0);var r=new kt(this.owner);r.setPosition(i.line,!1),this.owner.sfdtExportModule.isPartialExport=!0;var o=this.owner.sfdtExportModule.write(n.currentWidget,n.offset,r.currentWidget,r.offset,!1);return this.owner.sfdtExportModule.isPartialExport=!1,o},e.prototype.successHandler=function(e,i,r,o){if(JSON.parse(e.data).canLock){i.start=this.selection.getHierarchicalIndex(r.paragraph,r.offset.toString()),i.end=this.selection.getHierarchicalIndex(o.paragraph,o.offset.toString());var s=this.getPreviousLockedRegion();if(s){var a=this.selection.getPosition(s);i.previousLockInfo={start:this.selection.getHierarchicalIndexByPosition(a.startPosition),end:this.selection.getHierarchicalIndexByPosition(a.endPosition),author:s.user,roomName:"",version:0}}var l={action:"LockContent",selectionInfo:i,author:this.owner.currentUser,version:this.version,data:"",roomName:this.collaborativeEditingSettings.roomName};this.owner.trigger("actionComplete",l)}else{var d=new t.L10n("documenteditor",this.owner.defaultLocale);d.setLocale(this.owner.locale),n.DialogUtility.alert({content:d.getConstant("Already locked"),closeOnEscape:!0,showCloseIcon:!0,position:{X:"Center",Y:"Center"}})}},e.prototype.failureHandler=function(){var e=new t.L10n("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),n.DialogUtility.alert({content:e.getConstant("Error in establishing connection with web server"),closeOnEscape:!0,showCloseIcon:!0,position:{X:"Center",Y:"Center"}})},e.prototype.lockRegion=function(e,t,i){var n=this.selection.getTextPosBasedOnLogicalIndex(e),r=this.selection.getTextPosBasedOnLogicalIndex(t);this.lockRegionInternal(n,r,i)},e.prototype.lockRegionInternal=function(e,t,i){var n=this.owner.editor.addEditElement(i),r=n.editRangeEnd;this.insertElements(e,t,[r],[n]),this.updateLockInfo(n.paragraph,r.paragraph,i,!0),this.owner.viewer.updateScrollBars()},e.prototype.insertElements=function(e,i,n,r){t.isNullOrUndefined(r)||this.insertElementsInternal(e,r),t.isNullOrUndefined(n)||this.insertElementsInternal(i,n)},e.prototype.insertElementsInternal=function(e,t){var i=0;if(e.paragraph.isEmpty()){var n=e.paragraph;n.childWidgets[0].children.push(t[0]),t[0].line=n.childWidgets[0],this.documentHelper.layout.reLayoutParagraph(n,0,0)}else{var r=e.currentWidget.getInline(e.offset,i),o=r.element;i=r.index;var s=t[0];this.insertElementInternal(o,s,i);for(var a=s.indexInOwner,l=s,d=1;d<t.length;d++)l=t[d],s.line.children.splice(a+d,0,l)}},e.prototype.insertElementInternal=function(e,i,n){var r=e.line,o=r.paragraph,s=e.indexInOwner,a=o.paragraphFormat.bidi&&e.isRightToLeft;n===e.length?(a||s++,r.children.splice(s,0,i)):0===n&&(t.isNullOrUndefined(e.previousNode)?(r.children.splice(0,0,i),s=0):r.children.splice(s,0,i)),i.line=e.line},e.prototype.setEditableRegion=function(){if(this.documentHelper.editRanges.containsKey(this.owner.currentUser)){var e=this.documentHelper.editRanges.get(this.owner.currentUser)[0],t=this.getParentBlock(e.paragraph);this.lockStart=this.owner.selection.getHierarchicalIndex(t,"0").split(";")}},e.prototype.isSelectionInEditableRange=function(e){var i;if(!t.isNullOrUndefined(this.owner.selection)){var n=this.owner.selection.start,r=this.owner.selection.end;this.owner.selection.isForward||(n=(i=[r,n])[0],r=i[1]);var o=this.owner.selection.getPosition(e);if((n.isExistAfter(o.startPosition)||n.isAtSamePosition(o.startPosition))&&(r.isExistBefore(o.endPosition)||r.isAtSamePosition(o.endPosition))||(o.startPosition.isExistAfter(n)||o.startPosition.isAtSamePosition(n))&&(o.endPosition.isExistBefore(r)||o.endPosition.isAtSamePosition(r))||o.startPosition.isExistAfter(n)&&o.startPosition.isExistBefore(r)&&(r.isExistAfter(o.endPosition)||r.isExistBefore(o.endPosition))||o.endPosition.isExistBefore(r)&&o.endPosition.isExistAfter(n)&&(n.isExistBefore(o.startPosition)||n.isExistAfter(o.startPosition)))return!0}return!1},e.prototype.updateRegion=function(e,i){if(this.documentHelper.editRanges.containsKey(e)){var n=this.documentHelper.editRanges.get(e);1===n.length&&(this.documentHelper.editRanges.remove(e),n[0].removeEditRangeMark()),this.setEditableRegion();var r=n[0],o=r.editRangeEnd,s=this.getParentBlock(r.paragraph),a=this.getParentBlock(o.paragraph),l=this.isSelectionInEditableRange(r),d=void 0,h=void 0;this.owner.editor.isRemoveRevision=!0,l||(d=this.owner.selection.getParagraphInfo(this.owner.selection.start),h=this.owner.selection.getParagraphInfo(this.owner.selection.end));for(var c=[];a!==s;){var p=a.combineWidget(this.owner.viewer);(a=p.previousRenderedWidget).bodyWidget.index!==p.bodyWidget.index&&c.push(p.bodyWidget);f=p.containerWidget.childWidgets[p.indexInOwner];this.removeDuplicateCollection(f),p.containerWidget.removeChild(p.indexInOwner)}if(!t.isNullOrUndefined(s)){var g=s.index,u=s.containerWidget;c.push(u);var m=s.containerWidget.childWidgets.indexOf(s),f=u.childWidgets[m];u.removeChild(m),this.removeDuplicateCollection(f);var v=[],y=[],b=[];if(this.owner.editor.isPasteListUpdated=!1,this.owner.editor.getBlocks(JSON.parse(i),!1,y,v,b),c.length!==y.length){if(1===c.length){F=c[0];c.unshift(this.owner.editor.splitBodyWidget(F,y[y.length-2].sectionFormat,F.childWidgets[m-1]))}if(c.length<y.length)for(var w=1;w<y.length-1;w++){var C=new bt(this.owner.documentHelper),F=new fe;C.bodyWidgets.push(F),F.page=C,c.splice(w,0,F),F.index=c[w-1].index,F.sectionFormat=new x(F),F.sectionFormat.copyFormat(y[w].sectionFormat);var P=c[w-1].page.index;if(this.documentHelper.insertPage(P,C),this.owner.editor.updateSectionIndex(c[w-1].sectionFormat,c[w-1],!0),c.length===y.length)break}}for(O=0;O<c.length;O++){var T=c[O],S=0,I=0;O===c.length-1&&(S=g,I=m);for(var N=y[O].childWidgets,E=0;E<N.length;E++)N[E].containerWidget=T,N[E].index=S,T.childWidgets.splice(I,0,N[E]),I++,S++;(a=N[N.length-1]).nextRenderedWidget&&a.nextRenderedWidget.index!==a.index&&this.updateNextBlocksIndex(a,!0),this.documentHelper.layout.layoutBodyWidgetCollection(N[0].index,T,void 0,!1)}for(var H=0;H<v.length;H++){var W=v[H];if(this.owner.editor.addCommentWidget(W,!1,this.owner.showComments,!1),W.replyComments.length>0)for(var O=0;O<W.replyComments.length;O++)this.owner.commentReviewPane.addReply(W.replyComments[O],!1,!1)}b.length>0&&this.updateRevisionCollection(b),this.owner.trackChangesPane.updateTrackChanges();var k=this.documentHelper.editRanges.get(e);if(l){if(k.length>0){var L=this.selection.getPosition(k[0]);this.selection.selectPosition(L.endPosition,L.endPosition)}}else this.tranformSelection(d,h);this.tranformHistoryPosition(),this.selection.updateEditRangeCollection(),this.updateLockRegion(e),this.documentHelper.removeEmptyPages(),this.owner.viewer.updateScrollBars(),this.owner.editor.isRemoveRevision=!1}}},e.prototype.updateRevisionCollection=function(e){var i=0,n=this.getRevisionTextPosition(e[0]),r=!1;if(this.owner.revisionsInternal.changes.length>0&&!t.isNullOrUndefined(n))for(var o=0;o<this.owner.revisionsInternal.changes.length;o++)if(this.getRevisionTextPosition(this.owner.revisionsInternal.changes[o]).isExistAfter(n)){i=o,r=!0;break}for(var s=0;s<e.length;s++)r?(this.owner.revisionsInternal.changes.splice(i,0,e[s]),i++):this.owner.revisionsInternal.changes.push(e[s])},e.prototype.getRevisionTextPosition=function(e){if(e.range.length>0){var t=e.range[0];if(t instanceof Se)return this.selection.getElementPosition(t).startPosition;if(t instanceof H){var i=t.ownerBase.firstChild.firstChild;if(i.bodyWidget)return this.selection.getTextPosBasedOnLogicalIndex(this.selection.getHierarchicalIndex(i,"0"))}else if(t instanceof k){var n=t.ownerBase;if(n.lastChild.paragraph.bodyWidget){var r=n.getLength(),o=new kt(this.owner);return o.setPositionParagraph(n.lastChild,r),o}}}},e.prototype.tranformSelection=function(e,t){this.documentHelper.skipScrollToPosition=!0;var i=this.selection.getHierarchicalIndex(e.paragraph,e.offset.toString()),n=this.selection.getHierarchicalIndex(t.paragraph,t.offset.toString());this.selection.select(i,n)},e.prototype.tranformHistoryPosition=function(){if(this.documentHelper.editRanges.containsKey(this.owner.currentUser)){var e=this.documentHelper.editRanges.get(this.owner.currentUser)[0],i=this.getParentBlock(e.paragraph),n=this.selection.getHierarchicalIndex(i,"0").split(";");if(!t.isNullOrUndefined(this.lockStart)&&this.lockStart.length>1){var r=parseInt(n[0],10)-parseInt(this.lockStart[0],10),o=parseInt(n[1],10)-parseInt(this.lockStart[1],10);this.transformHistory(r,o)}}},e.prototype.transformHistory=function(e,i){if(this.owner.enableEditorHistory){var n=this.owner.editorHistory.undoStack;if(!t.isNullOrUndefined(n))for(o=0;o<n.length;o++)this.transformBaseHistoryInfo(n[o],e,i);var r=this.owner.editorHistory.redoStack;if(!t.isNullOrUndefined(r))for(var o=0;o<r.length;o++)this.transformBaseHistoryInfo(r[o],e,i)}},e.prototype.transformBaseHistoryInfo=function(e,t,i){if(e.endPosition&&(e.endPosition=this.tranformPosition(e.endPosition,t,i)),e.insertPosition&&(e.insertPosition=this.tranformPosition(e.insertPosition,t,i)),e.selectionStart&&(e.selectionStart=this.tranformPosition(e.selectionStart,t,i)),e.selectionEnd&&(e.selectionEnd=this.tranformPosition(e.selectionEnd,t,i)),e instanceof ti)for(var n=e.modifiedActions,r=0;r<n.length;r++)this.transformBaseHistoryInfo(n[r],t,i)},e.prototype.tranformPosition=function(e,t,i){var n=e.split(";");return n[0]=(parseInt(n[0],10)+t).toString(),n[1]=(parseInt(n[1],10)+i).toString(),n.join(";")},e.prototype.getParentBlock=function(e){return e.isInsideTable&&(e=this.owner.documentHelper.layout.getParentTable(e)),e.combineWidget(this.owner.viewer)},e.prototype.removeDuplicateCollection=function(e){if(this.removeFieldInBlock(e,!1,!1),this.removeFieldInBlock(e,!0,!1),this.removeFieldInBlock(e,!1,!0),e instanceof xe){for(var t=0;t<e.childWidgets.length;t++)if(e.childWidgets[t]instanceof Fe){var i=e.childWidgets[t];this.owner.editor.removeDeletedCellRevision(i)}}else this.owner.editor.removeRevisionForBlock(e,void 0,!1,!1)},e.prototype.removeFieldInBlock=function(e,t,i){e instanceof xe?this.removeFieldTable(e,t,i):(this.owner.editor.removeField(e,t,i),this.removeComment(e))},e.prototype.removeFieldTable=function(e,t,i){for(var n=0;n<e.childWidgets.length;n++)for(var r=e.childWidgets[n],o=0;o<r.childWidgets.length;o++)for(var s=r.childWidgets[o],a=0;a<s.childWidgets.length;a++)this.removeFieldInBlock(s.childWidgets[a],t,i)},e.prototype.removeComment=function(e){if(this.documentHelper.comments.length>0)for(var t=0;t<this.documentHelper.comments.length;t++){var i=this.documentHelper.comments[t];i.commentStart.line.paragraph===e&&(this.documentHelper.comments.splice(t,1),this.owner.commentReviewPane.deleteComment(i),t--)}},e.prototype.updateNextBlocksIndex=function(e,t){var i=e.getSplitWidgets().pop().nextRenderedWidget,n=1;i.bodyWidget.index===e.bodyWidget.index&&(n=e.index-i.index+1);var r=e.containerWidget.childWidgets.indexOf(e)+1;if(e.containerWidget instanceof fe)for(var o=e.containerWidget.index,s=this.documentHelper.pages.indexOf(e.containerWidget.page);s<this.documentHelper.pages.length;s++){var a=this.documentHelper.pages[s];if(a.bodyWidgets[0].index!==o)return;for(var l=r;l<a.bodyWidgets[0].childWidgets.length;l++)a.bodyWidgets[0].childWidgets[l].index+=n;r=0}},e.prototype.updateLockRegion=function(e,i){if(t.isNullOrUndefined(e)&&(e=this.owner.currentUser),i=!!t.isNullOrUndefined(i)||i,this.documentHelper.editRanges.containsKey(e)){var n=this.documentHelper.editRanges.get(e);if(1===n.length&&!t.isNullOrUndefined(n[0].editRangeEnd)){var r=n[0];this.updateLockInfo(r.paragraph,r.editRangeEnd.paragraph,e,i)}}},e.prototype.updateLockInfo=function(e,i,n,r){e.isInsideTable&&(e=this.documentHelper.layout.getParentTable(e)),i.isInsideTable&&(i=this.documentHelper.layout.getParentTable(i));do{if(r?(e.lockedBy=n,e.locked=r):(e.lockedBy=void 0,e.locked=r),e===i)break;if(e=e.nextRenderedWidget,t.isNullOrUndefined(e))break}while(e)},e.prototype.pullAction=function(){var e=this;if(this.owner){var t=new v;t.url=this.owner.serviceUrl+this.owner.serverActionSettings.getPendingActions,t.contentType="application/json;charset=UTF-8",t.onSuccess=function(t){e.updateAction(JSON.parse(t.data)),n.hideSpinner(e.owner.element)},t.onFailure=this.failureHandler.bind(this),t.onError=this.failureHandler.bind(this),t.customHeaders=this.owner.headers,n.showSpinner(this.owner.element),t.send({roomName:this.collaborativeEditingSettings.roomName,version:this.version})}},e.prototype.destroy=function(){this.owner=void 0},e}(),di=function(){function e(){this.customXMLItemsPath="customXml/item",this.customXMLItemsPropspath="customXml/itemProps",this.itemPropsPath="itemProps",this.documentPath="word/document.xml",this.stylePath="word/styles.xml",this.chartPath="word/charts",this.numberingPath="word/numbering.xml",this.settingsPath="word/settings.xml",this.headerPath="word/header",this.footerPath="word/footer",this.imagePath="word/media/image",this.footnotesPath="word/footnotes.xml",this.endnotesPath="word/endnotes.xml",this.appPath="docProps/app.xml",this.corePath="docProps/core.xml",this.contentTypesPath="[Content_Types].xml",this.defaultEmbeddingPath="word/embeddings/",this.commentsPath="word/comments.xml",this.commentsExtendedPath="word/commentsExtended.xml",this.generalRelationPath="_rels/.rels",this.wordRelationPath="word/_rels/document.xml.rels",this.customXMLRelPath="customXml/_rels/item",this.excelRelationPath="xl/_rels/workbook.xml.rels",this.footnotesRelationPath="word/_rels/footnotes.xml.rels",this.endnotesRelationPath="word/_rels/endnotes.xml.rels",this.headerRelationPath="word/_rels/header",this.footerRelationPath="word/_rels/footer",this.xmlContentType="application/xml",this.fontContentType="application/vnd.openxmlformats-officedocument.obfuscatedFont",this.documentContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",this.settingsContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml",this.commentsContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",this.commentsExContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",this.endnoteContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",this.footerContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",this.footnoteContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",this.headerContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",this.numberingContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",this.stylesContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",this.webSettingsContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml",this.appContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml",this.coreContentType="application/vnd.openxmlformats-package.core-properties+xml",this.customContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml",this.customXmlContentType="application/vnd.openxmlformats-officedocument.customXmlProperties+xml",this.relationContentType="application/vnd.openxmlformats-package.relationships+xml",this.chartsContentType="application/vnd.openxmlformats-officedocument.drawingml.chart+xml",this.tableStyleContentType="application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml",this.chartColorStyleContentType="application/vnd.ms-office.chartcolorstyle+xml",this.commentsRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",this.commentsExRelType="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",this.settingsRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",this.endnoteRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",this.footerRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",this.footnoteRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",this.headerRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",this.documentRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",this.numberingRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",this.stylesRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",this.chartRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",this.fontRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",this.tableStyleRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles",this.coreRelType="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",this.appRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",this.customRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",this.imageRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",this.hyperlinkRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",this.controlRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/control",this.packageRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",this.customXmlRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",this.customUIRelType="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility",this.attachedTemplateRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/attachedTemplate",this.chartColorStyleRelType="http://schemas.microsoft.com/office/2011/relationships/chartColorStyle",this.wNamespace="http://schemas.openxmlformats.org/wordprocessingml/2006/main",this.wpNamespace="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",this.pictureNamespace="http://schemas.openxmlformats.org/drawingml/2006/picture",this.aNamespace="http://schemas.openxmlformats.org/drawingml/2006/main",this.a14Namespace="http://schemas.microsoft.com/office/drawing/2010/main",this.rNamespace="http://schemas.openxmlformats.org/officeDocument/2006/relationships",this.rpNamespace="http://schemas.openxmlformats.org/package/2006/relationships",this.vNamespace="urn:schemas-microsoft-com:vml",this.oNamespace="urn:schemas-microsoft-com:office:office",this.xmlNamespace="http://www.w3.org/XML/1998/namespace",this.w10Namespace="urn:schemas-microsoft-com:office:word",this.cpNamespace="http://schemas.openxmlformats.org/package/2006/metadata/core-properties",this.dcNamespace="http://purl.org/dc/elements/1.1/",this.docPropsNamespace="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",this.veNamespace="http://schemas.openxmlformats.org/markup-compatibility/2006",this.mNamespace="http://schemas.openxmlformats.org/officeDocument/2006/math",this.wneNamespace="http://schemas.microsoft.com/office/word/2006/wordml",this.customPropsNamespace="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",this.vtNamespace="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",this.chartNamespace="http://schemas.openxmlformats.org/drawingml/2006/chart",this.slNamespace="http://schemas.openxmlformats.org/schemaLibrary/2006/main",this.dtNamespace="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",this.wmlNamespace="http://schemas.microsoft.com/office/word/2003/wordml",this.w14Namespace="http://schemas.microsoft.com/office/word/2010/wordml",this.wpCanvasNamespace="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",this.wpDrawingNamespace="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",this.wpGroupNamespace="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",this.wpInkNamespace="http://schemas.microsoft.com/office/word/2010/wordprocessingInk",this.wpShapeNamespace="http://schemas.microsoft.com/office/word/2010/wordprocessingShape",this.w15Namespace="http://schemas.microsoft.com/office/word/2012/wordml",this.diagramNamespace="http://schemas.openxmlformats.org/drawingml/2006/diagram",this.eNamespace="http://schemas.microsoft.com/office/2006/encryption",this.pNamespace="http://schemas.microsoft.com/office/2006/keyEncryptor/password",this.certNamespace="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate",this.cxNamespace="http://schemas.microsoft.com/office/drawing/2014/chartex",this.c15Namespace="http://schemas.microsoft.com/office/drawing/2015/06/chart",this.c7Namespace="http://schemas.microsoft.com/office/drawing/2007/8/2/chart",this.csNamespace="http://schemas.microsoft.com/office/drawing/2012/chartStyle",this.spreadSheetNamespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main",this.spreadSheet9="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",this.cRelationshipsTag="Relationships",this.cRelationshipTag="Relationship",this.cIdTag="Id",this.cTypeTag="Type",this.cTargetTag="Target",this.cUserShapesTag="userShapes",this.cExternalData="externalData",this.twipsInOnePoint=20,this.twentiethOfPoint=20,this.borderMultiplier=8,this.percentageFactor=50,this.emusPerPoint=12700,this.cConditionalTableStyleTag="tblStylePr",this.cTableFormatTag="tblPr",this.cTowFormatTag="trPr",this.cCellFormatTag="tcPr",this.cParagraphFormatTag="pPr",this.cCharacterFormatTag="rPr",this.packageType="http://schemas.microsoft.com/office/2006/xmlPackage",this.relsPartPath="/_rels/.rels",this.documentRelsPartPath="/word/_rels/document.xml.rels",this.webSettingsPath="/word/webSettings.xml",this.wordMLDocumentPath="/word/document.xml",this.wordMLStylePath="/word/styles.xml",this.wordMLNumberingPath="/word/numbering.xml",this.wordMLSettingsPath="/word/settings.xml",this.wordMLHeaderPath="/word/header",this.wordMLFooterPath="/word/footer",this.wordMLCommentsPath="/word/comments.xml",this.wordMLImagePath="/word/media/image",this.wordMLFootnotesPath="/word/footnotes.xml",this.wordMLEndnotesPath="/word/endnotes.xml",this.wordMLAppPath="/docProps/app.xml",this.wordMLCorePath="/docProps/core.xml",this.wordMLCustomPath="/docProps/custom.xml",this.wordMLFontTablePath="/word/fontTable.xml",this.wordMLChartsPath="/word/charts/",this.wordMLDefaultEmbeddingPath="/word/embeddings/",this.wordMLEmbeddingPath="/word/embeddings/",this.wordMLDrawingPath="/word/drawings/",this.wordMLThemePath="/word/theme/theme1.xml",this.wordMLFontsPath="/word/fonts/",this.wordMLDiagramPath="/word/diagrams/",this.wordMLControlPath="/word/activeX/",this.wordMLVbaProject="/vbaProject.bin",this.wordMLVbaData="/vbaData.xml",this.wordMLVbaProjectPath="/word/vbaProject.bin",this.wordMLVbaDataPath="/word/vbaData.xml",this.wordMLWebSettingsPath="/word/webSettings.xml",this.wordMLCustomItemProp1Path="/customXml/itemProps1.xml",this.wordMLFootnoteRelPath="/word/_rels/footnotes.xml.rels",this.wordMLEndnoteRelPath="/word/_rels/endnotes.xml.rels",this.wordMLSettingsRelPath="/word/_rels/settings.xml.rels",this.wordMLNumberingRelPath="/word/_rels/numbering.xml.rels",this.wordMLFontTableRelPath="/word/_rels/fontTable.xml.rels",this.wordMLCustomXmlPropsRelType="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",this.wordMLControlRelType="http://schemas.microsoft.com/office/2006/relationships/activeXControlBinary",this.wordMLDiagramContentType="application/vnd.ms-office.drawingml.diagramDrawing+xml",this.dsNamespace="http://schemas.openxmlformats.org/officeDocument/2006/customXml",this.excelFiles=void 0,this.lastSection=!1,this.mRelationShipID=0,this.cRelationShipId=0,this.eRelationShipId=0,this.efRelationShipId=0,this.mDocPrID=1,this.chartCount=0,this.seriesCount=0,this.chartStringCount=0,this.mDifferentFirstPage=!1,this.mBookmarks=void 0,this.mComments=[],this.revisions=[],this.customXMLProps=[],this.paraID=0,this.commentParaID=0,this.commentParaIDInfo={},this.isInsideComment=!1,this.commentId={},this.currentCommentId=0,this.trackChangesId=0,this.prevRevisionIds=[],this.isRevisionContinuous=!1}return e.prototype.getModuleName=function(){return"WordExport"},Object.defineProperty(e.prototype,"bookmarks",{get:function(){return t.isNullOrUndefined(this.mBookmarks)&&(this.mBookmarks=[]),this.mBookmarks},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"documentImages",{get:function(){return void 0===this.mDocumentImages&&(this.mDocumentImages=new u),this.mDocumentImages},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"externalImages",{get:function(){return void 0===this.mExternalLinkImages&&(this.mExternalLinkImages=new u),this.mExternalLinkImages},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerFooterImages",{get:function(){return void 0===this.mHeaderFooterImages&&(this.mHeaderFooterImages=new u),this.mHeaderFooterImages},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"documentCharts",{get:function(){return void 0===this.mDocumentCharts&&(this.mDocumentCharts=new u),this.mDocumentCharts},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headersFooters",{get:function(){return void 0===this.mHeaderFooterColl&&(this.mHeaderFooterColl=new u),this.mHeaderFooterColl},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endnotesFootnotes",{get:function(){return void 0===this.mFootEndnotesColl&&(this.mFootEndnotesColl=new u),this.mFootEndnotesColl},enumerable:!0,configurable:!0}),e.prototype.save=function(e,t){var i=this;this.fileName=t,this.serialize(e);var n=this.serializeExcelFiles();n&&n.length>0?Promise.all(n).then(function(){i.saveInternal(t)}):this.saveInternal(t),this.close()},e.prototype.saveInternal=function(e){this.mArchive.save(e+".docx").then(function(e){e.destroy()})},e.prototype.saveAsBlob=function(e){var t=this;this.serialize(e);var i=this.serializeExcelFiles();return new Promise(function(e,n){i.length>0?Promise.all(i).then(function(){t.mArchive.saveAsBlob().then(function(i){t.mArchive.destroy(),i=new Blob([i],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}),e(i)})}):t.mArchive.saveAsBlob().then(function(i){t.mArchive.destroy(),i=new Blob([i],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}),e(i)})})},e.prototype.serializeExcelFiles=function(){var e=this,t=this.excelFiles,i=[];if(t&&t.length>0){for(var n=0;n<t.length;n++)!function(n){var r=t.keys[n],o=t.get(r).saveAsBlob();i.push(o),o.then(function(t){var i=new c.ZipArchiveItem(t,r);e.mArchive.addItem(i)})}(n);this.excelFiles.clear()}return i},e.prototype.saveExcel=function(){var e=this.defaultEmbeddingPath+"Microsoft_Excel_Worksheet"+this.chartCount+".xlsx";this.excelFiles.add(e,this.mArchiveExcel),this.mArchiveExcel=void 0},e.prototype.destroy=function(){this.clearDocument(),this.mRelationShipID=void 0,this.mDocPrID=void 0,this.mDifferentFirstPage=void 0,this.fileName=void 0,this.mArchive&&(this.mArchive.destroy(),this.mArchive=void 0),this.mArchiveExcel&&(this.mArchiveExcel.destroy(),this.mArchiveExcel=void 0)},e.prototype.serialize=function(e){var t=e.owner.sfdtExportModule.write();this.setDocument(t),this.mComments=e.comments,this.mCustomXML=e.customXmlData,this.revisions=e.owner.revisions.changes,this.mArchive=new c.ZipArchive,this.mArchive.compressionLevel="Normal",this.commentParaIDInfo={},this.commentParaID=0,this.currentCommentId=0,this.commentId={},this.mVerticalMerge=new u,this.mGridSpans=new u;this.serializeDocument(),this.serializeStyles(),this.serializeNumberings(),this.serializeComments(),this.serializeCommentsExtended(),this.serializeSettings(),this.serializeCoreProperties(),this.serializeAppProperties(),this.serializeFontTable(void 0),this.serializeSettingsRelation(),this.serializeHeaderFooters(),this.serializeFootnotes(),this.serializeEndnotes(),this.serializeDocumentRelations(),this.serializeGeneralRelations(),this.serializeContentTypes(void 0),this.clearDocument()},e.prototype.setDocument=function(e){this.document=e,this.mSections=e.sections,this.mLists=e.lists,this.mAbstractLists=e.abstractLists,this.defCharacterFormat=e.characterFormat,this.defParagraphFormat=e.paragraphFormat,this.defaultTabWidthValue=e.defaultTabWidth,this.dontUseHtmlParagraphAutoSpacing=e.dontUseHTMLParagraphAutoSpacing,this.mStyles=e.styles,this.formatting=e.formatting,this.enforcement=e.enforcement,this.hashValue=e.hashValue,this.saltValue=e.saltValue,this.protectionType=e.protectionType,this.formFieldShading=e.formFieldShading,this.trackChanges=e.trackChanges},e.prototype.clearDocument=function(){this.section=void 0,this.lastSection=void 0,this.blockOwner=void 0,this.paragraph=void 0,this.table=void 0,this.row=void 0,this.headerFooter=void 0,this.commentParaIDInfo={},this.commentParaID=0,this.currentCommentId=0,this.commentId={},this.document=void 0,this.mSections=void 0,this.mLists=void 0,this.mAbstractLists=void 0,this.defCharacterFormat=void 0,this.defParagraphFormat=void 0,this.defaultTabWidthValue=void 0,this.trackChanges=void 0,this.customXMLProps=[],this.mRelationShipID=0,this.eRelationShipId=0,this.cRelationShipId=0,this.efRelationShipId=0,this.mDocPrID=1,this.chartCount=0,this.mDifferentFirstPage=!1,this.mHeaderFooterColl&&(this.mHeaderFooterColl.destroy(),this.mHeaderFooterColl=void 0),this.mVerticalMerge&&(this.mVerticalMerge.destroy(),this.mVerticalMerge=void 0),this.mGridSpans&&(this.mGridSpans.destroy(),this.mGridSpans=void 0),this.mDocumentImages&&(this.mDocumentImages.destroy(),this.mDocumentImages=void 0),this.mExternalLinkImages&&(this.mExternalLinkImages.destroy(),this.mExternalLinkImages=void 0),this.mHeaderFooterImages&&(this.mHeaderFooterImages.destroy(),this.mHeaderFooterImages=void 0),this.mDocumentCharts&&(this.mDocumentCharts.destroy(),this.mDocumentCharts=void 0),this.mFootEndnotesColl&&(this.mFootEndnotesColl.destroy(),this.mFootEndnotesColl=void 0)},e.prototype.serializeDocument=function(){var e=new p.XmlWriter;e.writeStartElement("w","document",this.wNamespace),this.writeCommonAttributeStrings(e),this.serializeDocumentBody(e),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,this.documentPath);this.mArchive.addItem(t)},e.prototype.writeCommonAttributeStrings=function(e){e.writeAttributeString("xmlns","wpc",void 0,this.wpCanvasNamespace),this.writeCustom(e),e.writeAttributeString("xmlns","wp14",void 0,this.wpDrawingNamespace),e.writeAttributeString("xmlns","wp",void 0,this.wpNamespace),e.writeAttributeString("xmlns","w10",void 0,this.w10Namespace),e.writeAttributeString("xmlns","w",void 0,this.wNamespace),this.writeDup(e),e.writeAttributeString("xmlns","wne",void 0,this.wneNamespace),e.writeAttributeString("xmlns","wps",void 0,this.wpShapeNamespace),e.writeAttributeString("mc","Ignorable",void 0,"w14 w15 wp14")},e.prototype.writeDup=function(e){e.writeAttributeString("xmlns","w14",void 0,this.w14Namespace),e.writeAttributeString("xmlns","w15",void 0,this.w15Namespace),e.writeAttributeString("xmlns","wpg",void 0,this.wpGroupNamespace),e.writeAttributeString("xmlns","wpi",void 0,this.wpInkNamespace)},e.prototype.writeCustom=function(e){e.writeAttributeString("xmlns","mc",void 0,this.veNamespace),e.writeAttributeString("xmlns","o",void 0,this.oNamespace),e.writeAttributeString("xmlns","r",void 0,this.rNamespace),e.writeAttributeString("xmlns","m",void 0,this.mNamespace),e.writeAttributeString("xmlns","v",void 0,this.vNamespace)},e.prototype.serializeDocumentBody=function(e){e.writeStartElement(void 0,"body",this.wNamespace);for(var t=this.document.sections.length,i=0;i<t;i++)this.section=this.document.sections[i],this.lastSection=i===t-1,this.serializeSection(e,this.section,i===t-1),this.section=void 0;e.writeEndElement()},e.prototype.serializeSection=function(e,t,i){this.blockOwner=t,this.serializeBodyItems(e,t.blocks,i),i&&this.serializeSectionProperties(e,t),this.blockOwner=void 0},e.prototype.serializeComments=function(){if(0!==this.mComments.length&&(1!==this.mComments.length||""!==this.mComments[0].text)){var e=new p.XmlWriter;e.writeStartElement("w","comments",this.wNamespace),this.serializeCommentCommonAttribute(e),this.serializeCommentInternal(e,this.mComments),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,this.commentsPath);this.mArchive.addItem(t)}},e.prototype.serializeCommentCommonAttribute=function(e){e.writeAttributeString("xmlns","wpc",void 0,this.wpCanvasNamespace),e.writeAttributeString("xmlns","cx",void 0,this.cxNamespace),e.writeAttributeString("xmlns","mc",void 0,this.veNamespace),e.writeAttributeString("xmlns","o",void 0,this.oNamespace),e.writeAttributeString("xmlns","r",void 0,this.rNamespace),e.writeAttributeString("xmlns","m",void 0,this.mNamespace),e.writeAttributeString("xmlns","v",void 0,this.vNamespace),e.writeAttributeString("xmlns","wp14",void 0,this.wpDrawingNamespace),e.writeAttributeString("xmlns","wp",void 0,this.wpNamespace),e.writeAttributeString("xmlns","w10",void 0,this.w10Namespace),e.writeAttributeString("xmlns","w",void 0,this.wNamespace),e.writeAttributeString("xmlns","w14",void 0,this.w14Namespace),e.writeAttributeString("xmlns","w15",void 0,this.w15Namespace),e.writeAttributeString("mc","Ignorable",void 0,"w14 w15")},e.prototype.serializeCommentInternal=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];e.writeStartElement("w","comment",this.wNamespace),e.writeAttributeString("w","id",this.wNamespace,this.commentId[n.commentId].toString()),n.author&&" "!==n.author&&e.writeAttributeString("w","author",this.wNamespace,n.author),n.date&&e.writeAttributeString("w","date",this.wNamespace,n.date),n.initial&&""!==n.initial&&e.writeAttributeString("w","initials",this.wNamespace,n.initial);for(var r=this.retrieveCommentText(n.text),o=0;o<r.length;o++)this.isInsideComment=!0,this.commentParaID++,this.serializeBodyItem(e,r[o],!0),this.isInsideComment=!1;0===r.length&&(this.isInsideComment=!0,this.commentParaID++),this.commentParaIDInfo[n.commentId]=this.commentParaID,this.isInsideComment=!1,e.writeEndElement(),n.replyComments.length>0&&this.serializeCommentInternal(e,n.replyComments)}},e.prototype.retrieveCommentText=function(e){var t=[],i=e.split("\n"),n={};if(0===(i=i.filter(function(e){return""!==e})).length)n.inlines=[{text:""}],t.push(n);else for(;i.length>0;)n.inlines=[{text:i[0]}],t.push(n),i.splice(0,1);return t},e.prototype.serializeCommentsExtended=function(){if(0!==this.mComments.length&&(1!==this.mComments.length||""!==this.mComments[0].text)){var e=new p.XmlWriter;e.writeStartElement("w15","commentsEx",this.wNamespace),this.serializeCommentCommonAttribute(e),this.serializeCommentsExInternal(e,this.mComments,!1),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,this.commentsExtendedPath);this.mArchive.addItem(t)}},e.prototype.serializeCommentsExInternal=function(e,t,i){for(var n=0;n<t.length;n++){var r=t[n];e.writeStartElement("w15","commentEx",this.wNamespace);var o=this.commentParaIDInfo[r.commentId];if(i){var s=this.commentParaIDInfo[r.ownerComment.commentId];e.writeAttributeString("w15","paraIdParent",this.wNamespace,s.toString())}e.writeAttributeString("w15","paraId",this.wNamespace,o.toString());var a=r.done?1:0;e.writeAttributeString("w15","done",this.wNamespace,a.toString()),e.writeEndElement(),r.replyComments.length>0&&this.serializeCommentsExInternal(e,r.replyComments,!0)}},e.prototype.serializeSectionProperties=function(e,i){e.writeStartElement("w","sectPr",this.wNamespace),i.headersFooters&&this.serializeHFReference(e,i.headersFooters),this.serializeSectionType(e,"nextPage"),this.serializePageSetup(e,i.sectionFormat),this.serializeColumns(e),this.serializeFootNotesPr(e,i.sectionFormat),this.serializeEndNotesPr(e,i.sectionFormat),void 0!==i.sectionFormat&&i.sectionFormat.differentFirstPage&&(e.writeStartElement(void 0,"titlePg",this.wNamespace),e.writeEndElement()),!t.isNullOrUndefined(i.sectionFormat)&&i.sectionFormat.bidi&&(e.writeStartElement(void 0,"bidi",this.wNamespace),e.writeEndElement()),e.writeEndElement()},e.prototype.serializeFootNotesPr=function(e,t){(t.footNoteNumberFormat||t.restartIndexForFootnotes)&&(e.writeStartElement(void 0,"footnotePr",this.wNamespace),e.writeStartElement(void 0,"pos",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,"pageBottom"),e.writeEndElement(),void 0!==t.footNoteNumberFormat&&(e.writeStartElement(void 0,"numFmt",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.getFootNoteNumberFormat(t.footNoteNumberFormat)),e.writeEndElement()),void 0!==t.restartIndexForFootnotes&&(e.writeStartElement(void 0,"numRestart",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.getFootNoteNumberRestart(t.restartIndexForFootnotes)),e.writeEndElement()),void 0!==t.initialFootNoteNumber&&(e.writeStartElement(void 0,"numStart",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t.initialFootNoteNumber.toString()),e.writeEndElement()),e.writeEndElement())},e.prototype.getFootNoteNumberFormat=function(e){var t;switch(e){case"UpperCaseRoman":t="upperRoman";break;case"LowerCaseRoman":t="lowerRoman";break;case"UpperCaseLetter":t="upperLetter";break;case"LowerCaseLetter":t="lowerLetter";break;default:t="decimal"}return t},e.prototype.getFootNoteNumberRestart=function(e){switch(e){case"RestartForEachSection ":return"eachSect";case"RestartForEachPage":return"eachPage";default:return"continuous"}},e.prototype.serializeEndNotesPr=function(e,t){(t.endnoteNumberFormat||t.restartIndexForEndnotes)&&(e.writeStartElement(void 0,"endnotePr",this.wNamespace),e.writeStartElement(void 0,"pos",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,"docEnd"),e.writeEndElement(),void 0!==t.endnoteNumberFormat&&(e.writeStartElement(void 0,"numFmt",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.getFootNoteNumberFormat(t.endnoteNumberFormat)),e.writeEndElement()),void 0!==t.restartIndexForEndnotes&&(e.writeStartElement(void 0,"numRestart",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.getFootNoteNumberRestart(t.restartIndexForEndnotes)),e.writeEndElement()),void 0!==t.initialEndNoteNumber&&(e.writeStartElement(void 0,"numStart",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t.initialEndNoteNumber.toString()),e.writeEndElement()),e.writeEndElement())},e.prototype.serializeColumns=function(e){e.writeStartElement(void 0,"cols",this.wNamespace),e.writeAttributeString(void 0,"equalWidth",this.wNamespace,"1"),e.writeAttributeString(void 0,"space",this.wNamespace,"0"),e.writeEndElement()},e.prototype.serializePageSetup=function(e,t){void 0!==t&&(this.serializePageSize(e,t),this.serializePageMargins(e,t)),t.restartPageNumbering&&(e.writeStartElement(void 0,"pgNumType",this.wNamespace),e.writeAttributeString(void 0,"start",this.wNamespace,t.pageStartingNumber.toString()),e.writeEndElement()),e.writeStartElement(void 0,"pgBorders",this.wNamespace),e.writeEndElement()},e.prototype.serializePageSize=function(e,t){e.writeStartElement(void 0,"pgSz",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,this.roundToTwoDecimal(t.pageWidth*this.twentiethOfPoint).toString()),e.writeAttributeString(void 0,"h",this.wNamespace,this.roundToTwoDecimal(t.pageHeight*this.twentiethOfPoint).toString()),e.writeEndElement()},e.prototype.serializePageMargins=function(e,t){e.writeStartElement(void 0,"pgMar",this.wNamespace);var i=Math.round(t.topMargin*this.twentiethOfPoint);e.writeAttributeString(void 0,"top",this.wNamespace,i.toString()),i=Math.round(t.rightMargin*this.twentiethOfPoint),e.writeAttributeString(void 0,"right",this.wNamespace,i.toString()),i=Math.round(t.bottomMargin*this.twentiethOfPoint),e.writeAttributeString(void 0,"bottom",this.wNamespace,i.toString()),i=Math.round(t.leftMargin*this.twentiethOfPoint),e.writeAttributeString(void 0,"left",this.wNamespace,i.toString()),e.writeAttributeString(void 0,"header",this.wNamespace,this.roundToTwoDecimal(t.headerDistance*this.twentiethOfPoint).toString()),e.writeAttributeString(void 0,"footer",this.wNamespace,this.roundToTwoDecimal(t.footerDistance*this.twentiethOfPoint).toString()),e.writeAttributeString(void 0,"gutter",this.wNamespace,"0"),e.writeEndElement()},e.prototype.serializeSectionType=function(e,t){e.writeStartElement("w","type",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,t),e.writeEndElement()},e.prototype.serializeHFReference=function(e,t){var i="";if(void 0!==t){this.mDifferentFirstPage=this.section.sectionFormat.differentOddAndEvenPages;var n=t.firstPageHeader;n&&n.blocks&&n.blocks.length>0&&(e.writeStartElement(void 0,"headerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"first"),i=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,i),this.addHeaderFooter(n,"FirstPageHeader",i),e.writeEndElement()),(n=t.firstPageFooter)&&n.blocks&&n.blocks.length>0&&(e.writeStartElement(void 0,"footerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"first"),i=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,i),this.addHeaderFooter(n,"FirstPageFooter",i),e.writeEndElement()),(n=t.evenHeader)&&n.blocks&&n.blocks.length>0&&(e.writeStartElement(void 0,"headerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"even"),i=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,i),this.addHeaderFooter(n,"EvenHeader",i),e.writeEndElement()),(n=t.evenFooter)&&n.blocks&&n.blocks.length>0&&(e.writeStartElement(void 0,"footerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"even"),i=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,i),this.addHeaderFooter(n,"EvenFooter",i),e.writeEndElement()),(n=t.header)&&n.blocks&&n.blocks.length>0&&(e.writeStartElement(void 0,"headerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"default"),i=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,i),this.addHeaderFooter(n,"OddHeader",i),e.writeEndElement()),(n=t.footer)&&n.blocks&&n.blocks.length>0&&(e.writeStartElement(void 0,"footerReference",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"default"),i=this.getNextRelationShipID(),e.writeAttributeString(void 0,"id",this.rNamespace,i),this.addHeaderFooter(n,"OddFooter",i),e.writeEndElement())}},e.prototype.addHeaderFooter=function(e,t,i){var n=new u;this.headersFooters.add(t,n),this.headersFooters.get(t).add(i,e)},e.prototype.serializeBodyItems=function(e,t,i){for(var n=0;n<t.length;n++)this.serializeBodyItem(e,t[n],i)},e.prototype.serializeContentControl=function(e,i,n,r,o){if(t.isNullOrUndefined(i))throw new Error("contentCOntrol should not be undefined");e.writeStartElement("w","sdt",this.wNamespace),e.writeStartElement(void 0,"sdtPr",this.wNamespace),t.isNullOrUndefined(i)||this.serializeContentProperties(e,i,n,r,o)},e.prototype.serializeContentProperties=function(e,i,n,r,o){if(t.isNullOrUndefined(i.title)||(e.writeStartElement(void 0,"alias",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,i.title),e.writeEndElement(),e.writeStartElement(void 0,"tag",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,i.tag),e.writeEndElement()),t.isNullOrUndefined(i.characterFormat)||this.serializeCharacterFormat(e,n.contentControlProperties.characterFormat),(i.lockContents||i.lockContentControl)&&(e.writeStartElement(void 0,"lock",this.wNamespace),i.lockContentControl&&i.lockContents?e.writeAttributeString("w","val",this.wNamespace,"sdtContentLocked"):i.lockContentControl?e.writeAttributeString("w","val",this.wNamespace,"sdtLocked"):i.lockContents&&e.writeAttributeString("w","val",this.wNamespace,"contentLocked"),e.writeEndElement()),i.hasPlaceHolderText&&t.isNullOrUndefined(void 0)&&(e.writeStartElement("w","placeholder",void 0),e.writeAttributeString("w","docPart",this.wNamespace,void 0),e.writeEndElement(),e.writeStartElement("w","showingPlcHdr",void 0),e.writeEndElement()),i.isTemporary&&(e.writeStartElement("w","temporary",void 0),e.writeEndElement()),t.isNullOrUndefined(i.appearance)||(e.writeStartElement("w15","appearance",void 0),e.writeAttributeString("w15","val",void 0,i.appearance.toLowerCase()),e.writeEndElement()),t.isNullOrUndefined(i.color)||(e.writeStartElement("w15","color",void 0),e.writeAttributeString("w","val",void 0,this.getColor(i.color)),e.writeEndElement()),i.multiline&&(e.writeStartElement(void 0,"text",this.wNamespace),e.writeAttributeString("w","multiLine",this.wNamespace,"1"),e.writeEndElement()),t.isNullOrUndefined(i.xmlMapping)||i.xmlMapping.isMapped&&(e.writeStartElement("w","dataBinding",this.wNamespace),e.writeAttributeString("w","xpath",void 0,i.xmlMapping.xPath),e.writeAttributeString("w","storeItemID",void 0,i.xmlMapping.storeItemId),e.writeEndElement()),i.picture&&(e.writeStartElement("w","picture",this.wNamespace),e.writeEndElement()),t.isNullOrUndefined(i.uncheckedState||i.checkedState)||(e.writeStartElement("w14","checkbox",void 0),i.isChecked?(e.writeStartElement("w14","checked",void 0),e.writeAttributeString("w14","val",void 0,"1"),e.writeEndElement()):(e.writeStartElement("w14","checked",void 0),e.writeAttributeString("w14","val",void 0,"0"),e.writeEndElement()),e.writeStartElement("w14","uncheckedState",void 0),e.writeAttributeString("w14","val",void 0,this.toUnicode(i.uncheckedState.value)),e.writeAttributeString("w14","font",void 0,i.uncheckedState.font),e.writeEndElement(),e.writeStartElement("w14","checkedState",void 0),e.writeAttributeString("w14","val",void 0,this.toUnicode(i.checkedState.value)),e.writeAttributeString("w14","font",void 0,i.checkedState.font),e.writeEndElement(),e.writeEndElement()),!t.isNullOrUndefined(i.contentControlListItems)&&"DropDownList"===i.type){var s=i.contentControlListItems;e.writeStartElement(void 0,"dropDownList",this.wNamespace),this.serializeContentControlList(e,s),e.writeEndElement()}if(!t.isNullOrUndefined(i.contentControlListItems)&&"ComboBox"===i.type){var a=i.contentControlListItems;e.writeStartElement(void 0,"comboBox",this.wNamespace),this.serializeContentControlList(e,a),e.writeEndElement()}if(this.serializeContentControlDate(e,i),t.isNullOrUndefined(i.type)||"Picture"===i.type&&(e.writeStartElement(void 0,"picture",this.wNamespace),e.writeEndElement()),e.writeEndElement(),e.writeStartElement("w","sdtContent",this.wNamespace),!o){if(n.hasOwnProperty("blocks")&&t.isNullOrUndefined(n.cellFormat))for(var l=0;l<n.blocks.length;l++){var d=n.blocks[l];if(d.hasOwnProperty("inlines"))this.paragraph=d,this.serializeParagraph(e,d,r),this.paragraph=void 0;else if(d.hasOwnProperty("rowFormat")){c=new u;this.serializeRow(e,d,c)}else if(d.hasOwnProperty("contentControlProperties"))this.serializeContentControl(e,d.contentControlProperties,d,r);else{var h=d;this.serializeTable(e,h)}}else if(n.hasOwnProperty("rowFormat")){if(n.cells.length>0){c=new u;this.serializeRow(e,n,c)}}else if(n.hasOwnProperty("cellFormat")){var c=new u;this.serializeCell(e,n,c)}e.writeEndElement(),e.writeEndElement()}},e.prototype.toUnicode=function(e){return e.charCodeAt(0).toString(16)},e.prototype.serializeContentControlList=function(e,i){for(var n=0;n<i.length;n++)e.writeStartElement(void 0,"listItem",this.wNamespace),t.isNullOrUndefined(i[n].displayText)||e.writeAttributeString("w","displayText",this.wNamespace,i[n].displayText),e.writeAttributeString("w","value",this.wNamespace,i[n].value),e.writeEndElement()},e.prototype.serializeContentParagraph=function(e,i){for(var n=0;n<i.blocks.length;n++){var r=i.blocks[n];if(r.hasOwnProperty("inlines"))for(var o=0;o<r.inlines.length;o++){var s=r.inlines[o];t.isNullOrUndefined(s.characterFormat)||this.serializeCharacterFormat(e,s.characterFormat)}}},e.prototype.serializeContentControlDate=function(e,i){"Date"===i.type&&(e.writeStartElement("w","date",this.wNamespace),t.isNullOrUndefined(i.dateDisplayFormat)||(e.writeStartElement("w","calender",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,i.dateCalendarType),e.writeEndElement()),t.isNullOrUndefined(i.dateDisplayLocale)||(e.writeStartElement("w","lid",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,i.dateDisplayLocale),e.writeEndElement()),t.isNullOrUndefined(i.dateStorageFormat)||(e.writeStartElement("w","storeMappedDataAs",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,i.dateStorageFormat),e.writeEndElement()),t.isNullOrUndefined(i.dateCalendarType)||(e.writeStartElement("w","dateFormat",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,i.dateDisplayFormat),e.writeEndElement()),e.writeEndElement())},e.prototype.serializeBodyItem=function(e,i,n){if(t.isNullOrUndefined(i))throw new Error("BodyItem should not be undefined");if(i.hasOwnProperty("contentControlProperties"))this.serializeContentControl(e,i.contentControlProperties,i,n);else if(i.hasOwnProperty("inlines"))this.paragraph=i,this.serializeParagraph(e,i,n),this.paragraph=void 0;else for(var r=i,o=0;o<r.rows.length;o++)if(r.rows[o].cells.length>0){this.serializeTable(e,r);break}var s=this.blockOwner;!n&&s.hasOwnProperty("sectionFormat")&&s.blocks.indexOf(i)===s.blocks.length-1&&(e.writeStartElement("w","p",this.wNamespace),e.writeStartElement(void 0,"pPr",this.wNamespace),this.serializeSectionProperties(e,s),e.writeEndElement(),e.writeEndElement())},e.prototype.serializeParagraph=function(e,i,n){if(t.isNullOrUndefined(i))throw new Error("Paragraph should not be undefined");e.writeStartElement("w","p",this.wNamespace),this.isInsideComment&&e.writeAttributeString("w14","paraId",void 0,this.commentParaID.toString()),e.writeStartElement(void 0,"pPr",this.wNamespace),t.isNullOrUndefined(i.paragraphFormat)||this.serializeParagraphFormat(e,i.paragraphFormat,i),t.isNullOrUndefined(i.characterFormat)||this.serializeCharacterFormat(e,i.characterFormat),e.writeEndElement(),this.prevRevisionIds=[],this.serializeParagraphItems(e,i.inlines),e.writeEndElement()},e.prototype.serializeRevisionStart=function(e,i,n){if(i.hasOwnProperty("revisionIds")){if(!t.isNullOrUndefined(n)&&n.hasOwnProperty("fieldType")&&0===n.fieldType)return;if(i.hasOwnProperty("fieldType")&&1===i.fieldType)return;if(!t.isNullOrUndefined(n)&&n.hasOwnProperty("bookmarkType")&&0===n.bookmarkType&&!(n.name.indexOf("_Toc")>=0))return;for(var r=i.revisionIds,o=0;o<r.length;o++){var s=this.retrieveRevision(r[o]);"Insertion"===s.revisionType&&this.serializeTrackChanges(e,"ins",s.author,s.date),"Deletion"===s.revisionType&&this.serializeTrackChanges(e,"del",s.author,s.date)}}},e.prototype.serializeTrackChanges=function(e,t,i,n){e.writeStartElement("w",t,this.wNamespace),e.writeAttributeString("w","id",this.wNamespace,(this.trackChangesId++).toString()),e.writeAttributeString("w","author",this.wNamespace,i),e.writeAttributeString("w","date",this.wNamespace,n)},e.prototype.retrieveRevision=function(e){for(var t=0;t<this.revisions.length;t++)if(this.revisions[t].revisionID===e)return this.revisions[t]},e.prototype.serializeParagraphItems=function(e,i){for(var n,r=void 0,o=!1,s=0;s<i.length;s++){var a=i[s];a.hasOwnProperty("contentControlProperties")&&(n=!0,this.serializeContentControl(e,a.contentControlProperties,a,void 0,n),this.serializeParagraphItems(e,a.inlines)),a.hasOwnProperty("inlines")&&this.serializeParagraphItems(e,a),this.serializeRevisionStart(e,a,r);var l=!1;if(a.characterFormat&&(l=!t.isNullOrUndefined(a.characterFormat.bdo)&&"None"!==a.characterFormat.bdo)&&!o&&(this.serializeBiDirectionalOverride(e,a.characterFormat),o=!0),o&&!l&&(e.writeEndElement(),o=!1),a.hasOwnProperty("fieldType"))this.serializeFieldCharacter(e,a);else if(a.hasOwnProperty("imageString"))this.serializePicture(e,a);else if(a.hasOwnProperty("shapeId")){var d=this.paragraph;this.serializeShape(e,a),this.paragraph=d}else a.hasOwnProperty("bookmarkType")?this.serializeBookMark(e,a):a.hasOwnProperty("editRangeId")?this.serializeEditRange(e,a):a.hasOwnProperty("chartType")?(this.chart=a,this.serializeChart(e,a),this.serializeChartStructure()):a.hasOwnProperty("commentCharacterType")?this.serializeComment(e,a):a.hasOwnProperty("footnoteType")?this.serializeEFReference(e,a):this.serializeTextRange(e,a,r);this.serializeRevisionEnd(e,a,r),r=a,n&&(e.writeEndElement(),e.writeEndElement(),n=!1)}o&&e.writeEndElement()},e.prototype.serializeEFReference=function(e,t){var i="",n=t.blocks;"Footnote"===t.footnoteType?(e.writeStartElement(void 0,"r",this.wNamespace),this.serializeCharacterFormat(e,t.characterFormat),e.writeStartElement(void 0,"footnoteReference",this.wNamespace),i=this.getEFNextRelationShipID(),e.writeAttributeString(void 0,"id",this.wNamespace,i),this.addFootnotesEndnotes(n,"footnote",i),e.writeEndElement(),e.writeEndElement()):(e.writeStartElement(void 0,"r",this.wNamespace),this.serializeCharacterFormat(e,t.characterFormat),e.writeStartElement(void 0,"endnoteReference",this.wNamespace),i=this.getEFNextRelationShipID(),e.writeAttributeString(void 0,"id",this.wNamespace,i),this.addFootnotesEndnotes(n,"endnote",i),e.writeEndElement(),e.writeEndElement())},e.prototype.addFootnotesEndnotes=function(e,t,i){var n=new u;this.endnotesFootnotes.add(t,n),this.endnotesFootnotes.get(t).add(i,e)},e.prototype.serializeEndnotesFootnote=function(e,t){if(0!==this.endnotesFootnotes.length){if(this.endnotesFootnotes.containsKey(t))for(var i=this.endnotesFootnotes.get(t),n=void 0,r=0;r<i.keys.length;r++){var o=i.keys[r];n=i.get(o),"endnote"===t?(this.endnotesPath,this.endnotesRelationPath,this.serializeInlineEndnotes(e,n,o)):(this.footnotesPath,this.footnotesRelationPath,this.serializeInlineFootnotes(e,n,o))}}},e.prototype.serializeInlineEndnotes=function(e,t,i){this.endNoteFootnote=t;var n=this.blockOwner;this.blockOwner=t,e.writeStartElement("w","endnote",this.wNamespace),e.writeAttributeString(void 0,"id",this.wNamespace,i),this.serializeBodyItems(e,t,!0),e.writeEndElement(),this.blockOwner=n,this.endNoteFootnote=void 0},e.prototype.serializeInlineFootnotes=function(e,t,i){this.endNoteFootnote=t;var n=this.blockOwner;this.blockOwner=t,e.writeStartElement("w","footnote",this.wNamespace),e.writeAttributeString(void 0,"id",this.wNamespace,i),this.serializeBodyItems(e,t,!0),e.writeEndElement(),this.blockOwner=n,this.endNoteFootnote=void 0},e.prototype.writeEFCommonAttributes=function(e){e.writeAttributeString("xmlns","wpc",void 0,this.wpCanvasNamespace),e.writeAttributeString("xmlns","cx",void 0,this.cxNamespace),e.writeAttributeString("xmlns","aink",void 0,"http://schemas.microsoft.com/office/drawing/2016/ink"),e.writeAttributeString("xmlns","am3d",void 0,"http://schemas.microsoft.com/office/drawing/2017/,odel3d"),this.writeCustom(e),e.writeAttributeString("xmlns","wp14",void 0,this.wpDrawingNamespace),e.writeAttributeString("xmlns","wp",void 0,this.wpNamespace),e.writeAttributeString("xmlns","w",void 0,this.wNamespace),this.writeDup(e),e.writeAttributeString("xmlns","wne",void 0,this.wneNamespace),e.writeAttributeString("xmlns","wps",void 0,this.wpShapeNamespace),e.writeAttributeString("mc","Ignorable",void 0,"w14 w15")},e.prototype.serializeFootnotes=function(){if(!t.isNullOrUndefined(this.document.footnotes)){var e=new p.XmlWriter;e.writeStartElement("w","footnotes",this.wNamespace),this.writeEFCommonAttributes(e),e.writeStartElement("w","footnote",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"separator"),e.writeAttributeString(void 0,"id",this.wNamespace,"-1"),this.serializeBodyItems(e,this.document.footnotes.separator,!0),e.writeEndElement(),e.writeStartElement("w","footnote",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"continuationSeparator"),e.writeAttributeString(void 0,"id",this.wNamespace,"0"),this.serializeBodyItems(e,this.document.footnotes.continuationSeparator,!0),e.writeEndElement(),this.document.footnotes.continuationNotice&&(e.writeStartElement("w","endnote",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"continuationNotice"),e.writeAttributeString(void 0,"id",this.wNamespace,"1"),this.serializeBodyItems(e,this.document.footnotes.continuationNotice,!0),e.writeEndElement()),this.serializeEndnotesFootnote(e,"footnote"),e.writeEndElement();var i=new c.ZipArchiveItem(e.buffer,this.footnotesPath);this.mArchive.addItem(i)}},e.prototype.serializeEndnotes=function(){if(!t.isNullOrUndefined(this.document.endnotes)){var e=new p.XmlWriter;e.writeStartElement("w","endnotes",this.wNamespace),this.writeEFCommonAttributes(e),e.writeStartElement("w","endnote",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"separator"),e.writeAttributeString(void 0,"id",this.wNamespace,"-1"),this.serializeBodyItems(e,this.document.endnotes.separator,!0),e.writeEndElement(),e.writeStartElement("w","endnote",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"continuationSeparator"),e.writeAttributeString(void 0,"id",this.wNamespace,"0"),this.serializeBodyItems(e,this.document.endnotes.continuationSeparator,!0),e.writeEndElement(),this.document.endnotes.continuationNotice&&(e.writeStartElement("w","endnote",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"continuationNotice"),e.writeAttributeString(void 0,"id",this.wNamespace,"1"),this.serializeBodyItems(e,this.document.endnotes.continuationNotice,!0),e.writeEndElement()),this.serializeEndnotesFootnote(e,"endnote"),e.writeEndElement();var i=new c.ZipArchiveItem(e.buffer,this.endnotesPath);this.mArchive.addItem(i)}},e.prototype.serializeRevisionEnd=function(e,i,n){if(i.hasOwnProperty("revisionIds")){if(i.hasOwnProperty("fieldType")&&0===i.fieldType)return;if(!t.isNullOrUndefined(n)&&n.hasOwnProperty("fieldType")&&(2===n.fieldType||0===n.fieldType&&i.text.indexOf("TOC")>=0))return;for(var r=0;r<i.revisionIds.length;r++){var o=this.retrieveRevision(i.revisionIds[r]);"Insertion"!==o.revisionType&&"Deletion"!==o.revisionType||e.writeEndElement()}}},e.prototype.serializeComment=function(e,i){if(1!==this.mComments.length||""!==this.mComments[0].text){0===i.commentCharacterType?e.writeStartElement("w","commentRangeStart",this.wNamespace):1===i.commentCharacterType&&e.writeStartElement("w","commentRangeEnd",this.wNamespace);var n=this.commentId[i.commentId];t.isNullOrUndefined(n)&&(n=this.commentId[i.commentId]=this.currentCommentId++),e.writeAttributeString("w","id",this.wNamespace,n.toString()),e.writeEndElement(),1===i.commentCharacterType&&this.serializeCommentItems(e,n)}},e.prototype.serializeCommentItems=function(e,t){e.writeStartElement("w","r",this.wNamespace),e.writeStartElement("w","commentReference",this.wNamespace),e.writeAttributeString("w","id",this.wNamespace,t.toString()),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeBiDirectionalOverride=function(e,t){e.writeStartElement(void 0,"bdo",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t.bdo.toLowerCase())},e.prototype.serializeEditRange=function(e,t){t.hasOwnProperty("editableRangeStart")?e.writeStartElement("w","permEnd",this.wNamespace):(e.writeStartElement("w","permStart",this.wNamespace),t.user&&""!==t.user&&e.writeAttributeString("w","ed",this.wNamespace,t.user),t.group&&""!==t.group&&e.writeAttributeString("w","edGrp",this.wNamespace,t.group.toLowerCase()),t.columnFirst&&-1!==t.columnFirst&&e.writeAttributeString("w","colFirst",this.wNamespace,t.columnFirst.toString()),t.columnLast&&-1!==t.columnLast&&e.writeAttributeString("w","colLast",this.wNamespace,t.columnLast.toString())),e.writeAttributeString("w","id",this.wNamespace,t.editRangeId),e.writeEndElement()},e.prototype.serializeBookMark=function(e,t){var i=this.getBookmarkId(t.name),n=t.name;0===t.bookmarkType?(e.writeStartElement("w","bookmarkStart",this.wNamespace),e.writeAttributeString("w","name",this.wNamespace,n)):1===t.bookmarkType&&e.writeStartElement("w","bookmarkEnd",this.wNamespace),e.writeAttributeString("w","id",this.wNamespace,i.toString()),e.writeEndElement()},e.prototype.getBookmarkId=function(e){var t=this.bookmarks.indexOf(e);return t<0&&(t=this.bookmarks.length,this.bookmarks.push(e)),t},e.prototype.serializePicture=function(e,t){t.width>=0&&t.height>=0&&(e.writeStartElement(void 0,"r",this.wNamespace),this.serializeCharacterFormat(e,t.characterFormat),this.serializeDrawing(e,t),e.writeEndElement())},e.prototype.serializeShape=function(e,t){t.width>=0&&t.height>=0&&(e.writeStartElement(void 0,"r",this.wNamespace),this.serializeCharacterFormat(e,t.characterFormat),this.serializeDrawing(e,t),e.writeEndElement())},e.prototype.serializeDrawing=function(e,t){e.writeStartElement(void 0,"drawing",this.wNamespace),t.hasOwnProperty("chartType")?this.serializeInlineCharts(e,t):"Inline"===t.textWrappingStyle?this.serializeInlinePictureAndShape(e,t):this.serializeWrappingPictureAndShape(e,t),e.writeEndElement()},e.prototype.serializeWrappingPictureAndShape=function(e,i){e.writeStartElement("wp","anchor",this.wpNamespace),this.serializePictureAndShapeDistance(e,i),e.writeAttributeString(void 0,"simplePos",void 0,"0"),e.writeAttributeString(void 0,"relativeHeight",void 0,i.zOrderPosition?i.zOrderPosition.toString():"0");var n=i.textWrappingStyle&&"Behind"===i.textWrappingStyle;e.writeAttributeString(void 0,"behindDoc",void 0,n?"1":"0");var r=i.LockAnchor?"1":"0";e.writeAttributeString(void 0,"locked",void 0,r);var o=i.layoutInCell?"1":"0";e.writeAttributeString(void 0,"layoutInCell",void 0,o);var s=i.allowOverlap?"1":"0";if(e.writeAttributeString(void 0,"allowOverlap",void 0,s),e.writeStartElement("wp","simplePos",this.wpNamespace),e.writeAttributeString(void 0,"x",void 0,"0"),e.writeAttributeString(void 0,"y",void 0,"0"),e.writeEndElement(),e.writeStartElement("wp","positionH",this.wpNamespace),e.writeAttributeString(void 0,"relativeFrom",void 0,L.formatText("firstlower",i.horizontalOrigin.toString())),"None"===i.horizontalAlignment){e.writeStartElement("wp","posOffset",this.wpNamespace);var a=Math.round(i.horizontalPosition*this.emusPerPoint);e.writeString(a.toString()),e.writeEndElement()}else{e.writeStartElement("wp","align",this.wpNamespace);var l=i.horizontalAlignment.toString().toLowerCase();e.writeString(l),e.writeEndElement()}if(e.writeEndElement(),e.writeStartElement("wp","positionV",this.wpNamespace),e.writeAttributeString(void 0,"relativeFrom",void 0,L.formatText("firstlower",i.verticalOrigin.toString())),"None"===i.verticalAlignment){e.writeStartElement("wp","posOffset",this.wpNamespace);var d=Math.round(i.verticalPosition*this.emusPerPoint);e.writeString(d.toString()),e.writeEndElement()}else{e.writeStartElement("wp","align",this.wpNamespace);var h=i.verticalAlignment.toString().toLowerCase();e.writeString(h),e.writeEndElement()}e.writeEndElement(),e.writeStartElement(void 0,"extent",this.wpNamespace);var c=Math.round(i.width*this.emusPerPoint);e.writeAttributeString(void 0,"cx",void 0,c.toString());var p=Math.round(i.height*this.emusPerPoint);e.writeAttributeString(void 0,"cy",void 0,p.toString()),e.writeEndElement(),t.isNullOrUndefined(i.imageString)?this.serializeShapeDrawingGraphics(e,i):(this.serializeShapeWrapStyle(e,i),this.serializeDrawingGraphics(e,i)),e.writeEndElement()},e.prototype.serializeInlinePictureAndShape=function(e,i){e.writeStartElement(void 0,"inline",this.wpNamespace),this.writeDefaultDistAttribute(e),e.writeStartElement(void 0,"extent",this.wpNamespace);var n=Math.round(i.width*this.emusPerPoint);e.writeAttributeString(void 0,"cx",void 0,n.toString());var r=Math.round(i.height*this.emusPerPoint);e.writeAttributeString(void 0,"cy",void 0,r.toString()),e.writeEndElement(),t.isNullOrUndefined(i.imageString)?this.serializeShapeDrawingGraphics(e,i):(this.serializeShapeWrapStyle(e,i),this.serializeDrawingGraphics(e,i)),e.writeEndElement()},e.prototype.serializePictureAndShapeDistance=function(e,t){var i=t.distanceTop?Math.round(t.distanceTop*this.emusPerPoint).toString():"0";e.writeAttributeString(void 0,"distT",void 0,i);var n=t.distanceBottom?Math.round(t.distanceBottom*this.emusPerPoint).toString():"0";e.writeAttributeString(void 0,"distB",void 0,n);var r=t.distanceLeft?Math.round(t.distanceLeft*this.emusPerPoint).toString():"114300";e.writeAttributeString(void 0,"distL",void 0,r);var o=t.distanceRight?Math.round(t.distanceRight*this.emusPerPoint).toString():"114300";e.writeAttributeString(void 0,"distR",void 0,o)},e.prototype.writeDefaultDistAttribute=function(e){e.writeAttributeString(void 0,"distT",void 0,"0"),e.writeAttributeString(void 0,"distB",void 0,"0"),e.writeAttributeString(void 0,"distL",void 0,"0"),e.writeAttributeString(void 0,"distR",void 0,"0")},e.prototype.serializeInlineCharts=function(e,t){e.writeStartElement(void 0,"inline",this.wpNamespace),this.writeDefaultDistAttribute(e),e.writeStartElement(void 0,"extent",this.wpNamespace);var i=Math.round(t.width*this.emusPerPoint);e.writeAttributeString(void 0,"cx",void 0,i.toString());var n=Math.round(t.height*this.emusPerPoint);e.writeAttributeString(void 0,"cy",void 0,n.toString()),e.writeEndElement(),e.writeStartElement(void 0,"effectExtent",this.wpNamespace),e.writeAttributeString(void 0,"l",void 0,"0"),e.writeAttributeString(void 0,"t",void 0,"0"),e.writeAttributeString(void 0,"r",void 0,"0"),e.writeAttributeString(void 0,"b",void 0,"0"),e.writeEndElement(),this.serializeDrawingGraphicsChart(e,t),e.writeEndElement()},e.prototype.serializeDrawingGraphicsChart=function(e,t){var i="";i=this.updatechartId(t),e.writeStartElement("wp","docPr",this.wpNamespace),e.writeAttributeString(void 0,"id",void 0,(this.mDocPrID++).toString()),e.writeAttributeString(void 0,"name",void 0,this.getNextChartName()),e.writeEndElement(),e.writeStartElement("wp","cNvGraphicFramePr",this.wpNamespace),e.writeEndElement(),e.writeStartElement("a","graphic",this.aNamespace),e.writeStartElement("a","graphicData",this.aNamespace),e.writeAttributeString(void 0,"uri",void 0,this.chartNamespace),e.writeStartElement("c","chart",this.chartNamespace),e.writeAttributeString("xmlns","r",void 0,this.rNamespace),e.writeAttributeString("r","id",void 0,i),e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},e.prototype.getNextChartName=function(){return"Chart"+ ++this.chartCount},e.prototype.serializeChart=function(e,t){e.writeStartElement("w","r",this.wNamespace),this.serializeCharacterFormat(e,t.characterFormat),this.serializeDrawing(e,t),e.writeEndElement()},e.prototype.serializeChartStructure=function(){this.serializeChartXML(),this.serializeChartColors(),this.serializeChartExcelData(),this.serializeChartRelations(),this.chart=void 0,this.saveExcel()},e.prototype.serializeChartXML=function(){var e="",t=new p.XmlWriter;t.writeStartElement("c","chartSpace",this.chartNamespace),t.writeAttributeString("xmlns","a",void 0,this.aNamespace),t.writeAttributeString("xmlns","r",void 0,this.rNamespace),t.writeAttributeString("xmlns","c16r2",void 0,this.c15Namespace),this.serializeChartData(t,this.chart),t.writeStartElement("c","externalData",this.chartNamespace),t.writeAttributeString("r","id",void 0,"rId1"),t.writeStartElement("c","autoUpdate",this.chartNamespace),t.writeAttributeString(void 0,"val",void 0,"0"),t.writeEndElement(),t.writeEndElement(),t.writeEndElement(),e=this.chartPath+"/chart"+this.chartCount+".xml";var i=new c.ZipArchiveItem(t.buffer,e);this.mArchive.addItem(i)},e.prototype.serializeChartColors=function(){var e=new p.XmlWriter,t="";e.writeStartElement("cs","colorStyle",this.csNamespace),e.writeAttributeString("xmlns","a",void 0,this.aNamespace),e.writeAttributeString(void 0,"meth",void 0,"cycle"),e.writeAttributeString(void 0,"id",void 0,"10"),this.serializeChartColor(e),t=this.chartPath+"/colors"+this.chartCount+".xml",e.writeEndElement();var i=new c.ZipArchiveItem(e.buffer,t);this.mArchive.addItem(i),t=""},e.prototype.serializeChartColor=function(e){for(var t=1;t<=6;t++)e.writeStartElement("a","schemeClr",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"accent"+t),e.writeEndElement();e.writeStartElement("cs","variation",this.csNamespace),e.writeEndElement(),e.writeStartElement("cs","variation",this.csNamespace),e.writeStartElement("a","lumMod",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"60000"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("cs","variation",this.csNamespace),e.writeStartElement("a","lumMod",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"80000"),e.writeEndElement(),e.writeStartElement("a","lumOff",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"20000"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("cs","variation",this.csNamespace),e.writeStartElement("a","lumMod",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"80000"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("cs","variation",this.csNamespace),e.writeStartElement("a","lumMod",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"60000"),e.writeEndElement(),e.writeStartElement("a","lumOff",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"40000"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("cs","variation",this.csNamespace),e.writeStartElement("a","lumMod",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"50000"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("cs","variation",this.csNamespace),e.writeStartElement("a","lumMod",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"70000"),e.writeEndElement(),e.writeStartElement("a","lumOff",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"30000"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("cs","variation",this.csNamespace),e.writeStartElement("a","lumMod",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"70000"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("cs","variation",this.csNamespace),e.writeStartElement("a","lumMod",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"50000"),e.writeEndElement(),e.writeStartElement("a","lumOff",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"50000"),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeChartExcelData=function(){t.isNullOrUndefined(this.excelFiles)&&(this.excelFiles=new u),this.mArchiveExcel=new c.ZipArchive,this.mArchiveExcel.compressionLevel="Normal";var e=this.chart.chartType,i="Scatter_Markers"===e||"Bubble"===e;this.serializeWorkBook(),this.serializeSharedString(i),this.serializeExcelContentTypes(),this.serializeExcelData(i),this.serializeExcelStyles(),this.serializeExcelRelation(),this.serializeExcelGeneralRelations(),this.chartStringCount=0},e.prototype.serializeWorkBook=function(){var e=new p.XmlWriter;this.resetExcelRelationShipId(),e.writeStartElement(void 0,"workbook",void 0),e.writeAttributeString("xmlns","r",void 0,this.rNamespace),e.writeAttributeString("xmlns",void 0,void 0,this.spreadSheetNamespace),e.writeStartElement(void 0,"sheets",void 0),e.writeStartElement(void 0,"sheet",void 0),e.writeAttributeString(void 0,"name",void 0,"Sheet1"),e.writeAttributeString(void 0,"sheetId",void 0,"1"),e.writeAttributeString("r","id",void 0,this.getNextExcelRelationShipID()),e.writeEndElement(),e.writeEndElement(),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,"xl/workbook.xml");this.mArchiveExcel.addItem(t)},e.prototype.serializeExcelStyles=function(){var e=new p.XmlWriter;e.writeStartElement(void 0,"styleSheet",void 0),e.writeAttributeString("xmlns","mc",void 0,this.veNamespace),e.writeAttributeString("mc","Ignorable",void 0,"x14ac"),e.writeAttributeString("xmlns","x14ac",void 0,"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"),e.writeAttributeString("xmlns",void 0,void 0,this.spreadSheetNamespace),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,"xl/styles.xml");this.mArchiveExcel.addItem(t)},e.prototype.serializeExcelData=function(e){var t=new p.XmlWriter;t.writeStartElement(void 0,"worksheet",void 0),t.writeAttributeString("xmlns","r",void 0,this.rNamespace),t.writeAttributeString("xmlns","x14",void 0,this.spreadSheet9),t.writeAttributeString("xmlns","mc",void 0,this.veNamespace),t.writeAttributeString("xmlns",void 0,void 0,this.spreadSheetNamespace),this.serializeExcelSheet(t,e),t.writeEndElement();var i=new c.ZipArchiveItem(t.buffer,"xl/worksheets/sheet1.xml");this.mArchiveExcel.addItem(i)},e.prototype.serializeSharedString=function(e){for(var t=this.chart,i=new p.XmlWriter,n=[],r=this.chart.chartType,o=t.chartSeries.length,s=0;s<o;s++){var a=t.chartSeries[s],l=a.seriesName.match(/[a-z]/i);e&&0===s&&n.push("X-Values"),l&&(n.push(a.seriesName),this.chartStringCount++)}"Bubble"===r&&n.push("Size");for(var d=0;d<t.chartCategory.length;d++){var h=t.chartCategory[d],g=t.chartPrimaryCategoryAxis.numberFormat;((l=h.categoryXName.match(/[a-z]/i))||"m/d/yyyy"===g)&&(n.push(h.categoryXName),this.chartStringCount++)}var u=this.chartStringCount+1;i.writeStartElement(void 0,"sst",void 0),i.writeAttributeString("xmlns",void 0,void 0,this.spreadSheetNamespace),i.writeAttributeString(void 0,"count",void 0,u.toString()),i.writeAttributeString(void 0,"uniqueCount",void 0,u.toString());for(var m=0;m<=n.length;m++)i.writeStartElement(void 0,"si",void 0),i.writeStartElement(void 0,"t",void 0),m!==n.length?i.writeString(n[m]):e||(i.writeAttributeString("xml","space",this.xmlNamespace,"preserve"),i.writeString(" ")),i.writeEndElement(),i.writeEndElement();i.writeEndElement();var f=new c.ZipArchiveItem(i.buffer,"xl/sharedStrings.xml");this.mArchiveExcel.addItem(f)},e.prototype.serializeExcelSheet=function(e,i){var n,r=this.chart,o="s",s="Bubble"===r.chartType,a=r.chartCategory.length+1,l=r.chartPrimaryCategoryAxis.numberFormat,d=r.chartSeries.length+1;s&&(n=d,d+=1);var h=void 0,c=void 0,p=0;e.writeStartElement(void 0,"sheetData",void 0);for(var g=0;g<a;g++){e.writeStartElement(void 0,"row",void 0),e.writeAttributeString(void 0,"r",void 0,(g+1).toString());for(var u=0;u<d;u++){var m=String.fromCharCode("A".charCodeAt(0)+u)+(g+1).toString();if(e.writeStartElement(void 0,"c",void 0),e.writeAttributeString(void 0,"r",void 0,m),0!==g&&0===u){var f=(h=r.chartCategory[g-1]).categoryXName.match(/[a-z]/i);o=t.isNullOrUndefined(f)&&"m/d/yyyy"===l?"s":!f&&!t.isNullOrUndefined(f)||i?"n":"s"}else o=0===g&&0!==u&&u!==n?(f=(c=r.chartSeries[u-1]).seriesName.match(/[a-z]/i))?"s":"n":0===g&&s&&u===n?"s":0===g&&0===u?"s":"n";if(e.writeAttributeString(void 0,"t",void 0,o),e.writeStartElement(void 0,"v",void 0),0!==g||0!==u||i){if("s"===o)e.writeString(p.toString()),p++;else if(0!==g&&"s"!==o&&0===u&&u!==n)e.writeString(h.categoryXName);else if(0!==u&&"s"!==o&&0===g&&u!==n)e.writeString(c.seriesName);else if(0!==u&&u!==n){var v=(y=h.chartData[u-1]).yValue;e.writeString(v.toString())}else if(s&&u===n){var y=h.chartData[u-2],b=y.size;e.writeString(b.toString())}}else e.writeString(this.chartStringCount.toString());e.writeEndElement(),e.writeEndElement(),o=""}e.writeEndElement()}e.writeEndElement()},e.prototype.serializeExcelContentTypes=function(){var e=new p.XmlWriter;e.writeStartElement(void 0,"Types","http://schemas.openxmlformats.org/package/2006/content-types"),this.serializeDefaultContentType(e,"xml",this.xmlContentType),this.serializeDefaultContentType(e,"rels",this.relationContentType),this.serializeOverrideContentType(e,"xl/styles.xml","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"),this.serializeOverrideContentType(e,"xl/workbook.xml","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"),this.serializeOverrideContentType(e,"xl/sharedStrings.xml","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"),this.serializeOverrideContentType(e,"xl/worksheets/sheet1.xml","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,this.contentTypesPath);this.mArchiveExcel.addItem(t)},e.prototype.serializeExcelRelation=function(){var e=new p.XmlWriter;this.resetExcelRelationShipId();e.writeStartElement(void 0,"Relationships",this.rpNamespace),this.serializeRelationShip(e,this.getNextExcelRelationShipID(),"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","worksheets/sheet1.xml"),this.serializeRelationShip(e,this.getNextExcelRelationShipID(),this.stylesRelType,"styles.xml"),this.serializeRelationShip(e,this.getNextExcelRelationShipID(),"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings","sharedStrings.xml"),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,this.excelRelationPath);this.mArchiveExcel.addItem(t)},e.prototype.serializeExcelGeneralRelations=function(){var e=new p.XmlWriter;this.resetExcelRelationShipId(),e.writeStartElement(void 0,"Relationships",this.rpNamespace),this.serializeRelationShip(e,this.getNextExcelRelationShipID(),this.documentRelType,"xl/workbook.xml"),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,this.generalRelationPath);this.mArchiveExcel.addItem(t)},e.prototype.getNextExcelRelationShipID=function(){return"rId"+ ++this.eRelationShipId},e.prototype.getNextChartRelationShipID=function(){return"rId"+ ++this.cRelationShipId},e.prototype.serializeChartData=function(e,i){e.writeStartElement("c","date1904",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),e.writeStartElement("c","lang",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"en-US"),e.writeEndElement(),e.writeStartElement("c","roundedCorners",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),e.writeStartElement("mc","AlternateContent",this.veNamespace),e.writeStartElement("mc","Choice",this.veNamespace),e.writeAttributeString("xmlns","c14",void 0,this.c7Namespace),e.writeAttributeString(void 0,"Requires",void 0,"c14"),e.writeStartElement("c14","style",void 0),e.writeAttributeString(void 0,"val",void 0,"102"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("mc","Fallback",this.veNamespace),e.writeStartElement("c","style",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"2"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("c","chart",this.chartNamespace),t.isNullOrUndefined(this.chart.chartTitle)||(e.writeStartElement("c","title",this.chartNamespace),this.serializeTextProperties(e,this.chart.chartTitleArea,this.chart.chartTitle),e.writeEndElement()),this.serializeChartPlotArea(e,i),e.writeEndElement(),this.serializeShapeProperties(e,"D9D9D9",!0),e.writeStartElement("c","txPr",this.chartNamespace),e.writeAttributeString("xmlns","c",void 0,this.chartNamespace),e.writeStartElement("a","bodyPr",this.aNamespace),e.writeAttributeString("xmlns","a",void 0,this.aNamespace),e.writeEndElement(),e.writeStartElement("a","lstStyle",this.aNamespace),e.writeAttributeString("xmlns","a",void 0,this.aNamespace),e.writeEndElement(),e.writeStartElement("a","p",this.aNamespace),e.writeAttributeString("xmlns","a",void 0,this.aNamespace),e.writeStartElement("a","pPr",this.aNamespace),e.writeStartElement("a","defRPr",this.aNamespace),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("a","endParaRPr",this.aNamespace),e.writeAttributeString(void 0,"lang",void 0,"en-US"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeChartPlotArea=function(e,i){e.writeStartElement("c","autoTitleDeleted",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),e.writeStartElement("c","plotArea",this.chartNamespace),e.writeStartElement("c","layout",this.chartNamespace),e.writeEndElement();var n=this.chartType(i),r="pieChart"===n||"doughnutChart"===n,o="scatterChart"===n||"bubbleChart"===n;if(e.writeStartElement("c",n,this.chartNamespace),"barChart"===n){var s="";s="Column_Clustered"===i.chartType||"Column_Stacked"===i.chartType||"Column_Stacked_100"===i.chartType?"col":"bar",e.writeStartElement("c","barDir",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,s),e.writeEndElement()}if(!r&&!o){var a=this.chartGrouping(i.chartType);e.writeStartElement("c","grouping",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,a),e.writeEndElement()}"scatterChart"===n&&(e.writeStartElement("c","scatterStyle",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"marker"),e.writeEndElement()),e.writeStartElement("c","varyColors",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement();for(var l="",d=0;d<i.chartSeries.length;d++){var h=i.chartSeries[d];this.seriesCount=d,e.writeStartElement("c","ser",this.chartNamespace),e.writeStartElement("c","idx",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,d.toString()),e.writeEndElement(),e.writeStartElement("c","order",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,d.toString()),e.writeEndElement(),e.writeStartElement("c","tx",this.chartNamespace),e.writeStartElement("c","strRef",this.chartNamespace),e.writeStartElement("c","f",this.chartNamespace);var c=String.fromCharCode("B".charCodeAt(0)+d);if(l="Sheet1!$"+c,e.writeString(l+"$1"),l=l+"$2:$"+c+"$",e.writeEndElement(),e.writeStartElement("c","strCache",this.chartNamespace),e.writeStartElement("c","ptCount",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"1"),e.writeEndElement(),e.writeStartElement("c","pt",this.chartNamespace),e.writeAttributeString(void 0,"idx",void 0,"0"),e.writeStartElement("c","v",this.chartNamespace),e.writeString(h.seriesName),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),"Pie"===i.chartType||"Doughnut"===i.chartType?(this.parseChartDataPoint(e,h),e.writeStartElement("c","explosion",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement()):o||this.parseChartSeriesColor(e,h.dataPoints,n),"scatterChart"===n){var p=h.dataPoints[0].fill.foreColor;e.writeStartElement("c","marker",this.chartNamespace),e.writeStartElement("c","symbol",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"circle"),e.writeEndElement(),e.writeStartElement("c","size",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"5"),e.writeEndElement(),this.serializeShapeProperties(e,p,!1),e.writeEndElement()}h.dataLabel&&this.parseChartDataLabels(e,h.dataLabel),h.trendLines&&this.parseChartTrendLines(e,h),h.errorBar&&this.serializeChartErrorBar(e,h),"scatterChart"===n?this.serializeDefaultShapeProperties(e):"bubbleChart"===n&&this.serializeShapeProperties(e,h.dataPoints[d].fill.foreColor,!1);var g="cat",u="strRef",m="strCache";"scatterChart"===n&&(g="xVal",u="numRef",m="numCache"),e.writeStartElement("c",g,this.chartNamespace),e.writeStartElement("c",u,this.chartNamespace),this.serializeChartCategory(e,i,m),e.writeEndElement(),e.writeEndElement(),this.serializeChartValue(e,l,n),e.writeEndElement()}if(e.writeStartElement("c","dLbls",this.chartNamespace),r&&(e.writeStartElement("c","dLblPos",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"bestFit"),e.writeEndElement()),e.writeStartElement("c","showLegendKey",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),e.writeStartElement("c","showVal",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),e.writeStartElement("c","showCatName",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),e.writeStartElement("c","showSerName",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),e.writeStartElement("c","showPercent",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),e.writeStartElement("c","showBubbleSize",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),e.writeStartElement("c","showLeaderLines",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"1"),e.writeEndElement(),e.writeEndElement(),r){var f=0,v=0;(h=this.chart.chartSeries[0]).hasOwnProperty("firstSliceAngle")&&(f=h.firstSliceAngle),e.writeStartElement("c","firstSliceAng",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,f.toString()),e.writeEndElement(),"Doughnut"===i.chartType&&(v=h.holeSize,e.writeStartElement("c","holeSize",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,v.toString()),e.writeEndElement())}"lineChart"===n||o?"bubbleChart"!==n&&(e.writeStartElement("c","smooth",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement()):(e.writeStartElement("c","gapWidth",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,this.chart.gapWidth.toString()),e.writeEndElement(),e.writeStartElement("c","overlap",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,this.chart.overlap.toString()),e.writeEndElement()),"bubbleChart"===n&&(e.writeStartElement("c","sizeRepresents",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"area"),e.writeEndElement());var y=this.chart.chartType;r||(e.writeStartElement("c","axId",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"335265000"),e.writeEndElement(),e.writeStartElement("c","axId",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"335263360"),e.writeEndElement()),e.writeEndElement();var b="Column_Stacked_100"===y||"Area_Stacked_100"===y||"Bar_Stacked_100"===y||"Line_Stacked_100"===y||"Line_Markers_Stacked_100"===y,w=this.chart.chartPrimaryCategoryAxis.categoryType;if(r||(this.serializeCategoryAxis(e,w,b),this.serializeValueAxis(e,w,b)),this.chart.hasOwnProperty("chartDataTable")){var C=this.chart.chartDataTable,x=0,F=0,P=0,T=0;C.showSeriesKeys&&(T=1),C.hasHorzBorder&&(x=1),C.hasVertBorder&&(F=1),C.hasBorders&&(P=1),e.writeStartElement("c","dTable",this.chartNamespace),e.writeStartElement("c","showHorzBorder",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,x.toString()),e.writeEndElement(),e.writeStartElement("c","showVertBorder",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,F.toString()),e.writeEndElement(),e.writeStartElement("c","showOutline",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,P.toString()),e.writeEndElement(),e.writeStartElement("c","showKeys",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,T.toString()),e.writeEndElement(),e.writeEndElement()}this.serializeDefaultShapeProperties(e),e.writeEndElement(),t.isNullOrUndefined(this.chart.chartLegend.position)||this.serializeChartLegend(e),e.writeStartElement("c","plotVisOnly",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"1"),e.writeEndElement(),e.writeStartElement("c","dispBlanksAs",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"gap"),e.writeEndElement()},e.prototype.serializeChartLegend=function(e){var t=this.chartLegendPosition(this.chart.chartLegend),i=this.chart.chartLegend.chartTitleArea,n=i.dataFormat.fill.foreColor;e.writeStartElement("c","legend",this.chartNamespace),e.writeStartElement("c","legendPos",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,t),e.writeEndElement(),e.writeStartElement("c","overlay",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),this.serializeDefaultShapeProperties(e),e.writeStartElement("c","txPr",this.chartNamespace),e.writeStartElement("a","bodyPr",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","lstStyle",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","p",this.aNamespace),this.serializeChartTitleFont(e,i.fontSize,n,i.fontName),e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeChartErrorBar=function(e,t){var i=t.errorBar,n=this.errorBarValueType(i.type),r=0;"Cap"!==i.endStyle&&(r=1),e.writeStartElement("c","errBars",this.chartNamespace),e.writeStartElement("c","errBarType",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,i.direction.toLowerCase()),e.writeEndElement(),e.writeStartElement("c","errValType",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n),e.writeEndElement(),e.writeStartElement("c","noEndCap",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r.toString()),e.writeEndElement(),e.writeStartElement("c","val",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,i.numberValue.toString()),e.writeEndElement(),this.serializeShapeProperties(e,"595959",!0),e.writeEndElement()},e.prototype.errorBarValueType=function(e){var t="";switch(e){case"StandardError":t="stdErr";break;case"StandardDeviation":t="stdDev";break;case"Percentage":t="percentage";break;case"Fixed":t="fixedVal";break;default:t="stdErr"}return t},e.prototype.serializeCategoryAxis=function(e,t,i){var n="catAx",r=this.chart.chartPrimaryCategoryAxis.numberFormat,o=this.chart.chartType,s="Scatter_Markers"===o||"Bubble"===o;"Time"===t&&(n="dateAx"),s&&(n="valAx"),e.writeStartElement("c",n,this.chartNamespace),e.writeStartElement("c","axId",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"335265000"),e.writeEndElement(),this.serializeAxis(e,"335263360",this.chart.chartPrimaryCategoryAxis,r,i),s||(e.writeStartElement("c","auto",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"1"),e.writeEndElement(),e.writeStartElement("c","lblAlgn",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"ctr"),e.writeEndElement(),e.writeStartElement("c","lblOffset",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"100"),e.writeEndElement()),"Time"===t?(e.writeStartElement("c","baseTimeUnit",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"days"),e.writeEndElement()):"Bubble"!==this.chart.chartType&&(e.writeStartElement("c","noMultiLvlLbl",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement()),e.writeEndElement()},e.prototype.serializeValueAxis=function(e,t,i){var n=this.chart.chartPrimaryValueAxis,r="between";"Time"===t&&(r="midCat"),e.writeStartElement("c","valAx",this.chartNamespace),e.writeStartElement("c","axId",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"335263360"),e.writeEndElement(),this.serializeAxis(e,"335265000",n,"General",i),e.writeStartElement("c","crossBetween",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r),e.writeEndElement(),0===n.majorUnit||i||(e.writeStartElement("c","majorUnit",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n.majorUnit.toString()),e.writeEndElement()),e.writeEndElement()},e.prototype.serializeAxis=function(e,t,i,n,r){e.writeStartElement("c","scaling",this.chartNamespace),e.writeStartElement("c","orientation",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"minMax"),e.writeEndElement(),0===i.maximumValue||r||(e.writeStartElement("c","max",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,i.maximumValue.toString()),e.writeEndElement(),e.writeStartElement("c","min",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,i.minimumValue.toString()),e.writeEndElement()),e.writeEndElement(),e.writeStartElement("c","delete",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),e.writeStartElement("c","axPos",this.chartNamespace),"335265000"===t?e.writeAttributeString(void 0,"val",void 0,"l"):e.writeAttributeString(void 0,"val",void 0,"b"),e.writeEndElement(),i.hasMajorGridLines&&(e.writeStartElement("c","majorGridlines",this.chartNamespace),this.serializeShapeProperties(e,"D9D9D9",!0),e.writeEndElement()),i.hasMinorGridLines&&(e.writeStartElement("c","minorGridlines",this.chartNamespace),this.serializeShapeProperties(e,"F2F2F2",!0),e.writeEndElement()),i.chartTitle&&(e.writeStartElement("c","title",this.chartNamespace),this.serializeTextProperties(e,i.chartTitleArea,i.chartTitle),e.writeEndElement()),e.writeStartElement("c","numFmt",this.chartNamespace),e.writeAttributeString(void 0,"formatCode",void 0,n),e.writeAttributeString(void 0,"sourceLinked",void 0,"1"),e.writeEndElement(),e.writeStartElement("c","majorTickMark",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"none"),e.writeEndElement(),e.writeStartElement("c","minorTickMark",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"none"),e.writeEndElement(),e.writeStartElement("c","tickLblPos",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"nextTo"),e.writeEndElement(),"Bubble"===this.chart.chartType?this.serializeShapeProperties(e,"BFBFBF",!0):this.serializeDefaultShapeProperties(e),e.writeStartElement("c","txPr",this.chartNamespace),e.writeStartElement("a","bodyPr",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","p",this.aNamespace),this.serializeChartTitleFont(e,i.fontSize,"595959",i.fontName),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("c","crossAx",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,t),e.writeEndElement(),e.writeStartElement("c","crosses",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"autoZero"),e.writeEndElement()},e.prototype.parseChartTrendLines=function(e,t){for(var i=0;i<t.trendLines.length;i++){var n=t.trendLines[i],r=this.chartTrendLineType(n.type),o=0,s=0;n.isDisplayEquation?s=1:n.isDisplayRSquared&&(o=1);var a=t.dataPoints[i];e.writeStartElement("c","trendline",this.chartNamespace),e.writeStartElement("c","spPr",this.chartNamespace),e.writeStartElement("a","ln",this.aNamespace),e.writeAttributeString(void 0,"w",void 0,"19050"),this.serializeChartSolidFill(e,a.fill.foreColor,!1),e.writeStartElement("a","prstDash",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"sysDot"),e.writeEndElement(),e.writeStartElement("a","round",this.aNamespace),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("c","trendlineType",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r),e.writeEndElement(),e.writeStartElement("c","forward",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n.forward.toString()),e.writeEndElement(),e.writeStartElement("c","backward",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n.backward.toString()),e.writeEndElement(),"NaN"!==n.intercept&&(e.writeStartElement("c","intercept",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n.intercept.toString()),e.writeEndElement()),e.writeStartElement("c","dispRSqr",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,o.toString()),e.writeEndElement(),e.writeStartElement("c","dispEq",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,s.toString()),e.writeEndElement(),e.writeEndElement()}},e.prototype.chartTrendLineType=function(e){var t="";switch(e){case"Linear":t="linear";break;case"Exponential":t="exp"}return t},e.prototype.parseChartDataLabels=function(e,t){var i="",n=0,r=0,o=0,s=0,a=0,l=0,d=0;switch(t.position){case"Center":i="ctr";break;case"Left":i="l";break;case"Right":i="r";break;case"Outside":i="outEnd";break;case"BestFit":i="bestFit";break;case"Bottom":case"OutsideBase":i="inBase";break;case"Inside":i="inEnd";break;case"Above":i="t";break;case"Below":i="b";break;default:i="Automatic"}e.writeStartElement("c","dLbls",this.chartNamespace),this.serializeDefaultShapeProperties(e),e.writeStartElement("c","txPr",this.chartNamespace),e.writeStartElement("a","bodyPr",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","lstStyle",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","p",this.aNamespace),this.serializeChartTitleFont(e,t.fontSize,t.fontColor,t.fontName),e.writeEndElement(),e.writeEndElement(),t.isLegendKey?n=1:t.isBubbleSize?r=1:t.isCategoryName?o=1:t.isSeriesName?s=1:t.isValue?a=1:t.isPercentage?l=1:t.isLeaderLines&&(d=1),"Automatic"!==i&&(e.writeStartElement("c","dLblPos",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,i),e.writeEndElement()),e.writeStartElement("c","showLegendKey",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,n.toString()),e.writeEndElement(),e.writeStartElement("c","showVal",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,a.toString()),e.writeEndElement(),e.writeStartElement("c","showCatName",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,o.toString()),e.writeEndElement(),e.writeStartElement("c","showSerName",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,s.toString()),e.writeEndElement(),e.writeStartElement("c","showPercent",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,l.toString()),e.writeEndElement(),e.writeStartElement("c","showBubbleSize",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r.toString()),e.writeEndElement(),e.writeStartElement("c","showLeaderLines",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,d.toString()),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeShapeProperties=function(e,t,i){var n=this.chart.chartType,r="Scatter_Markers"===n||"Bubble"===n;e.writeStartElement("c","spPr",this.chartNamespace),!r||i?(e.writeStartElement("a","ln",this.aNamespace),e.writeAttributeString(void 0,"w",void 0,"9525"),this.serializeChartSolidFill(e,t,!1),e.writeStartElement("a","prstDash",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"solid"),e.writeEndElement(),e.writeStartElement("a","round",this.aNamespace),e.writeEndElement(),e.writeEndElement()):"Scatter_Markers"===n?(this.serializeChartSolidFill(e,t,!1),this.serializeDefaultLineProperties(e)):"Bubble"===n&&(this.serializeChartSolidFill(e,t,!0),this.serializeDefaultLineProperties(e)),e.writeStartElement("a","effectLst",this.aNamespace),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeDefaultShapeProperties=function(e){e.writeStartElement("c","spPr",this.chartNamespace),e.writeStartElement("a","noFill",this.aNamespace),e.writeEndElement(),this.serializeDefaultLineProperties(e),e.writeStartElement("a","effectLst",this.aNamespace),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeDefaultLineProperties=function(e){e.writeStartElement("a","ln",this.aNamespace),e.writeStartElement("a","noFill",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","round",this.aNamespace),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeTextProperties=function(e,t,i){var n=t.dataFormat.fill.foreColor,r=100*t.fontSize;e.writeStartElement("c","tx",this.chartNamespace),e.writeStartElement("c","rich",this.chartNamespace),e.writeStartElement("a","bodyPr",this.aNamespace),e.writeAttributeString(void 0,"rot",void 0,"0"),e.writeAttributeString(void 0,"vert",void 0,"horz"),e.writeEndElement(),e.writeStartElement("a","lstStyle",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","p",this.aNamespace),this.serializeChartTitleFont(e,t.fontSize,n,t.fontName),e.writeStartElement("a","r",this.aNamespace),e.writeStartElement("a","rPr",this.aNamespace),e.writeAttributeString(void 0,"lang",void 0,"en-US"),e.writeAttributeString(void 0,"b",void 0,"0"),e.writeAttributeString(void 0,"sz",void 0,r.toString()),e.writeAttributeString(void 0,"baseline",void 0,"0"),this.serializeChartSolidFill(e,n,!1),this.serializeFont(e,t.fontName),e.writeEndElement(),e.writeStartElement("a","t",this.aNamespace),e.writeString(i),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("c","layout",this.chartNamespace),e.writeEndElement(),e.writeStartElement("c","overlay",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),this.serializeDefaultShapeProperties(e),e.writeStartElement("c","txPr",this.chartNamespace),e.writeStartElement("a","bodyPr",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","lstStyle",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","p",this.aNamespace),e.writeEndElement(),this.serializeChartTitleFont(e,t.fontSize,n,t.fontName),e.writeEndElement()},e.prototype.serializeChartTitleFont=function(e,t,i,n){var r=100*t;e.writeStartElement("a","pPr",this.aNamespace),e.writeStartElement("a","defRPr",this.aNamespace),e.writeAttributeString(void 0,"lang",void 0,"en-US"),e.writeAttributeString(void 0,"b",void 0,"0"),e.writeAttributeString(void 0,"sz",void 0,r.toString()),e.writeAttributeString(void 0,"baseline",void 0,"0"),this.serializeChartSolidFill(e,i,!1),this.serializeFont(e,n),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeChartSolidFill=function(e,t,i){e.writeStartElement("a","solidFill",this.aNamespace),e.writeStartElement("a","srgbClr",this.aNamespace),"000000"!==t?e.writeAttributeString(void 0,"val",void 0,t):e.writeAttributeString(void 0,"val",void 0,"595959"),"Bubble"===this.chart.chartType&&i&&(e.writeStartElement("a","alpha",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,"75000"),e.writeEndElement()),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeFont=function(e,t){e.writeStartElement("a","latin",this.aNamespace),e.writeAttributeString(void 0,"typeface",void 0,t),e.writeEndElement(),e.writeStartElement("a","ea",this.aNamespace),e.writeAttributeString(void 0,"typeface",void 0,t),e.writeEndElement(),e.writeStartElement("a","cs",this.aNamespace),e.writeAttributeString(void 0,"typeface",void 0,t),e.writeEndElement()},e.prototype.parseChartSeriesColor=function(e,t,i){for(var n=0;n<t.length;n++){var r=t[n];if(e.writeStartElement("c","spPr",this.chartNamespace),"lineChart"===i&&(e.writeStartElement("a","ln",this.aNamespace),e.writeAttributeString(void 0,"w",void 0,"28575"),e.writeAttributeString(void 0,"cap",void 0,"rnd")),"lineChart"!==i?this.serializeChartSolidFill(e,r.fill.foreColor,!0):this.serializeChartSolidFill(e,r.line.color,!0),"lineChart"!==i&&(e.writeStartElement("a","ln",this.aNamespace),e.writeStartElement("a","noFill",this.aNamespace),e.writeEndElement()),e.writeStartElement("a","round",this.aNamespace),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("a","effectLst",this.aNamespace),e.writeEndElement(),e.writeEndElement(),"lineChart"===i){var o="none",s=0;this.chart.chartSeries[n].hasOwnProperty("seriesFormat")&&(o=this.chart.chartSeries[n].seriesFormat.markerStyle,s=this.chart.chartSeries[n].seriesFormat.markerSize),e.writeStartElement("c","marker",this.chartNamespace),e.writeStartElement("c","symbol",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,o.toLowerCase()),e.writeEndElement(),this.chart.chartSeries[n].hasOwnProperty("seriesFormat")&&(e.writeStartElement("c","size",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,s.toString()),e.writeEndElement()),e.writeEndElement()}}},e.prototype.parseChartDataPoint=function(e,t){for(var i=t.dataPoints,n=[],r=0;r<i.length;r++)n.push(i[r]),e.writeStartElement("c","dPt",this.chartNamespace),e.writeStartElement("c","idx",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r.toString()),e.writeEndElement(),e.writeStartElement("c","bubble3D",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement(),this.parseChartSeriesColor(e,n,this.chart.chartType),e.writeEndElement(),n=[]},e.prototype.serializeChartCategory=function(e,t,i){var n=t.chartCategory,r=n.length;e.writeStartElement("c","f",this.chartNamespace),e.writeString("Sheet1!$A$2:$A$"+(r+1).toString()),e.writeEndElement(),e.writeStartElement("c",i,this.chartNamespace),"numCache"===i&&(e.writeStartElement("c","formatCode",this.chartNamespace),e.writeString("General"),e.writeEndElement()),e.writeStartElement("c","ptCount",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r.toString()),e.writeEndElement();for(var o=0;o<n.length;o++){var s=n[o];e.writeStartElement("c","pt",this.chartNamespace),e.writeAttributeString(void 0,"idx",void 0,o.toString()),e.writeStartElement("c","v",this.chartNamespace),""!==s.categoryXName&&e.writeString(s.categoryXName),e.writeEndElement(),e.writeEndElement()}e.writeEndElement()},e.prototype.serializeChartValue=function(e,t,i){var n="val";("scatterChart"===i||"bubbleChart"===i)&&(n="yVal"),this.serializeChartYValue(e,n,t),"bubbleChart"===i&&(n="bubbleSize",t="Sheet1!$C$2:$C$",this.serializeChartYValue(e,n,t)),"lineChart"!==i&&"scatterChart"!==i||(e.writeStartElement("c","smooth",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,"0"),e.writeEndElement())},e.prototype.serializeChartYValue=function(e,t,i){var n=this.chart.chartCategory,r=n.length;e.writeStartElement("c",t,this.chartNamespace),e.writeStartElement("c","numRef",this.chartNamespace),e.writeStartElement("c","f",this.chartNamespace),e.writeString(i+(r+1).toString()),e.writeEndElement(),e.writeStartElement("c","numCache",this.chartNamespace),e.writeStartElement("c","formatCode",this.chartNamespace),e.writeString("General"),e.writeEndElement(),e.writeStartElement("c","ptCount",this.chartNamespace),e.writeAttributeString(void 0,"val",void 0,r.toString()),e.writeEndElement();for(var o=0;o<r;o++)for(var s=n[o],a=0;a<s.chartData.length;a++)if(a===this.seriesCount){var l=s.chartData[this.seriesCount];e.writeStartElement("c","pt",this.chartNamespace),e.writeAttributeString(void 0,"idx",void 0,o.toString()),e.writeStartElement("c","v",this.chartNamespace),"bubbleSize"!==t?e.writeString(l.yValue.toString()):e.writeString(l.size.toString()),e.writeEndElement(),e.writeEndElement()}e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},e.prototype.chartType=function(e){var t=e.chartType;switch(t){case"Pie":t="pieChart";break;case"Doughnut":t="doughnutChart";break;case"Scatter_Markers":t="scatterChart";break;case"Bubble":t="bubbleChart"}return"Area"!==t&&"Area_Stacked"!==t&&"Area_Stacked_100"!==t||(t="areaChart"),"Bar_Stacked_100"!==t&&"Bar_Stacked"!==t&&"Bar_Clustered"!==t&&"Column_Clustered"!==t&&"Column_Stacked"!==t&&"Column_Stacked_100"!==t||(t="barChart"),"Line"!==t&&"Line_Markers"!==t&&"Line_Markers_Stacked"!==t&&"Line_Stacked"!==t&&"Line_Markers_Stacked_100"!==t&&"Line_Stacked_100"!==t||(t="lineChart"),t},e.prototype.chartGrouping=function(e){var t="standard";return"Bar_Stacked"===e||"Column_Stacked"===e||"Area_Stacked"===e||"Line_Stacked"===e||"Line_Markers_Stacked"===e?t="stacked":"Bar_Stacked_100"===e||"Column_Stacked_100"===e||"Area_Stacked_100"===e||"Line_Stacked_100"===e||"Line_Markers_Stacked_100"===e?t="percentStacked":"Bar_Clustered"!==e&&"Column_Clustered"!==e||(t="clustered"),t},e.prototype.chartLegendPosition=function(e){var t=e.position;switch(t){case"Top":t="t";break;case"Bottom":t="b";break;case"Left":t="l";break;case"Right":t="r";break;case"Corner":t="tr";break;default:t="b"}return t},e.prototype.updatechartId=function(e){var t="";return""===t&&(t=this.addChartRelation(this.documentCharts,e)),t},e.prototype.addChartRelation=function(e,t){var i="";return i=this.getNextRelationShipID(),e.add(i,t),i},e.prototype.startsWith=function(e,t){return t.length>0&&e.substring(0,t.length)===t},e.prototype.serializeShapeDrawingGraphics=function(e,i){var n=i.autoShapeType;i.shapeId;this.serializeShapeWrapStyle(e,i),e.writeStartElement("wp","docPr",this.wpNamespace),e.writeAttributeString(void 0,"id",void 0,(this.mDocPrID++).toString()),e.writeAttributeString(void 0,"name",void 0,i.name),e.writeAttributeString(void 0,"title",void 0,i.title),e.writeEndElement(),e.writeStartElement("a","graphic",this.aNamespace),e.writeStartElement("a","graphicData",this.aNamespace),e.writeAttributeString(void 0,"uri",void 0,this.wpShapeNamespace),e.writeStartElement("wps","wsp",this.wpShapeNamespace),e.writeStartElement("wps","cNvCnPr",this.wpShapeNamespace),e.writeStartElement("a","cxnSpLocks",this.aNamespace),e.writeAttributeString(void 0,"noChangeShapeType",void 0,"1"),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("wps","spPr",this.wpShapeNamespace),e.writeAttributeString(void 0,"bwMode",void 0,"auto"),e.writeStartElement("a","xfrm",this.aNamespace),e.writeStartElement("a","off",this.aNamespace),e.writeAttributeString(void 0,"x",void 0,"0"),e.writeAttributeString(void 0,"y",void 0,"0"),e.writeEndElement(),e.writeStartElement("a","ext",this.aNamespace);var r=Math.round(i.width*this.emusPerPoint);e.writeAttributeString(void 0,"cx",void 0,r.toString());var o=Math.round(i.height*this.emusPerPoint);e.writeAttributeString(void 0,"cy",void 0,o.toString()),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("a","prstGeom",this.aNamespace),"StraightConnector"===n?e.writeAttributeString(void 0,"prst",void 0,"straightConnector1"):"RoundedRectangle"===n?e.writeAttributeString(void 0,"prst",void 0,"roundRect"):e.writeAttributeString(void 0,"prst",void 0,"rect"),e.writeStartElement("a","avLst",this.aNamespace),e.writeEndElement(),e.writeEndElement(),i.fillFormat&&i.fillFormat.color&&i.fillFormat.fill?(e.writeStartElement("a","solidFill",this.aNamespace),e.writeStartElement("a","srgbClr",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,this.getColor(i.fillFormat.color)),e.writeEndElement(),e.writeEndElement()):(e.writeStartElement("a","noFill",this.aNamespace),e.writeEndElement());var s=i.lineFormat.weight?i.lineFormat.weight*this.emusPerPoint:this.emusPerPoint;if(e.writeStartElement("a","ln",this.aNamespace),e.writeAttributeString(void 0,"w",void 0,s.toString()),!t.isNullOrUndefined(i.lineFormat.lineFormatType)&&"None"!==i.lineFormat.lineFormatType||i.lineFormat.line?(e.writeStartElement("a","solidFill",this.aNamespace),e.writeStartElement("a","srgbClr",this.aNamespace),e.writeAttributeString(void 0,"val",void 0,this.getColor(i.lineFormat.color)),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("a","round",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","headEnd",this.aNamespace),e.writeEndElement(),e.writeStartElement("a","tailEnd",this.aNamespace),e.writeEndElement()):(e.writeStartElement("a","noFill",this.aNamespace),e.writeEndElement()),e.writeEndElement(),e.writeEndElement(),"Rectangle"!==n&&"RoundedRectangle"!==n||(e.writeStartElement("wps","txbx",this.wpShapeNamespace),e.writeStartElement(void 0,"txbxContent",this.wNamespace),this.serializeBodyItems(e,i.textFrame.blocks,!0),e.writeEndElement(),e.writeEndElement()),e.writeStartElement("wps","bodyPr",this.wpShapeNamespace),!t.isNullOrUndefined(i.textFrame)){var a=void 0;i.textFrame.leftMargin>=0&&(a=Math.round(i.textFrame.leftMargin*this.emusPerPoint).toString(),e.writeAttributeString(void 0,"lIns",void 0,a)),i.textFrame.topMargin>=0&&(a=Math.round(i.textFrame.topMargin*this.emusPerPoint).toString(),e.writeAttributeString(void 0,"tIns",void 0,a)),i.textFrame.rightMargin>=0&&(a=Math.round(i.textFrame.rightMargin*this.emusPerPoint).toString(),e.writeAttributeString(void 0,"rIns",void 0,a)),i.textFrame.bottomMargin>=0&&(a=Math.round(i.textFrame.bottomMargin*this.emusPerPoint).toString(),e.writeAttributeString(void 0,"bIns",void 0,a)),e.writeAttributeString(void 0,"anchor",void 0,"t"),e.writeAttributeString(void 0,"anchorCtr",void 0,"0")}e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeShapeWrapStyle=function(e,t){if("Inline"!==t.textWrappingStyle){var i="wrapNone";if(t.textWrappingStyle&&"InFrontOfText"!==t.textWrappingStyle&&"Behind"!==t.textWrappingStyle&&(i="wrap"+t.textWrappingStyle,"Tight"===t.textWrappingStyle&&(i="wrapSquare")),e.writeStartElement("wp",i,this.wpNamespace),t.textWrappingStyle&&"InFrontOfText"!==t.textWrappingStyle&&"Behind"!==t.textWrappingStyle&&t.textWrappingType){var n="Both"===t.textWrappingType?"bothSides":t.textWrappingType.toLowerCase();e.writeAttributeString(void 0,"wrapText",void 0,n)}e.writeEndElement()}},e.prototype.serializeDrawingGraphics=function(e,i){var n="";if(i.isMetaFile&&!t.isNullOrUndefined(i.metaFileImageString)&&(i.imageString=i.metaFileImageString),n=this.updateShapeId(i),e.writeStartElement("wp","docPr",this.wpNamespace),e.writeAttributeString(void 0,"id",void 0,(this.mDocPrID++).toString()),t.isNullOrUndefined(i.alternativeText)||e.writeAttributeString(void 0,"descr",void 0,i.alternativeText),e.writeAttributeString(void 0,"name",void 0,t.isNullOrUndefined(i.name)?"":i.name),t.isNullOrUndefined(i.title)||e.writeAttributeString(void 0,"title",void 0,i.title),e.writeEndElement(),e.writeStartElement("a","graphic",this.aNamespace),e.writeStartElement("a","graphicData",this.aNamespace),e.writeAttributeString(void 0,"uri",void 0,this.pictureNamespace),e.writeStartElement("pic","pic",this.pictureNamespace),e.writeStartElement("pic","nvPicPr",this.pictureNamespace),e.writeStartElement("pic","cNvPr",this.pictureNamespace),e.writeAttributeString(void 0,"id",void 0,"0"),e.writeAttributeString(void 0,"name",void 0,""),e.writeAttributeString(void 0,"descr",void 0,""),e.writeEndElement(),e.writeStartElement("pic","cNvPicPr",this.pictureNamespace),e.writeStartElement("a","picLocks",this.aNamespace),e.writeAttributeString(void 0,"noChangeAspect",void 0,"1"),e.writeAttributeString(void 0,"noChangeArrowheads",void 0,"1"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("pic","blipFill",this.pictureNamespace),e.writeStartElement("a","blip",this.aNamespace),this.startsWith(i.imageString,"data:image")?e.writeAttributeString("r","embed",this.rNamespace,n):this.documentImages.containsKey(n)&&(this.documentImages.remove(n),this.externalImages.add(n,i.imageString),e.writeAttributeString(void 0,"link",this.rNamespace,n)),e.writeEndElement(),i.iscrop){e.writeStartElement("a","srcRect",this.aNamespace);var r=Math.round(1e3*i.left);e.writeAttributeString(void 0,"l",void 0,r.toString());var o=Math.round(1e3*i.top);e.writeAttributeString(void 0,"t",void 0,o.toString());var s=Math.round(1e3*i.right);e.writeAttributeString(void 0,"r",void 0,s.toString());var a=Math.round(1e3*i.bottom);e.writeAttributeString(void 0,"b",void 0,a.toString()),e.writeEndElement()}e.writeStartElement("a","stretch",this.aNamespace),e.writeStartElement("a","fillRect",this.aNamespace),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("pic","spPr",this.pictureNamespace),e.writeAttributeString(void 0,"bwMode",void 0,"auto"),e.writeStartElement("a","xfrm",this.aNamespace),e.writeStartElement("a","off",this.aNamespace),e.writeAttributeString(void 0,"x",void 0,"0"),e.writeAttributeString(void 0,"y",void 0,"0"),e.writeEndElement(),e.writeStartElement("a","ext",this.aNamespace);var l=Math.round(i.width*this.emusPerPoint);e.writeAttributeString(void 0,"cx",void 0,l.toString());var d=Math.round(i.height*this.emusPerPoint);e.writeAttributeString(void 0,"cy",void 0,d.toString()),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("a","prstGeom",this.aNamespace),e.writeAttributeString(void 0,"prst",void 0,"rect"),e.writeStartElement("a","avLst",this.aNamespace),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement(),e.writeEndElement()},e.prototype.updateShapeId=function(e){var t="",i=this.paragraph;return this.headerFooter?t=this.updateHFImageRels(this.headerFooter,e):""===t&&(i.hasOwnProperty("sectionFormat")||i.hasOwnProperty("inlines"))&&(t=this.addImageRelation(this.documentImages,e)),t},e.prototype.addImageRelation=function(e,t){var i="";return i=this.getNextRelationShipID(),e.add(i,t),i},e.prototype.updateHFImageRels=function(e,t){for(var i="",n="",r=this.headersFooters.keys,o=0;o<r.length;o++)for(var s=this.headersFooters.get(r[o]),a=s.keys,l=0;l<a.length;l++)if(s.get(a[l])===e){n=a[l];var d=void 0;this.headerFooterImages.containsKey(n)?(d=this.headerFooterImages.get(n),i=this.addImageRelation(d,t)):(d=new u,i=this.addImageRelation(d,t),this.headerFooterImages.add(n,d))}return i},e.prototype.serializeTable=function(e,t){if(!(t.rows.length<=0)){var i=this.table;this.table=t,e.writeStartElement(void 0,"tbl",this.wNamespace);var n=t.rows[0].rowFormat;this.serializeTableFormat(e,n,t),this.serializeTableGrid(e,t);var r=new u,o=new u,s=new u,a=t.rows;if(a.length>0)for(var l=0;l<a.length;l++){var d=a[l];if(d.cells.length>0){if(d.hasOwnProperty("contentControlProperties")){this.serializeContentControl(e,d.contentControlProperties,d);continue}var h=this.row;this.row=d,e.writeStartElement(void 0,"tr",this.wNamespace),this.serializeRowFormat(e,d);for(var c=d.cells,p=c.length,g=0,m=0;m<p;m++){var f=c[m],v=f.columnIndex;if(f.hasOwnProperty("contentControlProperties"))this.serializeContentControl(e,f.contentControlProperties,f);else{var y=f.cellFormat;if(v-g>0)for(var b=0===m?0:g+1;b<v;b++)if(r.containsKey(b)){var w=this.getMergeCellFormat(y,s.get(b),b<f.columnIndex);this.serializeTableCell(e,f,w,!1),r.set(b,r.get(b)-1),1===r.get(b)&&(r.remove(b),s.remove(b),o.containsKey(b)&&o.remove(b)),o.containsKey(b)&&(g+=o.get(b)-1,b+=o.get(b))}g=v,y.rowSpan>1&&(r.add(v,y.rowSpan),s.add(v,y)),this.serializeTableCell(e,f,y,!0),y.columnSpan>1&&y.rowSpan>1&&o.add(v,y.columnSpan);for(var C=v+1;;C++)if(r.containsKey(C)){var x=this.getMergeCellFormat(y,s.get(C),C<f.columnIndex);this.serializeTableCell(e,f,x,!1),r.set(C,r.get(C)-1),g++,1===r.get(C)&&(r.remove(C),s.remove(C),o.containsKey(C)&&o.remove(C)),o.containsKey(C)&&(g+=o.get(C)-1,C+=o.get(C))}else if(!(m===p-1&&C<t.columnCount))break}}e.writeEndElement(),this.row=h}}e.writeEndElement(),this.table=i}},e.prototype.getMergeCellFormat=function(e,t,i){var n=t;return i?n.borders.right=e.borders.left:n.borders.left=e.borders.right,n},e.prototype.serializeTableCell=function(e,t,i,n){var r=this.blockOwner;if(this.blockOwner=t,e.writeStartElement(void 0,"tc",this.wNamespace),e.writeStartElement(void 0,"tcPr",this.wNamespace),this.serializeCellWidth(e,i),this.serializeCellMargins(e,i),e.writeStartElement(void 0,"tcBorders",this.wNamespace),this.serializeBorders(e,i.borders,8),e.writeEndElement(),this.serializeShading(e,t.cellFormat.shading),this.serializeTableCellDirection(e,i),this.serializeCellVerticalAlign(e,i.verticalAlignment),i.columnSpan>1){var o=i.columnSpan;e.writeStartElement(void 0,"gridSpan",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,o.toString()),e.writeEndElement()}if(i.rowSpan>1&&(e.writeStartElement(void 0,"vMerge",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,n?"restart":"continue"),e.writeEndElement()),e.writeEndElement(),t&&t.blocks.length>0)for(var s=0,a=void 0;s<t.blocks.length;)a=t.blocks[s],this.serializeBodyItem(e,a,!1),s+=1;else e.writeStartElement(void 0,"p",this.wNamespace),e.writeStartElement(void 0,"pPr",this.wNamespace),e.writeStartElement(void 0,"pStyle",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,"Normal"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement();e.writeEndElement(),this.blockOwner=r},e.prototype.serializeTableGrid=function(e,t){e.writeStartElement(void 0,"tblGrid",this.wNamespace),0!==t.grid.length&&this.serializeGridColumns(e,t.grid),e.writeEndElement()},e.prototype.serializeTableRows=function(e,t){var i=new u;if(t.length>0)for(var n=0;n<t.length;n++){var r=t[n];if(r.cells.length>0){if(r.hasOwnProperty("contentControlProperties")){this.serializeContentControl(e,r.contentControlProperties,r);continue}this.serializeRow(e,r,i)}}},e.prototype.serializeRow=function(e,t,i){var n=this.row;this.row=t,e.writeStartElement(void 0,"tr",this.wNamespace),this.serializeRowFormat(e,t),this.serializeCells(e,t.cells,i),e.writeEndElement(),this.row=n},e.prototype.serializeRowFormat=function(e,i){if(this.serializeRowMargins(e,i.rowFormat),e.writeStartElement(void 0,"trPr",this.wNamespace),i.rowFormat.height>0){e.writeStartElement(void 0,"trHeight",this.wNamespace),"Exactly"===i.rowFormat.heightType?e.writeAttributeString("w","hRule",this.wNamespace,"exact"):"AtLeast"===i.rowFormat.heightType&&e.writeAttributeString("w","hRule",this.wNamespace,"atLeast");var n=this.roundToTwoDecimal(i.rowFormat.height*this.twentiethOfPoint).toString();e.writeAttributeString("w","val",this.wNamespace,n),e.writeEndElement()}var r=i.rowFormat,o=r.gridBefore;o>0&&(e.writeStartElement(void 0,"gridBefore",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,o.toString()),e.writeEndElement());var s=r.gridAfter;if(s>0&&(e.writeStartElement(void 0,"gridAfter",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,s.toString()),e.writeEndElement()),o>0){switch(e.writeStartElement(void 0,"wBefore",this.wNamespace),r.gridBeforeWidthType){case"Percent":a=this.roundToTwoDecimal(r.gridBeforeWidth*this.percentageFactor).toString();e.writeAttributeString("w","val",this.wNamespace,a),e.writeAttributeString("w","type",this.wNamespace,"pct");break;case"Point":l=this.roundToTwoDecimal(r.gridBeforeWidth*this.twipsInOnePoint).toString();e.writeAttributeString("w","val",this.wNamespace,l),e.writeAttributeString("w","type",this.wNamespace,"dxa")}e.writeEndElement()}if(s>0){switch(e.writeStartElement(void 0,"wAfter",this.wNamespace),r.gridAfterWidthType){case"Percent":var a=this.roundToTwoDecimal(r.gridAfterWidth*this.percentageFactor).toString();e.writeAttributeString("w","val",this.wNamespace,a),e.writeAttributeString("w","type",this.wNamespace,"pct");break;case"Point":var l=this.roundToTwoDecimal(r.gridAfterWidth*this.twipsInOnePoint).toString();e.writeAttributeString("w","val",this.wNamespace,l),e.writeAttributeString("w","type",this.wNamespace,"dxa")}e.writeEndElement()}r.allowBreakAcrossPages||(e.writeStartElement(void 0,"cantSplit",this.wNamespace),e.writeEndElement()),r.isHeader&&(e.writeStartElement(void 0,"tblHeader",this.wNamespace),e.writeEndElement()),!t.isNullOrUndefined(r.revisionIds)&&r.revisionIds.length>0&&(this.serializeRevisionStart(e,r,void 0),this.serializeRevisionEnd(e,r,void 0)),e.writeEndElement()},e.prototype.serializeCells=function(e,t,i){for(var n=0;n<t.length;n++)t[n].hasOwnProperty("contentControlProperties")?this.serializeContentControl(e,t[n].contentControlProperties,t[n]):this.serializeCell(e,t[n],i)},e.prototype.serializeCell=function(e,t,i){var n=this.blockOwner;if(this.blockOwner=t,e.writeStartElement(void 0,"tc",this.wNamespace),i=this.serializeCellFormat(e,t.cellFormat,!0,!0,i),t.blocks.length>0)for(var r=0,o=void 0;r<t.blocks.length;)o=t.blocks[r],this.serializeBodyItem(e,o,!1),r+=1;else e.writeStartElement(void 0,"p",this.wNamespace),e.writeStartElement(void 0,"pPr",this.wNamespace),e.writeStartElement(void 0,"pStyle",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,"Normal"),e.writeEndElement(),e.writeEndElement(),e.writeEndElement();e.writeEndElement();var s=1;if(i.containsKey(t.columnIndex+t.cellFormat.columnSpan-1+s)&&1===this.row.cells.length)for(var a=i.keys[i.keys.length-1];s<=a;)s=this.createCellForMerge(e,t,i,s),s++;else this.createCellForMerge(e,t,i,s);this.blockOwner=n},e.prototype.createCellForMerge=function(e,i,n,r){for(;n.containsKey(i.columnIndex+i.cellFormat.columnSpan-1+r)&&(this.row.cells.indexOf(i)===this.row.cells.length-1||this.row.cells.indexOf(i)===i.columnIndex)&&void 0===i.nextNode;){var o=i.columnIndex+i.cellFormat.columnSpan-1+r;e.writeStartElement(void 0,"tc",this.wNamespace);var s=!0;t.isNullOrUndefined(this.spanCellFormat)?(e.writeStartElement(void 0,"tcPr",this.wNamespace),s=!1):(s=!1,n=this.serializeCellFormat(e,this.spanCellFormat,!1,s,n)),this.serializeColumnSpan(o,e),e.writeStartElement(void 0,"vMerge",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,"continue"),e.writeEndElement(),t.isNullOrUndefined(this.spanCellFormat)&&(e.writeStartElement(void 0,"tcBorders",this.wNamespace),this.serializeBorders(e,i.cellFormat.borders,8),e.writeEndElement()),s||e.writeEndElement(),n=this.checkMergeCell(o,n),e.writeStartElement("w","p",this.wNamespace),e.writeEndElement(),e.writeEndElement(),r++}return r},e.prototype.serializeCellFormat=function(e,t,i,n,r){var o=this.blockOwner;this.table.tableFormat,this.row.rowFormat;return e.writeStartElement(void 0,"tcPr",this.wNamespace),this.serializeCellWidth(e,t),this.serializeCellMargins(e,t),i&&(r=this.serializeCellMerge(e,t,r),this.serializeGridSpan(e,o)),e.writeStartElement(void 0,"tcBorders",this.wNamespace),this.serializeBorders(e,t.borders,8),e.writeEndElement(),this.serializeShading(e,o.cellFormat.shading),this.serializeTableCellDirection(e,t),this.serializeCellVerticalAlign(e,t.verticalAlignment),n&&e.writeEndElement(),r},e.prototype.serializeCellWidth=function(e,t){e.writeStartElement(void 0,"tcW",this.wNamespace),"Percent"===t.preferredWidthType?(e.writeAttributeString(void 0,"type",this.wNamespace,"pct"),e.writeAttributeString(void 0,"w",this.wNamespace,this.roundToTwoDecimal(t.preferredWidth*this.percentageFactor).toString())):"Auto"===t.preferredWidthType?(e.writeAttributeString(void 0,"type",this.wNamespace,"auto"),e.writeAttributeString(void 0,"w",this.wNamespace,"0")):(e.writeAttributeString(void 0,"w",this.wNamespace,this.roundToTwoDecimal(t.preferredWidth*this.twipsInOnePoint).toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa")),e.writeEndElement()},e.prototype.serializeCellMerge=function(e,t,i){var n,r=this.blockOwner,o=!1,s=r.columnIndex,a=this.row.cells.indexOf(r),l=a>0?this.row.cells[a-1].columnIndex:r.columnIndex;if(r.columnIndex===a?(n=r.columnIndex,o=!0):o=!1,!o){0===a&&(s=r.columnIndex,l=-1);for(var d=l;d<s;d++)n=l+1,l+=1,0===n&&i.containsKey(n)&&(i=this.createMerge(e,n,r,i))}return t.rowSpan>1?(e.writeStartElement(void 0,"vMerge",this.wNamespace),this.spanCellFormat=t,i.add(n,t.rowSpan-1),t.columnSpan>1&&this.mGridSpans.add(n,t.columnSpan),e.writeAttributeString("w","val",this.wNamespace,"restart"),e.writeEndElement()):i.containsKey(n)&&o&&(i=this.createMerge(e,n,r,i)),i},e.prototype.createMerge=function(e,t,i,n){return this.serializeColumnSpan(t,e),e.writeStartElement(void 0,"vMerge",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,"continue"),e.writeEndElement(),e.writeStartElement(void 0,"tcBorders",this.wNamespace),this.serializeBorders(e,i.cellFormat.borders,8),e.writeEndElement(),e.writeEndElement(),e.writeStartElement("w","p",this.wNamespace),e.writeEndElement(),e.writeEndElement(),e.writeStartElement(void 0,"tc",this.wNamespace),e.writeStartElement(void 0,"tcPr",this.wNamespace),this.serializeCellWidth(e,i.cellFormat),n=this.checkMergeCell(t,n)},e.prototype.serializeColumnSpan=function(e,t){this.mGridSpans.keys.length>0&&this.mGridSpans.containsKey(e)&&(t.writeStartElement(void 0,"gridSpan",this.wNamespace),t.writeAttributeString("w","val",this.wNamespace,this.mGridSpans.get(e).toString()),t.writeEndElement())},e.prototype.checkMergeCell=function(e,t){return t.get(e)-1==0?(t.remove(e),this.spanCellFormat=void 0,this.mGridSpans.keys.length>0&&this.mGridSpans.containsKey(e)&&this.mGridSpans.remove(e)):t.set(e,t.get(e)-1),t},e.prototype.serializeGridSpan=function(e,t){if(t.cellFormat.columnSpan>1){var i=t.cellFormat.columnSpan;e.writeStartElement(void 0,"gridSpan",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,i.toString()),e.writeEndElement()}},e.prototype.serializeTableCellDirection=function(e,t){},e.prototype.serializeCellVerticalAlign=function(e,t){switch(e.writeStartElement(void 0,"vAlign",this.wNamespace),t){case"Center":e.writeAttributeString("w","val",this.wNamespace,"center");break;case"Bottom":e.writeAttributeString("w","val",this.wNamespace,"bottom");break;default:e.writeAttributeString("w","val",this.wNamespace,"top")}e.writeEndElement()},e.prototype.serializeGridColumns=function(e,t){for(var i=0,n=t.length;i<n;i++){var r=Math.round(20*t[i]);e.writeStartElement(void 0,"gridCol",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,r.toString()),e.writeEndElement()}},e.prototype.serializeTableFormat=function(e,i,n){e.writeStartElement(void 0,"tblPr",this.wNamespace),this.serializeTablePositioning(e,n),this.serializeTableWidth(e,n),this.serializeTableAlignment(e,n.tableFormat),this.serializeCellSpacing(e,n.tableFormat),this.serializeTableIndentation(e,n.tableFormat),this.serializeTableMargins(e,n.tableFormat),this.serializeTableBorders(e,n.tableFormat),this.serializeShading(e,n.tableFormat.shading),n.tableFormat.bidi&&(e.writeStartElement(void 0,"bidiVisual",this.wNamespace),e.writeEndElement()),this.serializeTblLayout(e,n.tableFormat),t.isNullOrUndefined(n)||e.writeEndElement()},e.prototype.serializeTablePositioning=function(e,i){if(i.wrapTextAround){if(e.writeStartElement("w","tblpPr",this.wNamespace),i.positioning.distanceLeft>0){var n=Math.round(i.positioning.distanceLeft*this.twipsInOnePoint).toString();e.writeAttributeString("w","leftFromText",this.wNamespace,n)}if(i.positioning.distanceRight>0){var r=Math.round(i.positioning.distanceRight*this.twipsInOnePoint).toString();e.writeAttributeString("w","rightFromText",this.wNamespace,r)}if(i.positioning.distanceTop>0){var o=Math.round(i.positioning.distanceTop*this.twipsInOnePoint).toString();e.writeAttributeString("w","topFromText",this.wNamespace,o)}if(i.positioning.distanceBottom>0){var s=Math.round(i.positioning.distanceBottom*this.twipsInOnePoint).toString();e.writeAttributeString("w","bottomFromText",this.wNamespace,s)}if(i.positioning.verticalOrigin){var a="Paragraph"===i.positioning.verticalOrigin?"text":i.positioning.verticalOrigin.toLowerCase();e.writeAttributeString("w","vertAnchor",this.wNamespace,a)}if(i.positioning.horizontalOrigin&&"Column"!==i.positioning.horizontalOrigin&&e.writeAttributeString("w","horzAnchor",this.wNamespace,i.positioning.horizontalOrigin.toLowerCase()),i.positioning.horizontalAlignment&&"Left"!==i.positioning.horizontalAlignment){var l=i.positioning.horizontalAlignment.toLowerCase();e.writeAttributeString("w","tblpXSpec",this.wNamespace,l)}if(i.positioning.verticalAlignment){var d=i.positioning.verticalAlignment.toLowerCase();e.writeAttributeString("w","tblpYSpec",this.wNamespace,d)}if((!t.isNullOrUndefined(i.positioning.horizontalAlignment)&&"Left"===i.positioning.horizontalAlignment||!i.positioning.horizontalAlignment)&&i.positioning.horizontalPosition>0){var h=Math.round(i.positioning.horizontalPosition*this.twipsInOnePoint).toString();e.writeAttributeString("w","tblpX",this.wNamespace,h)}if(!i.positioning.verticalAlignment&&i.positioning.verticalPosition>0){var c=Math.round(i.positioning.verticalPosition*this.twipsInOnePoint).toString();e.writeAttributeString("w","tblpY",this.wNamespace,c)}e.writeEndElement(),i.positioning.allowOverlap||(e.writeStartElement("w","tblOverlap",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,"never"),e.writeEndElement())}},e.prototype.serializeTableMargins=function(e,t){this.serializeMargins(e,t,"tblCellMar")},e.prototype.serializeRowMargins=function(e,t){e.writeStartElement(void 0,"tblPrEx",this.wNamespace),this.serializeMargins(e,t,"tblCellMar"),e.writeEndElement()},e.prototype.serializeCellMargins=function(e,t){this.serializeMargins(e,t,"tcMar")},e.prototype.serializeMargins=function(e,i,n){if(e.writeStartElement(void 0,n,this.wNamespace),!t.isNullOrUndefined(i.topMargin)){var r=Math.round(20*i.topMargin);e.writeStartElement(void 0,"top",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,r.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement()}if(!t.isNullOrUndefined(i.leftMargin)){var o=Math.round(20*i.leftMargin);e.writeStartElement(void 0,"left",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,o.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement()}if(!t.isNullOrUndefined(i.bottomMargin)){var s=Math.round(20*i.bottomMargin);e.writeStartElement(void 0,"bottom",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,s.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement()}if(!t.isNullOrUndefined(i.rightMargin)){var a=Math.round(20*i.rightMargin);e.writeStartElement(void 0,"right",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,a.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement()}e.writeEndElement()},e.prototype.serializeShading=function(e,i){e.writeStartElement(void 0,"shd",this.wNamespace),i.backgroundColor&&"empty"!==i.backgroundColor?e.writeAttributeString(void 0,"fill",this.wNamespace,this.getColor(i.backgroundColor)):e.writeAttributeString(void 0,"fill",this.wNamespace,"auto"),"empty"===i.foregroundColor||t.isNullOrUndefined(i.foregroundColor)?e.writeAttributeString(void 0,"color",this.wNamespace,"auto"):e.writeAttributeString(void 0,"color",this.wNamespace,this.getColor(i.foregroundColor)),t.isNullOrUndefined(i.textureStyle)||e.writeAttributeString("w","val",this.wNamespace,this.getTextureStyle(i.textureStyle)),e.writeEndElement()},e.prototype.getTextureStyle=function(e){switch(e){case"Texture5Percent":case"Texture2Pt5Percent":case"Texture7Pt5Percent":return"pct5";case"Texture10Percent":return"pct10";case"Texture12Pt5Percent":return"pct12";case"Texture15Percent":case"Texture17Pt5Percent":return"pct15";case"Texture20Percent":case"Texture22Pt5Percent":return"pct20";case"Texture25Percent":case"Texture27Pt5Percent":return"pct25";case"Texture30Percent":case"Texture32Pt5Percent":return"pct30";case"Texture35Percent":return"pct35";case"Texture37Pt5Percent":return"pct37";case"Texture40Percent":case"Texture42Pt5Percent":return"pct40";case"Texture45Percent":case"Texture47Pt5Percent":return"pct45";case"Texture50Percent":case"Texture52Pt5Percent":return"pct50";case"Texture55Percent":case"Texture57Pt5Percent":return"pct55";case"Texture60Percent":return"pct60";case"Texture62Pt5Percent":return"pct62";case"Texture65Percent":case"Texture67Pt5Percent":return"pct65";case"Texture70Percent":case"Texture72Pt5Percent":return"pct70";case"Texture75Percent":case"Texture77Pt5Percent":return"pct75";case"Texture80Percent":case"Texture82Pt5Percent":return"pct80";case"Texture85Percent":return"pct85";case"Texture87Pt5Percent":return"pct87";case"Texture90Percent":case"Texture92Pt5Percent":return"pct90";case"Texture95Percent":case"Texture97Pt5Percent":return"pct95";case"TextureCross":return"thinHorzCross";case"TextureDarkCross":return"horzCross";case"TextureDarkDiagonalCross":return"diagCross";case"TextureDarkDiagonalDown":return"reverseDiagStripe";case"TextureDarkDiagonalUp":return"diagStripe";case"TextureDarkHorizontal":return"horzStripe";case"TextureDarkVertical":return"vertStripe";case"TextureDiagonalCross":return"thinDiagCross";case"TextureDiagonalDown":return"thinReverseDiagStripe";case"TextureDiagonalUp":return"thinDiagStripe";case"TextureHorizontal":return"thinHorzStripe";case"TextureSolid":return"solid";case"TextureVertical":return"thinVertStripe";default:return"clear"}},e.prototype.serializeTableBorders=function(e,t){t.borders;e.writeStartElement(void 0,"tblBorders",this.wNamespace),this.serializeBorders(e,t.borders,8),e.writeEndElement()},e.prototype.serializeBorders=function(e,t,i){this.serializeBorder(e,t.top,"top",i),this.serializeBorder(e,t.left,"left",i),this.serializeBorder(e,t.bottom,"bottom",i),this.serializeBorder(e,t.right,"right",i),this.serializeBorder(e,t.horizontal,"insideH",i),this.serializeBorder(e,t.vertical,"insideV",i),this.serializeBorder(e,t.diagonalDown,"tl2br",i),this.serializeBorder(e,t.diagonalUp,"tr2bl",i)},e.prototype.serializeTblLayout=function(e,t){t.allowAutoFit||(e.writeStartElement(void 0,"tblLayout",this.wNamespace),e.writeAttributeString(void 0,"type",this.wNamespace,"fixed"),e.writeEndElement())},e.prototype.serializeBorder=function(e,i,n,r){var o=i.lineStyle,s=(i.lineWidth?i.lineWidth:0)*r,a=i.space?i.space:0;if("Cleared"===o)return e.writeStartElement(void 0,n,this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,"nil"),void e.writeEndElement();("None"===o||t.isNullOrUndefined(o))&&!i.hasNoneStyle||s<=0||(e.writeStartElement(void 0,n,this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.getBorderStyle(o)),i.color&&e.writeAttributeString(void 0,"color",this.wNamespace,this.getColor(i.color)),e.writeAttributeString(void 0,"sz",this.wNamespace,this.roundToTwoDecimal(s).toString()),e.writeAttributeString(void 0,"space",this.wNamespace,a.toString()),i.shadow&&e.writeAttributeString(void 0,"shadow",this.wNamespace,"on"),e.writeEndElement())},e.prototype.getBorderStyle=function(e){switch(e){case"Cleared":return"cleared";case"DashSmallGap":return"dashSmallGap";case"Triple":return"triple";case"Dot":return"dotted";case"DashDot":return"dotDash";case"DashLargeGap":return"dashed";case"DashDotDot":return"dotDotDash";case"Double":return"double";case"ThinThickSmallGap":return"thinThickSmallGap";case"ThickThinSmallGap":return"thickThinSmallGap";case"ThinThickThinSmallGap":return"thinThickThinSmallGap";case"ThickThinMediumGap":return"thickThinMediumGap";case"ThinThickMediumGap":return"thinThickMediumGap";case"ThinThickThinMediumGap":return"thinThickThinMediumGap";case"ThickThinLargeGap":return"thickThinLargeGap";case"ThinThickLargeGap":return"thinThickLargeGap";case"ThinThickThinLargeGap":return"thinThickThinLargeGap";case"Thick":return"thick";case"SingleWavy":return"wave";case"DoubleWavy":return"doubleWave";case"DashDotStroked":return"dashDotStroked";case"Engrave3D":return"threeDEngrave";case"Emboss3D":return"threeDEmboss";case"Outset":return"outset";case"Inset":return"inset";default:return"single"}},e.prototype.serializeTableIndentation=function(e,i){if(!t.isNullOrUndefined(i.leftIndent)){e.writeStartElement(void 0,"tblInd",this.wNamespace);var n=Math.round(i.leftIndent*this.twipsInOnePoint);e.writeAttributeString(void 0,"w",this.wNamespace,n.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement()}},e.prototype.serializeCellSpacing=function(e,i){!t.isNullOrUndefined(i.cellSpacing)&&i.cellSpacing>0&&(e.writeStartElement(void 0,"tblCellSpacing",this.wNamespace),e.writeAttributeString(void 0,"w",this.wNamespace,this.roundToTwoDecimal(i.cellSpacing/2*this.twentiethOfPoint).toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa"),e.writeEndElement())},e.prototype.serializeTableWidth=function(e,t){if(e.writeStartElement(void 0,"tblW",this.wNamespace),"Percent"===t.tableFormat.preferredWidthType)e.writeAttributeString(void 0,"w",this.wNamespace,(t.tableFormat.preferredWidth*this.percentageFactor).toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"pct");else if("Point"===t.tableFormat.preferredWidthType){var i=Math.round(t.tableFormat.preferredWidth*this.twipsInOnePoint);e.writeAttributeString(void 0,"w",this.wNamespace,i.toString()),e.writeAttributeString(void 0,"type",this.wNamespace,"dxa")}else e.writeAttributeString(void 0,"w",this.wNamespace,"0"),e.writeAttributeString(void 0,"type",this.wNamespace,"auto");e.writeEndElement()},e.prototype.serializeTableAlignment=function(e,t){switch(e.writeStartElement(void 0,"jc",this.wNamespace),t.tableAlignment){case"Right":e.writeAttributeString("w","val",this.wNamespace,"right");break;case"Center":e.writeAttributeString("w","val",this.wNamespace,"center");break;default:e.writeAttributeString("w","val",this.wNamespace,"left")}e.writeEndElement()},e.prototype.serializeFieldCharacter=function(e,i){e.writeStartElement(void 0,"r",this.wNamespace),this.serializeCharacterFormat(e,i.characterFormat),e.writeStartElement(void 0,"fldChar",this.wNamespace);var n=0===i.fieldType?"begin":1===i.fieldType?"end":"separate";if(e.writeAttributeString(void 0,"fldCharType",this.wNamespace,n),"begin"===n&&!t.isNullOrUndefined(i.formFieldData)){var r=i.formFieldData;if(e.writeStartElement(void 0,"ffData",this.wNamespace),e.writeStartElement(void 0,"name",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,r.name),e.writeEndElement(),e.writeStartElement(void 0,"enabled",this.wNamespace),e.writeEndElement(),r.hasOwnProperty("textInput")){e.writeStartElement(void 0,"textInput",this.wNamespace);r.textInput.type;e.writeStartElement(void 0,"type",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,r.textInput.type.toString().toLowerCase()),e.writeEndElement(),e.writeStartElement(void 0,"defalut",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,r.textInput.defaultValue),e.writeEndElement(),e.writeStartElement(void 0,"format",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,r.textInput.format),e.writeEndElement(),e.writeEndElement()}else if(r.hasOwnProperty("checkBox"))e.writeStartElement(void 0,"checkBox",this.wNamespace),"Auto"===r.checkBox.sizeType?(e.writeStartElement(void 0,"sizeAuto",this.wNamespace),e.writeEndElement()):(e.writeStartElement(void 0,"size",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.roundToTwoDecimal(2*r.checkBox.size).toString()),e.writeEndElement()),e.writeStartElement(void 0,"defalut",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,r.checkBox.defaultValue?"1":"0"),e.writeEndElement(),r.checkBox.checked&&(e.writeStartElement(void 0,"checked",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,r.checkBox.checked?"1":"0"),e.writeEndElement()),e.writeEndElement();else{e.writeStartElement(void 0,"ddList",this.wNamespace),0!==r.dropDownList.selectedIndex&&(e.writeStartElement(void 0,"result",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,r.dropDownList.selectedIndex.toString()),e.writeEndElement());for(var o=0;o<r.dropDownList.dropDownItems.length;o++)e.writeStartElement(void 0,"listEntry",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,r.dropDownList.dropDownItems[o].toString()),e.writeEndElement();e.writeEndElement()}e.writeEndElement()}e.writeEndElement(),e.writeEndElement(),0===i.fieldType&&"FieldFormTextInput"===i.fieldCodeType&&(e.writeStartElement("w","r",this.wNamespace),e.writeStartElement(void 0,"instrText",this.wNamespace),e.writeAttributeString("xml","space",this.xmlNamespace,"preserve"),e.writeString("FORMTEXT"),e.writeEndElement(),e.writeEndElement())},e.prototype.serializeTextRange=function(e,i,n,r){if(e.writeStartElement("w","r",this.wNamespace),t.isNullOrUndefined(i.characterFormat)||this.serializeCharacterFormat(e,i.characterFormat),"\t"===i.text)e.writeElementString(void 0,"tab",this.wNamespace,void 0);else if("\v"===i.text)e.writeElementString(void 0,"br",this.wNamespace,void 0);else if("\f"===i.text)e.writeStartElement(void 0,"br",this.wNamespace),e.writeAttributeString("w","type",this.wNamespace,"page"),e.writeEndElement();else if("%02"===encodeURI(i.text))e.writeStartElement(void 0,"footnoteRef",this.wNamespace),e.writeEndElement();else if("%02"===encodeURI(i.text)&&"endnote"===r)e.writeStartElement(void 0,"endnoteRef",this.wNamespace),e.writeEndElement();else if("%03"===encodeURI(i.text))e.writeStartElement(void 0,"separator",this.wNamespace),e.writeEndElement();else if("%04"===encodeURI(i.text))e.writeStartElement(void 0,"continuationSeparator",this.wNamespace),e.writeEndElement();else{var o=this.retrieveDeleteRevision(i),s=!t.isNullOrUndefined(n)&&n.hasOwnProperty("fieldType")&&2!==n.fieldType?o?"delInstrText":"instrText":o?"delText":"t";e.writeStartElement(void 0,s,this.wNamespace),e.writeAttributeString("xml","space",this.xmlNamespace,"preserve"),e.writeString(i.text),e.writeEndElement()}e.writeEndElement()},e.prototype.retrieveDeleteRevision=function(e){if(e.hasOwnProperty("revisionIds")&&e.revisionIds.length>0)for(var t=0;t<e.revisionIds.length;t++)if("Deletion"===this.retrieveRevision(e.revisionIds[t]).revisionType)return!0;return!1},e.prototype.serializeParagraphFormat=function(e,i,n){t.isNullOrUndefined(i)||(t.isNullOrUndefined(i.styleName)||(e.writeStartElement(void 0,"pStyle",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,i.styleName),e.writeEndElement()),t.isNullOrUndefined(n)?this.serializeListFormat(e,i.listFormat):this.serializeListFormat(e,n.paragraphFormat.listFormat),i.bidi&&(e.writeStartElement(void 0,"bidi",this.wNamespace),e.writeEndElement()),t.isNullOrUndefined(i.outlineLevel)||(e.writeStartElement(void 0,"outlineLvl",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.getOutlineLevelValue(i.outlineLevel).toString()),e.writeEndElement()),this.serializeParagraphSpacing(e,i),t.isNullOrUndefined(i.contextualSpacing)||(e.writeStartElement("w","contextualSpacing",this.wNamespace),i.contextualSpacing||e.writeAttributeString("w","val",this.wNamespace,"0"),e.writeEndElement()),this.serializeIndentation(e,i),this.serializeParagraphAlignment(e,i.textAlignment,i.bidi),!t.isNullOrUndefined(i.tabs)&&i.tabs.length>0&&this.serializeTabs(e,i.tabs))},e.prototype.getOutlineLevelValue=function(e){if(-1!==e.indexOf("Level")){var t=parseInt(e.substring(5),10);if(t>0)return t-1}return 9},e.prototype.serializeTabs=function(e,t){e.writeStartElement("w","tabs",this.wNamespace);for(var i=0;i<t.length;i++)this.serializeTab(e,t[i]);e.writeEndElement()},e.prototype.serializeTab=function(e,i){var n=0;e.writeStartElement("w","tab",this.wNamespace),0===i.position&&0!==i.deletePosition?(n=i.deletePosition*this.twentiethOfPoint,e.writeAttributeString("w","val",this.wNamespace,"clear")):(n=i.position*this.twentiethOfPoint,e.writeAttributeString("w","val",this.wNamespace,this.getTabJustification(i.tabJustification))),t.isNullOrUndefined(i.tabLeader)||"None"===i.tabLeader||e.writeAttributeString("w","leader",this.wNamespace,this.getTabLeader(i.tabLeader)),isNaN(n)||e.writeAttributeString("w","pos",this.wNamespace,n.toString()+""),e.writeEndElement()},e.prototype.getTabLeader=function(e){switch(e){case"Dot":return"dot";case"Hyphen":return"hyphen";case"Underscore":return"underscore";default:return"none"}},e.prototype.getTabJustification=function(e){switch(e){case"Bar":return"bar";case"Center":return"center";case"Decimal":return"decimal";case"Left":return"left";case"List":return"num";case"Right":return"right";default:return"clear"}},e.prototype.serializeListFormat=function(e,i){if(!t.isNullOrUndefined(i.listId)||!t.isNullOrUndefined(i.listLevelNumber)){if(e.writeStartElement(void 0,"numPr",this.wNamespace),t.isNullOrUndefined(i.listLevelNumber)||-1===i.listLevelNumber||(e.writeStartElement(void 0,"ilvl",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,i.listLevelNumber.toString()),e.writeEndElement()),!t.isNullOrUndefined(i.listId)){e.writeStartElement(void 0,"numId",this.wNamespace);var n=(i.listId+1).toString();-1===i.listId&&(n=""),e.writeAttributeString("w","val",this.wNamespace,n),e.writeEndElement()}e.writeEndElement()}},e.prototype.serializeParagraphAlignment=function(e,i,n){if(n&&("Right"===i?i="Left":"Left"===i&&(i="Right")),!t.isNullOrUndefined(i)){e.writeStartElement(void 0,"jc",this.wNamespace);var r=void 0;switch(i){case"Center":r="center";break;case"Right":r="right";break;case"Justify":r="both";break;default:r="left"}e.writeAttributeString("w","val",this.wNamespace,r),e.writeEndElement()}},e.prototype.serializeParagraphSpacing=function(e,i){if(e.writeStartElement(void 0,"spacing",this.wNamespace),t.isNullOrUndefined(i.beforeSpacing)||e.writeAttributeString(void 0,"before",this.wNamespace,this.roundToTwoDecimal(i.beforeSpacing*this.twentiethOfPoint).toString()),t.isNullOrUndefined(i.afterSpacing)||e.writeAttributeString(void 0,"after",this.wNamespace,this.roundToTwoDecimal(i.afterSpacing*this.twentiethOfPoint).toString()),!t.isNullOrUndefined(i.lineSpacing)){var n="AtLeast"===i.lineSpacingType||"Exactly"===i.lineSpacingType?this.roundToTwoDecimal(i.lineSpacing*this.twentiethOfPoint):this.roundToTwoDecimal(240*i.lineSpacing);e.writeAttributeString(void 0,"line",this.wNamespace,n.toString())}if(!t.isNullOrUndefined(i.lineSpacingType)){var r="auto";"AtLeast"===i.lineSpacingType?r="atLeast":"Exactly"===i.lineSpacingType&&(r="exact"),e.writeAttributeString(void 0,"lineRule",this.wNamespace,r)}e.writeEndElement()},e.prototype.serializeIndentation=function(e,i){e.writeStartElement(void 0,"ind",this.wNamespace),t.isNullOrUndefined(i.leftIndent)||e.writeAttributeString(void 0,"left",this.wNamespace,this.roundToTwoDecimal(i.leftIndent*this.twipsInOnePoint).toString()),t.isNullOrUndefined(i.rightIndent)||e.writeAttributeString(void 0,"right",this.wNamespace,this.roundToTwoDecimal(i.rightIndent*this.twipsInOnePoint).toString()),t.isNullOrUndefined(i.firstLineIndent)||(i.firstLineIndent<0?e.writeAttributeString(void 0,"hanging",this.wNamespace,this.roundToTwoDecimal(-1*i.firstLineIndent*this.twipsInOnePoint).toString()):e.writeAttributeString(void 0,"firstLine",this.wNamespace,this.roundToTwoDecimal(i.firstLineIndent*this.twipsInOnePoint).toString())),e.writeEndElement()},e.prototype.serializeCustomXMLMapping=function(e,t){if(e.length>0)for(var i=e.keys,n=0;n<i.length;n++){var r=new p.XmlWriter;r.writeStartElement(void 0,"Relationships",this.rpNamespace);var o=this.mCustomXML.get(i[n]),s=i[n],a=this.getNextRelationShipID(),l=n+1,d=this.createXMLItem(o,a,l),h=this.createXMLItemProps(s,l);this.serializeRelationShip(t,a,this.customXmlRelType,"../"+d),this.customXMLRelation(r,l,h),r.writeEndElement();var g=new c.ZipArchiveItem(r.buffer,this.customXMLRelPath+l+".xml.rels");this.mArchive.addItem(g)}},e.prototype.customXMLRelation=function(e,t,i){this.serializeRelationShip(e,"rId1",this.wordMLCustomXmlPropsRelType,i)},e.prototype.createXMLItem=function(e,t,i){var n=new Blob([e],{type:"text/plain"}),r=this.customXMLItemsPath+i+".xml",o=new c.ZipArchiveItem(n,r);return this.mArchive.addItem(o),r},e.prototype.createXMLItemProps=function(e,t){var i=new p.XmlWriter,n=this.customXMLItemsPropspath+t+".xml",r=this.itemPropsPath+t+".xml";i.writeStartElement("ds","datastoreItem",this.wNamespace),i.writeAttributeString("ds","itemID",void 0,e),i.writeAttributeString("xmlns","ds",void 0,this.dsNamespace),i.writeEndElement(),this.customXMLProps.push(n);var o=new c.ZipArchiveItem(i.buffer,n);return this.mArchive.addItem(o),r},e.prototype.serializeStyles=function(){var e=new p.XmlWriter;e.writeStartElement("w","styles",this.wNamespace),e.writeAttributeString("xmlns","mc",void 0,this.veNamespace),e.writeAttributeString("xmlns","r",void 0,this.rNamespace),e.writeAttributeString("xmlns","w",void 0,this.wNamespace),e.writeAttributeString("xmlns","w14",void 0,this.w14Namespace),e.writeAttributeString("xmlns","w15",void 0,this.w15Namespace),e.writeAttributeString("mc","Ignorable",void 0,"w14 w15"),this.serializeDefaultStyles(e),this.serializeDocumentStyles(e),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,this.stylePath);this.mArchive.addItem(t)},e.prototype.serializeDefaultStyles=function(e){e.writeStartElement(void 0,"docDefaults",this.wNamespace),e.writeStartElement(void 0,"rPrDefault",this.wNamespace),this.serializeCharacterFormat(e,this.defCharacterFormat),e.writeEndElement(),e.writeStartElement(void 0,"pPrDefault",this.wNamespace),t.isNullOrUndefined(this.defParagraphFormat)||(e.writeStartElement(void 0,"pPr",this.wNamespace),this.serializeParagraphFormat(e,this.defParagraphFormat,void 0),e.writeEndElement()),e.writeEndElement(),e.writeEndElement()},e.prototype.serializeDocumentStyles=function(e){for(var i=0;i<this.mStyles.length;i++){var n=this.mStyles[i];e.writeStartElement(void 0,"style",this.wNamespace);var r="Paragraph"===n.type?"paragraph":"character";e.writeAttributeString("w","type",this.wNamespace,r),e.writeAttributeString("w","styleId",this.wNamespace,n.name),e.writeStartElement(void 0,"name",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,n.name),e.writeEndElement(),t.isNullOrUndefined(n.basedOn)||(e.writeStartElement(void 0,"basedOn",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,n.basedOn),e.writeEndElement()),t.isNullOrUndefined(n.next)||(e.writeStartElement(void 0,"next",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,n.next),e.writeEndElement()),t.isNullOrUndefined(n.link)||(e.writeStartElement(void 0,"link",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,n.link),e.writeEndElement()),"Paragraph"===n.type&&(e.writeStartElement(void 0,"pPr",this.wNamespace),this.serializeParagraphFormat(e,n.paragraphFormat,void 0),e.writeEndElement()),this.serializeCharacterFormat(e,n.characterFormat),e.writeEndElement()}},e.prototype.serializeCharacterFormat=function(e,i){if(e.writeStartElement(void 0,"rPr",this.wNamespace),t.isNullOrUndefined(i.styleName)||(e.writeStartElement(void 0,"rStyle",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,i.styleName),e.writeEndElement()),t.isNullOrUndefined(i.fontFamily)||(e.writeStartElement(void 0,"rFonts",this.wNamespace),e.writeAttributeString(void 0,"ascii",this.wNamespace,i.fontFamily),e.writeAttributeString(void 0,"hAnsi",this.wNamespace,i.fontFamily),e.writeAttributeString(void 0,"eastAsia",this.wNamespace,i.fontFamily),e.writeAttributeString(void 0,"cs",this.wNamespace,i.fontFamilyBidi),e.writeEndElement()),t.isNullOrUndefined(i.bold)||this.serializeBoolProperty(e,"b",i.bold),i.boldBidi&&this.serializeBoolProperty(e,"bCs",i.boldBidi),t.isNullOrUndefined(i.italic)||this.serializeBoolProperty(e,"i",i.italic),t.isNullOrUndefined(i.italicBidi)||this.serializeBoolProperty(e,"iCs",i.italicBidi),i.bidi&&(e.writeStartElement(void 0,"rtl",this.wNamespace),e.writeEndElement()),i.allCaps&&this.serializeBoolProperty(e,"caps",i.allCaps),!t.isNullOrUndefined(i.strikethrough))switch(i.strikethrough){case"SingleStrike":this.serializeBoolProperty(e,"strike",!0);break;case"DoubleStrike":this.serializeBoolProperty(e,"dstrike",!0);break;default:this.serializeBoolProperty(e,"strike",!1),this.serializeBoolProperty(e,"dstrike",!1)}if(t.isNullOrUndefined(i.fontColor)||(e.writeStartElement(void 0,"color",this.wNamespace),"empty"===i.fontColor?e.writeAttributeString("w","val",this.wNamespace,"auto"):e.writeAttributeString("w","val",this.wNamespace,this.getColor(i.fontColor)),e.writeEndElement()),t.isNullOrUndefined(i.fontSize)||(e.writeStartElement(void 0,"sz",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.roundToTwoDecimal(2*i.fontSize).toString()),e.writeEndElement()),t.isNullOrUndefined(i.fontSizeBidi)||(e.writeStartElement(void 0,"szCs",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.roundToTwoDecimal(2*i.fontSizeBidi).toString()),e.writeEndElement()),t.isNullOrUndefined(i.highlightColor)||"NoColor"===i.highlightColor||(e.writeStartElement(void 0,"highlight",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.getHighlightColor(i.highlightColor)),e.writeEndElement()),!t.isNullOrUndefined(i.revisionIds)&&i.revisionIds.length>0&&(this.serializeRevisionStart(e,i,void 0),this.serializeRevisionEnd(e,i,void 0)),t.isNullOrUndefined(i.underline)||"None"===i.underline||(e.writeStartElement(void 0,"u",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,this.getUnderlineStyle(i.underline)),e.writeEndElement()),!t.isNullOrUndefined(i.baselineAlignment)){switch(e.writeStartElement(void 0,"vertAlign",this.wNamespace),i.baselineAlignment){case"Subscript":e.writeAttributeString("w","val",this.wNamespace,"subscript");break;case"Superscript":e.writeAttributeString("w","val",this.wNamespace,"superscript");break;default:e.writeAttributeString("w","val",this.wNamespace,"baseline")}e.writeEndElement()}e.writeEndElement()},e.prototype.getColor=function(e){return e.length>0&&("#"===e[0]&&(e=e.substr(1)),e.length>6&&(e=e.substr(0,6))),e},e.prototype.getUnderlineStyle=function(e){switch(e){case"DotDotDashHeavy":return"dashDotDotHeavy";case"DotDashHeavy":return"dashDotHeavy";case"DashHeavy":return"dashedHeavy";case"DashLong":return"dashLong";case"DashLongHeavy":return"dashLongHeavy";case"DotDash":return"dotDash";case"DotDotDash":return"dotDotDash";case"Dotted":return"dotted";case"DottedHeavy":return"dottedHeavy";case"Double":return"double";case"Single":return"single";case"Thick":return"thick";case"Wavy":return"wave";case"WavyDouble":return"wavyDouble";case"WavyHeavy":return"wavyHeavy";case"Words":return"words";default:return"dash"}},e.prototype.getHighlightColor=function(e){switch(e){case"BrightGreen":return"green";case"Turquoise":return"cyan";case"Pink":return"magenta";case"Blue":return"blue";case"Red":return"red";case"DarkBlue":return"darkBlue";case"Teal":return"darkCyan";case"Green":return"darkGreen";case"Violet":return"darkMagenta";case"DarkRed":return"darkRed";case"DarkYellow":return"darkYellow";case"Gray50":return"darkGray";case"Gray25":return"lightGray";case"Black":return"black";default:return"yellow"}},e.prototype.serializeBoolProperty=function(e,t,i){e.writeStartElement(void 0,t,this.wNamespace),i||e.writeAttributeString(void 0,"val",this.wNamespace,"0"),e.writeEndElement()},e.prototype.serializeNumberings=function(){if(0!==this.document.lists.length){var e=new p.XmlWriter;e.writeStartElement("w","numbering",this.wNamespace),this.writeCommonAttributeStrings(e),this.serializeAbstractListStyles(e,this.document.abstractLists),this.serializeListInstances(e,this.document.lists),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,this.numberingPath);this.mArchive.addItem(t)}},e.prototype.serializeAbstractListStyles=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];e.writeStartElement(void 0,"abstractNum",this.wNamespace),e.writeAttributeString(void 0,"abstractNumId",this.wNamespace,n.abstractListId.toString()),e.writeStartElement(void 0,"nsid",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.generateHex()),e.writeEndElement();for(var r=0,o=n.levels.length;r<o;r++)this.serializeListLevel(e,n.levels[r],r);e.writeEndElement()}},e.prototype.serializeListInstances=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];e.writeStartElement(void 0,"num",this.wNamespace),e.writeAttributeString(void 0,"numId",this.wNamespace,(n.listId+1).toString()),e.writeStartElement(void 0,"abstractNumId",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,n.abstractListId.toString()),e.writeEndElement(),e.writeEndElement()}},e.prototype.generateHex=function(){return(Math.floor(373e7*Math.random())+27e7).toString(16).toUpperCase()},e.prototype.roundToTwoDecimal=function(e){return Math.round(e)},e.prototype.serializeListLevel=function(e,t,i){e.writeStartElement(void 0,"lvl",this.wNamespace),e.writeAttributeString(void 0,"ilvl",this.wNamespace,i.toString()),e.writeStartElement(void 0,"start",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t.startAt.toString()),e.writeEndElement(),e.writeStartElement(void 0,"numFmt",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,this.getLevelPattern(t.listLevelPattern)),e.writeEndElement(),this.serializeLevelFollow(e,t),this.serializeLevelText(e,t,i+1),e.writeStartElement(void 0,"pPr",this.wNamespace),this.serializeParagraphFormat(e,t.paragraphFormat,void 0),e.writeEndElement(),this.serializeCharacterFormat(e,t.characterFormat),e.writeEndElement()},e.prototype.getLevelPattern=function(e){var t;switch(e){case"Arabic":t="decimal";break;case"UpRoman":t="upperRoman";break;case"LowRoman":t="lowerRoman";break;case"UpLetter":t="upperLetter";break;case"LowLetter":t="lowerLetter";break;default:t="bullet"}return t},e.prototype.serializeLevelText=function(e,t,i){e.writeStartElement(void 0,"lvlText",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,t.numberFormat),e.writeEndElement()},e.prototype.serializeLevelFollow=function(e,t){var i;i="Tab"===t.followCharacter?"tab":"Space"===t.followCharacter?"space":"nothing",e.writeStartElement(void 0,"suff",this.wNamespace),e.writeAttributeString(void 0,"val",this.wNamespace,i),e.writeEndElement()},e.prototype.serializeDocumentProtectionSettings=function(e){if(e.writeStartElement("w","documentProtection",this.wNamespace),this.formatting&&e.writeAttributeString("w","formatting",this.wNamespace,"1"),this.protectionType&&"NoProtection"!==this.protectionType){var t="ReadOnly"===this.protectionType?"readOnly":"forms";e.writeAttributeString("w","edit",this.wNamespace,t)}e.writeAttributeString("w","cryptProviderType",this.wNamespace,"rsaAES"),e.writeAttributeString("w","cryptAlgorithmClass",this.wNamespace,"hash"),e.writeAttributeString("w","cryptAlgorithmType",this.wNamespace,"typeAny"),e.writeAttributeString("w","cryptAlgorithmSid",this.wNamespace,"14"),e.writeAttributeString("w","cryptSpinCount",this.wNamespace,"100000"),this.enforcement&&e.writeAttributeString("w","enforcement",this.wNamespace,"1"),this.hashValue&&e.writeAttributeString("w","hash",this.wNamespace,this.hashValue),this.saltValue&&e.writeAttributeString("w","salt",this.wNamespace,this.saltValue),e.writeEndElement()},e.prototype.serializeSettings=function(){var e=new p.XmlWriter;e.writeStartElement("w","settings",this.wNamespace),this.writeCustom(e),e.writeAttributeString("xmlns","w10",void 0,this.w10Namespace),e.writeAttributeString("xmlns","w14",void 0,this.w14Namespace),e.writeAttributeString("xmlns","w15",void 0,this.w15Namespace),e.writeAttributeString("xmlns","sl",void 0,this.slNamespace),e.writeAttributeString("mc","Ignorable",void 0,"w14 w15"),this.serializeDocumentProtectionSettings(e),e.writeStartElement("w","zoom",this.wNamespace),e.writeAttributeString("w","val",this.wNamespace,"none"),e.writeAttributeString("w","percent",this.wNamespace,"100"),e.writeEndElement(),e.writeStartElement(void 0,"displayBackgroundShape",this.wNamespace),e.writeEndElement(),e.writeStartElement(void 0,"defaultTabStop",this.wNamespace);var t=Math.round(this.defaultTabWidthValue*this.twipsInOnePoint);e.writeAttributeString(void 0,"val",this.wNamespace,t.toString()),e.writeEndElement(),this.trackChanges&&(e.writeStartElement(void 0,"trackRevisions",this.wNamespace),e.writeEndElement()),this.mDifferentFirstPage&&(e.writeStartElement(void 0,"evenAndOddHeaders",this.wNamespace),e.writeEndElement()),this.formFieldShading||(e.writeStartElement(void 0,"doNotShadeFormData",this.wNamespace),e.writeEndElement()),e.writeStartElement(void 0,"compat",this.wNamespace),this.dontUseHtmlParagraphAutoSpacing&&this.serializeBoolProperty(e,"doNotUseHTMLParagraphAutoSpacing",this.dontUseHtmlParagraphAutoSpacing),e.writeStartElement(void 0,"compatSetting",this.wNamespace),e.writeAttributeString(void 0,"name",this.wNamespace,"compatibilityMode"),e.writeAttributeString(void 0,"uri",this.wNamespace,"http://schemas.microsoft.com/office/word"),e.writeAttributeString(void 0,"val",this.wNamespace,"15"),e.writeEndElement(),e.writeEndElement(),this.document.footnotes&&(e.writeStartElement(void 0,"footnotePr",this.wNamespace),e.writeStartElement(void 0,"footnote",this.wNamespace),e.writeAttributeString(void 0,"id",this.wNamespace,"-1"),e.writeEndElement(),e.writeStartElement(void 0,"footnote",this.wNamespace),e.writeAttributeString(void 0,"id",this.wNamespace,"0"),e.writeEndElement(),e.writeEndElement()),this.document.endnotes&&(e.writeStartElement(void 0,"endnotePr",this.wNamespace),e.writeStartElement(void 0,"endnote",this.wNamespace),e.writeAttributeString(void 0,"id",this.wNamespace,"-1"),e.writeEndElement(),e.writeStartElement(void 0,"endnote",this.wNamespace),e.writeAttributeString(void 0,"id",this.wNamespace,"0"),e.writeEndElement(),e.writeEndElement()),e.writeEndElement();var i=new c.ZipArchiveItem(e.buffer,this.settingsPath);this.mArchive.addItem(i)},e.prototype.serializeCoreProperties=function(){},e.prototype.serializeAppProperties=function(){},e.prototype.serializeFontTable=function(e){},e.prototype.serializeSettingsRelation=function(){},e.prototype.serializeHeaderFooters=function(){this.serializeHeaderFooter("EvenFooter"),this.serializeHeaderFooter("EvenHeader"),this.serializeHeaderFooter("FirstPageFooter"),this.serializeHeaderFooter("FirstPageHeader"),this.serializeHeaderFooter("OddFooter"),this.serializeHeaderFooter("OddHeader")},e.prototype.serializeHeaderFooter=function(e){if(0!==this.headersFooters.length){var t,i;if(this.headersFooters.containsKey(e))for(var n=this.headersFooters.get(e),r=void 0,o=0;o<n.keys.length;o++){var s=n.keys[o];r=n.get(s),"EvenHeader"===e||"FirstPageHeader"===e||"OddHeader"===e?(t=this.headerPath+s.replace("rId","")+".xml",i=this.headerRelationPath+s.replace("rId","")+".xml.rels",this.serializeHeader(r,s,t,i)):(t=this.footerPath+s.replace("rId","")+".xml",i=this.footerRelationPath+s.replace("rId","")+".xml.rels",this.serializeFooter(r,s,t,i))}}},e.prototype.serializeHeader=function(e,t,i,n){this.headerFooter=e;var r=new p.XmlWriter;r.writeStartElement("w","hdr",this.wNamespace),this.writeHFCommonAttributes(r);var o=this.blockOwner;this.blockOwner=e,this.serializeBodyItems(r,e.blocks,!0),this.blockOwner=o,r.writeEndElement();var s=new c.ZipArchiveItem(r.buffer,i);this.mArchive.addItem(s),this.serializeHFRelations(t,n),this.headerFooter=void 0},e.prototype.serializeHFRelations=function(e,t){if(this.headerFooterImages.containsKey(e)){var i=new p.XmlWriter;i.writeStartElement(void 0,"Relationships",this.rpNamespace),this.serializeImagesRelations(this.headerFooterImages.get(e),i),i.writeEndElement();var n=new c.ZipArchiveItem(i.buffer,t);this.mArchive.addItem(n)}},e.prototype.writeHFCommonAttributes=function(e){e.writeAttributeString("xmlns","v",void 0,this.vNamespace),e.writeAttributeString("xmlns","w10",void 0,this.w10Namespace),e.writeAttributeString("xmlns","o",void 0,this.oNamespace),e.writeAttributeString("xmlns","ve",void 0,this.veNamespace),e.writeAttributeString("xmlns","r",void 0,this.rNamespace),e.writeAttributeString("xmlns","m",void 0,this.mNamespace),e.writeAttributeString("xmlns","wne",void 0,this.wneNamespace),e.writeAttributeString("xmlns","a",void 0,this.aNamespace),e.writeAttributeString("xmlns","pic",void 0,this.pictureNamespace),e.writeAttributeString("xmlns","wp",void 0,this.wpNamespace),e.writeAttributeString("xmlns","wpc",void 0,this.wpCanvasNamespace),e.writeAttributeString("xmlns","wp14",void 0,this.wpDrawingNamespace),this.writeDup(e),e.writeAttributeString("xmlns","wps",void 0,this.wpShapeNamespace),e.writeAttributeString("ve","Ignorable",void 0,"w14 w15 wp14")},e.prototype.serializeFooter=function(e,t,i,n){this.headerFooter=e;var r=new p.XmlWriter;r.writeStartElement("w","ftr",this.wNamespace),this.writeHFCommonAttributes(r),this.serializeBodyItems(r,e.blocks,!0),r.writeEndElement();var o=new c.ZipArchiveItem(r.buffer,i);this.mArchive.addItem(o),this.serializeHFRelations(t,n)},e.prototype.serializeDocumentRelations=function(){var e=new p.XmlWriter;e.writeStartElement(void 0,"Relationships",this.rpNamespace),this.serializeRelationShip(e,this.getNextRelationShipID(),this.stylesRelType,"styles.xml"),this.serializeRelationShip(e,this.getNextRelationShipID(),this.settingsRelType,"settings.xml"),this.document.endnotes&&this.serializeRelationShip(e,this.getNextRelationShipID(),this.endnoteRelType,"endnotes.xml"),this.document.footnotes&&this.serializeRelationShip(e,this.getNextRelationShipID(),this.footnoteRelType,"footnotes.xml"),this.mComments.length>0&&(1===this.mComments.length&&""===this.mComments[0].text||(this.serializeRelationShip(e,this.getNextRelationShipID(),this.commentsRelType,"comments.xml"),this.serializeRelationShip(e,this.getNextRelationShipID(),this.commentsExRelType,"commentsExtended.xml"))),this.document.lists.length>0&&this.serializeRelationShip(e,this.getNextRelationShipID(),this.numberingRelType,"numbering.xml"),this.serializeHeaderFooterRelations(e),this.serializeImagesRelations(this.documentImages,e),this.serializeCustomXMLMapping(this.mCustomXML,e),this.serializeChartDocumentRelations(this.documentCharts,e),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,this.wordRelationPath);this.mArchive.addItem(t),this.headerFooter=void 0},e.prototype.serializeChartDocumentRelations=function(e,t){if(e.length>0)for(var i=e.keys,n=1;n<=i.length;n++)this.serializeRelationShip(t,i[n-1],this.chartRelType,"charts/chart"+n+".xml")},e.prototype.serializeChartRelations=function(){var e=new p.XmlWriter;this.resetChartRelationShipId(),e.writeStartElement(void 0,"Relationships",this.rpNamespace);var t="colors"+this.chartCount+".xml",i=this.chartPath+"/_rels/chart"+this.chartCount+".xml.rels",n="../embeddings/Microsoft_Excel_Worksheet"+this.chartCount+".xlsx";this.serializeRelationShip(e,this.getNextChartRelationShipID(),this.packageRelType,n),this.serializeRelationShip(e,this.getNextChartRelationShipID(),this.chartColorStyleRelType,t),e.writeEndElement();var r=new c.ZipArchiveItem(e.buffer,i);this.mArchive.addItem(r)},e.prototype.serializeImagesRelations=function(e,i){if(e.length>0)for(var n="",r=void 0,o=e.keys,s=0;s<o.length;s++)if(r=e.get(o[s]).imageString,t.isNullOrUndefined(r))n=this.imagePath+"/0.jpeg",this.serializeRelationShip(i,o[s],this.imageRelType,n.replace("word/",""));else{var a=L.formatClippedString(r),l=a.extension,d=a.formatClippedString;n=this.imagePath+o[s]+l,this.serializeRelationShip(i,o[s],this.imageRelType,n.replace("word/",""));var h=new Blob([this.encodedString(d)]),p=new c.ZipArchiveItem(h,n);this.mArchive.addItem(p)}},e.prototype.encodedString=function(e){var t,i,n,r,o,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,d=0,h=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&h--,e.charAt(e.length-2)===a.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(var c=new Uint8Array(0|h);l<e.length;)t=a.indexOf(e.charAt(l++))<<2|(r=a.indexOf(e.charAt(l++)))>>4,i=(15&r)<<4|(o=a.indexOf(e.charAt(l++)))>>2,n=(3&o)<<6|(s=a.indexOf(e.charAt(l++))),c[d++]=t,64!==o&&(c[d++]=i),64!==s&&(c[d++]=n);return c},e.prototype.serializeExternalLinkImages=function(e){for(var t=this.externalImages.keys,i=0;i<this.externalImages.keys.length;i++)this.serializeRelationShip(e,t[i],this.imageRelType,this.externalImages.get(t[i]))},e.prototype.serializeHeaderFooterRelations=function(e){this.serializeHFRelation(e,"EvenFooter"),this.serializeHFRelation(e,"EvenHeader"),this.serializeHFRelation(e,"FirstPageFooter"),this.serializeHFRelation(e,"FirstPageHeader"),this.serializeHFRelation(e,"OddFooter"),this.serializeHFRelation(e,"OddHeader")},e.prototype.serializeHFRelation=function(e,t){var i,n="";if(this.headersFooters.containsKey(t))for(var r=this.headersFooters.get(t),o=0;o<r.keys.length;o++){var s=r.keys[o];"EvenHeader"===t||"FirstPageHeader"===t||"OddHeader"===t?(n="header"+s.replace("rId","")+".xml",i=this.headerRelType):(n="footer"+s.replace("rId","")+".xml",i=this.footerRelType),this.serializeRelationShip(e,s,i,n)}},e.prototype.serializeRelationShip=function(e,t,i,n){e.writeStartElement(void 0,"Relationship",void 0),e.writeAttributeString(void 0,"Id",void 0,t),e.writeAttributeString(void 0,"Type",void 0,i),e.writeAttributeString(void 0,"Target",void 0,n.replace("\\","/").replace("\v","")),(i===this.hyperlinkRelType||this.startsWith(n,"http://")||this.startsWith(n,"https://")||this.startsWith(n,"file:///"))&&e.writeAttributeString(void 0,"TargetMode",void 0,"External"),e.writeEndElement()},e.prototype.getNextRelationShipID=function(){return"rId"+ ++this.mRelationShipID},e.prototype.getEFNextRelationShipID=function(){return(++this.efRelationShipId).toString()},e.prototype.serializeGeneralRelations=function(){var e=new p.XmlWriter;this.resetRelationShipID(),e.writeStartElement(void 0,"Relationships",this.rpNamespace),this.serializeRelationShip(e,this.getNextRelationShipID(),this.documentRelType,this.documentPath),e.writeEndElement();var t=new c.ZipArchiveItem(e.buffer,this.generalRelationPath);this.mArchive.addItem(t)},e.prototype.serializeContentTypes=function(e){var t=new p.XmlWriter;if(t.writeStartElement(void 0,"Types","http://schemas.openxmlformats.org/package/2006/content-types"),this.serializeDefaultContentType(t,"rels",this.relationContentType),this.serializeDefaultContentType(t,"xml",this.xmlContentType),(this.documentImages.length>0||this.externalImages.length>0||this.headerFooterImages.length>0)&&(this.serializeDefaultContentType(t,"png","image/png"),this.serializeDefaultContentType(t,"bmp","image/bmp"),this.serializeDefaultContentType(t,"emf","image/x-emf"),this.serializeDefaultContentType(t,"wmf","image/x-wmf"),this.serializeDefaultContentType(t,"gif","image/gif"),this.serializeDefaultContentType(t,"ico","image/x-icon"),this.serializeDefaultContentType(t,"tif","image/tiff"),this.serializeDefaultContentType(t,"tiff","image/tiff"),this.serializeDefaultContentType(t,"jpeg","image/jpeg"),this.serializeDefaultContentType(t,"jpg","image/jpeg"),this.serializeDefaultContentType(t,"svg","image/svg+xml")),this.serializeOverrideContentType(t,this.documentPath,this.documentContentType),this.serializeOverrideContentType(t,this.numberingPath,this.numberingContentType),this.serializeOverrideContentType(t,this.stylePath,this.stylesContentType),this.serializeOverrideContentType(t,this.settingsPath,this.settingsContentType),this.serializeOverrideContentType(t,this.commentsPath,this.commentsContentType),this.serializeOverrideContentType(t,this.commentsExtendedPath,this.commentsExContentType),this.chartCount>0){var i=1;for(this.serializeDefaultContentType(t,"xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");i<=this.chartCount;)this.serializeOverrideContentType(t,"word/charts/chart"+i+".xml",this.chartsContentType),this.serializeOverrideContentType(t,"word/charts/colors"+i+".xml",this.chartColorStyleContentType),i++}if(this.customXMLProps.length>0)for(var n=0;n<this.customXMLProps.length;n++)this.serializeOverrideContentType(t,this.customXMLProps[n],this.customXmlContentType);this.serializeHFContentTypes(t),this.SerializeEFContentTypes(t),t.writeEndElement();var r=new c.ZipArchiveItem(t.buffer,this.contentTypesPath);this.mArchive.addItem(r)},e.prototype.serializeHFContentTypes=function(e){this.serializeHeaderFootersContentType(e,"EvenFooter"),this.serializeHeaderFootersContentType(e,"EvenHeader"),this.serializeHeaderFootersContentType(e,"FirstPageFooter"),this.serializeHeaderFootersContentType(e,"FirstPageHeader"),this.serializeHeaderFootersContentType(e,"OddFooter"),this.serializeHeaderFootersContentType(e,"OddHeader")},e.prototype.serializeHeaderFootersContentType=function(e,t){var i,n;if(this.headersFooters.containsKey(t))for(var r=this.headersFooters.get(t),o=0;o<r.keys.length;o++){var s=r.keys[o];"EvenHeader"===t||"FirstPageHeader"===t||"OddHeader"===t?(n=this.headerPath+s.replace("rId","")+".xml",i=this.headerContentType):(n=this.footerPath+s.replace("rId","")+".xml",i=this.footerContentType),this.serializeOverrideContentType(e,n,i)}},e.prototype.SerializeEFContentTypes=function(e){this.serializeEFContentType(e)},e.prototype.serializeEFContentType=function(e){var t,i;i=this.endnotesPath,t=this.endnoteContentType,this.serializeOverrideContentType(e,i,t),i=this.footnotesPath,t=this.footnoteContentType,this.serializeOverrideContentType(e,i,t)},e.prototype.serializeOverrideContentType=function(e,t,i){e.writeStartElement(void 0,"Override",void 0),e.writeAttributeString(void 0,"PartName",void 0,"/"+t.replace("\\","/")),e.writeAttributeString(void 0,"ContentType",void 0,i),e.writeEndElement()},e.prototype.serializeDefaultContentType=function(e,t,i){e.writeStartElement(void 0,"Default",void 0),e.writeAttributeString(void 0,"Extension",void 0,t),e.writeAttributeString(void 0,"ContentType",void 0,i),e.writeEndElement()},e.prototype.resetRelationShipID=function(){this.mRelationShipID=0},e.prototype.resetExcelRelationShipId=function(){this.eRelationShipId=0},e.prototype.resetChartRelationShipId=function(){this.cRelationShipId=0},e.prototype.close=function(){},e}(),hi=function(){function e(){this.pageContent="",this.curSectionIndex=0,this.inField=!1}return e.prototype.getModuleName=function(){return"TextExport"},e.prototype.save=function(e,t){this.serialize(e);var i=new p.StreamWriter;this.writeInternal(i),i.save(t+".txt")},e.prototype.saveAsBlob=function(e){this.serialize(e);var t=new p.StreamWriter;this.writeInternal(t);var i=t.buffer;return t.destroy(),new Promise(function(e,t){e(i)})},e.prototype.serialize=function(e){var t=e.owner.sfdtExportModule.write();this.setDocument(t)},e.prototype.setDocument=function(e){this.document=e,this.mSections=e.sections},e.prototype.writeInternal=function(e){var t=void 0,i=this.document.sections.length-1,n=!1;this.updateLastParagraph();for(var r=0;r<=i;r++)t=this.document.sections[r],n=r===i,this.writeBody(e,t.blocks),this.writeNewLine(e),this.writeSectionEnd(t,n);for(var o=0;o<=i;o++)t=this.document.sections[o],this.writeHeadersFooters(e,t)},e.prototype.writeBody=function(e,t){for(var i=t.length-1,n=void 0,r=0;r<=i;r++)if((n=t[r]).hasOwnProperty("inlines")){var o=n===this.lastPara;this.writeParagraph(e,n,o)}else this.writeTable(e,n)},e.prototype.writeParagraph=function(e,t,i){for(var n=0;n<t.inlines.length;n++){var r=t.inlines[n];r.hasOwnProperty("fieldType")?this.inField=0===r.fieldType:r.hasOwnProperty("text")&&!this.inField&&this.writeText(e,r.text)}i||this.writeNewLine(e)},e.prototype.writeTable=function(e,t){for(var i=0;i<t.rows.length;i++)for(var n=t.rows[i],r=0;r<n.cells.length;r++){var o=n.cells[r];this.writeBody(e,o.blocks)}},e.prototype.writeHeadersFooters=function(e,i){var n=i.headersFooters;t.isNullOrUndefined(n)||(this.writeHeaderFooter(e,i.headersFooters.header),this.writeHeaderFooter(e,i.headersFooters.footer),this.writeHeaderFooter(e,i.headersFooters.evenFooter),this.writeHeaderFooter(e,i.headersFooters.evenHeader),this.writeHeaderFooter(e,i.headersFooters.firstPageHeader),this.writeHeaderFooter(e,i.headersFooters.firstPageFooter))},e.prototype.writeHeaderFooter=function(e,t){t&&t.blocks&&this.writeBody(e,t.blocks)},e.prototype.writeSectionEnd=function(e,t){this.curSectionIndex++},e.prototype.writeNewLine=function(e){t.isNullOrUndefined(e)?this.pageContent=this.pageContent+" ":e.writeLine("")},e.prototype.writeText=function(e,i){t.isNullOrUndefined(e)?this.pageContent+=i:e.write(i)},e.prototype.updateLastParagraph=function(){var e,i=this.document.sections.length;if(i>0&&(e=this.document.sections[i-1]),!t.isNullOrUndefined(e)){for(var n=[],r=0;r<e.blocks.length;r++)e.blocks[r].hasOwnProperty("inlines")&&n.push(e.blocks[r]);var o=n.length;o>0&&(this.lastPara=n[o-1])}},e.prototype.destroy=function(){this.document=void 0,this.lastPara=void 0,this.mSections=void 0,this.sections=void 0},e}(),ci=function(){function e(e){this.startLine=void 0,this.endLine=void 0,this.endOffset=void 0,this.endCell=void 0,this.startColumnIndex=void 0,this.endColumnIndex=void 0,this.lists=void 0,this.document=void 0,this.writeInlineStyles=void 0,this.blockContent=!1,this.startContent=!1,this.multipleLineContent=!1,this.nestedContent=!1,this.editRangeId=-1,this.selectedCommentsId=[],this.selectedRevisionId=[],this.nestedBlockContent=!1,this.nestedBlockEnabled=!1,this.blocks=[],this.contentInline=[],this.isContentControl=!1,this.isBlockClosed=!0,this.isExport=!0,this.isPartialExport=!1,this.checkboxOrDropdown=!1,this.copyWithTrackChange=!1,this.documentHelper=e}return Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"owner",{get:function(){return this.documentHelper.owner},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"SfdtExport"},e.prototype.clear=function(){this.writeInlineStyles=void 0,this.startLine=void 0,this.endLine=void 0,this.lists=void 0,this.document=void 0,this.endCell=void 0,this.startColumnIndex=void 0,this.endColumnIndex=void 0,this.selectedCommentsId=[],this.selectedRevisionId=[],this.startBlock=void 0,this.endBlock=void 0,this.isPartialExport=!1},e.prototype.serialize=function(){return JSON.stringify(this.write())},e.prototype.saveAsBlob=function(e){var t=new p.StreamWriter;t.write(this.serialize());var i=t.buffer;return t.destroy(),new Promise(function(e,t){e(i)})},e.prototype.updateEditRangeId=function(){for(var e=-1,t=0;t<this.documentHelper.editRanges.keys.length;t++)for(var i=this.documentHelper.editRanges.keys,n=0;n<i[t].length;n++)for(var r=this.documentHelper.editRanges.get(i[t]),o=0;o<r.length;o++)e++,r[o].editRangeId=e,r[o].editRangeEnd.editRangeId=e},e.prototype.write=function(e,i,n,r,o,s){if(o&&(this.writeInlineStyles=!0),this.Initialize(),this.updateEditRangeId(),e instanceof Te&&n instanceof Te){this.isExport=!1,t.isNullOrUndefined(s)||(this.isExport=s);var a=e.paragraph,l=n.paragraph;this.isPartialExport&&(this.startBlock=this.getParentBlock(a),this.endBlock=this.getParentBlock(l));var d=a.associatedCell,h=l.associatedCell,c=(a.bodyWidget,this.createSection(e.paragraph.bodyWidget));if(this.document.sections.push(c),d===h||t.isNullOrUndefined(h))this.startLine=e,this.endLine=n,this.endOffset=r;else if(d instanceof Pe){var p=d.getContainerTable(),g=h.getContainerTable();p.tableFormat===g.tableFormat&&(this.endCell=h,this.endCell.ownerTable!==d.ownerTable&&d.ownerTable.associatedCell&&d.ownerTable.associatedCell.ownerTable===this.endCell.ownerTable&&0===d.ownerTable.associatedCell.childWidgets.indexOf(d.ownerTable)&&(d=d.ownerTable.associatedCell),this.endColumnIndex=this.endCell.columnIndex+this.endCell.cellFormat.columnSpan,this.startColumnIndex=d.columnIndex)}else this.endCell=h;var u=void 0;if(d===h&&!this.isPartialExport||t.isNullOrUndefined(d)){var m=this.createParagraph(e.paragraph);c.blocks.push(m);b=e.paragraph;for(u=this.writeParagraph(e.paragraph,m,c.blocks,e.indexInOwner,i),this.isPartialExport&&(u=this.getNextBlock(u,b),c=this.document.sections[this.document.sections.length-1]);u;)b=u,u=this.writeBlock(u,0,c.blocks),this.isPartialExport&&t.isNullOrUndefined(u)&&(u=this.getNextBlock(u,b),c=this.document.sections[this.document.sections.length-1])}else{if(t.isNullOrUndefined(h)&&d.ownerTable.associatedCell){var f=(p=d.getContainerTable()).childWidgets[p.childWidgets.length-1],v=f.childWidgets[f.childWidgets.length-1];if(v.ownerTable!==d.ownerTable&&d.ownerTable.associatedCell&&0===d.ownerTable.associatedCell.childWidgets.indexOf(d.ownerTable))for(;d.ownerTable!==v.ownerTable;)d=d.ownerTable.associatedCell;this.endColumnIndex=v.columnIndex+v.cellFormat.columnSpan,this.startColumnIndex=d.columnIndex}var y=this.createTable(d.ownerTable);c.blocks.push(y);var b=d.ownerTable;for(u=this.writeTable(d.ownerTable,y,d.ownerRow.indexInOwner,c.blocks),this.isPartialExport&&(u=this.getNextBlock(u,b),c=this.document.sections[this.document.sections.length-1]);u;)b=u,u=this.writeBlock(u,0,c.blocks),this.isPartialExport&&(u=this.getNextBlock(u,b),c=this.document.sections[this.document.sections.length-1])}}else if(this.isExport=!0,this.documentHelper.pages.length>0){var w=this.documentHelper.pages[0];this.writePage(w)}this.writeStyles(this.documentHelper),this.writeLists(this.documentHelper),this.writeComments(this.documentHelper),this.writeRevisions(this.documentHelper),this.writeCustomXml(this.documentHelper),this.footnotes(this.documentHelper),this.endnotes(this.documentHelper);var C=this.document;return this.clear(),C},e.prototype.getNextBlock=function(e,i){if(t.isNullOrUndefined(e)&&this.isPartialExport&&this.endBlock&&!this.endBlock.equals(i))if((e=i.getSplitWidgets().pop().nextRenderedWidget)&&i.bodyWidget.index!==e.bodyWidget.index){var n=this.createSection(e.bodyWidget);this.document.sections.push(n)}else e=void 0;return e},e.prototype.Initialize=function(){this.lists=[],this.document={},this.document.sections=[],this.document.characterFormat=this.writeCharacterFormat(this.documentHelper.characterFormat),this.document.paragraphFormat=this.writeParagraphFormat(this.documentHelper.paragraphFormat),this.document.defaultTabWidth=this.documentHelper.defaultTabWidth,this.document.trackChanges=this.owner.enableTrackChanges,this.document.enforcement=this.documentHelper.isDocumentProtected,this.document.hashValue=this.documentHelper.hashValue,this.document.saltValue=this.documentHelper.saltValue,this.document.formatting=this.documentHelper.restrictFormatting,this.document.protectionType=this.documentHelper.protectionType,this.document.dontUseHTMLParagraphAutoSpacing=this.documentHelper.dontUseHtmlParagraphAutoSpacing,this.document.formFieldShading=this.documentHelper.owner.documentEditorSettings.formFieldSettings.applyShading},e.prototype.writePage=function(e){if(e.bodyWidgets.length>0){var i=e.bodyWidgets[0];do{i=this.writeBodyWidget(i,0)}while(!t.isNullOrUndefined(i))}return this.document},e.prototype.writeBodyWidget=function(e,i){if(e instanceof fe){var n=this.createSection(e);this.document.sections.push(n),this.writeHeaderFooters(this.documentHelper.headersFooters[e.index],n);var r=e.childWidgets[i];do{r=this.writeBlock(r,0,n.blocks)}while(r);var o=e;do{e=o,o=o.nextRenderedWidget,!t.isNullOrUndefined(o)||t.isNullOrUndefined(e.page.nextPage)||t.isNullOrUndefined(e.page.nextPage)||(o=e.page.nextPage.bodyWidgets[0])}while(o instanceof fe&&o.index===e.index);return o}},e.prototype.writeHeaderFooters=function(e,i){t.isNullOrUndefined(e)||(i.headersFooters.header=this.writeHeaderFooter(e[0]),i.headersFooters.footer=this.writeHeaderFooter(e[1]),i.headersFooters.evenHeader=this.writeHeaderFooter(e[2]),i.headersFooters.evenFooter=this.writeHeaderFooter(e[3]),i.headersFooters.firstPageHeader=this.writeHeaderFooter(e[4]),i.headersFooters.firstPageFooter=this.writeHeaderFooter(e[5]))},e.prototype.writeHeaderFooter=function(e){if(!t.isNullOrUndefined(e)&&!e.isEmpty){var i={};if(e&&e.childWidgets&&e.childWidgets.length>0){i.blocks=[];var n=e.firstChild;do{n=this.writeBlock(n,0,i.blocks)}while(n)}return i}},e.prototype.createSection=function(e){var i={};return i.sectionFormat={},i.sectionFormat.pageWidth=e.sectionFormat.pageWidth,i.sectionFormat.pageHeight=e.sectionFormat.pageHeight,i.sectionFormat.leftMargin=e.sectionFormat.leftMargin,i.sectionFormat.rightMargin=e.sectionFormat.rightMargin,i.sectionFormat.topMargin=e.sectionFormat.topMargin,i.sectionFormat.bottomMargin=e.sectionFormat.bottomMargin,i.sectionFormat.differentFirstPage=e.sectionFormat.differentFirstPage,i.sectionFormat.differentOddAndEvenPages=e.sectionFormat.differentOddAndEvenPages,i.sectionFormat.headerDistance=e.sectionFormat.headerDistance,i.sectionFormat.footerDistance=e.sectionFormat.footerDistance,i.sectionFormat.bidi=e.sectionFormat.bidi,e.sectionFormat.restartPageNumbering&&(i.sectionFormat.restartPageNumbering=e.sectionFormat.restartPageNumbering,i.sectionFormat.pageStartingNumber=e.sectionFormat.pageStartingNumber),t.isNullOrUndefined(e.page.endnoteWidget||e.page.footnoteWidget)||(i.sectionFormat.endnoteNumberFormat=e.sectionFormat.endnoteNumberFormat,i.sectionFormat.footNoteNumberFormat=e.sectionFormat.footNoteNumberFormat,i.sectionFormat.restartIndexForFootnotes=e.sectionFormat.restartIndexForFootnotes,i.sectionFormat.restartIndexForEndnotes=e.sectionFormat.restartIndexForEndnotes,i.sectionFormat.initialFootNoteNumber=e.sectionFormat.initialFootNoteNumber,i.sectionFormat.initialEndNoteNumber=e.sectionFormat.initialEndNoteNumber),i.blocks=[],i.headersFooters={},i},e.prototype.writeBlock=function(e,i,n){if(e instanceof ye){if(e instanceof we){if(e.hasOwnProperty("contentControlProperties")&&"BuildingBlockGallery"!==e.contentControlProperties.type){s=this.blockContentControl(e);return!t.isNullOrUndefined(s)&&this.isBlockClosed&&(n.push(s),this.blocks=[]),this.nextBlock}var r=this.createParagraph(e);return n.push(r),this.writeParagraph(e,r,n)}var o=e;if(o.hasOwnProperty("contentControlProperties")&&"BuildingBlockGallery"!==o.contentControlProperties.type){var s=this.tableContentControl(o);return this.isBlockClosed&&n.push(s),this.nextBlock}var a=this.createTable(o);return n.push(a),this.writeTable(o,a,0,n)}},e.prototype.writeParagraphs=function(e){var i=this.blocks,n=e.childWidgets[0],r=n.children[0],o=n.children[1];if((r instanceof Qe||o instanceof Qe)&&(r=n.children[2],o=n.children[3]),this.nestedBlockEnabled&&(i=[]),r instanceof Me&&o instanceof Me&&!this.nestedBlockContent||this.blockContent&&r instanceof Me&&!this.nestedBlockContent){var s=!1;if(o instanceof Me&&"Block"===o.contentControlWidgetType&&(s=!0),s||this.blockContent&&r instanceof Me&&!this.nestedBlockContent&&0===r.type&&"Block"===r.contentControlWidgetType){this.nestedBlockContent=!0,this.nestedBlockEnabled=!0;var a=this.blockContentControl(e);t.isNullOrUndefined(a)||this.blocks.push(a)}else{l=this.createParagraph(e);i.push(l),this.nextBlock=this.writeParagraph(e,l,i)}}else{var l=this.createParagraph(e);i.push(l),this.nextBlock=this.writeParagraph(e,l,i)}return this.blockContent?!this.nestedBlockContent&&this.nestedBlockEnabled?(this.nestedBlockEnabled=!1,i):void 0:i},e.prototype.contentControlProperty=function(e){var i={};return i.lockContentControl=e.lockContentControl,i.lockContents=e.lockContents,i.tag=e.tag,i.color=e.color,i.title=e.title,t.isNullOrUndefined(e.appearance)||(i.appearance=e.appearance),i.type=e.type,i.hasPlaceHolderText=e.hasPlaceHolderText,i.multiline=e.multiline,i.isTemporary=e.isTemporary,t.isNullOrUndefined(e.isChecked)||(i.isChecked=e.isChecked),t.isNullOrUndefined(e.uncheckedState)||(i.uncheckedState=this.tounCheckedState(e.uncheckedState)),t.isNullOrUndefined(e.checkedState)||(i.checkedState=this.toCheckedState(e.checkedState)),t.isNullOrUndefined(e.dateCalendarType)||(i.dateCalendarType=e.dateCalendarType),t.isNullOrUndefined(e.dateStorageFormat)||(i.dateStorageFormat=e.dateStorageFormat),t.isNullOrUndefined(e.dateDisplayLocale)||(i.dateDisplayLocale=e.dateDisplayLocale),t.isNullOrUndefined(e.dateDisplayFormat)||(i.dateDisplayFormat=e.dateDisplayFormat),t.isNullOrUndefined(e.xmlMapping)||(i.xmlMapping=e.xmlMapping),t.isNullOrUndefined(e.characterFormat)||(i.characterFormat=this.writeCharacterFormat(e.characterFormat)),i.contentControlListItems=e.contentControlListItems,i},e.prototype.tounCheckedState=function(e){var t={};return t.font=e.font,t.value=e.value,t},e.prototype.toCheckedState=function(e){var t={};return t.font=e.font,t.value=e.value,t},e.prototype.blockContentControl=function(e){var i={};if(0===e.childWidgets.length)return void(this.nextBlock=e.nextWidget);if(i.blocks=this.writeParagraphs(e),!t.isNullOrUndefined(i.blocks)){var n=e.childWidgets[0],r=n.children[0],o=n.children[1];if((r instanceof Qe||o instanceof Qe)&&(r=n.children[2],o=n.children[3]),r instanceof Me&&o instanceof Me&&!this.nestedBlockContent||this.blockContent&&r instanceof Me&&!this.nestedBlockContent){if(!(o instanceof Me))return i.contentControlProperties=this.contentControlProperty(r.contentControlProperties),i;"Block"===o.contentControlWidgetType?i.contentControlProperties=this.contentControlProperty(o.contentControlProperties):i.contentControlProperties=this.contentControlProperty(e.contentControlProperties)}else i.contentControlProperties=this.contentControlProperty(e.contentControlProperties);return i}},e.prototype.tableContentControl=function(e){var i={};return i.blocks=this.tableContentControls(e),t.isNullOrUndefined(this.nextBlock)||e.contentControlProperties!==this.nextBlock.contentControlProperties?(i.contentControlProperties=this.contentControlProperty(e.contentControlProperties),i):this.blocks=i.blocks},e.prototype.tableContentControls=function(e){var t=[];this.isBlockClosed||(t=this.blocks);var i=this.createTable(e);return t.push(i),this.nextBlock=this.writeTable(e,i,0,t),t},e.prototype.writeParagraph=function(e,i,n,r,o){t.isNullOrUndefined(r)&&(r=0),t.isNullOrUndefined(o)&&(o=0);for(var s=e;s instanceof we;){if(this.writeLines(s,r,o,i.inlines))return;r=0,o=0,s=(e=s).nextSplitWidget}return s=e.nextRenderedWidget,t.isNullOrUndefined(s)&&e.containerWidget instanceof fe&&!t.isNullOrUndefined(e.containerWidget.page.nextPage)&&!t.isNullOrUndefined(e.containerWidget.page.nextPage.bodyWidgets)&&(s=e.containerWidget.page.nextPage.bodyWidgets[0].childWidgets[0]),s instanceof ye&&e.containerWidget.index===s.containerWidget.index?s:void 0},e.prototype.writeInlines=function(e,i,n){this.contentInline=[];var r=i.clone(),o=!1,s=e.paragraphFormat.bidi;(s||this.documentHelper.layout.isContainsRtl(r))&&this.documentHelper.layout.reArrangeElementsForRtl(r,s);for(var a=0;a<r.children.length;a++){var l=r.children[a];if(this.isExport&&this.checkboxOrDropdown){if(o&&l instanceof Oe)continue;l instanceof Ie&&2===l.fieldType&&(o=!0)}if(!(l instanceof Qe))if(l instanceof Le)n.push(this.writeInlinesFootNote(e,l,i,n));else if(l instanceof Me&&!t.isNullOrUndefined(l.contentControlProperties)&&"BuildingBlockGallery"!==l.contentControlProperties.type||this.startContent||this.blockContent)n.length>0&&this.writeInlinesContentControl(l,i,n,a);else{var d=this.writeInline(l);t.isNullOrUndefined(d)||n.push(d),this.isExport&&l instanceof Ie&&1===l.fieldType&&(o=!1,this.checkboxOrDropdown=!1)}}},e.prototype.inlineContentControl=function(e,i,n){var r={},o=[];if(t.isNullOrUndefined(n))if(this.nestedContent){r.inlines=this.inlineContentControls(e,void 0,o);s=this.nestedContentProperty(i,r);t.isNullOrUndefined(s)&&!this.multipleLineContent||(this.contentInline.push(r),o=[])}else r.inlines=this.inlineContentControls(e,this.contentInline);else if(this.nestedContent){n=n[n.length-1].inlines,r=this.inlineContentControls(e,n[n.length-1].inlines);var s=this.nestedContentProperty(i,n[n.length-1]);t.isNullOrUndefined(s)||(this.contentInline.push(r),o=[])}else this.inlineContentControls(e,n[n.length-1].inlines);if(t.isNullOrUndefined(i)){if(this.startContent)return this.multipleLineContent=!0,r}else if(1===i.type&&!this.nestedContent)return this.multipleLineContent?(n[n.length-1].contentControlProperties=this.contentControlProperty(i.contentControlProperties),void(this.multipleLineContent=!1)):(r.contentControlProperties=this.contentControlProperty(i.contentControlProperties),r)},e.prototype.nestedContentProperty=function(e,i,n){if(t.isNullOrUndefined(e)){if(this.startContent)return this.multipleLineContent=!0,i}else{if(1===e.type)return i.contentControlProperties=this.contentControlProperty(e.contentControlProperties),i;if(this.startContent)return this.multipleLineContent=!0,i}},e.prototype.inlineContentControls=function(e,i,n){var r=this.writeInline(e);return t.isNullOrUndefined(n)?(i.push(r),i):(n.push(r),n)},e.prototype.writeInline=function(e){var t={};if(e.removedIds.length>0)for(var i=0;i<e.removedIds.length;i++)e.revisions[i]=this.documentHelper.revisionsInternal.get(e.removedIds[i]);if(t.characterFormat=this.writeCharacterFormat(e.characterFormat),e instanceof Ie)t.fieldType=e.fieldType,0===e.fieldType&&(t.hasFieldEnd=!0,e.formFieldData&&(t.formFieldData={},t.formFieldData.name=e.formFieldData.name,t.formFieldData.enabled=e.formFieldData.enabled,t.formFieldData.helpText=e.formFieldData.helpText,t.formFieldData.statusText=e.formFieldData.statusText,e.formFieldData instanceof Ee?(t.formFieldData.textInput={},t.formFieldData.textInput.type=e.formFieldData.type,t.formFieldData.textInput.maxLength=e.formFieldData.maxLength,t.formFieldData.textInput.defaultValue=e.formFieldData.defaultValue,t.formFieldData.textInput.format=e.formFieldData.format):e.formFieldData instanceof He?(t.formFieldData.checkBox={},this.checkboxOrDropdown=!0,t.formFieldData.checkBox.sizeType=e.formFieldData.sizeType,t.formFieldData.checkBox.size=e.formFieldData.size,t.formFieldData.checkBox.defaultValue=e.formFieldData.defaultValue,t.formFieldData.checkBox.checked=e.formFieldData.checked):(t.formFieldData.dropDownList={},this.checkboxOrDropdown=!0,t.formFieldData.dropDownList.dropDownItems=e.formFieldData.dropdownItems,t.formFieldData.dropDownList.selectedIndex=e.formFieldData.selectedIndex))),e.fieldCodeType&&""!==e.fieldCodeType&&(t.fieldCodeType=e.fieldCodeType);else if(e instanceof tt)this.writeChart(e,t);else if(e instanceof Ze)t.imageString=e.imageString,t.metaFileImageString=e.metaFileImageString,t.isMetaFile=e.isMetaFile,t.isCompressed=e.isCompressed,t.width=L.convertPixelToPoint(e.width),t.height=L.convertPixelToPoint(e.height),t.iscrop=e.isCrop,e.isCrop&&(t.bottom=e.bottom,t.right=e.right,t.left=e.left,t.top=e.top,t.getimagewidth=e.cropWidthScale,t.getimageheight=e.cropHeightScale),t.name=e.name,t.alternativeText=e.alternativeText,t.title=e.title,t.visible=e.visible,t.widthScale=e.widthScale,t.heightScale=e.heightScale,t.verticalPosition=L.convertPixelToPoint(e.verticalPosition),t.verticalOrigin=e.verticalOrigin,t.verticalAlignment=e.verticalAlignment,t.horizontalPosition=L.convertPixelToPoint(e.horizontalPosition),t.horizontalOrigin=e.horizontalOrigin,t.horizontalAlignment=e.horizontalAlignment,t.allowOverlap=e.allowOverlap,t.textWrappingStyle=e.textWrappingStyle,t.textWrappingType=e.textWrappingType,t.layoutInCell=e.layoutInCell,t.zOrderPosition=e.zOrderPosition;else if(e instanceof Ae)t.bookmarkType=e.bookmarkType,t.name=e.name;else if(e instanceof Oe)if(-1!==e.text.indexOf(""))t.text=e.text.replace(/\u001e/g,"-");else if(-1!==e.text.indexOf(""))t.text=e.text.replace(/\u001f/g,"");else if(0!==e.revisions.length)if(this.isExport||!this.owner.enableTrackChanges||this.isPartialExport)t.text=e.text;else{this.copyWithTrackChange=!0;for(r=0;r<e.revisions.length;r++){var n=e.revisions[r];-1===this.selectedRevisionId.indexOf(n.revisionID)&&this.selectedRevisionId.push(n.revisionID),"Deletion"===e.revisions[r].revisionType?e.revisions.pop():"Insertion"===e.revisions[r].revisionType?(e.revisions.pop(),t.text=e.text):t.text=e.text}}else t.text=e.text;else e instanceof et?(t.user=e.user,t.group=e.group,t.columnFirst=e.columnFirst,t.columnLast=e.columnLast,t.editRangeId=e.editRangeId.toString()):e instanceof $e?(t.editableRangeStart={user:e.editRangeStart.user,group:e.editRangeStart.group,columnFirst:e.editRangeStart.columnFirst,columnLast:e.editRangeStart.columnLast},t.editRangeId=e.editRangeId.toString()):e instanceof vt?(this.isExport||0!==e.commentType||this.selectedCommentsId.push(e.commentId),t.commentCharacterType=e.commentType,t.commentId=e.commentId):e instanceof Ke?this.writeShape(e,t):t=void 0;if(e.revisions.length>0){t.revisionIds=[];for(var r=0;r<e.revisions.length;r++)-1===this.selectedRevisionId.indexOf(e.revisions[r].revisionID)&&this.selectedRevisionId.push(e.revisions[r].revisionID),t.revisionIds.push(e.revisions[r].revisionID)}return t},e.prototype.writeShape=function(e,t){if(t.shapeId=e.shapeId,t.name=e.name,t.alternativeText=e.alternativeText,t.title=e.title,t.visible=e.visible,t.width=L.convertPixelToPoint(e.width),t.height=L.convertPixelToPoint(e.height),t.widthScale=e.widthScale,t.heightScale=e.heightScale,t.verticalPosition=L.convertPixelToPoint(e.verticalPosition),t.verticalOrigin=e.verticalOrigin,t.verticalAlignment=e.verticalAlignment,t.verticalRelativePercent=e.verticalRelativePercent,t.horizontalPosition=L.convertPixelToPoint(e.horizontalPosition),t.horizontalOrigin=e.horizontalOrigin,t.horizontalAlignment=e.horizontalAlignment,t.horizontalRelativePercent=e.horizontalRelativePercent,t.zOrderPosition=e.zOrderPosition,t.allowOverlap=e.allowOverlap,t.textWrappingStyle=e.textWrappingStyle,t.textWrappingType=e.textWrappingType,t.distanceBottom=L.convertPixelToPoint(e.distanceBottom),t.distanceLeft=L.convertPixelToPoint(e.distanceLeft),t.distanceRight=L.convertPixelToPoint(e.distanceRight),t.distanceTop=L.convertPixelToPoint(e.distanceTop),t.layoutInCell=e.layoutInCell,t.lockAnchor=e.lockAnchor,t.autoShapeType=e.autoShapeType,e.fillFormat&&(t.fillFormat={},t.fillFormat.color=e.fillFormat.color,t.fillFormat.fill=e.fillFormat.fill),e.lineFormat&&(t.lineFormat={},t.lineFormat.lineFormatType=e.lineFormat.lineFormatType,t.lineFormat.color=e.lineFormat.color,t.lineFormat.weight=e.lineFormat.weight,t.lineFormat.lineStyle=e.lineFormat.dashStyle,t.lineFormat.line=e.lineFormat.line),e.textFrame){t.textFrame={},t.textFrame.textVerticalAlignment=e.textFrame.textVerticalAlignment,t.textFrame.leftMargin=L.convertPixelToPoint(e.textFrame.marginLeft),t.textFrame.rightMargin=L.convertPixelToPoint(e.textFrame.marginRight),t.textFrame.topMargin=L.convertPixelToPoint(e.textFrame.marginTop),t.textFrame.bottomMargin=L.convertPixelToPoint(e.textFrame.marginBottom),t.textFrame.blocks=[];for(var i=0;i<e.textFrame.childWidgets.length;i++){var n=e.textFrame.childWidgets[i];this.writeBlock(n,0,t.textFrame.blocks)}}},e.prototype.writeChart=function(e,t){t.chartLegend={},t.chartTitleArea={},t.chartArea={},t.plotArea={},t.chartCategory=[],t.chartSeries=[],t.chartPrimaryCategoryAxis={},t.chartPrimaryValueAxis={},this.writeChartTitleArea(e.chartTitleArea,t.chartTitleArea),this.writeChartArea(e.chartArea,t.chartArea),this.writeChartArea(e.chartPlotArea,t.plotArea),this.writeChartCategory(e,t.chartCategory),this.createChartSeries(e,t.chartSeries),this.writeChartLegend(e.chartLegend,t.chartLegend),this.writeChartCategoryAxis(e.chartPrimaryCategoryAxis,t.chartPrimaryCategoryAxis),this.writeChartCategoryAxis(e.chartPrimaryValueAxis,t.chartPrimaryValueAxis),void 0!==e.chartDataTable.showSeriesKeys&&(t.chartDataTable={},this.writeChartDataTable(e.chartDataTable,t.chartDataTable)),t.chartTitle=e.title,t.chartType=e.type,t.gapWidth=e.chartGapWidth,t.overlap=e.chartOverlap,t.height=L.convertPixelToPoint(e.height),t.width=L.convertPixelToPoint(e.width)},e.prototype.writeChartTitleArea=function(e,t){t.fontName=e.chartfontName,t.fontSize=e.chartFontSize,t.layout={},t.dataFormat=this.writeChartDataFormat(e.dataFormat),this.writeChartLayout(e.layout,t.layout)},e.prototype.writeChartDataFormat=function(e){var t={};return t.fill={},t.line={},t.fill.foreColor=e.fill.color,t.fill.rgb=e.fill.rgb,t.line.color=e.line.color,t.line.rgb=e.line.rgb,t},e.prototype.writeChartLayout=function(e,t){t.layoutX=e.chartLayoutLeft,t.layoutY=e.chartLayoutTop},e.prototype.writeChartArea=function(e,t){t.foreColor=e.chartForeColor},e.prototype.writeChartLegend=function(e,t){t.position=e.chartLegendPostion,t.chartTitleArea={},this.writeChartTitleArea(e.chartTitleArea,t.chartTitleArea)},e.prototype.writeChartCategoryAxis=function(e,t){t.chartTitle=e.categoryAxisTitle,t.chartTitleArea={},this.writeChartTitleArea(e.chartTitleArea,t.chartTitleArea),t.categoryType=e.categoryAxisType,t.fontSize=e.axisFontSize,t.fontName=e.axisFontName,t.numberFormat=e.categoryNumberFormat,t.maximumValue=e.max,t.minimumValue=e.min,t.majorUnit=e.interval,t.hasMajorGridLines=e.majorGridLines,t.hasMinorGridLines=e.minorGridLines,t.majorTickMark=e.majorTick,t.minorTickMark=e.minorTick,t.tickLabelPosition=e.tickPosition},e.prototype.writeChartDataTable=function(e,t){t.showSeriesKeys=e.showSeriesKeys,t.hasHorzBorder=e.hasHorzBorder,t.hasVertBorder=e.hasVertBorder,t.hasBorders=e.hasBorders},e.prototype.writeChartCategory=function(e,t){var i=e.chartCategory;t.chartData=[];for(var n=0;n<i.length;n++){var r=i[n],o=this.createChartCategory(r,e.chartType);t.push(o)}},e.prototype.createChartCategory=function(e,t){var i={};return i.chartData=[],this.writeChartData(e,i.chartData,t),i.categoryXName=e.categoryXName,i},e.prototype.writeChartData=function(e,t,i){for(var n=e.chartData,r=0;r<n.length;r++){var o=n[r],s=this.createChartData(o,i);t.push(s)}},e.prototype.createChartData=function(e,t){var i={};return i.yValue=e.yValue,"Bubble"===t&&(i.size=e.size),i},e.prototype.createChartSeries=function(e,t){for(var i=e.chartSeries,n=e.chartType,r=0;r<i.length;r++){var o=i[r],s=this.writeChartSeries(o,n);t.push(s)}},e.prototype.writeChartSeries=function(e,i){var n="Pie"===i||"Doughnut"===i,r={},o={},s=e.errorBar;if(r.dataPoints=[],r.seriesName=e.seriesName,n&&(t.isNullOrUndefined(e.firstSliceAngle)||(r.firstSliceAngle=e.firstSliceAngle),"Doughnut"===i&&(r.holeSize=e.doughnutHoleSize)),!t.isNullOrUndefined(e.dataLabels.labelPosition)){var a=this.writeChartDataLabels(e.dataLabels);r.dataLabel=a}if(!t.isNullOrUndefined(e.seriesFormat.markerStyle)){var l={},d=e.seriesFormat;l.markerStyle=d.markerStyle,l.markerSize=d.numberValue,l.markerColor=d.markerColor,r.seriesFormat=l}if(t.isNullOrUndefined(s.type)||(o.type=s.type,o.direction=s.direction,o.endStyle=s.endStyle,o.numberValue=s.numberValue,r.errorBar=s),e.trendLines.length>0){r.trendLines=[];for(c=0;c<e.trendLines.length;c++){var h=this.writeChartTrendLines(e.trendLines[c]);r.trendLines.push(h)}}for(var c=0;c<e.chartDataFormat.length;c++){d=this.writeChartDataFormat(e.chartDataFormat[c]);r.dataPoints.push(d)}return r},e.prototype.writeChartDataLabels=function(e){var t={};return t.position=e.position,t.fontName=e.fontName,t.fontColor=e.fontColor,t.fontSize=e.fontSize,t.isLegendKey=e.isLegendKey,t.isBubbleSize=e.isBubbleSize,t.isCategoryName=e.isCategoryName,t.isSeriesName=e.isSeriesName,t.isValue=e.isValue,t.isPercentage=e.isPercentage,t.isLeaderLines=e.isLeaderLines,t},e.prototype.writeChartTrendLines=function(e){var t={};return t.name=e.trendLineName,t.type=e.trendLineType,t.forward=e.forwardValue,t.backward=e.backwardValue,t.intercept=e.interceptValue,t.isDisplayEquation=e.isDisplayEquation,t.isDisplayRSquared=e.isDisplayRSquared,t},e.prototype.writeLines=function(e,i,n,r){for(var o=i,s=this.endLine instanceof Te&&this.endLine.paragraph===e,a=s?this.endLine.indexInOwner:e.childWidgets.length-1,l=o;l<=a;l++){var d=e.childWidgets[l];if(this.endLine===d||i===l&&0!==n)this.writeLine(d,this.startLine!==this.endLine&&d!==this.startLine?0:n,r);else{this.writeInlines(e,d,r);for(var h=0;h<e.floatingElements.length;h++){var c=e.floatingElements[h];if(c instanceof Ke){var p=this.writeInline(c);t.isNullOrUndefined(p)||r.push(p)}}}}return s},e.prototype.writeLine=function(e,i,n){this.contentInline=[];var r=!1,o=!1,s=e===this.endLine,a=e.clone(),l=e.paragraph.paragraphFormat.bidi;(l||this.documentHelper.layout.isContainsRtl(a))&&this.documentHelper.layout.reArrangeElementsForRtl(a,l);for(var d=!1,h=!1,c=0,p=0;p<a.children.length;p++){var g=a.children[p];if(!(g instanceof Qe)){var u=void 0;if(c+=g.length,d=c>i,g instanceof Me&&(d||(r=0===g.type),o=!0),g instanceof Oe&&g.hasOwnProperty("contentControlProperties")&&d&&!o&&(r=!0),g instanceof Me&&(r&&1===g.type&&(r=!1),o&&1===g.type&&(o=!1)),h=s&&c>=this.endOffset,d&&!r)if(g instanceof Me&&!t.isNullOrUndefined(g.contentControlProperties)&&"BuildingBlockGallery"!==g.contentControlProperties.type||this.startContent||this.blockContent){if(h){this.startContent=!1;break}this.writeInlinesContentControl(g,e,n,p)}else{if(u=this.writeInline(g),n[n.length]=u,c>i||h){if(u.hasOwnProperty("text")){var m=c-g.length,f=i-m,v=h?this.endOffset-m:g.length;u.text=u.text.substring(f,v)}i=-1}if(!this.isExport&&!u.hasOwnProperty("text")&&this.owner.enableTrackChanges&&!this.isPartialExport){var y=n.length-1;n.splice(y,1)}if(h)break}}}},e.prototype.writeInlinesFootNote=function(e,t,i,n){var r={};r.footnoteType=t.footnoteType,r.characterFormat={},r.characterFormat=this.writeCharacterFormat(t.characterFormat),r.blocks=[];for(var o=0;o<t.blocks.length;o++)this.writeBlock(t.blocks[o],0,r.blocks);return r.symbolCode=t.symbolCode,r.symbolFontName=t.symbolFontName,r.customMarker=t.customMarker,r},e.prototype.writeInlinesContentControl=function(e,i,n,r){if(e instanceof Me&&"Block"===e.contentControlWidgetType)return this.isBlockClosed=!1,this.blockContent&&0===e.type?(this.nestedBlockContent=!0,!0):this.nestedBlockContent&&1===e.type?(this.nestedBlockContent=!1,!0):(this.blockContent=0===e.type,i.children[r-1]instanceof Me&&"Block"===i.children[r-1].contentControlWidgetType&&(this.blockContent=!0),this.blockContent||(this.isBlockClosed=!0),!0);if(e instanceof Me){if(this.startContent&&0===e.type)return this.nestedContent=!0,!0;if(this.startContent&&this.nestedContent){if((a={}).inlines=this.contentInline,this.contentInline.length>0){var o=this.nestedContentProperty(i.children[r+1],a);n.push(o),this.contentInline=[]}return this.multipleLineContent&&(a=n[n.length-1],this.nestedContentProperty(i.children[r+1],a),this.multipleLineContent=!1),this.nestedContent=!1,!0}return this.contentType=e.contentControlWidgetType,this.startContent=0===e.type,!0}if(this.startContent&&"Inline"===this.contentType)if(this.multipleLineContent)this.inlineContentControl(e,i.children[r+1],n),this.contentInline=[];else{var s=this.inlineContentControl(e,i.children[r+1]);if(!t.isNullOrUndefined(s)){if(!this.nestedContent||!this.multipleLineContent)return n.push(s),this.contentInline=[],!1;(a={}).inlines=this.contentInline,n.push(a)}}else{var a=this.writeInline(e);t.isNullOrUndefined(a)||n.push(a)}},e.prototype.createParagraph=function(e){var t={},i=!1;if(!this.documentHelper.selection||this.documentHelper.selection.isEmpty||this.isExport)i=!0;else{var n=this.documentHelper.selection.end;this.documentHelper.selection.isForward||(n=this.documentHelper.selection.start);var r=n.paragraph.childWidgets[n.paragraph.childWidgets.length-1];i=this.documentHelper.selection.isParagraphLastLine(r)&&n.currentWidget===r&&n.offset===this.documentHelper.selection.getLineLength(r)+1}return t.paragraphFormat=this.writeParagraphFormat(i?e.paragraphFormat:new I(e)),t.characterFormat=this.writeCharacterFormat(i?e.characterFormat:new k(e)),t.inlines=[],t},e.prototype.writeCharacterFormat=function(e,t){var i={};return L.writeCharacterFormat(i,t,e),i.boldBidi=t?e.bold:e.getValue("bold"),i.italicBidi=t?e.italic:e.getValue("italic"),i.fontSizeBidi=t?e.fontSize:e.getValue("fontSize"),i.fontFamilyBidi=t?e.fontFamily:e.getValue("fontFamily"),this.writeInlineStyles&&!t&&(i.inlineFormat=this.writeCharacterFormat(e,!0)),i},e.prototype.writeParagraphFormat=function(e,i){var n={};return n.leftIndent=i?e.leftIndent:e.getValue("leftIndent"),n.rightIndent=i?e.rightIndent:e.getValue("rightIndent"),n.firstLineIndent=i?e.firstLineIndent:e.getValue("firstLineIndent"),n.textAlignment=i?e.textAlignment:e.getValue("textAlignment"),n.beforeSpacing=i?e.beforeSpacing:e.getValue("beforeSpacing"),n.afterSpacing=i?e.afterSpacing:e.getValue("afterSpacing"),n.lineSpacing=i?e.lineSpacing:e.getValue("lineSpacing"),n.lineSpacingType=i?e.lineSpacingType:e.getValue("lineSpacingType"),n.styleName=t.isNullOrUndefined(e.baseStyle)?void 0:e.baseStyle.name,n.outlineLevel=i?e.outlineLevel:e.getValue("outlineLevel"),n.listFormat=this.writeListFormat(e.listFormat,i),n.tabs=this.writeTabs(e.tabs),n.bidi=i?e.bidi:e.getValue("bidi"),n.contextualSpacing=i?e.contextualSpacing:e.getValue("contextualSpacing"),this.writeInlineStyles&&!i&&(n.inlineFormat=this.writeParagraphFormat(e,!0)),n},e.prototype.writeTabs=function(e){if(!(t.isNullOrUndefined(e)||e.length<1)){for(var i=[],n=0;n<e.length;n++){var r=e[n],o={};o.position=r.position,o.deletePosition=r.deletePosition,o.tabJustification=r.tabJustification,o.tabLeader=r.tabLeader,i.push(o)}return i}},e.prototype.writeListFormat=function(e,i){var n={},r=e.getValue("listId");t.isNullOrUndefined(r)||(n.listId=r,this.lists.indexOf(e.listId)<0&&this.lists.push(e.listId));var o=e.getValue("listLevelNumber");return t.isNullOrUndefined(o)||(n.listLevelNumber=o),n},e.prototype.writeTable=function(e,t,i,n){var r=e.childWidgets[i];if(!(r instanceof Fe&&this.writeRow(r,t.rows))){var o=e;do{o=(e=o).nextSplitWidget}while(o instanceof ye);return o=e.nextRenderedWidget,o instanceof ye&&o.containerWidget.index===e.containerWidget.index?o:void 0}},e.prototype.writeRow=function(e,i){if(!(e instanceof Fe))return!1;var n=this.createRow(e);i.push(n);for(var r=0;r<e.childWidgets.length;r++){var o=e.childWidgets[r];if(o instanceof Pe&&e.index===o.rowIndex&&(t.isNullOrUndefined(this.startColumnIndex)||o.columnIndex>=this.startColumnIndex)&&(t.isNullOrUndefined(this.endColumnIndex)||o.columnIndex<this.endColumnIndex)&&this.writeCell(o,n.cells))return!0}var s=e;do{(s=(e=s).nextRenderedWidget)&&(e.ownerTable.index!==s.ownerTable.index&&e.ownerTable.bodyWidget.sectionIndex===s.ownerTable.bodyWidget.sectionIndex||e.ownerTable.bodyWidget.sectionIndex!==s.ownerTable.bodyWidget.sectionIndex)&&(s=void 0)}while(s instanceof Fe&&s.index===e.index);return this.writeRow(s,i)},e.prototype.writeCell=function(e,t){var i=this.createCell(e);t.push(i);var n=e.firstChild;do{n=this.writeBlock(n,0,i.blocks)}while(n);return this.endCell instanceof Pe&&this.endCell.cellFormat===e.cellFormat},e.prototype.createTable=function(e){var t={};t.rows=[],t.grid=[];for(var i=0;i<e.tableHolder.columns.length;i++)t.grid[i]=e.tableHolder.columns[i].preferredWidth;return t.tableFormat=this.writeTableFormat(e.tableFormat),t.description=e.description,t.title=e.title,t.columnCount=e.tableHolder.columns.length,this.writeTablePositioning(t,e),t},e.prototype.writeTablePositioning=function(e,i){i.wrapTextAround&&(e.wrapTextAround=i.wrapTextAround,e.positioning={},e.positioning.allowOverlap=i.positioning.allowOverlap,e.positioning.distanceBottom=L.convertPixelToPoint(i.positioning.distanceBottom),e.positioning.distanceLeft=L.convertPixelToPoint(i.positioning.distanceLeft),e.positioning.distanceRight=L.convertPixelToPoint(i.positioning.distanceRight),e.positioning.distanceTop=L.convertPixelToPoint(i.positioning.distanceTop),t.isNullOrUndefined(i.positioning.verticalAlignment)||(e.positioning.verticalAlignment=i.positioning.verticalAlignment),t.isNullOrUndefined(i.positioning.verticalOrigin)||(e.positioning.verticalOrigin=i.positioning.verticalOrigin),e.positioning.verticalPosition=i.positioning.verticalPosition,t.isNullOrUndefined(i.positioning.horizontalAlignment)||(e.positioning.horizontalAlignment=i.positioning.horizontalAlignment),t.isNullOrUndefined(i.positioning.horizontalOrigin)||(e.positioning.horizontalOrigin=i.positioning.horizontalOrigin),e.positioning.horizontalPosition=i.positioning.horizontalPosition)},e.prototype.createRow=function(e){var t={};return t.cells=[],t.rowFormat=this.writeRowFormat(e.rowFormat),e.hasOwnProperty("contentControlProperties")&&(t.contentControlProperties=this.contentControlProperty(e.contentControlProperties)),t},e.prototype.createCell=function(e){var t={};return t.blocks=[],t.cellFormat=this.writeCellFormat(e.cellFormat),t.columnIndex=e.columnIndex,e.hasOwnProperty("contentControlProperties")&&(t.contentControlProperties=this.contentControlProperty(e.contentControlProperties)),t},e.prototype.writeShading=function(e){var t={};return t.backgroundColor=e.hasValue("backgroundColor")?e.backgroundColor:void 0,t.foregroundColor=e.hasValue("foregroundColor")?e.foregroundColor:void 0,t.textureStyle=e.hasValue("textureStyle")?e.textureStyle:void 0,t},e.prototype.writeBorder=function(e){var t={};return t.color=e.hasValue("color")?e.color:void 0,t.hasNoneStyle=e.hasValue("hasNoneStyle")?e.hasNoneStyle:void 0,t.lineStyle=e.hasValue("lineStyle")?e.lineStyle:void 0,t.lineWidth=e.hasValue("lineWidth")?e.lineWidth:void 0,t.shadow=e.hasValue("shadow")?e.shadow:void 0,t.space=e.hasValue("space")?e.space:void 0,t},e.prototype.writeBorders=function(e){var t={};return t.top=this.writeBorder(e.top),t.left=this.writeBorder(e.left),t.right=this.writeBorder(e.right),t.bottom=this.writeBorder(e.bottom),t.diagonalDown=this.writeBorder(e.diagonalDown),t.diagonalUp=this.writeBorder(e.diagonalUp),t.horizontal=this.writeBorder(e.horizontal),t.vertical=this.writeBorder(e.vertical),t},e.prototype.writeCellFormat=function(e){var t={};return t.borders=this.writeBorders(e.borders),t.shading=this.writeShading(e.shading),t.topMargin=e.hasValue("topMargin")?e.topMargin:void 0,t.rightMargin=e.hasValue("rightMargin")?e.rightMargin:void 0,t.leftMargin=e.hasValue("leftMargin")?e.leftMargin:void 0,t.bottomMargin=e.hasValue("bottomMargin")?e.bottomMargin:void 0,t.preferredWidth=e.hasValue("preferredWidth")?e.preferredWidth:void 0,t.preferredWidthType=e.hasValue("preferredWidthType")?e.preferredWidthType:void 0,t.cellWidth=e.hasValue("cellWidth")?e.cellWidth:void 0,t.columnSpan=e.columnSpan,t.rowSpan=e.rowSpan,t.verticalAlignment=e.hasValue("verticalAlignment")?e.verticalAlignment:void 0,t},e.prototype.writeRowFormat=function(e){var t={},i=[];t.height=e.hasValue("height")?e.height:void 0,t.allowBreakAcrossPages=e.hasValue("allowBreakAcrossPages")?e.allowBreakAcrossPages:void 0,t.heightType=e.hasValue("heightType")?e.heightType:void 0,t.isHeader=e.hasValue("isHeader")?e.isHeader:void 0,t.borders=this.writeBorders(e.borders),t.gridBefore=e.gridBefore,t.gridBeforeWidth=e.hasValue("gridBeforeWidth")?e.gridBeforeWidth:void 0,t.gridBeforeWidthType=e.hasValue("gridBeforeWidthType")?e.gridBeforeWidthType:void 0,t.gridAfter=e.gridAfter,t.gridAfterWidth=e.hasValue("gridAfterWidth")?e.gridAfterWidth:void 0,t.gridAfterWidthType=e.hasValue("gridAfterWidthType")?e.gridAfterWidthType:void 0,t.leftMargin=e.hasValue("leftMargin")?e.leftMargin:void 0,t.topMargin=e.hasValue("topMargin")?e.topMargin:void 0,t.rightMargin=e.hasValue("rightMargin")?e.rightMargin:void 0,t.bottomMargin=e.hasValue("bottomMargin")?e.bottomMargin:void 0,t.leftIndent=e.hasValue("leftIndent")?e.leftIndent:void 0;for(var n=0;n<e.revisions.length;n++)t.revisionIds=this.writeRowRevisions(e.revisions[n],i);return t},e.prototype.writeRowRevisions=function(e,t){return-1===this.selectedRevisionId.indexOf(e.revisionID)&&this.selectedRevisionId.push(e.revisionID),t.push(e.revisionID),t},e.prototype.writeTableFormat=function(e){var t={};return t.borders=this.writeBorders(e.borders),t.shading=this.writeShading(e.shading),t.cellSpacing=e.hasValue("cellSpacing")?e.cellSpacing:void 0,t.leftIndent=e.hasValue("leftIndent")?e.leftIndent:void 0,t.tableAlignment=e.hasValue("tableAlignment")?e.tableAlignment:void 0,t.topMargin=e.hasValue("topMargin")?e.topMargin:void 0,t.rightMargin=e.hasValue("rightMargin")?e.rightMargin:void 0,t.leftMargin=e.hasValue("leftMargin")?e.leftMargin:void 0,t.bottomMargin=e.hasValue("bottomMargin")?e.bottomMargin:void 0,t.preferredWidth=e.hasValue("preferredWidth")?e.preferredWidth:void 0,t.preferredWidthType=e.hasValue("preferredWidthType")?e.preferredWidthType:void 0,t.bidi=e.hasValue("bidi")?e.bidi:void 0,t.allowAutoFit=e.hasValue("allowAutoFit")?e.allowAutoFit:void 0,t},e.prototype.footnotes=function(e){for(var t=0;t<e.footnotes.separator.length;t++)this.seprators(e)},e.prototype.seprators=function(e){if(e.footnotes.separator.length>0){this.document.footnotes={},this.document.footnotes.separator=[];for(t=0;t<e.footnotes.separator.length;t++)this.writeBlock(e.footnotes.separator[t],0,this.document.footnotes.separator)}if(e.footnotes.continuationSeparator.length>0){this.document.footnotes.continuationSeparator=[];for(t=0;t<e.footnotes.continuationSeparator.length;t++)this.writeBlock(e.footnotes.continuationSeparator[t],0,this.document.footnotes.continuationSeparator)}if(e.footnotes.continuationNotice.length>0){this.document.footnotes.continuationNotice=[];for(var t=0;t<e.footnotes.continuationNotice.length;t++)this.writeBlock(e.footnotes.continuationNotice[t],0,this.document.footnotes.continuationNotice)}},e.prototype.endnotes=function(e){for(var t=0;t<this.documentHelper.endnotes.separator.length;t++)this.endnoteSeparator(e)},e.prototype.endnoteSeparator=function(e){if(e.endnotes.separator.length>0){this.document.endnotes={},this.document.endnotes.separator=[];for(t=0;t<e.endnotes.separator.length;t++)this.writeBlock(e.endnotes.separator[t],0,this.document.endnotes.separator)}if(e.endnotes.continuationSeparator.length>0){this.document.endnotes.continuationSeparator=[];for(t=0;t<e.endnotes.continuationSeparator.length;t++)this.writeBlock(e.endnotes.continuationSeparator[t],0,this.document.endnotes.continuationSeparator)}if(e.endnotes.continuationNotice.length>0){this.document.endnotes.continuationNotice=[];for(var t=0;t<e.endnotes.continuationNotice.length;t++)this.writeBlock(e.endnotes.continuationNotice[t],0,this.document.endnotes.continuationNotice)}},e.prototype.writeStyles=function(e){this.document.styles=[];for(var t=0;t<e.styles.length;t++)this.document.styles.push(this.writeStyle(e.styles.getItem(t)))},e.prototype.writeStyle=function(e){var i={};return i.name=e.name,"Paragraph"===e.type&&(i.type="Paragraph",i.paragraphFormat=this.writeParagraphFormat(e.paragraphFormat),i.characterFormat=this.writeCharacterFormat(e.characterFormat)),"Character"===e.type&&(i.type="Character",i.characterFormat=this.writeCharacterFormat(e.characterFormat)),t.isNullOrUndefined(e.basedOn)||(i.basedOn=e.basedOn.name),t.isNullOrUndefined(e.link)||(i.link=e.link.name),t.isNullOrUndefined(e.next)||(i.next=e.next.name),i},e.prototype.writeRevisions=function(e){this.document.revisions=[];for(var t=0;t<e.owner.revisions.changes.length;t++)(this.isExport||!this.isExport&&-1!==this.selectedRevisionId.indexOf(e.owner.revisions.changes[t].revisionID))&&this.document.revisions.push(this.writeRevision(e.owner.revisions.changes[t]))},e.prototype.writeRevision=function(e){var t={};return t.author=e.author,t.date=e.date,t.revisionType=e.revisionType,t.revisionId=e.revisionID,t},e.prototype.writeComments=function(e){this.document.comments=[];for(var t=0;t<e.comments.length;t++)(this.isExport||!this.isExport&&-1!==this.selectedCommentsId.indexOf(this.documentHelper.comments[t].commentId))&&this.document.comments.push(this.writeComment(this.documentHelper.comments[t]))},e.prototype.writeCustomXml=function(e){this.document.customXml=[];for(var t=0;t<e.customXmlData.length;t++){var i={},n=e.customXmlData.keys[t];i.itemID=n;var r=this.documentHelper.customXmlData.get(n);i.xml=r,this.document.customXml.push(i)}},e.prototype.writeComment=function(e){var t={};t.commentId=e.commentId,t.author=e.author,t.date=e.date,t.blocks=[],t.blocks.push(this.commentInlines(e.text)),t.done=e.isResolved,t.replyComments=[];for(var i=0;i<e.replyComments.length;i++)t.replyComments.push(this.writeComment(e.replyComments[i]));return t},e.prototype.commentInlines=function(e){var t={};return t.inlines=[{text:e}],t},e.prototype.writeLists=function(e){var t=[];this.document.lists=[];for(n=0;n<e.lists.length;n++){var i=e.lists[n];this.lists.indexOf(i.listId)>-1&&(this.document.lists.push(this.writeList(i)),t.indexOf(i.abstractListId)<0&&t.push(i.abstractListId))}this.document.abstractLists=[];for(var n=0;n<e.abstractLists.length;n++){var r=e.abstractLists[n];t.indexOf(r.abstractListId)>-1&&this.document.abstractLists.push(this.writeAbstractList(r))}},e.prototype.writeAbstractList=function(e){var t={};t.abstractListId=e.abstractListId,t.levels=[];for(var i=0;i<e.levels.length;i++)t.levels[i]=this.writeListLevel(e.levels[i]);return t},e.prototype.writeList=function(e){var t={};t.abstractListId=e.abstractListId,t.levelOverrides=[];for(var i=0;i<e.levelOverrides.length;i++)t.levelOverrides.push(this.writeLevelOverrides(e.levelOverrides[i]));return t.listId=e.listId,t},e.prototype.writeLevelOverrides=function(e){var t={};return t.levelNumber=e.levelNumber,e.overrideListLevel&&(t.overrideListLevel=this.writeListLevel(e.overrideListLevel)),t.startAt=e.startAt,t},e.prototype.writeListLevel=function(e){var t={};return t.characterFormat=this.writeCharacterFormat(e.characterFormat),t.paragraphFormat=this.writeParagraphFormat(e.paragraphFormat),t.followCharacter=e.followCharacter,t.listLevelPattern=e.listLevelPattern,t.numberFormat=e.numberFormat,t.restartLevel=e.restartLevel,t.startAt=e.startAt,t},e.prototype.getParentBlock=function(e){return e.isInsideTable&&(e=this.owner.documentHelper.layout.getParentTable(e)),e},e.prototype.destroy=function(){this.lists=void 0,this.endLine=void 0,this.startLine=void 0,this.endOffset=void 0,this.documentHelper=void 0},e}(),pi=function(){function e(e){var i=this;this.displayText="",this.navigationUrl=void 0,this.bookmarkDropdown=void 0,this.bookmarkCheckbox=void 0,this.bookmarks=[],this.onKeyUpOnUrlBox=function(e){if(13===e.keyCode)return void(""!==i.displayTextBox.value&&""!==i.urlTextBox.value&&i.onInsertHyperlink());var t=i.urlTextBox.value;"www."===t.substring(0,4).toLowerCase()&&(i.urlTextBox.value="http://"+t),""===i.displayText&&(i.displayTextBox.value=t),i.enableOrDisableInsertButton()},this.onKeyUpOnDisplayBox=function(){i.displayText=i.displayTextBox.value,i.enableOrDisableInsertButton()},this.onInsertButtonClick=function(){i.onInsertHyperlink()},this.onCancelButtonClick=function(){i.documentHelper.dialog.hide(),i.clearValue(),i.documentHelper.updateFocus()},this.loadHyperlinkDialog=function(){i.documentHelper.updateFocus(),i.bookmarks=[];for(var e=0;e<i.documentHelper.bookmarks.keys.length;e++){var n=i.documentHelper.bookmarks.keys[e];0!==n.indexOf("_")&&i.bookmarks.push(n)}var r=i.documentHelper.selection.getHyperlinkField();if(t.isNullOrUndefined(r))i.displayText=i.documentHelper.selection.getText(!0),""!==i.displayText&&(-1!==i.displayText.indexOf(String.fromCharCode(65532))||-1!==i.displayText.indexOf("\r")&&-1!==i.displayText.lastIndexOf("\r")&&-1!==i.displayText.slice(0,-1).indexOf("\r")?(i.displayTextBox.value="<<Selection in document>>",i.displayTextBox.disabled=!0):i.displayTextBox.value=i.displayText);else{if(!t.isNullOrUndefined(r.fieldSeparator)){var o=i.documentHelper.selection.getHyperlinkDisplayText(r.fieldSeparator.line.paragraph,r.fieldSeparator,r.fieldEnd,!1,void 0);i.displayText=o.displayText,i.displayTextBox.disabled=o.isNestedField}i.displayTextBox.value=i.displayText;var s=i.documentHelper.selection.getLinkText(r);i.urlTextBox.value=i.navigationUrl=s,i.documentHelper.dialog.header=i.localObj.getConstant("Edit Hyperlink")}i.bookmarkDiv.style.display="none",i.addressText.style.display="block",i.urlTextBox.style.display="block",i.bookmarkCheckbox.checked=!1,i.bookmarkDropdown.dataSource=i.documentHelper.bookmarks.keys,i.insertButton=document.getElementsByClassName("e-hyper-insert")[0],i.enableOrDisableInsertButton(),i.urlTextBox.focus(),"none"!==i.documentHelper.selection.caret.style.display&&(i.documentHelper.selection.caret.style.display="none")},this.closeHyperlinkDialog=function(){i.clearValue(),i.documentHelper.updateFocus()},this.onUseBookmarkChange=function(e){e.checked?(i.bookmarkDiv.style.display="block",i.bookmarkDropdown.dataSource=i.bookmarks,i.addressText.style.display="none",i.urlTextBox.style.display="none"):(i.bookmarkDiv.style.display="none",i.addressText.style.display="block",i.urlTextBox.style.display="block")},this.onBookmarkchange=function(){""!==i.bookmarkDropdown.value&&(i.insertButton.disabled=!1)},this.documentHelper=e}return e.prototype.getModuleName=function(){return"HyperlinkDialog"},e.prototype.initHyperlinkDialog=function(e,i){var n=this.documentHelper.owner.containerId+"_insert_hyperlink";this.target=t.createElement("div",{id:n,className:"e-de-hyperlink"});var o=t.createElement("div"),a=t.createElement("div",{className:"e-de-hyperlink-dlg-title",innerHTML:e.getConstant("Text to display")});this.displayTextBox=t.createElement("input",{id:this.documentHelper.owner.containerId+"_display_text",className:"e-input e-de-hyperlink-dlg-input"}),this.displayTextBox.addEventListener("keyup",this.onKeyUpOnDisplayBox),o.appendChild(a),o.appendChild(this.displayTextBox),this.addressText=t.createElement("div",{className:"e-de-hyperlink-dlg-title",innerHTML:e.getConstant("Address")}),this.urlTextBox=t.createElement("input",{id:this.documentHelper.owner.containerId+"_url_text",className:"e-input e-de-hyperlink-dlg-input",attrs:{autofocus:"true"}}),this.urlTextBox.addEventListener("input",this.onKeyUpOnUrlBox),this.urlTextBox.addEventListener("keyup",this.onKeyUpOnUrlBox),o.appendChild(this.addressText),o.appendChild(this.urlTextBox),this.bookmarkDiv=t.createElement("div",{styles:"display:none;"});var l=t.createElement("div",{className:"e-de-hyperlink-dlg-title",innerHTML:e.getConstant("Bookmark")}),d=t.createElement("div",{className:"e-de-hyperlink-dlg-bookmark"}),h=t.createElement("input",{id:"e-de-hyperlink-dlg-bookmark-value"});d.appendChild(h),this.bookmarkDropdown=new s.DropDownList({dataSource:[],change:this.onBookmarkchange,popupHeight:"230px",width:"230px",noRecordsTemplate:e.getConstant("No bookmarks found")}),this.bookmarkDropdown.appendTo(h),this.bookmarkDiv.appendChild(l),this.bookmarkDiv.appendChild(d),o.appendChild(this.bookmarkDiv);var c=t.createElement("div",{className:"e-de-hyperlink-bookmark-check e-de-hyperlink-dlg-title"}),p=t.createElement("input",{attrs:{type:"checkbox"},id:this.target.id+"_bookmark",className:this.target.id+"_bookmarkcheck"});c.appendChild(p),this.bookmarkCheckbox=new r.CheckBox({label:e.getConstant("Use bookmarks"),enableRtl:i,change:this.onUseBookmarkChange}),this.bookmarkCheckbox.appendTo(p),o.appendChild(c),this.target.appendChild(o)},e.prototype.show=function(){this.localObj=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale),this.localObj.setLocale(this.documentHelper.owner.locale),this.target||this.initHyperlinkDialog(this.localObj,this.documentHelper.owner.enableRtl),this.documentHelper.dialog.header=this.localObj.getConstant("Insert Hyperlink"),this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.buttons=[{click:this.onInsertButtonClick,buttonModel:{content:this.localObj.getConstant("Ok"),cssClass:"e-flat e-hyper-insert",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:this.localObj.getConstant("Cancel"),cssClass:"e-flat e-hyper-cancel"}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.beforeOpen=this.loadHyperlinkDialog,this.documentHelper.dialog.close=this.closeHyperlinkDialog,this.documentHelper.dialog.show()},e.prototype.hide=function(){this.closeHyperlinkDialog()},e.prototype.enableOrDisableInsertButton=function(){t.isNullOrUndefined(this.insertButton)||(this.insertButton.disabled=""===this.urlTextBox.value||""===this.displayTextBox.value)},e.prototype.onInsertHyperlink=function(){var e=this.displayTextBox.value.trim(),i=this.urlTextBox.value.trim(),n=!1;if(t.isNullOrUndefined(this.bookmarkDropdown.value)||""===this.bookmarkDropdown.value||(i=this.bookmarkDropdown.value,n=!0),""===i)return void this.documentHelper.hideDialog();if(e=""===e&&""!==i?i:this.displayTextBox.value,t.isNullOrUndefined(this.navigationUrl)){var r=(this.documentHelper.selection.text!==e||-1===this.documentHelper.selection.text.indexOf("\r"))&&!this.displayTextBox.disabled;this.documentHelper.owner.editorModule.insertHyperlinkInternal(i,e,r,n)}else this.documentHelper.owner.editorModule.editHyperlink(this.documentHelper.selection,i,e,n);this.documentHelper.hideDialog(),this.navigationUrl=void 0},e.prototype.clearValue=function(){this.displayTextBox.value="",this.urlTextBox.value="",this.displayText="",this.displayTextBox.disabled=!1,this.bookmarks=[]},e.prototype.destroy=function(){this.displayTextBox&&(this.displayTextBox.innerHTML="",this.displayTextBox=void 0),this.urlTextBox&&(this.urlTextBox.parentElement.removeChild(this.urlTextBox),this.urlTextBox=void 0),this.documentHelper=void 0,t.isNullOrUndefined(this.target)||(this.target.parentElement&&this.target.parentElement.removeChild(this.target),this.target.innerHTML="",this.target=void 0)},e}(),gi=function(){function e(e){var i=this;this.keyUpInsertTable=function(e){13===e.keyCode&&""!==i.rowsCountBox.value&&""!==i.columnsCountBox.value&&i.onInsertTableClick()},this.onCancelButtonClick=function(){i.documentHelper.dialog.hide(),i.documentHelper.updateFocus()},this.onInsertTableClick=function(){var e=i.rowValueTextBox.value,n=i.columnValueTexBox.value;t.isNullOrUndefined(e)&&t.isNullOrUndefined(n)||i.documentHelper.owner.editor.insertTable(e,n),i.documentHelper.hideDialog()},this.documentHelper=e}return e.prototype.getModuleName=function(){return"TableDialog"},e.prototype.initTableDialog=function(e){var i=this.documentHelper.owner.containerId+"_insert_Table";this.target=t.createElement("div",{id:i,className:"e-de-insert-table"});var n=t.createElement("div"),r=t.createElement("div",{className:"e-de-insert-table-dlg-sub-header",innerHTML:e.getConstant("Number of columns")}),o=t.createElement("div",{className:"e-de-insert-table-dlg-input"});this.columnsCountBox=t.createElement("input",{attrs:{type:"text"},id:this.documentHelper.owner.containerId+"_column"}),o.appendChild(this.columnsCountBox);var s=t.createElement("div",{className:"e-de-insert-table-dlg-sub-header",innerHTML:e.getConstant("Number of rows")}),l=t.createElement("div");this.rowsCountBox=t.createElement("input",{attrs:{type:"text"},id:this.documentHelper.owner.containerId+"row"}),l.appendChild(this.rowsCountBox),n.appendChild(r),n.appendChild(o),n.appendChild(s),n.appendChild(l),this.target.appendChild(n),this.columnsCountBox.addEventListener("keyup",this.keyUpInsertTable),this.rowsCountBox.addEventListener("keyup",this.keyUpInsertTable),this.rowValueTextBox=new a.NumericTextBox({format:"#",value:2,min:1,max:32767,enablePersistence:!1}),this.rowValueTextBox.appendTo(this.rowsCountBox),this.columnValueTexBox=new a.NumericTextBox({format:"#",value:2,min:1,max:63,enablePersistence:!1}),this.columnValueTexBox.appendTo(this.columnsCountBox)},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initTableDialog(e),"none"!==this.documentHelper.selection.caret.style.display&&(this.documentHelper.selection.caret.style.display="none"),this.documentHelper.dialog.header=e.getConstant("Insert Table"),this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.beforeOpen=this.documentHelper.updateFocus,this.documentHelper.dialog.buttons=[{click:this.onInsertTableClick,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-table-ok",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-table-cancel"}}],this.rowValueTextBox.value=2,this.columnValueTexBox.value=2,this.documentHelper.dialog.close=this.documentHelper.updateFocus,this.documentHelper.dialog.dataBind(),this.columnValueTexBox.focusIn(),this.documentHelper.dialog.show()},e.prototype.destroy=function(){if(this.columnsCountBox&&(this.columnsCountBox.parentElement&&this.columnsCountBox.parentElement.removeChild(this.columnsCountBox),this.columnsCountBox=void 0),this.rowsCountBox&&(this.rowsCountBox.parentElement&&this.rowsCountBox.parentElement.removeChild(this.rowsCountBox),this.rowsCountBox=void 0),this.columnValueTexBox&&(this.columnValueTexBox.destroy(),this.columnValueTexBox=void 0),this.rowValueTextBox&&(this.rowValueTextBox.destroy(),this.rowValueTextBox=void 0),this.columnsCountBox=void 0,this.rowsCountBox=void 0,this.documentHelper=void 0,!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}},e}(),ui=function(){function e(e){var t=this;this.onKeyUpOnTextBox=function(){t.enableOrDisableButton()},this.addBookmark=function(){t.documentHelper.owner.editorModule.insertBookmark(t.textBoxInput.value),t.documentHelper.hideDialog()},this.selectHandler=function(e){t.focusTextBox(e.text)},this.gotoBookmark=function(){t.documentHelper.selection.selectBookmark(t.textBoxInput.value)},this.deleteBookmark=function(){t.documentHelper.owner.editorModule.deleteBookmark(t.textBoxInput.value),t.show()},this.documentHelper=e}return e.prototype.getModuleName=function(){return"BookmarkDialog"},e.prototype.initBookmarkDialog=function(e,i,n){var s=this.documentHelper.owner.containerId+"_insert_bookmark";this.target=t.createElement("div",{id:s,className:"e-de-bookmark"});var a=e.getConstant("Bookmark name")+":",l=t.createElement("div",{innerHTML:a,className:"e-bookmark-dlgfields"});this.target.appendChild(l);var d=t.createElement("div",{className:"e-bookmark-common"});this.target.appendChild(d);var h=t.createElement("div",{className:"e-bookmark-list"});d.appendChild(h),n&&h.classList.add("e-de-rtl");var c=t.createElement("div",{className:"e-bookmark-textboxdiv"});h.appendChild(c),this.textBoxInput=t.createElement("input",{className:"e-input e-bookmark-textbox-input",id:"bookmark_text_box",attrs:{autofocus:"true"}}),this.textBoxInput.setAttribute("type","text"),c.appendChild(this.textBoxInput);var p=t.createElement("div",{className:"e-bookmark-listViewDiv",id:"bookmark_listview"});h.appendChild(p),this.listviewInstance=new o.ListView({dataSource:i,cssClass:"e-bookmark-listview"});var g=void 0===i||0===i.length;this.listviewInstance.appendTo(p),this.listviewInstance.addEventListener("select",this.selectHandler);var u=t.createElement("div",{className:"e-bookmark-button"});d.appendChild(u);var m=t.createElement("div",{className:"e-bookmark-addbutton"});u.appendChild(m);var f=t.createElement("button",{innerHTML:e.getConstant("Add"),id:"add",attrs:{type:"button"}});m.appendChild(f),this.addButton=new r.Button({cssClass:"e-button-custom"}),this.addButton.disabled=!0,this.addButton.appendTo(f),this.textBoxInput.addEventListener("input",this.onKeyUpOnTextBox),this.textBoxInput.addEventListener("keyup",this.onKeyUpOnTextBox),f.addEventListener("click",this.addBookmark);var v=t.createElement("div",{className:"e-bookmark-deletebutton"});u.appendChild(v);var y=t.createElement("button",{innerHTML:e.getConstant("Delete"),id:"delete",attrs:{type:"button"}});v.appendChild(y),this.deleteButton=new r.Button({cssClass:"e-button-custom"}),this.deleteButton.disabled=g,this.deleteButton.appendTo(y),y.addEventListener("click",this.deleteBookmark);var b=t.createElement("div",{className:"e-bookmark-gotobutton"});u.appendChild(b);var w=t.createElement("button",{innerHTML:e.getConstant("Go To"),id:"goto",attrs:{type:"button"}});b.appendChild(w),this.gotoButton=new r.Button({cssClass:"e-button-custom"}),this.gotoButton.disabled=g,this.gotoButton.appendTo(w),w.addEventListener("click",this.gotoBookmark)},e.prototype.show=function(){var e=this.documentHelper.getBookmarks(),i=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);if(i.setLocale(this.documentHelper.owner.locale),this.initBookmarkDialog(i,e,this.documentHelper.owner.enableRtl),this.documentHelper.dialog.header=i.getConstant("Bookmark"),this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.beforeOpen=this.documentHelper.updateFocus,this.documentHelper.dialog.close=this.documentHelper.updateFocus,this.documentHelper.dialog.buttons=[{click:this.removeObjects.bind(this),buttonModel:{content:i.getConstant("Cancel"),cssClass:"e-flat e-hyper-insert",isPrimary:!0}}],this.documentHelper.dialog.dataBind(),!(void 0===e||0===e.length)){var n=e[0];this.listviewInstance.selectItem(n)}this.documentHelper.dialog.show()},e.prototype.enableOrDisableButton=function(){t.isNullOrUndefined(this.addButton)||(this.addButton.disabled=""===this.textBoxInput.value)},e.prototype.focusTextBox=function(e){this.textBoxInput.value=e;var t=document.getElementById("bookmark_text_box");t.setSelectionRange(0,e.length),t.focus(),this.enableOrDisableButton()},e.prototype.removeObjects=function(){this.documentHelper.hideDialog()},e.prototype.destroy=function(){this.textBoxInput&&(this.textBoxInput.remove(),this.textBoxInput=void 0),this.listviewInstance&&(this.listviewInstance.destroy(),this.listviewInstance=void 0)},e}(),mi=function(){function e(e){var i=this;this.loadTableofContentDialog=function(){i.documentHelper.updateFocus(),i.pageNumber.checked=!0,i.rightAlign.disabled=!1,i.rightAlign.checked=!0,i.tabLeader.enabled=!0,i.hyperlink.checked=!0,i.style.checked=!0,i.outline.checked=!0,i.outline.disabled=!1,i.showLevel.enabled=!0},this.closeTableOfContentDialog=function(){i.unWireEventsAndBindings(),i.documentHelper.updateFocus()},this.onCancelButtonClick=function(){i.documentHelper.dialog3.hide(),i.unWireEventsAndBindings(),i.documentHelper.updateFocus()},this.selectHandler=function(e){i.textBoxInput.value=e.text;var t=document.getElementById("toclist");t.setSelectionRange(0,e.text.length),t.focus()},this.showStyleDialog=function(){t.isNullOrUndefined(i.documentHelper.owner.styleDialogModule)||i.documentHelper.owner.styleDialogModule.show(i.textBoxInput.value)},this.reset=function(){i.showLevel.enabled=!0,i.showLevel.value=3,i.outline.disabled=!1,i.outline.checked=!0;var e=["1","2","3",null,null,null,null,null,null];i.changeByValue(e),i.normal.value=null},this.changeStyle=function(e){var t=e.srcElement.value;t!==i.getElementValue(e.srcElement)&&""!==t?i.showLevel.enabled=!1:(i.showLevel.enabled=!0,i.checkLevel())},this.changeHeadingStyle=function(e){var t=e.srcElement.value;i.showLevel.enabled=""===t,i.normal===e.srcElement&&(i.outline.checked=!1,i.outline.disabled=!0)},this.changePageNumberValue=function(e){e.checked?(i.rightAlign.checked=!0,i.rightAlign.disabled=!1,i.tabLeader.enabled=!0):(i.rightAlign.disabled=!0,i.tabLeader.enabled=!1)},this.changeRightAlignValue=function(e){e.checked?i.tabLeader.enabled=!0:i.tabLeader.enabled=!1},this.changeStyleValue=function(e){e.checked?(i.heading1.disabled=!1,i.heading2.disabled=!1,i.heading3.disabled=!1,i.heading4.disabled=!1,i.heading5.disabled=!1,i.heading6.disabled=!1,i.heading7.disabled=!1,i.heading8.disabled=!1,i.heading9.disabled=!1,i.normal.disabled=!1):(i.heading1.disabled=!0,i.heading2.disabled=!0,i.heading3.disabled=!0,i.heading4.disabled=!0,i.heading5.disabled=!0,i.heading6.disabled=!0,i.heading7.disabled=!0,i.heading8.disabled=!0,i.heading9.disabled=!0,i.normal.disabled=!0)},this.applyTableOfContentProperties=function(){var e={startLevel:1,endLevel:i.showLevel.value,includeHyperlink:i.hyperlink.checked,includePageNumber:i.pageNumber.checked,rightAlign:i.rightAlign.checked,tabLeader:i.tabLeader.value,includeOutlineLevels:i.outline.checked};i.applyLevelSetting(e),i.documentHelper.owner.editorModule.insertTableOfContents(e),i.documentHelper.dialog3.hide(),i.documentHelper.updateFocus()},this.unWireEventsAndBindings=function(){i.pageNumber.checked=!1,i.rightAlign.checked=!1,i.tabLeader.value="",i.hyperlink.checked=!1,i.style.checked=!1,i.outline.checked=!1,i.normal.value=""},this.documentHelper=e}return e.prototype.getModuleName=function(){return"TableOfContentsDialog"},e.prototype.initTableOfContentDialog=function(e,i){var n=this.documentHelper.owner.containerId,l=n+"_toc_dialog";this.target=t.createElement("div",{id:l,className:"e-de-toc-dlg-container"});var d=t.createElement("div",{id:"general_div",className:"e-de-toc-dlg-sub-container"});this.target.appendChild(d);var h=t.createElement("div",{id:n+"_genLabel",className:"e-de-toc-dlg-main-heading",styles:"margin-bottom: 13px;",innerHTML:e.getConstant("General")});d.appendChild(h);var c,p;i?(c="float:right;",p="float:left;position:relative;"):(c="float:left;",p="float:right;");var g=t.createElement("div",{id:"general_top_container",styles:"display:inline-flex"}),u=t.createElement("div",{id:"left_general",styles:c+"position:relative;"});g.appendChild(u);var m=t.createElement("div",{className:"e-de-toc-dlg-right-general-div"});g.appendChild(m),d.appendChild(g);var f=t.createElement("div",{id:"general_bottom_container",styles:"display:inline-flex"}),v=t.createElement("div",{id:"leftBottom_general",styles:"float:left;"});f.appendChild(v);var y=t.createElement("div",{className:"e-de-toc-dlg-right-sub-container",styles:p});f.appendChild(y),d.appendChild(f);var b=t.createElement("div",{id:"pageNumber_div",className:"e-de-toc-dlg-sub-container"}),w=t.createElement("input",{attrs:{type:"checkbox"},id:this.target.id+"_pageNumber"});b.appendChild(w);var C=t.createElement("div",{id:"rightAlign_div",className:"e-de-toc-dlg-sub-container"}),x=t.createElement("input",{attrs:{type:"checkbox"},id:this.target.id+"_rightAlign"});C.appendChild(x),this.pageNumber=new r.CheckBox({label:e.getConstant("Show page numbers"),enableRtl:i,checked:!0,change:this.changePageNumberValue}),this.rightAlign=new r.CheckBox({label:e.getConstant("Right align page numbers"),enableRtl:i,checked:!0,change:this.changeRightAlignValue}),this.pageNumber.appendTo(w),this.rightAlign.appendTo(x);var F=t.createElement("div",{id:"tab_div",className:"e-de-toc-dlg-tab-div"}),P=t.createElement("div",{id:"tabLeaderLabel_div"}),T=t.createElement("label",{id:n+"_tabLeaderLabel",className:"e-de-toc-dlg-heading",innerHTML:e.getConstant("Tab leader")+":"});P.appendChild(T);var S=t.createElement("div",{id:"tabLeader_div"}),I=t.createElement("select",{id:n+"_tabLeader",innerHTML:'<option value="None">('+e.getConstant("None").toLocaleLowerCase()+')</option><option value="Dot" selected>....................</option><option value="Hyphen">-------------------</option><option value="Underscore">____________</option>'});S.appendChild(I),F.appendChild(P),F.appendChild(S),u.appendChild(b),u.appendChild(C),u.appendChild(F),this.tabLeader=new s.DropDownList({width:210,enableRtl:i}),this.tabLeader.appendTo(I);var N=t.createElement("input",{attrs:{type:"checkbox"},id:this.target.id+"_hyperlink"});m.appendChild(N),this.hyperlink=new r.CheckBox({label:e.getConstant("Use hyperlinks instead of page numbers"),cssClass:"e-de-toc-label",enableRtl:i,checked:!0}),this.hyperlink.appendTo(N);var E=t.createElement("div",{id:"show_div",className:"e-de-toc-dlg-style-label"}),H=t.createElement("div",{id:"showLevelLabel_div",className:"e-de-toc-dlg-show-level-div"}),W=t.createElement("label",{id:n+"_showLevelLabel",className:"e-de-toc-dlg-heading",innerHTML:e.getConstant("Show levels")+":"});H.appendChild(W);var O=t.createElement("div",{id:"showLevel_div",className:"e-de-toc-dlg-showlevel-div"}),k=t.createElement("input",{id:n+"_showLevel",attrs:{type:"text"}});O.appendChild(k),E.appendChild(H),E.appendChild(O),m.appendChild(E),this.showLevel=new a.NumericTextBox({format:"#",value:3,min:1,max:9,width:210,change:this.changeShowLevelValue.bind(this)}),this.showLevel.appendTo(k),i&&(this.hyperlink.cssClass="e-de-toc-label-rtl",H.classList.add("e-de-rtl"),O.classList.add("e-de-rtl"),y.classList.add("e-de-rtl"));var L=t.createElement("div",{id:"buildTable_div",className:"e-de-toc-dlg-sub-container"}),R=t.createElement("div",{id:n+"_buildTableLabel",className:"e-de-toc-dlg-main-heading e-de-toc-dlg-build-table",styles:"margin-bottom: 13px;",innerHTML:e.getConstant("Build table of contents from")+":"});v.appendChild(L),v.appendChild(R);var B=t.createElement("input",{attrs:{type:"checkbox"},id:this.target.id+"_style"});v.appendChild(B),this.style=new r.CheckBox({label:e.getConstant("Styles"),enableRtl:i,checked:!0,change:this.changeStyleValue}),this.style.appendTo(B);var D=t.createElement("TABLE",{styles:"margin-top:3px;"}),A=t.createElement("tr"),M=t.createElement("td",{styles:"width:120px;padding-left:10px;"}),U=t.createElement("label",{innerHTML:e.getConstant("Available styles"),className:"e-de-toc-dlg-main-heading e-de-toc-dlg-sub-level-heading",id:this.target.id+"_availableLabel"});M.appendChild(U);var z=t.createElement("td"),V=t.createElement("label",{innerHTML:e.getConstant("TOC level")+":",className:"e-de-toc-dlg-main-heading e-de-toc-dlg-sub-level-heading",id:this.target.id+"_tocLabel"});z.appendChild(V),A.appendChild(M),A.appendChild(z),D.appendChild(A);var _=t.createElement("div",{id:"table_div",className:"e-de-toc-table-div"}),j=t.createElement("TABLE"),q=t.createElement("tr"),G=t.createElement("td"),K=t.createElement("label",{innerHTML:e.getConstant("Heading")+" 1",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading1Label"});G.appendChild(K);var X=t.createElement("td");this.heading1=t.createElement("input",{id:"_heading1",className:"e-input e-de-toc-dlg-toc-level"}),this.heading1.value="1",this.heading1.addEventListener("keyup",this.changeStyle),X.appendChild(this.heading1),q.appendChild(G),q.appendChild(X);var Y=t.createElement("tr"),J=t.createElement("td"),Z=t.createElement("label",{innerHTML:e.getConstant("Heading")+" 2",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading2Label"});J.appendChild(Z);var Q=t.createElement("td");this.heading2=t.createElement("input",{id:"_heading2",className:"e-input e-de-toc-dlg-toc-level"}),this.heading2.value="2",this.heading2.addEventListener("keyup",this.changeStyle),Q.appendChild(this.heading2),Y.appendChild(J),Y.appendChild(Q);var $=t.createElement("tr"),ee=t.createElement("td"),te=t.createElement("label",{innerHTML:e.getConstant("Heading")+" 3",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading3Label"});ee.appendChild(te);var ie=t.createElement("td");this.heading3=t.createElement("input",{id:"_heading3",className:"e-input e-de-toc-dlg-toc-level"}),this.heading3.value="3",this.heading3.addEventListener("keyup",this.changeStyle),ie.appendChild(this.heading3),$.appendChild(ee),$.appendChild(ie);var ne=t.createElement("tr"),re=t.createElement("td"),oe=t.createElement("label",{innerHTML:e.getConstant("Heading")+" 4",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading4Label"});re.appendChild(oe);var se=t.createElement("td");this.heading4=t.createElement("input",{id:"_heading4",className:"e-input e-de-toc-dlg-toc-level"}),this.heading4.addEventListener("keyup",this.changeStyle),se.appendChild(this.heading4),ne.appendChild(re),ne.appendChild(se);var ae=t.createElement("tr"),le=t.createElement("td"),de=t.createElement("label",{innerHTML:e.getConstant("Heading")+" 5",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading5Label"});le.appendChild(de);var he=t.createElement("td");this.heading5=t.createElement("input",{id:"_heading5",className:"e-input e-de-toc-dlg-toc-level"}),this.heading5.addEventListener("keyup",this.changeStyle),he.appendChild(this.heading5),ae.appendChild(le),ae.appendChild(he);var ce=t.createElement("tr"),pe=t.createElement("td"),ge=t.createElement("label",{innerHTML:e.getConstant("Heading")+" 6",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading6Label"});pe.appendChild(ge);var ue=t.createElement("td");this.heading6=t.createElement("input",{id:"_heading6",className:"e-input e-de-toc-dlg-toc-level"}),this.heading6.addEventListener("keyup",this.changeStyle),ue.appendChild(this.heading6),ce.appendChild(pe),ce.appendChild(ue);var me=t.createElement("tr"),fe=t.createElement("td"),ve=t.createElement("label",{innerHTML:e.getConstant("Heading")+" 7",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading7Label"});fe.appendChild(ve);var ye=t.createElement("td");this.heading7=t.createElement("input",{id:"_heading7",className:"e-input e-de-toc-dlg-toc-level"}),this.heading7.addEventListener("keyup",this.changeStyle),ye.appendChild(this.heading7),me.appendChild(fe),me.appendChild(ye);var be=t.createElement("tr"),we=t.createElement("td"),Ce=t.createElement("label",{innerHTML:e.getConstant("Heading")+" 8",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading8Label"});we.appendChild(Ce);var xe=t.createElement("td");this.heading8=t.createElement("input",{id:"_heading8",className:"e-input e-de-toc-dlg-toc-level"}),this.heading8.addEventListener("keyup",this.changeStyle),xe.appendChild(this.heading8),be.appendChild(we),be.appendChild(xe);var Fe=t.createElement("tr"),Pe=t.createElement("td"),Te=t.createElement("label",{innerHTML:e.getConstant("Heading")+" 9",className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_heading9Label"});Pe.appendChild(Te);var Se=t.createElement("td");this.heading9=t.createElement("input",{id:"_heading9",className:"e-input e-de-toc-dlg-toc-level"}),this.heading9.addEventListener("keyup",this.changeStyle),Se.appendChild(this.heading9),Fe.appendChild(Pe),Fe.appendChild(Se);var Ie=t.createElement("tr"),Ne=t.createElement("td"),Ee=t.createElement("label",{innerHTML:e.getConstant("Normal"),className:"e-de-toc-dlg-sub-heading",id:this.target.id+"_normalLabel"});Ne.appendChild(Ee);var He=t.createElement("td");this.normal=t.createElement("input",{id:"_normal",className:"e-input e-de-toc-dlg-toc-level"}),this.normal.addEventListener("keyup",this.changeHeadingStyle),He.appendChild(this.normal),Ie.appendChild(Ne),Ie.appendChild(He),i&&(this.normal.classList.add("e-de-rtl"),this.heading1.classList.add("e-de-rtl"),this.heading2.classList.add("e-de-rtl"),this.heading3.classList.add("e-de-rtl"),this.heading4.classList.add("e-de-rtl"),this.heading5.classList.add("e-de-rtl"),this.heading6.classList.add("e-de-rtl"),this.heading7.classList.add("e-de-rtl"),this.heading8.classList.add("e-de-rtl"),this.heading9.classList.add("e-de-rtl")),j.appendChild(q),j.appendChild(Y),j.appendChild($),j.appendChild(ne),j.appendChild(ae),j.appendChild(ce),j.appendChild(me),j.appendChild(be),j.appendChild(Fe),j.appendChild(Ie),_.appendChild(j);var We=t.createElement("div",{className:"e-de-toc-styles-table-div"});We.appendChild(D),We.appendChild(_),v.appendChild(We);var Oe=t.createElement("div",{id:"fields_div",styles:"display: flex;"});v.appendChild(Oe);var ke=t.createElement("div",{id:"out_div"}),Le=t.createElement("div",{id:"outline_div",className:"e-de-toc-dlg-sub-container e-de-toc-dlg-outline-levels"}),Re=t.createElement("input",{attrs:{type:"checkbox"},id:"_outline"});Le.appendChild(Re),ke.appendChild(Le),Oe.appendChild(ke),this.outline=new r.CheckBox({label:e.getConstant("Outline levels"),enableRtl:i,checked:!0,cssClass:"e-de-outline-rtl"}),this.outline.appendTo(Re);var Be=t.createElement("div",{className:"e-de-toc-reset-button"});Oe.appendChild(Be);var De=t.createElement("button",{innerHTML:e.getConstant("Reset"),id:"reset",attrs:{type:"button"}});Be.appendChild(De),new r.Button({cssClass:"e-btn e-flat"}).appendTo(De),De.addEventListener("click",this.reset);var Ae=t.createElement("div",{id:"tocStyles_div",className:"e-de-toc-dlg-sub-container"}),Me=t.createElement("div",{id:n+"_tocStylesLabel",className:"e-de-toc-dlg-main-heading e-de-toc-dlg-styles",innerHTML:e.getConstant("Styles")+":"});y.appendChild(Ae),y.appendChild(Me);var Ue=t.createElement("div",{className:"e-de-toc-dlg-style-input"});y.appendChild(Ue),this.textBoxInput=t.createElement("input",{className:"e-input",id:"toclist"}),this.textBoxInput.setAttribute("type","text"),Ue.appendChild(this.textBoxInput);var ze=t.createElement("div",{className:"e-de-toc-list-view"}),Ve=["TOC 1","TOC 2","TOC 3","TOC 4","TOC 5","TOC 6","TOC 7","TOC 8","TOC 9"],_e=this.styleLocaleValue(Ve,e);this.listViewInstance=new o.ListView({dataSource:_e,cssClass:"e-toc-list-view"}),this.listViewInstance.appendTo(ze),this.listViewInstance.addEventListener("select",this.selectHandler),y.appendChild(ze);var je=t.createElement("div",{className:"e-de-toc-modify-button"});y.appendChild(je);var qe=t.createElement("button",{innerHTML:e.getConstant("Modify")+"...",id:"modify",attrs:{type:"button"}});je.appendChild(qe),new r.Button({cssClass:"e-btn e-flat"}).appendTo(qe),qe.addEventListener("click",this.showStyleDialog),i&&(Be.classList.add("e-de-rtl"),Me.classList.add("e-de-rtl"),Ue.classList.add("e-de-rtl"),ze.classList.add("e-de-rtl"),je.classList.add("e-de-rtl"))},e.prototype.styleLocaleValue=function(e,t){for(var i=[],n=0;n<e.length;n++)i.push(t.getConstant(e[n]));return i},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initTableOfContentDialog(e,this.documentHelper.owner.enableRtl),this.documentHelper.dialog3.header=e.getConstant("Table of Contents"),this.documentHelper.dialog3.position={X:"center",Y:"center"},this.documentHelper.dialog3.width="auto",this.documentHelper.dialog3.height="auto",this.documentHelper.dialog3.content=this.target,this.documentHelper.dialog3.beforeOpen=this.loadTableofContentDialog,this.documentHelper.dialog3.close=this.closeTableOfContentDialog,this.documentHelper.dialog3.buttons=[{click:this.applyTableOfContentProperties,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-toc-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-toc-cancel"}}],this.documentHelper.dialog3.dataBind(),this.documentHelper.dialog3.show()},e.prototype.changeShowLevelValue=function(e){var t=[];switch(e.value){case 1:t=["1",null,null,null,null,null,null,null,null],this.changeByValue(t);break;case 2:t=["1","2",null,null,null,null,null,null,null],this.changeByValue(t);break;case 3:t=["1","2","3",null,null,null,null,null,null],this.changeByValue(t);break;case 4:t=["1","2","3","4",null,null,null,null,null],this.changeByValue(t);break;case 5:t=["1","2","3","4","5",null,null,null,null],this.changeByValue(t);break;case 6:t=["1","2","3","4","5","6",null,null,null],this.changeByValue(t);break;case 7:t=["1","2","3","4","5","6","7",null,null],this.changeByValue(t);break;case 8:t=["1","2","3","4","5","6","7","8",null],this.changeByValue(t);break;case 9:t=["1","2","3","4","5","6","7","8","9"],this.changeByValue(t)}},e.prototype.changeByValue=function(e){this.heading1.value=e[0],this.heading2.value=e[1],this.heading3.value=e[2],this.heading4.value=e[3],this.heading5.value=e[4],this.heading6.value=e[5],this.heading7.value=e[6],this.heading8.value=e[7],this.heading9.value=e[8]},e.prototype.checkLevel=function(){""!==this.heading1.value&&(this.showLevel.value=1),""!==this.heading2.value&&(this.showLevel.value=2),""!==this.heading3.value&&(this.showLevel.value=3),""!==this.heading4.value&&(this.showLevel.value=4),""!==this.heading5.value&&(this.showLevel.value=5),""!==this.heading6.value&&(this.showLevel.value=6),""!==this.heading7.value&&(this.showLevel.value=7),""!==this.heading8.value&&(this.showLevel.value=8),""!==this.heading9.value&&(this.showLevel.value=9)},e.prototype.getElementValue=function(e){switch(e){case this.heading1:return"1";case this.heading2:return"2";case this.heading3:return"3";case this.heading4:return"4";case this.heading5:return"5";case this.heading6:return"6";case this.heading7:return"7";case this.heading8:return"8";case this.heading9:return"9";default:return"1"}},e.prototype.getHeadingLevel=function(e){switch(e){case 1:return parseInt(this.heading1.value);case 2:return parseInt(this.heading2.value);case 3:return parseInt(this.heading3.value);case 4:return parseInt(this.heading4.value);case 5:return parseInt(this.heading5.value);case 6:return parseInt(this.heading6.value);case 7:return parseInt(this.heading7.value);case 8:return parseInt(this.heading8.value);case 9:return parseInt(this.heading9.value);default:return 0}},e.prototype.applyLevelSetting=function(e){e.levelSettings={};for(var t=0,i=0,n=!1,r=1;r<=e.endLevel;r++){var o=this.getHeadingLevel(r);if(r===o)0===t&&(t=r,n=!1),n||(i=r);else if(n=!0,0!==o){var s="Heading "+r.toString();e.levelSettings[s]=o}}e.startLevel=t,e.endLevel=i,""!==this.normal.value&&(e.levelSettings.Normal=+this.normal.value)},e.prototype.destroy=function(){if(this.pageNumber&&(this.pageNumber.destroy(),this.pageNumber=void 0),this.rightAlign&&(this.rightAlign.destroy(),this.rightAlign=void 0),this.tabLeader&&(this.tabLeader.destroy(),this.tabLeader=void 0),this.showLevel&&(this.showLevel.destroy(),this.showLevel=void 0),this.hyperlink&&(this.hyperlink.destroy(),this.hyperlink=void 0),this.style&&(this.style.destroy(),this.style=void 0),this.outline&&(this.outline.destroy(),this.outline=void 0),this.listViewInstance&&(this.listViewInstance.destroy(),this.listViewInstance=void 0),this.heading1=void 0,this.heading2=void 0,this.heading3=void 0,this.heading4=void 0,this.heading5=void 0,this.heading6=void 0,this.heading7=void 0,this.heading8=void 0,this.heading9=void 0,this.normal=void 0,this.textBoxInput=void 0,this.documentHelper=void 0,!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}},e}(),fi=function(){function e(e){var t=this;this.isPortrait=!0,this.loadPageSetupDialog=function(){t.documentHelper.updateFocus();var e=t.documentHelper.selection.sectionFormat;t.topMarginBox.value=e.topMargin,t.leftMarginBox.value=e.leftMargin,t.bottomMarginBox.value=e.bottomMargin,t.rightMarginBox.value=e.rightMargin,t.widthBox.value=e.pageWidth,t.heightBox.value=e.pageHeight,t.checkBox1.checked=e.differentOddAndEvenPages,t.checkBox2.checked=e.differentFirstPage,t.headerBox.value=e.headerDistance,t.footerBox.value=e.footerDistance,t.widthBox.value>t.heightBox.value?t.landscape.checked=!0:t.portrait.checked=!0,t.setPageSize(t.portrait.checked,parseFloat(e.pageWidth.toFixed(1)),parseFloat(e.pageHeight.toFixed(1)))},this.closePageSetupDialog=function(){t.unWireEventsAndBindings(),t.documentHelper.updateFocus()},this.onCancelButtonClick=function(){t.documentHelper.dialog.hide(),t.unWireEventsAndBindings(),t.documentHelper.updateFocus()},this.keyUpInsertPageSettings=function(e){13===e.keyCode&&t.applyPageSetupProperties()},this.applyPageSetupProperties=function(){var e=new x;e.bottomMargin=t.bottomMarginBox.value,e.topMargin=t.topMarginBox.value,e.leftMargin=t.leftMarginBox.value,e.rightMargin=t.rightMarginBox.value,e.pageWidth=t.widthBox.value,e.pageHeight=t.heightBox.value,e.differentOddAndEvenPages=t.checkBox1.checked,e.differentFirstPage=t.checkBox2.checked,e.headerDistance=t.headerBox.value,e.footerDistance=t.footerBox.value,t.documentHelper.owner.editorModule.onApplySectionFormat(void 0,e),t.documentHelper.hideDialog()},this.changeByPaperSize=function(e){var i=e.value;t.documentHelper.selection.sectionFormat.pageWidth>t.documentHelper.selection.sectionFormat.pageHeight||t.landscape.checked?(t.isPortrait=!1,t.portrait.checked=!1):t.isPortrait=!0,"letter"===i?t.isPortrait?(t.widthBox.value=612,t.heightBox.value=792):(t.widthBox.value=792,t.heightBox.value=612):"tabloid"===i?t.isPortrait?(t.widthBox.value=792,t.heightBox.value=1224):(t.widthBox.value=1224,t.heightBox.value=792):"legal"===i?t.isPortrait?(t.widthBox.value=612,t.heightBox.value=1008):(t.widthBox.value=1008,t.heightBox.value=612):"statement"===i?t.isPortrait?(t.widthBox.value=392,t.heightBox.value=612):(t.widthBox.value=612,t.heightBox.value=392):"executive"===i?t.isPortrait?(t.widthBox.value=522,t.heightBox.value=756):(t.widthBox.value=756,t.heightBox.value=522):"a3"===i?t.isPortrait?(t.widthBox.value=841.9,t.heightBox.value=1190.55):(t.widthBox.value=1190.55,t.heightBox.value=841.9):"a4"===i?t.isPortrait?(t.widthBox.value=595.3,t.heightBox.value=841.9):(t.widthBox.value=841.9,t.heightBox.value=595.3):"a5"===i?t.isPortrait?(t.widthBox.value=419.55,t.heightBox.value=595.3):(t.widthBox.value=595.3,t.heightBox.value=419.55):"b4"===i?t.isPortrait?(t.widthBox.value=728.5,t.heightBox.value=1031.8):(t.widthBox.value=1031.8,t.heightBox.value=728.5):"b5"===i?t.isPortrait?(t.widthBox.value=515.9,t.heightBox.value=728.5):(t.widthBox.value=728.5,t.heightBox.value=515.9):"customsize"===i&&(t.isPortrait,t.widthBox.value=t.documentHelper.selection.sectionFormat.pageWidth,t.heightBox.value=t.documentHelper.selection.sectionFormat.pageHeight)},this.onPortrait=function(){t.landscape.checked=!1;var e=t.widthBox.value,i=t.heightBox.value;e>i&&(t.widthBox.value=i,t.heightBox.value=e)},this.onLandscape=function(){t.portrait.checked=!1;var e=t.widthBox.value,i=t.heightBox.value;e<i&&(t.widthBox.value=i,t.heightBox.value=e)},this.unWireEventsAndBindings=function(){t.paperSize.value=void 0,t.topMarginBox.value=void 0,t.bottomMarginBox.value=void 0,t.leftMarginBox.value=void 0,t.rightMarginBox.value=void 0,t.headerBox.value=void 0,t.footerBox.value=void 0,t.widthBox.value=void 0,t.heightBox.value=void 0,t.checkBox1.checked=!1,t.checkBox2.checked=!1,t.portrait.checked=!1,t.landscape.checked=!1},this.documentHelper=e}return e.prototype.getModuleName=function(){return"PageSetupDialog"},e.prototype.initPageSetupDialog=function(e,n){var r=this.documentHelper.owner.containerId+"_pagesetup_dialog";this.target=t.createElement("div",{id:r,className:"e-de-pagesetup-dlg-container"});var o=t.createElement("div",{id:this.target.id+"_MarginTabContainer"});this.target.appendChild(o),this.marginTab=t.createElement("div",{id:this.target.id+"_marginPropertyTab",styles:"position: relative;"}),this.paperTab=t.createElement("div",{id:this.target.id+"_paperSizePropertyTab",styles:"position: relative;"}),this.layoutTab=t.createElement("div",{id:this.target.id+"_CellPropertiesDialogTab",styles:"position: relative;"});var s=t.createElement("div",{id:this.target.id+"_PageSetupDialogTab",className:"e-de-page-setup-ppty-tab"}),a=t.createElement("div",{className:"e-tab-header"}),l=t.createElement("div",{id:this.target.id+"_marginHeader",innerHTML:e.getConstant("Margin")}),d=t.createElement("div",{id:this.target.id+"_paperHeader",innerHTML:e.getConstant("Paper")}),h=t.createElement("div",{id:this.target.id+"_layoutHeader",innerHTML:e.getConstant("Layout")});a.appendChild(l),a.appendChild(d),a.appendChild(h);var c=t.createElement("div",{id:this.target.id+"_marginContent"}),p=t.createElement("div",{id:this.target.id+"_paperContent"}),g=t.createElement("div",{id:this.target.id+"_layoutContent"});c.appendChild(this.marginTab),p.appendChild(this.paperTab),g.appendChild(this.layoutTab),o.appendChild(s),this.initMarginProperties(this.marginTab,e,n),this.initPaperSizeProperties(this.paperTab,e,n),this.initLayoutProperties(this.layoutTab,e,n);var u=[{header:{text:l},content:c},{header:{text:d},content:p},{header:{text:h},content:g}];new i.Tab({items:u,enableRtl:n},s).isStringTemplate=!0,this.target.addEventListener("keyup",this.keyUpInsertPageSettings)},e.prototype.initMarginProperties=function(e,i,n){var o=t.createElement("div",{id:"margin_div",className:"e-de-page-setup-dlg-sub-container",styles:"height:135px;"}),s=t.createElement("div",{id:"left_margin",className:"e-de-page-setup-dlg-left-sub-container"});o.appendChild(s);var l=t.createElement("div",{className:"e-de-page-setup-dlg-right-sub-container"});o.appendChild(l),n&&(s.classList.add("e-de-rtl"),l.classList.add("e-de-rtl"));var d=t.createElement("label",{innerHTML:i.getConstant("Top"),className:"e-de-page-setup-dlg-sub-header",id:this.target.id+"_TopLabel",styles:"padding-top:0px;"}),h=t.createElement("input",{attrs:{type:"text"},id:this.target.id+"_Top"}),c=t.createElement("label",{innerHTML:i.getConstant("Bottom"),className:"e-de-page-setup-dlg-sub-title-header",id:this.target.id+"_bottomLabel"}),p=t.createElement("input",{attrs:{type:"text"},id:this.target.id+"_bottom"});s.appendChild(d),s.appendChild(h),s.appendChild(c),s.appendChild(p);var g=t.createElement("label",{innerHTML:i.getConstant("Left"),className:"e-de-page-setup-dlg-sub-header",styles:"padding-top:0px;",id:this.target.id+"_leftLabel"}),u=t.createElement("input",{attrs:{type:"text"},id:this.target.id+"_left"}),m=t.createElement("label",{innerHTML:i.getConstant("Right"),id:this.target.id+"_rightLabel",className:"e-de-page-setup-dlg-sub-title-header"}),f=t.createElement("input",{attrs:{type:"text"},id:this.target.id+"_right"});l.appendChild(g),l.appendChild(u),l.appendChild(m),l.appendChild(f),e.appendChild(o),this.topMarginBox=new a.NumericTextBox({value:71,width:170,decimals:2}),this.topMarginBox.appendTo(h),this.leftMarginBox=new a.NumericTextBox({value:73,width:170,decimals:2}),this.leftMarginBox.appendTo(u),this.bottomMarginBox=new a.NumericTextBox({value:72,width:170,decimals:2}),this.bottomMarginBox.appendTo(p),this.rightMarginBox=new a.NumericTextBox({value:74,width:170,decimals:2}),this.rightMarginBox.appendTo(f);var v,y=t.createElement("div",{id:"orientation_div",className:"e-de-page-setup-dlg-sub-container-port"}),b=t.createElement("div",{id:"_orientationLabelDiv",className:"e-de-page-setup-dlg-sub-label",innerHTML:i.getConstant("Orientation")}),w=t.createElement("div",{id:"_orientationPropDiv",styles:"display: flex;",className:"e-de-page-setup-dlg-orientation-prop"});v=n?"padding-left: 30px;":"padding-right: 30px;";var C=t.createElement("div",{id:"_portraitDiv",styles:v}),x=t.createElement("input",{attrs:{type:"radiobutton"},id:this.target.id+"_portrait"}),F=t.createElement("div",{id:"_landscapeDiv"}),P=t.createElement("input",{attrs:{type:"radiobutton"},id:this.target.id+"_landscape"});C.appendChild(x),F.appendChild(P),w.appendChild(C),w.appendChild(F),y.appendChild(b),y.appendChild(w),this.portrait=new r.RadioButton({label:i.getConstant("Portrait"),checked:!0,enableRtl:n,change:this.onPortrait}),this.landscape=new r.RadioButton({label:i.getConstant("Landscape"),enableRtl:n,change:this.onLandscape}),this.portrait.appendTo(x),this.landscape.appendTo(P),e.appendChild(y)},e.prototype.initPaperSizeProperties=function(e,i,n){var r=t.createElement("div",{id:"size_div",className:"e-de-page-setup-dlg-sub-size-container"}),o=t.createElement("div",{id:"left_size",className:"e-de-page-setup-dlg-left-sub-container"});r.appendChild(o);var l=t.createElement("div",{className:"e-de-page-setup-dlg-right-sub-container"});r.appendChild(l),n&&(o.classList.add("e-de-rtl"),l.classList.add("e-de-rtl"));var d=t.createElement("label",{innerHTML:i.getConstant("Width"),className:"e-de-page-setup-dlg-sub-header",id:this.target.id+"_widthLabel",styles:"padding-top:0px;"}),h=t.createElement("input",{attrs:{type:"text"},id:this.target.id+"_Width"});o.appendChild(d),o.appendChild(h);var c=t.createElement("label",{innerHTML:i.getConstant("Height"),className:"e-de-page-setup-dlg-sub-header",styles:"padding-top:0px;",id:this.target.id+"_heightLabel"}),p=t.createElement("input",{attrs:{type:"text"},id:this.target.id+"_height"});l.appendChild(c),l.appendChild(p),e.appendChild(r),this.widthBox=new a.NumericTextBox({value:612,width:170,decimals:2}),this.widthBox.appendTo(h),this.heightBox=new a.NumericTextBox({value:792,width:170,decimals:2}),this.heightBox.appendTo(p);var g=t.createElement("div",{id:"_paperSizeDiv",styles:"height:37px;",className:"e-de-page-setup-dlg-sub-container"}),u=t.createElement("select",{id:this.target.id+"_papersize",styles:"width:170px;padding-bottom: 20px;",innerHTML:'<option value="letter">'+i.getConstant("Letter")+'</option><option value="tabloid">'+i.getConstant("Tabloid")+'</option><option value="legal">'+i.getConstant("Legal")+'</option><option value="statement">'+i.getConstant("Statement")+'</option><option value="executive">'+i.getConstant("Executive")+'</option><option value="a3">'+i.getConstant("A3")+'</option><option value="a4">'+i.getConstant("A4")+'</option><option value="a5">'+i.getConstant("A5")+'</option><option value="b4">'+i.getConstant("B4")+'</option><option value="b5">'+i.getConstant("B5")+'</option><option value="customsize">'+i.getConstant("Custom Size")+"</option>"});g.appendChild(u),this.paperSize=new s.DropDownList({change:this.changeByPaperSize,width:"170px",enableRtl:n}),this.paperSize.appendTo(u),e.appendChild(g)},e.prototype.initLayoutProperties=function(e,i,n){var o=t.createElement("div",{id:"_layoutDiv",className:"e-de-page-setup-dlg-layout-sub-container"}),s=t.createElement("div",{id:"_firstPageDiv",styles:"height: 27px;",className:"e-de-page-setup-dlg-first-page-prop"}),l=t.createElement("input",{attrs:{type:"checkbox"},id:this.target.id+"_oddoreven"});s.appendChild(l);var d=t.createElement("div",{id:"_oddOrEvenDiv",styles:"height: 27px;",className:"e-de-page-setup-dlg-odd-or-even-prop"}),h=t.createElement("input",{attrs:{type:"checkbox"},id:this.target.id+"_even"});d.appendChild(h),o.appendChild(s),o.appendChild(d),this.checkBox1=new r.CheckBox({label:i.getConstant("Different odd and even"),enableRtl:n}),this.checkBox2=new r.CheckBox({label:i.getConstant("Different first page"),enableRtl:n}),this.checkBox1.appendTo(l),this.checkBox2.appendTo(h),e.appendChild(o);var c=t.createElement("div",{id:"_textLabelDiv",className:"e-de-page-setup-dlg-sub-label"}),p=t.createElement("label",{innerHTML:i.getConstant("From edge"),id:this.target.id+"_textLabel"});c.appendChild(p),e.appendChild(c);var g=t.createElement("div",{id:"_headerFooeterPropDiv",className:"e-de-page-setup-dlg-sub-container",styles:"height: 65px;"}),u=t.createElement("div",{id:"_leftLayoutDiv",className:"e-de-page-setup-dlg-left-layout-container"});g.appendChild(u);var m=t.createElement("div",{className:"e-de-page-setup-dlg-right-layout-container"});g.appendChild(m),n&&(m.classList.add("e-de-rtl"),u.classList.add("e-de-rtl"));var f=t.createElement("label",{innerHTML:i.getConstant("Header"),className:"e-de-page-setup-dlg-sub-header",id:this.target.id+"_headerLabel",styles:"padding-top:0px;"}),v=t.createElement("input",{attrs:{type:"text"},id:this.target.id+"_header"});u.appendChild(f),u.appendChild(v);var y=t.createElement("label",{innerHTML:i.getConstant("Footer"),className:"e-de-page-setup-dlg-sub-header",styles:"padding-top:0px;",id:this.target.id+"_footerLabel"}),b=t.createElement("input",{attrs:{type:"text"},id:this.target.id+"_footer"});m.appendChild(y),m.appendChild(b),e.appendChild(g),this.headerBox=new a.NumericTextBox({value:612,width:170,decimals:2}),this.headerBox.appendTo(v),this.footerBox=new a.NumericTextBox({value:792,width:170,decimals:2}),this.footerBox.appendTo(b)},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initPageSetupDialog(e,this.documentHelper.owner.enableRtl),this.documentHelper.dialog.header=e.getConstant("Page Setup"),this.documentHelper.dialog.width="auto",this.documentHelper.dialog.height="auto",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.beforeOpen=this.loadPageSetupDialog,this.documentHelper.dialog.close=this.closePageSetupDialog,this.documentHelper.dialog.buttons=[{click:this.applyPageSetupProperties,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-layout-ppty-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-layout-ppty-cancel"}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show()},e.prototype.setPageSize=function(e,t,i){this.paperSize.value=e&&612===t&&792===i||!e&&792===t&&612===i?"letter":e&&792===t&&1224===i||!e&&1224===t&&792===i?"tabloid":e&&612===t&&1008===i||!e&&1008===t&&612===i?"legal":e&&392===t&&612===i||!e&&392===t&&612===i?"statement":e&&522===t&&756===i||!e&&756===t&&522===i?"executive":e&&841.9===t&&1190.5===i||!e&&1190.5===t&&841.9===i?"a3":e&&595.3===t&&841.9===i||!e&&841.9===t&&595.3===i?"a4":e&&419.6===t&&595.3===i||!e&&595.3===t&&419.6===i?"a5":e&&728.5===t&&1031.8===i||!e&&1031.8===t&&728.5===i?"b4":e&&515.9===t&&728.5===i||!e&&728.5===t&&515.9===i?"letter":"customsize"},e.prototype.destroy=function(){if(this.topMarginBox&&(this.topMarginBox.destroy(),this.topMarginBox=void 0),this.leftMarginBox&&(this.leftMarginBox.destroy(),this.leftMarginBox=void 0),this.bottomMarginBox&&(this.bottomMarginBox.destroy(),this.bottomMarginBox=void 0),this.rightMarginBox&&(this.rightMarginBox.destroy(),this.rightMarginBox=void 0),this.headerBox&&(this.headerBox.destroy(),this.headerBox=void 0),this.footerBox&&(this.footerBox.destroy(),this.footerBox=void 0),this.widthBox&&(this.widthBox.destroy(),this.widthBox=void 0),this.heightBox&&(this.heightBox.destroy(),this.heightBox=void 0),this.paperSize&&(this.paperSize.destroy(),this.paperSize=void 0),this.checkBox1&&(this.checkBox1.destroy(),this.checkBox1=void 0),this.checkBox2&&(this.checkBox2.destroy(),this.checkBox2=void 0),this.portrait&&(this.portrait.destroy(),this.portrait=void 0),this.landscape&&(this.landscape.destroy(),this.landscape=void 0),this.documentHelper=void 0,!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}},e}(),vi=function(){function e(e){var i=this;this.leftIndent=void 0,this.rightIndent=void 0,this.beforeSpacing=void 0,this.afterSpacing=void 0,this.textAlignment=void 0,this.firstLineIndent=void 0,this.lineSpacingIn=void 0,this.lineSpacingType=void 0,this.paragraphFormat=void 0,this.bidi=void 0,this.contextualSpacing=void 0,this.isStyleDialog=!1,this.directionDiv=void 0,this.keyUpParagraphSettings=function(e){13===e.keyCode&&i.applyParagraphFormat()},this.changeBeforeSpacing=function(e){i.beforeSpacing=e.value},this.changeAfterSpacing=function(e){i.afterSpacing=e.value},this.changeLeftIndent=function(e){i.leftIndent=e.value},this.changeRightIndent=function(e){i.rightIndent=e.value},this.changeLineSpacingValue=function(e){i.lineSpacingIn=e.value},this.changeFirstLineIndent=function(e){i.firstLineIndent=e.value,2===i.special.index&&(i.firstLineIndent=-i.firstLineIndent,i.leftIndent=i.leftIndentIn.value+e.value)},this.changeByTextAlignment=function(e){i.textAlignment=e.value},this.changeBidirectional=function(e){"ltr"===e.value?(i.rtlButton.checked=!i.ltrButton.checked,i.bidi=!1):(i.ltrButton.checked=!i.rtlButton.checked,i.bidi=!0),i.changeAlignmentByBidi()},this.changeContextualSpacing=function(e){i.contextualSpacing=e.checked},this.changeByValue=function(){var e=i.documentHelper.selection.paragraphFormat;switch(i.special.index){case 0:0!==e.firstLineIndent&&(i.byIn.value=0,i.leftIndent=i.leftIndentIn.value);break;case 1:0===e.firstLineIndent||t.isNullOrUndefined(e.firstLineIndent)?i.byIn.value=.1:e.firstLineIndent<0&&(i.byIn.value=-e.firstLineIndent,Math.abs(e.firstLineIndent)<=i.leftIndent&&(i.leftIndent=e.firstLineIndent+i.leftIndent));break;case 2:0===e.firstLineIndent||t.isNullOrUndefined(e.firstLineIndent)?e.firstLineIndent=-.1:e.firstLineIndent>0&&(i.byIn.value=e.firstLineIndent,t.isNullOrUndefined(i.leftIndent)?i.leftIndent=e.firstLineIndent:i.leftIndent=i.leftIndent+e.firstLineIndent)}},this.changeBySpacing=function(){if(!t.isNullOrUndefined(i.lineSpacing))switch(i.lineSpacing.index){case 0:i.lineSpacingType="AtLeast",i.atIn.value=12;break;case 1:i.lineSpacingType="Exactly",i.atIn.value=12;break;case 2:i.lineSpacingType="Multiple",i.atIn.value=1}},this.loadParagraphDialog=function(){i.isStyleDialog?i.directionDiv.classList.add("e-de-disabledbutton"):i.directionDiv.classList.remove("e-de-disabledbutton");var e;e=i.paragraphFormat?i.paragraphFormat:i.documentHelper.selection.paragraphFormat;var t=i.getAlignmentValue(e.textAlignment);i.alignment.index=t,i.beforeSpacingIn.value=e.beforeSpacing,i.afterSpacingIn.value=e.afterSpacing,i.leftIndentIn.value=e.leftIndent,i.rightIndentIn.value=e.rightIndent,i.byIn.value=Math.abs(e.firstLineIndent);var n=i.lineSpacing.index;e.firstLineIndent>0?i.special.index=1:e.firstLineIndent<0&&(i.special.index=2,i.leftIndentIn.value=e.leftIndent-i.byIn.value),n="AtLeast"===e.lineSpacingType?0:"Exactly"===e.lineSpacingType?1:2,i.lineSpacing.index=n,i.atIn.value=e.lineSpacing,"none"!==i.documentHelper.selection.caret.style.display&&(i.documentHelper.selection.caret.style.display="none"),e.bidi?(i.rtlButton.checked=!0,i.ltrButton.checked=!1):(i.ltrButton.checked=!0,i.rtlButton.checked=!1),i.contextSpacing.checked=e.contextualSpacing},this.applyParagraphFormat=function(){var e,n;i.paragraphFormat?(e=i.paragraphFormat,n=!1):(e=new I,n=!0),t.isNullOrUndefined(i.beforeSpacing)||(e.beforeSpacing=i.beforeSpacing),t.isNullOrUndefined(i.afterSpacing)||(e.afterSpacing=i.afterSpacing),t.isNullOrUndefined(i.lineSpacingType)||(e.lineSpacingType=i.lineSpacingType),t.isNullOrUndefined(i.leftIndent)||(e.leftIndent=i.leftIndent),t.isNullOrUndefined(i.rightIndent)||(e.rightIndent=i.rightIndent),t.isNullOrUndefined(i.lineSpacingIn)||(e.lineSpacing=i.lineSpacingIn),t.isNullOrUndefined(i.firstLineIndent)||(e.firstLineIndent=Math.abs(i.firstLineIndent),2===i.special.index&&(e.firstLineIndent=-e.firstLineIndent)),t.isNullOrUndefined(i.bidi)||(e.bidi=i.bidi),t.isNullOrUndefined(i.textAlignment)||(e.textAlignment=i.textAlignment),t.isNullOrUndefined(i.contextualSpacing)||(e.contextualSpacing=i.contextualSpacing),n?i.onParagraphFormat(e):i.documentHelper.owner.styleDialogModule.updateParagraphFormat(),i.documentHelper.hideDialog()},this.closeParagraphDialog=function(){i.leftIndent=void 0,i.afterSpacing=void 0,i.beforeSpacing=void 0,i.firstLineIndent=void 0,i.textAlignment=void 0,i.rightIndent=void 0,i.lineSpacingIn=void 0,i.lineSpacingType=void 0,i.paragraphFormat=void 0,i.documentHelper.hideDialog()},this.documentHelper=e}return Object.defineProperty(e.prototype,"owner",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"ParagraphDialog"},e.prototype.initParagraphDialog=function(e){var i=this,n=this.documentHelper.owner.containerId,o=n+"_paragraph_dialog";this.target=t.createElement("div",{id:o,className:"e-de-para-dlg-container"});var l=t.createElement("div",{id:"property_div",styles:"width:400px;"}),d=t.createElement("div",{id:"genral_div",className:"e-de-para-dlg-sub-container"}),h=t.createElement("div",{id:n+"_genLabel",className:"e-de-para-dlg-heading",innerHTML:e.getConstant("General")}),c=t.createElement("div",{id:n+"_AlignLabel",className:"e-de-dlg-sub-header",innerHTML:e.getConstant("Alignment")}),p=t.createElement("select",{id:n+"_Alignment",innerHTML:'<option value="Center">'+e.getConstant("Center")+'</option><option value="Left">'+e.getConstant("Left")+'</option><option value="Right">'+e.getConstant("Right")+'</option><option value="Justify">'+e.getConstant("Justify")+"</option>"});d.appendChild(h),d.appendChild(c),d.appendChild(p);var g=t.createElement("div",{id:n+"_DirLabel",className:"e-de-dlg-sub-header",innerHTML:e.getConstant("Direction")});this.directionDiv=t.createElement("div",{id:n+"_DirDiv",styles:"display:flex"});var u=t.createElement("div",{id:n+"_DirDiv",className:"e-de-rtl-btn-div"}),m=t.createElement("input",{id:n+"_rtlEle"});u.appendChild(m),this.directionDiv.appendChild(u);var f=this.documentHelper.owner.enableRtl;f&&u.classList.add("e-de-rtl");var v=t.createElement("div",{id:n+"_DirDiv",className:"e-de-ltr-btn-div"}),y=t.createElement("input",{id:n+"_ltrEle"});v.appendChild(y),this.directionDiv.appendChild(v),d.appendChild(g),d.appendChild(this.directionDiv),this.rtlButton=new r.RadioButton({label:e.getConstant("Right-to-left"),enableRtl:f,value:"rtl",cssClass:"e-small",change:this.changeBidirectional}),this.rtlButton.appendTo(m),this.ltrButton=new r.RadioButton({label:e.getConstant("Left-to-right"),enableRtl:f,value:"ltr",cssClass:"e-small",change:this.changeBidirectional}),this.ltrButton.appendTo(y);var b=t.createElement("div",{id:"indention_div",styles:"width: 400px;",className:"e-de-para-dlg-sub-container e-para-dlg-sub-height"}),w=t.createElement("div",{id:"left_indention",styles:"float:left;position:relative;"});b.appendChild(w);var C=t.createElement("div",{className:"e-de-para-dlg-right-sub-container",styles:"float:right;position:relative;"});b.appendChild(C);var x=t.createElement("div",{id:"spacing_div"}),F=t.createElement("div",{id:"left_spacing",styles:"float:left;position:relative;"});x.appendChild(F);var P="float:left";f&&(P="float:right;");var T=t.createElement("div",{id:"context_spacing",styles:P+"position:relative;"});x.appendChild(T);var S=t.createElement("div",{styles:"display:inline-flex;"});x.appendChild(S);var I=t.createElement("input",{attrs:{type:"checkbox"},id:n+"_contextSpacing"});T.appendChild(I);var N=t.createElement("div",{id:n+"_indentLabel",className:"e-de-para-dlg-heading",innerHTML:e.getConstant("Indentation")}),E=t.createElement("div",{id:n+"_bfTextLabel",className:"e-de-dlg-sub-header",innerHTML:e.getConstant("Before text")}),H=t.createElement("input",{id:n+"_leftIndent",attrs:{type:"text"}}),W=t.createElement("div",{id:n+"_specialLabel",className:"e-de-dlg-sub-header",innerHTML:e.getConstant("Special")}),O=t.createElement("select",{id:n+"_special",innerHTML:'<option value="None">'+e.getConstant("None")+'</option><option value="First Line">'+e.getConstant("First line")+'</option><option value="Hanging">'+e.getConstant("Hanging")+"</option> "});w.appendChild(N),w.appendChild(E),w.appendChild(H),w.appendChild(W),w.appendChild(O);var k=t.createElement("div",{id:n+"_afTextLabel",className:"e-de-dlg-sub-header",innerHTML:e.getConstant("After text")}),L=t.createElement("input",{id:n+"_rightIndent",attrs:{type:"text"}}),R=t.createElement("label",{id:n+"_byLabel",className:"e-de-dlg-sub-header",innerHTML:e.getConstant("By")}),B=t.createElement("input",{id:n+"_By",attrs:{type:"text"}});C.appendChild(k),C.appendChild(L),C.appendChild(R),C.appendChild(B);var D=t.createElement("div",{innerHTML:e.getConstant("Spacing"),className:"e-de-para-dlg-heading",id:n+"_spaceLabel"}),A=t.createElement("div",{id:n+"_spacingWholeDiv",styles:"display:inline-flex;"}),M=t.createElement("div",{id:n+"_beforeSpacingWholeDiv"}),U=t.createElement("div",{className:"e-de-dlg-sub-header",innerHTML:e.getConstant("Before"),id:n+"_beforeLabel"}),z=t.createElement("input",{id:n+"_beforeSpacing",attrs:{type:"text"}}),V=t.createElement("div",{id:n+"_afterSpacingWholeDiv",className:"e-de-para-dlg-spacing-div"}),_=t.createElement("div",{innerHTML:e.getConstant("After"),className:"e-de-dlg-sub-header",id:n+"_afterLabel"}),j=t.createElement("input",{id:n+"_afterSpacing",attrs:{type:"text"}});F.appendChild(D),F.appendChild(A),M.appendChild(U),M.appendChild(z),A.appendChild(M),V.appendChild(_),V.appendChild(j),A.appendChild(V);var q=t.createElement("div",{id:n+"_lineSpacingWholeDiv"}),G=t.createElement("div",{id:n+"_lineSpaceLabel",className:"e-de-dlg-sub-header",innerHTML:e.getConstant("Line Spacing")}),K=t.createElement("select",{id:n+"_lineSpacing",styles:"width:180px;",innerHTML:'<option value="At least">'+e.getConstant("At least")+'</option><option value="Exactly">'+e.getConstant("Exactly")+'</option><option value="Multiple">'+e.getConstant("Multiple")+"</option>"}),X=t.createElement("div",{id:n+"_lineTypeWholeDiv",className:"e-de-para-dlg-spacing-div"}),Y=t.createElement("div",{innerHTML:e.getConstant("At"),id:n+"_atLabel",className:"e-de-dlg-sub-header"}),J=t.createElement("input",{id:n+"_lineSpacingAt",attrs:{type:"text"}});q.appendChild(G),q.appendChild(K),S.appendChild(q),X.appendChild(Y),X.appendChild(J),S.appendChild(X),l.appendChild(d),l.appendChild(b),l.appendChild(x),this.target.appendChild(l),this.leftIndentIn=new a.NumericTextBox({format:"n1",value:0,min:-1584,max:1584,width:180,enablePersistence:!1,change:this.changeLeftIndent}),this.leftIndentIn.appendTo(H),this.rightIndentIn=new a.NumericTextBox({format:"n1",value:0,min:-1584,max:1584,width:180,enablePersistence:!1,change:this.changeRightIndent}),this.rightIndentIn.appendTo(L),this.byIn=new a.NumericTextBox({format:"n1",value:0,min:0,max:1584,width:180,enablePersistence:!1,change:this.changeFirstLineIndent}),this.byIn.appendTo(B),this.beforeSpacingIn=new a.NumericTextBox({format:"n1",value:0,min:0,max:1584,width:180,step:6,enablePersistence:!1,change:this.changeBeforeSpacing}),this.beforeSpacingIn.appendTo(z),this.afterSpacingIn=new a.NumericTextBox({format:"n1",value:0,min:0,max:1584,width:180,step:6,enablePersistence:!1,change:this.changeAfterSpacing}),this.afterSpacingIn.appendTo(j),this.atIn=new a.NumericTextBox({format:"n1",value:0,min:1,max:1584,width:180,step:.5,enablePersistence:!1,change:this.changeLineSpacingValue}),this.special=new s.DropDownList({change:this.changeByValue,width:180,enableRtl:f}),this.special.appendTo(O),this.lineSpacing=new s.DropDownList({change:this.changeBySpacing,width:"180px",enableRtl:f}),this.lineSpacing.appendTo(K),this.alignment=new s.DropDownList({width:180,change:this.changeByTextAlignment,enableRtl:f}),this.alignment.appendTo(p),this.atIn.appendTo(J),this.contextSpacing=new r.CheckBox({change:this.changeContextualSpacing,label:e.getConstant("Contextual Spacing"),enableRtl:f,cssClass:"e-de-para-dlg-cs-check-box"}),this.contextSpacing.appendTo(I),this.target.addEventListener("keyup",i.keyUpParagraphSettings),f&&(V.classList.add("e-de-rtl"),X.classList.add("e-de-rtl"))},e.prototype.changeAlignmentByBidi=function(){"Left"===this.textAlignment?this.textAlignment="Right":"Right"===this.textAlignment&&(this.textAlignment="Left"),t.isNullOrUndefined(this.textAlignment)?0===this.alignment.index?this.textAlignment="Center":this.textAlignment="Justify":this.alignment.index=this.getAlignmentValue(this.textAlignment)},e.prototype.getAlignmentValue=function(e){return"Center"===e?0:"Left"===e?1:"Right"===e?2:3},e.prototype.onParagraphFormat=function(e){var t=this.documentHelper.selection,i=e.bidi&&-1!==t.paragraphFormat.listId;i||(this.documentHelper.layout.isBidiReLayout=!0),this.documentHelper.owner.editorModule.initHistory("ParagraphFormat"),this.documentHelper.owner.isShiftingEnabled=!0,this.documentHelper.selection.isEmpty?(this.documentHelper.owner.editorModule.applyParaFormatProperty(t.start.paragraph,void 0,e,!1),this.documentHelper.owner.editor.layoutItemBlock(t.start.paragraph,!1)):this.documentHelper.owner.editorModule.updateSelectionParagraphFormatting("ParagraphFormat",e,!1),this.documentHelper.owner.editorModule.reLayout(t),i||(this.documentHelper.layout.isBidiReLayout=!1)},e.prototype.show=function(e){e?(this.isStyleDialog=!0,this.paragraphFormat=e):this.isStyleDialog=!1;var i=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);i.setLocale(this.documentHelper.owner.locale),this.target||this.initParagraphDialog(i),this.loadParagraphDialog(),this.documentHelper.dialog.header=i.getConstant("Paragraph"),this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.buttons=[{click:this.applyParagraphFormat,buttonModel:{content:i.getConstant("Ok"),cssClass:"e-flat e-para-okay",isPrimary:!0}},{click:this.closeParagraphDialog,buttonModel:{content:i.getConstant("Cancel"),cssClass:"e-flat e-para-cancel"}}],this.documentHelper.dialog.beforeOpen=this.documentHelper.updateFocus,this.documentHelper.dialog.close=this.documentHelper.updateFocus,this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show()},e.prototype.destroy=function(){if(this.afterSpacingIn&&(this.afterSpacingIn.destroy(),this.afterSpacingIn=void 0),this.beforeSpacingIn&&(this.beforeSpacingIn.destroy(),this.beforeSpacingIn=void 0),this.leftIndentIn&&(this.leftIndentIn.destroy(),this.leftIndentIn=void 0),this.rightIndentIn&&(this.rightIndentIn.destroy(),this.rightIndentIn=void 0),this.byIn&&(this.byIn.destroy(),this.byIn=void 0),this.special&&(this.special.destroy(),this.special=void 0),this.atIn&&(this.atIn.destroy(),this.atIn=void 0),this.alignment&&(this.alignment.change=void 0,this.alignment.destroy()),this.alignment=void 0,this.lineSpacing&&(this.lineSpacing.change=void 0,this.lineSpacing.destroy()),this.lineSpacing=void 0,this.special&&(this.special.change=void 0,this.special.destroy()),this.special=void 0,this.documentHelper=void 0,!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}},e}(),yi=function(){function e(){this.listIn=void 0,this.levelNumberIn=void 0,this.dialog=void 0,this.levelNumber=0}return Object.defineProperty(e.prototype,"levelNumber",{get:function(){return this.levelNumberIn},set:function(e){this.levelNumberIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"list",{get:function(){return this.listIn},set:function(e){t.isNullOrUndefined(e)?this.createList():this.listIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listLevel",{get:function(){if(!t.isNullOrUndefined(this.list)&&this.levelNumber>=0&&this.levelNumber<9){if(t.isNullOrUndefined(this.dialog.documentHelper.getAbstractListById(this.list.abstractListId))){this.dialog.documentHelper.lists.push(this.list);var e=this.list.abstractList;this.list.abstractList||((e=new G).abstractListId=this.list.abstractListId);var i=new K(e);return i.characterFormat=new k(i),i.paragraphFormat=new I(i),i.paragraphFormat.leftIndent=48,i.paragraphFormat.firstLineIndent=-24,i.numberFormat="%"+1..toString()+".",i.listLevelPattern="UpRoman",i.followCharacter="Tab",i.startAt=1,i.restartLevel=1,this.dialog.documentHelper.abstractLists.push(e),this.dialog.documentHelper.getAbstractListById(this.list.abstractListId).levels[0]}return this.dialog.documentHelper.getAbstractListById(this.list.abstractListId).levels.length<=this.levelNumber&&this.addListLevels(),this.dialog.documentHelper.getAbstractListById(this.list.abstractListId).levels[this.levelNumber]}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listLevelPattern",{get:function(){return t.isNullOrUndefined(this.listLevel)?"Arabic":this.listLevel.listLevelPattern},set:function(e){t.isNullOrUndefined(this.listLevel)||(this.listLevel.listLevelPattern=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"followCharacter",{get:function(){return t.isNullOrUndefined(this.listLevel)?"None":this.listLevel.followCharacter},set:function(e){t.isNullOrUndefined(this.listLevel)||(this.listLevel.followCharacter=e)},enumerable:!0,configurable:!0}),e.prototype.createList=function(){this.list=new P,this.list.listId=this.dialog.documentHelper.lists.length+1;var e=new G;e.abstractListId=this.dialog.documentHelper.abstractLists.length+1,this.list.abstractListId=e.abstractListId,this.dialog.documentHelper.lists.push(this.list);var t=new K(e);t.paragraphFormat=new I(t),t.paragraphFormat.leftIndent=48,t.paragraphFormat.firstLineIndent=-24,t.characterFormat=new k(t),t.numberFormat="%1.",t.startAt=1,e.levels.push(t),this.dialog.documentHelper.abstractLists.push(e)},e.prototype.addListLevels=function(){if(!t.isNullOrUndefined(this.list)&&!t.isNullOrUndefined(this.list.abstractListId))for(var e=this.dialog.documentHelper.getAbstractListById(this.list.abstractListId).levels.length;e<9;e++){var i=new K(this.dialog.documentHelper.getAbstractListById(this.list.abstractListId));i.characterFormat=new k(i),i.paragraphFormat=new I(i),i.paragraphFormat.leftIndent=48*(e+1),i.paragraphFormat.firstLineIndent=-24,i.numberFormat="%"+(e+1).toString()+".",i.listLevelPattern="Arabic",i.followCharacter="Tab",i.startAt=1,i.restartLevel=e,this.dialog.documentHelper.getAbstractListById(this.list.abstractListId).levels.push(i)}},e.prototype.destroy=function(){this.list=void 0,this.followCharacter=void 0,this.levelNumber=void 0,this.listLevelPattern=void 0},e}(),bi=function(){function e(e){var i=this;this.dialog=void 0,this.target=void 0,this.documentHelper=void 0,this.viewModel=void 0,this.startAt=void 0,this.textIndent=void 0,this.alignedAt=void 0,this.listLevelElement=void 0,this.followNumberWith=void 0,this.numberStyle=void 0,this.numberFormat=void 0,this.restartBy=void 0,this.isListCharacterFormat=!1,this.onTextIndentChanged=function(e){i.viewModel.listLevel.paragraphFormat.leftIndent=e.value},this.onStartValueChanged=function(e){t.isNullOrUndefined(i.viewModel)||t.isNullOrUndefined(i.viewModel.listLevel)||(i.viewModel.listLevel.startAt=e.value)},this.onListLevelValueChanged=function(e){i.viewModel.levelNumber=parseInt(e.value.slice(e.value.length-1),10)-1,t.isNullOrUndefined(i.listLevel)||(t.isNullOrUndefined(i.listLevel.characterFormat)&&(i.listLevel.characterFormat=new k(i.viewModel.listLevel)),t.isNullOrUndefined(i.listLevel.paragraphFormat)||(i.listLevel.paragraphFormat=new I(i.viewModel.listLevel)),i.updateDialogValues(),i.updateRestartLevelBox())},this.onNumberFormatChanged=function(e){i.viewModel.listLevel.numberFormat=e.target.value},this.onAlignedAtValueChanged=function(e){i.viewModel.listLevel.paragraphFormat.firstLineIndent=e.value},this.onFollowCharacterValueChanged=function(e){e.value&&(i.viewModel.followCharacter=e.value)},this.onLevelPatternValueChanged=function(e){i.viewModel.listLevelPattern=e.value;var t="%"+(i.levelNumber+1).toString(),n=document.getElementById(i.documentHelper.owner.containerId+"_numberFormat");"Bullet"===i.listLevel.listLevelPattern?(i.listLevel.numberFormat="",n.value=i.listLevel.numberFormat,i.listLevel.characterFormat.fontFamily="Wingdings"):("None"===i.listLevel.listLevelPattern&&(i.listLevel.numberFormat=""),i.listLevel.numberFormat.match(t)||"None"===i.listLevel.listLevelPattern||(i.listLevel.numberFormat=t+"."),n.value=i.listLevel.numberFormat)},this.loadListDialog=function(){i.documentHelper.updateFocus(),t.isNullOrUndefined(i.documentHelper.owner)||(i.viewModel=new yi,i.viewModel.dialog=i,i.documentHelper.selection.paragraphFormat.listLevelNumber>0&&(i.viewModel.levelNumber=i.documentHelper.selection.paragraphFormat.listLevelNumber),i.viewModel.list=i.documentHelper.selection.paragraphFormat.getList(),t.isNullOrUndefined(i.listLevel)||(t.isNullOrUndefined(i.listLevel.characterFormat)&&(i.listLevel.characterFormat=new k(i.viewModel.listLevel)),t.isNullOrUndefined(i.listLevel.paragraphFormat)&&(i.listLevel.paragraphFormat=new I(i.viewModel.listLevel)),i.updateDialogValues(),"none"!==i.documentHelper.selection.caret.style.display&&(i.documentHelper.selection.caret.style.display="none")))},this.showFontDialog=function(){i.documentHelper.owner.fontDialogModule.showFontDialog(i.listLevel.characterFormat)},this.onApplyList=function(){t.isNullOrUndefined(i.owner)||i.documentHelper.selection.paragraphFormat.setList(i.list),i.documentHelper.dialog2.hide(),i.documentHelper.updateFocus()},this.onCancelButtonClick=function(){i.disposeBindingForListUI(),i.documentHelper.dialog2.hide(),i.documentHelper.updateFocus(),i.isListCharacterFormat=!1},this.closeListDialog=function(){i.disposeBindingForListUI(),i.documentHelper.updateFocus(),i.isListCharacterFormat=!1},this.documentHelper=e,this.viewModel=new yi}return Object.defineProperty(e.prototype,"listLevel",{get:function(){if(!t.isNullOrUndefined(this.viewModel))return this.viewModel.listLevel},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"list",{get:function(){if(!t.isNullOrUndefined(this.viewModel))return this.viewModel.list},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"levelNumber",{get:function(){return this.listLevel.ownerBase instanceof F?this.listLevel.ownerBase.levelNumber:this.listLevel.ownerBase instanceof G&&!t.isNullOrUndefined(this.listLevel.ownerBase.levels)?this.listLevel.ownerBase.levels.indexOf(this.listLevel):-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"owner",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"ListDialog"},e.prototype.showListDialog=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initListDialog(e,this.documentHelper.owner.enableRtl),this.isListCharacterFormat=!0,this.documentHelper.dialog2.header=e.getConstant("Define new Multilevel list"),this.documentHelper.dialog2.height="auto",this.documentHelper.dialog2.width="auto",this.documentHelper.dialog2.content=this.target;var i,n=this.documentHelper.owner.enableRtl;i=n?"e-flat e-list-dlg-font e-de-dlg-target.e-de-rtl e-font-rtl":"e-flat e-list-dlg-font e-font",this.documentHelper.dialog2.buttons=[{click:this.showFontDialog,buttonModel:{content:e.getConstant("Font"),cssClass:i}},{click:this.onApplyList,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-list-dlg",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-list-dlg"}}],this.documentHelper.dialog2.dataBind(),this.wireAndBindEvent(e,n),this.documentHelper.dialog2.beforeOpen=this.loadListDialog,this.documentHelper.dialog2.close=this.closeListDialog,this.documentHelper.dialog2.position={X:"center",Y:"top"},this.documentHelper.dialog2.show()},e.prototype.initListDialog=function(e,i){var n=this.documentHelper.owner.containerId,r=n+"_insert_list";this.target=t.createElement("div",{id:r,className:"e-de-list-dlg"});var o=t.createElement("div",{innerHTML:'<label id="'+n+'_listLevellabel" style="display:block;" class=e-de-list-ddl-header-list-level>'+e.getConstant("List level")+'</label><label id="'+n+'_modifyLabel" style="display:block;" class=e-de-list-ddl-subheader>'+e.getConstant("Choose level to modify")+'</label><select style="height:20px;width:43%" id="'+n+'_listLevel"><option>'+e.getConstant("Level")+" 1</option><option>"+e.getConstant("Level")+" 2</option><option>"+e.getConstant("Level")+" 3</option><option>"+e.getConstant("Level")+" 4</option><option>"+e.getConstant("Level")+" 5</option><option>"+e.getConstant("Level")+" 6</option><option>"+e.getConstant("Level")+" 7</option><option>"+e.getConstant("Level")+" 8</option><option>"+e.getConstant("Level")+" 9</option></select>"});this.target.appendChild(o);var s,a=t.createElement("div");s=i?'<div style="float:right;display:block;width:241px;">':'<div style="float:left;display:block;">';var l=t.createElement("div",{innerHTML:s+'<label id="'+n+'_numberFormatLabel" style="display:block;" class=e-de-list-ddl-header>'+e.getConstant("Number format")+'</label><label id="'+n+'_numberStyleLabel" style="display:block;" class=e-de-list-ddl-subheader>'+e.getConstant("Number style for this level")+'</label><select style="height:20px;width:100%" id="'+n+'_numberStyle"><option>'+e.getConstant("Arabic")+"</option><option>"+e.getConstant("UpRoman")+"</option><option>"+e.getConstant("LowRoman")+"</option><option>"+e.getConstant("UpLetter")+"</option><option>"+e.getConstant("LowLetter")+"</option><option>"+e.getConstant("Number")+"</option><option>"+e.getConstant("Leading zero")+"</option><option>"+e.getConstant("Bullet")+"</option><option>"+e.getConstant("Ordinal")+"</option><option>"+e.getConstant("Ordinal Text")+"</option><option>"+e.getConstant("Special")+"</option><option>"+e.getConstant("For East")+'</option></select><label id="'+n+'_startAtLabel" style="display:block;" class=e-de-list-ddl-subheaderbottom>'+e.getConstant("Start at")+'</label><input type="text" id="'+n+'_startAt">'});a.appendChild(l),this.numberFormatDiv=t.createElement("div",{className:"e-de-list-dlg-subdiv",innerHTML:'<div><div><label id="'+n+'_formatLabel" style="display:inline-block;width:86%" class=e-de-list-ddl-subheader>'+e.getConstant("Enter formatting for number")+'</label><button type="button" id="'+n+'_list_info" class="e-control e-btn e-primary e-de-list-format-info">i</button></div><input style=width:180px; type="text" id="'+n+'_numberFormat" class=e-input></div><label id="'+n+'_restartLabel" style="display:block;" class=e-de-list-ddl-subheaderbottom>'+e.getConstant("Restart list after")+'</label><select style="height:20px;width:100%" id="'+n+'_restartBy"><option>'+e.getConstant("No Restart")+"</option></select></div>"}),a.appendChild(this.numberFormatDiv),this.target.appendChild(a);var d;d=i?"display:block;position:relative; ":"display:block; ";var h=t.createElement("div",{innerHTML:s+'<label id="'+n+'_IndentsLabel" style='+d+"class=e-de-list-ddl-header>"+e.getConstant("Position")+'</label><label id="'+n+'_textIndentLabel" style='+d+"class=e-de-list-ddl-subheader>"+e.getConstant("Text indent at")+'</label><input type="text" id="'+n+'_textIndent"><label id="'+n+'_followCharacterLabel" style='+d+"class=e-de-list-ddl-subheaderbottom>"+e.getConstant("Follow number with")+'</label><select style="height:20px;width:100%" id="'+n+'_followCharacter"><option>'+e.getConstant("Tab character")+"</option><option>"+e.getConstant("Space")+"</option><option>"+e.getConstant("Nothing")+'</option></select></div><div id="e-de-list-dlg-div" class="e-de-list-dlg-div"><label id="'+n+'_alignedAtLabel" style="display:block;" class=e-de-list-ddl-subheader>'+e.getConstant("Aligned at")+'</label><input type="text" id="'+n+'_alignedAt"></div>'});this.target.appendChild(h)},e.prototype.wireAndBindEvent=function(e,t){var i=this.documentHelper.owner.containerId;t&&(document.getElementById("e-de-list-dlg-div").classList.add("e-de-rtl"),this.numberFormatDiv.classList.add("e-de-rtl"));var r=document.getElementById(i+"_startAt"),o=document.getElementById(i+"_textIndent"),l=document.getElementById(i+"_alignedAt");this.startAt=new a.NumericTextBox({format:"#",decimals:0,min:0,max:50,width:"180px",enablePersistence:!1}),this.startAt.addEventListener("change",this.onStartValueChanged),this.startAt.appendTo(r),this.textIndent=new a.NumericTextBox({format:"#",decimals:0,min:0,max:1584,width:"180px",step:4,enablePersistence:!1}),this.textIndent.addEventListener("change",this.onTextIndentChanged),this.textIndent.appendTo(o),this.alignedAt=new a.NumericTextBox({format:"#",max:1584,step:6,width:"180px",enablePersistence:!1}),this.alignedAt.addEventListener("change",this.onAlignedAtValueChanged),this.alignedAt.appendTo(l);var d=document.getElementById(i+"_listLevel");this.listLevelElement=new s.DropDownList({popupHeight:"150px",width:"180px",enableRtl:t,change:this.onListLevelValueChanged}),this.listLevelElement.appendTo(d);var h=document.getElementById(i+"_followCharacter");this.followNumberWith=new s.DropDownList({popupHeight:"150px",width:"180px",enableRtl:t,change:this.onFollowCharacterValueChanged}),this.followNumberWith.appendTo(h);var c=document.getElementById(i+"_numberStyle");this.numberStyle=new s.DropDownList({popupHeight:"150px",width:"180px",enableRtl:t,change:this.onLevelPatternValueChanged}),this.numberStyle.appendTo(c),this.numberFormat=document.getElementById(i+"_numberFormat"),this.numberFormat.addEventListener("change",this.onNumberFormatChanged);var p=document.getElementById(i+"_restartBy");this.restartBy=new s.DropDownList({popupHeight:"150px",width:"180px",enableRtl:t}),this.restartBy.appendTo(p);var g=document.getElementById(i+"_list_info");this.formatInfoToolTip=new n.Tooltip({width:200}),this.formatInfoToolTip.content=e.getConstant("Number format tooltip information"),this.formatInfoToolTip.position="RightTop",this.formatInfoToolTip.appendTo(g)},e.prototype.updateRestartLevelBox=function(){for(var e=this.documentHelper.owner.containerId,t=document.getElementById(e+"_listLevel"),i=document.getElementById(e+"_restartBy"),n=0;n<i.options.length;n)i.options.remove(n);if(0===t.selectedIndex)(o=document.createElement("option")).value="No Restart",o.innerHTML="No Restart",i.appendChild(o);else{for(n=t.selectedIndex;n>0;n--){var r=document.createElement("option");r.value="Level "+n,r.innerHTML="Level "+n,i.appendChild(r)}var o=document.createElement("option");o.value="No Restart",o.innerHTML="No Restart",i.appendChild(o)}i.selectedIndex=0},e.prototype.listPatternConverter=function(e){switch(e){case"Arabic":return 0;case"LowLetter":return 1;case"LowRoman":return 2;case"UpLetter":return 3;case"UpRoman":return 4;case"Number":return 5;case"LeadingZero":return 6;case"Bullet":return 7;case"Ordinal":return 8;case"OrdinalText":return 9;case"Special":return 10;case"FarEast":return 11;default:return 12}},e.prototype.followCharacterConverter=function(e){switch(e){case"Tab":return 0;case"Space":return 1;default:return 2}},e.prototype.updateDialogValues=function(){t.isNullOrUndefined(this.viewModel)||t.isNullOrUndefined(this.viewModel.listLevel)||(this.startAt.value=this.viewModel.listLevel.startAt,this.textIndent.value=this.viewModel.listLevel.paragraphFormat.leftIndent,this.alignedAt.value=this.viewModel.listLevel.paragraphFormat.firstLineIndent,this.followNumberWith.index=this.followCharacterConverter(this.viewModel.followCharacter),this.numberFormat.value=this.viewModel.listLevel.numberFormat,this.numberStyle.index=this.listPatternConverter(this.viewModel.listLevelPattern),this.listLevelElement.index=this.viewModel.levelNumber)},e.prototype.disposeBindingForListUI=function(){this.followNumberWith.index=-1,this.numberFormat.value=" ",this.numberStyle.index=-1,this.listLevelElement.index=-1,this.restartBy.index=-1,this.viewModel.destroy()},e.prototype.destroy=function(){if(this.alignedAt&&this.alignedAt.destroy(),this.alignedAt=void 0,this.dialog=void 0,this.followNumberWith&&this.followNumberWith.destroy(),this.followNumberWith=void 0,this.listLevelElement&&this.listLevelElement.destroy(),this.listLevelElement=void 0,this.textIndent&&this.textIndent.destroy(),this.textIndent=void 0,this.startAt&&this.startAt.destroy(),this.startAt=void 0,this.numberStyle&&this.numberStyle.destroy(),this.numberStyle=void 0,this.numberFormat=void 0,this.restartBy&&this.restartBy.destroy(),this.restartBy=void 0,!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}this.documentHelper=void 0,this.viewModel=void 0},e}(),wi=function(){function e(e){var i=this;this.target=void 0,this.styleType=void 0,this.styleBasedOn=void 0,this.styleParagraph=void 0,this.onlyThisDocument=void 0,this.template=void 0,this.fontFamily=void 0,this.fontSize=void 0,this.characterFormat=void 0,this.paragraphFormat=void 0,this.openDialog=function(e){switch(e.item.id){case"style_font":i.showFontDialog();break;case"style_paragraph":i.showParagraphDialog();break;case"style_numbering":i.showNumberingBulletDialog()}},this.setBoldProperty=function(){i.characterFormat.bold=!i.characterFormat.bold,i.fontButtonClicked()},this.setItalicProperty=function(){i.characterFormat.italic=!i.characterFormat.italic,i.fontButtonClicked()},this.setUnderlineProperty=function(){i.characterFormat.underline="None"===i.characterFormat.underline?"Single":"None",i.fontButtonClicked()},this.fontButtonClicked=function(){i.characterFormat.bold?i.bold.classList.contains("e-active")||i.bold.classList.add("e-active"):i.bold.classList.contains("e-active")&&i.bold.classList.remove("e-active"),i.characterFormat.italic?i.italic.classList.contains("e-active")||i.italic.classList.add("e-active"):i.italic.classList.contains("e-active")&&i.italic.classList.remove("e-active"),void 0!==i.characterFormat.underline&&"None"!==i.characterFormat.underline?i.underline.classList.contains("e-active")||(i.underline.classList.add("e-active"),i.characterFormat.underline="Single"):i.underline.classList.contains("e-active")&&(i.underline.classList.remove("e-active"),i.characterFormat.underline="None")},this.fontSizeUpdate=function(e){i.characterFormat.fontSize=e.value},this.fontFamilyChanged=function(e){i.characterFormat.fontFamily=e.value.toString()},this.fontColorUpdate=function(e){i.characterFormat.fontColor=e.currentValue.hex},this.setLeftAlignment=function(){"Left"===i.paragraphFormat.textAlignment?i.paragraphFormat.textAlignment="Justify":i.paragraphFormat.textAlignment="Left",i.updateParagraphFormat()},this.setRightAlignment=function(){"Right"===i.paragraphFormat.textAlignment?i.paragraphFormat.textAlignment="Left":i.paragraphFormat.textAlignment="Right",i.updateParagraphFormat()},this.setCenterAlignment=function(){"Center"===i.paragraphFormat.textAlignment?i.paragraphFormat.textAlignment="Left":i.paragraphFormat.textAlignment="Center",i.updateParagraphFormat()},this.setJustifyAlignment=function(){"Justify"===i.paragraphFormat.textAlignment?i.paragraphFormat.textAlignment="Left":i.paragraphFormat.textAlignment="Justify",i.updateParagraphFormat()},this.increaseBeforeAfterSpacing=function(){i.paragraphFormat.beforeSpacing+=6,i.paragraphFormat.afterSpacing+=6},this.decreaseBeforeAfterSpacing=function(){i.paragraphFormat.beforeSpacing>=6?i.paragraphFormat.beforeSpacing-=6:i.paragraphFormat.beforeSpacing=0,i.paragraphFormat.afterSpacing>=6?i.paragraphFormat.afterSpacing-=6:i.paragraphFormat.afterSpacing=0},this.updateNextStyle=function(e){var n=e.srcElement.value;if(i.getTypeValue()===i.localObj.getConstant("Paragraph")&&!t.isNullOrUndefined(n)&&""!==n&&!i.isUserNextParaUpdated){var r=i.documentHelper.styles.getStyleNames(i.getTypeValue());i.isEdit&&(r=r.filter(function(e){return e!==i.editStyleName})),r.push(n),i.styleParagraph.dataSource=r,i.styleParagraph.index=null,i.styleParagraph.index=r.indexOf(n),i.styleParagraph.dataBind()}},this.updateOkButton=function(){i.target.getElementsByClassName("e-input e-de-style-dlg-name-input").item(0).value;i.enableOrDisableOkButton()},this.styleTypeChange=function(e){if(e.isInteracted){var t=void 0;e.value===i.localObj.getConstant("Character")&&(i.style=new z,t="Character"),e.value!==i.localObj.getConstant("Paragraph")&&e.value!==i.localObj.getConstant("Linked Style")||(i.style=new U,t="Paragraph"),i.toggleDisable(),i.updateStyleNames(t)}},this.styleBasedOnChange=function(){},this.styleParagraphChange=function(e){e.isInteracted&&(i.isUserNextParaUpdated=!0)},this.showFontDialog=function(){t.isNullOrUndefined(i.documentHelper.owner.fontDialogModule)||i.documentHelper.owner.showFontDialog(i.characterFormat),i.updateCharacterFormat()},this.showParagraphDialog=function(){t.isNullOrUndefined(i.documentHelper.owner.paragraphDialogModule)||i.documentHelper.owner.showParagraphDialog(i.paragraphFormat)},this.showNumberingBulletDialog=function(){i.numberingBulletDialog=new Ci(i.documentHelper),i.style instanceof U&&!t.isNullOrUndefined(i.style.paragraphFormat)&&i.numberingBulletDialog.showNumberBulletDialog(i.style.paragraphFormat.listFormat,i.abstractList)},this.onOkButtonClick=function(){var e=i.styleNameElement.value;if(!(e.length>0))throw new Error("Enter valid Style name");var n,r=i.documentHelper.styles.findByName(e);if(t.isNullOrUndefined(r)){var o="Paragraph"===i.getTypeValue()?new U:new z;o.copyStyle(i.style);var s=i.documentHelper.styles.findByName(i.styleBasedOn.value);i.styleType.value!==i.localObj.getConstant("Paragraph")&&i.styleType.value!==i.localObj.getConstant("Linked Style")||(e===i.styleParagraph.value?o.next=o:o.next=i.documentHelper.styles.findByName(i.styleParagraph.value),i.updateList()),o.link=i.styleType.value===i.localObj.getConstant("Linked Style")?i.createLinkStyle(e):void 0,o.type=i.getTypeValue(),o.name=e,o.basedOn=s,i.documentHelper.styles.push(o),n=e,i.documentHelper.owner.editorModule.applyStyle(n)}else i.style.type=i.getTypeValue(),i.style.basedOn=i.documentHelper.styles.findByName(i.styleBasedOn.value),i.styleType.value!==i.localObj.getConstant("Paragraph")&&i.styleType.value!==i.localObj.getConstant("Linked Style")||(i.style.next=i.documentHelper.styles.findByName(i.styleParagraph.value),i.style.characterFormat.mergeFormat(r.characterFormat),i.style.paragraphFormat.mergeFormat(r.paragraphFormat,!0),i.updateList(),i.style.link=i.styleType.value===i.localObj.getConstant("Linked Style")?i.createLinkStyle(e,i.isEdit):void 0),i.style.name=r.name,n=r.name,r=i.style,i.documentHelper.owner.isShiftingEnabled=!0,i.documentHelper.owner.editorModule.layoutWholeDocument(),i.documentHelper.owner.isShiftingEnabled=!1;i.documentHelper.dialog2.hide(),i.documentHelper.updateFocus(),i.style,i.documentHelper.updateFocus()},this.loadStyleDialog=function(){i.documentHelper.updateFocus(),i.isUserNextParaUpdated=!1,i.styleNameElement=i.target.getElementsByClassName("e-input e-de-style-dlg-name-input").item(0),i.styleNameElement.value=null,i.isEdit||(i.styleType.index=0);var e;i.isEdit&&(i.styleNameElement.value=i.editStyleName,e=i.editStyleName),i.okButton=i.documentHelper.dialog2.element.getElementsByClassName("e-flat e-style-okay").item(0),i.enableOrDisableOkButton(),i.updateStyleNames(i.getTypeValue(),e),i.updateCharacterFormat(i.style.characterFormat),i.updateParagraphFormat(i.style.paragraphFormat)},this.onCancelButtonClick=function(){!i.isEdit&&i.style&&i.style.destroy(),i.documentHelper.dialog2.hide(),i.documentHelper.updateFocus()},this.closeStyleDialog=function(){i.documentHelper.updateFocus()},this.documentHelper=e}return e.prototype.getModuleName=function(){return"StyleDialog"},e.prototype.initStyleDialog=function(e,i){this.localObj=e;var n=this.documentHelper.owner.containerId+"_style";this.target=t.createElement("div",{id:n,className:"e-de-style-dialog"});var r=t.createElement("div"),o=t.createElement("div",{className:"e-de-style-properties",innerHTML:e.getConstant("Properties")});r.appendChild(o);var a=t.createElement("div",{styles:"display:flex",className:"e-de-style-nametype-div"});r.appendChild(a);var l=t.createElement("div",{className:"e-de-style-left-div"});a.appendChild(l);var d=t.createElement("div",{className:"e-de-style-name",innerHTML:e.getConstant("Name")+":"});l.appendChild(d);var h=t.createElement("input",{id:this.documentHelper.owner.containerId+"_style_name",styles:"width:210px;",className:"e-input e-de-style-dlg-name-input"});h.addEventListener("keyup",this.updateOkButton),h.addEventListener("input",this.updateOkButton),h.addEventListener("blur",this.updateNextStyle),l.appendChild(h);var c=t.createElement("div");a.appendChild(c);var p=t.createElement("div",{className:"e-de-style-styletype",innerHTML:e.getConstant("Style type")+":"});c.appendChild(p);var g=t.createElement("div",{className:"e-de-style-style-type-div"}),u=t.createElement("select",{id:"e-de-style-style-type"});u.innerHTML='<option value="Paragraph">'+e.getConstant("Paragraph")+'</option><option value="Character">'+e.getConstant("Character")+'</option><option value="Linked(Paragraph and Character)">'+e.getConstant("Linked Style")+"</option>",g.appendChild(u),this.styleType=new s.DropDownList({change:this.styleTypeChange,popupHeight:"253px",width:"210px",enableRtl:i}),this.styleType.appendTo(u),c.appendChild(g);var m=t.createElement("div",{styles:"display:flex",className:"e-de-style-based-para-div"});r.appendChild(m);var f=t.createElement("div",{className:"e-de-style-left-div"});m.appendChild(f);var v=t.createElement("div",{className:"e-de-style-style-based-on",innerHTML:e.getConstant("Style based on")+":"});f.appendChild(v);var y=t.createElement("div",{className:"e-de-style-style-based-on-div"}),b=t.createElement("input",{id:"e-de-style-style-based-on-value"});y.appendChild(b),this.styleBasedOn=new s.DropDownList({dataSource:[],select:this.styleBasedOnChange,popupHeight:"253px",width:"210px",enableRtl:i}),this.styleBasedOn.appendTo(b),f.appendChild(y);var w=t.createElement("div");m.appendChild(w),i&&(l.classList.add("e-de-rtl"),f.classList.add("e-de-rtl"),w.classList.add("e-de-rtl"));var C=t.createElement("div",{className:"e-de-style-style-paragraph",innerHTML:e.getConstant("Style for following paragraph")+":"});w.appendChild(C);var x=t.createElement("div",{className:"e-de-style-style-paragraph-div"}),F=t.createElement("input",{id:"e-de-style-style-paragraph-value"});x.appendChild(F),this.styleParagraph=new s.DropDownList({dataSource:[],select:this.styleParagraphChange,popupHeight:"253px",width:"210px",enableRtl:i}),this.styleParagraph.appendTo(F),w.appendChild(x);var P=t.createElement("div",{className:"e-de-style-formatting",innerHTML:e.getConstant("Formatting")});r.appendChild(P);var T=t.createElement("div",{className:"e-de-style-options-div"});r.appendChild(T);var S=t.createElement("div",{styles:"display:flex;margin-bottom: 14px;"});T.appendChild(S),this.createFontOptions(S,i);var I=t.createElement("div",{styles:"display:flex",className:"e-style-paragraph"});T.appendChild(I),this.createParagraphOptions(I),this.createFormatDropdown(r,e,i),this.target.appendChild(r)},e.prototype.createFormatDropdown=function(e,i,n){var r=this,o=t.createElement("button",{id:"style_format_dropdown",innerHTML:i.getConstant("Format"),attrs:{type:"button"}});o.style.height="31px",e.appendChild(o);var s=[{text:i.getConstant("Font")+"...",id:"style_font"},{text:i.getConstant("Paragraph")+"...",id:"style_paragraph"},{text:i.getConstant("Numbering")+"...",id:"style_numbering"}];this.styleDropdwn=new d.DropDownButton({items:s,cssClass:"e-de-style-format-dropdwn",enableRtl:n,beforeItemRender:function(e){r.styleType.value===i.getConstant("Character")?(e.item.text===i.getConstant("Paragraph")&&e.element.classList.add("e-disabled"),"Numbering"===e.item.text&&e.element.classList.add("e-disabled")):(e.item.text===i.getConstant("Paragraph")&&e.element.classList.remove("e-disabled"),"Numbering"===e.item.text&&e.element.classList.remove("e-disabled"))}}),this.styleDropdwn.appendTo(o),this.styleDropdwn.addEventListener("select",this.openDialog)},e.prototype.createFontOptions=function(e,i){var n=this,r=t.createElement("input",{id:this.target.id+"_fontName"});e.appendChild(r),this.fontFamily=new s.ComboBox({dataSource:void 0,query:(new g.Query).select(["FontName"]),fields:{text:"FontName",value:"value"},allowCustom:!0,width:"123px",popupWidth:"123px",cssClass:"e-style-font-fmaily-right",enableRtl:i,change:this.fontFamilyChanged,showClearButton:!1,itemTemplate:'<span style="font-family: ${FontName};">${FontName}</span>'}),this.fontFamily.appendTo(r),this.fontFamily.isStringTemplate=!0;for(var o=this.documentHelper.owner.documentEditorSettings.fontFamilies,l=0;l<o.length;l++){var d=o[l],h={FontName:d,value:d};this.fontFamily.addItem(h,l)}this.fontFamily.focus=function(){n.fontFamily.element.select()},this.fontFamily.element.parentElement.setAttribute("title",this.localObj.getConstant("Font"));var c=t.createElement("input");e.appendChild(c);var p=[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72];this.fontSize=new s.ComboBox({dataSource:p,width:"73px",cssClass:"e-style-font-fmaily-right",enableRtl:i,change:this.fontSizeUpdate}),this.fontSize.showClearButton=!1,this.fontSize.appendTo(c);var u=t.createElement("div",{className:"e-de-style-font-group-button"});e.appendChild(u),this.bold=this.createButtonElement(u,"e-de-bold","e-de-style-bold-button-size",this.documentHelper.owner.containerId+"_style_bold"),this.bold.addEventListener("click",this.setBoldProperty),this.italic=this.createButtonElement(u,"e-de-italic","e-de-style-icon-button-size",this.documentHelper.owner.containerId+"_style_italic"),this.italic.addEventListener("click",this.setItalicProperty),this.underline=this.createButtonElement(u,"e-de-underline","e-de-style-icon-button-size",this.documentHelper.owner.containerId+"_style_underline"),this.underline.addEventListener("click",this.setUnderlineProperty);var m=t.createElement("input",{attrs:{type:"color"},className:"e-de-style-icon-button-size"});e.appendChild(m),this.fontColor=new a.ColorPicker({cssClass:"e-de-style-font-color-picker",enableRtl:i,change:this.fontColorUpdate,locale:this.documentHelper.owner.locale}),this.fontColor.appendTo(m)},e.prototype.createParagraphOptions=function(e){var i=this,n=t.createElement("div",{className:"e-de-style-paragraph-group-button"});e.appendChild(n),this.leftAlign=this.createButtonElement(n,"e-de-align-left","e-de-style-icon-button-size"),this.leftAlign.addEventListener("click",this.setLeftAlignment),this.centerAlign=this.createButtonElement(n,"e-de-align-center","e-de-style-icon-button-size"),this.centerAlign.addEventListener("click",this.setCenterAlignment),this.rightAlign=this.createButtonElement(n,"e-de-align-right","e-de-style-icon-button-size"),this.rightAlign.addEventListener("click",this.setRightAlignment),this.justify=this.createButtonElement(n,"e-de-justify","e-de-style-icon-button-last-size"),this.justify.addEventListener("click",this.setJustifyAlignment);var r=t.createElement("div",{className:"e-de-style-paragraph-group-button"});e.appendChild(r),this.singleLineSpacing=this.createButtonElement(r,"e-de-single-spacing","e-de-style-icon-button-first-size"),this.singleLineSpacing.addEventListener("click",function(){i.paragraphFormat.lineSpacing=1,i.updateParagraphFormat()}),this.onePointFiveLineSpacing=this.createButtonElement(r,"e-de-one-point-five-spacing","e-de-style-icon-button-size"),this.onePointFiveLineSpacing.addEventListener("click",function(){i.paragraphFormat.lineSpacing=1.5,i.updateParagraphFormat()}),this.doubleLineSpacing=this.createButtonElement(r,"e-de-double-spacing","e-de-style-icon-button-last-size"),this.doubleLineSpacing.addEventListener("click",function(){i.paragraphFormat.lineSpacing=2,i.updateParagraphFormat()});var o=t.createElement("div",{className:"e-de-style-paragraph-group-button"});e.appendChild(o);var s=this.createButtonElement(o,"e-de-before-spacing","e-de-style-icon-button-first-size"),a=this.createButtonElement(o,"e-de-after-spacing","e-de-style-icon-button-last-size");s.addEventListener("click",this.increaseBeforeAfterSpacing),a.addEventListener("click",this.decreaseBeforeAfterSpacing);var l=t.createElement("div",{className:"e-de-style-paragraph-indent-group-button"});e.appendChild(l),this.createButtonElement(l,"e-de-indent","e-de-style-icon-button-first-size").addEventListener("click",function(){i.paragraphFormat.leftIndent>=36?i.paragraphFormat.leftIndent-=36:i.paragraphFormat.leftIndent=0}),this.createButtonElement(l,"e-de-outdent","e-de-style-icon-button-size").addEventListener("click",function(){i.paragraphFormat.leftIndent+=36})},e.prototype.createButtonElement=function(e,i,n,o){var s=t.createElement("button",{attrs:{type:"button"}});return t.isNullOrUndefined(o)||(s.id=o),e.appendChild(s),new r.Button({iconCss:i,cssClass:n}).appendTo(s),s},e.prototype.toggleDisable=function(){this.styleType.value===this.localObj.getConstant("Character")?(this.styleParagraph.enabled=!1,this.target.getElementsByClassName("e-style-paragraph").item(0).setAttribute("style","display:flex;pointer-events:none;opacity:0.5")):(this.styleParagraph.enabled=!0,this.target.getElementsByClassName("e-style-paragraph").item(0).removeAttribute("style"),this.target.getElementsByClassName("e-style-paragraph").item(0).setAttribute("style","display:flex")),this.styleBasedOn.enabled=!0},e.prototype.show=function(e,i){var n=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);this.isEdit=!t.isNullOrUndefined(e)&&e.length>0,this.editStyleName=e,this.abstractList=new G;var r=this.documentHelper.styles.findByName(e);this.style=this.isEdit?r||this.getStyle(e):new U,n.setLocale(this.documentHelper.owner.locale),this.target||this.initStyleDialog(n,this.documentHelper.owner.enableRtl),t.isNullOrUndefined(i)&&(i=n.getConstant("Create New Style")),this.documentHelper.dialog2.header=i,this.documentHelper.dialog2.height="auto",this.documentHelper.dialog2.width="auto",this.documentHelper.dialog2.content=this.target,this.documentHelper.dialog2.buttons=[{click:this.onOkButtonClick,buttonModel:{content:n.getConstant("Ok"),cssClass:"e-flat e-style-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:n.getConstant("Cancel"),cssClass:"e-flat e-style-cancel"}}],this.toggleDisable(),this.documentHelper.dialog2.dataBind(),this.documentHelper.dialog2.beforeOpen=this.loadStyleDialog,this.documentHelper.dialog2.close=this.closeStyleDialog,this.documentHelper.dialog2.position={X:"center",Y:"center"},this.documentHelper.dialog2.show()},e.prototype.updateList=function(){var e=this.style.paragraphFormat.listFormat.listId;e>-1&&(0===this.documentHelper.lists.filter(function(t){return t.listId===e}).length?this.documentHelper.lists.push(this.style.paragraphFormat.listFormat.list):(this.documentHelper.lists=this.documentHelper.lists.filter(function(t){return t.listId!==e}),this.documentHelper.lists.push(this.style.paragraphFormat.listFormat.list))),-1!==this.abstractList.abstractListId&&this.documentHelper.abstractLists.push(this.abstractList)},e.prototype.createLinkStyle=function(e,t){var i;return i=t?this.documentHelper.styles.findByName(e+" Char","Character"):new z,i.type="Character",i.name=e+" Char",i.characterFormat=this.style.characterFormat.cloneFormat(),i.basedOn=this.style.basedOn,t||this.documentHelper.styles.push(i),this.documentHelper.styles.findByName(i.name,"Character")},e.prototype.updateCharacterFormat=function(e){t.isNullOrUndefined(e)||(this.characterFormat=e),this.fontFamily.value=this.characterFormat.fontFamily,this.fontSize.value=this.characterFormat.fontSize,this.fontColor.value=this.characterFormat.fontColor,this.fontButtonClicked()},e.prototype.updateParagraphFormat=function(e){t.isNullOrUndefined(e)||(this.paragraphFormat=e),"Left"===this.paragraphFormat.textAlignment?(this.leftAlign.classList.contains("e-active")||this.leftAlign.classList.add("e-active"),this.rightAlign.classList.contains("e-active")&&this.rightAlign.classList.remove("e-active"),this.centerAlign.classList.contains("e-active")&&this.centerAlign.classList.remove("e-active"),this.justify.classList.contains("e-active")&&this.justify.classList.remove("e-active")):"Right"===this.paragraphFormat.textAlignment?(this.leftAlign.classList.contains("e-active")&&this.leftAlign.classList.remove("e-active"),this.rightAlign.classList.contains("e-active")||this.rightAlign.classList.add("e-active"),this.centerAlign.classList.contains("e-active")&&this.centerAlign.classList.remove("e-active"),this.justify.classList.contains("e-active")&&this.justify.classList.remove("e-active")):"Center"===this.paragraphFormat.textAlignment?(this.leftAlign.classList.contains("e-active")&&this.leftAlign.classList.remove("e-active"),this.rightAlign.classList.contains("e-active")&&this.rightAlign.classList.remove("e-active"),this.centerAlign.classList.contains("e-active")||this.centerAlign.classList.add("e-active"),this.justify.classList.contains("e-active")&&this.justify.classList.remove("e-active")):"Justify"===this.paragraphFormat.textAlignment&&(this.leftAlign.classList.contains("e-active")&&this.leftAlign.classList.remove("e-active"),this.rightAlign.classList.contains("e-active")&&this.rightAlign.classList.remove("e-active"),this.centerAlign.classList.contains("e-active")&&this.centerAlign.classList.remove("e-active"),this.justify.classList.contains("e-active")||this.justify.classList.add("e-active")),1===this.paragraphFormat.lineSpacing?(this.singleLineSpacing.classList.add("e-active"),this.onePointFiveLineSpacing.classList.remove("e-active"),this.doubleLineSpacing.classList.remove("e-active")):1.5===this.paragraphFormat.lineSpacing?(this.singleLineSpacing.classList.remove("e-active"),this.onePointFiveLineSpacing.classList.add("e-active"),this.doubleLineSpacing.classList.remove("e-active")):2===this.paragraphFormat.lineSpacing?(this.singleLineSpacing.classList.remove("e-active"),this.onePointFiveLineSpacing.classList.remove("e-active"),this.doubleLineSpacing.classList.add("e-active")):(this.singleLineSpacing.classList.remove("e-active"),this.onePointFiveLineSpacing.classList.remove("e-active"),this.doubleLineSpacing.classList.remove("e-active"))},e.prototype.enableOrDisableOkButton=function(){t.isNullOrUndefined(this.okButton)||(this.okButton.disabled=""===this.styleNameElement.value)},e.prototype.getTypeValue=function(){return this.styleType.value===this.localObj.getConstant("Linked Style")||this.styleType.value===this.localObj.getConstant("Paragraph")?"Paragraph":"Character"},e.prototype.updateStyleNames=function(e,i){var n=this.documentHelper.styles.getStyleNames(e);if(this.styleParagraph.dataSource=n,this.styleParagraph.index=null,i){this.styleBasedOn.dataSource=n.filter(function(e){return e!==i}),this.styleBasedOn.index=null;var r=this.getStyle(i);if(r.basedOn instanceof String||t.isNullOrUndefined(r.basedOn)?this.styleBasedOn.enabled=!1:this.styleBasedOn.index=n.indexOf(r.basedOn.name)>-1?n.indexOf(r.basedOn.name):0,"Paragraph"===r.type?t.isNullOrUndefined(r.link)?this.styleType.index=0:this.styleType.index=2:this.styleType.index=1,!t.isNullOrUndefined(r.next)){var o=r.next.name,s=0;n.indexOf(o)>-1&&(s=n.indexOf(o)),this.styleParagraph.index=s,this.isUserNextParaUpdated=o!==i}}else{this.styleBasedOn.dataSource=n,this.styleBasedOn.index=null;var a=0;if(this.documentHelper.owner.selectionModule){var l=void 0;l="Character"===e?this.documentHelper.owner.selection.characterFormat.styleName:this.documentHelper.owner.selection.paragraphFormat.styleName,a=n.indexOf(l)}this.styleBasedOn.index=a,this.styleParagraph.index=0}this.isEdit?this.styleType.enabled=!1:this.styleType.enabled=!0,this.styleBasedOn.dataBind(),this.styleParagraph.dataBind()},e.prototype.getStyle=function(e){return t.isNullOrUndefined(this.documentHelper.styles.findByName(e))&&this.documentHelper.owner.editor.createStyle(this.documentHelper.preDefinedStyles.get(e)),this.documentHelper.styles.findByName(e)},e.prototype.destroy=function(){if(this.documentHelper=void 0,!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}this.fontColor&&(this.fontColor.destroy(),this.fontColor=void 0),this.fontSize&&(this.fontSize.destroy(),this.fontSize=void 0),this.fontFamily&&(this.fontFamily.destroy(),this.fontFamily=void 0),this.styleType&&(this.styleType.destroy(),this.styleType=void 0),this.styleBasedOn&&(this.styleBasedOn.destroy(),this.styleBasedOn=void 0),this.styleParagraph&&(this.styleParagraph.destroy(),this.styleParagraph=void 0),this.onlyThisDocument&&this.onlyThisDocument.destroy(),this.onlyThisDocument=void 0,this.template&&(this.template.destroy(),this.template=void 0),this.style&&(this.style=void 0),this.abstractList&&(this.abstractList=void 0),this.numberingBulletDialog&&(this.numberingBulletDialog.destroy(),this.numberingBulletDialog=void 0),this.styleDropdwn&&(this.styleDropdwn.destroy(),this.styleDropdwn=void 0)},e}(),Ci=function(){function e(e){var i=this;this.isBullet=!1,this.numberListClick=function(e){i.isBullet=!1,i.setActiveElement(e),e.currentTarget.classList.contains("e-de-list-numbered-none")?(i.numberFormat=void 0,i.listLevelPattern=void 0):e.currentTarget.classList.contains("e-de-list-numbered-number-dot")?(i.numberFormat="%1.",i.listLevelPattern="Arabic"):e.currentTarget.classList.contains("e-de-list-numbered-number-brace")?(i.numberFormat="%1)",i.listLevelPattern="Arabic"):e.currentTarget.classList.contains("e-de-list-numbered-up-roman")?(i.numberFormat="%1.",i.listLevelPattern="UpRoman"):e.currentTarget.classList.contains("e-de-list-numbered-up-letter")?(i.numberFormat="%1.",i.listLevelPattern="UpLetter"):e.currentTarget.classList.contains("e-de-list-numbered-low-letter-brace")?(i.numberFormat="%1)",i.listLevelPattern="LowLetter"):e.currentTarget.classList.contains("e-de-numbered-low-letter-dot")?(i.numberFormat="%1.",i.listLevelPattern="LowLetter"):e.currentTarget.classList.contains("e-de-list-numbered-low-roman")&&(i.numberFormat="%1.",i.listLevelPattern="LowRoman")},this.bulletListClick=function(e){i.isBullet=!0,i.setActiveElement(e),e.currentTarget.classList.contains("e-bullet-none")?(i.symbol=void 0,i.fontFamily=void 0):e.currentTarget.classList.contains("e-bullet-dot")?(i.symbol="",i.fontFamily="Symbol"):e.currentTarget.classList.contains("e-bullet-circle")?(i.symbol=" ",i.fontFamily="Symbol"):e.currentTarget.classList.contains("e-bullet-square")?(i.symbol="",i.fontFamily="Wingdings"):e.currentTarget.classList.contains("e-bullet-flower")?(i.symbol="",i.fontFamily="Wingdings"):e.currentTarget.classList.contains("e-bullet-arrow")?(i.symbol="",i.fontFamily="Wingdings"):e.currentTarget.classList.contains("e-bullet-tick")&&(i.symbol="",i.fontFamily="Wingdings")},this.loadNumberingBulletDialog=function(){i.documentHelper.updateFocus()},this.closeNumberingBulletDialog=function(){i.unWireEventsAndBindings(),i.documentHelper.updateFocus()},this.onCancelButtonClick=function(){i.isBullet=!1,i.listLevelPattern=void 0,i.numberFormat=void 0,i.symbol=void 0,i.fontFamily=void 0,i.documentHelper.dialog.hide(),i.unWireEventsAndBindings()},this.onOkButtonClick=function(){i.documentHelper.owner.documentHelper.lists.length>0?(i.listFormat.list.listId=i.documentHelper.owner.documentHelper.lists[i.documentHelper.owner.documentHelper.lists.length-1].listId+1,i.listFormat.listId=i.listFormat.list.listId):(i.listFormat.list.listId=0,i.listFormat.listId=0),i.documentHelper.owner.documentHelper.abstractLists.length>0?i.abstractList.abstractListId=i.documentHelper.owner.documentHelper.abstractLists[i.documentHelper.owner.documentHelper.abstractLists.length-1].abstractListId+1:i.abstractList.abstractListId=0,i.listFormat.list.abstractListId=i.abstractList.abstractListId;var e=new K(i.abstractList);e.listLevelPattern=t.isNullOrUndefined(i.listLevelPattern)?"Bullet":i.listLevelPattern,e.numberFormat=i.isBullet?i.symbol:i.numberFormat,"Bullet"!==e.listLevelPattern&&(e.startAt=1),e.characterFormat.fontFamily=t.isNullOrUndefined(i.fontFamily)?"Verdana":i.fontFamily,e.paragraphFormat.leftIndent=36,e.paragraphFormat.firstLineIndent=-18,i.abstractList.levels.push(e),i.listFormat.listLevelNumber=0,i.listFormat.list.abstractList=i.abstractList,i.documentHelper.hideDialog()},this.documentHelper=e}return e.prototype.getModuleName=function(){return"BulletsAndNumberingDialog"},e.prototype.initNumberingBulletDialog=function(e){var n=this.documentHelper.owner.containerId;this.target=t.createElement("div",{id:n+"_insertNumberBulletDialog",className:"e-de-number-bullet-dlg"});var r=t.createElement("div",{id:n+"_tabNumberBulletDialog",className:"e-de-tab-number-bullet-dlg"});this.target.appendChild(r),this.createNumberList(n),this.createBulletList(n),this.tabObj=new i.Tab({items:[{header:{text:t.createElement("div",{innerHTML:e.getConstant("Numbering")})},content:this.numberListDiv},{header:{text:t.createElement("div",{innerHTML:e.getConstant("Bullets")})},content:this.bulletListDiv}],heightAdjustMode:"None",width:"auto",selecting:this.onTabSelect.bind(this)}),this.tabObj.isStringTemplate=!0,this.tabObj.appendTo(r)},e.prototype.onTabSelect=function(e){1===e.selectingIndex&&(this.bulletListDiv.style.display="block")},e.prototype.createNumberList=function(e){this.numberListDiv=t.createElement("div",{className:"e-de-style-numbered-list",id:e+"_Number"});var i=this.numberListDiv,n=t.createElement("ul",{styles:"display: block; outline: 0px;",id:"listMenu",className:"e-de-ui-wfloating-menu e-de-ui-bullets-menu e-de-list-container e-de-list-thumbnail"});i.appendChild(n);var r=this.createNumberNoneListTag(n),o=this.createNumberListTag(n,"1.","2.","3.","e-de-list-numbered-number-dot"),s=this.createNumberListTag(n,"1)","2)","3)","e-de-list-numbered-number-brace"),a=this.createNumberListTag(n,"I.","II.","III.","e-de-list-numbered-up-roman"),l=this.createNumberListTag(n,"A.","B.","C.","e-de-list-numbered-up-letter"),d=this.createNumberListTag(n,"a.","b.","c.","e-de-numbered-low-letter-dot"),h=this.createNumberListTag(n,"a)","b)","c)","e-de-list-numbered-low-letter-brace"),c=this.createNumberListTag(n,"i.","ii.","iii.","e-de-list-numbered-low-roman");r.addEventListener("click",this.numberListClick),o.addEventListener("click",this.numberListClick),s.addEventListener("click",this.numberListClick),a.addEventListener("click",this.numberListClick),l.addEventListener("click",this.numberListClick),h.addEventListener("click",this.numberListClick),d.addEventListener("click",this.numberListClick),c.addEventListener("click",this.numberListClick),this.target.appendChild(i)},e.prototype.createNumberListTag=function(e,i,n,r,o){var s=t.createElement("li",{styles:"display:block",className:"e-de-ui-wfloating-menuitem e-de-ui-wfloating-menuitem-md e-de-list-items e-de-list-item-size "+o});e.appendChild(s);var a="<div>"+i+'<span class="e-de-ui-list-line"></span></div><div>'+n+'<span class="e-de-ui-list-line">';a+="</span></div><div>"+r+'<span class="e-de-ui-list-line"> </span></div >';var l=t.createElement("div",{className:"e-de-ui-list-header-presetmenu",id:"e-de-ui-zlist0",innerHTML:a});return s.style.cssFloat="left",s.appendChild(l),s},e.prototype.createNumberNoneListTag=function(e){var i=t.createElement("li",{styles:"display:block",className:"e-de-ui-wfloating-menuitem e-de-ui-wfloating-menuitem-md e-de-list-items e-de-list-item-size e-de-list-numbered-none"});e.appendChild(i);var n=t.createElement("div",{className:"e-de-ui-list-header-presetmenu",id:"e-de-ui-zlist0",innerHTML:'<div class="e-de-ui-bullets e-de-bullet-icons">None</div>'});return i.style.cssFloat="left",i.appendChild(n),i},e.prototype.createBulletListTag=function(e,i,n){var r=t.createElement("li",{styles:"display:block;",className:"e-de-ui-wfloating-menuitem e-de-ui-wfloating-bullet-menuitem-md e-de-list-items e-de-list-item-size "+n});e.appendChild(r);var o=t.createElement("div",{className:"e-de-ui-bullet-list-header-presetmenu e-de-bullet-icon-size",id:"e-de-ui-zlist0"}),s=t.createElement("div",{className:i});return o.appendChild(s),r.appendChild(o),r},e.prototype.createBulletList=function(e){this.bulletListDiv=t.createElement("div",{className:"e-de-ui-bullet-list-header-presetmenu",id:e+"_Bullet"});var i=this.bulletListDiv;i.style.display="none";var n=t.createElement("ul",{styles:"display: block; outline: 0px;",id:"listMenu",className:"e-de-ui-wfloating-menu e-de-ui-bullets-menu e-de-list-container e-de-list-thumbnail"});i.appendChild(n);var r=this.createBulletListTag(n,"e-de-icon-bullet-list-none e-de-bullet-icons","e-bullet-none"),o=this.createBulletListTag(n,"e-de-icon-bullet-list-dot e-de-bullet-icons","e-bullet-dot"),s=this.createBulletListTag(n,"e-de-icon-bullet-list-circle e-de-bullet-icons","e-bullet-circle"),a=this.createBulletListTag(n,"e-de-icon-bullet-list-square e-de-bullet-icons","e-bullet-square"),l=this.createBulletListTag(n,"e-de-icon-bullet-list-flower e-de-bullet-icons","e-bullet-flower"),d=this.createBulletListTag(n,"e-de-icon-bullet-list-arrow e-de-bullet-icons","e-bullet-arrow"),h=this.createBulletListTag(n,"e-de-icon-bullet-list-tick e-de-bullet-icons","e-bullet-tick");r.addEventListener("click",this.bulletListClick),o.addEventListener("click",this.bulletListClick),s.addEventListener("click",this.bulletListClick),a.addEventListener("click",this.bulletListClick),l.addEventListener("click",this.bulletListClick),d.addEventListener("click",this.bulletListClick),h.addEventListener("click",this.bulletListClick),this.target.appendChild(i)},e.prototype.showNumberBulletDialog=function(e,i){t.isNullOrUndefined(e)?this.listFormat=new T:this.listFormat=e,t.isNullOrUndefined(this.listFormat.list)&&(this.listFormat.list=new P),t.isNullOrUndefined(i)?this.abstractList=new G:this.abstractList=i;var n=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);n.setLocale(this.documentHelper.owner.locale),this.target||this.initNumberingBulletDialog(n),this.documentHelper.dialog.header=n.getConstant("Numbering and Bullets"),this.documentHelper.dialog.width="auto",this.documentHelper.dialog.height="auto",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.beforeOpen=this.loadNumberingBulletDialog,this.documentHelper.dialog.close=this.closeNumberingBulletDialog,this.documentHelper.dialog.position={X:"center",Y:"center"},this.documentHelper.dialog.buttons=[{click:this.onOkButtonClick,buttonModel:{content:n.getConstant("Ok"),cssClass:"e-flat e-numbering-bullet-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:n.getConstant("Cancel"),cssClass:"e-flat e-numbering-bullet-cancel"}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show(),this.tabObj.refresh()},e.prototype.setActiveElement=function(e){for(var t=e.currentTarget.parentElement,i=0;i<t.childElementCount;i++)t.childNodes[i].classList.contains("e-de-list-active")&&t.childNodes[i].classList.remove("e-de-list-active");e.currentTarget.classList.add("e-de-list-active")},e.prototype.unWireEventsAndBindings=function(){},e.prototype.destroy=function(){if(this.documentHelper=void 0,this.listFormat&&(this.listFormat.destroy(),this.listFormat=void 0),this.tabObj&&(this.tabObj.destroy(),this.tabObj=void 0),this.abstractList&&(this.abstractList.destroy(),this.abstractList=void 0),this.target&&this.target.parentElement){this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}this.bulletListDiv=void 0,this.numberListDiv=void 0},e}(),xi=function(){function e(e){var i=this;this.fontStyleInternal=void 0,this.fontNameList=void 0,this.fontStyleText=void 0,this.fontSizeText=void 0,this.colorPicker=void 0,this.underlineDrop=void 0,this.strikethroughBox=void 0,this.doublestrikethrough=void 0,this.superscript=void 0,this.subscript=void 0,this.allcaps=void 0,this.bold=void 0,this.italic=void 0,this.underline=void 0,this.strikethrough=void 0,this.baselineAlignment=void 0,this.fontSize=void 0,this.fontFamily=void 0,this.fontColor=void 0,this.allCaps=void 0,this.characterFormat=void 0,this.loadFontDialog=function(){i.documentHelper.updateFocus();var e;if(e=i.characterFormat?i.characterFormat:i.documentHelper.owner.selection.characterFormat,i.fontNameList.value=e.fontFamily,i.fontNameList.dataBind(),e.bold||e.italic?e.bold&&!e.italic?(i.fontStyleText.value=i.fontSizeText.value,i.fontStyleText.index=1):!e.bold&&e.italic?(i.fontStyleText.value=i.fontSizeText.value,i.fontStyleText.index=2):e.bold&&e.italic&&(i.fontStyleText.value=i.fontSizeText.value,i.fontStyleText.index=3):(i.fontStyleText.value=i.fontSizeText.value,i.fontStyleText.index=0),!t.isNullOrUndefined(e.fontSize))for(var n=0;n<=15;n++){var r=i.fontSizeText.getItems();if(e.fontSize.toString()===r[n].innerHTML){i.fontSizeText.value=e.fontSize,i.fontSizeText.index=n;break}}t.isNullOrUndefined(e.fontColor)?i.colorPicker.value="#000000":i.colorPicker.value=e.fontColor,"None"===e.underline?i.underlineDrop.index=0:"Single"===e.underline&&(i.underlineDrop.index=1),"SingleStrike"===e.strikethrough?i.strikethroughBox.checked=!0:"DoubleStrike"===e.strikethrough?i.doublestrikethrough.checked=!0:(i.strikethroughBox.checked=!1,i.doublestrikethrough.checked=!1),"Superscript"===e.baselineAlignment?i.superscript.checked=!0:"Subscript"===e.baselineAlignment?i.subscript.checked=!0:(i.superscript.checked=!1,i.subscript.checked=!1),"none"!==i.documentHelper.selection.caret.style.display&&(i.documentHelper.selection.caret.style.display="none"),e.allCaps?i.allcaps.checked=!0:(i.allcaps.checked=!1,i.allCaps=!1)},this.closeFontDialog=function(){i.unWireEventsAndBindings(),i.documentHelper.updateFocus()},this.onCancelButtonClick=function(){i.documentHelper.dialog.hide(),i.unWireEventsAndBindings(),i.documentHelper.updateFocus()},this.onInsertFontFormat=function(){var e;e=i.characterFormat?i.characterFormat:new k(void 0),t.isNullOrUndefined(i.bold)||(e.bold=i.bold),t.isNullOrUndefined(i.italic)||(e.italic=i.italic),!t.isNullOrUndefined(i.fontSize)&&i.fontSize>0&&(e.fontSize=i.fontSize),t.isNullOrUndefined(i.fontColor)||(e.fontColor=i.fontColor),t.isNullOrUndefined(i.baselineAlignment)||(e.baselineAlignment=i.baselineAlignment),t.isNullOrUndefined(i.strikethrough)||(e.strikethrough=i.strikethrough),t.isNullOrUndefined(i.underline)||(e.underline=i.underline),t.isNullOrUndefined(i.fontFamily)||(e.fontFamily=i.fontFamily),t.isNullOrUndefined(i.allCaps)||(e.allCaps=i.allCaps),i.characterFormat?i.documentHelper.owner.styleDialogModule.updateCharacterFormat():i.onCharacterFormat(i.documentHelper.selection,e),i.documentHelper.hideDialog()},this.fontSizeUpdate=function(e){i.fontSize=e.value},this.fontStyleUpdate=function(e){i.fontStyle=e.value},this.fontFamilyUpdate=function(e){i.fontFamily=e.value},this.underlineUpdate=function(e){i.underline=e.value},this.fontColorUpdate=function(e){t.isNullOrUndefined(e.currentValue)||(i.fontColor=e.currentValue.hex)},this.singleStrikeUpdate=function(e){i.enableCheckBoxProperty(e),e.checked?i.strikethrough="SingleStrike":i.strikethrough="None"},this.doubleStrikeUpdate=function(e){i.enableCheckBoxProperty(e),e.checked?i.strikethrough="DoubleStrike":i.strikethrough="None"},this.superscriptUpdate=function(e){i.enableCheckBoxProperty(e),e.checked?i.baselineAlignment="Superscript":i.baselineAlignment="Normal"},this.subscriptUpdate=function(e){i.enableCheckBoxProperty(e),e.checked?i.baselineAlignment="Subscript":i.baselineAlignment="Normal"},this.allcapsUpdate=function(e){i.enableCheckBoxProperty(e),e.checked?i.allCaps=!0:i.allCaps=!1},this.documentHelper=e}return Object.defineProperty(e.prototype,"fontStyle",{get:function(){return this.fontStyleInternal},set:function(e){switch(this.fontStyleInternal=e,this.fontStyle){case"Bold":this.bold=!0,this.italic=!1;break;case"Italic":this.bold=!1,this.italic=!0;break;case"BoldItalic":this.bold=!0,this.italic=!0;break;case"Regular":this.bold=!1,this.italic=!1}},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"FontDialog"},e.prototype.createInputElement=function(e,i,n){return t.createElement("input",{attrs:{type:e},id:i,className:n})},e.prototype.initFontDialog=function(e,i){var n,o,s,l,d,h,c=this.documentHelper.owner.containerId;this.target=t.createElement("div",{id:c+"_insertFontDialog",className:"e-de-font-dlg"});var p=this.getFontDiv(e,i);this.target.appendChild(p);var g=this.getFontSizeDiv(e,i);this.target.appendChild(g);var u=t.createElement("div",{id:c+"_fontColor",className:"e-de-font-clr-div"});this.fontColorDiv=t.createElement("div",{id:c+"_fontColorDiv",className:"e-de-font-dlg-display"});var m=t.createElement("label",{className:"e-de-font-dlg-header-font-color e-de-font-color-margin",innerHTML:e.getConstant("Font color"),styles:"width:63px"});i&&m.classList.add("e-de-rtl"),this.fontColorDiv.appendChild(m);var f=this.createInputElement("color",this.target.id+"_ColorDiv","e-de-font-dlg-color");this.fontColorDiv.appendChild(f),u.appendChild(this.fontColorDiv),this.target.appendChild(u);var v=t.createElement("div",{id:c+"_fontEffectsDiv"}),y=t.createElement("div",{className:"e-de-font-color-label e-de-font-dlg-display",id:this.target.id+"_fontEffectsSubDiv1"});n=t.createElement("label",{className:"e-de-font-dlg-header-effects",innerHTML:e.getConstant("Effects"),styles:"width:58px"}),y.appendChild(n),o=this.createInputElement("checkbox",this.target.id+"_strikeThrough",""),y.appendChild(o),s=this.createInputElement("checkbox",this.target.id+"_superScript",""),y.appendChild(s),v.appendChild(y);var b=t.createElement("div",{className:"e-de-font-checkbox",id:c+"_fontEffectsSubDiv2"});l=this.createInputElement("checkbox",this.target.id+"_subScript",""),b.appendChild(l),d=this.createInputElement("checkbox",this.target.id+"_doubleStrikeThrough",""),b.appendChild(d),v.appendChild(b);var w=t.createElement("div",{className:"e-de-font-checkbox-transform-label e-de-font-checkbox-transform",id:c+"_fontEffectsSubDiv3"});h=this.createInputElement("checkbox",this.target.id+"_allCaps",""),w.appendChild(h),v.appendChild(w),this.target.appendChild(v),this.colorPicker=new a.ColorPicker({change:this.fontColorUpdate,value:"#000000",enableRtl:i,locale:this.documentHelper.owner.locale}),this.colorPicker.appendTo(f),this.strikethroughBox=new r.CheckBox({change:this.singleStrikeUpdate,cssClass:"e-de-font-content-label",label:e.getConstant("Strikethrough"),enableRtl:i}),this.strikethroughBox.appendTo(o),this.doublestrikethrough=new r.CheckBox({change:this.doubleStrikeUpdate,cssClass:"e-de-font-content-checkbox-label",label:e.getConstant("Double strikethrough"),enableRtl:i}),this.doublestrikethrough.appendTo(d),this.subscript=new r.CheckBox({label:e.getConstant("Subscript"),cssClass:"e-de-font-content-label-width",change:this.subscriptUpdate,enableRtl:i}),this.subscript.appendTo(l),this.superscript=new r.CheckBox({label:e.getConstant("Superscript"),cssClass:"e-de-font-content-label",change:this.superscriptUpdate,enableRtl:i}),this.superscript.appendTo(s),this.allcaps=new r.CheckBox({label:e.getConstant("All caps"),cssClass:"e-de-font-content-label-caps",change:this.allcapsUpdate,enableRtl:i}),this.allcaps.appendTo(h),i&&(b.classList.add("e-de-rtl"),w.classList.add("e-de-rtl"),this.doublestrikethrough.cssClass="e-de-font-content-checkbox-label-rtl")},e.prototype.getFontSizeDiv=function(e,i){var n,r,o=this.documentHelper.owner.containerId;r=t.createElement("div",{id:o+"_fontSizeAndUnderlineDiv",className:"e-de-font-dlg-padding e-de-font-dlg-display"});var a=t.createElement("div",{id:o+"_fontSizeAndUnderlineSubDiv1"}),l=t.createElement("label",{className:"e-de-font-dlg-header",innerHTML:e.getConstant("Size")}),d="font-family:Roboto;font-size:14px;opacity:0.8;";(n=t.createElement("select",{id:this.target.id+"_fontSize",styles:d})).innerHTML="<option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>14</option><option>16</option><option>18</option><option>20</option><option>24</option><option>26</option><option>28</option><option>36</option><option>48</option><option>72</option><option>96</option>",a.appendChild(l),a.appendChild(n),r.appendChild(a);var h=t.createElement("div",{className:"e-de-font-dlg-cb-right",id:o+"_fontSizeAndUnderlineSubDiv2"});i&&h.classList.add("e-de-rtl");var c,p=e.getConstant("Underline style"),g=t.createElement("label",{className:"e-de-font-dlg-header",innerHTML:p});return c=t.createElement("select",{id:this.target.id+"_underLine",styles:d}),c.innerHTML='<option value="None">'+e.getConstant("None")+'</option><option value="Single">________</option>',h.appendChild(g),h.appendChild(c),r.appendChild(h),this.fontSizeText=new s.ComboBox({change:this.fontSizeUpdate,popupHeight:"170px",width:"170px",enableRtl:i}),this.fontSizeText.showClearButton=!1,this.fontSizeText.appendTo(n),this.underlineDrop=new s.DropDownList({change:this.underlineUpdate,popupHeight:"100px",width:"170px",enableRtl:i}),this.underlineDrop.appendTo(c),r},e.prototype.getFontDiv=function(e,i){for(var n=this.documentHelper.owner.containerId,r=t.createElement("div",{id:n+"_fontDiv",className:"e-de-font-dlg-display"}),o=t.createElement("div",{id:n+"_fontSubDiv1"}),a=t.createElement("label",{className:"e-de-font-dlg-header",innerHTML:e.getConstant("Font")}),l=t.createElement("select",{id:this.target.id+"_fontName"}),d=this.documentHelper.owner.documentEditorSettings.fontFamilies,h=0;h<d.length;h++)l.innerHTML+="<option>"+d[h]+"</option>";o.appendChild(a),o.appendChild(l),r.appendChild(o);var c,p,g;c=t.createElement("div",{className:"e-de-font-dlg-cb-right",id:n+"_fontSubDiv2",styles:"float:right;"}),i&&c.classList.add("e-de-rtl"),p=t.createElement("label",{className:"e-de-font-dlg-header",innerHTML:e.getConstant("Font style")});return g=t.createElement("select",{id:this.target.id+"_fontStyle",styles:"font-family:Roboto;font-size:14px;opacity:0.8;"}),g.innerHTML='<option value="Regular">'+e.getConstant("Regular")+'</option><option value="Bold">'+e.getConstant("Bold")+'</option><option value="Italic">'+e.getConstant("Italic")+'</option><option value="BoldItalic">'+e.getConstant("Bold")+e.getConstant("Italic")+"</option>",c.appendChild(p),c.appendChild(g),r.appendChild(c),this.fontNameList=new s.ComboBox({change:this.fontFamilyUpdate,popupHeight:"200px",width:"170px",enableRtl:i}),this.fontNameList.showClearButton=!1,this.fontNameList.appendTo(l),this.fontStyleText=new s.DropDownList({change:this.fontStyleUpdate,popupHeight:"170px",width:"170px",enableRtl:i}),this.fontStyleText.appendTo(g),r},e.prototype.showFontDialog=function(e){e&&(this.characterFormat=e);var i=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);i.setLocale(this.documentHelper.owner.locale),this.target||this.initFontDialog(i,this.documentHelper.owner.enableRtl),this.documentHelper.dialog.header=i.getConstant("Font"),this.documentHelper.dialog.width="auto",this.documentHelper.dialog.height="auto",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.beforeOpen=this.loadFontDialog,this.documentHelper.dialog.close=this.closeFontDialog,this.documentHelper.dialog.buttons=[{click:this.onInsertFontFormat,buttonModel:{content:i.getConstant("Ok"),cssClass:"e-flat e-font-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:i.getConstant("Cancel"),cssClass:"e-flat e-font-cancel"}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show()},e.prototype.onCharacterFormat=function(e,t){if(this.documentHelper.owner.editorModule.initHistory("CharacterFormat"),e.isEmpty)return e.start.offset===e.getParagraphLength(e.start.paragraph)&&(this.documentHelper.owner.editorModule.applyCharFormatValueInternal(e,e.start.paragraph.characterFormat,void 0,t),this.documentHelper.owner.editorModule.reLayout(e)),void this.documentHelper.updateFocus();this.documentHelper.owner.editorModule.setOffsetValue(this.documentHelper.selection),this.documentHelper.owner.editorModule.updateSelectionCharacterFormatting("CharacterFormat",t,!1)},e.prototype.enableCheckBoxProperty=function(e){this.strikethroughBox.checked&&this.doublestrikethrough.checked&&(this.strikethroughBox.checked=!1,this.doublestrikethrough.checked=!1,e.event.currentTarget.id===this.target.id+"_doubleStrikeThrough"?this.doublestrikethrough.checked=!0:this.strikethroughBox.checked=!0),this.superscript.checked&&this.subscript.checked&&(this.subscript.checked=!1,this.superscript.checked=!1,e.event.currentTarget.id===this.target.id+"_subScript"?this.subscript.checked=!0:this.superscript.checked=!0)},e.prototype.unWireEventsAndBindings=function(){this.fontNameList.value="",this.fontSizeText.value="",this.fontStyleText.value="",this.strikethroughBox.checked=!1,this.doublestrikethrough.checked=!1,this.superscript.checked=!1,this.subscript.checked=!1,this.allcaps.checked=!1,this.bold=void 0,this.italic=void 0,this.underline=void 0,this.strikethrough=void 0,this.baselineAlignment=void 0,this.fontColor=void 0,this.fontSize=void 0,this.fontFamily=void 0},e.prototype.destroy=function(){if(this.documentHelper=void 0,this.characterFormat&&(this.characterFormat.destroy(),this.characterFormat=void 0),!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}this.fontNameList&&this.fontNameList.destroy(),this.fontNameList=void 0,this.fontStyleText&&this.fontStyleText.destroy(),this.fontStyleText=void 0,this.fontSizeText&&this.fontSizeText.destroy(),this.fontSizeText=void 0,this.colorPicker&&this.colorPicker.destroy(),this.colorPicker=void 0,this.underlineDrop&&this.underlineDrop.destroy(),this.underlineDrop=void 0,this.strikethroughBox&&this.strikethroughBox.destroy(),this.strikethroughBox=void 0,this.doublestrikethrough&&this.doublestrikethrough.destroy(),this.doublestrikethrough=void 0,this.superscript&&this.superscript.destroy(),this.superscript=void 0,this.subscript&&this.subscript.destroy(),this.subscript=void 0,this.allcaps&&this.allcaps.destroy(),this.allcaps=void 0},e}(),Fi=function(){function e(e){var i=this;this.hasTableWidth=!1,this.hasCellWidth=!1,this.bidi=!1,this.isTableBordersAndShadingUpdated=!1,this.isCellBordersAndShadingUpdated=!1,this.tabObj=void 0,this.localValue=void 0,this.isCellOptionsUpdated=!1,this.isTableOptionsUpdated=!1,this.onBeforeOpen=function(){i.documentHelper.updateFocus(),i.loadTableProperties()},this.onCloseTablePropertyDialog=function(){i.unWireEvent.bind(i),i.documentHelper.updateFocus()},this.applyTableProperties=function(){var e=i.documentHelper.selection;if(i.preferCheckBox.checked||i.preferCheckBox.indeterminate||(t.isNullOrUndefined(e.tableFormat.preferredWidth)||0!==e.tableFormat.preferredWidth)&&(i.tableFormat.preferredWidth=0,i.tableFormat.preferredWidthType="Point"),i.tableFormat.hasValue("tableAlignment")&&"Left"!==i.tableFormat.tableAlignment&&(t.isNullOrUndefined(e.tableFormat.leftIndent)||0!==e.tableFormat.leftIndent)&&(i.tableFormat.leftIndent=0),i.rowHeightCheckBox.checked||i.rowHeightCheckBox.indeterminate||(t.isNullOrUndefined(e.rowFormat.height)||0!==e.rowFormat.height)&&(i.rowFormat.heightType="AtLeast",i.rowFormat.height=0),i.preferredCellWidthCheckBox.checked||i.preferredCellWidthCheckBox.indeterminate){if("Percent"===i.cellFormat.preferredWidthType&&!i.tableFormat.hasValue("preferredWidth")&&!i.tableFormat.hasValue("preferredWidthType")&&0===i.documentHelper.selection.start.paragraph.associatedCell.ownerTable.tableFormat.preferredWidth){var n=i.documentHelper.selection.start.paragraph.associatedCell.ownerTable.getOwnerWidth(!0),r=i.documentHelper.selection.start.paragraph.associatedCell.ownerTable.getTableClientWidth(n);i.tableFormat.preferredWidthType="Percent",i.tableFormat.preferredWidth=r/L.convertPixelToPoint(i.documentHelper.owner.viewer.clientArea.width)*100}}else(t.isNullOrUndefined(e.cellFormat.preferredWidth)||0===e.cellFormat.preferredWidth)&&(i.cellFormat.preferredWidthType="Point",i.cellFormat.preferredWidth=0);i.rowHeightValue&&(i.rowFormat.height=i.rowHeightValue),i.documentHelper.owner.editorModule.initComplexHistory("TableProperties"),i.documentHelper.owner.editorModule.onTableFormat(i.tableFormat),i.documentHelper.owner.editorModule.onRowFormat(i.rowFormat),i.documentHelper.owner.editorModule.onCellFormat(i.cellFormat),i.documentHelper.owner.editorHistory.updateComplexHistory(),i.closeTablePropertiesDialog(),i.documentHelper.updateFocus()},this.applyTableSubProperties=function(){if(i.isCellOptionsUpdated){var e=i.documentHelper.owner.cellOptionsDialogModule.cellFormat;i.documentHelper.owner.cellOptionsDialogModule.applySubCellOptions(e)}if(i.isTableOptionsUpdated){var t=i.documentHelper.owner.tableOptionsDialogModule.tableFormat;i.documentHelper.owner.tableOptionsDialogModule.applySubTableOptions(t)}i.isCellOptionsUpdated=!1,i.isTableOptionsUpdated=!1},this.unWireEvent=function(){i.preferCheckBox.change=void 0,i.tableWidthBox.change=void 0,i.tableWidthType.change=void 0,i.leftIndentBox.change=void 0,i.rowHeightCheckBox.change=void 0,i.rowHeightBox.change=void 0,i.rowHeightType.change=void 0,i.repeatHeader.change=void 0,i.allowRowBreak.change=void 0,i.preferredCellWidthCheckBox.change=void 0,i.cellWidthBox.change=void 0,i.cellWidthType.change=void 0,i.cellFormat.destroy(),i.rowFormat.destroy(),i.tableFormat.destroy(),i.rowHeightValue=void 0,i.documentHelper.dialog2.open=i.documentHelper.selection.hideCaret.bind(i.documentHelper.owner.viewer)},this.closeTablePropertiesDialog=function(){i.documentHelper.dialog2.hide(),i.documentHelper.updateFocus()},this.changeBidirectional=function(e){"ltr"===e.value?(i.rtlButton.checked=!i.ltrButton.checked,i.tableFormat.bidi=!1):(i.ltrButton.checked=!i.rtlButton.checked,i.tableFormat.bidi=!0),i.tableFormat.bidi&&"Left"===i.tableFormat.tableAlignment?i.tableFormat.tableAlignment="Right":i.tableFormat.bidi||"Right"!==i.tableFormat.tableAlignment||(i.tableFormat.tableAlignment="Left"),i.activeTableAlignment(i.tableFormat,!0)},this.changeTableCheckBox=function(){var e=i.preferCheckBox.checked||i.preferCheckBox.indeterminate;i.tableWidthBox.enabled=e,i.tableWidthType.enabled=e,i.tableFormat.preferredWidthType=e?"Points"===i.tableWidthType.value?"Point":i.tableWidthType.value:i.documentHelper.selection.tableFormat.preferredWidthType},this.changeTableAlignment=function(e){i.updateClassForAlignmentProperties(i.tableTab);var n=e.target;t.classList(n,["e-de-table-alignment-active"],["e-de-table-properties-alignment"]);var r=i.tableFormat.bidi||i.rtlButton.checked;n.classList.contains("e-de-table-left-alignment")&&!r||n.classList.contains("e-de-table-right-alignment")&&r?i.leftIndentBox.enabled=!0:i.leftIndentBox.enabled=!1,i.tableFormat.tableAlignment=i.getTableAlignment()},this.changeTableRowCheckBox=function(){i.rowHeightType.enabled=i.rowHeightCheckBox.checked,i.rowHeightBox.enabled=i.rowHeightCheckBox.checked,i.rowHeightType.enabled?i.rowFormat.heightType=i.rowHeightType.value:i.rowFormat.heightType=i.documentHelper.selection.rowFormat.heightType},this.changeTableCellCheckBox=function(){i.cellWidthType.enabled=i.preferredCellWidthCheckBox.checked,i.cellWidthBox.enabled=i.preferredCellWidthCheckBox.checked},this.changeCellAlignment=function(e){i.updateClassForCellAlignment(i.cellTab);var n=e.target;t.classList(n,["e-de-table-alignment-active"],["e-de-tablecell-alignment"]),i.cellFormat.verticalAlignment=i.getCellAlignment()},this.showTableOptionsDialog=function(){i.documentHelper.owner.tableOptionsDialogModule.show(),i.documentHelper.dialog2.element.style.pointerEvents="none"},this.showBordersShadingsPropertiesDialog=function(){i.documentHelper.owner.bordersAndShadingDialogModule.show(),i.documentHelper.dialog2.element.style.pointerEvents="none"},this.showCellOptionsDialog=function(){i.documentHelper.owner.cellOptionsDialogModule.show(),i.documentHelper.dialog2.element.style.pointerEvents="none"},this.documentHelper=e}return Object.defineProperty(e.prototype,"cellFormat",{get:function(){return t.isNullOrUndefined(this.cellFormatIn)?this.cellFormatIn=new q:this.cellFormatIn},set:function(e){this.cellFormatIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tableFormat",{get:function(){return t.isNullOrUndefined(this.tableFormatIn)?(this.tableFormatIn=new j,this.tableFormatIn):this.tableFormatIn},set:function(e){this.tableFormatIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rowFormat",{get:function(){return t.isNullOrUndefined(this.rowFormatInternal)?(this.rowFormatInternal=new H,this.rowFormatInternal):this.rowFormatInternal},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"TablePropertiesDialog"},e.prototype.initTablePropertyDialog=function(e,n){this.localValue=e;var r=this.documentHelper.owner.containerId+"_TablePropertiesDialog";this.target=t.createElement("div",{id:r,className:"e-de-table-properties-dlg"});var o=t.createElement("div",{id:this.target.id+"_TabContainer"});this.target.appendChild(o),this.tableTab=t.createElement("div",{id:this.target.id+"_TablePropertiesContentDialogTab",className:"e-de-table-ppty-dlg-tabs"}),this.rowTab=t.createElement("div",{id:this.target.id+"_RowPropertiesDialogTab",className:"e-de-table-ppty-dlg-tabs"}),this.cellTab=t.createElement("div",{id:this.target.id+"_CellPropertiesDialogTab",className:"e-de-table-ppty-dlg-tabs"});var s=t.createElement("div",{className:"e-de-table-dialog-separator-line"}),a=t.createElement("div",{id:this.target.id+"_TablePropertiesDialogTab",className:"e-de-table-ppty-tab"}),l=t.createElement("div",{className:"e-tab-header"}),d=t.createElement("div",{id:this.target.id+"_tableHeader",innerHTML:e.getConstant("Table")}),h=t.createElement("div",{id:this.target.id+"_rowHeader",innerHTML:e.getConstant("Row")}),c=t.createElement("div",{id:this.target.id+"_cellHeader",innerHTML:e.getConstant("Cell")});l.appendChild(d),l.appendChild(h),l.appendChild(c);var p=t.createElement("div",{id:this.target.id+"_tableContent"}),g=t.createElement("div",{id:this.target.id+"_rowContent"}),u=t.createElement("div",{id:this.target.id+"_cellContent"}),m=[{header:{text:d},content:p},{header:{text:h},content:g},{header:{text:c},content:u}];p.appendChild(this.tableTab),g.appendChild(this.rowTab),u.appendChild(this.cellTab),o.appendChild(a),this.initTableProperties(this.tableTab,e,this.documentHelper.owner.enableRtl),this.initTableRowProperties(this.rowTab,e,this.documentHelper.owner.enableRtl),this.initTableCellProperties(this.cellTab,e,this.documentHelper.owner.enableRtl),this.tabObj=new i.Tab({items:m,enableRtl:n},a),this.tabObj.isStringTemplate=!0,this.target.appendChild(s);for(var f=this.tableTab.getElementsByClassName(this.tableTab.id+"e-de-table-alignment"),v=0;v<f.length;v++)f[v].addEventListener("click",this.changeTableAlignment);for(var y=this.cellTab.getElementsByClassName(this.cellTab.id+"e-de-table-cell-alignment"),v=0;v<y.length;v++)y[v].addEventListener("click",this.changeCellAlignment)},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initTablePropertyDialog(e,this.documentHelper.owner.enableRtl),"none"!==this.documentHelper.selection.caret.style.display&&(this.documentHelper.selection.caret.style.display="none"),this.documentHelper.dialog2.header=e.getConstant("Table Properties"),this.documentHelper.dialog2.position={X:"center",Y:"center"},this.documentHelper.dialog2.width="auto",this.documentHelper.dialog2.height="auto",this.documentHelper.dialog2.content=this.target,this.documentHelper.dialog2.beforeOpen=this.onBeforeOpen,this.documentHelper.dialog2.close=this.onCloseTablePropertyDialog,this.documentHelper.dialog2.open=this.wireEvent.bind(this),this.documentHelper.dialog2.buttons=[{click:this.applyTableProperties,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-table-ppty-okay",isPrimary:!0}},{click:this.closeTablePropertiesDialog,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-table-ppty-cancel"}}],this.documentHelper.dialog2.dataBind(),this.documentHelper.dialog2.show()},e.prototype.calculateGridValue=function(e){e.calculateGrid(),e.isGridUpdated=!1,e.buildTableColumns(),e.isGridUpdated=!0,this.documentHelper.selection.owner.isLayoutEnabled=!0,this.documentHelper.layout.reLayoutTable(e),this.documentHelper.owner.editorModule.reLayout(this.documentHelper.selection),this.documentHelper.owner.editorModule.updateSelectionTextPosition(!0);var t=this.documentHelper.owner.editorHistory;t&&t.currentBaseHistoryInfo&&(t.currentBaseHistoryInfo.modifiedProperties.length>0&&t.currentBaseHistoryInfo.updateSelection(),t.updateHistory()),this.documentHelper.owner.editorModule.fireContentChange()},e.prototype.loadTableProperties=function(){this.setTableProperties(),this.setTableRowProperties(),this.setTableCellProperties(),this.documentHelper.owner.bordersAndShadingDialogModule?this.bordersAndShadingButton.disabled=!1:this.bordersAndShadingButton.disabled=!0,this.tableOptionButton.disabled=!1,this.cellOptionButton.disabled=!1},e.prototype.wireEvent=function(){this.documentHelper.selection.hideCaret(),this.preferCheckBox.change=this.changeTableCheckBox.bind(this),this.tableWidthBox.change=this.onTableWidthChange.bind(this),this.tableWidthType.change=this.onTableWidthTypeChange.bind(this),this.leftIndentBox.change=this.onLeftIndentChange.bind(this),this.rowHeightCheckBox.change=this.changeTableRowCheckBox.bind(this),this.rowHeightBox.change=this.onRowHeightChange.bind(this),this.rowHeightType.change=this.onRowHeightTypeChange.bind(this),this.allowRowBreak.change=this.onAllowBreakAcrossPage.bind(this),this.repeatHeader.change=this.onRepeatHeader.bind(this),this.preferredCellWidthCheckBox.change=this.changeTableCellCheckBox.bind(this),this.cellWidthBox.change=this.onCellWidthChange.bind(this),this.cellWidthType.change=this.onCellWidthTypeChange.bind(this)},e.prototype.initTableProperties=function(e,i,n){var o=t.createElement("div",{id:e.id+"_table_TabContainer"}),l=t.createElement("div",{id:o.id+"_sizeLabel",innerHTML:i.getConstant("Size"),styles:"width:100%;margin:0px;",className:"e-de-table-dialog-options-label e-de-table-dialog-size-label"}),d=t.createElement("div",{styles:"display: inline-flex;"}),h=t.createElement("div",{styles:"float: left;",className:"e-de-table-container-div"}),c=t.createElement("div",{className:"e-de-table-ppty-dlg-preferred-width-div"}),p=t.createElement("div",{styles:"display: inline;",className:"e-de-table-ppty-dlg-measure-div"}),g=t.createElement("div",{styles:"display: inline;position: absolute;",className:"e-de-table-ppty-dlg-measure-drop-down-div"}),u=t.createElement("div"),m=t.createElement("input",{id:e.id+"_Prefer_Width_CheckBox",attrs:{type:"checkbox"}});this.preferredWidth=t.createElement("input",{id:e.id+"preferred_Width"});var f=t.createElement("div"),v=t.createElement("select",{innerHTML:'<option value="Points">'+i.getConstant("Points")+'</option><option value="Percent">'+i.getConstant("Percent")+"</option>",id:e.id+"_width_dropdown"}),y=t.createElement("label",{innerHTML:i.getConstant("Measure in"),styles:"width: 60px;",className:"e-de-table-measure-lbl"}),b=t.createElement("div",{innerHTML:i.getConstant("Alignment"),className:"e-de-table-dialog-options-label",styles:"width: 100%;margin: 0px;"}),w=t.createElement("div",{styles:"height:85px;display:inline-flex",className:"e-de-tbl-prop-sub-cntr"}),C=e.id+"e-de-table-alignment",x=t.createElement("div",{className:"e-de-table-dia-align-div"});this.left=t.createElement("div",{className:"e-icons e-de-table-properties-alignment e-de-table-left-alignment "+C,id:e.id+"_left_alignment",styles:"width:54px;height:54px;margin:2px"}),x.appendChild(this.left);var F=t.createElement("div",{className:"e-de-table-dia-align-div"});this.center=t.createElement("div",{className:"e-icons e-de-table-properties-alignment e-de-table-center-alignment "+C,id:e.id+"_center_alignment",styles:"width:54px;height:54px;margin:2px"}),F.appendChild(this.center),this.right=t.createElement("div",{styles:"width:54px;height:54px;margin:2px",id:e.id+"_right_alignment",className:"e-icons e-de-table-properties-alignment e-de-table-right-alignment "+C});var P=t.createElement("div",{className:"e-de-table-dia-align-div"});P.appendChild(this.right);var T,S,I=t.createElement("label",{innerHTML:i.getConstant("Left"),className:"e-de-table-dia-align-label"}),N=t.createElement("label",{innerHTML:i.getConstant("Center"),className:"e-de-table-dia-align-label"}),E=t.createElement("label",{innerHTML:i.getConstant("Right"),className:"e-de-table-dia-align-label"}),H=t.createElement("div",{className:"e-de-table-ppty-dlg-left-indent-container"});n?(T="left: 45px;",S="left: 45px;"):(T="right: 45px;",S="right: 45px;"),this.indentingLabel=t.createElement("label",{innerHTML:i.getConstant("Indent from left"),styles:T,className:"e-de-tbl-indent-lbl"});var W=t.createElement("div",{styles:"margin-top: 15px;position: relative;"+S});this.leftIndent=t.createElement("input",{id:e.id+"_left_indent"});var O=t.createElement("div",{innerHTML:i.getConstant("Table direction"),className:"e-de-table-dialog-options-label",styles:"width: 100%;margin: 0px;padding-top:14px;"}),k=t.createElement("div",{styles:"display:flex"}),L=t.createElement("div",{id:e.id+"_TableDirDiv",className:"e-de-tbl-rtl-btn-div"}),R=t.createElement("input",{id:e.id+"_rtlEle"});L.appendChild(R),k.appendChild(L);var B=t.createElement("div",{id:e.id+"_DirDiv",className:"e-de-tbl-ltr-btn-div"}),D=t.createElement("input",{id:e.id+"_ltrEle"});B.appendChild(D),k.appendChild(B),this.rtlButton=new r.RadioButton({label:i.getConstant("Right-to-left"),value:"rtl",cssClass:"e-small",change:this.changeBidirectional,enableRtl:n}),this.rtlButton.appendTo(R),this.ltrButton=new r.RadioButton({label:i.getConstant("Left-to-right"),value:"ltr",cssClass:"e-small",change:this.changeBidirectional,enableRtl:n}),this.ltrButton.appendTo(D);var A=t.createElement("div",{className:"e-de-tbl-dlg-border-btn"});n&&(A.style.cssFloat="left"),this.bordersAndShadingButton=t.createElement("button",{innerHTML:i.getConstant("Borders and Shading")+"...",id:e.id+"_borders_and_shadings",className:"e-control e-btn e-flat e-de-ok-button",attrs:{type:"button"}}),this.tableOptionButton=t.createElement("button",{className:"e-control e-btn e-flat",innerHTML:i.getConstant("Options")+"...",id:e.id+"_table_cellmargin",attrs:{type:"button"}}),this.tableOptionButton.addEventListener("click",this.showTableOptionsDialog),this.bordersAndShadingButton.addEventListener("click",this.showBordersShadingsPropertiesDialog),A.appendChild(this.bordersAndShadingButton),A.appendChild(this.tableOptionButton),H.appendChild(this.indentingLabel),W.appendChild(this.leftIndent),H.appendChild(W),w.appendChild(x),w.appendChild(F),w.appendChild(P),x.appendChild(I),F.appendChild(N),P.appendChild(E),w.appendChild(H),o.appendChild(l),e.appendChild(o),h.appendChild(m),d.appendChild(h),c.appendChild(this.preferredWidth),d.appendChild(c),f.appendChild(v),p.appendChild(y),g.appendChild(f),u.appendChild(p),u.appendChild(g),d.appendChild(u),e.appendChild(d),e.appendChild(b),e.appendChild(w),e.appendChild(O),e.appendChild(k),e.appendChild(A),this.tableWidthBox=new a.NumericTextBox({value:0,decimals:2,min:0,max:1584,width:120,enablePersistence:!1}),this.tableWidthBox.appendTo(this.preferredWidth),this.leftIndentBox=new a.NumericTextBox({value:0,decimals:2,min:-1584,max:1584,width:140,enablePersistence:!1}),this.leftIndentBox.appendTo(this.leftIndent),this.preferCheckBox=new r.CheckBox({label:i.getConstant("Preferred Width"),enableRtl:n}),this.preferCheckBox.appendTo(m),this.tableWidthType=new s.DropDownList({width:"120px",enableRtl:n}),this.tableWidthType.appendTo(v),n&&(L.classList.add("e-de-rtl"),c.classList.add("e-de-rtl"),p.classList.add("e-de-rtl"),g.classList.add("e-de-rtl"),H.classList.add("e-de-rtl"),A.classList.add("e-de-rtl"),this.bordersAndShadingButton.classList.add("e-de-rtl"),x.classList.add("e-de-rtl"),F.classList.add("e-de-rtl"),P.classList.add("e-de-rtl"))},e.prototype.onTableWidthChange=function(){this.tableFormat.preferredWidth=this.tableWidthBox.value},e.prototype.onTableWidthTypeChange=function(){var e,t=L.convertPixelToPoint(this.documentHelper.owner.viewer.clientArea.width);"Percent"===this.tableWidthType.text&&"Percent"!==this.documentHelper.selection.tableFormat.preferredWidthType?(e=this.tableWidthBox.value/t*100,this.formatNumericTextBox(this.tableWidthBox,"Percent",e)):"Points"===this.tableWidthType.text&&"Point"!==this.documentHelper.selection.tableFormat.preferredWidthType?(e=t/100*this.tableWidthBox.value,this.formatNumericTextBox(this.tableWidthBox,"Point",e)):(e="#'%'"===this.tableWidthBox.format?"Points"===this.tableWidthType.text?t/100*this.tableWidthBox.value:this.tableWidthBox.value:"Percent"===this.tableWidthType.text?this.tableWidthBox.value/t*100:this.tableWidthBox.value,this.formatNumericTextBox(this.tableWidthBox,"Points"===this.tableWidthType.text?"Point":this.tableWidthType.text,e)),this.tableFormat.preferredWidthType="Points"===this.tableWidthType.text?"Point":this.tableWidthType.text},e.prototype.onLeftIndentChange=function(){this.tableFormat.leftIndent=this.leftIndentBox.value},e.prototype.setTableProperties=function(){var e=this.documentHelper.selection.tableFormat,i=e.preferredWidth>0,n=e.preferredWidth;t.isNullOrUndefined(e.preferredWidth)?(this.preferCheckBox.indeterminate=!0,n=this.documentHelper.selection.start.paragraph.associatedCell.ownerTable.combineWidget(this.documentHelper.owner.viewer).tableFormat.preferredWidth):this.preferCheckBox.checked=i,this.tableWidthBox.enabled=i,this.tableWidthType.enabled=i,this.formatNumericTextBox(this.tableWidthBox,e.preferredWidthType,n),"Auto"===e.preferredWidthType||"Point"===e.preferredWidthType?this.tableWidthType.index=0:this.tableWidthType.index=1,this.activeTableAlignment(e,!1),e.bidi?(this.rtlButton.checked=!0,this.ltrButton.checked=!1):(this.ltrButton.checked=!0,this.rtlButton.checked=!1)},e.prototype.activeTableAlignment=function(e,i){var n=i?this.tableFormat.tableAlignment:void 0;t.isNullOrUndefined(n)&&(e.bidi?"Left"===e.tableAlignment?n="Right":"Right"===e.tableAlignment&&(n="Left"):n=e.tableAlignment),e.bidi?(this.leftIndentBox.enabled="Right"===n,this.indentingLabel.innerHTML=this.localValue.getConstant("Indent from right")):(this.leftIndentBox.enabled="Left"===n,this.indentingLabel.innerHTML=this.localValue.getConstant("Indent from left")),this.leftIndentBox.value=e.leftIndent,t.classList(this.left,[],["e-de-table-alignment-active"]),t.classList(this.right,[],["e-de-table-alignment-active"]),t.classList(this.center,[],["e-de-table-alignment-active"]),"Left"===n?this.left.classList.add("e-de-table-alignment-active"):"Center"===n?this.center.classList.add("e-de-table-alignment-active"):"Right"===n&&this.right.classList.add("e-de-table-alignment-active")},e.prototype.getTableAlignment=function(){for(var e=this.tableTab.id,t=this.tableTab.getElementsByClassName(e+"e-de-table-alignment"),i=0;i<t.length;i++)if(t[i].classList.contains("e-de-table-alignment-active"))return 0===i?this.ltrButton.checked?"Left":"Right":1===i?"Center":this.ltrButton.checked?"Right":"Left"},e.prototype.updateClassForAlignmentProperties=function(e){for(var i=e.id,n=e.getElementsByClassName(i+"e-de-table-alignment"),r=0;r<n.length;r++){var o=n[r];o.classList.contains("e-de-table-alignment-active")&&t.classList(o,["e-de-table-properties-alignment"],["e-de-table-alignment-active"])}},e.prototype.initTableRowProperties=function(e,i,n){var o=t.createElement("div",{styles:"width: 100%;"}),l=t.createElement("div",{innerHTML:i.getConstant("Size"),styles:"width: 100%;",className:"e-de-table-dialog-options-label e-de-table-dialog-size-label"}),d=t.createElement("div",{styles:"display: inline-flex;width: 100%;"}),h=t.createElement("div",{className:"e-de-table-header-div",styles:"margin-top:6px"}),c=t.createElement("input",{attrs:{type:"checkbox"},id:e.id+"_height_CheckBox"}),p=t.createElement("div",{className:"e-de-row-ht-top"});this.rowHeight=t.createElement("input",{attrs:{type:"text"},id:e.id+"_table_row_height"});var g=t.createElement("div",{className:"e-de-ht-wdth-type"}),u=t.createElement("div"),m=t.createElement("div"),f=t.createElement("div"),v=t.createElement("select",{innerHTML:'<option value="At least">'+i.getConstant("At least")+'</option><option value="Exactly">'+i.getConstant("Exactly")+"</option>",id:e.id+"_height_type"}),y=t.createElement("label",{innerHTML:i.getConstant("Row height is"),className:"e-de-table-measure-lbl"});o.appendChild(l),e.appendChild(o),h.appendChild(c),d.appendChild(h),p.appendChild(this.rowHeight),d.appendChild(p),f.appendChild(v),u.appendChild(y),m.appendChild(f),g.appendChild(u),g.appendChild(m),d.appendChild(g),e.appendChild(d);var b=t.createElement("div",{innerHTML:i.getConstant("Options")+"...",styles:"width: 100%;",className:"e-de-table-dialog-options-label"}),w=t.createElement("div",{className:"e-de-table-ppty-options-break"}),C=t.createElement("div",{className:"e-de-table-ppty-options-header-row"}),x=t.createElement("input",{attrs:{type:"checkbox"},id:e.id+"_allow_row_break"}),F=t.createElement("input",{attrs:{type:"checkbox"},id:e.id+"_repeat_header"});w.appendChild(x),C.appendChild(F),e.appendChild(b),e.appendChild(w),e.appendChild(C),this.rowHeightBox=new a.NumericTextBox({value:0,decimals:2,min:0,max:1584,width:120,enablePersistence:!1}),this.rowHeightBox.appendTo(this.rowHeight),this.rowHeightCheckBox=new r.CheckBox({label:i.getConstant("Specify height"),enableRtl:n}),this.rowHeightCheckBox.appendTo(c),this.rowHeightType=new s.DropDownList({width:"120px",enableRtl:n}),this.rowHeightType.appendTo(v),this.allowRowBreak=new r.CheckBox({label:i.getConstant("Allow row to break across pages"),enableRtl:n}),this.allowRowBreak.appendTo(x),this.repeatHeader=new r.CheckBox({label:i.getConstant("Repeat as header row at the top of each page"),enableRtl:n}),this.repeatHeader.appendTo(F),n&&(u.classList.add("e-de-rtl"),m.classList.add("e-de-rtl"),p.classList.add("e-de-rtl"))},e.prototype.setTableRowProperties=function(){var e=this.documentHelper.selection.rowFormat,i=e.height>0||"Exactly"===e.heightType;i?this.rowHeightCheckBox.checked=!0:void 0===e.heightType?(this.rowHeightCheckBox.indeterminate=!0,i=!0):this.rowHeightCheckBox.checked=!1,this.rowHeightBox.enabled=i,this.rowHeightType.enabled=i;var n=!this.enableRepeatHeader();t.isNullOrUndefined(this.documentHelper.selection.rowFormat.isHeader)?(this.repeatHeader.indeterminate=!0,this.repeatHeader.disabled=!0):this.documentHelper.selection.rowFormat.isHeader?(this.repeatHeader.checked=!n,this.repeatHeader.indeterminate=n,this.repeatHeader.disabled=n):(this.repeatHeader.checked=!1,this.repeatHeader.indeterminate=!1,this.repeatHeader.disabled=n),t.isNullOrUndefined(e.allowBreakAcrossPages)?this.allowRowBreak.indeterminate=!0:this.allowRowBreak.checked=e.allowBreakAcrossPages,this.rowHeightBox.value=e.height,"Auto"===e.heightType||"AtLeast"===e.heightType?this.rowHeightType.index=0:this.rowHeightType.index=1},e.prototype.onRowHeightChange=function(){this.rowHeightValue=this.rowHeightBox.value},e.prototype.onRowHeightTypeChange=function(){this.rowFormat.heightType=this.rowHeightType.text},e.prototype.onAllowBreakAcrossPage=function(){this.rowFormat.allowBreakAcrossPages=this.allowRowBreak.checked},e.prototype.onRepeatHeader=function(){this.rowFormat.isHeader=this.repeatHeader.checked},e.prototype.enableRepeatHeader=function(){var e=this.documentHelper.selection,t=e.start,i=e.end;e.isForward||(t=e.end,i=e.start);var n=t.paragraph.associatedCell,r=i.paragraph.associatedCell;return 0===n.ownerRow.index&&r.ownerTable.equals(n.ownerTable)},e.prototype.initTableCellProperties=function(e,i,n){var o=t.createElement("div",{styles:"width: 100%;"}),l=t.createElement("div",{innerHTML:i.getConstant("Size"),className:"e-de-table-dialog-options-label e-de-table-dialog-size-label",styles:"width: 100%;"}),d=t.createElement("div",{styles:"width: 100%;display: inline-flex;"}),h=t.createElement("div",{className:"e-de-table-cell-header-div",styles:"margin-top:9px"}),c=t.createElement("input",{attrs:{type:"checkbox"},id:e.id+"_Prefer_Width_CheckBox_cell"}),p=t.createElement("div",{className:"e-de-cell-ht-top"});this.preferredCellWidth=t.createElement("input",{id:e.id+"tablecell_Width_textBox",attrs:{type:"text"}});var g=t.createElement("div",{className:"e-de-ht-wdth-type"}),u=t.createElement("div"),m=t.createElement("div"),f=t.createElement("div"),v=t.createElement("select",{innerHTML:'<option value="Points">'+i.getConstant("Points")+'</option><option value="Percent">'+i.getConstant("Percent")+"</option>",id:e.id+"_measure_type_cell"}),y=t.createElement("label",{innerHTML:i.getConstant("Measure in"),className:"e-de-table-measure-lbl"});o.appendChild(l),e.appendChild(o),h.appendChild(c),d.appendChild(h),p.appendChild(this.preferredCellWidth),d.appendChild(p),f.appendChild(v),u.appendChild(y),m.appendChild(f),g.appendChild(u),g.appendChild(m),d.appendChild(g),e.appendChild(d);var b=t.createElement("div",{innerHTML:i.getConstant("Vertical alignment"),styles:"width: 100%;margin: 0px;",className:"e-de-table-dialog-options-label"}),w=e.id+"e-de-table-cell-alignment",C=t.createElement("div",{styles:"width: 100%;height: 100px;"}),x="width:54px;height:54px;margin:2px;border-style:solid;border-width:1px",F=t.createElement("div",{className:"e-de-table-dia-align-div"});this.cellTopAlign=t.createElement("div",{styles:x,id:e.id+"_cell_top-alignment",className:"e-icons e-de-tablecell-alignment e-de-tablecell-top-alignment "+w}),F.appendChild(this.cellTopAlign);var P=t.createElement("div",{className:"e-de-table-dia-align-div"});this.cellCenterAlign=t.createElement("div",{styles:x,id:e.id+"_cell_center-alignment",className:"e-icons e-de-tablecell-alignment e-de-tablecell-center-alignment "+w}),P.appendChild(this.cellCenterAlign);var T=t.createElement("div",{className:"e-de-table-dia-align-div"});this.cellBottomAlign=t.createElement("div",{styles:x,id:e.id+"_cell_bottom-alignment",className:"e-icons e-de-tablecell-alignment e-de-tablecell-bottom-alignment "+w}),T.appendChild(this.cellBottomAlign);var S=t.createElement("label",{innerHTML:i.getConstant("Top"),className:"e-de-table-dia-align-label"}),I=t.createElement("label",{innerHTML:i.getConstant("Center"),className:"e-de-table-dia-align-label"}),N=t.createElement("label",{innerHTML:i.getConstant("Bottom"),className:"e-de-table-dia-align-label"});this.cellOptionButton=t.createElement("button",{innerHTML:i.getConstant("Options")+"...",id:e.id+"_table_cellmargin",className:"e-control e-btn e-flat",attrs:{type:"button"}}),this.cellOptionButton.style.cssFloat=n?"left":"right",C.appendChild(F),C.appendChild(P),C.appendChild(T),F.appendChild(S),P.appendChild(I),T.appendChild(N),e.appendChild(b),e.appendChild(C),e.appendChild(this.cellOptionButton),this.cellOptionButton.addEventListener("click",this.showCellOptionsDialog),this.cellWidthBox=new a.NumericTextBox({value:0,decimals:2,min:0,max:1584,width:120,enablePersistence:!1}),this.cellWidthBox.appendTo(this.preferredCellWidth),this.preferredCellWidthCheckBox=new r.CheckBox({label:i.getConstant("Preferred Width"),enableRtl:n}),this.preferredCellWidthCheckBox.appendTo(c),this.cellWidthType=new s.DropDownList({width:"120px",enableRtl:n}),this.cellWidthType.appendTo(v),n&&(p.classList.add("e-de-rtl"),u.classList.add("e-de-rtl"),m.classList.add("e-de-rtl"),this.cellOptionButton.classList.add("e-de-rtl"),F.classList.add("e-de-rtl"),P.classList.add("e-de-rtl"),T.classList.add("e-de-rtl"))},e.prototype.setTableCellProperties=function(){var e=this.documentHelper.selection.cellFormat;this.hasCellWidth=e.preferredWidth>0;var i=e.preferredWidth;t.isNullOrUndefined(e.preferredWidth)?(this.preferredCellWidthCheckBox.indeterminate=!0,i=this.documentHelper.selection.start.paragraph.associatedCell.cellFormat.preferredWidth):this.preferredCellWidthCheckBox.checked=this.hasCellWidth,this.cellWidthBox.enabled=this.hasCellWidth,this.cellWidthType.enabled=this.hasCellWidth,"Auto"===e.preferredWidthType||"Point"===e.preferredWidthType?this.cellWidthType.index=0:this.cellWidthType.index=1,this.formatNumericTextBox(this.cellWidthBox,e.preferredWidthType,i),t.classList(this.cellTopAlign,["e-de-tablecell-alignment"],["e-de-table-alignment-active"]),t.classList(this.cellCenterAlign,["e-de-tablecell-alignment"],["e-de-table-alignment-active"]),t.classList(this.cellBottomAlign,["e-de-tablecell-alignment"],["e-de-table-alignment-active"]),"Top"===e.verticalAlignment?this.cellTopAlign.classList.add("e-de-table-alignment-active"):"Center"===e.verticalAlignment?this.cellCenterAlign.classList.add("e-de-table-alignment-active"):"Bottom"===e.verticalAlignment&&this.cellBottomAlign.classList.add("e-de-table-alignment-active")},e.prototype.updateClassForCellAlignment=function(e){for(var i=e.getElementsByClassName(e.id+"e-de-table-cell-alignment"),n=0;n<i.length;n++){var r=i[n];r.classList.contains("e-de-table-alignment-active")&&t.classList(r,["e-de-tablecell-alignment"],["e-de-table-alignment-active"])}},e.prototype.formatNumericTextBox=function(e,t,i){e.format="Auto"===t||"Point"===t?"n2":"#'%'",e.step=1,e.decimals=2,e.value=i},e.prototype.getCellAlignment=function(){for(var e=this.cellTab.id,t=this.cellTab.getElementsByClassName(e+"e-de-table-cell-alignment"),i=0;i<t.length;i++)if(t[i].classList.contains("e-de-table-alignment-active"))return 0===i?"Top":1===i?"Center":"Bottom";return this.documentHelper.selection.cellFormat.verticalAlignment},e.prototype.onCellWidthChange=function(){this.cellFormat.preferredWidth=this.cellWidthBox.value},e.prototype.onCellWidthTypeChange=function(){var e,t=this.documentHelper.selection.start.paragraph.associatedCell.ownerTable,i=t.getOwnerWidth(!0),n=t.getTableClientWidth(i);"Percent"===this.cellWidthType.text&&"Percent"!==this.documentHelper.selection.cellFormat.preferredWidthType?(e=this.cellWidthBox.value/n*100,this.formatNumericTextBox(this.cellWidthBox,"Percent",e)):"Points"===this.cellWidthType.text&&"Point"!==this.documentHelper.selection.cellFormat.preferredWidthType?(e=n/100*this.cellWidthBox.value,this.formatNumericTextBox(this.cellWidthBox,"Point",e)):(e="#'%'"===this.cellWidthBox.format?"Points"===this.cellWidthType.text?n/100*this.cellWidthBox.value:this.cellWidthBox.value:"Percent"===this.cellWidthType.text?this.cellWidthBox.value/n*100:this.cellWidthBox.value,this.formatNumericTextBox(this.cellWidthBox,"Points"===this.cellWidthType.text?"Point":this.cellWidthType.text,e)),this.cellFormat.preferredWidthType="Points"===this.cellWidthType.text?"Point":this.cellWidthType.text},e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}this.dialog=void 0,this.target=void 0,this.cellAlignment=void 0,this.tableAlignment=void 0,this.documentHelper=void 0,this.preferCheckBox=void 0,this.tableWidthType=void 0,this.preferredWidth=void 0,this.rowHeightType=void 0,this.rowHeightCheckBox=void 0,this.rowHeight=void 0,this.cellWidthType=void 0,this.preferredCellWidthCheckBox=void 0,this.preferredCellWidth=void 0,this.tableTab=void 0,this.rowTab=void 0,this.cellTab=void 0,this.left=void 0,this.center=void 0,this.right=void 0,this.leftIndent=void 0,this.allowRowBreak=void 0,this.repeatHeader=void 0,this.cellTopAlign=void 0,this.cellCenterAlign=void 0,this.cellBottomAlign=void 0,this.tableFormat.destroy(),this.cellFormat.destroy(),this.tableFormat=void 0,this.cellFormat=void 0},e}(),Pi=function(){function e(e){var i=this;this.cellFormat=new q,this.tableFormat=new j,this.isShadingChanged=!1,this.applyBordersShadingsProperties=function(){var e=i.documentHelper.owner.tablePropertiesDialogModule,n=i.documentHelper.selection.start.paragraph.associatedCell,r=void 0;(i.checkClassName(i.previewDivTopTop)||i.checkClassName(i.previewDivTopBottom)||i.checkClassName(i.previewDivTopCenter)||i.checkClassName(i.previewDivBottomcenter)||i.checkClassName(i.previewDivBottomLeft)||i.checkClassName(i.previewDivBottomRight)||i.checkClassName(i.previewDivDiagonalRight)||i.checkClassName(i.previewDivLeftDiagonal))&&(r=new E,i.checkClassName(i.previewDivTopTop)&&(r.top=i.getBorder()),i.checkClassName(i.previewDivTopBottom)&&(r.bottom=i.getBorder()),i.checkClassName(i.previewDivBottomLeft)&&(r.left=i.getBorder()),i.checkClassName(i.previewDivBottomRight)&&(r.right=i.getBorder()),i.checkClassName(i.previewDivTopCenter)&&(r.horizontal=i.getBorder()),i.checkClassName(i.previewDivBottomcenter)&&(r.vertical=i.getBorder()),i.checkClassName(i.previewDivLeftDiagonal)&&(r.diagonalDown=i.getBorder()),i.checkClassName(i.previewDivDiagonalRight)&&(r.diagonalUp=i.getBorder()));var o=new _,s=i.documentHelper.owner.editorModule;if(o.backgroundColor=i.shadingColorPicker.value,0===i.ulelementShading.index)i.applyTo=0,e&&(e.isCellBordersAndShadingUpdated=!0),i.cellFormat.borders=new E,t.isNullOrUndefined(r)?i.noneDiv.classList.contains("e-de-table-border-inside-setting-click")&&s.applyBordersInternal(i.cellFormat.borders,new E):s.applyBordersInternal(i.cellFormat.borders,r),t.isNullOrUndefined(n.cellFormat.shading)||(o.foregroundColor=n.cellFormat.shading.foregroundColor,o.textureStyle=n.cellFormat.shading.textureStyle),i.cellFormat.shading=new _,s.applyShading(i.cellFormat.shading,o);else{e&&(e.isTableBordersAndShadingUpdated=!0),i.applyTo=1;var a=i.documentHelper.owner.selection.tableFormat.table.tableFormat;i.tableFormat.copyFormat(a),i.tableFormat.borders=new E,t.isNullOrUndefined(r)?i.noneDiv.classList.contains("e-de-table-border-inside-setting-click")&&s.applyBordersInternal(i.tableFormat.borders,new E):s.applyBordersInternal(i.tableFormat.borders,r),t.isNullOrUndefined(a.shading)||(o.foregroundColor=a.shading.foregroundColor,o.textureStyle=a.shading.textureStyle),i.tableFormat.shading=new _,i.isShadingChanged=a.shading.backgroundColor!==o.backgroundColor,s.applyShading(i.tableFormat.shading,o)}i.applyFormat(),i.closeDialog()},this.closeDialog=function(){i.documentHelper.dialog.hide(),i.closeBordersShadingsDialog()},this.closeBordersShadingsDialog=function(){i.documentHelper.dialog2.element.style.pointerEvents="",i.documentHelper.updateFocus()},this.handleSettingCheckBoxAction=function(e){var t=e.target.id,n=i.target.id;t===n+"_None_Div"||t===n+"_None_Div_Container"||t===n+"_None_Div_Transparent"?(i.updateClassForSettingDivElements(),i.noneDiv.classList.add("e-de-table-border-inside-setting-click"),i.setSettingPreviewDivElement("none")):t===n+"_Box_Div"||t===n+"_Box_Div_Container"||t===n+"_Box_Div_Transparent"?(i.updateClassForSettingDivElements(),i.boxDiv.classList.add("e-de-table-border-inside-setting-click"),i.setSettingPreviewDivElement("box")):t===n+"_All_Div"||t===n+"_All_Div_Container"||t===n+"_All_Div_Transparent"?(i.updateClassForSettingDivElements(),i.allDiv.classList.add("e-de-table-border-inside-setting-click"),i.setSettingPreviewDivElement("all")):(i.updateClassForSettingDivElements(),i.customDiv.classList.add("e-de-table-border-inside-setting-click"),i.setSettingPreviewDivElement("customDiv"))},this.handlePreviewCheckBoxAction=function(e){var t=e.target.id,n=i.target.id,r="e-de-table-border-inside-preview-click";i.customDiv.click(),t===n+"_Preview_Div_TopTop_Container"||t===n+"_Preview_Div_TopTop"||t===n+"_previewDivTopTopTransParent"?(i.handlePreviewCheckBoxShowHide(n,r,i.previewDivTopTop),i.showHidePreviewDivElements(n,r,"_Preview_Div","_Preview_Div_TopTop","TopTop")):t===n+"_Preview_Div_TopCenter_Container"||t===n+"_Preview_Div_TopCenter"||t===n+"_previewDivTopCenterTransParent"?(i.handlePreviewCheckBoxShowHide(n,r,i.previewDivTopCenter),i.showHidePreviewDivElements(n,r,"_Preview_Div_Horizontal","_Preview_Div_TopCenter","TopCenter")):t===n+"_Preview_Div_TopBottom_Container"||t===n+"_Preview_Div_TopBottom"||t===n+"_previewDivTopBottomTransParent"?(i.handlePreviewCheckBoxShowHide(n,r,i.previewDivTopBottom),i.showHidePreviewDivElements(n,r,"_Preview_Div","_Preview_Div_TopBottom","TopBottom")):t===n+"_Preview_Div_LeftDiagonal_Container"||t===n+"_Preview_Div_LeftDiagonal"||t===n+"_previewDivLeftDiagonalTransParent"?(i.handlePreviewCheckBoxShowHide(n,r,i.previewDivLeftDiagonal),i.showHidePreviewDivElements(n,r,"_Preview_Div_Left_Diagonal","_Preview_Div_LeftDiagonal","LeftDiagonal")):t===n+"_Preview_Div_BottomLeft_Container"||t===n+"_Preview_Div_BottomLeft"||t===n+"_previewDivBottomLeftTransparent"?(i.handlePreviewCheckBoxShowHide(n,r,i.previewDivBottomLeft),i.showHidePreviewDivElements(n,r,"_Preview_Div","_Preview_Div_BottomLeft","BottomLeft")):t===n+"_Preview_Div_BottomCenter_Container"||t===n+"_Preview_Div_BottomCenter"||t===n+"_previewDivBottomcenterTransparent"?(i.handlePreviewCheckBoxShowHide(n,r,i.previewDivBottomcenter),i.showHidePreviewDivElements(n,r,"_Preview_Div_Vertical","_Preview_Div_BottomCenter","BottomCenter")):t===n+"_Preview_Div_BottomRight_Container"||t===n+"_Preview_Div_BottomRight"||t===n+"_previewDivBottomRightTransparent"?(i.handlePreviewCheckBoxShowHide(n,r,i.previewDivBottomRight),i.showHidePreviewDivElements(n,r,"_Preview_Div","_Preview_Div_BottomRight","BottomRight")):t!==n+"_Preview_Div_RightDiagonal_Container"&&t!==n+"_Preview_Div_RightDiagonal"&&t!==n+"_previewDivDiagonalRightTransparent"||(i.handlePreviewCheckBoxShowHide(n,r,i.previewDivDiagonalRight),i.showHidePreviewDivElements(n,r,"_Preview_Div_Right_Diagonal","_Preview_Div_RightDiagonal","RightDiagonal"))},this.applyTableCellPreviewBoxes=function(){i.customDiv.click(),t.isNullOrUndefined(i.ulelementShading)||(0===i.ulelementShading.index?(i.previewDivBottomcenterContainer.style.display="none",i.previewDivTopCenterContainer.style.display="none",i.previewVerticalDiv.style.display="none",i.previewHorizontalDiv.style.display="none",i.previewDivLeftDiagonal.style.display="",i.previewDivDiagonalRight.style.display="",i.previewDivBottomRightContainer.style.left="80px"):(i.previewDivLeftDiagonal.style.display="none",i.previewDivDiagonalRight.style.display="none",i.previewDivBottomcenterContainer.style.display="",i.previewDivTopCenterContainer.style.display="",i.previewVerticalDiv.style.display="",i.previewHorizontalDiv.style.display="",i.previewDivBottomRightContainer.style.left="110px"))},this.applyPreviewTableBackgroundColor=function(e){if(!t.isNullOrUndefined(e.currentValue)){var n=e.currentValue.hex;i.previewDiv.style.backgroundColor=n}},this.applyPreviewTableBorderColor=function(e){if(!t.isNullOrUndefined(e.currentValue)){var n=e.currentValue.hex;i.previewDiv.style.borderColor=n,i.previewRightDiagonalDiv.style.backgroundColor=n,i.previewLeftDiagonalDiv.style.backgroundColor=n,i.previewVerticalDiv.style.backgroundColor=n,i.previewHorizontalDiv.style.backgroundColor=n}},this.documentHelper=e}return e.prototype.getModuleName=function(){return"BordersAndShadingDialog"},e.prototype.initBordersAndShadingsDialog=function(e,i){this.target=t.createElement("div",{id:this.documentHelper.owner.containerId+"_table_border_shadings",className:"e-de-table-border-shading-dlg"});var n,r=t.createElement("div",{innerHTML:e.getConstant("Borders"),styles:"position: absolute;top: 65px;",id:this.target.id+"_border_label",className:"e-de-table-border-heading"}),o=t.createElement("div",{styles:"display: inline-block;position: absolute;top: 105px;width: 100px;height: 235px;border-style: none;",id:this.target.id+"_border_settings"});n=i?"left: 148px;":"left: 125px;";var l,d=t.createElement("div",{styles:"display: inline-block;position: absolute;"+n+"top: 125px;width: 150px;height: 235px;padding-left: 40px;border-style: none;padding-right: 40px;",id:this.target.id+"_border_style"});l=i?"right: 342px;":"left: 339px;";var h=t.createElement("div",{styles:"display: inline-block;position: absolute;"+l+"top: 87px;width: 180px;height: 235px;padding: 0px;border-style: none;",id:this.target.id+"_border_preview"}),c=t.createElement("div",{innerHTML:e.getConstant("Style"),styles:"width: 100%;padding-bottom: 10px;",className:"e-de-table-element-subheading"}),p=t.createElement("select",{id:this.target.id+"_border_style_dropDown"});p.innerHTML="<option>None</option><option>Single</option><option>Dot</option><option>DashSmallGap</option><option>DashLargeGap</option><option>DashDot</option><option>DashDotDot</option><option>Double</option><option>Triple</option><option>ThinThickSmallGap</option><option>ThickThinSmallGap</option><option>ThinThickThinSmallGap</option><option>ThinThickMediumGap</option><option>ThickThinMediumGap</option><option>ThinThickThinMediumGap</option><option>ThinThickLargeGap</option><option>ThickThinLargeGap</option><option>ThinThickThinLargeGap</option><option>SingleWavy</option><option>DoubleWavy</option><option>DashDotStroked</option><option>Emboss3D</option><option>Engrave3D</option><option>Outset</option><option>Inset</option><option>Thick</option>";var g,u=t.createElement("div",{innerHTML:e.getConstant("Width"),styles:"width:100%;padding-top: 20px;padding-bottom: 10px;",className:"e-de-table-element-subheading"}),m=t.createElement("input",{id:this.target.id+"_width"}),f=t.createElement("div",{innerHTML:e.getConstant("Color"),styles:"padding-top: 25px;",className:"e-de-table-setting-heading"}),v=t.createElement("input",{attrs:{type:"color"},id:this.target.id+"_border_color",styles:"width: 30px;position: absolute;left: 90px;",className:"e-dlg-clr-pkr-top"}),y=t.createElement("div",{innerHTML:e.getConstant("Setting"),styles:"width: 100%;position: absolute;",className:"e-de-table-setting-heading"}),b=t.createElement("div",{id:this.target.id+"_None_Div_Container",className:"e-de-table-border-none"});g=i?"padding-right:10px;":"padding-left:10px;",this.noneDiv=t.createElement("div",{id:this.target.id+"_None_Div",className:"e-de-table-border-inside-setting e-de-table-border-setting-genral"});var w=t.createElement("label",{innerHTML:e.getConstant("None"),className:"e-de-table-setting-labels-heading",styles:g+"top: 20px;position: absolute;",id:this.target.id+"_None_Div_Label"}),C=t.createElement("div",{id:this.target.id+"_Box_Div_Container",className:"e-de-table-border-box"});this.boxDiv=t.createElement("div",{id:this.target.id+"_Box_Div",className:"e-de-table-border-inside-setting e-de-table-border-setting-genral"});var x=t.createElement("label",{innerHTML:e.getConstant("Box"),className:"e-de-table-setting-labels-heading",styles:g+"top: 20px;position: absolute;",id:this.target.id+"_Box_Div_Label"}),F=t.createElement("div",{id:this.target.id+"_All_Div_Container",className:"e-de-table-border-all"});this.allDiv=t.createElement("div",{id:this.target.id+"_All_Div",className:"e-de-table-border-inside-setting e-de-table-border-setting-genral"});var P=t.createElement("label",{innerHTML:e.getConstant("All"),className:"e-de-table-setting-labels-heading",styles:g+"top: 25px;position: absolute;",id:this.target.id+"_All_Div_Label"}),T=t.createElement("div",{id:this.target.id+"_Custom_Div_Container",className:"e-de-table-border-custom"});this.customDiv=t.createElement("div",{id:this.target.id+"_Custom_Div",className:"e-de-table-border-inside-setting e-de-table-border-setting-genral"});var S=t.createElement("label",{innerHTML:e.getConstant("Custom"),className:"e-de-table-setting-labels-heading",styles:g+"top: 25px;position: absolute;",id:this.target.id+"_Custom_Div_Label"});this.noneDivTransparent=t.createElement("div",{id:this.target.id+"_None_Div_Transparent",className:"e-icons e-de-table-border-setting e-de-table-border-none-setting"}),this.boxDivTransparent=t.createElement("div",{id:this.target.id+"_Box_Div_Transparent",className:"e-icons e-de-table-border-setting e-de-table-border-box-setting"}),this.allDivTransparent=t.createElement("div",{id:this.target.id+"_All_Div_Transparent",className:"e-icons e-de-table-border-setting e-de-table-border-all-setting"}),this.customDivTransparent=t.createElement("div",{id:this.target.id+"_Custom_Div_Transparent",className:"e-icons e-de-table-border-setting e-de-table-border-custom-setting"}),i&&(this.noneDivTransparent.classList.add("e-de-rtl"),this.boxDivTransparent.classList.add("e-de-rtl"),this.allDivTransparent.classList.add("e-de-rtl"),this.customDivTransparent.classList.add("e-de-rtl"));var I;I=i?"margin-right: 10px;":"margin-left: 10px;";var N=t.createElement("div",{innerHTML:e.getConstant("Preview"),className:"e-de-table-setting-heading",styles:"position: absolute;top: 20px;"+I});this.previewDiv=t.createElement("div",{styles:"width: 80px;height: 80px;position: absolute; left: 50px;top: 50px;",id:this.target.id+"_Preview_Div",className:"e-de-border-dlg-preview-div"}),this.previewRightDiagonalDiv=t.createElement("div",{styles:"position: absolute;width:1px;height:113px;left: 90px;top: 34px;transform: rotate(135deg);",id:this.target.id+"_Preview_Div_Right_Diagonal",className:"e-de-border-dlg-preview-inside-divs"}),this.previewLeftDiagonalDiv=t.createElement("div",{styles:"position: absolute;width: 1px;height: 113px;left: 90px;top: 34px;transform:rotate(45deg);",id:this.target.id+"_Preview_Div_Left_Diagonal",className:"e-de-border-dlg-preview-inside-divs"}),this.previewVerticalDiv=t.createElement("div",{styles:"width: 1px;height: 81px;position: absolute;left: 90px;top: 50px;",id:this.target.id+"_Preview_Div_Vertical",className:"e-de-border-dlg-preview-inside-divs"}),this.previewHorizontalDiv=t.createElement("div",{styles:"width: 81px;height: 1px;position: absolute;left: 50px;top: 90px;",id:this.target.id+"_Preview_Div_Horizontal",className:"e-de-border-dlg-preview-inside-divs"});var E;E=i?"right: 10px;":"left: 10px;",this.previewDivTopTopContainer=t.createElement("div",{styles:"top: 50px;position: absolute;"+E,id:this.target.id+"_Preview_Div_TopTop_Container"}),this.previewDivTopTop=t.createElement("div",{id:this.target.id+"_Preview_Div_TopTop",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivTopCenterContainer=t.createElement("div",{styles:"top: 80px;position: absolute;"+E,id:this.target.id+"_Preview_Div_TopCenter_Container"}),this.previewDivTopCenter=t.createElement("div",{id:this.target.id+"_Preview_Div_TopCenter",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivTopBottomContainer=t.createElement("div",{styles:"top: 110px;position: absolute;"+E,id:this.target.id+"_Preview_Div_TopBottom_Container"}),this.previewDivTopBottom=t.createElement("div",{id:this.target.id+"_Preview_Div_TopBottom",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivLeftDiagonalContainer=t.createElement("div",{styles:"top: 145px;position: absolute;left: 10px;",id:this.target.id+"_Preview_Div_LeftDiagonal_Container"}),this.previewDivLeftDiagonal=t.createElement("div",{id:this.target.id+"_Preview_Div_LeftDiagonal",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"});var H,W,O;i?(H="left: 104px",W="left: 74px",O="left: 44px"):(H="left: 50px;",W="left : 80px;",O="left : 110px"),this.previewDivBottomLeftContainer=t.createElement("div",{styles:"top: 145px;position: absolute;"+H,id:this.target.id+"_Preview_Div_BottomLeft_Container"}),this.previewDivBottomLeft=t.createElement("div",{id:this.target.id+"_Preview_Div_BottomLeft",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivBottomcenterContainer=t.createElement("div",{styles:"top: 145px;position: absolute;"+W,id:this.target.id+"_Preview_Div_BottomCenter_Container"}),this.previewDivBottomcenter=t.createElement("div",{id:this.target.id+"_Preview_Div_BottomCenter",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivBottomRightContainer=t.createElement("div",{styles:"top: 145px;position: absolute;"+O,id:this.target.id+"_Preview_Div_BottomRight_Container"}),this.previewDivBottomRight=t.createElement("div",{id:this.target.id+"_Preview_Div_BottomRight",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivDiagonalRightContainer=t.createElement("div",{styles:"top: 145px; position: absolute; left: 110px;",id:this.target.id+"_Preview_Div_RightDiagonal_Container"}),this.previewDivDiagonalRight=t.createElement("div",{id:this.target.id+"_Preview_Div_RightDiagonal",className:"e-de-table-border-inside-preview e-de-table-border-preview-genral"}),this.previewDivTopTopTransParent=t.createElement("div",{id:this.target.id+"_previewDivTopTopTransParent",className:"e-icons e-de-table-border-preview e-de-table-border-toptop-alignment"}),this.previewDivTopCenterTransParent=t.createElement("div",{id:this.target.id+"_previewDivTopCenterTransParent",className:"e-icons e-de-table-border-preview e-de-table-border-topcenter-alignment"}),this.previewDivTopBottomTransParent=t.createElement("div",{id:this.target.id+"_previewDivTopBottomTransParent",className:"e-icons e-de-table-border-preview e-de-table-border-topbottom-alignment"}),this.previewDivLeftDiagonalTransParent=t.createElement("div",{id:this.target.id+"_previewDivLeftDiagonalTransParent",className:"e-icons e-de-table-border-preview e-de-table-border-diagionalup-alignment"}),this.previewDivBottomLeftTransparent=t.createElement("div",{id:this.target.id+"_previewDivBottomLeftTransparent",className:"e-icons e-de-table-border-preview e-de-table-border-bottomleft-alignment"}),this.previewDivBottomcenterTransparent=t.createElement("div",{id:this.target.id+"_previewDivBottomcenterTransparent",className:"e-icons e-de-table-border-preview e-de-table-border-bottomcenter-alignment"}),this.previewDivBottomRightTransparent=t.createElement("div",{id:this.target.id+"_previewDivBottomRightTransparent",className:"e-icons e-de-table-border-preview e-de-table-border-bottomright-alignment"}),this.previewDivDiagonalRightTransparent=t.createElement("div",{id:this.target.id+"_previewDivDiagonalRightTransparent",className:"e-icons e-de-table-border-preview e-de-table-border-diagionaldown-alignment"});var k;k=i?"left:60px;":"left:17px;",this.shadingContiner=t.createElement("div",{styles:"display:inline-block;position:absolute;"+k+";width:400px;height:100px;padding:0px;border-style: none;margin-left:10px;",id:this.target.id+"_shading_preview",className:"e-de-table-shading-preview"});var L,R=t.createElement("div",{innerHTML:e.getConstant("Shading"),className:"e-de-table-border-heading",styles:"padding-top: 30px;left: 5px;"}),B=t.createElement("div",{styles:"display:flex;"}),D=t.createElement("div",{innerHTML:e.getConstant("Fill"),className:"e-de-table-setting-heading e-de-table-border-fill",styles:"top: 50px;left: 10px;"}),A=t.createElement("input",{attrs:{type:"color"},id:this.target.id+"_shading_color",styles:"position: absolute;top: 75px;left: 40px;width: 30px;"});L=i?"left: 75px;":"left: 150px;";var M=t.createElement("div",{styles:"position:absolute;top:44px;"+L+"width:180px;"}),U=t.createElement("div",{styles:"width:100px;padding-bottom: 10px;",innerHTML:e.getConstant("Apply To"),className:"e-de-table-element-subheading"}),z=t.createElement("div",{styles:"width:100px;position:absolute;"}),V=t.createElement("select",{innerHTML:'<option value="Cell">'+e.getConstant("Cell")+'</option><option value="Table">'+e.getConstant("Table")+"</option>",id:this.target.id+"_shading"});z.appendChild(V),this.noneDiv.appendChild(this.noneDivTransparent),this.boxDiv.appendChild(this.boxDivTransparent),this.allDiv.appendChild(this.allDivTransparent),this.customDiv.appendChild(this.customDivTransparent),b.appendChild(this.noneDiv),b.appendChild(w),C.appendChild(this.boxDiv),C.appendChild(x),F.appendChild(this.allDiv),F.appendChild(P),T.appendChild(this.customDiv),T.appendChild(S),o.appendChild(y),o.appendChild(b),o.appendChild(C),o.appendChild(F),o.appendChild(T),this.previewDivBottomcenter.appendChild(this.previewDivBottomcenterTransparent),this.previewDivBottomRight.appendChild(this.previewDivBottomRightTransparent),this.previewDivBottomLeft.appendChild(this.previewDivBottomLeftTransparent),this.previewDivTopTop.appendChild(this.previewDivTopTopTransParent),this.previewDivTopCenter.appendChild(this.previewDivTopCenterTransParent),this.previewDivTopBottom.appendChild(this.previewDivTopBottomTransParent),this.previewDivDiagonalRight.appendChild(this.previewDivDiagonalRightTransparent),this.previewDivLeftDiagonal.appendChild(this.previewDivLeftDiagonalTransParent),this.previewDivBottomcenterContainer.appendChild(this.previewDivBottomcenter),this.previewDivBottomLeftContainer.appendChild(this.previewDivBottomLeft),this.previewDivBottomRightContainer.appendChild(this.previewDivBottomRight),this.previewDivDiagonalRightContainer.appendChild(this.previewDivDiagonalRight),this.previewDivLeftDiagonalContainer.appendChild(this.previewDivLeftDiagonal),this.previewDivTopBottomContainer.appendChild(this.previewDivTopBottom),this.previewDivTopCenterContainer.appendChild(this.previewDivTopCenter),this.previewDivTopTopContainer.appendChild(this.previewDivTopTop),h.appendChild(N),h.appendChild(this.previewDiv),h.appendChild(this.previewRightDiagonalDiv),h.appendChild(this.previewHorizontalDiv),h.appendChild(this.previewLeftDiagonalDiv),h.appendChild(this.previewVerticalDiv),h.appendChild(this.previewDivBottomcenterContainer),h.appendChild(this.previewDivBottomLeftContainer),h.appendChild(this.previewDivBottomRightContainer),h.appendChild(this.previewDivDiagonalRightContainer),h.appendChild(this.previewDivLeftDiagonalContainer),h.appendChild(this.previewDivTopBottomContainer),h.appendChild(this.previewDivTopCenterContainer),h.appendChild(this.previewDivTopTopContainer),M.appendChild(U),M.appendChild(z),B.appendChild(D),B.appendChild(A),B.appendChild(M),this.shadingContiner.appendChild(R),this.shadingContiner.appendChild(B),d.appendChild(c),d.appendChild(p),d.appendChild(u),d.appendChild(m),d.appendChild(f),d.appendChild(v),this.target.appendChild(r),this.target.appendChild(o),this.target.appendChild(d),this.target.appendChild(h),this.target.appendChild(this.shadingContiner),b.addEventListener("click",this.handleSettingCheckBoxAction),C.addEventListener("click",this.handleSettingCheckBoxAction),F.addEventListener("click",this.handleSettingCheckBoxAction),T.addEventListener("click",this.handleSettingCheckBoxAction),this.previewDivBottomcenterContainer.addEventListener("click",this.handlePreviewCheckBoxAction),this.previewDivBottomLeftContainer.addEventListener("click",this.handlePreviewCheckBoxAction),this.previewDivBottomRightContainer.addEventListener("click",this.handlePreviewCheckBoxAction),this.previewDivTopTopContainer.addEventListener("click",this.handlePreviewCheckBoxAction),this.previewDivTopBottomContainer.addEventListener("click",this.handlePreviewCheckBoxAction),this.previewDivTopCenterContainer.addEventListener("click",this.handlePreviewCheckBoxAction),this.previewDivDiagonalRightContainer.addEventListener("click",this.handlePreviewCheckBoxAction),this.previewDivLeftDiagonalContainer.addEventListener("click",this.handlePreviewCheckBoxAction),this.borderWidth=new a.NumericTextBox({value:0,min:0,max:6,decimals:2,width:150,enablePersistence:!1}),this.borderWidth.appendTo(m),this.borderStyle=new s.DropDownList({width:"150px",popupHeight:"150px",index:1,enableRtl:i}),this.borderStyle.appendTo(p),this.ulelementShading=new s.DropDownList({width:"150px",change:this.applyTableCellPreviewBoxes,index:1,enableRtl:i}),this.ulelementShading.appendTo(V),this.borderColorPicker=new a.ColorPicker({value:"#000000",change:this.applyPreviewTableBorderColor,enableRtl:i,locale:this.documentHelper.owner.locale,cssClass:"e-de-dlg-clr-picker"}),this.borderColorPicker.appendTo(v),this.shadingColorPicker=new a.ColorPicker({value:"#FFFFFF",change:this.applyPreviewTableBackgroundColor,enableRtl:i,locale:this.documentHelper.owner.locale,cssClass:"e-de-dlg-clr-picker"}),this.shadingColorPicker.appendTo(A),i&&D.classList.add("e-de-rtl")},e.prototype.applyFormat=function(){var e=this.documentHelper.owner.editorModule;e.initComplexHistory("BordersAndShading"),e.isBordersAndShadingDialog=!0,0===this.applyTo?e.onCellFormat(this.cellFormat):e.onTableFormat(this.tableFormat,this.isShadingChanged),t.isNullOrUndefined(this.documentHelper.owner.editorHistory.currentHistoryInfo)||this.documentHelper.owner.editorHistory.updateComplexHistory(),e.isBordersAndShadingDialog=!1},e.prototype.getBorder=function(){var e=new N;return e.color=this.borderColorPicker.value,e.lineStyle=this.borderStyle.text,e.lineWidth=this.borderWidth.value,e},e.prototype.checkClassName=function(e){return e.classList.contains("e-de-table-border-inside-preview-click")},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initBordersAndShadingsDialog(e,this.documentHelper.owner.enableRtl),this.loadBordersShadingsPropertiesDialog(),this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.header=e.getConstant("Borders and Shading"),this.documentHelper.dialog.beforeOpen=this.documentHelper.updateFocus,this.documentHelper.dialog.close=this.closeBordersShadingsDialog,this.documentHelper.dialog.position={X:"center",Y:"center"},this.documentHelper.dialog.width="auto",this.documentHelper.dialog.height="auto",this.documentHelper.dialog.buttons=[{click:this.applyBordersShadingsProperties,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-table-border-shading-okay",isPrimary:!0}},{click:this.closeDialog,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-table-border-shading-cancel"}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show()},e.prototype.updateClassForSettingDivElements=function(){for(var e=this.target.getElementsByClassName("e-de-table-border-inside-setting"),t=0;t<e.length;t++)if(-1!==e[t].className.indexOf("e-de-table-border-inside-setting-click")){var i=e[t].className;i=i.replace("e-de-table-border-inside-setting-click",""),e[t].className=i}},e.prototype.setSettingPreviewDivElement=function(e){switch(e){case"none":this.previewDivTopTop.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivTopCenter.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivTopBottom.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivLeftDiagonal.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivDiagonalRight.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivBottomRight.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivBottomLeft.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivBottomcenter.classList.remove("e-de-table-border-inside-preview-click"),this.isShowHidePreviewTableElements("none");break;case"box":this.previewDivTopCenter.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivLeftDiagonal.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivDiagonalRight.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivBottomcenter.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivTopTop.classList.add("e-de-table-border-inside-preview-click"),this.previewDivTopBottom.classList.add("e-de-table-border-inside-preview-click"),this.previewDivBottomRight.classList.add("e-de-table-border-inside-preview-click"),this.previewDivBottomLeft.classList.add("e-de-table-border-inside-preview-click"),this.isShowHidePreviewTableElements("box");break;case"all":this.previewDivLeftDiagonal.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivDiagonalRight.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivBottomcenter.classList.add("e-de-table-border-inside-preview-click"),this.previewDivTopTop.classList.add("e-de-table-border-inside-preview-click"),this.previewDivTopBottom.classList.add("e-de-table-border-inside-preview-click"),this.previewDivBottomRight.classList.add("e-de-table-border-inside-preview-click"),this.previewDivBottomLeft.classList.add("e-de-table-border-inside-preview-click"),this.previewDivTopCenter.classList.add("e-de-table-border-inside-preview-click"),this.isShowHidePreviewTableElements("all")}},e.prototype.isShowHidePreviewTableElements=function(e){switch(e){case"none":this.previewDiv.style.border="none",this.previewRightDiagonalDiv.style.display="none",this.previewLeftDiagonalDiv.style.display="none",this.previewHorizontalDiv.style.display="none",this.previewVerticalDiv.style.display="none";break;case"box":this.previewDiv.style.border="1px solid rgba(0, 0, 0, .54)",this.previewRightDiagonalDiv.style.display="none",this.previewLeftDiagonalDiv.style.display="none",this.previewHorizontalDiv.style.display="none",this.previewVerticalDiv.style.display="none";break;case"all":this.previewDiv.style.border="1px solid rgba(0, 0, 0, .54)",this.previewRightDiagonalDiv.style.display="none",this.previewLeftDiagonalDiv.style.display="none",this.previewHorizontalDiv.style.display="block",this.previewVerticalDiv.style.display="block"}},e.prototype.handlePreviewCheckBoxShowHide=function(e,t,i){i.classList.contains(t)?i.classList.remove(t):i.classList.add(t)},e.prototype.showHidePreviewDivElements=function(e,t,i,n,r){var o=document.getElementById(e+i),s=document.getElementById(e+n);"TopTop"===r?this.setPropertyPreviewDivElement(o,s,t,"border-top"):"TopCenter"===r?this.setPropertyPreviewDivElement(o,s,t,"display"):"TopBottom"===r?this.setPropertyPreviewDivElement(o,s,t,"border-bottom"):"LeftDiagonal"===r?this.setPropertyPreviewDivElement(o,s,t,"display"):"BottomLeft"===r?this.setPropertyPreviewDivElement(o,s,t,"border-left"):"BottomCenter"===r?this.setPropertyPreviewDivElement(o,s,t,"display"):"BottomRight"===r?this.setPropertyPreviewDivElement(o,s,t,"border-right"):"RightDiagonal"===r&&this.setPropertyPreviewDivElement(o,s,t,"display")},e.prototype.setPropertyPreviewDivElement=function(e,t,i,n){t.classList.contains(i)&&"border"===n.split("-")[0]?e.style[n]="1px solid rgba(0, 0, 0, .54)":t.classList.contains(i)&&"display"===n?e.style[n]="block":e.style[n]="none"},e.prototype.loadBordersShadingsPropertiesDialog=function(){var e,i,n,r,o=this.documentHelper.selection.tableFormat.table.tableFormat;t.isNullOrUndefined(o)||t.isNullOrUndefined(o.borders)||(this.cloneBorders(o.borders),t.isNullOrUndefined(o.borders)||t.isNullOrUndefined(o.borders.top)?(e=1,i="#000000",r=0,n="#000000"):(e=this.getLineStyle(o.borders.top.lineStyle),i=o.borders.top.color,r=o.borders.top.getLineWidth(),n=o.shading.backgroundColor)),this.borderColorPicker.value=i,this.shadingColorPicker.value=n;var s={target:this.borderColorPicker,ctrlKey:!1,shiftKey:!1,which:0},a={target:this.shadingColorPicker,ctrlKey:!1,shiftKey:!1,which:0};this.applyPreviewTableBackgroundColor(a),this.applyPreviewTableBorderColor(s),this.ulelementShading.index=1,this.previewDivLeftDiagonal.style.display="none",this.previewDivDiagonalRight.style.display="none",this.borderWidth.value=r,this.borderStyle.index=e},e.prototype.cloneBorders=function(e){var t=!1,i=!1,n=!1,r=!1,o=!1,s=!1,a=!1,l=!1,d=!1;null!==e&&(e.top&&(e.top.hasNoneStyle||"None"!==e.top.lineStyle)&&(t=!0),e.bottom&&(e.bottom.hasNoneStyle||"None"!==e.bottom.lineStyle)&&(i=!0),e.left&&(e.left.hasNoneStyle||"None"!==e.left.lineStyle)&&(n=!0),e.right&&(e.right.hasNoneStyle||"None"!==e.right.lineStyle)&&(r=!0),e.horizontal&&(e.horizontal.hasNoneStyle||"None"!==e.horizontal.lineStyle)&&(o=!0),e.vertical&&(e.vertical.hasNoneStyle||"None"!==e.vertical.lineStyle)&&(s=!0),e.diagonalDown&&(e.diagonalDown.hasNoneStyle||"None"!==e.diagonalDown.lineStyle)&&(a=!0),e.diagonalUp&&(e.diagonalUp.hasNoneStyle||"None"!==e.diagonalUp.lineStyle)&&(d=!0),t&&i&&n&&r?t&&i&&n&&r&&o&&s&&!d&&!a?t&&i&&n&&r&&o&&s&&!d&&!a&&(e.top.hasNoneStyle&&e.bottom.hasNoneStyle&&e.left.hasNoneStyle&&e.right.hasNoneStyle&&e.horizontal.hasNoneStyle&&e.vertical.hasNoneStyle?(this.setSettingPreviewDivElement("none"),this.customDiv.classList.remove("e-de-table-border-inside-setting-click"),this.noneDiv.classList.add("e-de-table-border-inside-setting-click"),this.boxDiv.classList.remove("e-de-table-border-inside-setting-click"),this.allDiv.classList.remove("e-de-table-border-inside-setting-click")):(this.setSettingPreviewDivElement("all"),this.allDiv.classList.add("e-de-table-border-inside-setting-click"),this.customDiv.classList.remove("e-de-table-border-inside-setting-click"),this.noneDiv.classList.remove("e-de-table-border-inside-setting-click"),this.boxDiv.classList.remove("e-de-table-border-inside-setting-click"))):n&&i&&t&&r&&!o&&!s?e.top.hasNoneStyle&&e.bottom.hasNoneStyle&&e.left.hasNoneStyle&&e.right.hasNoneStyle&&e.horizontal.hasNoneStyle&&e.vertical.hasNoneStyle?(this.setSettingPreviewDivElement("none"),this.boxDiv.classList.remove("e-de-table-border-inside-setting-click"),this.allDiv.classList.remove("e-de-table-border-inside-setting-click"),this.customDiv.classList.remove("e-de-table-border-inside-setting-click"),this.noneDiv.classList.add("e-de-table-border-inside-setting-click")):(this.setSettingPreviewDivElement("box"),this.customDiv.classList.remove("e-de-table-border-inside-setting-click"),this.noneDiv.classList.remove("e-de-table-border-inside-setting-click"),this.boxDiv.classList.add("e-de-table-border-inside-setting-click"),this.allDiv.classList.remove("e-de-table-border-inside-setting-click")):l=!0:l=!0,this.previewDivLeftDiagonal.classList.remove("e-de-table-border-inside-preview-click"),this.previewDivDiagonalRight.classList.remove("e-de-table-border-inside-preview-click"),l&&(this.customDiv.classList.add("e-de-table-border-inside-setting-click"),this.noneDiv.classList.remove("e-de-table-border-inside-setting-click"),this.boxDiv.classList.remove("e-de-table-border-inside-setting-click"),this.allDiv.classList.remove("e-de-table-border-inside-setting-click"),t?this.previewDivTopTop.classList.add("e-de-table-border-inside-preview-click"):this.previewDivTopTop.classList.remove("e-de-table-border-inside-preview-click"),i?this.previewDivTopBottom.classList.add("e-de-table-border-inside-preview-click"):this.previewDivTopBottom.classList.remove("e-de-table-border-inside-preview-click"),n?this.previewDivBottomLeft.classList.add("e-de-table-border-inside-preview-click"):this.previewDivBottomLeft.classList.remove("e-de-table-border-inside-preview-click"),r?this.previewDivBottomRight.classList.add("e-de-table-border-inside-preview-click"):this.previewDivBottomRight.classList.remove("e-de-table-border-inside-preview-click"),s?this.previewDivBottomcenter.classList.add("e-de-table-border-inside-preview-click"):this.previewDivBottomcenter.classList.remove("e-de-table-border-inside-preview-click"),o?this.previewDivTopCenter.classList.add("e-de-table-border-inside-preview-click"):this.previewDivTopCenter.classList.remove("e-de-table-border-inside-preview-click")))},e.prototype.getLineStyle=function(e){switch(e){case"Single":return 1;case"Dot":return 2;case"DashSmallGap":return 3;case"DashLargeGap":return 4;case"DashDot":return 5;case"DashDotDot":return 6;case"Double":return 7;case"Triple":return 8;case"ThinThickSmallGap":return 9;case"ThickThinSmallGap":return 10;case"ThinThickThinSmallGap":return 11;case"ThinThickMediumGap":return 12;case"ThickThinMediumGap":return 13;case"ThinThickThinMediumGap":return 14;case"ThinThickLargeGap":return 15;case"ThickThinLargeGap":return 16;case"ThinThickThinLargeGap":return 17;case"SingleWavy":return 18;case"DoubleWavy":return 19;case"DashDotStroked":return 20;case"Emboss3D":return 21;case"Engrave3D":return 22;case"Outset":return 23;case"Inset":return 24;case"Thick":return 25}return 0},e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}this.cellFormat&&(this.cellFormat.destroy(),this.cellFormat=void 0),this.tableFormat&&(this.tableFormat.destroy(),this.tableFormat=void 0),this.dialog=void 0,this.target=void 0,t.isNullOrUndefined(this.borderStyle)||this.borderStyle.destroy(),this.borderStyle=void 0,t.isNullOrUndefined(this.borderColorPicker)||this.borderColorPicker.destroy(),this.borderColorPicker=void 0,t.isNullOrUndefined(this.shadingColorPicker)||this.shadingColorPicker.destroy(),this.shadingColorPicker=void 0,t.isNullOrUndefined(this.ulelementShading)||this.ulelementShading.destroy(),this.ulelementShading=void 0,this.noneDivTransparent=void 0,this.boxDivTransparent=void 0,this.allDivTransparent=void 0,this.customDivTransparent=void 0,this.previewDiv=void 0,this.previewRightDiagonalDiv=void 0,this.previewLeftDiagonalDiv=void 0,this.previewVerticalDiv=void 0,this.previewHorizontalDiv=void 0,this.previewDivTopTopContainer=void 0,this.previewDivTopTop=void 0,this.previewDivTopCenterContainer=void 0,this.previewDivTopCenter=void 0,this.previewDivTopBottomContainer=void 0,this.previewDivTopBottom=void 0,this.previewDivLeftDiagonalContainer=void 0,this.previewDivLeftDiagonal=void 0,this.previewDivBottomLeftContainer=void 0,this.previewDivBottomLeft=void 0,this.previewDivBottomcenterContainer=void 0,this.previewDivBottomcenter=void 0,this.previewDivBottomRightContainer=void 0,this.previewDivBottomRight=void 0,this.previewDivDiagonalRightContainer=void 0,this.previewDivDiagonalRight=void 0,this.previewDivTopTopTransParent=void 0,this.previewDivTopCenterTransParent=void 0,this.previewDivTopBottomTransParent=void 0,this.previewDivLeftDiagonalTransParent=void 0,this.previewDivBottomLeftTransparent=void 0,this.previewDivBottomcenterTransparent=void 0,this.previewDivBottomRightTransparent=void 0,this.previewDivDiagonalRightTransparent=void 0,this.shadingContiner=void 0,this.noneDiv=void 0,this.customDiv=void 0,this.allDiv=void 0,this.boxDiv=void 0},e}(),Ti=function(){function e(e){var i=this;this.applyTableCellProperties=function(){var e=i.documentHelper.selection.tableFormat;t.isNullOrUndefined(i.bottomMarginBox.value||i.leftMarginBox.value||i.rightMarginBox.value||i.topMarginBox.value||i.cellSpaceTextBox.value)||e.bottomMargin===i.bottomMarginBox.value&&e.leftMargin===i.leftMarginBox.value&&e.rightMargin===i.rightMarginBox.value&&e.topMargin===i.topMarginBox.value&&e.cellSpacing===i.cellSpaceTextBox.value||(i.documentHelper.owner.tablePropertiesDialogModule.isTableOptionsUpdated=!0,i.applyTableOptions(i.tableFormat),i.documentHelper.owner.tablePropertiesDialogModule.applyTableSubProperties()),i.closeCellMarginsDialog()},this.closeCellMarginsDialog=function(){i.documentHelper.dialog.hide(),i.documentHelper.dialog.element.style.pointerEvents="",i.documentHelper.updateFocus()},this.changeAllowSpaceCheckBox=function(){i.allowSpaceCheckBox.checked?i.cellSpaceTextBox.enabled=!0:i.cellSpaceTextBox.enabled=!1},this.removeEvents=function(){i.documentHelper.dialog2.element.style.pointerEvents="",i.documentHelper.updateFocus()},this.documentHelper=e}return Object.defineProperty(e.prototype,"tableFormat",{get:function(){return t.isNullOrUndefined(this.tableFormatIn)?this.tableFormatIn=new j:this.tableFormatIn},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"TableOptionsDialog"},e.prototype.initTableOptionsDialog=function(e,i){this.target=t.createElement("div",{id:this.documentHelper.owner.containerId+"_insertCellMarginsDialog",className:"e-de-table-options-dlg"});var n=t.createElement("div",{className:"e-de-table-options-dlg-div"}),o=t.createElement("Label",{id:this.target.id+"_innerDivLabel",className:"e-de-cell-dia-options-label",innerHTML:e.getConstant("Default cell margins")});n.appendChild(o),Si.getCellMarginDialogElements(this,n,e);var s=t.createElement("div",{styles:"width: 475px; position: relative;"}),l=t.createElement("Label",{className:"e-de-cell-dia-options-label",id:this.target.id+"_cellSpaceLabel"});l.innerHTML=e.getConstant("Default cell spacing"),s.appendChild(l);var d,h=t.createElement("TABLE",{styles:"height: 30px;"}),c=t.createElement("tr"),p=t.createElement("td"),g=t.createElement("input",{attrs:{type:"checkbox"},id:this.target.id+"_cellcheck"});d=i?"padding-right:15px;":"padding-left:14px;";var u=t.createElement("td",{styles:d});this.cellspacingTextBox=t.createElement("input",{attrs:{type:"text"},id:this.target.id+"_cellspacing"}),p.appendChild(g),u.appendChild(this.cellspacingTextBox),c.appendChild(p),c.appendChild(u),h.appendChild(c),s.appendChild(h);var m=document.createElement("div");this.target.appendChild(s),this.target.appendChild(m),this.cellSpaceTextBox=new a.NumericTextBox({value:0,min:0,max:264.5,width:163,decimals:2,enablePersistence:!1}),this.cellSpaceTextBox.appendTo(this.cellspacingTextBox),this.allowSpaceCheckBox=new r.CheckBox({label:e.getConstant("Allow spacing between cells"),change:this.changeAllowSpaceCheckBox,enableRtl:i,cssClass:"e-de-tbl-margin-sub-header"}),this.allowSpaceCheckBox.appendTo(g)},e.prototype.loadCellMarginsDialog=function(){var e=this.documentHelper.selection.tableFormat;this.cellSpaceTextBox.value=e.cellSpacing,this.bottomMarginBox.value=e.bottomMargin,this.topMarginBox.value=e.topMargin,this.rightMarginBox.value=e.rightMargin,this.leftMarginBox.value=e.leftMargin,e.cellSpacing>0?(this.allowSpaceCheckBox.checked=!0,this.cellSpaceTextBox.enabled=!0):(this.allowSpaceCheckBox.checked=!1,this.cellSpaceTextBox.enabled=!1)},e.prototype.applySubTableOptions=function(e){this.documentHelper.owner.editorHistory.initComplexHistory(this.documentHelper.selection,"TableMarginsSelection"),this.applyTableOptionsHistory(e),t.isNullOrUndefined(this.documentHelper.owner.editorHistory.currentHistoryInfo)||this.documentHelper.owner.editorHistory.updateComplexHistory()},e.prototype.applyTableOptionsHelper=function(e){this.applySubTableOptionsHelper(e)},e.prototype.applyTableOptionsHistory=function(e){this.documentHelper.owner.editorModule.initHistory("TableOptions"),this.applySubTableOptionsHelper(e)},e.prototype.applySubTableOptionsHelper=function(e){var i=this.documentHelper.selection.start.currentWidget.paragraph.associatedCell.ownerTable,n=(i=i.combineWidget(this.documentHelper.owner.viewer)).tableFormat;t.isNullOrUndefined(this.documentHelper.owner.editorHistory.currentBaseHistoryInfo)||this.documentHelper.owner.editorHistory.currentBaseHistoryInfo.addModifiedTableOptions(n),n.cellSpacing=e.cellSpacing,n.leftMargin=e.leftMargin,n.topMargin=e.topMargin,n.rightMargin=e.rightMargin,n.bottomMargin=e.bottomMargin,this.documentHelper.owner.tablePropertiesDialogModule.calculateGridValue(i)},e.prototype.applyTableOptions=function(e){e.leftMargin=this.leftMarginBox.value,e.topMargin=this.topMarginBox.value,e.bottomMargin=this.bottomMarginBox.value,e.rightMargin=this.rightMarginBox.value,this.allowSpaceCheckBox.checked&&(e.cellSpacing=this.cellSpaceTextBox.value)},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initTableOptionsDialog(e,this.documentHelper.owner.enableRtl),this.loadCellMarginsDialog(),this.documentHelper.dialog.header=e.getConstant("Table Options"),this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.beforeOpen=void 0,this.documentHelper.dialog.position={X:"center",Y:"center"},this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.open=void 0,this.documentHelper.dialog.beforeOpen=this.documentHelper.updateFocus,this.documentHelper.dialog.close=this.removeEvents,this.documentHelper.dialog.buttons=[{click:this.applyTableCellProperties,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-table-cell-okay",isPrimary:!0}},{click:this.closeCellMarginsDialog,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-table-cell-cancel"}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show()},e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}this.dialog=void 0,this.target=void 0,this.documentHelper=void 0,this.cellspacingTextBox=void 0,this.allowSpaceCheckBox=void 0},e}(),Si=function(){function e(e){var i=this;this.removeEvents=function(){i.documentHelper.dialog2.element.style.pointerEvents="",i.documentHelper.updateFocus()},this.changeSameAsTable=function(){i.sameAsTableCheckBox.checked?(i.leftMarginBox.enabled=!1,i.rightMarginBox.enabled=!1,i.bottomMarginBox.enabled=!1,i.topMarginBox.enabled=!1):(i.leftMarginBox.enabled=!0,i.rightMarginBox.enabled=!0,i.bottomMarginBox.enabled=!0,i.topMarginBox.enabled=!0)},this.applyTableCellProperties=function(){var e=i.documentHelper.selection.cellFormat;t.isNullOrUndefined(i.bottomMarginBox.value||i.leftMarginBox.value||i.rightMarginBox.value||i.topMarginBox.value)||e.bottomMargin===i.bottomMarginBox.value&&e.leftMargin===i.leftMarginBox.value&&e.rightMargin===i.rightMarginBox.value&&e.topMargin===i.topMarginBox.value||(i.documentHelper.owner.tablePropertiesDialogModule.isCellOptionsUpdated=!0,i.applyTableOptions(i.cellFormat),i.documentHelper.owner.tablePropertiesDialogModule.applyTableSubProperties()),i.closeCellMarginsDialog()},this.closeCellMarginsDialog=function(){i.documentHelper.dialog.hide(),i.documentHelper.dialog.element.style.pointerEvents=""},this.documentHelper=e}return Object.defineProperty(e.prototype,"cellFormat",{get:function(){return t.isNullOrUndefined(this.cellFormatIn)?this.cellFormatIn=new q:this.cellFormatIn},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"CellOptionsDialog"},e.prototype.initCellMarginsDialog=function(i,n){this.owner=this.documentHelper.owner.viewer,this.target=t.createElement("div",{id:this.documentHelper.owner.containerId+"_tableCellMarginsDialog",className:"e-de-table-cell-margin-dlg"});var o=t.createElement("div",{styles:"width: 504px;position: relative;height: auto;"}),s=t.createElement("Label",{className:"e-de-cell-dia-options-label",id:this.target.id+"_innerDivLabel"});s.innerHTML=i.getConstant("Cell margins"),o.appendChild(s);var a=t.createElement("TABLE",{styles:"padding-bottom: 8px;padding-top: 8px;",className:"e-de-cell-margin-top"}),l=t.createElement("tr"),d=t.createElement("td",{className:"e-de-tbl-btn-separator"}),h=t.createElement("input",{attrs:{type:"checkbox"},id:this.target.id+"_sameAsCheckBox"});d.appendChild(h),l.appendChild(d),a.appendChild(l),o.appendChild(a),e.getCellMarginDialogElements(this,o,i);var c=document.createElement("div");this.target.appendChild(c),this.sameAsTableCheckBox=new r.CheckBox({label:i.getConstant("Same as the whole table"),change:this.changeSameAsTable,enableRtl:n}),this.sameAsTableCheckBox.appendTo(h),this.sameAsTableCheckBox.addEventListener("change",this.changeSameAsTable)},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),this.target||this.initCellMarginsDialog(e,this.documentHelper.owner.enableRtl),this.loadCellMarginsDialog(),this.documentHelper.dialog.header=e.getConstant("Cell Options"),this.documentHelper.dialog.position={X:"center",Y:"top"},this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.beforeOpen=void 0,this.documentHelper.dialog.open=void 0,this.documentHelper.dialog.close=this.removeEvents,this.documentHelper.dialog.buttons=[{click:this.applyTableCellProperties,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-table-cell-margin-okay",isPrimary:!0}},{click:this.closeCellMarginsDialog,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-table-cell-margin-cancel"}}],this.documentHelper.dialog.show()},e.prototype.loadCellMarginsDialog=function(){var e=this.documentHelper.selection.cellFormat;if(this.sameAsTable=t.isNullOrUndefined(e.leftMargin||e.topMargin||e.rightMargin||e.bottomMargin),this.sameAsTable){var i=this.documentHelper.selection.tableFormat;this.loadCellProperties(i,!1,!0)}else this.loadCellProperties(e,!0,!1)},e.prototype.loadCellProperties=function(e,t,i){this.leftMarginBox.value=e.leftMargin,this.rightMarginBox.value=e.rightMargin,this.topMarginBox.value=e.topMargin,this.bottomMarginBox.value=e.bottomMargin,this.leftMarginBox.enabled=t,this.rightMarginBox.enabled=t,this.topMarginBox.enabled=t,this.bottomMarginBox.enabled=t,this.sameAsTableCheckBox.checked=i},e.prototype.applySubCellOptions=function(e){this.documentHelper.owner.editorHistory.initComplexHistory(this.documentHelper.selection,"CellMarginsSelection"),this.documentHelper.owner.editorModule.initHistory("CellOptions"),this.documentHelper.selection.start.paragraph.associatedCell.ownerTable.combineWidget(this.owner),this.applyCellMarginValue(this.documentHelper.selection.start.paragraph.associatedCell.ownerRow.combineWidget(this.owner),this.documentHelper.selection.start,this.documentHelper.selection.end,e),this.documentHelper.owner.editorModule.reLayout(this.documentHelper.selection,!1),t.isNullOrUndefined(this.documentHelper.owner.editorHistory.currentHistoryInfo)||this.documentHelper.owner.editorHistory.updateComplexHistory()},e.prototype.applyCellMarginValue=function(e,i,n,r){if(this.applyCellMarginsInternal(e,r),n.paragraph.associatedCell.ownerRow!==e){var o=e.nextWidget;t.isNullOrUndefined(o)||this.applyCellMarginValue(o,i,n,r)}},e.prototype.applyCellMarginsInternal=function(e,i){if(!t.isNullOrUndefined(this.documentHelper.owner.editorHistory.currentBaseHistoryInfo)){var n=e.childWidgets[0].cellFormat;i=this.documentHelper.owner.editorHistory.currentBaseHistoryInfo.addModifiedCellOptions(n,i,e.ownerTable)}t.isNullOrUndefined(i)||this.applyCellMarginsForCells(e,i)},e.prototype.applyCellMarginsForCells=function(e,t){var i=e.childWidgets;this.iterateCells(i,t)},e.prototype.iterateCells=function(e,t){for(var i=0;i<e.length;i++)this.applySubCellMargins(e[i].cellFormat,t);this.documentHelper.owner.tablePropertiesDialogModule.calculateGridValue(e[0].ownerTable)},e.prototype.applySubCellMargins=function(e,t){e.leftMargin=t.leftMargin,e.topMargin=t.topMargin,e.rightMargin=t.rightMargin,e.bottomMargin=t.bottomMargin},e.prototype.applyTableOptions=function(e){this.sameAsTableCheckBox.checked||(e.leftMargin=this.leftMarginBox.value,e.topMargin=this.topMarginBox.value,e.bottomMargin=this.bottomMarginBox.value,e.rightMargin=this.rightMarginBox.value)},e.prototype.destroy=function(){if(!t.isNullOrUndefined(this.target)){this.target.parentElement&&this.target.parentElement.removeChild(this.target);for(var e=0;e<this.target.childNodes.length;e++)this.target.removeChild(this.target.childNodes[e]),e--;this.target=void 0}this.dialog=void 0,this.target=void 0,this.documentHelper=void 0,this.sameAsTableCheckBox=void 0},e.getCellMarginDialogElements=function(e,i,n){if(!t.isNullOrUndefined(e)){var r=t.createElement("TABLE",{className:"e-de-cell-margin-top"}),o=t.createElement("tr",{styles:"height: 50px;"}),s=t.createElement("td"),l=t.createElement("label",{innerHTML:n.getConstant("Top"),className:"e-de-cell-dia-label-common",id:e.target.id+"_TopLabel"}),d=t.createElement("input",{attrs:{type:"text"},styles:"width:100%",id:e.target.id+"_Top"});s.appendChild(l),s.appendChild(d);var h=t.createElement("td",{className:"e-de-tbl-btn-separator"}),c=t.createElement("label",{innerHTML:n.getConstant("Left"),className:"e-de-cell-dia-label-common",id:e.target.id+"_leftLabel"}),p=t.createElement("input",{attrs:{type:"text"},styles:"width:100%",id:e.target.id+"_left"});h.appendChild(c),h.appendChild(p),o.appendChild(s),o.appendChild(h);var g=t.createElement("tr",{styles:"height: 50px;"}),u=t.createElement("td",{styles:"width:40%;"}),m=t.createElement("label",{innerHTML:n.getConstant("Bottom"),className:"e-de-cell-dia-label-common",id:e.target.id+"_bottomLabel"}),f=t.createElement("input",{attrs:{type:"text"},styles:"width:100%",id:e.target.id+"_bottom"});u.appendChild(m),u.appendChild(f);var v=t.createElement("td",{styles:"width:40%;"}),y=t.createElement("label",{innerHTML:n.getConstant("Right"),id:e.target.id+"_rightLabel",className:"e-de-cell-dia-label-common"}),b=t.createElement("input",{attrs:{type:"text"},styles:"width:100%",id:e.target.id+"_right"});v.appendChild(y),v.appendChild(b),g.appendChild(u),g.appendChild(v),r.appendChild(o),r.appendChild(g),i.appendChild(r),e.target.appendChild(i),e.topMarginBox=new a.NumericTextBox({value:0,min:0,max:1584,width:175,decimals:2,enablePersistence:!1}),e.topMarginBox.appendTo(d),e.leftMarginBox=new a.NumericTextBox({value:0,min:0,max:1584,width:175,decimals:2,enablePersistence:!1}),e.leftMarginBox.appendTo(p),e.bottomMarginBox=new a.NumericTextBox({value:0,min:0,max:1584,width:175,decimals:2,enablePersistence:!1}),e.bottomMarginBox.appendTo(f),e.rightMarginBox=new a.NumericTextBox({value:0,min:0,max:1584,width:175,decimals:2,enablePersistence:!1}),e.rightMarginBox.appendTo(b)}},e}(),Ii=function(){function e(e){var t=this;this.modifyStyles=function(){t.documentHelper.dialog.hide(),t.documentHelper.owner.styleDialogModule.show(t.styleName,t.localValue.getConstant("Modify Style"))},this.selectHandler=function(e){t.styleName=e.text},this.addNewStyles=function(){t.documentHelper.dialog.hide(),t.documentHelper.owner.styleDialogModule.show()},this.documentHelper=e}return e.prototype.getModuleName=function(){return"StylesDialog"},e.prototype.initStylesDialog=function(e,i,n){var s=this.documentHelper.owner.containerId+"_insert_styles";this.target=t.createElement("div",{id:s,className:"e-de-styles"});var a=e.getConstant("Styles"),l=t.createElement("div",{innerHTML:a,className:"e-styles-dlgfields"});this.target.appendChild(l);var d=t.createElement("div",{className:"e-styles-common"});this.target.appendChild(d);var h=t.createElement("div",{className:"e-styles-list"});d.appendChild(h),n&&h.classList.add("e-de-rtl");var c=t.createElement("div",{className:"e-styles-listViewDiv",id:"styles_listview"});h.appendChild(c),this.listviewInstance=new o.ListView({dataSource:i,cssClass:"e-styles-listview"}),this.listviewInstance.appendTo(c),this.listviewInstance.addEventListener("select",this.selectHandler);var p=t.createElement("div",{className:"e-styles-button"});d.appendChild(p);var g=t.createElement("div",{className:"e-styles-addbutton"});p.appendChild(g);var u=t.createElement("button",{innerHTML:e.getConstant("New")+"...",id:"new",attrs:{type:"button"}});g.appendChild(u),new r.Button({cssClass:"e-button-custom"}).appendTo(u),u.addEventListener("click",this.addNewStyles);var m=t.createElement("div",{className:"e-styles-addbutton"});p.appendChild(m);var f=t.createElement("button",{innerHTML:e.getConstant("Modify")+"...",id:"modify",attrs:{type:"button"}});m.appendChild(f),new r.Button({cssClass:"e-button-custom"}).appendTo(f),f.addEventListener("click",this.modifyStyles)},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale);var i=this.updateStyleNames();this.localValue=e,this.initStylesDialog(e,i,this.documentHelper.owner.enableRtl),this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.beforeOpen=this.documentHelper.updateFocus,this.documentHelper.dialog.close=this.documentHelper.updateFocus,this.documentHelper.dialog.header=e.getConstant("Styles"),this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.buttons=[{click:this.hideObjects.bind(this),buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-hyper-insert",isPrimary:!0}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show()},e.prototype.updateStyleNames=function(){var e=this.documentHelper.owner.documentHelper.styles.getStyleNames("Paragraph"),t=["Normal","Heading 1","Heading 2","Heading 3","Heading 4","Heading 5","Heading 6"],i=this.defaultStyleName(t);return e.concat(i).filter(function(e,t,i){return i.indexOf(e)===t})},e.prototype.defaultStyleName=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},e.prototype.hideObjects=function(){this.documentHelper.dialog.hide(),this.documentHelper.updateFocus()},e.prototype.destroy=function(){this.listviewInstance&&(this.listviewInstance.destroy(),this.listviewInstance=void 0)},e}(),Ni=function(){function e(e){var i=this;this.selectHandler=function(e){i.selectedText=e.text},this.onCancelButtonClick=function(){i.documentHelper.clearSelectionHighlight(),i.documentHelper.hideDialog()},this.onIgnoreClicked=function(){t.isNullOrUndefined(i.elementBox)||(n.showSpinner(i.documentHelper.dialog.element),i.parent.spellChecker.manageReplace("Ignore Once",i.elementBox),i.removeErrors(),i.parent.spellChecker.checkForNextError(),n.hideSpinner(i.documentHelper.dialog.element))},this.onIgnoreAllClicked=function(){if(!t.isNullOrUndefined(i.elementBox)){n.showSpinner(i.documentHelper.dialog.element);var e=i.elementBox.text;i.parent.spellChecker.handleIgnoreAllItems({element:i.elementBox,text:e}),i.parent.spellChecker.checkForNextError(),n.hideSpinner(i.documentHelper.dialog.element)}},this.addToDictClicked=function(){t.isNullOrUndefined(i.elementBox)||(n.showSpinner(i.documentHelper.dialog.element),i.parent.spellChecker.handleAddToDictionary({element:i.elementBox,text:i.elementBox.text}),i.parent.spellChecker.errorWordCollection.containsKey(i.errorText)&&i.parent.spellChecker.errorWordCollection.remove(i.errorText),i.parent.spellChecker.checkForNextError(),i.documentHelper.hideDialog())},this.changeButtonClicked=function(){t.isNullOrUndefined(i.selectedText)||(i.isSpellChecking=!0,n.showSpinner(i.documentHelper.dialog.element),i.parent.spellChecker.manageReplace(i.selectedText,i.elementBox),i.removeErrors(),i.parent.spellChecker.checkForNextError(),i.documentHelper.dialog.content="",n.hideSpinner(i.documentHelper.dialog.element))},this.changeAllButtonClicked=function(){if(!t.isNullOrUndefined(i.selectedText)){i.isSpellChecking=!0,n.showSpinner(i.documentHelper.dialog.element);for(var e=i.parent.spellChecker.errorWordCollection.get(i.errorText),r=0;r<e.length;r++)if(e[r]instanceof Re&&!e[r].ischangeDetected)i.parent.spellChecker.manageReplace(i.selectedText,e[r]);else if(e[r]instanceof Oe){var o=i.parent.spellChecker.getMatchedResultsFromElement(e[r]),s=o.textResults,a=e[r].ischangeDetected?e[r].start.offset:e[r].line.getOffset(e[r],0);i.parent.searchModule.textSearch.updateMatchedTextLocation(o.matches,s,o.elementInfo,0,e[r],!1,null,a);for(var l=0;l<s.length;l++){var d=i.parent.spellChecker.createErrorElementWithInfo(s.innerList[l],e[r]);i.parent.spellChecker.manageReplace(i.selectedText,d)}}i.parent.spellChecker.errorWordCollection.containsKey(i.errorText)&&i.parent.spellChecker.errorWordCollection.remove(i.errorText),i.parent.spellChecker.checkForNextError(),i.documentHelper.dialog.content="",n.hideSpinner(i.documentHelper.dialog.element)}},this.documentHelper=e,n.createSpinner({target:this.documentHelper.dialog.element,cssClass:"e-spin-overlay"})}return Object.defineProperty(e.prototype,"parent",{get:function(){return this.documentHelper.owner},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"SpellCheckDialog"},e.prototype.removeErrors=function(){if(!t.isNullOrUndefined(this.errorText)&&this.parent.spellChecker.errorWordCollection.containsKey(this.errorText)){var e=this.parent.spellChecker.errorWordCollection.get(this.errorText);e.splice(0,1),0===e.length&&this.parent.spellChecker.errorWordCollection.remove(this.errorText)}0===this.parent.spellChecker.errorWordCollection.length&&this.documentHelper.hideDialog()},e.prototype.show=function(e,i){this.target=void 0,this.localValue=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale),this.localValue.setLocale(this.documentHelper.owner.locale),this.target||this.updateSuggestionDialog(e,i)},e.prototype.updateSuggestionDialog=function(e,t){var i=this;this.elementBox=t;var n;this.isSpellChecking?this.parent.spellChecker.callSpellChecker(this.parent.spellChecker.languageID,e,!1,!0).then(function(t){var r=JSON.parse(t);n=r.Suggestions,i.isSpellChecking=!1,i.handleRetrievedSuggestion(e,n)}):(e=this.parent.spellChecker.manageSpecialCharacters(e,void 0,!0),n=this.parent.spellChecker.errorSuggestions.containsKey(e)?this.parent.spellChecker.errorSuggestions.get(e):[],this.handleRetrievedSuggestion(e,n))},e.prototype.handleRetrievedSuggestion=function(e,t){e=this.parent.spellChecker.manageSpecialCharacters(e,void 0,!0),this.initSpellCheckDialog(this.localValue,e,t),"none"!==this.documentHelper.selection.caret.style.display&&(this.documentHelper.selection.caret.style.display="none"),this.documentHelper.dialog.header="Spelling Editor",this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.beforeOpen=this.documentHelper.updateFocus,this.documentHelper.dialog.buttons=[{click:this.onCancelButtonClick,buttonModel:{content:this.localValue.getConstant("Cancel"),cssClass:"e-control e-flat",isPrimary:!0}}],this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show(),n.hideSpinner(this.documentHelper.dialog.element)},e.prototype.initSpellCheckDialog=function(e,i,n){var s=this.documentHelper.owner.containerId+"_add_SpellCheck";this.target=t.createElement("div",{id:s,className:"e-de-insert-spellchecker"}),this.errorText=i;var a=t.createElement("div",{className:"e-de-dlg-spellchecker-subheader",innerHTML:e.getConstant("Spelling")});this.target.appendChild(a);var l=t.createElement("div",{className:"e-de-spellcheck-error-container"}),d=t.createElement("div",{className:"e-de-dlg-spellcheck-listview",id:"styles_listview"});l.appendChild(d),this.spellingListView=new o.ListView({dataSource:[i],cssClass:"e-dlg-spellcheck-listitem"}),this.spellingListView.appendTo(d);var h=t.createElement("div",{className:"e-de-spellcheck-btncontainer"});l.appendChild(h);var c=t.createElement("button",{innerHTML:e.getConstant("Ignore"),id:"ignore"});h.appendChild(c),new r.Button({cssClass:"e-de-spellcheck-btn"}).appendTo(c),c.addEventListener("click",this.onIgnoreClicked);var p=t.createElement("button",{innerHTML:e.getConstant("Ignore all"),id:"new"});h.appendChild(p),new r.Button({cssClass:"e-de-spellcheck-btn"}).appendTo(p),p.addEventListener("click",this.onIgnoreAllClicked);var g=t.createElement("button",{innerHTML:e.getConstant("Add to Dictionary"),id:"new"});h.appendChild(g),new r.Button({cssClass:"e-de-spellcheck-btn"}).appendTo(g),g.addEventListener("click",this.addToDictClicked),this.target.appendChild(l);var u=t.createElement("div",{className:"e-de-dlg-spellchecker-subheaderbtm",innerHTML:e.getConstant("Suggestions")});this.target.appendChild(u);var m=t.createElement("div",{className:"e-de-spellcheck-suggestion-container"});this.target.appendChild(m);var f=t.createElement("div",{className:"e-de-dlg-spellcheck-listview"});m.appendChild(f),this.suggestionListView=new o.ListView({dataSource:n,cssClass:"e-dlg-spellcheck-listitem"}),this.suggestionListView.appendTo(f),this.suggestionListView.addEventListener("select",this.selectHandler);var v=t.createElement("div",{className:"e-de-spellcheck-btncontainer"});m.appendChild(v);var y=t.createElement("button",{innerHTML:e.getConstant("Change"),id:"Change"});v.appendChild(y);var b=new r.Button({cssClass:"e-de-spellcheck-btn"});b.appendTo(y),y.addEventListener("click",this.changeButtonClicked);var w=t.createElement("button",{innerHTML:e.getConstant("Change All"),id:"Change All"});v.appendChild(w);var C=new r.Button({cssClass:"e-de-spellcheck-btn"});C.appendTo(w),w.addEventListener("click",this.changeAllButtonClicked),(t.isNullOrUndefined(n)||0===n.length)&&(b.disabled=!0,C.disabled=!0)},e.prototype.destroy=function(){this.target&&(this.target.remove(),this.target=void 0),this.spellingListView&&(this.spellingListView.destroy(),this.spellingListView=void 0),this.suggestionListView&&(this.suggestionListView.destroy(),this.suggestionListView=void 0)},e}(),Ei=function(){function e(e){var t=this;this.changeBidirectional=function(e){"exact"===e.value?(t.autoButton.checked=!t.exactButton.checked,t.exactlyNumber.enabled=!0):(t.exactButton.checked=!t.autoButton.checked,t.exactlyNumber.enabled=!1)},this.changeBidirect=function(e){"check"===e.value?t.notCheckedButton.checked=!t.checkedButton.checked:t.checkedButton.checked=!t.notCheckedButton.checked},this.onCancelButtonClick=function(){t.documentHelper.dialog.hide()},this.insertCheckBoxField=function(){t.closeCheckBoxField();var e=new He;e.defaultValue=t.checkedButton.checked,e.name=t.bookmarkInputText.value,e.helpText=t.tooltipInputText.value,e.checked=e.defaultValue,e.enabled=t.checBoxEnableElement.checked,t.exactButton.checked?(e.sizeType="Exactly",e.size=t.exactlyNumber.value):(e.sizeType="Auto",e.size=11),t.owner.editor.editFormField("CheckBox",e)},this.closeCheckBoxField=function(){t.documentHelper.dialog.hide(),t.documentHelper.dialog.element.style.pointerEvents=""},this.owner=e}return Object.defineProperty(e.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"CheckBoxFormFieldDialog"},e.prototype.initCheckBoxDialog=function(e,i){this.target=t.createElement("div");var n=t.createElement("div"),o=t.createElement("div",{className:"e-de-ff-dlg-heading",innerHTML:e.getConstant("Check box size")}),s=t.createElement("div",{className:"e-de-ff-radio-scnd-div"}),l=t.createElement("div",{className:"e-de-ff-radio-scnd-div"}),d=t.createElement("input",{className:"e-de-rtl-btn-div"}),h=t.createElement("input",{className:"e-de-rtl-btn-div"});this.autoButton=new r.RadioButton({label:e.getConstant("Auto"),cssClass:"e-small",change:this.changeBidirectional,checked:!0,enableRtl:i}),this.exactButton=new r.RadioButton({label:e.getConstant("Exactly"),value:"exact",cssClass:"e-small",change:this.changeBidirectional,enableRtl:i}),this.exactNumberDiv=t.createElement("div",{className:"e-de-ff-chck-exact"});var c=t.createElement("input",{attrs:{type:"text"}});this.exactlyNumber=new a.NumericTextBox({format:"n",value:10,min:1,max:1584,enablePersistence:!1,enabled:!1,cssClass:"e-de-check-exactnumbr-width",enableRtl:i});var p=t.createElement("div",{className:"e-de-ff-dlg-heading",innerHTML:e.getConstant("Default value")}),g=t.createElement("div",{className:"e-de-ff-radio-div"}),u=t.createElement("div",{className:"e-de-ff-radio-div"}),m=t.createElement("input",{className:"e-de-rtl-btn-div"}),f=t.createElement("input",{className:"e-de-rtl-btn-div"});this.notCheckedButton=new r.RadioButton({label:e.getConstant("Not checked"),enableRtl:i,cssClass:"e-small",change:this.changeBidirect}),this.checkedButton=new r.RadioButton({label:e.getConstant("Checked"),value:"check",enableRtl:i,cssClass:"e-small",change:this.changeBidirect,checked:!0});var v=t.createElement("div",{className:"e-de-ff-dlg-heading",innerHTML:e.getConstant("Field settings")}),y=t.createElement("div",{className:"e-de-div-seperate-dlg"}),b=t.createElement("div",{className:"e-de-ff-dlg-lft-hlf"}),w=t.createElement("div",{className:"e-de-ff-dlg-rght-hlf"}),C=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Tooltip")});this.tooltipInputText=t.createElement("input",{className:"e-input e-bookmark-textbox-input"});var x=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Name")});this.bookmarkInputText=t.createElement("input",{className:"e-input e-bookmark-textbox-input"});var F=t.createElement("div"),P=t.createElement("input",{attrs:{type:"checkbox"}});this.checBoxEnableElement=new r.CheckBox({cssClass:"e-de-ff-dlg-check",label:e.getConstant("Check box enabled"),enableRtl:i}),i&&(s.classList.add("e-de-rtl"),l.classList.add("e-de-rtl"),this.exactNumberDiv.classList.add("e-de-rtl"),g.classList.add("e-de-rtl"),u.classList.add("e-de-rtl"),b.classList.add("e-de-rtl"),w.classList.add("e-de-rtl")),this.target.appendChild(n),n.appendChild(p),n.appendChild(g),g.appendChild(m),this.notCheckedButton.appendTo(m),n.appendChild(u),u.appendChild(f),this.checkedButton.appendTo(f),n.appendChild(o),n.appendChild(s),s.appendChild(d),this.autoButton.appendTo(d),n.appendChild(l),l.appendChild(h),this.exactButton.appendTo(h),l.appendChild(this.exactNumberDiv),this.exactNumberDiv.appendChild(c),this.exactlyNumber.appendTo(c),n.appendChild(v),n.appendChild(y),y.appendChild(b),y.appendChild(w),b.appendChild(C),b.appendChild(this.tooltipInputText),w.appendChild(x),w.appendChild(this.bookmarkInputText),n.appendChild(F),F.appendChild(P),this.checBoxEnableElement.appendTo(P)},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),t.isNullOrUndefined(this.target)&&this.initCheckBoxDialog(e,this.documentHelper.owner.enableRtl),this.loadCheckBoxDialog(),this.documentHelper.dialog.header=e.getConstant("Check Box Form Field"),this.documentHelper.dialog.position={X:"center",Y:"center"},this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="400px",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.buttons=[{click:this.insertCheckBoxField,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-table-cell-margin-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-table-cell-margin-cancel"}}],this.documentHelper.dialog.show()},e.prototype.loadCheckBoxDialog=function(){var e=this.owner.selection.getCurrentFormField();if(e instanceof Ie){this.fieldBegin=e;var t=this.fieldBegin.formFieldData;t.defaultValue?(this.checkedButton.checked=!0,this.notCheckedButton.checked=!1):(this.checkedButton.checked=!1,this.notCheckedButton.checked=!0),"Auto"!==t.sizeType?(this.exactButton.checked=!0,this.autoButton.checked=!1,this.exactlyNumber.enabled=!0):(this.autoButton.checked=!0,this.exactButton.checked=!1,this.exactlyNumber.enabled=!1),t.size&&(this.exactlyNumber.value=t.size),t.enabled?this.checBoxEnableElement.checked=!0:this.checBoxEnableElement.checked=!1,t.name&&""!==t.name?this.bookmarkInputText.value=t.name:this.bookmarkInputText.value="",t.helpText&&""!==t.helpText?this.tooltipInputText.value=t.helpText:this.tooltipInputText.value=""}},e.prototype.destroy=function(){var e=this.target;e&&(e.parentElement&&e.parentElement.removeChild(e),this.target=void 0),this.owner=void 0,this.autoButton&&(this.autoButton.destroy(),this.autoButton=void 0),this.exactButton&&(this.exactButton.destroy(),this.exactButton=void 0),this.notCheckedButton&&(this.notCheckedButton.destroy(),this.notCheckedButton=void 0),this.checkedButton&&(this.checkedButton.destroy(),this.checkedButton=void 0),this.bookmarkInputText=void 0,this.tooltipInputText=void 0,this.checBoxEnableElement&&(this.checBoxEnableElement.destroy(),this.checBoxEnableElement=void 0),this.exactlyNumber&&(this.exactlyNumber.destroy(),this.exactlyNumber=void 0),this.exactNumberDiv=void 0},e}(),Hi=function(){function e(e){var i=this;this.updateTextFormtas=function(){var e=i.updateFormats(i.defaultTextInput.value);i.defaultTextInput.value=t.isNullOrUndefined(e)?"":e},this.onCancelButtonClick=function(){i.documentHelper.dialog.hide()},this.insertTextField=function(){var e=!0;if("Date"===i.typeDropDown.value&&(e=i.isValidDateFormat()),e)if(i.updateTextFormtas(),i.defaultTextInput.value.length>i.maxLengthNumber.value&&!t.isNullOrUndefined(i.maxLengthNumber.value)&&0!==i.maxLengthNumber.value)n.DialogUtility.alert({content:"The maximum length value must be equal or greater than the length of the default text.",showCloseIcon:!0,closeOnEscape:!0,position:{X:"center",Y:"center"},animationSettings:{effect:"Zoom"}});else{var r=void 0;r="Date"===i.typeDropDown.value?"Date":"Number"===i.typeDropDown.value?"Number":"Text";var o=i.textFormatDropDown.value,s=new Ee;s.type=r,s.defaultValue=i.defaultTextInput.value,s.maxLength=i.maxLengthNumber.value,s.format=t.isNullOrUndefined(o)?"":o,s.name=i.bookmarkTextInput.value,s.helpText=i.tooltipTextInput.value,s.enabled=i.fillInEnable.checked,i.owner.editor.editFormField("Text",s),i.closeTextField()}else n.DialogUtility.alert({content:"A valid date or time is required",showCloseIcon:!0,closeOnEscape:!0,position:{X:"center",Y:"center"},animationSettings:{effect:"Zoom"}})},this.closeTextField=function(){i.documentHelper.dialog.hide(),i.documentHelper.dialog.element.style.pointerEvents=""},this.owner=e}return Object.defineProperty(e.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"TextFormFieldDialog"},e.prototype.initTextDialog=function(e,i){var n=this;this.target=t.createElement("div");var o=t.createElement("div"),l=t.createElement("div",{className:"e-de-div-seperate-dlg"}),d=t.createElement("div",{className:"e-de-ff-dlg-lft-hlf"});this.defaultTextDiv=t.createElement("div",{className:"e-de-ff-dlg-rght-hlf"});var h=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Type")}),c=t.createElement("input"),p=["Regular text","Number","Date"];this.typeDropDown=new s.DropDownList({dataSource:p,popupHeight:"150px",value:"Regular text",change:this.changeTypeDropDown.bind(this)}),this.defaultTextLabel=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Default text")}),this.defaultTextInput=t.createElement("input",{className:"e-input e-bookmark-textbox-input",styles:"margin-top:3px"});var g=t.createElement("div",{className:"e-de-div-seperate-dlg"}),u=t.createElement("div",{className:"e-de-ff-dlg-lft-hlf"}),m=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Maximum length")}),f=t.createElement("input");this.maxLengthNumber=new a.NumericTextBox({format:"n",value:0,min:0,max:32767,width:"100%",enablePersistence:!1,change:function(e){e.value||(this.element.value="Unlimited")},focus:function(e){e.value||(this.element.value="Unlimited")},blur:function(e){if(!e.value){var t=this;setTimeout(function(){t.element.value="Unlimited"},0)}}});var v=t.createElement("div",{className:"e-de-ff-dlg-rght-hlf"});this.textFormatLabel=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Text format")});var y=t.createElement("input"),b=["Uppercase","Lowercase","FirstCapital","Titlecase"];this.textFormatDropDown=new s.ComboBox({dataSource:b,popupHeight:"150px",allowCustom:!0,showClearButton:!1,change:this.updateTextFormtas.bind(this)}),this.textFormatDropDown.focus=function(){n.textFormatDropDown.element.select()};var w=t.createElement("div",{className:"e-de-ff-dlg-heading",innerHTML:e.getConstant("Field settings")}),C=t.createElement("div",{className:"e-de-div-seperate-dlg"}),x=t.createElement("div",{className:"e-de-ff-dlg-lft-hlf"}),F=t.createElement("div",{className:"e-de-ff-dlg-rght-hlf"}),P=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Tooltip")});this.tooltipTextInput=t.createElement("input",{className:"e-input e-bookmark-textbox-input"});var T=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Name")});this.bookmarkTextInput=t.createElement("input",{className:"e-input e-bookmark-textbox-input"});var S=t.createElement("div"),I=t.createElement("input",{attrs:{type:"checkbox"}});this.fillInEnable=new r.CheckBox({cssClass:"e-de-ff-dlg-check",label:e.getConstant("Fillin enabled"),enableRtl:i}),i&&(d.classList.add("e-de-rtl"),u.classList.add("e-de-rtl"),x.classList.add("e-de-rtl"),F.classList.add("e-de-rtl")),this.target.appendChild(o),o.appendChild(l),l.appendChild(d),d.appendChild(h),d.appendChild(c),this.typeDropDown.appendTo(c),l.appendChild(this.defaultTextDiv),this.defaultTextDiv.appendChild(this.defaultTextLabel),this.defaultTextDiv.appendChild(this.defaultTextInput),o.appendChild(g),g.appendChild(u),u.appendChild(m),u.appendChild(f),this.maxLengthNumber.appendTo(f),g.appendChild(v),v.appendChild(this.textFormatLabel),v.appendChild(y),this.textFormatDropDown.appendTo(y),o.appendChild(w),o.appendChild(C),C.appendChild(x),x.appendChild(P),x.appendChild(this.tooltipTextInput),C.appendChild(F),F.appendChild(T),F.appendChild(this.bookmarkTextInput),o.appendChild(S),S.appendChild(I),this.fillInEnable.appendTo(I)},e.prototype.show=function(){this.localObj=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale),this.localObj.setLocale(this.documentHelper.owner.locale),t.isNullOrUndefined(this.target)&&this.initTextDialog(this.localObj,this.documentHelper.owner.enableRtl),this.loadTextDialog(),this.documentHelper.dialog.header=this.localObj.getConstant("Text Form Field"),this.documentHelper.dialog.position={X:"center",Y:"center"},this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="448px",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.buttons=[{click:this.insertTextField,buttonModel:{content:this.localObj.getConstant("Ok"),cssClass:"e-flat e-table-cell-margin-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:this.localObj.getConstant("Cancel"),cssClass:"e-flat e-table-cell-margin-cancel"}}],this.documentHelper.dialog.show()},e.prototype.changeTypeDropDown=function(e){e.isInteracted&&(this.defaultTextInput.value="",this.textFormatDropDown.value=""),"Regular text"===e.value?(this.defaultTextLabel.innerHTML=this.localObj.getConstant("Default text"),this.textFormatLabel.innerHTML=this.localObj.getConstant("Text format"),this.textFormatDropDown.dataSource=["Uppercase","Lowercase","FirstCapital","Titlecase"]):"Number"===e.value?(this.defaultTextLabel.innerHTML=this.localObj.getConstant("Default number"),this.textFormatLabel.innerHTML=this.localObj.getConstant("Number format"),this.textFormatDropDown.dataSource=["0","0.00","#,##0","#,##0.00","$#,##0.00;($#,##0.00)","0%"]):"Date"===e.value&&(this.defaultTextLabel.innerHTML=this.localObj.getConstant("Default date"),this.textFormatLabel.innerHTML=this.localObj.getConstant("Date format"),this.textFormatDropDown.dataSource=["M/d/yyyy","dddd, MMMM d, yyyy","MMMM d, yyyy","M/d/yy","yyyy-MM-dd","d-MMM-yy","M.d.yyyy","MMM. d, yy","d MMMM yyyy","MMMM yy","MMM-yy","M/d/yyyy h:mm am/pm","M/d/yyyy h:mm:ss am/pm","h:mm am/pm","h:mm:ss am/pm","HH:mm","HH:mm:ss"])},e.prototype.loadTextDialog=function(){var e=this.owner.selection.getCurrentFormField();if(e instanceof Ie){this.fieldBegin=e;var i=e.formFieldData;i.maxLength>0?this.maxLengthNumber.value=i.maxLength:(this.maxLengthNumber.value=0,this.maxLengthNumber.element.value="Unlimited"),"Date"===i.type?this.typeDropDown.value="Date":"Number"===i.type?this.typeDropDown.value="Number":this.typeDropDown.value="Regular text",i.format?this.textFormatDropDown.value=i.format:this.textFormatDropDown.value="",this.defaultTextInput.value=t.isNullOrUndefined(i.defaultValue)?"":i.defaultValue,this.fillInEnable.checked=i.enabled,this.tooltipTextInput.value=t.isNullOrUndefined(i.helpText)?"":i.helpText,this.bookmarkTextInput.value=t.isNullOrUndefined(i.name)?"":i.name}},e.prototype.updateFormats=function(e){var i=t.isNullOrUndefined(this.textFormatDropDown.value)?"":this.textFormatDropDown.value.toString();if("Regular text"===this.typeDropDown.value)return L.formatText(i,e);if("Number"===this.typeDropDown.value){var n=L.formatNumber(i,e);return"NaN"!==n.toString()?n:""}return"Date"===this.typeDropDown.value?L.formatDate(i,e):""},e.prototype.isValidDateFormat=function(){var e=this.defaultTextInput.value;if(""!==e){var t=new Date(e);if(isNaN(t.getDate()))return!1}return!0},e.prototype.destroy=function(){var e=this.target;e&&(e.parentElement&&e.parentElement.removeChild(e),this.target=void 0),this.maxLengthNumber&&(this.maxLengthNumber.destroy(),this.maxLengthNumber=void 0),this.fillInEnable&&(this.fillInEnable.destroy(),this.fillInEnable=void 0),this.typeDropDown&&(this.typeDropDown.destroy(),this.typeDropDown=void 0),this.textFormatDropDown&&(this.textFormatDropDown.destroy(),this.textFormatDropDown=void 0),this.owner=void 0,this.defaultTextInput=void 0,this.tooltipTextInput=void 0,this.bookmarkTextInput=void 0,this.defaultTextLabel=void 0,this.defaultTextDiv=void 0,this.textFormatLabel=void 0},e}(),Wi=function(){function e(e){var t=this;this.addItemtoList=function(){t.dropDownItems.push(t.drpDownItemsInput.value),t.currentSelectedItem=t.drpDownItemsInput.value,t.drpDownItemsInput.value="",t.enableOrDisableButton(),t.updateList()},this.removeItemFromList=function(){for(var e=0;e<t.dropDownItems.length;e++)t.dropDownItems[e]===t.currentSelectedItem&&t.dropDownItems.splice(e,1);t.updateList()},this.selectHandler=function(e){t.currentSelectedItem=e.text},this.moveUpItem=function(){var e=t.getSelectedIndex();t.moveUp(e,e-1),t.updateList()},this.moveDownItem=function(){var e=t.getSelectedIndex();t.moveDown(e,e+1),t.updateList()},this.onKeyUpOnTextBox=function(){t.enableOrDisableButton()},this.onCancelButtonClick=function(){t.documentHelper.dialog.hide()},this.insertDropDownField=function(){var e=new We;e.dropdownItems=t.dropDownItems,e.selectedIndex=0,e.name=t.bookmarkInput.value,e.helpText=t.tooltipInput.value,e.enabled=t.dropDownEnable.checked,t.owner.editor.editFormField("DropDown",e),t.closeDropDownField()},this.closeDropDownField=function(){t.documentHelper.dialog.hide(),t.documentHelper.dialog.element.style.pointerEvents=""},this.owner=e}return Object.defineProperty(e.prototype,"documentHelper",{get:function(){return this.owner.documentHelper},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"DropDownFormFieldDialog"},e.prototype.initTextDialog=function(e,i){this.target=t.createElement("div");var n=t.createElement("div"),s=t.createElement("div",{className:"e-de-drp-dwn-frst-div"}),a=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Drop-down items")});this.drpDownItemsInput=t.createElement("input",{className:"e-input e-bookmark-textbox-input",id:"fielditems_text_box"}),this.drpDownItemsInput.addEventListener("keyup",this.onKeyUpOnTextBox);var l=t.createElement("div",{className:"e-de-ff-drpdwn-dlg-scndiv"}),d=t.createElement("div",{className:"e-de-ff-dlg-drpdwn-heading",innerHTML:e.getConstant("Items in drop-down list")}),h=t.createElement("div",{className:"e-bookmark-listViewDiv e-de-ff-drpdwn-listview",attrs:{style:"height:100%"}});this.listviewInstance=new o.ListView({cssClass:"e-bookmark-listview",select:this.selectHandler});var c=t.createElement("div"),p=t.createElement("div",{className:"e-bookmark-addbutton"}),g=t.createElement("button",{innerHTML:e.getConstant("ADD"),attrs:{type:"button",style:"height:36px;width:100%"}});this.addButton=new r.Button({cssClass:"e-button-custom"}),this.addButton.disabled=!0,g.addEventListener("click",this.addItemtoList.bind(this));var u=t.createElement("div",{className:"e-bookmark-addbutton"});u.style.display="none";var m=t.createElement("button",{innerHTML:"EDIT",attrs:{type:"button",style:"height:36px;width:100%"}});this.editButton=new r.Button({cssClass:"e-button-custom"});var f=t.createElement("div",{className:"e-bookmark-addbutton"}),v=t.createElement("button",{innerHTML:e.getConstant("REMOVE"),attrs:{type:"button",style:"height:36px;width:100%"}});this.removeButton=new r.Button({cssClass:"e-button-custom"}),v.addEventListener("click",this.removeItemFromList.bind(this));var y=t.createElement("div",{attrs:{style:"display:inline-flex"}}),b=t.createElement("div",{className:"e-bookmark-addbutton"}),w=t.createElement("button",{attrs:{type:"button",style:"height:36px;width:36px"},className:"e-de-ff-drpdwn-mvup"});this.moveUpButton=new r.Button({cssClass:"e-button-custom",iconCss:"e-de-arrow-up"}),w.addEventListener("click",this.moveUpItem.bind(this));var C=t.createElement("div",{className:"e-bookmark-addbutton"}),x=t.createElement("button",{attrs:{type:"button",style:"height:36px;width:36px"},className:"e-de-ff-drpdwn-mvdn"});this.moveDownButton=new r.Button({cssClass:"e-button-custom",iconCss:"e-de-arrow-down"}),x.addEventListener("click",this.moveDownItem.bind(this));var F=t.createElement("div",{className:"e-de-ff-dlg-heading",innerHTML:e.getConstant("Field settings")}),P=t.createElement("div",{className:"e-de-div-seperate-dlg"}),T=t.createElement("div",{className:"e-de-ff-dlg-lft-hlf"}),S=t.createElement("div",{className:"e-de-ff-dlg-rght-hlf"}),I=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Tooltip")});this.tooltipInput=t.createElement("input",{className:"e-input e-bookmark-textbox-input"});var N=t.createElement("div",{className:"e-de-ff-dlg-heading-small",innerHTML:e.getConstant("Name")});this.bookmarkInput=t.createElement("input",{className:"e-input e-bookmark-textbox-input"});var E=t.createElement("div"),H=t.createElement("input",{attrs:{type:"checkbox"}});this.dropDownEnable=new r.CheckBox({cssClass:"e-de-ff-dlg-check",label:e.getConstant("Dropdown enabled"),enableRtl:i}),i&&(h.classList.add("e-de-rtl"),w.classList.add("e-de-rtl"),T.classList.add("e-de-rtl"),S.classList.add("e-de-rtl")),this.target.appendChild(n),n.appendChild(s),s.appendChild(a),s.appendChild(this.drpDownItemsInput),n.appendChild(d),n.appendChild(l),l.appendChild(h),this.listviewInstance.appendTo(h),l.appendChild(c),c.appendChild(p),p.appendChild(g),this.addButton.appendTo(g),c.appendChild(u),u.appendChild(m),this.editButton.appendTo(m),c.appendChild(f),f.appendChild(v),this.removeButton.appendTo(v),c.appendChild(y),y.appendChild(b),b.appendChild(w),this.moveUpButton.appendTo(w),y.appendChild(C),C.appendChild(x),this.moveDownButton.appendTo(x),n.appendChild(F),n.appendChild(P),P.appendChild(T),T.appendChild(I),T.appendChild(this.tooltipInput),P.appendChild(S),S.appendChild(N),S.appendChild(this.bookmarkInput),n.appendChild(E),E.appendChild(H),this.dropDownEnable.appendTo(H)},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);e.setLocale(this.documentHelper.owner.locale),t.isNullOrUndefined(this.target)&&this.initTextDialog(e,this.documentHelper.owner.enableRtl),this.loadDropDownDialog(),this.documentHelper.dialog.header=e.getConstant("Drop Down Form Field"),this.documentHelper.dialog.position={X:"center",Y:"center"},this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="448px",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.buttons=[{click:this.insertDropDownField,buttonModel:{content:e.getConstant("Ok"),cssClass:"e-flat e-table-cell-margin-okay",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-table-cell-margin-cancel"}}],this.documentHelper.dialog.show()},e.prototype.loadDropDownDialog=function(){var e=this.owner.selection.getCurrentFormField();if(e instanceof Ie){if(this.fieldBegin=e,this.dropDownInstance=e.formFieldData,this.dropDownInstance.dropdownItems.length>0){var t=this.dropDownInstance.selectedIndex;this.currentSelectedItem=this.dropDownInstance.dropdownItems[t]}this.dropDownInstance.enabled?this.dropDownEnable.checked=!0:this.dropDownEnable.disabled=!1,""!==this.dropDownInstance.helpText?this.tooltipInput.value=this.dropDownInstance.helpText:this.tooltipInput.value="",""!==this.dropDownInstance.name?this.bookmarkInput.value=this.dropDownInstance.name:this.bookmarkInput.value="",this.dropDownItems=this.dropDownInstance.dropdownItems.slice(),this.updateList()}},e.prototype.updateList=function(){if(this.listviewInstance.dataSource=this.dropDownItems.slice(),this.listviewInstance.dataBind(),this.currentSelectedItem){var e=this.currentSelectedItem;this.listviewInstance.selectItem(e)}},e.prototype.getSelectedIndex=function(){for(var e=0;e<this.dropDownItems.length;e++)if(this.dropDownItems[e]===this.currentSelectedItem)return e;return 0},e.prototype.moveUp=function(e,t){var i=[];if(0===e){for(var n=0;n<this.dropDownItems.length;n++)n<this.dropDownItems.length-1?i[n]=this.dropDownItems[n+1]:i[n]=this.dropDownItems[0];this.dropDownItems=i}else{var r=this.dropDownItems[e];this.dropDownItems[e]=this.dropDownItems[t],this.dropDownItems[t]=r}},e.prototype.moveDown=function(e,t){var i=[];if(e===this.dropDownItems.length-1){for(var n=0;n<this.dropDownItems.length;n++)i[n]=0!==n?this.dropDownItems[n-1]:this.dropDownItems[this.dropDownItems.length-1];this.dropDownItems=i}else{var r=this.dropDownItems[e];this.dropDownItems[e]=this.dropDownItems[t],this.dropDownItems[t]=r}},e.prototype.enableOrDisableButton=function(){t.isNullOrUndefined(this.addButton)||(this.addButton.disabled=""===this.drpDownItemsInput.value)},e.prototype.destroy=function(){var e=this.target;e&&(e.parentElement&&e.parentElement.removeChild(e),this.target=void 0),this.owner=void 0,this.drpDownItemsInput=void 0,this.listviewInstance&&(this.listviewInstance.destroy(),this.listviewInstance=void 0),this.addButton&&(this.addButton.destroy(),this.addButton=void 0),this.editButton&&(this.editButton.destroy(),this.editButton=void 0),this.removeButton&&(this.removeButton.destroy(),this.removeButton=void 0),this.moveUpButton&&(this.moveUpButton.destroy(),this.moveUpButton=void 0),this.moveDownButton&&(this.moveDownButton.destroy(),this.moveDownButton=void 0),this.tooltipInput=void 0,this.bookmarkInput=void 0,this.dropDownEnable&&(this.dropDownEnable.destroy(),this.dropDownEnable=void 0),this.dropDownInstance=void 0},e}(),Oi=function(){function e(e){this.langIDInternal=0,this.enableSpellCheckInternal=!0,this.uniqueSpelledWords={},this.spellSuggestionInternal=!0,this.uniqueKey="",this.removeUnderlineInternal=!1,this.uniqueWordsCountInternal=1e4,this.performOptimizedCheck=!1,this.documentHelper=e,this.errorWordCollection=new u,this.errorSuggestions=new u,this.ignoreAllItems=[],this.uniqueSpelledWords={},this.textSearchResults=new zt(this.documentHelper.owner),this.uniqueKey=this.documentHelper.owner.element.id+"_"+this.createGuid()}return e.prototype.getModuleName=function(){return"SpellChecker"},Object.defineProperty(e.prototype,"enableOptimizedSpellCheck",{get:function(){return this.performOptimizedCheck},set:function(e){this.performOptimizedCheck=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uniqueWordsCount",{get:function(){return t.isNullOrUndefined(this.uniqueWordsCountInternal)?0:this.uniqueWordsCountInternal},set:function(e){this.uniqueWordsCountInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageID",{get:function(){return t.isNullOrUndefined(this.langIDInternal)?0:this.langIDInternal},set:function(e){this.langIDInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowSpellCheckAndSuggestion",{get:function(){return this.spellSuggestionInternal},set:function(e){this.spellSuggestionInternal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"removeUnderline",{get:function(){return this.removeUnderlineInternal},set:function(e){this.removeUnderlineInternal=e,this.documentHelper.owner.editor.reLayout(this.documentHelper.selection)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableSpellCheck",{get:function(){return this.enableSpellCheckInternal},set:function(e){this.enableSpellCheckInternal=e,this.documentHelper.owner.editor.reLayout(this.documentHelper.selection)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewer",{get:function(){return this.documentHelper.owner.viewer},enumerable:!0,configurable:!0}),e.prototype.manageReplace=function(e,i){this.documentHelper.triggerSpellCheck=!0;if(!t.isNullOrUndefined(i)&&i instanceof Re){var n=i.text;if(this.documentHelper.selection.start=i.start,this.documentHelper.selection.end=i.end,"Ignore Once"!==e)return e=this.manageSpecialCharacters(n,e),this.documentHelper.owner.editor.insertTextInternal(e,!0),this.documentHelper.selection.start.setPositionInternal(this.documentHelper.selection.end),void this.documentHelper.clearSelectionHighlight();this.currentContextInfo={text:n,element:i}}if(!t.isNullOrUndefined(this.currentContextInfo)&&this.currentContextInfo.element&&"Ignore Once"!==e){var r=this.currentContextInfo.element;this.currentContextInfo.element.text,this.documentHelper.selection.start=r.start,this.documentHelper.selection.end=r.end}else this.handleReplace(e);"Ignore Once"!==e&&(this.documentHelper.owner.editor.insertTextInternal(e,!0),t.isNullOrUndefined(this.currentContextInfo)||this.removeErrorsFromCollection(this.currentContextInfo),this.documentHelper.selection.start.setPositionInternal(this.documentHelper.selection.end),this.documentHelper.clearSelectionHighlight()),this.documentHelper.triggerSpellCheck=!1},e.prototype.handleReplace=function(e){var i=this.documentHelper.selection.start,n=i.offset,r=i.currentWidget.getInline(n,0,!1,!0);r.element.line.getOffset(r.element,0)+r.element.length===n&&this.retrieveExactElementInfo(r);for(var o,s=r.element.text,a=new RegExp("^[#\\@\\!\\~\\$\\%\\^\\&\\*\\(\\)\\-\\_\\+\\=\\{\\}\\[\\]\\:\\;\\\"'\\,\\<\\.\\>\\/\\?\\`\\s]+","g"),l=[];!t.isNullOrUndefined(o=a.exec(s));)l.push(o);if("Ignore Once"===e)return void this.handleIgnoreOnce(r);i.offset=n-r.index,!t.isNullOrUndefined(l)&&l.length>0&&(i.offset+=l[0].toString().length),i.location=this.documentHelper.owner.selection.getPhysicalPositionInternal(i.currentWidget,i.offset,!0),(i=this.documentHelper.owner.searchModule.textSearch.getTextPosition(i.currentWidget,i.offset.toString())).setPositionParagraph(i.currentWidget,i.offset);var d=i.offset+r.element.length-i.offset,h=i.currentWidget.getOffset(r.element,d),c=i.currentWidget,p=new RegExp("[#\\@\\!\\~\\$\\%\\^\\&\\*\\(\\)\\-\\_\\+\\=\\{\\}\\[\\]\\:\\;\\\"'\\,\\<\\.\\>\\/\\?\\s\\`]+$","g");for(l=[];!t.isNullOrUndefined(o=p.exec(s));)l.push(o);!t.isNullOrUndefined(l)&&l.length>0&&(h-=l[0].toString().length),this.documentHelper.selection.end=this.documentHelper.owner.searchModule.textSearch.getTextPosition(c,h.toString()),this.documentHelper.selection.end.location=this.documentHelper.owner.selection.getPhysicalPositionInternal(i.currentWidget,h,!0),this.documentHelper.selection.end.setPositionParagraph(c,h),this.currentContextInfo={element:r.element,text:r.element.text}},e.prototype.retrieveExactElementInfo=function(e){var i=e.element.nextElement;!t.isNullOrUndefined(i)&&i instanceof Oe&&""!=i.text.trim()&&(e.element=i)},e.prototype.handleIgnoreOnce=function(e){var i=e.element,n="";n=!t.isNullOrUndefined(this.currentContextInfo)&&this.currentContextInfo.element?this.currentContextInfo.element.text:i.text,n=this.manageSpecialCharacters(n,void 0,!0),-1===i.ignoreOnceItems.indexOf(n)&&i.ignoreOnceItems.push(n),this.documentHelper.owner.editor.reLayout(this.documentHelper.selection)},e.prototype.handleIgnoreAllItems=function(e){var i=t.isNullOrUndefined(e)?this.retriveText():e,n=this.manageSpecialCharacters(i.text,void 0,!0);-1===this.ignoreAllItems.indexOf(n)&&(this.ignoreAllItems.push(n),this.removeErrorsFromCollection(i),this.documentHelper.triggerSpellCheck=!0,this.documentHelper.owner.editor.reLayout(this.documentHelper.selection),this.documentHelper.triggerSpellCheck=!1,this.documentHelper.clearSelectionHighlight())},e.prototype.handleAddToDictionary=function(e){var i=this,n=t.isNullOrUndefined(e)?this.retriveText():e,r=this.manageSpecialCharacters(n.text,void 0,!0);this.callSpellChecker(this.languageID,r,!1,!1,!0).then(function(e){i.documentHelper.triggerSpellCheck=!0,i.removeErrorsFromCollection(n),i.ignoreAllItems.push(r),i.documentHelper.owner.editor.reLayout(i.documentHelper.selection,!0),i.documentHelper.triggerSpellCheck=!1})},e.prototype.manageSpecialCharacters=function(e,i,n){if(!t.isNullOrUndefined(e)){t.isNullOrUndefined(i)&&(i=e);for(var r=new RegExp("^[#\\@\\!\\~\\$\\%\\^\\&\\*\\(\\)\\-\\_\\+\\=\\{\\}\\[\\]\\:\\;\\\"\\”'\\,\\<\\.\\>\\/\\?\\`\\s]+","g"),o=[],s=void 0;!t.isNullOrUndefined(s=r.exec(e));)o.push(s);if(o.length>0)for(l=0;l<o.length;l++){d=o[l];i=n?i.replace(d[0],""):d[0]+i}var a=new RegExp("[#\\@\\!\\~\\$\\%\\^\\&\\*\\(\\)\\-\\_\\+\\=\\{\\}\\[\\]\\:\\;\\\"\\”'\\,\\<\\.\\>\\/\\?\\s\\`]+$","g");for(o=[];!t.isNullOrUndefined(s=a.exec(i));)o.push(s);if(o.length>0)for(var l=0;l<o.length;l++){var d=o[l];i=n?i.slice(0,d.index):i+d[0]}}return i},e.prototype.removeErrorsFromCollection=function(e){if(this.errorWordCollection.containsKey(e.text)){var t=this.errorWordCollection.get(e.text);t.indexOf(e.element)>=0&&t.splice(0,1),0===t.length&&this.errorWordCollection.remove(e.text)}},e.prototype.retriveText=function(){var e,i;if(!t.isNullOrUndefined(this.currentContextInfo)&&this.currentContextInfo.element)i=this.currentContextInfo.element,e=this.currentContextInfo.element.text,this.documentHelper.selection.start=i.start,this.documentHelper.selection.end=i.end;else{var n=this.documentHelper.selection.start,r=n.offset,o=n.currentWidget.getInline(r,0);i=o.element,e=o.element.text}return{text:e,element:i}},e.prototype.handleSuggestions=function(e){this.spellCheckSuggestion=[],0===e.length?this.spellCheckSuggestion.push("Add To Dictionary"):(e=5===e.length?this.constructInlineMenu(e):e,this.spellCheckSuggestion.push("Add To Dictionary"));var t=[];if(this.spellCheckSuggestion.length>0)for(var i=0,n=this.spellCheckSuggestion;i<n.length;i++){var r=n[i];t.push({text:r,id:this.documentHelper.owner.element.id+"_contextmenu_otherSuggestions_spellcheck_"+r,iconCss:""})}return t},e.prototype.checktextElementHasErrors=function(e,i,n){var r=!1,o=[];if(e=e.replace(/[\s]+/g,""),!t.isNullOrUndefined(i.errorCollection)&&i.errorCollection.length>0){if(!this.documentHelper.isScrollHandler&&(i.ischangeDetected||i.paragraph.isChangeDetected))return this.updateStatusForGlobalErrors(i.errorCollection,i),i.errorCollection=[],i.ischangeDetected=!0,{errorFound:r,elements:o};for(var s=0;s<i.errorCollection.length;s++)this.handleErrorCollection(i.errorCollection[s])&&(r=!0,o.push(i.errorCollection[s]))}else!this.documentHelper.isScrollHandler&&i.paragraph.isChangeDetected?i.ischangeDetected=!0:!i.ischangeDetected&&this.handleErrorCollection(i)&&(r=!0,o.push(i));return{errorFound:r,elements:o}},e.prototype.updateStatusForGlobalErrors=function(e,t){if(e.length>0)for(var i=0;i<e.length;i++){var n=this.manageSpecialCharacters(e[i].text,void 0,!0);if(this.errorWordCollection.containsKey(n))for(var r=this.errorWordCollection.get(n),o=0;o<r.length;o++)if(r[o]instanceof Re&&r[o]===e[i]){r[o].ischangeDetected=!0,r[o].start.offset=t.line.getOffset(t.istextCombined?this.getCombinedElement(t):t,0),r[o].line=t.line;break}}},e.prototype.handleErrorCollection=function(e){var t=this.errorWordCollection,i=this.manageSpecialCharacters(e.text,void 0,!0);return!!(t.containsKey(i)&&e.length>1)&&(!(this.ignoreAllItems.indexOf(i)>-1)||(t.containsKey(i)&&t.remove(i),!1))},e.prototype.constructInlineMenu=function(e){for(var t=e.length-1;t>0;t--)e.length>3&&(this.spellCheckSuggestion.push(e[t]),e.pop());return e},e.prototype.findCurretText=function(){var e,i,n=this.documentHelper.selection.start,r=n.currentWidget.getInline(this.documentHelper.selection.start.offset,0);if(!t.isNullOrUndefined(r.element)){if(!t.isNullOrUndefined(r.element.errorCollection)&&r.element.errorCollection.length>0)for(var o=0;o<r.element.errorCollection.length;o++){var s=r.element.errorCollection[o];if(s.start.location.x<=n.location.x&&s.end.location.x>=n.location.x){i=s.text,e=s;break}}else i=r.element.text;" "===i&&(i=(r=n.currentWidget.getInline(this.documentHelper.selection.start.offset+1,0)).element.text)}return{text:i,element:e}},e.prototype.addErrorCollection=function(e,i,n){if(e=this.manageSpecialCharacters(e,void 0,!0),this.errorWordCollection.containsKey(e)){var r=this.errorWordCollection.get(e);i instanceof Re?this.compareErrorTextElement(i,r)||r.push(i):i instanceof Oe&&(this.compareTextElement(i,r)||r.push(i))}else!t.isNullOrUndefined(n)&&n.length>0&&this.errorSuggestions.add(e,n),this.errorWordCollection.add(e,[i])},e.prototype.compareErrorTextElement=function(e,t){for(var i=[],n=!1,r=0;r<t.length;r++)i.push(t[r]);for(var o=t.length,r=0;r<o;r++)if(i[r]instanceof Re)if(i[r].ischangeDetected){var s=this.manageSpecialCharacters(i[r].text,void 0,!0);n=!0,this.removeErrorsFromCollection({element:i[r],text:s})}else{var a=i[r];if(e.start.offset===a.start.offset&&e.end.offset===a.end.offset)return!0}return n&&this.errorWordCollection.add(this.manageSpecialCharacters(e.text,void 0,!0),[e]),!1},e.prototype.compareTextElement=function(e,t){for(var i=0;i<t.length;i++)if(t[i]instanceof Oe&&t[i]===e)return!0;return!1},e.prototype.handleWordByWordSpellCheck=function(e,t,i,n,r,o,s){if(e.HasSpellingError&&s){this.addErrorCollection(t.text,t,e.Suggestions);var a=t.line.paragraph.containerWidget instanceof Pe?t.line.paragraph.containerWidget.cellFormat.shading.backgroundColor:this.documentHelper.backgroundColor;this.documentHelper.render.renderWavyLine(t,i,n,r,"#FF0000","Single",o,a),t.isSpellChecked=!0}else t.isSpellChecked=!0},e.prototype.checkElementCanBeCombined=function(e,i,n,r,o,s,a,l){var d=t.isNullOrUndefined(o)?"":o,h=!t.isNullOrUndefined(l)&&l,c=!!t.isNullOrUndefined(a)||a,p=!!t.isNullOrUndefined(s)||s,g=[],u=this.documentHelper.selection.getLineWidget(e,0),m=u.children.indexOf(e),f=e.text;g.push(e);var v=a?0:1,y=!1,b=!1;if("\v"!==e.text){if(c){for(var w=void 0,C=m-v;C>=0;C--)if((w=u.children[C])instanceof Oe&&!b){if(0!==f.indexOf(" ")&&w.text.lastIndexOf(" ")!==w.text.length-1)y=!t.isNullOrUndefined(o),d=w.text+d,f=w.text,b=!1,g.push(w),h=!0;else if(!t.isNullOrUndefined(w)){w=w.nextElement;break}}else w instanceof Ie&&1!==w.fieldType&&(b=!0);var x=h?w:e;if(this.lookThroughPreviousLine(d,f,x,i,n))return!0}a?d=y?d:e.text+d:d+=e.text,b=!1;var F=e.text;if(p){for(var P=!1,T=void 0,C=m+1;C<u.children.length;C++)if((T=u.children[C])instanceof Oe&&!b){if(F.lastIndexOf(" ")!==F.length-1&&0!==T.text.indexOf(" "))d+=T.text,F=T.text,b=!1,g.push(T),P=!0,h=!0;else if(!t.isNullOrUndefined(T)){T=T.previousElement;break}}else T instanceof Ie&&2!==T.fieldType&&(b=!0);if("\f"!==(x=P?T:e).text&&this.lookThroughNextLine(d,f,x,i,n))return!0}}return h&&r&&!this.checkCombinedElementsBeIgnored(g,d)&&this.handleCombinedElements(e,d,i,n),h},e.prototype.lookThroughPreviousLine=function(e,i,n,r,o){if(!t.isNullOrUndefined(n)&&0===n.indexInOwner&&!t.isNullOrUndefined(n.line.previousLine)){var s=n.line.previousLine,a=s.children.length-1;if(!t.isNullOrUndefined(s.children[a])&&s.children[a]instanceof Oe){var l=s.children[a];if(!t.isNullOrUndefined(n.text)&&0!==n.text.indexOf(" ")&&l.text.lastIndexOf(" ")!==l.text.length-1)return e=e.length>0?e:i,this.checkElementCanBeCombined(l,r,o,!0,e,!1,!0,!0),!0}}return!1},e.prototype.lookThroughNextLine=function(e,i,n,r,o){if(!t.isNullOrUndefined(n)&&n.indexInOwner===n.line.children.length-1&&!t.isNullOrUndefined(n.line.nextLine)){var s=n.line.nextLine;if(!t.isNullOrUndefined(s.children[0])&&s.children[0]instanceof Oe){var a=s.children[0];if(n.text.lastIndexOf(" ")!==n.text.length-1&&0!==a.text.indexOf(" "))return e=e.length>0?e:i,this.checkElementCanBeCombined(a,r,o,!0,e,!0,!1,!0),!0}}return!1},e.prototype.handleCombinedElements=function(e,t,i,n){e.istextCombined=!0;var r=t.split(/[\s]+/);if(-1===this.ignoreAllItems.indexOf(t)&&e instanceof Oe&&-1===e.ignoreOnceItems.indexOf(t))if(r.length>1)for(var o=0;o<r.length;o++){var s=r[o];s=this.manageSpecialCharacters(s,void 0,!0),this.documentHelper.render.handleUnorderedElements(s,e,i,o,0,o===r.length-1,n)}else t=this.manageSpecialCharacters(t,void 0,!0),this.documentHelper.render.handleUnorderedElements(t,e,i,0,0,!0,n)},e.prototype.checkArrayHasSameElement=function(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.start.location.x===t.start.location.x&&n.start.location.y===t.start.location.y)return!0}return!1},e.prototype.handleSplitWordSpellCheck=function(e,t,i,n,r,o,s,a){if(e.HasSpellingError&&" "!==i.text&&n){var l=this.getMatchedResultsFromElement(i,t);s=i.istextCombined?i.line.getOffset(this.getCombinedElement(i),0):s,this.documentHelper.owner.searchModule.textSearch.updateMatchedTextLocation(l.matches,l.textResults,l.elementInfo,0,i,!1,null,s),this.handleMatchedResults(l.textResults,i,r,o,e.Suggestions,a)}else a&&(i.isSpellChecked=!0);this.updateUniqueWords([{Text:t,HasSpellError:e.HasSpellingError}])},e.prototype.handleMatchedResults=function(e,i,n,r,o,s){if(0===e.length&&s)return void(i.isSpellChecked=!0);for(var a=0;a<e.length;a++){var l=this.createErrorElementWithInfo(e.innerList[a],i);t.isNullOrUndefined(i.errorCollection)||this.checkArrayHasSameElement(i.errorCollection,l)||i.errorCollection.splice(r,0,l),this.addErrorCollection(l.text,l,o);var d=i.line.paragraph.containerWidget instanceof Pe?i.paragraph.containerWidget.cellFormat.shading.backgroundColor:this.documentHelper.backgroundColor;this.documentHelper.render.renderWavyLine(l,l.start.location.x,l.start.location.y-i.margin.top,n,"#FF0000","Single",i.characterFormat.baselineAlignment,d),s&&(i.isSpellChecked=!0)}},e.prototype.callSpellChecker=function(e,i,n,r,o,s){var a=this,l=this;return new Promise(function(d,h){if(!t.isNullOrUndefined(a)){var c=new XMLHttpRequest,p=a.documentHelper.owner.serviceUrl+a.documentHelper.owner.serverActionSettings.spellCheck;p=s?p+"ByPage":p,c.open("POST",p,!0),c.setRequestHeader("Content-Type","application/json"),a.setCustomHeaders(c);var g={LanguageID:e,TexttoCheck:i,CheckSpelling:n,CheckSuggestion:r,AddWord:o};c.send(JSON.stringify(g)),c.onreadystatechange=function(){if(4===c.readyState)if(200===c.status||304===c.status)d(c.response);else{var e={name:"onFailure",status:c.status,statusText:c.responseText,url:p};l.documentHelper.owner.fireServiceFailure(e),h(c.response)}}}})},e.prototype.setCustomHeaders=function(e){for(var t=0;t<this.documentHelper.owner.headers.length;t++)for(var i=this.documentHelper.owner.headers[t],n=0,r=Object.keys(i);n<r.length;n++){var o=r[n];e.setRequestHeader(o,i[o])}},e.prototype.checkForNextError=function(){if(!t.isNullOrUndefined(this.viewer)){var e=this.errorWordCollection;if(e.length>0)for(var i=0;i<e.length;i++){for(var n=e.get(e.keys[i]),r=0;r<n.length;r++){if(n[r]instanceof Re&&!n[r].ischangeDetected)this.updateErrorElementTextBox(e.keys[i],n[r]);else if(n[r]instanceof Oe){var o=this.getMatchedResultsFromElement(n[r]),s=o.textResults,a=n[r].ischangeDetected?n[r].start.offset:n[r].line.getOffset(n[r],0);this.documentHelper.owner.searchModule.textSearch.updateMatchedTextLocation(o.matches,s,o.elementInfo,0,n[r],!1,null,a);for(var l=0;l<s.length;l++){var d=this.createErrorElementWithInfo(s.innerList[l],n[r]);this.updateErrorElementTextBox(d.text,d);break}}break}break}else this.documentHelper.clearSelectionHighlight()}},e.prototype.createErrorElementWithInfo=function(e,t){var i=new Re;return i.text=e.text,i.start=e.start,i.end=e.end,i.height=t.height,i.canTrigger=t.canTrigger,i.characterFormat.copyFormat(t.characterFormat),i.width=this.documentHelper.textHelper.getWidth(i.text,t.characterFormat),i},e.prototype.getMatchedResultsFromElement=function(e,i){var n=e.line,r=this.documentHelper.owner.searchModule.textSearch.stringToRegex(t.isNullOrUndefined(i)?e.text:i,"CaseSensitive");this.textSearchResults.clearResults();for(var o,s=this.textSearchResults,a=this.documentHelper.owner.searchModule.textSearch.getElementInfo(n.children[0],0,!1),l=a.fullText,d=[],h=a.elementsWithOffset;!t.isNullOrUndefined(o=r.exec(l));)d.push(o);return{matches:d,elementInfo:h,textResults:s}},e.prototype.updateErrorElementTextBox=function(e,t){var i=t;this.documentHelper.clearSelectionHighlight(),this.documentHelper.selection.start=i.start,this.documentHelper.selection.end=i.end,this.documentHelper.selection.highlight(t.start.paragraph,t.start,t.end),this.documentHelper.owner.spellCheckDialog.updateSuggestionDialog(e,i)},e.prototype.getWhiteSpaceCharacterInfo=function(e,i){var n=[],r=0,o=0;if(n=e.match(/[\s]+/),!t.isNullOrUndefined(n)&&n.length>0)for(var s=0;s<n.length;s++)r+=this.documentHelper.textHelper.getWidth(n[s],i),o+=n[s].length;return{width:r,wordLength:o,isBeginning:!t.isNullOrUndefined(n)&&0===n.index}},e.prototype.getSpecialCharactersInfo=function(e,i){var n=[],r=0,o=0,s=0;n=e.match(/^[\#\@\!\~\$\%\^\&\*\(\)\-\_\+\=\{\}\[\]\:\;\"\'\,\<\.\>\/\?\`]*/);for(a=0;a<n.length;a++)!t.isNullOrUndefined(n[a])&&n[a].length>0&&(r=this.documentHelper.textHelper.getWidth(n[a],i)),s=n.length;n=e.match(/[\#\@\!\~\$\%\^\&\*\(\)\-\_\+\=\{\}\[\]\:\;\"\'\,\<\.\>\/\?\`]*$/);for(var a=0;a<n.length;a++)!t.isNullOrUndefined(n[a])&&n[a].length>0&&(o=this.documentHelper.textHelper.getWidth(n[a],i)),s=n.length;return{beginningWidth:r,endWidth:o,wordLength:s}},e.prototype.getCombinedElement=function(e){for(var i=e;!t.isNullOrUndefined(e)&&e instanceof Oe&&e.istextCombined;)i=e,e=e.previousElement;return i},e.prototype.checkCombinedElementsBeIgnored=function(e,t){t=this.manageSpecialCharacters(t,void 0,!0);for(var i=0;i<e.length;i++)if(-1!==e[i].ignoreOnceItems.indexOf(t))return!0;return!1},e.prototype.updateSplittedElementError=function(e,t){var i=e.errorCollection.length;if(i>0){for(var n=[],r=0;r<i;r++)n.push(e.errorCollection[r]);for(r=0;r<i;r++)-1===e.text.indexOf(n[r].text)&&(t.ischangeDetected=!0,e.errorCollection.splice(0,1))}},e.prototype.getPageContent=function(e){var t="";if(this.documentHelper.owner.sfdtExportModule){var i=this.documentHelper.owner.sfdtExportModule;i.Initialize();var n=i.writePage(e);if(this.documentHelper.owner.textExportModule){var r=this.documentHelper.owner.textExportModule;r.pageContent="",r.setDocument(n),r.writeInternal(),t=r.pageContent}}return t},e.prototype.updateUniqueWords=function(e){if(t.isNullOrUndefined(localStorage.getItem(this.uniqueKey))||(this.uniqueSpelledWords=JSON.parse(localStorage.getItem(this.uniqueKey))),this.uniqueSpelledWords=this.uniqueSpelledWords||{},e.length+Object.keys(this.uniqueSpelledWords).length<=this.uniqueWordsCount)for(var i=0;i<e.length;i++)this.checkForUniqueWords(e[i]);localStorage.setItem(this.uniqueKey,JSON.stringify(this.uniqueSpelledWords)),this.uniqueSpelledWords={}},e.prototype.checkForUniqueWords=function(e){this.uniqueSpelledWords[e.Text]||(this.uniqueSpelledWords[e.Text]=e.HasSpellError)},e.prototype.clearCache=function(){t.isNullOrUndefined(localStorage.getItem(this.uniqueKey))||localStorage.removeItem(this.uniqueKey)},e.prototype.createGuid=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?i:3&i|8).toString(16)})},e.prototype.checkSpellingInPageInfo=function(e){var i=JSON.parse(localStorage.getItem(this.uniqueKey));return t.isNullOrUndefined(i)||t.isNullOrUndefined(i[e])?{hasSpellError:!1,isElementPresent:!1}:{hasSpellError:i[e],isElementPresent:!0}},e.prototype.destroy=function(){this.errorWordCollection=void 0,this.ignoreAllItems=void 0,this.errorSuggestions=void 0,this.uniqueSpelledWords={},this.textSearchResults=void 0,t.isNullOrUndefined(localStorage.getItem(this.uniqueKey))||localStorage.removeItem(this.uniqueKey)},e}(),ki=function(){function e(e){var i=this;this.isNewComment=!1,this.selectedTab=0,this.onTabSelection=function(e){i.selectedTab=e.selectedIndex,1===i.selectedTab?i.owner.trackChangesPane.updateHeight():i.commentPane.updateHeight(),setTimeout(function(){i.owner.resize()},10)},this.owner=e;var n=new t.L10n("documenteditor",this.owner.defaultLocale);n.setLocale(this.owner.locale),this.initReviewPane(n),this.parentPaneElement.style.display="none"}return Object.defineProperty(e.prototype,"previousSelectedComment",{get:function(){return this.previousSelectedCommentInt},set:function(e){if(!t.isNullOrUndefined(e)&&e!==this.previousSelectedCommentInt&&this.commentPane.comments.containsKey(e)){var i=this.commentPane.getCommentStart(e).commentMark;i&&(t.classList(i,[],["e-de-cmt-mark-selected"]),this.commentPane.removeSelectionMark("e-de-cmt-selection"),this.commentPane.removeSelectionMark("e-de-cmt-mark-selected"));var n=this.commentPane.comments.get(e);n.hideDrawer();for(var r=0;r<e.replyComments.length;r++)(n=this.commentPane.comments.get(e.replyComments[r]))&&(n.hideDrawer(),n.hideMenuItems())}this.previousSelectedCommentInt=e},enumerable:!0,configurable:!0}),e.prototype.showHidePane=function(e,t){this.parentPaneElement&&(this.updateTabHeaderWidth(),e?(this.parentPaneElement.style.display="block","Changes"===t?(this.isCommentTabVisible=!1,this.owner.notify("reviewPane",{comment:this.isCommentTabVisible,changes:!0}),this.reviewTab.select(1)):(this.owner.trackChangesPane.isChangesTabVisible=!1,this.owner.notify("reviewPane",{comment:!0,changes:this.owner.trackChangesPane.isChangesTabVisible}),this.reviewTab.select(0)),this.owner.trackChangesPane.updateTrackChanges(e),this.commentPane.updateCommentStatus()):this.parentPaneElement.style.display="none"),e&&this.commentPane.updateHeight(),this.owner&&this.owner.resize()},e.prototype.reviewPaneHelper=function(e){var i=this;t.isNullOrUndefined(e.comment)&&t.isNullOrUndefined(e.changes)||(e.comment||e.changes?"none"===this.parentPaneElement.style.display&&(this.parentPaneElement.style.display="block",this.owner&&setTimeout(function(){i.owner.resize()},10)):(this.parentPaneElement.style.display="none",this.owner&&setTimeout(function(){i.owner.resize()},10)))},e.prototype.updateTabHeaderWidth=function(){var e=this.reviewTab.getRootElement().getElementsByClassName("e-tab-wrap");e[0].style.padding="0 8px",e[1].style.padding="0 8px"},e.prototype.initReviewPane=function(e){var t=this.owner.documentHelper.optionsPaneContainer;t.style.display="inline-flex",this.initPaneHeader(e),t.appendChild(this.addReviewTab(e)),this.initCommentPane(),this.owner.on("reviewPane",this.reviewPaneHelper,this)},e.prototype.addReviewTab=function(e){var n=t.createElement("div",{innerHTML:e.getConstant("Comments")}),r=t.createElement("div",{innerHTML:e.getConstant("Changes")});this.parentPaneElement=t.createElement("div",{styles:"height:100%;overflow:auto;display:none",className:"e-de-review-pane"}),this.element=t.createElement("div",{className:"e-de-property-tab"});var o=[{header:{text:n},content:this.reviewPane},{header:{text:r}}];this.reviewTab=new i.Tab({items:o,selected:this.onTabSelection,animation:{previous:{effect:"None"},next:{effect:"None"}}}),this.reviewTab.appendTo(this.element),this.owner.enableRtl&&(this.reviewTab.enableRtl=!0),this.reviewTab.enablePersistence=!0,this.parentPaneElement.appendChild(this.element),this.closeButton=t.createElement("button",{className:"e-de-close-icon e-btn e-flat e-icon-btn",id:"close",attrs:{type:"button",style:"position:absolute;top:6px;right:1px"}}),this.closeButton.title=e.getConstant("Close");var s=t.createElement("span",{className:"e-de-op-close-icon e-de-close-icon e-btn-icon e-icons"});return this.closeButton.appendChild(s),this.element.appendChild(this.closeButton),this.closeButton.addEventListener("click",this.closePane.bind(this)),this.parentPaneElement},e.prototype.initPaneHeader=function(e){return this.headerContainer=t.createElement("div"),this.reviewPane=t.createElement("div",{className:"e-de-cmt-pane"}),this.owner.enableRtl&&t.classList(this.reviewPane,["e-rtl"],[]),this.headerContainer.appendChild(this.initToolbar(e)),this.reviewPane.appendChild(this.headerContainer),this.reviewPane.style.display="block",this.reviewPane},e.prototype.closePane=function(){if(this.commentPane&&this.commentPane.isEditMode)if(!t.isNullOrUndefined(this.commentPane.currentEditingComment)&&this.commentPane.isInsertingReply&&""===this.commentPane.currentEditingComment.replyViewTextBox.value)this.owner.documentHelper.currentSelectedComment=void 0,this.commentPane.currentEditingComment.cancelReply(),this.owner.showComments=!1;else if(this.isNewComment||!t.isNullOrUndefined(this.commentPane.currentEditingComment)&&this.commentPane.isInsertingReply&&""!==this.commentPane.currentEditingComment.replyViewTextBox.value||!t.isNullOrUndefined(this.commentPane.currentEditingComment)&&!this.commentPane.isInsertingReply&&this.commentPane.currentEditingComment.textArea.value!==this.commentPane.currentEditingComment.comment.text){var e=new t.L10n("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),this.confirmDialog=n.DialogUtility.confirm({title:e.getConstant("Un-posted comments"),content:e.getConstant("Discard Comment"),okButton:{text:"Discard",click:this.discardButtonClick.bind(this)},cancelButton:{text:"Cancel",click:this.closeDialogUtils.bind(this)},showCloseIcon:!0,closeOnEscape:!0,animationSettings:{effect:"Zoom"},position:{X:"Center",Y:"Center"}})}else this.owner.documentHelper.currentSelectedComment=void 0,this.commentPane.currentEditingComment.cancelEditing(),this.owner.showComments=!1;else this.owner.showComments=!1,this.owner.showRevisions=!1,this.owner.documentHelper.currentSelectedComment=void 0,this.owner.documentHelper.currentSelectedRevision=void 0,this.owner.notify("reviewPane",{changes:!1,comment:!1})},e.prototype.discardButtonClick=function(){if(this.commentPane.currentEditingComment){var e=this.isNewComment;this.commentPane.currentEditingComment&&this.commentPane.isInsertingReply?this.commentPane.currentEditingComment.cancelReply():(this.commentPane.currentEditingComment.cancelEditing(),e&&this.discardComment(this.commentPane.currentEditingComment.comment)),this.owner.documentHelper.currentSelectedComment=void 0,this.closeDialogUtils(),this.owner.showComments=!1}},e.prototype.closeDialogUtils=function(){this.confirmDialog.close(),this.confirmDialog=void 0},e.prototype.initToolbar=function(e){return this.toolbarElement=t.createElement("div"),this.toolbar=new i.Toolbar({items:[{prefixIcon:"e-de-new-cmt e-de-cmt-tbr",tooltipText:e.getConstant("New Comment"),text:e.getConstant("New Comment"),click:this.insertComment.bind(this)},{prefixIcon:"e-de-nav-left-arrow e-de-cmt-tbr",align:"Right",tooltipText:e.getConstant("Previous Comment"),click:this.navigatePreviousComment.bind(this)},{prefixIcon:"e-de-nav-right-arrow e-de-cmt-tbr",align:"Right",tooltipText:e.getConstant("Next Comment"),click:this.navigateNextComment.bind(this)}],enableRtl:this.owner.enableRtl}),this.toolbar.appendTo(this.toolbarElement),this.toolbarElement},e.prototype.insertComment=function(){this.owner&&this.owner.editorModule&&(this.owner.editor.isUserInsert=!0,this.owner.editorModule.insertComment(""),this.owner.editor.isUserInsert=!1)},e.prototype.addComment=function(e,t,i){this.isNewComment=t,this.owner.documentHelper.currentSelectedComment=e,this.commentPane.insertComment(e),t||(this.commentPane.comments.get(e).cancelEditing(),this.enableDisableToolbarItem()),i&&this.selectComment(e)},e.prototype.deleteComment=function(e){this.commentPane&&this.commentPane.deleteComment(e)},e.prototype.selectComment=function(e){this.commentPane.isEditMode||(e.isReply&&(e=e.ownerComment),this.owner&&this.owner.viewer&&this.owner.documentHelper.currentSelectedComment!==e&&(this.owner.documentHelper.currentSelectedComment=e),this.commentPane.selectComment(e))},e.prototype.resolveComment=function(e){this.commentPane.resolveComment(e)},e.prototype.reopenComment=function(e){this.commentPane.reopenComment(e)},e.prototype.addReply=function(e,t,i){this.isNewComment=t,this.commentPane.insertReply(e),t||(this.commentPane.comments.get(e).cancelEditing(),this.enableDisableToolbarItem()),i&&this.selectComment(e.ownerComment)},e.prototype.navigatePreviousComment=function(){this.owner&&this.owner.editorModule&&this.owner.selection.navigatePreviousComment()},e.prototype.navigateNextComment=function(){this.owner&&this.owner.editorModule&&this.owner.selection.navigateNextComment()},e.prototype.enableDisableItems=function(){this.enableDisableToolbarItem();for(var e=this.commentPane.comments.keys,t=0;t<e.length;t++){var i=this.commentPane.comments.get(e[t]);this.owner.isReadOnly?(i.replyViewTextBox.style.display="none",i.menuBar.style.display="none"):(i.replyViewTextBox.style.display="block",i.menuBar.style.display="block")}},e.prototype.enableDisableToolbarItem=function(){if(this.toolbar){var e=!0;this.commentPane.isEditMode&&(e=!this.commentPane.isEditMode),this.owner.isReadOnly&&(e=!this.owner.isReadOnly);var t=this.toolbar.element.querySelectorAll(".e-de-cmt-tbr");this.toolbar.enableItems(t[0].parentElement.parentElement,e),e&&this.owner&&this.owner.viewer&&(e=!(0===this.owner.documentHelper.comments.length)),this.toolbar.enableItems(t[1].parentElement.parentElement,e),this.toolbar.enableItems(t[2].parentElement.parentElement,e)}},e.prototype.initCommentPane=function(){this.commentPane=new Li(this.owner,this),this.commentPane.initCommentPane()},e.prototype.layoutComments=function(){for(var e=0;e<this.owner.documentHelper.comments.length;e++)this.commentPane.addComment(this.owner.documentHelper.comments[e])},e.prototype.clear=function(){this.previousSelectedCommentInt=void 0,this.commentPane.clear()},e.prototype.discardComment=function(e){e&&(this.owner.editorHistory?(this.owner.editorHistory.undo(),this.owner.editorHistory.redoStack.pop()):this.owner.editor&&this.owner.editor.deleteCommentInternal(e))},e.prototype.destroy=function(){this.commentPane&&this.commentPane.destroy(),this.commentPane=void 0,this.closeButton&&this.closeButton.parentElement&&this.closeButton.parentElement.removeChild(this.closeButton),this.closeButton=void 0,this.toolbar&&this.toolbar.destroy(),this.toolbar=void 0,this.toolbarElement&&this.toolbarElement.parentElement&&this.toolbarElement.parentElement.removeChild(this.toolbarElement),this.toolbarElement=void 0,this.headerContainer&&this.headerContainer.parentElement&&this.headerContainer.parentElement.removeChild(this.headerContainer),this.headerContainer=void 0,this.previousSelectedCommentInt=void 0,this.reviewPane&&this.reviewPane.parentElement&&this.reviewPane.parentElement.removeChild(this.reviewPane),this.owner.off("reviewPane",this.reviewPaneHelper),this.reviewPane.innerHTML="",this.reviewPane=void 0,this.owner=void 0},e}(),Li=function(){function e(e,t){this.isEditModeInternal=!1,this.isInsertingReply=!1,this.owner=e,this.parentPane=t,this.parent=t.reviewPane,this.comments=new u}return Object.defineProperty(e.prototype,"isEditMode",{get:function(){return this.isEditModeInternal},set:function(e){this.isEditModeInternal=e;for(var t=this.comments.keys,i=0;i<t.length;i++){var n=this.comments.get(t[i]);e?n.menuBar.style.display="none":n.comment.isReply||(n.menuBar.style.display="block")}this.parentPane&&this.parentPane.enableDisableToolbarItem(),this.owner&&(this.isEditModeInternal?this.owner.trigger("commentBegin"):this.owner.trigger("commentEnd"))},enumerable:!0,configurable:!0}),e.prototype.initCommentPane=function(){this.commentPane=t.createElement("div",{className:"e-de-cmt-container"});var e=new t.L10n("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),this.noCommentIndicator=t.createElement("div",{className:"e-de-cmt-no-cmt",innerHTML:e.getConstant("No comments in this document")}),this.commentPane.appendChild(this.noCommentIndicator),this.parent.appendChild(this.commentPane)},e.prototype.addComment=function(e){var t=new Ri(this.owner,this,e),i=t.layoutComment(!1);this.comments.add(e,t),this.commentPane.appendChild(i);for(var n=0;n<e.replyComments.length;n++){var r=new Ri(this.owner,this,e.replyComments[n]);this.comments.add(e.replyComments[n],r),i.insertBefore(r.layoutComment(!0),t.replyViewContainer)}this.updateCommentStatus(),t.hideDrawer()},e.prototype.updateHeight=function(){var e=this.parentPane.reviewTab.getRootElement().getElementsByClassName("e-tab-header")[0].getBoundingClientRect().height;this.commentPane.style.height=this.parentPane.parentPaneElement.clientHeight-this.parentPane.headerContainer.clientHeight-e+"px"},e.prototype.insertReply=function(e){var t=e.ownerComment,i=this.comments.get(t),n=new Ri(this.owner,this,e);this.comments.add(e,n);var r=n.layoutComment(!0),o=t.replyComments.indexOf(e);if(o===t.replyComments.length-1)i.parentElement.insertBefore(r,i.replyViewContainer);else{var s=t.replyComments[o+1];i.parentElement.insertBefore(r,this.comments.get(s).parentElement)}n.editComment()},e.prototype.insertComment=function(e){var t=new Ri(this.owner,this,e),i=t.layoutComment(!1);if(this.comments.add(e,t),this.owner.documentHelper.comments.indexOf(e)===this.owner.documentHelper.comments.length-1)this.commentPane.appendChild(i);else{var n=this.owner.documentHelper.comments.indexOf(e),r=this.comments.get(this.owner.documentHelper.comments[n+1]).parentElement;this.commentPane.insertBefore(i,r),i.focus()}this.updateCommentStatus(),t.editComment()},e.prototype.removeSelectionMark=function(e){if(this.parent)for(var i=this.parent.getElementsByClassName(e),n=0;n<i.length;n++)t.classList(i[n],[],[e])},e.prototype.selectComment=function(e){if(this.removeSelectionMark("e-de-cmt-selection"),e.isReply&&(e=e.ownerComment),e){this.owner.notify("reviewPane",{comment:!0,changes:this.owner.trackChangesPane.isChangesTabVisible});var i=this.comments.get(e),n=i.parentElement;n&&(t.classList(n,["e-de-cmt-selection"],[]),n.focus());var r=this.getCommentStart(e);r.commentMark||r.renderCommentMark(),t.classList(r.commentMark,["e-de-cmt-mark-selected"],[]),i.showDrawer()}},e.prototype.getCommentStart=function(e){var i=new t.L10n("documenteditor",this.owner.defaultLocale);i.setLocale(this.owner.locale);var n=void 0;return e&&e.commentStart&&(n=e.commentStart),void 0!==n.commentMark&&(n.commentMark.title=i.getConstant("Click to see this comment")),this.getFirstCommentInLine(n)},e.prototype.getFirstCommentInLine=function(e){for(var t=0;t<e.line.children.length;t++){var i=e.line.children[t];if(i instanceof vt&&0===i.commentType)return i}return e},e.prototype.deleteComment=function(e){var i=this.comments.get(e);if(!t.isNullOrUndefined(i)){i.parentElement&&i.parentElement.parentElement&&i.parentElement.parentElement.removeChild(i.parentElement);for(var n=0;n<e.replyComments.length;n++){var r=e.replyComments[n];this.comments.containsKey(r)&&this.comments.remove(r)}this.comments.remove(e),i.destroy()}this.updateCommentStatus()},e.prototype.resolveComment=function(e){var t=this.comments.get(e);t&&t.resolveComment()},e.prototype.reopenComment=function(e){var t=this.comments.get(e);t&&t.reopenComment()},e.prototype.updateCommentStatus=function(){0===this.owner.documentHelper.comments.length?(this.noCommentIndicator.parentElement||this.commentPane.appendChild(this.noCommentIndicator),this.noCommentIndicator.style.display="block",this.parentPane.isCommentTabVisible=!1,this.owner.notify("reviewPane",{comment:!1,changes:this.owner.trackChangesPane.isChangesTabVisible}),this.parentPane.reviewTab.hideTab(0)):(this.parentPane.isCommentTabVisible=!0,this.noCommentIndicator.style.display="none",this.owner.notify("reviewPane",{comment:!0,changes:this.owner.trackChangesPane.isChangesTabVisible}),this.parentPane.reviewTab.hideTab(0,!1)),this.parentPane&&this.parentPane.enableDisableToolbarItem()},e.prototype.clear=function(){this.isEditMode=!1,this.currentEditingComment=void 0,this.isInsertingReply=!1,this.removeChildElements(),this.commentPane.innerHTML="",this.updateCommentStatus()},e.prototype.removeChildElements=function(){for(var e=this.comments.keys,t=0;t<e.length;t++)this.comments.get(e[t]).destroy();this.comments.clear()},e.prototype.destroy=function(){this.removeChildElements(),this.noCommentIndicator&&this.noCommentIndicator&&this.noCommentIndicator.parentElement.removeChild(this.noCommentIndicator),this.noCommentIndicator=void 0,this.commentPane&&this.commentPane.parentElement&&this.commentPane.parentElement.removeChild(this.commentPane),this.commentPane.innerHTML="",this.parentPane=void 0,this.owner=void 0},e}(),Ri=function(){function e(e,t,i){this.isReply=!1,this.isDrawerExpand=!1,this.owner=e,this.comment=i,this.commentPane=t}return e.prototype.layoutComment=function(e){this.isReply=e;var i="e-de-cmt-sub-container";e&&(i+=" e-de-cmt-reply");var n=new t.L10n("documenteditor",this.owner.defaultLocale);return n.setLocale(this.owner.locale),this.parentElement=t.createElement("div",{className:i}),this.initCommentHeader(n),this.initCommentView(n),this.initDateView(),this.comment.isReply?this.menuBar.style.display="none":(this.parentElement.tabIndex=0,this.initReplyView(n),this.initResolveOption(n),this.initDrawer(),this.comment.isResolved&&this.resolveComment()),this.commentView.addEventListener("mouseenter",this.showMenuItems.bind(this)),this.commentView.addEventListener("mouseleave",this.hideMenuItemOnMouseLeave.bind(this)),this.parentElement},e.prototype.initCommentHeader=function(e){var i=t.createElement("div",{className:"e-de-cmt-view"}),n=t.createElement("div",{className:"e-de-cmt-author"}),r=t.createElement("div",{className:"e-de-cmt-author-name"});r.textContent=this.comment.author,t.isNullOrUndefined(this.comment.author)||(n.style.display="flex",this.owner.documentHelper.getAvatar(n,r,this.comment,void 0)),this.menuBar=t.createElement("button",{className:"e-de-cp-option",attrs:{type:"button"}});var o=[{text:e.getConstant("Edit")},{text:e.getConstant("Delete")},{text:e.getConstant("Reply")},{text:e.getConstant("Resolve")}],s=new d.DropDownButton({items:this.isReply?o.splice(0,2):o,select:this.userOptionSelectEvent.bind(this),iconCss:"e-de-menu-icon",cssClass:"e-caret-hide",enableRtl:this.owner.enableRtl});this.menuBar.title=e.getConstant("More Options")+"...",s.appendTo(this.menuBar),n.appendChild(this.menuBar),this.dropDownButton=s,i.appendChild(n),this.commentView=i,this.parentElement.appendChild(i),i.addEventListener("click",this.selectComment.bind(this))},e.prototype.selectComment=function(){if(this.commentPane)if(this.commentPane.isEditMode){if(this.commentPane.isEditMode&&this.commentPane.isInsertingReply&&this.commentPane.currentEditingComment&&""===this.commentPane.currentEditingComment.replyViewTextBox.value){var e=this.comment;if(e&&e.isReply&&(e=this.comment.ownerComment),e&&this.owner.documentHelper.currentSelectedComment===e)return;this.commentPane.currentEditingComment.cancelReply(),this.owner.selection.selectComment(this.comment)}}else this.owner.selection.selectComment(this.comment)},e.prototype.initCommentView=function(e){this.commentText=t.createElement("div",{className:"e-de-cmt-readonly"}),this.commentText.innerText=this.comment.text,this.commentView.appendChild(this.commentText),this.initEditView(e)},e.prototype.initEditView=function(e){this.textAreaContainer=t.createElement("div",{styles:"display:none"}),this.textArea=t.createElement("textarea",{className:"e-de-cmt-textarea e-input"}),this.textArea.placeholder=e.getConstant("Type your comment here"),this.textArea.rows=1,this.textArea.value=this.comment.text.trim(),this.textArea.addEventListener("keydown",this.updateTextAreaHeight.bind(this)),this.textArea.addEventListener("keyup",this.enableDisablePostButton.bind(this));var i=t.createElement("div",{className:"e-de-cmt-action-button"}),n=t.createElement("button",{className:"e-de-cmt-post-btn e-btn e-flat",attrs:{type:"button"}});this.postButton=new r.Button({cssClass:"e-btn e-flat e-primary e-de-overlay",iconCss:"e-de-cmt-post",disabled:!0},n),n.addEventListener("click",this.postComment.bind(this)),n.title=e.getConstant("Post");var o=t.createElement("button",{className:"e-de-cmt-cancel-btn e-btn e-flat",attrs:{type:"button"}});this.cancelButton=new r.Button({cssClass:"e-btn e-flat",iconCss:"e-de-cmt-cancel"},o),o.title=e.getConstant("Cancel"),o.addEventListener("click",this.cancelEditing.bind(this)),i.appendChild(n),i.appendChild(o),this.textAreaContainer.appendChild(this.textArea),this.textAreaContainer.appendChild(i),this.commentView.appendChild(this.textAreaContainer)},e.prototype.initDateView=function(){this.commentDate=t.createElement("div",{className:"e-de-cmt-date"}),this.commentDate.innerText=L.getModifiedDate(this.comment.date),this.commentView.appendChild(this.commentDate)},e.prototype.initDrawer=function(){this.drawerElement=t.createElement("div",{styles:"display:none;",className:"e-de-cmt-drawer-cnt"});var e=t.createElement("div",{className:"e-de-cmt-drawer"}),i=t.createElement("span");e.appendChild(i),this.drawerElement.appendChild(e),this.drawerSpanElement=i,this.drawerAction=e,this.drawerAction.addEventListener("click",this.showOrHideDrawer.bind(this)),this.parentElement.appendChild(this.drawerElement)},e.prototype.initReplyView=function(e){this.replyViewContainer=t.createElement("div",{className:"e-de-cmt-rply-view"}),this.commentPane.parentPane.isNewComment&&(this.replyViewContainer.style.display="none"),this.replyViewTextBox=t.createElement("textarea",{className:"e-de-cmt-textarea e-input"}),this.replyViewTextBox.placeholder=e.getConstant("Reply"),this.replyViewTextBox.rows=1,this.replyViewTextBox.value="",this.replyViewTextBox.readOnly=!0,this.replyViewTextBox.addEventListener("click",this.enableReplyView.bind(this)),this.replyViewTextBox.addEventListener("keydown",this.updateReplyTextAreaHeight.bind(this)),this.replyViewTextBox.addEventListener("keyup",this.enableDisableReplyPostButton.bind(this));var i=t.createElement("div",{styles:"display:none",className:"e-de-cmt-action-button"}),n=t.createElement("button",{className:"e-de-cmt-post-btn e-de-overlay e-btn e-flat",attrs:{type:"button"}});this.replyPostButton=new r.Button({cssClass:"e-btn e-flat e-primary",iconCss:"e-de-cmt-post",disabled:!0},n),n.addEventListener("click",this.postReply.bind(this)),n.title=e.getConstant("Post");var o=t.createElement("button",{className:"e-de-cmt-cancel-btn e-btn e-flat",attrs:{type:"button"}});this.replyCancelButton=new r.Button({cssClass:"e-btn e-flat",iconCss:"e-de-cmt-cancel"},o),o.addEventListener("click",this.cancelReply.bind(this)),o.title=e.getConstant("Cancel"),i.appendChild(n),i.appendChild(o),this.replyFooter=i,this.replyViewContainer.appendChild(this.replyViewTextBox),this.replyViewContainer.appendChild(i),this.parentElement.appendChild(this.replyViewContainer)},e.prototype.initResolveOption=function(e){var i=t.createElement("div",{className:"e-de-cmt-resolve-btn"}),n=t.createElement("button",{className:"e-de-cmt-post-btn e-btn e-flat",attrs:{type:"button"}});this.reopenButton=new r.Button({cssClass:"e-btn e-flat",iconCss:"e-de-cmt-reopen"},n),n.title=e.getConstant("Reopen"),n.addEventListener("click",this.reopenButtonClick.bind(this));var o=t.createElement("button",{className:"e-de-cmt-cancel-btn e-btn e-flat",attrs:{type:"button"}});o.title=e.getConstant("Delete"),this.deleteButton=new r.Button({cssClass:"e-btn e-flat",iconCss:"e-de-cmt-delete"},o),o.addEventListener("click",this.deleteComment.bind(this)),i.appendChild(n),i.appendChild(o),this.parentElement.appendChild(i)},e.prototype.reopenButtonClick=function(){this.owner.editor.reopenComment(this.comment)},e.prototype.deleteComment=function(){var e={author:this.comment.author,cancel:!1};this.owner.trigger("commentDelete",e);var t={author:this.comment.author,cancel:e.cancel,type:"Delete"};this.owner.trigger("beforeCommentAction",t),t.cancel||this.owner.editorModule.deleteCommentInternal(this.comment)},e.prototype.updateReplyTextAreaHeight=function(){var e=this;setTimeout(function(){e.replyViewTextBox.style.height="auto";var t=e.replyViewTextBox.scrollHeight;e.replyViewTextBox.style.height=t+"px"})},e.prototype.enableDisableReplyPostButton=function(){this.replyPostButton.disabled=""===this.replyViewTextBox.value,this.replyPostButton.disabled?t.classList(this.replyPostButton.element,["e-de-overlay"],[]):this.replyPostButton.element.classList.contains("e-de-overlay")&&t.classList(this.replyPostButton.element,[],["e-de-overlay"])},e.prototype.enableReplyView=function(){var e=this,t={author:this.comment.author,cancel:!1,type:"Reply"};this.owner.trigger("beforeCommentAction",t),t.cancel&&"Reply"===t.type||this.commentPane.isEditMode||(this.commentPane.currentEditingComment=this,this.commentPane.isInsertingReply=!0,this.owner.documentHelper.currentSelectedComment!==this.comment&&this.owner.selection.selectComment(this.comment),this.commentPane.isEditMode=!0,this.replyViewTextBox.readOnly=!1,this.replyFooter.style.display="block",setTimeout(function(){e.replyViewTextBox.focus()}))},e.prototype.postReply=function(){var e=this.replyViewTextBox.value;this.cancelReply(),this.updateReplyTextAreaHeight(),this.owner.editorModule.replyComment(this.comment,e),this.owner.fireContentChange()},e.prototype.cancelReply=function(){this.commentPane.currentEditingComment=void 0,this.commentPane.isInsertingReply=!0,this.commentPane.isEditMode=!1,this.replyPostButton.disabled=!0,this.replyViewTextBox.value="",this.replyViewTextBox.readOnly=!0,this.replyFooter.style.display="none"},e.prototype.updateTextAreaHeight=function(){var e=this;setTimeout(function(){if(!t.isNullOrUndefined(e.textArea)){e.textArea.style.height="auto";var i=e.textArea.scrollHeight;e.textArea.style.height=i+"px"}})},e.prototype.showMenuItems=function(){this.comment.isReply&&(this.commentPane.isEditMode||t.isNullOrUndefined(this.comment)||this.comment.isResolved||(this.menuBar.style.display="block"));var e=this.commentPane.getCommentStart(this.comment);t.isNullOrUndefined(e)||t.isNullOrUndefined(e.commentMark)||e.commentMark.classList.add("e-de-cmt-mark-hover")},e.prototype.hideMenuItemOnMouseLeave=function(){if(this.comment.isReply&&this.owner.documentHelper.currentSelectedComment!==this.comment.ownerComment&&this.hideMenuItems(),this.commentPane){var e=this.commentPane.getCommentStart(this.comment);t.isNullOrUndefined(e)||t.isNullOrUndefined(e.commentMark)||e.commentMark.classList.remove("e-de-cmt-mark-hover")}},e.prototype.hideMenuItems=function(){this.menuBar.style.display="none"},e.prototype.enableDisablePostButton=function(){this.postButton.disabled=""===this.textArea.value,this.postButton.disabled?t.classList(this.postButton.element,["e-de-overlay"],[]):this.postButton.element.classList.contains("e-de-overlay")&&t.classList(this.postButton.element,[],["e-de-overlay"])},e.prototype.editComment=function(){var e=this,t={author:this.comment.author,cancel:!1,type:"Edit"};this.owner.trigger("beforeCommentAction",t),t.cancel&&"Edit"===t.type||(this.commentPane.currentEditingComment=this,this.commentPane.isInsertingReply=!1,this.commentPane.isEditMode=!0,this.commentText.style.display="none",this.textAreaContainer.style.display="block",this.commentDate.style.display="none",this.menuBar.style.display="none",this.updateTextAreaHeight(),setTimeout(function(){e.textArea&&e.textArea.focus()}))},e.prototype.resolveComment=function(){t.classList(this.parentElement,["e-de-cmt-resolved"],[]);var e=new t.L10n("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),this.dropDownButton.items=[{text:e.getConstant("Reopen")},{text:e.getConstant("Delete")}]},e.prototype.reopenComment=function(){t.classList(this.parentElement,[],["e-de-cmt-resolved"]);var e=new t.L10n("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale),this.dropDownButton.items=[{text:e.getConstant("Edit")},{text:e.getConstant("Delete")},{text:e.getConstant("Reply")},{text:e.getConstant("Resolve")}],this.showDrawer()},e.prototype.postComment=function(){var e={author:this.comment.author,cancel:!1,type:"Post"};if(this.owner.trigger("beforeCommentAction",e),!e.cancel||"Post"!==e.type){var i=this.textArea.value;this.commentText.innerText=i,this.comment.text=i,this.showCommentView(),this.commentPane&&this.commentPane.parentPane&&(this.commentPane.parentPane.isNewComment=!1),t.isNullOrUndefined(this.replyViewContainer)||(this.replyViewContainer.style.display=""),this.owner.fireContentChange()}},e.prototype.showCommentView=function(){this.commentPane.isEditMode=!1,this.textAreaContainer.style.display="none",this.commentText.style.display="block",this.commentDate.style.display="block",this.menuBar.style.display="block"},e.prototype.cancelEditing=function(){this.showCommentView(),this.textArea.value=this.comment.text.trim(),this.commentPane.parentPane.isNewComment&&(this.commentPane&&this.commentPane.parentPane&&(this.commentPane.parentPane.isNewComment=!1),this.commentPane.parentPane.discardComment(this.comment))},e.prototype.showOrHideDrawer=function(){this.isDrawerExpand?this.hideDrawer():this.showDrawer()},e.prototype.hideDrawer=function(){if(this.parentElement){var e=new t.L10n("documenteditor",this.owner.defaultLocale);e.setLocale(this.owner.locale);var i=this.parentElement.getElementsByClassName("e-de-cmt-sub-container");if(i.length>1){for(var n=1;n<i.length;n++)i[n].style.display="none";this.drawerElement.style.display="block",t.classList(this.drawerSpanElement,[],["e-de-nav-up"]),this.drawerSpanElement.innerText="+"+(i.length-1)+" "+e.getConstant("more")+"..."}this.isDrawerExpand=!1}},e.prototype.showDrawer=function(){if(this.parentElement){var e=this.parentElement.getElementsByClassName("e-de-cmt-sub-container");if(e.length>1){for(var i=0;i<e.length;i++)e[i].style.display="block";this.drawerElement.style.display="block",this.drawerSpanElement.innerText="",t.classList(this.drawerSpanElement,["e-de-nav-up"],[])}this.isDrawerExpand=!0}},e.prototype.userOptionSelectEvent=function(e){var i=e.item.text,n=new t.L10n("documenteditor",this.owner.defaultLocale);switch(n.setLocale(this.owner.locale),i){case n.getConstant("Edit"):this.editComment();break;case n.getConstant("Reply"):this.enableReplyView();break;case n.getConstant("Delete"):this.deleteComment();break;case n.getConstant("Resolve"):this.owner.editor.resolveComment(this.comment);break;case n.getConstant("Reopen"):this.owner.editor.reopenComment(this.comment)}},e.prototype.unwireEvent=function(){this.drawerAction&&this.drawerAction.removeEventListener("click",this.showOrHideDrawer.bind(this)),this.textArea&&(this.textArea.removeEventListener("keydown",this.updateTextAreaHeight.bind(this)),this.textArea.removeEventListener("keyup",this.enableDisablePostButton.bind(this))),this.postButton&&this.postButton.removeEventListener("click",this.postComment.bind(this)),this.cancelButton&&this.cancelButton.removeEventListener("click",this.cancelEditing.bind(this)),this.commentView&&(this.commentView.removeEventListener("click",this.selectComment.bind(this)),this.commentView.removeEventListener("mouseenter",this.showMenuItems.bind(this)),this.commentView.removeEventListener("mouseleave",this.hideMenuItemOnMouseLeave.bind(this)))},e.prototype.destroy=function(){this.unwireEvent(),this.comment&&(this.comment=void 0),this.dropDownButton&&this.dropDownButton.destroy(),this.dropDownButton=void 0,this.postButton&&this.postButton.destroy(),this.postButton=void 0,this.cancelButton&&this.cancelButton.destroy(),this.replyPostButton&&(this.replyPostButton.destroy(),this.replyPostButton=void 0),this.replyCancelButton&&(this.replyCancelButton.destroy(),this.replyCancelButton=void 0),this.reopenButton&&(this.reopenButton.destroy(),this.reopenButton=void 0),this.deleteButton&&(this.deleteButton.destroy(),this.deleteButton=void 0),this.replyViewContainer=void 0,this.replyViewTextBox=void 0,this.replyFooter=void 0,this.parentElement&&this.parentElement.parentElement&&this.parentElement.parentElement.removeChild(this.parentElement),this.commentPane=void 0,this.parentElement.innerHTML="",this.cancelButton=void 0,this.owner=void 0,this.menuBar=void 0,this.commentView=void 0,this.drawerAction=void 0,this.commentText=void 0,this.commentDate=void 0,this.textAreaContainer=void 0,this.textArea=void 0,this.drawerElement=void 0,this.drawerSpanElement=void 0,this.parentElement=null},e}(),Bi=function(){function e(e){var i=this;this.list=void 0,this.noteNumberFormat=void 0,this.sectionFormat=void 0,this.onCancelButtonClick=function(){i.documentHelper.dialog.hide(),i.documentHelper.updateFocus(),i.unWireEventsAndBindings()},this.loadFontDialog=function(){i.documentHelper.updateFocus();var e,t;if(t=i.sectionFormat?i.sectionFormat:i.documentHelper.owner.selection.sectionFormat,i.documentHelper.selection.isinFootnote){var n=t.footNoteNumberFormat,r=t.initialFootNoteNumber;e=i.reversetype(n),i.notesList.value=e,i.startValueTextBox.value=r}else{var o=t.endnoteNumberFormat;e=i.reversetype(o);r=t.initialEndNoteNumber;i.notesList.value=e,i.startValueTextBox.value=r}},this.onInsertFootnoteClick=function(){var e=new x(void 0);if(!t.isNullOrUndefined(i.notesList)){var n=i.notesList.value.toString(),r=i.types(n),o=i.startValueTextBox.value;t.isNullOrUndefined(i.notesList)||(i.documentHelper.selection.isinFootnote?(e.footNoteNumberFormat=r,e.footNoteNumberFormat=r,e.initialFootNoteNumber=o,i.documentHelper.owner.editorModule.onApplySectionFormat(void 0,e)):(e.endnoteNumberFormat=r,e.endnoteNumberFormat=r,e.initialEndNoteNumber=o,i.documentHelper.owner.editorModule.onApplySectionFormat(void 0,e)))}i.documentHelper.hideDialog()},this.unWireEventsAndBindings=function(){i.notesList.value=void 0},this.documentHelper=e}return e.prototype.getModuleName=function(){return"FootNotesDialog"},e.prototype.notesDialog=function(e,i){var n=this.documentHelper.owner.containerId+"_insert_Footnote";this.target=t.createElement("div",{id:n,className:"e-de-insert-footnote"});var r=t.createElement("div"),o=t.createElement("div",{className:"e-de-insert-footnote-dlg-sub-header",innerHTML:e.getConstant("Start at")}),l=t.createElement("div");this.footCount=t.createElement("input",{attrs:{type:"text"},id:this.documentHelper.owner.containerId+"row"}),l.appendChild(this.footCount);var d=t.createElement("div",{className:"e-de-insert-footnote-dlg-sub-header",innerHTML:e.getConstant("Number format")}),h=t.createElement("div",{className:"e-de-insert-footnote-dlg-header"}),c=t.createElement("select",{id:this.target.id+"_papersize",styles:"padding-bottom: 20px;",innerHTML:'<option value="1, 2, 3, ...">'+e.getConstant("1, 2, 3, ...")+'</option><option value="a, b, c, ...">'+e.getConstant("a, b, c, ...")+'</option><option value="A, B, C, ...">'+e.getConstant("A, B, C, ...")+'</option><option value="I, II, III, ...">'+e.getConstant("I, II, III, ...")+'</option><option value="i, ii, iii, ...">'+e.getConstant("i, ii, iii, ...")+"</option>"});h.appendChild(c),this.notesList=new s.DropDownList({enableRtl:i}),this.notesList.appendTo(c),r.appendChild(d),r.appendChild(h),r.appendChild(o),r.appendChild(l),this.target.appendChild(r),this.startValueTextBox=new a.NumericTextBox({format:"#",min:1,max:99999,enablePersistence:!1}),this.startValueTextBox.appendTo(this.footCount)},e.prototype.show=function(){var e=new t.L10n("documenteditor",this.documentHelper.owner.defaultLocale);if(e.setLocale(this.documentHelper.owner.locale),this.target||this.notesDialog(e),"none"!==this.documentHelper.selection.caret.style.display&&(this.documentHelper.selection.caret.style.display="none"),this.documentHelper.selection.isinFootnote?this.documentHelper.dialog.header=e.getConstant("Footnote"):this.documentHelper.dialog.header=e.getConstant("Endnote"),this.documentHelper.dialog.height="auto",this.documentHelper.dialog.width="auto",this.documentHelper.dialog.content=this.target,this.documentHelper.dialog.beforeOpen=this.loadFontDialog,this.documentHelper.dialog.buttons=[{click:this.onInsertFootnoteClick,buttonModel:{content:e.getConstant("Apply"),cssClass:"e-flat e-table-ok",isPrimary:!0}},{click:this.onCancelButtonClick,buttonModel:{content:e.getConstant("Cancel"),cssClass:"e-flat e-table-cancel"}}],this.startValueTextBox.value=1,this.documentHelper.dialog.close=this.documentHelper.updateFocus,this.documentHelper.dialog.dataBind(),this.documentHelper.dialog.show(),this.documentHelper.selection.isinEndnote){var i=this.endnoteListValue(this.list);this.notesList.index=i}},e.prototype.types=function(e){switch(e){case"1, 2, 3, ...":return"Arabic";case"A, B, C, ...":return"UpperCaseLetter";case"a, b, c, ...":return"LowerCaseLetter";case"I, II, III, ...":return"LowerCaseRoman";case"i, ii, iii, ...":return"UpperCaseRoman";default:return"Arabic"}},e.prototype.reversetype=function(e){switch(e){case"Arabic":return"1, 2, 3, ...";case"UpperCaseLetter":return"A, B, C, ...";case"LowerCaseLetter":return"a, b, c, ...";case"UpperCaseRoman":return"I, II, III, ...";case"LowerCaseRoman":return"i, ii, iii, ...";default:return"1, 2, 3, ..."}},e.prototype.endnoteListValue=function(e){return"A, B, C, ..."===e?0:"1, 2, 3, ..."===e?1:"a, b, c, ..."===e?2:3},e.prototype.destroy=function(){this.footCount&&(this.footCount.parentElement&&this.footCount.parentElement.removeChild(this.footCount),this.footCount=void 0),this.startValueTextBox&&(this.startValueTextBox.destroy(),this.startValueTextBox=void 0),this.notesList&&(this.notesList.destroy(),this.notesList=void 0),this.footCount=void 0},e}(),Di=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ai=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},Mi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Di(i,e),Ai([t.Property("#FFE97F")],i.prototype,"searchHighlightColor",void 0),Ai([t.Property(["Algerian","Arial","Calibri","Cambria","Cambria Math","Candara","Courier New","Georgia","Impact","Segoe Print","Segoe Script","Segoe UI","Symbol","Times New Roman","Verdana","Wingdings"])],i.prototype,"fontFamilies",void 0),Ai([t.Property({shadingColor:"#cfcfcf",applyShading:!0,selectionColor:"#cccccc",formFillingMode:"Popup"})],i.prototype,"formFieldSettings",void 0),Ai([t.Property({roomName:"",editableRegionColor:"#22b24b",lockedRegionColor:"#f44336"})],i.prototype,"collaborativeEditingSettings",void 0),Ai([t.Property(1)],i.prototype,"printDevicePixelRatio",void 0),i}(t.ChildProperty),Ui=function(e){function i(t,i){var n=e.call(this,t,i)||this;return n.enableHeaderFooterIn=!1,n.isShiftingEnabled=!1,n.isLayoutEnabled=!0,n.isPastingContent=!1,n.parser=void 0,n.disableHistoryIn=!1,n.findResultsList=void 0,n.tablePropertiesDialogModule=void 0,n.bordersAndShadingDialogModule=void 0,n.cellOptionsDialogModule=void 0,n.tableOptionsDialogModule=void 0,n.paragraphDialogModule=void 0,n.imageResizerModule=void 0,n.createdTriggered=!1,n.defaultLocale={Table:"Table",Row:"Row",Cell:"Cell",Ok:"OK",Apply:"Apply",Cancel:"Cancel",Size:"Size","Preferred Width":"Preferred width",Points:"Points",Percent:"Percent","Measure in":"Measure in",Alignment:"Alignment",Left:"Left",Center:"Center",Right:"Right",Justify:"Justify","Indent from left":"Indent from left","Borders and Shading":"Borders and Shading",Options:"Options","Specify height":"Specify height","At least":"At least",Exactly:"Exactly","Row height is":"Row height is","Allow row to break across pages":"Allow row to break across pages","Repeat as header row at the top of each page":"Repeat as header row at the top of each page","Vertical alignment":"Vertical alignment",Top:"Top",Bottom:"Bottom","Default cell margins":"Default cell margins","Default cell spacing":"Default cell spacing","Allow spacing between cells":"Allow spacing between cells","Cell margins":"Cell margins","Same as the whole table":"Same as the whole table",Borders:"Borders",None:"None",Style:"Style",Width:"Width",Height:"Height",Letter:"Letter","1, 2, 3, ...":"1, 2, 3, ...","a, b, c, ...":"a, b, c, ...","A, B, C, ...":"A, B, C, ...","I, II, III, ...":"I, II, III, ...","i, ii, iii, ...":"i, ii, iii, ...",Tabloid:"Tabloid",Legal:"Legal",Statement:"Statement",Executive:"Executive",A3:"A3",A4:"A4",A5:"A5",B4:"B4",B5:"B5","Custom Size":"Custom size","Different odd and even":"Different odd and even","Different first page":"Different first page","From edge":"From edge",Header:"Header",Footer:"Footer",Margin:"Margins",Paper:"Paper",Layout:"Layout",Orientation:"Orientation",Landscape:"Landscape",Portrait:"Portrait","Show page numbers":"Show page numbers","Right align page numbers":"Right align page numbers",Nothing:"Nothing","Tab leader":"Tab leader","Show levels":"Show levels","Use hyperlinks instead of page numbers":"Use hyperlinks instead of page numbers","Build table of contents from":"Build table of contents from",Styles:"Styles","Available styles":"Available styles","TOC level":"TOC level",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","List Paragraph":"List Paragraph",Normal:"Normal","Outline levels":"Outline levels","Table entry fields":"Table entry fields",Modify:"Modify",Color:"Color",Setting:"Setting",Box:"Box",All:"All",Custom:"Custom",Preview:"Preview",Shading:"Shading",Fill:"Fill","Apply To":"Apply to","Table Properties":"Table Properties","Cell Options":"Cell Options","Table Options":"Table Options","Insert Table":"Insert Table","Number of columns":"Number of columns","Number of rows":"Number of rows","Text to display":"Text to display",Address:"Address","Insert Hyperlink":"Insert Hyperlink","Edit Hyperlink":"Edit Hyperlink",Insert:"Insert",General:"General",Indentation:"Indentation","Before text":"Before text",Special:"Special","First line":"First line",Hanging:"Hanging","After text":"After text",By:"By",Before:"Before","Line Spacing":"Line spacing",After:"After",At:"At",Multiple:"Multiple",Spacing:"Spacing","Define new Multilevel list":"Define new Multilevel list","List level":"List level","Choose level to modify":"Choose level to modify",Level:"Level","Number format":"Number format","Number style for this level":"Number style for this level","Enter formatting for number":"Enter formatting for number","Start at":"Start at","Restart list after":"Restart list after",Position:"Position","Text indent at":"Text indent at","Aligned at":"Aligned at","Follow number with":"Follow number with","Tab character":"Tab character",Space:"Space",Arabic:"Arabic",UpRoman:"UpRoman",LowRoman:"LowRoman",UpLetter:"UpLetter",LowLetter:"LowLetter",Number:"Number","Leading zero":"Leading zero",Bullet:"Bullet",Ordinal:"Ordinal","Ordinal Text":"Ordinal Text","For East":"For East","No Restart":"No Restart",Font:"Font","Font style":"Font style","Underline style":"Underline style","Font color":"Font color",Effects:"Effects",Strikethrough:"Strikethrough",Superscript:"Superscript",Subscript:"Subscript","Double strikethrough":"Double strikethrough",Regular:"Regular",Bold:"Bold",Italic:"Italic",Cut:"Cut",Copy:"Copy",Paste:"Paste",Hyperlink:"Hyperlink","Open Hyperlink":"Open Hyperlink","Copy Hyperlink":"Copy Hyperlink","Remove Hyperlink":"Remove Hyperlink",Paragraph:"Paragraph","Linked Style":"Linked(Paragraph and Character)",Character:"Character","Merge Cells":"Merge Cells","Insert Above":"Insert Above","Insert Below":"Insert Below","Insert Left":"Insert Left","Insert Right":"Insert Right",Delete:"Delete","Delete Table":"Delete Table","Delete Row":"Delete Row","Delete Column":"Delete Column","File Name":"File Name","Format Type":"Format Type",Save:"Save",Navigation:"Navigation",Results:"Results",Replace:"Replace","Replace All":"Replace All","We replaced all":"We replaced all",Find:"Find","No matches":"No matches","All Done":"All Done",Result:"Result",of:"of",instances:"instances",with:"with","Click to follow link":"Click to follow link","Continue Numbering":"Continue Numbering","Bookmark name":"Bookmark name",Close:"Close","Restart At":"Restart At",Properties:"Properties",Name:"Name","Style type":"Style type","Style based on":"Style based on","Style for following paragraph":"Style for following paragraph",Formatting:"Formatting","Numbering and Bullets":"Numbering and Bullets",Numbering:"Numbering","Update Field":"Update Field","Edit Field":"Edit Field",Bookmark:"Bookmark","Page Setup":"Page Setup","No bookmarks found":"No bookmarks found","Number format tooltip information":'Single-level number format: </br>[PREFIX]%[LEVELNUMBER][SUFFIX]</br>For example, "Chapter %1." will display numbering like</br>Chapter 1. Item</br>Chapter 2. Item</br>…</br>Chapter N. Item</br></br>Multilevel number format:</br>[PREFIX]%[LEVELNUMBER][SUFFIX]+[PREFIX]%[LEVELNUMBER][SUFFIX]</br>For example, "%1.%2." will display numbering like</br>1.1. Item</br>1.2. Item</br>…</br>1.N. Item',Format:"Format","Create New Style":"Create New Style","Modify Style":"Modify Style",New:"New",InsertFootnote:"InsertFootnote",InsertEndnote:"InsertEndnote",Footnote:"Footnote",Endnote:"Endnote","Notes Options":"Notes Options",Bullets:"Bullets","Use bookmarks":"Use bookmarks","Table of Contents":"Table of Contents",AutoFit:"AutoFit","AutoFit to Contents":"AutoFit to Contents","AutoFit to Window":"AutoFit to Window","Fixed Column Width":"Fixed Column Width",Reset:"Reset","Match case":"Match case","Whole words":"Whole words",Add:"Add","Go To":"Go To","Search for":"Search for","Replace with":"Replace with","TOC 1":"TOC 1","TOC 2":"TOC 2","TOC 3":"TOC 3","TOC 4":"TOC 4","TOC 5":"TOC 5","TOC 6":"TOC 6","TOC 7":"TOC 7","TOC 8":"TOC 8","TOC 9":"TOC 9","Right-to-left":"Right-to-left","Left-to-right":"Left-to-right",Direction:"Direction","Table direction":"Table direction","Indent from right":"Indent from right","Contextual Spacing":"Don't add space between the paragraphs of the same styles","Password Mismatch":"The password don't match","Restrict Editing":"Restrict Editing","Formatting restrictions":"Formatting restrictions","Allow formatting":"Allow formatting","Editing restrictions":"Editing restrictions","Read only":"Read only","Exceptions Optional":"Exceptions (optional)","Select Part Of Document And User":"Select parts of the document and choose users who are allowed to freely edit them.",Everyone:"Everyone","More users":"More users","Add Users":"Add Users","Enforcing Protection":"Yes, Start Enforcing Protection","Start Enforcing Protection":"Start Enforcing Protection","Enter User":"Enter User",Users:"Users","Enter new password":"Enter new password","Reenter new password to confirm":"Reenter new password to confirm","Your permissions":"Your permissions","Protected Document":"This document is protected from unintentional editing.You may edit in this region.",FormFieldsOnly:"This document is protected from unintentional editing. You may only fill in forms in this region.","You may format text only with certain styles":"You may format text only with certain styles.","Stop Protection":"Stop Protection",Password:"Password","Spelling Editor":"Spelling Editor",Spelling:"Spelling","Spell Check":"Spell Check","Underline errors":"Underline errors",Ignore:"Ignore","Ignore All":"Ignore All","Add to Dictionary":"Add to Dictionary",Change:"Change","Change All":"Change All",Suggestions:"Suggestions","The password is incorrect":"The password is incorrect","Error in establishing connection with web server":"Error in establishing connection with web server","Highlight the regions I can edit":"Highlight the regions I can edit","Show All Regions I Can Edit":"Show All Regions I Can Edit","Find Next Region I Can Edit":"Find Next Region I Can Edit","Keep source formatting":"Keep source formatting","Match destination formatting":"Match destination formatting",InsertAsRows:"Insert as New Rows",InsertAsColumns:"Insert as New Columns",OverwriteCells:"Overwrite Cells",NestTable:"Nest Table","Text only":"Text only",Comments:"Comments","Type your comment":"Type your comment",Post:"Post",Reply:"Reply","New Comment":"New Comment",Edit:"Edit",Resolve:"Resolve",Reopen:"Reopen","No comments in this document":"No comments in this document",more:"more","Type your comment here":"Type your comment here","Next Comment":"Next Comment","Previous Comment":"Previous Comment","Un-posted comments":"Un-posted comments","Discard Comment":"Added comments not posted. If you continue, that comment will be discarded.","No Headings":"No Heading Found!","Add Headings":"This document has no headings. Please add headings and try again.","More Options":"More Options","Click to see this comment":"Click to see this comment","Form Fields":"Form Fields","Text Form":"Text Form","Check Box":"Check Box","Drop Down Form Field":"Drop Down Form Field","Dropdown items":"Drop-down items","Items in dropdown list":"Items in drop-down list",ADD:"ADD",REMOVE:"REMOVE","Field settings":"Field settings",Tooltip:"Tooltip","Dropdown enabled":"Drop-down enabled","Check Box Form Field":"Check Box Form Field","Check box size":"Check box size",Auto:"Auto","Default value":"Default value","Not checked":"Not checked",Checked:"Checked","Check box enabled":"Check box enabled","Text Form Field":"Text Form Field",Type:"Type","Default text":"Default text","Maximum length":"Maximum length","Text format":"Text format","Fillin enabled":"Fill-in enabled","Default number":"Default number","Default date":"Default date","Date format":"Date format","Merge Track":"This action wont be marked as change. Do you want to continue?",UnTrack:"Cannot be tracked !",Accept:"Accept",Reject:"Reject","Previous Changes":"Previous Changes","Next Changes":"Next Changes",Inserted:"Inserted",Deleted:"Deleted","Move From":"Move From","Move To":"Move To",Changes:"Changes","Accept all":"Accept all","Reject all":"Reject all","No changes":"No changes","Accept Changes":"Accept Changes","Reject Changes":"Reject Changes",User:"User",View:"View",Insertion:"Insertion",Deletion:"Deletion","All caps":"All caps","This region is locked by":"This region is locked by",Lock:"Lock",Unlock:"Unlock","Already locked":"Selected or part of region is already locked by another user","Click to View/Edit Footnote":"Click to View/Edit Footnote","Click to View/Edit Endnote":"Click to View/Edit Endnote","Multiple Comment":"Please post your comment","No suggestions":"No suggestions","More Suggestion":"More Suggestion","Ignore Once":"Ignore Once"},n}Di(i,e),n=i,Object.defineProperty(i.prototype,"enableHeaderAndFooter",{get:function(){return this.enableHeaderFooterIn},set:function(e){this.enableHeaderFooterIn=e,!e&&this.selection&&this.selection.isWebLayout&&(this.selection.isWebLayout=!1),this.viewer.updateScrollBars()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pageCount",{get:function(){return!this.isDocumentLoaded||t.isNullOrUndefined(this.viewer)||this.viewer instanceof de?1:this.documentHelper.pages.length},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selection",{get:function(){return this.selectionModule},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"editor",{get:function(){return this.editorModule},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"editorHistory",{get:function(){return this.editorHistoryModule},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"search",{get:function(){return this.searchModule},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"contextMenu",{get:function(){return this.contextMenuModule},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"spellCheckDialog",{get:function(){return this.spellCheckDialogModule},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"spellChecker",{get:function(){return this.spellCheckerModule},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"containerId",{get:function(){return this.element.id},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isDocumentLoaded",{get:function(){return this.isDocumentLoadedIn},set:function(e){this.isDocumentLoadedIn=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"revisions",{get:function(){return t.isNullOrUndefined(this.revisionsInternal)&&(this.revisionsInternal=new O(this)),this.revisionsInternal},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"enableHistoryMode",{get:function(){return this.enableEditorHistory&&!t.isNullOrUndefined(this.editorHistoryModule)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"documentStart",{get:function(){if(!t.isNullOrUndefined(this.selectionModule))return this.selection.getDocumentStart()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"documentEnd",{get:function(){if(!t.isNullOrUndefined(this.selectionModule))return this.selection.getDocumentEnd()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isReadOnlyMode",{get:function(){return this.isReadOnly||t.isNullOrUndefined(this.editorModule)||t.isNullOrUndefined(this.selectionModule)||!t.isNullOrUndefined(this.editor)&&this.editor.restrictEditing},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isSpellCheck",{get:function(){return this.enableSpellCheck&&this.spellChecker.enableSpellCheck},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"enableImageResizerMode",{get:function(){return this.enableImageResizer&&!t.isNullOrUndefined(this.imageResizerModule)},enumerable:!0,configurable:!0}),i.prototype.preRender=function(){this.findResultsList=[],this.documentHelper=new se(this),"Pages"===this.layoutType?this.viewer=new le(this):this.viewer=new de(this),this.parser=new Pt(this.documentHelper)},i.prototype.render=function(){if(!t.isNullOrUndefined(this.element)){var e=this.element;e.style.minHeight="200px",e.style.minWidth="200px",""!==this.height&&(this.element.style.height=t.formatUnit(this.height)),""!==this.width&&(this.element.style.width=t.formatUnit(this.width))}this.documentHelper.initializeComponents(),this.openBlank(),this.renderComplete(),this.createdTriggered=!0},i.prototype.getModuleName=function(){return"DocumentEditor"},i.prototype.onPropertyChanged=function(e,i){for(var n=this,r=0,o=Object.keys(e);r<o.length;r++)switch(o[r]){case"zoomFactor":this.viewer&&i.zoomFactor!==e.zoomFactor&&(this.documentHelper.zoomFactor=e.zoomFactor);break;case"layoutType":if(this.selection&&this.selection.isWebLayout)break;this.viewer.destroy(),"Pages"===this.layoutType?this.viewer=new le(this):(!0===this.enableHeaderAndFooter&&this.selection.closeHeaderFooter(),this.viewer=new de(this)),this.selection.start.paragraph.containerWidget instanceof be&&(this.selection.clearSelectionHighlightInSelectedWidgets(),this.selection.selectContent(this.documentStart,!0)),this.editor.layoutWholeDocument(),setTimeout(function(){n.fireViewChange()},200);break;case"locale":this.localizeDialogs();break;case"isReadOnly":!t.isNullOrUndefined(this.optionsPaneModule)&&this.optionsPaneModule.isOptionsPaneShow&&this.optionsPaneModule.showHideOptionsPane(!1),this.showComments&&this.commentReviewPane.showHidePane(!0,"Comments"),this.commentReviewPane.enableDisableItems();break;case"currentUser":case"userColor":this.selection&&this.documentHelper.isDocumentProtected&&this.selection.highlightEditRegion(),this.viewer.updateScrollBars();break;case"pageGap":case"pageOutline":this.viewer.updateScrollBars();break;case"zIndex":this.documentHelper.dialog&&(this.documentHelper.dialog.zIndex=e.zIndex+10),this.documentHelper.dialog2&&(this.documentHelper.dialog2.zIndex=e.zIndex);break;case"showComments":this.viewer&&this.documentHelper.showComments(e.showComments),this.viewer.updateScrollBars();break;case"enableRtl":this.localizeDialogs(e.enableRtl);break;case"enableComment":this.viewer&&this.showComments&&(this.showComments=!!this.showComments&&this.enableComment,this.documentHelper.showComments(e.enableComment)),this.viewer.updateScrollBars();break;case"showRevisions":this.isReadOnly||this.documentHelper.isDocumentProtected?(this.showRevisions=!1,this.documentHelper.showRevisions(!1)):this.viewer&&this.documentHelper.showRevisions(e.showRevisions),this.viewer.updateScrollBars();break;case"documentEditorSettings":this.viewer.updateScrollBars();break;case"height":this.element.style.height=t.formatUnit(this.height),this.resize();break;case"width":this.element.style.width=t.formatUnit(this.width),this.resize()}},i.prototype.localizeDialogs=function(e){if(""!==this.locale){var i=new t.L10n("documenteditor",this.defaultLocale);i.setLocale(this.locale),t.isNullOrUndefined(e)||(this.documentHelper.dialog.enableRtl=e,this.documentHelper.dialog2.enableRtl=e),this.optionsPaneModule&&this.optionsPaneModule.initOptionsPane(i,e),this.paragraphDialogModule&&this.paragraphDialogModule.initParagraphDialog(i),this.footNotesDialogModule&&this.footNotesDialogModule.notesDialog(i,e),this.pageSetupDialogModule&&this.pageSetupDialogModule.initPageSetupDialog(i,e),this.fontDialogModule&&this.fontDialogModule.initFontDialog(i,e),this.hyperlinkDialogModule&&this.hyperlinkDialogModule.initHyperlinkDialog(i,e),this.contextMenuModule&&(this.contextMenuModule.contextMenuInstance.destroy(),this.contextMenuModule.initContextMenu(i,e)),this.listDialogModule&&this.listDialogModule.initListDialog(i,e),this.tablePropertiesDialogModule&&this.tablePropertiesDialogModule.initTablePropertyDialog(i,e),this.bordersAndShadingDialogModule&&this.bordersAndShadingDialogModule.initBordersAndShadingsDialog(i,e),this.cellOptionsDialogModule&&this.cellOptionsDialogModule.initCellMarginsDialog(i,e),this.tableOptionsDialogModule&&this.tableOptionsDialogModule.initTableOptionsDialog(i,e),this.tableDialogModule&&this.tableDialogModule.initTableDialog(i),this.styleDialogModule&&this.styleDialogModule.initStyleDialog(i,e),this.tableOfContentsDialogModule&&this.tableOfContentsDialogModule.initTableOfContentDialog(i,e),this.commentReviewPane&&this.commentReviewPane.parentPaneElement&&(this.enableRtl?t.classList(this.commentReviewPane.parentPaneElement,["e-rtl"],[]):t.classList(this.commentReviewPane.parentPaneElement,[],["e-rtl"]))}},i.prototype.setDefaultCharacterFormat=function(e){this.characterFormat=e},i.prototype.setDefaultParagraphFormat=function(e){this.paragraphFormat=e},i.prototype.setDefaultSectionFormat=function(e){this.sectionFormat=e},i.prototype.getPersistData=function(){return"documenteditor"},i.prototype.clearPreservedCollectionsInViewer=function(){this.viewer instanceof ae&&this.documentHelper.clearDocumentItems()},i.prototype.getDocumentEditorElement=function(){return this.element},i.prototype.fireContentChange=function(){this.enableLockAndEdit&&this.collaborativeEditingModule&&this.collaborativeEditingModule.saveContent();var e={source:t.isBlazor()?null:this};this.trigger("contentChange",e)},i.prototype.fireDocumentChange=function(){this.enableLockAndEdit&&this.enableEditor&&this.editor.enforceProtection("",!1,!0);var e={source:t.isBlazor()?null:this};this.trigger("documentChange",e)},i.prototype.fireSelectionChange=function(){!this.documentHelper.isCompositionStart&&t.Browser.isDevice&&this.editorModule&&this.editorModule.predictText();var e={source:t.isBlazor()?null:this};this.trigger("selectionChange",e)},i.prototype.fireZoomFactorChange=function(){var e={source:t.isBlazor()?null:this};this.trigger("zoomFactorChange",e),this.notify("internalZoomFactorChange",e)},i.prototype.fireBeformFieldFill=function(){var e={};this.trigger("beforeFieldFill",e)},i.prototype.fireAfterFormFieldFill=function(){var e={};this.trigger("afterFieldFill",e)},i.prototype.fireServiceFailure=function(e){this.trigger("serviceFailure",e)},i.prototype.fireViewChange=function(){if(this.viewer&&this.documentHelper.pages.length>0&&this.viewer.visiblePages.length>0){var e=this.viewer.visiblePages,i={startPage:e[0].index+1,endPage:e[e.length-1].index+1,source:t.isBlazor()?null:this};this.trigger("viewChange",i)}},i.prototype.fireCustomContextMenuSelect=function(e){var t={id:e};this.trigger("customContextMenuSelect",t)},i.prototype.fireCustomContextMenuBeforeOpen=function(e){var t={ids:e};this.trigger("customContextMenuBeforeOpen",t)},i.prototype.showParagraphDialog=function(e){this.paragraphDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.paragraphDialogModule.show(e)},i.prototype.showPageSetupDialog=function(){this.pageSetupDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.pageSetupDialogModule.show()},i.prototype.showFootNotesDialog=function(){this.footNotesDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.footNotesDialogModule.show()},i.prototype.showFontDialog=function(e){this.fontDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.fontDialogModule.showFontDialog(e)},i.prototype.showCellOptionsDialog=function(){this.cellOptionsDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.cellOptionsDialogModule.show()},i.prototype.showTableOptionsDialog=function(){this.tableOptionsDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.tableOptionsDialogModule.show()},i.prototype.showTableDialog=function(){this.tableDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.tableDialogModule.show()},i.prototype.showTableOfContentsDialog=function(){this.tableOfContentsDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.tableOfContentsDialogModule.show()},i.prototype.showStyleDialog=function(){this.styleDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.styleDialogModule.show()},i.prototype.showHyperlinkDialog=function(){this.hyperlinkDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.hyperlinkDialogModule.show()},i.prototype.showBookmarkDialog=function(){this.bookmarkDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.bookmarkDialogModule.show()},i.prototype.showStylesDialog=function(){this.stylesDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.stylesDialogModule.show()},i.prototype.showListDialog=function(){this.listDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.listDialogModule.showListDialog()},i.prototype.showTablePropertiesDialog=function(){this.tablePropertiesDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.tablePropertiesDialogModule.show()},i.prototype.showBordersAndShadingDialog=function(){this.bordersAndShadingDialogModule&&!this.isReadOnlyMode&&this.viewer&&this.bordersAndShadingDialogModule.show()},i.prototype.requiredModules=function(){var e=[];return this.enableLockAndEdit&&e.push({member:"CollaborativeEditing",args:[this]}),this.enablePrint&&e.push({member:"Print",args:[]}),(this.enableSfdtExport||this.enableWordExport||this.enableTextExport||this.enableSelection||this.enableEditor)&&e.push({member:"SfdtExport",args:[this.documentHelper]}),this.enableWordExport&&e.push({member:"WordExport",args:[]}),this.enableTextExport&&e.push({member:"TextExport",args:[]}),(this.enableSelection||this.enableSearch||this.enableEditor)&&(e.push({member:"Selection",args:[this]}),this.enableContextMenu&&e.push({member:"ContextMenu",args:[this.documentHelper]})),this.enableSearch&&(e.push({member:"Search",args:[this]}),this.enableOptionsPane&&e.push({member:"OptionsPane",args:[this.documentHelper]})),this.enableEditor&&(e.push({member:"Editor",args:[this.documentHelper]}),this.enableImageResizer&&e.push({member:"ImageResizer",args:[this,this.documentHelper]}),this.enableEditorHistory&&e.push({member:"EditorHistory",args:[this]}),this.enableHyperlinkDialog&&e.push({member:"HyperlinkDialog",args:[this.documentHelper]}),this.enableTableDialog&&e.push({member:"TableDialog",args:[this.documentHelper]}),this.enableBookmarkDialog&&e.push({member:"BookmarkDialog",args:[this.documentHelper]}),this.enableTableOfContentsDialog&&e.push({member:"TableOfContentsDialog",args:[this.documentHelper]}),this.enablePageSetupDialog&&e.push({member:"PageSetupDialog",args:[this.documentHelper]}),this.enableFootnoteAndEndnoteDialog&&e.push({member:"FootNotesDialog",args:[this.documentHelper]}),this.enableStyleDialog&&(e.push({member:"StylesDialog",args:[this.documentHelper]}),e.push({member:"StyleDialog",args:[this.documentHelper]}),e.push({member:"BulletsAndNumberingDialog",args:[this.documentHelper]})),this.enableListDialog&&e.push({member:"ListDialog",args:[this.documentHelper]}),this.enableParagraphDialog&&e.push({member:"ParagraphDialog",args:[this.documentHelper]}),this.enableFontDialog&&e.push({member:"FontDialog",args:[this.documentHelper]}),this.enableTablePropertiesDialog&&(e.push({member:"TablePropertiesDialog",args:[this.documentHelper]}),e.push({member:"CellOptionsDialog",args:[this.documentHelper]})),this.enableBordersAndShadingDialog&&e.push({member:"BordersAndShadingDialog",args:[this.documentHelper]}),this.enableTableOptionsDialog&&e.push({member:"TableOptionsDialog",args:[this.documentHelper]}),this.enableSpellCheck&&(e.push({member:"SpellChecker",args:[this.documentHelper]}),e.push({member:"SpellCheckDialog",args:[this.documentHelper]})),this.enableFormField&&(e.push({member:"TextFormFieldDialog",args:[this]}),e.push({member:"DropDownFormFieldDialog",args:[this]}),e.push({member:"CheckBoxFormFieldDialog",args:[this]}))),e},i.prototype.open=function(e){t.isNullOrUndefined(this.viewer)||(this.showComments=!1,this.clearPreservedCollectionsInViewer(),this.documentHelper.userCollection.push("Everyone"),this.documentHelper.lists=[],this.documentHelper.abstractLists=[],this.documentHelper.styles=new V,this.documentHelper.cachedPages=[],this.showRevisions=!1,this.clearSpellCheck(),this.isSpellCheck&&!this.spellChecker.enableOptimizedSpellCheck&&(this.documentHelper.triggerElementsOnLoading=!0,this.documentHelper.triggerSpellCheck=!0),!t.isNullOrUndefined(e)&&this.viewer&&(this.documentHelper.setDefaultDocumentFormat(),this.documentHelper.onDocumentChanged(this.parser.convertJsonToDocument(e)),this.editorModule&&this.editorModule.intializeDefaultStyles()),this.isSpellCheck&&!this.spellChecker.enableOptimizedSpellCheck&&(this.documentHelper.triggerElementsOnLoading=!1,this.documentHelper.triggerSpellCheck=!1))},i.prototype.scrollToPage=function(e){return!(t.isNullOrUndefined(this.viewer)||e<1||e>this.documentHelper.pages.length)&&(this.viewer.scrollToPage(e-1),!0)},i.prototype.enableAllModules=function(){this.enablePrint=this.enableSfdtExport=this.enableWordExport=this.enableTextExport=this.enableSelection=this.enableContextMenu=this.enableSearch=this.enableOptionsPane=this.enableEditor=this.enableImageResizer=this.enableEditorHistory=this.enableHyperlinkDialog=this.enableTableDialog=this.enableBookmarkDialog=this.enableTableOfContentsDialog=this.enableFootnoteAndEndnoteDialog=this.enablePageSetupDialog=this.enableStyleDialog=this.enableListDialog=this.enableParagraphDialog=this.enableFontDialog=this.enableTablePropertiesDialog=this.enableBordersAndShadingDialog=this.enableTableOptionsDialog=this.enableSpellCheck=this.enableComment=this.enableFormField=!0,n.Inject(C,ci,di,hi,Dt,_t,ri,oi,ii,Ft,jt,pi,gi,Bi,ui,mi,fi,wi,bi,vi,Ci,xi,Fi,Pi,Ti,Si,Ii,Oi,Ni,Ei,Hi,Wi)},i.prototype.resize=function(e,i){this.element&&(!t.isNullOrUndefined(e)&&e>200&&(this.element.style.width=e+"px"),!t.isNullOrUndefined(i)&&i>200&&(this.element.style.height=i+"px"),this.viewer&&this.documentHelper.updateViewerSize(),this.trackChangesPane.toolbar&&this.trackChangesPane.toolbar.refreshOverflow())},i.prototype.getFormFieldNames=function(){for(var e=[],t=this.documentHelper.formFields,i=0;i<t.length;i++)""!==t[i].formFieldData.name&&e.push(t[i].formFieldData.name);return e},i.prototype.getFormFieldInfo=function(e){for(var t=this.documentHelper.formFields,i=0;i<t.length;i++)if(t[i].formFieldData.name===e&&""!==t[i].formFieldData.name)return t[i].formFieldData.getFormFieldInfo()},i.prototype.setFormFieldInfo=function(e,t){for(var i=this.documentHelper.formFields,n=0;n<i.length;n++)if(i[n].formFieldData.name===e&&""!==i[n].formFieldData.name){var r=i[n];return void(this.selection&&(this.selection.selectFieldInternal(r),this.editor&&this.editor.setFormField(r,t)))}},i.prototype.resetFormFields=function(e){for(var i=this.documentHelper.formFields,n=0;n<i.length;n++)(t.isNullOrUndefined(e)||e===i[n].formFieldData.name)&&(i[n].formFieldData instanceof Ee?this.editor.updateFormField(i[n],i[n].formFieldData.defaultValue,!0):i[n].formFieldData instanceof He?this.editor.toggleCheckBoxFormField(i[n],!0,i[n].formFieldData.defaultValue):i[n].formFieldData instanceof We&&this.editor.updateFormField(i[n],0,!0))},i.prototype.importFormData=function(e){for(var t=this.documentHelper.formFields,i=0;i<e.length;i++)for(var n=e[i],r=n.fieldName,o=0;o<t.length;o++)t[o].formFieldData.name===r&&(t[o].formFieldData instanceof He?this.editor.toggleCheckBoxFormField(t[o],!0,n.value):t[o].formFieldData instanceof Ee?this.editor.updateFormField(t[o],n.value):t[o].formFieldData instanceof We&&this.editor.updateFormField(t[o],n.value))},i.prototype.exportFormData=function(){for(var e=[],t=this.documentHelper.formFields,i=0;i<t.length;i++)if(""!==t[i].formFieldData.name){var n={fieldName:"",value:""};if(n.fieldName=t[i].formFieldData.name,t[i].formFieldData instanceof He)n.value=t[i].formFieldData.checked;else if(t[i].formFieldData instanceof Ee){var r="";r=this.documentHelper.isInlineFormFillProtectedMode?this.editorModule.getFormFieldText(t[i]):t[i].resultText;var o=new RegExp(this.documentHelper.textHelper.getEnSpaceCharacter(),"gi");""===r.replace(o,"")&&(r=""),n.value=r}else t[i].formFieldData instanceof We&&(n.value=t[i].formFieldData.selectedIndex);e.push(n)}return e},i.prototype.updateFields=function(){for(var e=0;e<this.documentHelper.fields.length;e++){var t=this.documentHelper.fields[e];0===this.selection.getFieldCode(t).toLowerCase().trim().indexOf("ref ")&&this.selection.updateRefField(t)}},i.prototype.focusIn=function(){this.viewer&&this.documentHelper.updateFocus()},i.prototype.fitPage=function(e){t.isNullOrUndefined(e)&&(e="None"),this.viewer&&(this.viewer.pageFitType=e)},i.prototype.exportAsImage=function(e,i){if(t.isNullOrUndefined(this.viewer))throw new Error("Invalid operation.");if(this.printModule){var n="Png"===i?"image/png":"image/jpeg";return this.printModule.exportAsImage(this.documentHelper,e,n)}},i.prototype.print=function(e){if(t.isNullOrUndefined(this.viewer))throw new Error("Invalid operation.");if(!this.printModule)throw new Error("Invalid operation. Print is not enabled.");"Continuous"===this.layoutType?(this.documentHelper.isWebPrinting=!0,this.viewer=new le(this),this.editor.layoutWholeDocument(),this.printModule.print(this.documentHelper,e),this.viewer=new de(this),this.editor.layoutWholeDocument(),this.documentHelper.isWebPrinting=!1):this.printModule.print(this.documentHelper,e)},i.prototype.serialize=function(){if(!(this.enableSfdtExport&&this.sfdtExportModule instanceof ci))throw new Error("Invalid operation. Sfdt export is not enabled.");return this.sfdtExportModule.serialize()},i.prototype.save=function(e,i){if(e=e||"Untitled",t.isNullOrUndefined(this.documentHelper))throw new Error("Invalid operation.");if("Docx"===i&&this.wordExportModule)this.wordExportModule&&this.wordExportModule.save(this.documentHelper,e);else if("Txt"===i&&this.textExportModule)this.textExportModule.save(this.documentHelper,e);else{if("Sfdt"!==i||!this.enableSfdtExport||!this.sfdtExportModule)throw new Error("Invalid operation. Specified export is not enabled.");var n=this.serialize(),r=new Blob([n],{type:"application/json"});p.Save.save(e+".sfdt",r)}},i.prototype.saveAsBlob=function(e){var i=this;if(t.isNullOrUndefined(this.viewer))throw new Error("Invalid operation");return new Promise(function(t){"Docx"===e&&i.wordExportModule?t(i.wordExportModule.saveAsBlob(i.documentHelper)):"Txt"===e&&i.textExportModule?t(i.textExportModule.saveAsBlob(i.documentHelper)):"Sfdt"===e&&i.enableSfdtExport&&i.sfdtExportModule&&t(i.sfdtExportModule.saveAsBlob(i.documentHelper))})},i.prototype.openBlank=function(){var e=new fe;e.index=0,e.sectionFormat=new x(e),this.sectionFormat&&this.parser.parseSectionFormat(this.sectionFormat,e.sectionFormat);var t=new we;t.index=0,t.paragraphFormat=new I(t),t.characterFormat=new k(t),e.childWidgets.push(t),t.containerWidget=e;var i=[];i.push(e);var n=this.parser.parseHeaderFooter({header:{},footer:{},evenHeader:{},evenFooter:{},firstPageHeader:{},firstPageFooter:{}},void 0);if(this.viewer&&(this.clearPreservedCollectionsInViewer(),this.documentHelper.userCollection.push("Everyone"),this.documentHelper.cachedPages=[],this.clearSpellCheck(),this.documentHelper.setDefaultDocumentFormat(),this.documentHelper.headersFooters.push(n),this.documentHelper.onDocumentChanged(i),this.editorModule)){this.editorModule.intializeDefaultStyles();var r=this.documentHelper.styles.findByName("Normal");t.paragraphFormat.baseStyle=r,t.paragraphFormat.listFormat.baseStyle=r}},i.prototype.getStyleNames=function(e){return this.viewer?this.documentHelper.styles.getStyleNames(e):[]},i.prototype.getStyles=function(e){return this.viewer?this.documentHelper.styles.getStyles(e):[]},i.prototype.getBookmarks=function(){var e=[];return this.viewer&&(e=this.documentHelper.getBookmarks(!0)),e},i.prototype.showDialog=function(e){switch(e){case"Hyperlink":this.showHyperlinkDialog();break;case"Table":this.showTableDialog();break;case"Bookmark":this.showBookmarkDialog();break;case"TableOfContents":this.showTableOfContentsDialog();break;case"PageSetup":this.showPageSetupDialog();break;case"List":this.showListDialog();break;case"Styles":this.showStylesDialog();break;case"Style":this.showStyleDialog();break;case"Paragraph":this.showParagraphDialog();break;case"Font":this.showFontDialog();break;case"TableProperties":this.showTablePropertiesDialog();break;case"BordersAndShading":this.showBordersAndShadingDialog();break;case"TableOptions":this.showTableOptionsDialog();break;case"SpellCheck":this.showSpellCheckDialog()}},i.prototype.showOptionsPane=function(){t.isNullOrUndefined(this.optionsPaneModule)||t.isNullOrUndefined(this.viewer)||this.optionsPaneModule.showHideOptionsPane(!0)},i.prototype.showRestrictEditingPane=function(e){e=!!t.isNullOrUndefined(e)||e,this.documentHelper&&this.documentHelper.restrictEditingPane&&this.documentHelper.restrictEditingPane.showHideRestrictPane(e)},i.prototype.showSpellCheckDialog=function(){if(this.spellCheckDialogModule&&this.spellChecker){var e=this.spellChecker.retriveText();t.isNullOrUndefined(e)||this.spellCheckDialogModule.show(e.text,e.element)}},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.destroyDependentModules(),t.isNullOrUndefined(this.documentHelper)||this.documentHelper.destroy(),this.viewer=void 0,t.isNullOrUndefined(this.element)||(this.element.classList.remove("e-documenteditor"),this.element.innerHTML=""),this.refreshing||(this.element=void 0),this.findResultsList=[],this.findResultsList=void 0},i.prototype.clearSpellCheck=function(){t.isNullOrUndefined(this.spellChecker)||t.isNullOrUndefined(this.spellChecker.errorWordCollection)||this.spellChecker.errorWordCollection.clear()},i.prototype.destroyDependentModules=function(){this.printModule&&(this.printModule.destroy(),this.printModule=void 0),this.sfdtExportModule&&(this.sfdtExportModule.destroy(),this.sfdtExportModule=void 0),this.optionsPaneModule&&(this.optionsPaneModule.destroy(),this.optionsPaneModule=void 0),this.commentReviewPane&&(this.commentReviewPane.destroy(),this.commentReviewPane=void 0),this.trackChangesPane&&(this.trackChangesPane.destroy(),this.trackChangesPane=void 0),t.isNullOrUndefined(this.hyperlinkDialogModule)||(this.hyperlinkDialogModule.destroy(),this.hyperlinkDialogModule=void 0),this.searchModule&&(this.searchModule.destroy(),this.searchModule=void 0),this.contextMenuModule&&(this.contextMenuModule.destroy(),this.contextMenuModule=void 0),this.editorModule&&(this.editorModule.destroy(),this.editorModule=void 0),this.selectionModule&&(this.selectionModule.destroy(),this.selectionModule=void 0),this.editorHistoryModule&&(this.editorHistoryModule.destroy(),this.editorHistoryModule=void 0),t.isNullOrUndefined(this.paragraphDialogModule)||(this.paragraphDialogModule.destroy(),this.paragraphDialogModule=void 0),this.pageSetupDialogModule&&(this.pageSetupDialogModule.destroy(),this.pageSetupDialogModule=void 0),this.footNotesDialogModule&&(this.footNotesDialogModule.destroy(),this.footNotesDialogModule=void 0),this.fontDialogModule&&(this.fontDialogModule.destroy(),this.fontDialogModule=void 0),this.listDialogModule&&(this.listDialogModule.destroy(),this.listDialogModule=void 0),this.imageResizerModule&&(this.imageResizerModule.destroy(),this.imageResizerModule=void 0),this.tablePropertiesDialogModule&&(this.tablePropertiesDialogModule.destroy(),this.tablePropertiesDialogModule=void 0),this.bordersAndShadingDialogModule&&(this.bordersAndShadingDialogModule.destroy(),this.bordersAndShadingDialogModule=void 0),this.cellOptionsDialogModule&&(this.cellOptionsDialogModule.destroy(),this.cellOptionsDialogModule=void 0),this.tableOptionsDialogModule&&(this.tableOptionsDialogModule.destroy(),this.tableOptionsDialogModule=void 0),this.tableDialogModule&&(this.tableDialogModule.destroy(),this.tableDialogModule=void 0),this.styleDialogModule&&(this.styleDialogModule=void 0),this.bookmarkDialogModule&&(this.bookmarkDialogModule.destroy(),this.bookmarkDialogModule=void 0),this.styleDialogModule&&(this.styleDialogModule.destroy(),this.styleDialogModule=void 0),this.textExportModule&&(this.textExportModule.destroy(),this.textExportModule=void 0),this.wordExportModule&&(this.wordExportModule.destroy(),this.wordExportModule=void 0),this.tableOfContentsDialogModule&&(this.tableOfContentsDialogModule.destroy(),this.tableOfContentsDialogModule=void 0),this.spellCheckerModule&&(this.spellCheckerModule.destroy(),this.spellCheckerModule=void 0)};var n;return Ai([t.Property("KeepSourceFormatting")],i.prototype,"defaultPasteOption",void 0),Ai([t.Property("Pages")],i.prototype,"layoutType",void 0),Ai([t.Property("")],i.prototype,"currentUser",void 0),Ai([t.Property("#FFFF00")],i.prototype,"userColor",void 0),Ai([t.Property(20)],i.prototype,"pageGap",void 0),Ai([t.Property("")],i.prototype,"documentName",void 0),Ai([t.Property("100%")],i.prototype,"width",void 0),Ai([t.Property("200px")],i.prototype,"height",void 0),Ai([t.Property("")],i.prototype,"serviceUrl",void 0),Ai([t.Property(1)],i.prototype,"zoomFactor",void 0),Ai([t.Property(2e3)],i.prototype,"zIndex",void 0),Ai([t.Property(!0)],i.prototype,"isReadOnly",void 0),Ai([t.Property(!1)],i.prototype,"enablePrint",void 0),Ai([t.Property(!1)],i.prototype,"enableSelection",void 0),Ai([t.Property(!1)],i.prototype,"enableEditor",void 0),Ai([t.Property(!1)],i.prototype,"enableEditorHistory",void 0),Ai([t.Property(!1)],i.prototype,"enableSfdtExport",void 0),Ai([t.Property(!1)],i.prototype,"enableWordExport",void 0),Ai([t.Property(!1)],i.prototype,"enableTextExport",void 0),Ai([t.Property(!1)],i.prototype,"enableOptionsPane",void 0),Ai([t.Property(!1)],i.prototype,"enableContextMenu",void 0),Ai([t.Property(!1)],i.prototype,"enableHyperlinkDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableBookmarkDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableTableOfContentsDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableSearch",void 0),Ai([t.Property(!1)],i.prototype,"enableParagraphDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableListDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableTablePropertiesDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableBordersAndShadingDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableFootnoteAndEndnoteDialog",void 0),Ai([t.Property(!1)],i.prototype,"enablePageSetupDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableStyleDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableFontDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableTableOptionsDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableTableDialog",void 0),Ai([t.Property(!1)],i.prototype,"enableImageResizer",void 0),Ai([t.Property(!1)],i.prototype,"enableSpellCheck",void 0),Ai([t.Property(!1)],i.prototype,"enableComment",void 0),Ai([t.Property(!1)],i.prototype,"enableTrackChanges",void 0),Ai([t.Property(!0)],i.prototype,"enableFormField",void 0),Ai([t.Property(!1)],i.prototype,"acceptTab",void 0),Ai([t.Property(!0)],i.prototype,"useCtrlClickToFollowHyperlink",void 0),Ai([t.Property("#000000")],i.prototype,"pageOutline",void 0),Ai([t.Property(!1)],i.prototype,"enableCursorOnReadOnly",void 0),Ai([t.Property(!1)],i.prototype,"enableLocalPaste",void 0),Ai([t.Property(!1)],i.prototype,"enableLockAndEdit",void 0),Ai([t.Complex({},Mi)],i.prototype,"documentEditorSettings",void 0),Ai([t.Property({systemClipboard:"SystemClipboard",spellCheck:"SpellCheck",restrictEditing:"RestrictEditing",canLock:"CanLock",getPendingActions:"GetPendingActions"})],i.prototype,"serverActionSettings",void 0),Ai([t.Property([])],i.prototype,"headers",void 0),Ai([t.Property(!1)],i.prototype,"showComments",void 0),Ai([t.Property(!1)],i.prototype,"showRevisions",void 0),Ai([t.Event()],i.prototype,"documentChange",void 0),Ai([t.Event()],i.prototype,"viewChange",void 0),Ai([t.Event()],i.prototype,"zoomFactorChange",void 0),Ai([t.Event()],i.prototype,"selectionChange",void 0),Ai([t.Event()],i.prototype,"requestNavigate",void 0),Ai([t.Event()],i.prototype,"contentChange",void 0),Ai([t.Event()],i.prototype,"keyDown",void 0),Ai([t.Event()],i.prototype,"searchResultsChange",void 0),Ai([t.Event()],i.prototype,"created",void 0),Ai([t.Event()],i.prototype,"destroyed",void 0),Ai([t.Event()],i.prototype,"customContextMenuSelect",void 0),Ai([t.Event()],i.prototype,"customContextMenuBeforeOpen",void 0),Ai([t.Event()],i.prototype,"beforePaneSwitch",void 0),Ai([t.Event()],i.prototype,"commentBegin",void 0),Ai([t.Event()],i.prototype,"commentEnd",void 0),Ai([t.Event()],i.prototype,"beforeFileOpen",void 0),Ai([t.Event()],i.prototype,"commentDelete",void 0),Ai([t.Event()],i.prototype,"beforeCommentAction",void 0),Ai([t.Event()],i.prototype,"trackChange",void 0),Ai([t.Event()],i.prototype,"beforeFormFieldFill",void 0),Ai([t.Event()],i.prototype,"serviceFailure",void 0),Ai([t.Event()],i.prototype,"afterFormFieldFill",void 0),Ai([t.Event()],i.prototype,"actionComplete",void 0),Ai([t.Event()],i.prototype,"contentControl",void 0),i=n=Ai([t.NotifyPropertyChanges],i)}(t.Component),zi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Di(i,e),Ai([t.Property("SystemClipboard")],i.prototype,"systemClipboard",void 0),Ai([t.Property("SpellCheck")],i.prototype,"spellCheck",void 0),Ai([t.Property("RestrictEditing")],i.prototype,"restrictEditing",void 0),Ai([t.Property("CanLock")],i.prototype,"canLock",void 0),Ai([t.Property("GetPendingActions")],i.prototype,"getPendingActions",void 0),i}(t.ChildProperty),Vi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Di(i,e),Ai([t.Property("#cfcfcf")],i.prototype,"shadingColor",void 0),Ai([t.Property(!0)],i.prototype,"applyShading",void 0),Ai([t.Property("#cccccc")],i.prototype,"selectionColor",void 0),Ai([t.Property("Popup")],i.prototype,"formFillingMode",void 0),Ai([t.Property([])],i.prototype,"formattingExceptions",void 0),i}(t.ChildProperty),_i=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Di(i,e),Ai([t.Property("")],i.prototype,"roomName",void 0),Ai([t.Property("#22b24b")],i.prototype,"editableRegionColor",void 0),Ai([t.Property("#f44336")],i.prototype,"lockedRegionColor",void 0),Ai([t.Property(3e3)],i.prototype,"saveTimeout",void 0),i}(t.ChildProperty),ji=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Di(i,e),Ai([t.Property("Import")],i.prototype,"import",void 0),i}(zi),qi="_use_local_clipboard",Gi=function(){function e(e){this.isCommentEditing=!1,this.container=e,this.importHandler=new v}return Object.defineProperty(e.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),e.prototype.getModuleName=function(){return"toolbar"},e.prototype.enableItems=function(e,t){this.toolbar.enableItems(e,t)},e.prototype.initToolBar=function(e){this.toolbarItems=e,this.renderToolBar(),this.wireEvent()},e.prototype.renderToolBar=function(){if(!t.isNullOrUndefined(this.container)){var e=this.container.toolbarContainer,i=t.createElement("div",{className:"e-de-tlbr-wrapper"}),n=t.createElement("div",{className:"e-de-toolbar"});this.initToolbarItems(),i.appendChild(n),e.appendChild(i);var o=t.createElement("div",{className:"e-de-ctnr-properties-pane-btn"});this.buttonElement=t.createElement("button",{attrs:{type:"button"}}),o.appendChild(this.buttonElement);var s="e-tbar-btn e-tbtn-txt e-control e-btn e-de-showhide-btn",a="e-icons e-de-ctnr-showhide";this.container.enableRtl&&(s+="-rtl",a="e-icons e-de-ctnr-showhide e-de-flip"),this.propertiesPaneButton=new r.Button({cssClass:s,iconCss:a});var l=this.container.localObj;this.buttonElement.title=l.getConstant("Hide properties pane"),this.propertiesPaneButton.appendTo(this.buttonElement),t.EventHandler.add(this.buttonElement,"click",this.showHidePropertiesPane,this),e.appendChild(o),this.toolbar.appendTo(n),this.initToolbarDropdown(n)}},e.prototype.initToolbarDropdown=function(e){var i=this;if(this.container){var n=this.container.localObj,r=this.container.element.id+"_toolbar";if(this.toolbarItems.indexOf("Image")>=0&&(o=new d.DropDownButton({items:[{text:n.getConstant("Upload from computer"),iconCss:"e-icons e-de-ctnr-upload",id:r+"_image_local"}],cssClass:"e-de-toolbar-btn-first e-caret-hide",select:this.onDropDownButtonSelect.bind(this)})).appendTo("#"+r+"_image"),this.toolbarItems.indexOf("Break")>=0){var o=new d.DropDownButton({items:[{text:n.getConstant("Page Break"),iconCss:"e-icons e-de-ctnr-page-break",id:r+"_page_break"},{text:n.getConstant("Section Break"),iconCss:"e-icons e-de-ctnr-section-break",id:r+"_section_break"}],cssClass:"e-caret-hide",select:this.onDropDownButtonSelect.bind(this)});o.appendTo("#"+r+"_break")}if(this.filePicker=t.createElement("input",{attrs:{type:"file",accept:".doc,.docx,.rtf,.txt,.htm,.html,.sfdt"},className:"e-de-ctnr-file-picker"}),t.Browser.isIE&&document.body.appendChild(this.filePicker),this.imagePicker=t.createElement("input",{attrs:{type:"file",accept:".jpg,.jpeg,.png,.bmp"},className:"e-de-ctnr-file-picker"}),t.Browser.isIE&&document.body.appendChild(this.imagePicker),this.toolbarItems.indexOf("LocalClipboard")>=0&&this.toggleButton(r+qi,this.container.enableLocalPaste),this.toolbarItems.indexOf("TrackChanges")>=0&&this.toggleButton(r+"_track",this.container.enableTrackChanges),this.toolbarItems.indexOf("RestrictEditing")>=0){this.toggleButton(r+"_restrict_edit",this.container.restrictEditing);var s="";this.container.restrictEditing&&(s=" e-de-selected-item"),(a=new d.DropDownButton({items:[{text:n.getConstant("Read only"),id:r+"_read_only",iconCss:"e-icons"+s},{text:n.getConstant("Protections"),id:r+"_protections",iconCss:"e-icons"}],cssClass:"e-de-toolbar-btn-first e-caret-hide",select:this.onDropDownButtonSelect.bind(this),beforeItemRender:function(e){i.onBeforeRenderRestrictDropdown(e,r)}})).appendTo("#"+r+"_restrict_edit")}if(this.toolbarItems.indexOf("FormFields")>=0){var a=new d.DropDownButton({items:[{text:n.getConstant("Text Form"),iconCss:"e-icons e-de-textform",id:r+"_text_form"},{text:n.getConstant("Check Box"),iconCss:"e-icons e-de-checkbox-form",id:r+"_checkbox"},{text:n.getConstant("DropDown"),iconCss:"e-icons e-de-dropdownform",id:r+"_dropdown"}],cssClass:"e-de-toolbar-btn-first e-caret-hide",select:this.onDropDownButtonSelect.bind(this)});a.appendTo("#"+r+"_form_fields")}}},e.prototype.onBeforeRenderRestrictDropdown=function(e,i){var n=e.element.getElementsByClassName("e-menu-icon")[0];if(!t.isNullOrUndefined(n)&&(e.item.id===i+"_read_only"&&this.toggleRestrictIcon(n,this.container.restrictEditing),e.item.id===i+"_protections")){var r=document.getElementsByClassName("e-de-restrict-pane")[0];if(!t.isNullOrUndefined(r)){var o=!("none"===r.style.display);this.toggleRestrictIcon(n,o)}}},e.prototype.toggleRestrictIcon=function(e,t){t?e.classList.add("e-de-selected-item"):e.classList.remove("e-de-selected-item")},e.prototype.showHidePropertiesPane=function(){var e=document.getElementsByClassName("e-de-ctnr-properties-pane-btn")[0],i=this.container.localObj;"none"===this.container.propertiesPaneContainer.style.display?(this.container.showPropertiesPane=!0,e.classList.remove("e-de-pane-disable-clr"),this.buttonElement.title=i.getConstant("Hide properties pane"),t.classList(e,["e-de-pane-enable-clr"],[]),this.container.trigger("beforePaneSwitch",{type:"PropertiesPane"})):this.container.previousContext.indexOf("Header")>=0||this.container.previousContext.indexOf("Footer")>=0?this.container.showHeaderProperties=!this.container.showHeaderProperties:(this.container.showPropertiesPane=!1,e.classList.remove("e-de-pane-enable-clr"),this.buttonElement.title=i.getConstant("Show properties pane"),t.classList(e,["e-de-pane-disable-clr"],[])),this.enableDisablePropertyPaneButton(this.container.showPropertiesPane),this.container.showPropertiesPaneOnSelection(),this.documentEditor.focusIn()},e.prototype.onWrapText=function(e){var t="",i=e.lastIndexOf(" ");return t=e.slice(0,i),e.slice(i),t+='<div class="e-de-text-wrap">'+e.slice(i)+"</div>"},e.prototype.wireEvent=function(){this.propertiesPaneButton.on("click",this.togglePropertiesPane.bind(this)),t.EventHandler.add(this.filePicker,"change",this.onFileChange,this),t.EventHandler.add(this.imagePicker,"change",this.onImageChange,this)},e.prototype.initToolbarItems=function(){this.toolbar=new i.Toolbar({enableRtl:this.container.enableRtl,clicked:this.clickHandler.bind(this),items:this.getToolbarItems()})},e.prototype.reInitToolbarItems=function(e){var i=this;this.toolbarItems=e;var n=this.container.toolbarContainer;this.toolbar.items=this.getToolbarItems(),this.toolbarTimer=setTimeout(function(){i.toolbarTimer&&clearTimeout(i.toolbarTimer),i.initToolbarDropdown(n),e.indexOf("Open")>=0&&t.EventHandler.add(i.filePicker,"change",i.onFileChange,i),e.indexOf("Image")>=0&&t.EventHandler.add(i.imagePicker,"change",i.onImageChange,i)},200)},e.prototype.getToolbarItems=function(){for(var e,t=this.container.localObj,i=this.container.element.id+"_toolbar",n=[],r=this.toolbarItems,o=0;o<this.toolbarItems.length;o++)switch(e=0===o?"e-de-toolbar-btn-start":"Separator"===r[o+1]&&"Separator"===r[o-1]?"e-de-toolbar-btn":"Separator"===r[o+1]?"e-de-toolbar-btn-last":"Separator"===r[o-1]?"e-de-toolbar-btn-first":o===this.toolbarItems.length-1?"e-de-toolbar-btn-end":"e-de-toolbar-btn-middle",r[o]){case"Separator":n.push({type:"Separator",cssClass:"e-de-separator"});break;case"New":n.push({prefixIcon:"e-de-ctnr-new",tooltipText:t.getConstant("Create a new document"),id:i+"_new",text:t.getConstant("New"),cssClass:e});break;case"Open":n.push({prefixIcon:"e-de-ctnr-open",tooltipText:t.getConstant("Open a document"),id:i+"_open",text:t.getConstant("Open"),cssClass:e});break;case"Undo":n.push({prefixIcon:"e-de-ctnr-undo",tooltipText:t.getConstant("Undo Tooltip"),id:i+"_undo",text:t.getConstant("Undo"),cssClass:e});break;case"Redo":n.push({prefixIcon:"e-de-ctnr-redo",tooltipText:t.getConstant("Redo Tooltip"),id:i+"_redo",text:t.getConstant("Redo"),cssClass:e});break;case"Comments":n.push({prefixIcon:"e-de-cnt-cmt-add",tooltipText:t.getConstant("Show comments"),id:i+"_comment",text:t.getConstant("Comments"),cssClass:e});break;case"TrackChanges":n.push({prefixIcon:"e-de-cnt-track",tooltipText:t.getConstant("Track Changes"),id:i+"_track",text:this.onWrapText(t.getConstant("TrackChanges")),cssClass:e});break;case"Image":n.push({template:'<button title="'+t.getConstant("Insert inline picture from a file.")+'" class="e-tbar-btn e-tbtn-txt e-control e-btn e-lib e-dropdown-btn e-de-toolbar-btn-first e-caret-hide" type="button" id="'+i+'_image"><span class="e-btn-icon e-icons e-de-ctnr-image e-icon-left"></span><span class="e-tbar-btn-text">'+t.getConstant("Image")+'</span><span class="e-btn-icon e-icons e-icon-right e-caret"></span></button>'});break;case"Table":n.push({prefixIcon:"e-de-ctnr-table",tooltipText:t.getConstant("Insert a table into the document"),id:i+"_table",text:t.getConstant("Table"),cssClass:e});break;case"Hyperlink":n.push({prefixIcon:"e-de-ctnr-link",tooltipText:t.getConstant("Create Hyperlink"),id:i+"_link",text:t.getConstant("Link"),cssClass:e});break;case"Bookmark":n.push({prefixIcon:"e-de-ctnr-bookmark",tooltipText:t.getConstant("Insert a bookmark in a specific place in this document"),id:i+"_bookmark",text:t.getConstant("Bookmark"),cssClass:e});break;case"TableOfContents":n.push({prefixIcon:"e-de-ctnr-tableofcontent",tooltipText:t.getConstant("Provide an overview of your document by adding a table of contents"),id:i+"_toc",text:this.onWrapText(t.getConstant("Table of Contents")),cssClass:e});break;case"Header":n.push({prefixIcon:"e-de-ctnr-header",tooltipText:t.getConstant("Add or edit the header"),id:i+"_header",text:t.getConstant("Header"),cssClass:e});break;case"Footer":n.push({prefixIcon:"e-de-ctnr-footer",tooltipText:t.getConstant("Add or edit the footer"),id:i+"_footer",text:t.getConstant("Footer"),cssClass:e});break;case"PageSetup":n.push({prefixIcon:"e-de-ctnr-pagesetup",tooltipText:t.getConstant("Open the page setup dialog"),id:i+"_page_setup",text:this.onWrapText(t.getConstant("Page Setup")),cssClass:e});break;case"PageNumber":n.push({prefixIcon:"e-de-ctnr-pagenumber",tooltipText:t.getConstant("Add page numbers"),id:i+"_page_number",text:this.onWrapText(t.getConstant("Page Number")),cssClass:e});break;case"Break":n.push({template:'<button title="'+t.getConstant("Break")+'" class="e-tbar-btn e-tbtn-txt e-control e-btn e-lib e-dropdown-btn e-caret-hide" type="button" id="'+i+'_break"><span class="e-btn-icon e-icons e-de-ctnr-break e-icon-left"></span><span class="e-tbar-btn-text">'+t.getConstant("Break")+'</span><span class="e-btn-icon e-icons e-icon-right e-caret"></span></button>'});break;case"Find":n.push({prefixIcon:"e-de-ctnr-find",tooltipText:t.getConstant("Find Text"),id:i+"_find",text:t.getConstant("Find"),cssClass:e});break;case"LocalClipboard":n.push({prefixIcon:"e-de-ctnr-paste",tooltipText:t.getConstant("Toggle between the internal clipboard and system clipboard"),id:i+qi,text:this.onWrapText(t.getConstant("Local Clipboard")),cssClass:e});break;case"RestrictEditing":n.push({template:'<button title="'+t.getConstant("Restrict editing")+'" class="e-tbar-btn e-tbtn-txt e-control e-btn e-lib e-dropdown-btn e-de-toolbar-btn-first e-caret-hide" type="button" id="'+i+'_restrict_edit"><span class="e-btn-icon e-de-ctnr-lock e-icons e-icon-left"></span><span class="e-tbar-btn-text">'+this.onWrapText(t.getConstant("Restrict Editing"))+'</span><span class="e-btn-icon e-icons e-icon-right e-caret"></span></button>'});break;case"FormFields":n.push({template:'<button title="'+t.getConstant("Form Fields")+'" class="e-tbar-btn e-tbtn-txt e-control e-btn e-lib e-dropdown-btn e-de-toolbar-btn-first e-caret-hide" type="button" id="'+i+'_form_fields"><span class="e-btn-icon e-de-formfield e-icons e-icon-left"></span><span class="e-tbar-btn-text">'+this.onWrapText(t.getConstant("Form Fields"))+'</span><span class="e-btn-icon e-icons e-icon-right e-caret"></span></button>'});break;case"UpdateFields":n.push({prefixIcon:"e-de-update-field",tooltipText:t.getConstant("Update cross reference fields"),id:i+"_update_fields",text:this.onWrapText(t.getConstant("Update Fields")),cssClass:e+" e-de-formfields"});break;case"InsertFootnote":n.push({prefixIcon:"e-de-footnote",tooltipText:t.getConstant("Footnote Tooltip"),text:this.onWrapText(t.getConstant("Insert Footnote")),id:i+"_footnote",cssClass:e});break;case"InsertEndnote":n.push({prefixIcon:"e-de-endnote",tooltipText:t.getConstant("Endnote Tooltip"),text:this.onWrapText(t.getConstant("Insert Endnote")),id:i+"_endnote",cssClass:e});break;default:n.push(r[o])}return n},e.prototype.clickHandler=function(e){var t=this.container.element.id+"_toolbar";switch(e.item.id){case t+"_new":this.container.documentEditor.openBlank();break;case t+"_open":this.filePicker.value="",this.filePicker.click();break;case t+"_undo":this.container.documentEditor.editorHistory.undo();break;case t+"_redo":this.container.documentEditor.editorHistory.redo();break;case t+"_table":this.container.documentEditor.showDialog("Table");break;case t+"_link":this.container.documentEditor.showDialog("Hyperlink");break;case t+"_bookmark":this.container.documentEditor.showDialog("Bookmark");break;case t+"_comment":this.documentEditor.editor.isUserInsert=!0,this.documentEditor.editor.insertComment(""),this.documentEditor.editor.isUserInsert=!1;break;case t+"_track":this.toggleTrackChangesInternal(e.item.id);break;case t+"_header":this.container.documentEditor.selection.goToHeader(),this.container.statusBar.toggleWebLayout();break;case t+"_toc":this.onToc();break;case t+"_footer":this.container.documentEditor.selection.goToFooter(),this.container.statusBar.toggleWebLayout();break;case t+"_page_setup":this.container.documentEditor.showDialog("PageSetup");break;case t+"_page_number":this.container.documentEditor.editor.insertPageNumber();break;case t+"_find":this.container.documentEditor.showOptionsPane();break;case t+qi:this.toggleLocalPaste(e.item.id);break;case t+"_update_fields":this.documentEditor.updateFields();break;case t+"_footnote":this.documentEditor.editor.insertFootnote();break;case t+"_endnote":this.documentEditor.editor.insertEndnote();break;default:this.container.trigger("toolbarClick",e)}e.item.id!==t+"_find"&&e.item.id!==t+"_image"&&this.container.documentEditor.focusIn()},e.prototype.toggleLocalPaste=function(e){this.container.enableLocalPaste=!this.container.enableLocalPaste,this.toggleButton(e,this.container.enableLocalPaste)},e.prototype.toggleEditing=function(){this.container.restrictEditing=!this.container.restrictEditing,this.container.showPropertiesPane=!this.container.restrictEditing},e.prototype.toggleButton=function(e,i){var n=document.getElementById(e);i?t.classList(n,["e-btn-toggle"],[]):t.classList(n,[],["e-btn-toggle"])},e.prototype.toggleTrackChangesInternal=function(e,i){t.isNullOrUndefined(i)||(this.container.enableTrackChanges=!i),this.container.enableTrackChanges=!this.container.enableTrackChanges,this.toggleButton(e,this.container.enableTrackChanges)},e.prototype.togglePropertiesPane=function(){this.container.showPropertiesPane=!this.container.showPropertiesPane},e.prototype.onDropDownButtonSelect=function(e){var t=this,i=this.container.element.id+"_toolbar",n=e.item.id;n===i+"_page_break"?this.container.documentEditor.editorModule.insertPageBreak():n===i+"_section_break"?this.container.documentEditor.editorModule.insertSectionBreak():n===i+"_image_local"?(this.imagePicker.value="",this.imagePicker.click()):n===i+"_image_url"||(n===i+"_read_only"?this.toggleEditing():n===i+"_protections"?this.documentEditor.documentHelper.restrictEditingPane.showHideRestrictPane(!0):n===i+"_checkbox"?this.documentEditor.editor.insertFormField("CheckBox"):n===i+"_dropdown"?this.documentEditor.editor.insertFormField("DropDown"):n===i+"_text_form"&&this.documentEditor.editor.insertFormField("Text")),setTimeout(function(){t.documentEditor.focusIn()},30)},e.prototype.onFileChange=function(){var e=this,t=this.filePicker.files[0],i={fileSize:t.size,isCanceled:void 0};if(this.documentEditor.trigger("beforeFileOpen",i),!i.isCanceled&&t){if(".sfdt"===t.name.substr(t.name.lastIndexOf("."))){var n=new FileReader;n.onload=function(){e.container.documentEditor.open(n.result)},n.readAsText(t)}else this.convertToSfdt(t);this.container.documentEditor.documentName=t.name.substr(0,t.name.lastIndexOf("."))}},e.prototype.convertToSfdt=function(e){n.showSpinner(this.container.containerTarget),this.importHandler.url=this.container.serviceUrl+this.container.serverActionSettings.import,this.importHandler.onSuccess=this.successHandler.bind(this),this.importHandler.onFailure=this.failureHandler.bind(this),this.importHandler.onError=this.failureHandler.bind(this),this.importHandler.customHeaders=this.container.headers;var t=new FormData;t.append("files",e),this.importHandler.send(t)},e.prototype.failureHandler=function(e){"onError"===e.name?n.DialogUtility.alert({content:this.container.localObj.getConstant("Error in establishing connection with web server"),closeOnEscape:!0,showCloseIcon:!0,position:{X:"Center",Y:"Center"}}):(alert("Failed to load the file"),this.documentEditor.fireServiceFailure(e)),n.hideSpinner(this.container.containerTarget)},e.prototype.successHandler=function(e){this.container.documentEditor.open(e.data),n.hideSpinner(this.container.containerTarget)},e.prototype.onImageChange=function(){var e=this,t=this.imagePicker.files[0],i=new FileReader;i.onload=function(){e.insertImage(i.result)},i.readAsDataURL(t)},e.prototype.insertImage=function(e){var t=document.createElement("img"),i=this.container;t.addEventListener("load",function(){i.documentEditor.editor.insertImage(e,this.width,this.height)}),t.src=e},e.prototype.enableDisableFormField=function(e){var i=document.getElementById("container_toolbar_form_fields");t.isNullOrUndefined(i)||this.toolbar.enableItems(i.parentElement,e)},e.prototype.enableDisableInsertComment=function(e){this.isCommentEditing=!e;var i=this.container.element.id+"_toolbar"+"_comment",n=document.getElementById(i);!this.container.enableComment&&n?this.toolbar.removeItems(n.parentElement):n&&(t.isNullOrUndefined(this.documentEditor)||!this.documentEditor.isReadOnly&&!this.documentEditor.documentHelper.isDocumentProtected||(e=!1),this.toolbar.enableItems(n.parentElement,e))},e.prototype.toggleTrackChanges=function(e){var t=this.container.element.id+"_toolbar_track";document.getElementById(t)&&this.toggleTrackChangesInternal(t,e)},e.prototype.enableDisableToolBarItem=function(e,i){for(var n=this.container.element.id+"_toolbar",r=0,o=this.toolbar.items;r<o.length;r++){var s=o[r],a=s.id;if(a!==n+"_new"&&a!==n+"_open"&&a!==n+"_find"&&a!==n+qi&&a!==n+"_restrict_edit"&&a!==n+"_update_fields"&&"Separator"!==s.type){if(e&&this.isCommentEditing&&a===n+"_comment")continue;if(a!==n+"_undo"&&a!==n+"_redo"&&a!==n+"_table"&&a!==n+"_link"&&a!==n+"_bookmark"&&a!==n+"_comment"&&a!==n+"_header"&&a!==n+"_toc"&&a!==n+"_footer"&&a!==n+"_page_setup"&&a!==n+"_page_number"&&a!==n+"_image"&&a!==n+"_form_fields"&&"_break"!==a&&a!==n+"_track"&&a!==n+"_footnote"&&a!==n+"_endnote")continue;var l=document.getElementById(s.id);this.toolbar.enableItems(l.parentElement,e)}}t.isNullOrUndefined(this.documentEditor)||this.enableDisableFormField(!this.documentEditor.enableHeaderAndFooter&&e&&!this.documentEditor.isReadOnlyMode),(this.documentEditor.selection.isinFootnote||this.documentEditor.selection.isinEndnote)&&(this.containsItem(n+"_endnote")&&this.toolbar.enableItems(document.getElementById(n+"_endnote").parentElement,!1),this.containsItem(n+"_footnote")&&this.toolbar.enableItems(document.getElementById(n+"_footnote").parentElement,!1)),i&&!this.container.showPropertiesPane||(i&&(e=this.container.showPropertiesPane),t.classList(this.propertiesPaneButton.element.parentElement,e?[]:["e-de-overlay"],e?["e-de-overlay"]:[])),(e||this.documentEditor.documentHelper.isDocumentProtected&&"FormFieldsOnly"===this.documentEditor.documentHelper.protectionType)&&this.enableDisableUndoRedo()},e.prototype.containsItem=function(e){for(var t=0,i=this.toolbar.items;t<i.length;t++)if(i[t].id===e)return!0;return!1},e.prototype.enableDisableUndoRedo=function(){var e=this.container.element.id+"_toolbar";this.toolbarItems.indexOf("Undo")>=0&&this.toolbar.enableItems(document.getElementById(e+"_undo").parentElement,this.container.documentEditor.editorHistory.canUndo()),this.toolbarItems.indexOf("Redo")>=0&&this.toolbar.enableItems(document.getElementById(e+"_redo").parentElement,this.container.documentEditor.editorHistory.canRedo())},e.prototype.onToc=function(){if("TableOfContents"===this.container.previousContext&&"none"===this.container.propertiesPaneContainer.style.display)return this.container.showPropertiesPane=!1,void this.documentEditor.focusIn();"block"===this.container.headerFooterProperties.element.style.display&&this.documentEditor.selection.closeHeaderFooter(),this.enableDisablePropertyPaneButton(!1),this.container.showProperties("toc")},e.prototype.enableDisablePropertyPaneButton=function(e){e?t.classList(this.propertiesPaneButton.element.firstChild,["e-pane-enabled"],["e-pane-disabled"]):t.classList(this.propertiesPaneButton.element.firstChild,["e-pane-disabled"],["e-pane-enabled"])},e.prototype.destroy=function(){if(this.restrictDropDwn&&(this.restrictDropDwn.destroy(),this.restrictDropDwn=void 0),this.imgDropDwn&&(this.imgDropDwn.destroy(),this.imgDropDwn=void 0),this.breakDropDwn&&(this.breakDropDwn.destroy(),this.breakDropDwn=void 0),this.formFieldDropDown&&(this.formFieldDropDown.destroy(),this.formFieldDropDown=void 0),this.toolbar){var e=this.toolbar.element;this.toolbar.destroy(),this.toolbar=void 0,e.parentElement.removeChild(e)}this.container.toolbarContainer&&(this.container.containerTarget.removeChild(this.container.toolbarContainer),this.container.toolbarContainer=void 0),this.container.toolbarModule&&(this.container.toolbarModule=void 0),this.container=void 0},e}(),Ki=function(){function e(e,i){var n=this;this.isRetrieving=!1,this.appliedHighlightColor="rgb(255, 255, 0)",this.createChangecase=function(e){var i=[{text:n.localObj.getConstant("UPPERCASE")}];n.changeCaseDropdown=new d.DropDownButton({items:i,iconCss:"e-icons e-de-ctnr-change-case",enableRtl:n.isRtl});var r=t.createElement("div",{id:e.id+"_changeCase",className:"e-de-ctnr-group-btn"}),o=t.createElement("button",{id:r.id+"_dropdownBtn",attrs:{type:"button"}});r.appendChild(o),e.appendChild(r),n.changeCaseDropdown.appendTo(o)},this.changeCase=function(e){if(!n.isRetrieving)switch(e.item.text){case"UPPERCASE":!n.documentEditor.isReadOnly&&n.documentEditor.editor&&n.documentEditor.editor.changeCase("Uppercase")}},this.container=e,this.isRtl=i}return Object.defineProperty(e.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),e.prototype.initializeTextPropertiesDiv=function(e,i){this.localObj=new t.L10n("documenteditorcontainer",this.container.defaultLocale,this.container.locale),this.textProperties=e;var n=this.documentEditor.element.id+"_font_properties",r=this.createDiv(n+"_text",e);t.classList(r,["e-de-cntr-pane-padding","e-de-prop-separator-line"],[]);var o=t.createElement("label",{className:"e-de-ctnr-prop-label"});o.innerHTML=this.localObj.getConstant("Text"),r.appendChild(o);var s=this.createDiv(n+"_sizeStyle",r,"display:inline-flex;");t.classList(s,["e-de-ctnr-segment"],[]),i&&t.classList(s,["e-de-ctnr-segment-rtl"],[]);var a=this.createDiv(n+"_fontFamilyDiv",s),l=t.createElement("input",{id:n+"_fontFamily",className:"e-prop-font-style"});a.appendChild(l),t.classList(a,["e-de-panel-left-width"],[]),this.createDropDownListForFamily(l);var d=this.createDiv(n+"_fontSizeDiv",s),h="e-de-ctnr-group-btn e-de-char-fmt-btn-left e-btn-group";i&&(h="e-rtl "+h);var c=t.createElement("input",{id:n+"_fontSize",innerHTML:"type:number",className:"e-prop-font-style"});d.appendChild(c),t.classList(d,["e-de-panel-right-width"],[]),this.createDropDownListForSize(c);var p=t.createElement("div",{id:n+"_properties",styles:"display:inline-flex;",className:"e-de-ctnr-segment"});i&&t.classList(p,["e-de-ctnr-segment-rtl"],[]),r.appendChild(p);var g=t.createElement("div",{id:n+"_leftDiv",className:h,styles:"display:inline-flex;"});p.appendChild(g),this.bold=this.createButtonTemplate(n+"_bold","e-de-ctnr-bold e-icons",g,"e-de-prop-font-button","40.5",this.localObj.getConstant("Bold Tooltip")),this.italic=this.createButtonTemplate(n+"_italic","e-de-ctnr-italic e-icons",g,"e-de-prop-font-button","40.5",this.localObj.getConstant("Italic Tooltip")),this.underline=this.createButtonTemplate(n+"_underline","e-de-ctnr-underline e-icons",g,"e-de-prop-font-button","40.5",this.localObj.getConstant("Underline Tooltip")),this.strikethrough=this.createButtonTemplate(n+"_strikethrough","e-de-ctnr-strikethrough e-icons",g,"e-de-prop-font-last-button","40.5",this.localObj.getConstant("Strikethrough")),h="e-de-ctnr-group-btn e-de-char-fmt-btn-right e-btn-group",i&&(h="e-rtl "+h);var u=t.createElement("div",{id:n+"_rightDiv",className:h,styles:"display:inline-flex;"});p.appendChild(u),this.superscript=this.createButtonTemplate(n+"_superscript","e-de-ctnr-superscript e-icons",u,"e-de-prop-font-button","38.5",this.localObj.getConstant("Superscript Tooltip")),this.subscript=this.createButtonTemplate(n+"_subscript","e-de-ctnr-subscript e-icons",u,"e-de-prop-font-last-button","38.5",this.localObj.getConstant("Subscript Tooltip"));var m=t.createElement("div",{id:n+"_colorDiv",styles:"display:inline-flex;",className:"e-de-ctnr-segment"});i&&t.classList(p,["e-de-ctnr-segment-rtl"],[]);var f=t.createElement("div",{id:n+"_color",className:"e-de-font-clr-picker e-de-ctnr-group-btn",styles:"display:inline-flex;"});i&&t.classList(f,["e-rtl"],[]),m.appendChild(f),r.appendChild(m),this.fontColor=this.createFontColorPicker(n+"_textColor",40.5,f,this.localObj.getConstant("Font color")),t.classList(f.firstElementChild.lastElementChild.lastElementChild.firstChild,["e-de-ctnr-fontcolor","e-icons"],["e-caret"]),this.initializeHighlightColorElement(),this.highlightColor=this.createHighlightColorSplitButton(n+"_highlightColor",34.5,f,this.localObj.getConstant("Text highlight color")),t.classList(this.highlightColor.element.nextElementSibling.firstElementChild,["e-de-ctnr-highlight","e-icons"],["e-caret"]),this.highlightColorInputElement=this.highlightColor.element.firstChild,this.clearFormat=this.createButtonTemplate(n+"_clearFormat","e-de-ctnr-clearall e-icons",f,"e-de-prop-font-last-button","40.5",this.localObj.getConstant("Clear all formatting"));var v=t.createElement("div",{id:n+"_rightDiv2",className:h,styles:"display:inline-flex;"});i&&t.classList(v,["e-rtl"],[]),v.setAttribute("title",this.container.localObj.getConstant("Change case Tooltip")),r.appendChild(v),this.createChangecase(v)},e.prototype.createHighlightColorSplitButton=function(e,i,n,r){var o=this,s=t.createElement("button",{id:e,attrs:{type:"button"}});n.appendChild(s);var a=new d.SplitButton({cssClass:"e-de-btn-hghlclr",iconCss:"e-de-ctnr-hglt-color",target:this.highlightColorElement,close:this.closePopup.bind(this),beforeOpen:this.openPopup.bind(this),enableRtl:this.isRtl});return a.appendTo(s),a.click=function(){o.applyHighlightColor(o.highlightColorInputElement.style.backgroundColor)},a.element.firstChild.style.backgroundColor="rgb(255, 255, 0)",a.element.parentElement.setAttribute("title",r),a},e.prototype.openPopup=function(){this.highlightColorElement.style.display="block"},e.prototype.closePopup=function(){this.highlightColorElement.style.display="none"},e.prototype.initializeHighlightColorElement=function(){this.highlightColorElement=t.createElement("div",{id:"highlight_color_ppty",styles:"display:none;width:157px",className:"e-de-cntr-highlight-pane"});var e=this.createHightlighColorPickerDiv("#ffff00","yellowDiv"),i=this.createHightlighColorPickerDiv("#00ff00","brightGreenDiv"),n=this.createHightlighColorPickerDiv("#00ffff","turquoiseDiv"),r=this.createHightlighColorPickerDiv("#ff00ff","hotPinkDiv"),o=this.createHightlighColorPickerDiv("#0000ff","blueDiv"),s=this.createHightlighColorPickerDiv("#ff0000","redDiv"),a=this.createHightlighColorPickerDiv("#000080","darkBlueDiv"),l=this.createHightlighColorPickerDiv("#008080","tealDiv"),d=this.createHightlighColorPickerDiv("#008000","greenDiv"),h=this.createHightlighColorPickerDiv("#800080","violetDiv"),c=this.createHightlighColorPickerDiv("#800000","darkRedDiv"),p=this.createHightlighColorPickerDiv("#808000","darkYellowDiv"),g=this.createHightlighColorPickerDiv("#808080","gray50Div"),u=this.createHightlighColorPickerDiv("#c0c0c0","gray25Div"),m=this.createHightlighColorPickerDiv("#000000","blackDiv"),f=t.createElement("div",{className:"e-hglt-no-color"});this.highlightColorElement.appendChild(f);var v=t.createElement("div",{styles:"width:24px;height:24px;background-color:#ffffff;margin:3px;",id:"noColorDiv"});f.appendChild(v);var y=t.createElement("div",{innerHTML:"No color",className:"e-de-ctnr-hglt-no-color"});v.appendChild(y),e.addEventListener("click",this.onHighLightColor.bind(this)),i.addEventListener("click",this.onHighLightColor.bind(this)),n.addEventListener("click",this.onHighLightColor.bind(this)),r.addEventListener("click",this.onHighLightColor.bind(this)),o.addEventListener("click",this.onHighLightColor.bind(this)),s.addEventListener("click",this.onHighLightColor.bind(this)),a.addEventListener("click",this.onHighLightColor.bind(this)),l.addEventListener("click",this.onHighLightColor.bind(this)),d.addEventListener("click",this.onHighLightColor.bind(this)),h.addEventListener("click",this.onHighLightColor.bind(this)),c.addEventListener("click",this.onHighLightColor.bind(this)),p.addEventListener("click",this.onHighLightColor.bind(this)),g.addEventListener("click",this.onHighLightColor.bind(this)),u.addEventListener("click",this.onHighLightColor.bind(this)),m.addEventListener("click",this.onHighLightColor.bind(this)),f.addEventListener("click",this.onHighLightColor.bind(this))},e.prototype.createHightlighColorPickerDiv=function(e,i){var n=t.createElement("div",{className:"e-de-ctnr-hglt-btn",id:i});return n.style.backgroundColor=e,this.highlightColorElement.appendChild(n),n},e.prototype.onHighLightColor=function(e){this.documentEditor.selection&&(this.applyHighlightColor(e.currentTarget.style.backgroundColor),this.highlightColor.toggle())},e.prototype.applyHighlightColorAsBackground=function(e){this.removeSelectedColorDiv(),"NoColor"===e?this.highlightColorElement.querySelector("#noColorDiv").classList.add("e-color-selected"):"Yellow"===e?this.highlightColorElement.querySelector("#yellowDiv").classList.add("e-color-selected"):"BrightGreen"===e?this.highlightColorElement.querySelector("#brightGreenDiv").classList.add("e-color-selected"):"Turquoise"===e?this.highlightColorElement.querySelector("#turquoiseDiv").classList.add("e-color-selected"):"Pink"===e?this.highlightColorElement.querySelector("#hotPinkDiv").classList.add("e-color-selected"):"Red"===e?this.highlightColorElement.querySelector("#redDiv").classList.add("e-color-selected"):"DarkBlue"===e?this.highlightColorElement.querySelector("#darkBlueDiv").classList.add("e-color-selected"):"Teal"===e?this.highlightColorElement.querySelector("#tealDiv").classList.add("e-color-selected"):"Green"===e?this.highlightColorElement.querySelector("#greenDiv").classList.add("e-color-selected"):"Violet"===e?this.highlightColorElement.querySelector("#violetDiv").classList.add("e-color-selected"):"DarkRed"===e?this.highlightColorElement.querySelector("#darkRedDiv").classList.add("e-color-selected"):"DarkYellow"===e?this.highlightColorElement.querySelector("#darkYellowDiv").classList.add("e-color-selected"):"Gray50"===e?this.highlightColorElement.querySelector("#gray50Div").classList.add("e-color-selected"):"Gray25"===e?this.highlightColorElement.querySelector("#gray25Div").classList.add("e-color-selected"):"Black"===e?this.highlightColorElement.querySelector("#blackDiv").classList.add("e-color-selected"):"Blue"===e&&this.highlightColorElement.querySelector("#blueDiv").classList.add("e-color-selected")},e.prototype.removeSelectedColorDiv=function(){this.highlightColorElement.querySelector("#noColorDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#yellowDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#brightGreenDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#turquoiseDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#hotPinkDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#redDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#darkBlueDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#tealDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#greenDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#violetDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#darkRedDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#darkYellowDiv").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#gray50Div").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#gray25Div").classList.remove("e-color-selected"),this.highlightColorElement.querySelector("#blackDiv").classList.remove("e-color-selected")},e.prototype.applyHighlightColor=function(e){this.appliedHighlightColor=e;var t=this.getHighLightColor(e);"NoColor"===t&&(this.documentEditor.selection.characterFormat.highlightColor=null),this.documentEditor.selection.characterFormat.highlightColor=t},e.prototype.getHighLightColor=function(e){switch(e){case"rgb(255, 255, 0)":return"Yellow";case"rgb(0, 255, 0)":return"BrightGreen";case"rgb(0, 255, 255)":return"Turquoise";case"rgb(255, 0, 255)":return"Pink";case"rgb(0, 0, 255)":return"Blue";case"rgb(255, 0, 0)":return"Red";case"rgb(0, 0, 128)":return"DarkBlue";case"rgb(0, 128, 128)":return"Teal";case"rgb(0, 128, 0)":return"Green";case"rgb(128, 0, 128)":return"Violet";case"rgb(128, 0, 0)":return"DarkRed";case"rgb(128, 128, 0)":return"DarkYellow";case"rgb(128, 128, 128)":return"Gray50";case"rgb(192, 192, 192)":return"Gray25";case"rgb(0, 0, 0)":return"Black";default:return"NoColor"}},e.prototype.createDiv=function(e,i,n){var r;return r=n?t.createElement("div",{id:e,styles:n}):t.createElement("div",{id:e}),i.appendChild(r),r},e.prototype.createButtonTemplate=function(e,i,n,o,s,a){var l=t.createElement("Button",{id:e,attrs:{type:"button"}});return n.appendChild(l),new r.Button({cssClass:o,iconCss:i,enableRtl:this.isRtl}).appendTo(l),l.setAttribute("title",a),l},e.prototype.createFontColorPicker=function(e,i,n,r){var o=t.createElement("input",{id:e,attrs:{type:"color"}});return o.style.width=i+"px",n.appendChild(o),this.fontColorInputElement=new a.ColorPicker({value:"#000000",showButtons:!0,enableRtl:this.isRtl,locale:this.container.locale},o),this.fontColorInputElement.element.parentElement.setAttribute("title",r),o},e.prototype.createDropDownListForSize=function(e){var t=this,i=["8","9","10","11","12","14","16","18","20","22","24","26","28","36","48","72","96"];this.fontSize=new s.ComboBox({dataSource:i,popupHeight:"180px",cssClass:"e-de-prop-dropdown",allowCustom:!0,showClearButton:!1,enableRtl:this.isRtl}),this.fontSize.focus=function(){t.isRetrieving=!1,t.fontSize.element.select()},this.fontSize.value=this.documentEditor.selection.characterFormat.fontSize.toString(),this.fontSize.appendTo(e),this.fontSize.element.parentElement.setAttribute("title",this.localObj.getConstant("Font Size"))},e.prototype.createDropDownListForFamily=function(e){var t=this,i=!1,n="";this.container.enableCsp||(n='<span style="font-family: ${FontName};">${FontName}</span>',i=!0),this.fontFamily=new s.ComboBox({dataSource:void 0,query:(new g.Query).select(["FontName"]),fields:{text:"FontName",value:"FontValue"},popupHeight:"150px",cssClass:"e-de-prop-dropdown",allowCustom:!0,showClearButton:!1,enableRtl:this.isRtl,itemTemplate:n}),this.fontFamily.appendTo(e),this.fontFamily.isStringTemplate=i;for(var r=this.container.documentEditorSettings.fontFamilies,o=0;o<r.length;o++){var a=r[o],l={FontName:a,FontValue:a};this.fontFamily.addItem(l,o)}this.fontFamily.focus=function(){t.isRetrieving=!1,t.fontFamily.element.select()},this.fontFamily.element.parentElement.setAttribute("title",this.localObj.getConstant("Font"))},e.prototype.wireEvent=function(){var e=this;this.fontFamily.addEventListener("change",function(){e.changeFontFamily()}),this.fontSize.addEventListener("change",function(){e.changeFontSize()}),this.bold.addEventListener("click",function(){e.isRetrieving=!1,e.boldAction()}),this.italic.addEventListener("click",function(){e.isRetrieving=!1,e.italicAction()}),this.underline.addEventListener("click",function(){e.isRetrieving=!1,e.underlineAction()}),this.strikethrough.addEventListener("click",function(){e.isRetrieving=!1,e.strikethroughAction()}),this.superscript.addEventListener("click",function(){e.isRetrieving=!1,e.superscriptAction()}),this.subscript.addEventListener("click",function(){e.isRetrieving=!1,e.subscriptAction()}),this.fontColorInputElement.addEventListener("change",function(t){e.isRetrieving=!1,e.changeFontColor(t)}),this.clearFormat.addEventListener("click",function(){e.isRetrieving=!1,e.clearFormatAction()}),this.changeCaseDropdown.addEventListener("select",function(t){e.isRetrieving=!1,e.changeCase(t)})},e.prototype.unwireEvents=function(){this.fontFamily.change=void 0,this.fontSize.change=void 0,this.bold.click=void 0,this.italic.click=void 0,this.underline.click=void 0,this.strikethrough.click=void 0,this.superscript.click=void 0,this.subscript.click=void 0,this.fontColorInputElement.change=void 0,this.highlightColorElement.click=void 0,this.highlightColor.click=void 0,this.clearFormat.click=void 0,this.changeCaseDropdown.select=void 0},e.prototype.boldAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.toggleBold()},e.prototype.italicAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.toggleItalic()},e.prototype.underlineAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.toggleUnderline("Single")},e.prototype.strikethroughAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.toggleStrikethrough()},e.prototype.clearFormatAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.clearFormatting()},e.prototype.subscriptAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.toggleSubscript()},e.prototype.superscriptAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.toggleSuperscript()},e.prototype.changeFontColor=function(e){var t=this;this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.selection&&(this.documentEditor.selection.characterFormat.fontColor=e.currentValue.hex,setTimeout(function(){t.documentEditor.focusIn()},30))},e.prototype.changeFontFamily=function(){var e=this;this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.selection&&""!==this.fontFamily.value&&setTimeout(function(){e.documentEditor.selection.characterFormat.fontFamily=e.fontFamily.value},10)},e.prototype.changeFontSize=function(){var e=this;this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.selection&&""!==this.fontSize.value&&setTimeout(function(){e.documentEditor.selection.characterFormat.fontSize=e.fontSize.value},10)},e.prototype.onSelectionChange=function(){this.isRetrieving=!0,this.documentEditor.selection&&(this.documentEditor.selection.characterFormat.fontFamily?(this.fontFamily.value=this.documentEditor.selection.characterFormat.fontFamily,this.fontFamily.dataBind()):this.fontFamily.value="",this.documentEditor.selection.characterFormat.fontSize?(this.fontSize.value=this.documentEditor.selection.characterFormat.fontSize.toString(),this.fontSize.dataBind()):this.fontSize.value="",this.documentEditor.selection.characterFormat.bold?this.bold.classList.contains("e-btn-toggle")||this.bold.classList.add("e-btn-toggle"):this.bold.classList.contains("e-btn-toggle")&&this.bold.classList.remove("e-btn-toggle"),this.documentEditor.selection.characterFormat.italic?this.italic.classList.contains("e-btn-toggle")||this.italic.classList.add("e-btn-toggle"):this.italic.classList.contains("e-btn-toggle")&&this.italic.classList.remove("e-btn-toggle"),this.documentEditor.selection.characterFormat.underline&&"None"!==this.documentEditor.selection.characterFormat.underline?this.underline.classList.contains("e-btn-toggle")||this.underline.classList.add("e-btn-toggle"):this.underline.classList.contains("e-btn-toggle")&&this.underline.classList.remove("e-btn-toggle"),this.documentEditor.selection.characterFormat.strikethrough&&"None"!==this.documentEditor.selection.characterFormat.strikethrough?this.strikethrough.classList.contains("e-btn-toggle")||this.strikethrough.classList.add("e-btn-toggle"):this.strikethrough.classList.contains("e-btn-toggle")&&this.strikethrough.classList.remove("e-btn-toggle"),this.documentEditor.selection.characterFormat.baselineAlignment&&"Subscript"===this.documentEditor.selection.characterFormat.baselineAlignment?this.subscript.classList.contains("e-btn-toggle")||this.subscript.classList.add("e-btn-toggle"):this.subscript.classList.contains("e-btn-toggle")&&this.subscript.classList.remove("e-btn-toggle"),this.documentEditor.selection.characterFormat.baselineAlignment&&"Superscript"===this.documentEditor.selection.characterFormat.baselineAlignment?this.superscript.classList.contains("e-btn-toggle")||this.superscript.classList.add("e-btn-toggle"):this.superscript.classList.contains("e-btn-toggle")&&this.superscript.classList.remove("e-btn-toggle"),this.documentEditor.selection.characterFormat.fontColor&&(this.fontColorInputElement.value=this.documentEditor.selection.characterFormat.fontColor),this.documentEditor.selection.characterFormat.highlightColor&&(this.highlightColorInputElement.style.backgroundColor=this.appliedHighlightColor,this.applyHighlightColorAsBackground(this.documentEditor.selection.characterFormat.highlightColor)))},e.prototype.destroy=function(){this.container=void 0,this.highlightColor&&(this.highlightColor.destroy(),this.highlightColor=void 0),this.fontColorInputElement&&(this.fontColorInputElement.destroy(),this.fontColorInputElement=void 0),this.fontSize&&(this.fontSize.destroy(),this.fontSize=void 0),this.fontFamily&&(this.fontFamily.destroy(),this.fontFamily=void 0)},e}(),Xi=function(){function e(e){this.isRetrieving=!1,this.appliedBulletStyle="dot",this.appliedNumberingStyle="arabic",this.appliedLineSpacing="",this.splitButtonClass="e-de-prop-splitbutton",this.container=e}return Object.defineProperty(e.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),e.prototype.initializeParagraphPropertiesDiv=function(e,i){this.localObj=new t.L10n("documenteditorcontainer",this.container.defaultLocale,this.container.locale),this.isRtl=i,this.isRtl&&(this.splitButtonClass="e-rtl "+this.splitButtonClass),this.textProperties=e;var n=this.documentEditor.element.id+"_font_properties",r=this.createDivElement(n+"_paragraph",e,"");t.classList(r,["e-de-cntr-pane-padding"],[]);var o=t.createElement("label",{styles:"width:26px;",className:"e-de-ctnr-prop-label"});o.innerHTML=this.localObj.getConstant("Paragraph"),r.appendChild(o);var s=this.createDivElement(n+"_styleDiv",r);s.classList.add("e-de-ctnr-segment","e-de-ctnr-style-div");var a=t.createElement("input",{id:n+"_style",styles:"width:248px;font-size: 12px;letter-spacing: 0.05px;"});s.appendChild(a),this.createStyleDropDownList(a);var l=this.createDivElement(n+"_indentWholeDiv",r);l.style.display="flex",l.classList.add("e-de-ctnr-segment"),i&&t.classList(l,["e-de-ctnr-segment-rtl"],[]);var d=this.createDivElement(n+"_indentDiv",l,"display:flex;"),h="e-de-ctnr-group-btn e-de-char-fmt-btn-left e-btn-group";i&&(h="e-rtl "+h),d.className=h,this.leftAlignment=this.createButtonTemplate(n+"_leftIndent","e-de-ctnr-alignleft e-icons",d,"e-de-prop-indent-button","40.5",this.localObj.getConstant("Align left Tooltip")),this.centerAlignment=this.createButtonTemplate(n+"_centerIndent","e-de-ctnr-aligncenter e-icons",d,"e-de-prop-indent-button","40.5",this.localObj.getConstant("Center Tooltip")),this.rightAlignment=this.createButtonTemplate(n+"_rightIndent","e-de-ctnr-alignright e-icons",d,"e-de-prop-indent-button","40.5",this.localObj.getConstant("Align right Tooltip")),this.justify=this.createButtonTemplate(n+"_justify","e-de-ctnr-justify e-icons",d,"e-de-prop-indent-last-button","40.5",this.localObj.getConstant("Justify Tooltip"));var c="e-de-ctnr-increaseindent e-icons",p="e-de-ctnr-decreaseindent e-icons",g=this.createDivElement(n+"_indentDiv",l,"display:flex;");h="e-de-ctnr-group-btn e-de-char-fmt-btn-right e-btn-group",i&&(h="e-rtl "+h,c+=" e-de-flip",p+=" e-de-flip"),g.className=h,this.decreaseIndent=this.createButtonTemplate(n+"_decreaseIndent",p,g,"e-de-prop-indent-button","37",this.localObj.getConstant("Decrease indent")),this.increaseIndent=this.createButtonTemplate(n+"_increaseIndent",c,g,"e-de-prop-indent-last-button","37",this.localObj.getConstant("Increase indent"));var u=this.createDivElement(n+"_listDiv",r,"display:flex;");t.classList(u,["e-de-ctnr-segment","e-de-ctnr-group-btn"],[]),i&&t.classList(u,["e-de-ctnr-segment-rtl","e-de-ctnr-group-btn"],[]);var m=t.createElement("button",{id:n+"_lineHeight",attrs:{type:"button"}});u.appendChild(m),this.lineSpacing=this.createLineSpacingDropdown(m);var f=this.createDivElement(n+"_listDropDiv",u);f.className="de-split-button";var v=t.createElement("button",{id:n+"_bullet",attrs:{type:"button"}});f.appendChild(v);var y=t.createElement("button",{id:n+"_numberingList",attrs:{type:"button"}});f.appendChild(y);var b="e-de-ctnr-bullets e-icons",w="e-de-ctnr-numbering e-icons";i&&(b+=" e-de-flip",w+=" e-de-flip"),this.createBulletListDropButton(b,v),this.createNumberListDropButton(w,y)},e.prototype.createSeparator=function(e){var i=t.createElement("div",{className:"e-de-prop-vline"});e.appendChild(i)},e.prototype.createDivElement=function(e,i,n){var r;return r=n?t.createElement("div",{id:e,styles:n}):t.createElement("div",{id:e}),i.appendChild(r),r},e.prototype.createButtonTemplate=function(e,i,n,o,s,a){var l=t.createElement("Button",{id:e,attrs:{type:"button"}});return n.appendChild(l),new r.Button({cssClass:o,iconCss:i}).appendTo(l),l.setAttribute("title",a),l},e.prototype.createLineSpacingDropdown=function(e){var t=this,i=[{text:this.localObj.getConstant("Single")},{text:"1.15"},{text:"1.5"},{text:this.localObj.getConstant("Double")}],n=new d.DropDownButton({items:i,iconCss:"e-de-ctnr-linespacing e-icons",enableRtl:this.isRtl,select:this.lineSpacingAction.bind(this),cssClass:this.splitButtonClass,beforeItemRender:function(e){e.element.innerHTML="<span></span>"+e.item.text;var i=e.element.children[0];e.item.text===t.appliedLineSpacing?(i.style.marginRight="10px",i.setAttribute("class","e-de-selected-item e-icons e-de-linespacing")):(e.element.children[0].style.marginRight="25px",e.element.children[0].classList.remove("e-de-selected-item"))}});return n.appendTo(e),e.setAttribute("title",this.localObj.getConstant("Line spacing")),n},e.prototype.createNumberListDropButton=function(e,i){var n=this,r=t.createElement("div",{id:"target",styles:"width: 211px;height: auto;display:none"}),o=t.createElement("ul",{styles:"display: block; outline: 0px;",id:"listMenu",className:"e-de-floating-menu e-de-bullets-menu e-de-list-container e-de-list-thumbnail"});r.appendChild(o),this.noneNumberTag=this.createNumberNoneListTag(o),this.noneNumberTag.addEventListener("click",this.numberedNoneClick.bind(this)),this.numberList=this.createNumberListTag(o,"1.","2.","3."),this.numberList.addEventListener("click",this.numberedNumberDotClick.bind(this)),this.lowLetter=this.createNumberListTag(o,"a.","b.","c."),this.lowLetter.addEventListener("click",this.numberedLowLetterClick.bind(this)),this.upLetter=this.createNumberListTag(o,"A.","B.","C."),this.upLetter.addEventListener("click",this.numberedUpLetterClick.bind(this)),this.lowRoman=this.createNumberListTag(o,"i.","ii.","iii."),this.lowRoman.addEventListener("click",this.numberedLowRomanClick.bind(this)),this.upRoman=this.createNumberListTag(o,"I.","II.","III."),this.upRoman.addEventListener("click",this.numberedUpRomanClick.bind(this));var s={target:r,iconCss:e,cssClass:this.splitButtonClass,beforeOpen:function(){r.style.display="block",n.updateSelectedNumberedListType(n.documentEditor.selection.paragraphFormat.listText)},beforeClose:function(){r.style.display="none",n.removeSelectedList()}};this.numberedListBtn=new d.SplitButton(s),this.numberedListBtn.click=function(){n.applyLastAppliedNumbering()},this.numberedListBtn.appendTo(i),i.parentElement.setAttribute("title",this.localObj.getConstant("Numbering"))},e.prototype.updateSelectedBulletListType=function(e){switch(e){case"":this.dotBullet.classList.add("de-list-item-selected");break;case" ":this.circleBullet.classList.add("de-list-item-selected");break;case"":this.squareBullet.classList.add("de-list-item-selected");break;case"":this.flowerBullet.classList.add("de-list-item-selected");break;case"":this.arrowBullet.classList.add("de-list-item-selected");break;case"":this.tickBullet.classList.add("de-list-item-selected");break;default:this.noneBulletTag.classList.add("de-list-item-selected")}},e.prototype.updateSelectedNumberedListType=function(e){switch(e){case"1.":this.numberList.classList.add("de-list-item-selected");break;case"I.":this.upRoman.classList.add("de-list-item-selected");break;case"A.":this.upLetter.classList.add("de-list-item-selected");break;case"a.":this.lowLetter.classList.add("de-list-item-selected");break;case"i.":this.lowRoman.classList.add("de-list-item-selected");break;default:this.noneNumberTag.classList.add("de-list-item-selected")}},e.prototype.removeSelectedList=function(){var e="de-list-item-selected";this.noneNumberTag.classList.remove(e),this.numberList.classList.remove(e),this.lowLetter.classList.remove(e),this.upLetter.classList.remove(e),this.lowRoman.classList.remove(e),this.upRoman.classList.remove(e),this.noneBulletTag.classList.remove(e),this.dotBullet.classList.remove(e),this.circleBullet.classList.remove(e),this.squareBullet.classList.remove(e),this.flowerBullet.classList.remove(e),this.arrowBullet.classList.remove(e),this.tickBullet.classList.remove(e)},e.prototype.applyLastAppliedNumbering=function(){switch(this.appliedNumberingStyle){case"arabic":this.numberedNumberDotClick();break;case"lowletter":this.numberedLowLetterClick();break;case"upletter":this.numberedUpLetterClick();break;case"lowroman":this.numberedLowRomanClick();break;case"uproman":this.numberedUpRomanClick()}},e.prototype.applyLastAppliedBullet=function(){switch(this.appliedBulletStyle){case"dot":this.bulletDotClick();break;case"circle":this.bulletCircleClick();break;case"square":this.bulletSquareClick();break;case"arrow":this.bulletArrowClick();break;case"tick":this.bulletTickClick();break;case"flower":this.bulletFlowerClick()}},e.prototype.createBulletListDropButton=function(e,i){var n=this,r=t.createElement("div",{id:"bullet_list",styles:"width: 196px;height: auto;display:none"}),o=t.createElement("ul",{styles:"display: block; outline: 0px;",id:"listMenu",className:"e-de-floating-menu e-de-bullets-menu e-de-list-container e-de-list-thumbnail"});r.appendChild(o),this.noneBulletTag=this.createBulletListTag(o,"e-de-ctnr-bullet-none e-icons e-de-ctnr-list"),this.noneBulletTag.addEventListener("click",this.numberedNoneClick.bind(this)),this.dotBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-dot e-icons e-de-ctnr-list"),this.dotBullet.addEventListener("click",this.bulletDotClick.bind(this)),this.circleBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-circle e-icons e-de-ctnr-list"),this.circleBullet.addEventListener("click",this.bulletCircleClick.bind(this)),this.squareBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-square e-icons e-de-ctnr-list"),this.squareBullet.addEventListener("click",this.bulletSquareClick.bind(this)),this.flowerBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-flower e-icons e-de-ctnr-list"),this.flowerBullet.addEventListener("click",this.bulletFlowerClick.bind(this)),this.arrowBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-arrow e-icons e-de-ctnr-list"),this.arrowBullet.addEventListener("click",this.bulletArrowClick.bind(this)),this.tickBullet=this.createBulletListTag(o,"e-de-ctnr-bullet-tick e-icons e-de-ctnr-list"),this.tickBullet.addEventListener("click",this.bulletTickClick.bind(this));var s={target:r,iconCss:e,cssClass:this.splitButtonClass,beforeOpen:function(){r.style.display="block",n.updateSelectedBulletListType(n.documentEditor.selection.paragraphFormat.listText)},beforeClose:function(){r.style.display="none",n.removeSelectedList()}};this.bulletListBtn=new d.SplitButton(s),this.bulletListBtn.click=function(){n.applyLastAppliedBullet()},this.bulletListBtn.appendTo(i),i.parentElement.setAttribute("title",this.localObj.getConstant("Bullets"))},e.prototype.createNumberListTag=function(e,i,n,r){var o=t.createElement("li",{styles:"display:block",className:"e-de-floating-menuitem e-de-floating-menuitem-md e-de-list-items e-de-list-item-size"});e.appendChild(o);var s="<div>"+i+'<span class="e-de-list-line"></span></div><div>'+n+'<span class="e-de-list-line">';s+="</span></div><div>"+r+'<span class="e-de-list-line"> </span></div >';var a=t.createElement("div",{className:"e-de-list-header-presetmenu",id:"ui-zlist0",innerHTML:s});return o.appendChild(a),o},e.prototype.createNumberNoneListTag=function(e){var i=t.createElement("li",{styles:"display:block;",className:"e-de-floating-menuitem e-de-floating-menuitem-md e-de-list-items e-de-list-item-size"});e.appendChild(i);var n=t.createElement("div",{className:"e-de-list-header-presetmenu",styles:"position:relative;left:11px;top:13px",id:"ui-zlist0",innerHTML:'<div><span class="e-de-bullets">None</span></div>'});return i.appendChild(n),i},e.prototype.createBulletListTag=function(e,i){var n=t.createElement("li",{styles:"display:block;",className:"e-de-floating-menuitem e-de-floating-bullet-menuitem-md e-de-list-items e-de-list-item-size"});e.appendChild(n);var r=t.createElement("div",{className:"e-de-bullet-list-header-presetmenu",id:"ui-zlist0"}),o=t.createElement("div");r.appendChild(o);var s=t.createElement("span",{className:i});return o.appendChild(s),n.appendChild(r),n},e.prototype.createStyleDropDownList=function(e){this.style=new s.DropDownList({dataSource:[{StyleName:"Normal",Class:"e-icons e-edit-font"}],cssClass:"e-de-prop-dropdown",popupHeight:"240px",enableRtl:this.isRtl,query:(new g.Query).select(["StyleName","Style"]),fields:{text:"StyleName",value:"StyleName"},change:this.selectStyleValue.bind(this)}),this.container.enableCsp||(this.style.open=this.updateOptions.bind(this),this.style.itemTemplate='<span style="${Style}">${StyleName}</span>',this.style.footerTemplate='<span class="e-de-ctnr-dropdown-ftr">'+this.localObj.getConstant("Manage Styles")+"...</span>",this.style.isStringTemplate=!0),this.style.appendTo(e),e.parentElement.setAttribute("title",this.localObj.getConstant("Styles"))},e.prototype.updateOptions=function(e){this.updateStyleNames(),e.popup.element.getElementsByClassName("e-de-ctnr-dropdown-ftr")[0].addEventListener("click",this.createStyle.bind(this))},e.prototype.updateStyleNames=function(){this.styleName=t.isNullOrUndefined(this.style.itemData)?void 0:this.style.itemData.StyleName,this.style.dataSource=this.constructStyleDropItems(this.documentEditor.getStyles("Paragraph")),this.style.dataBind(),this.onSelectionChange()},e.prototype.createStyle=function(){this.style.hidePopup(),this.documentEditor.isReadOnly||this.documentEditor.showDialog("Styles")},e.prototype.constructStyleDropItems=function(e){for(var t=[],i=0,n=e;i<n.length;i++){var r=n[i],o={};o.StyleName=r.name,o.Style=this.parseStyle(r.style),t.push(o)}return t},e.prototype.parseStyle=function(e){var i="",n=JSON.parse(e),r="";if(!t.isNullOrUndefined(n.characterFormat.baselineAlignment)&&"Normal"!==n.characterFormat.baselineAlignment){var o="";switch(n.characterFormat.baselineAlignment){case"Superscript":o="super";break;case"Subscript":o="sub"}o.length>1&&(i+="vertical-align:"+o+";")}return t.isNullOrUndefined(n.characterFormat.underline)||"None"===n.characterFormat.underline||(r+="underline "),t.isNullOrUndefined(n.characterFormat.strikethrough)||"None"===n.characterFormat.strikethrough||(r+="line-through "),t.isNullOrUndefined(n.characterFormat.fontSize)||(i+="font-size:"+n.characterFormat.fontSize+"px;"),t.isNullOrUndefined(n.characterFormat.fontFamily)||(i+="font-family:"+n.characterFormat.fontFamily+";"),!t.isNullOrUndefined(n.characterFormat.bold)&&n.characterFormat.bold&&(i+="font-weight:bold;"),!t.isNullOrUndefined(n.characterFormat.italic)&&n.characterFormat.italic&&(i+="font-style:italic;"),r.length>1&&(i+="text-decoration:"+r+";"),i},e.prototype.wireEvent=function(){var e=this;this.leftAlignment.addEventListener("click",function(){e.leftAlignmentAction()}),this.rightAlignment.addEventListener("click",function(){e.rightAlignmentAction()}),this.centerAlignment.addEventListener("click",function(){e.centerAlignmentAction()}),this.justify.addEventListener("click",function(){e.justifyAction()}),this.increaseIndent.addEventListener("click",function(){e.increaseIndentAction()}),this.decreaseIndent.addEventListener("click",function(){e.decreaseIndentAction()}),this.lineSpacing.addEventListener("select",function(t){e.lineSpacingAction(t)})},e.prototype.unwireEvents=function(){this.leftAlignment.click=void 0,this.rightAlignment.click=void 0,this.centerAlignment.click=void 0,this.justify.click=void 0,this.increaseIndent.click=void 0,this.decreaseIndent.click=void 0,this.lineSpacing.select=void 0,this.style.select=void 0},e.prototype.leftAlignmentAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.toggleTextAlignment("Left")},e.prototype.lineSpacingAction=function(e){var t=this;if(!this.isRetrieving){switch(e.item.text){case this.localObj.getConstant("Single"):this.documentEditor.selection.paragraphFormat.lineSpacing=1;break;case"1.15":this.documentEditor.selection.paragraphFormat.lineSpacing=1.15;break;case"1.5":this.documentEditor.selection.paragraphFormat.lineSpacing=1.5;break;case this.localObj.getConstant("Double"):this.documentEditor.selection.paragraphFormat.lineSpacing=2}setTimeout(function(){t.documentEditor.focusIn()},30)}},e.prototype.setLineSpacing=function(){var e=this.documentEditor.selection.paragraphFormat.lineSpacing;this.appliedLineSpacing=1===e?this.localObj.getConstant("Single"):1.15===e?"1.15":1.5===e?"1.5":2===e?this.localObj.getConstant("Double"):""},e.prototype.selectStyleValue=function(e){var t=this;!this.isRetrieving&&e.isInteracted&&setTimeout(function(){t.applyStyleValue(e)},10)},e.prototype.applyStyleValue=function(e){!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.applyStyle(e.itemData.StyleName,!0)},e.prototype.rightAlignmentAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.toggleTextAlignment("Right")},e.prototype.centerAlignmentAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.toggleTextAlignment("Center")},e.prototype.justifyAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.toggleTextAlignment("Justify")},e.prototype.increaseIndentAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.increaseIndent()},e.prototype.decreaseIndentAction=function(){this.isRetrieving||!this.documentEditor.isReadOnly&&this.documentEditor.editor&&this.documentEditor.editor.decreaseIndent()},e.prototype.numberedNoneClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.documentEditor.editor.clearList(),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.numberedNumberDotClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedNumberingStyle="arabic",this.documentEditor.editor.applyNumbering("%1.","Arabic"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.numberedUpRomanClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedNumberingStyle="uproman",this.documentEditor.editor.applyNumbering("%1.","UpRoman"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.numberedUpLetterClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedNumberingStyle="upletter",this.documentEditor.editor.applyNumbering("%1.","UpLetter"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.numberedLowLetterClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedNumberingStyle="lowletter",this.documentEditor.editor.applyNumbering("%1.","LowLetter"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.numberedLowRomanClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedNumberingStyle="lowroman",this.documentEditor.editor.applyNumbering("%1.","LowRoman"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.bulletDotClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedBulletStyle="dot",this.documentEditor.editor.applyBullet("","Symbol"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.bulletCircleClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedBulletStyle="circle",this.documentEditor.editor.applyBullet(" ","Symbol"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.bulletSquareClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedBulletStyle="square",this.documentEditor.editor.applyBullet("","Wingdings"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.bulletFlowerClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedBulletStyle="flower",this.documentEditor.editor.applyBullet("","Wingdings"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.bulletArrowClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedBulletStyle="arrow",this.documentEditor.editor.applyBullet("","Wingdings"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.bulletTickClick=function(){var e=this;this.isRetrieving||this.documentEditor.editor&&(this.appliedBulletStyle="tick",this.documentEditor.editor.applyBullet("","Wingdings"),setTimeout(function(){e.documentEditor.focusIn()},30))},e.prototype.onSelectionChange=function(){if(this.isRetrieving=!0,this.documentEditor.editor){var e=this.documentEditor.selection.paragraphFormat.styleName;e?(this.style.value=e,this.style.dataBind()):this.style.value=null,t.classList(this.leftAlignment,[],["e-btn-toggle"]),t.classList(this.rightAlignment,[],["e-btn-toggle"]),t.classList(this.centerAlignment,[],["e-btn-toggle"]),t.classList(this.justify,[],["e-btn-toggle"]),"Left"===this.documentEditor.selection.paragraphFormat.textAlignment?t.classList(this.leftAlignment,["e-btn-toggle"],[]):"Right"===this.documentEditor.selection.paragraphFormat.textAlignment?t.classList(this.rightAlignment,["e-btn-toggle"],[]):"Center"===this.documentEditor.selection.paragraphFormat.textAlignment?t.classList(this.centerAlignment,["e-btn-toggle"],[]):"Justify"===this.documentEditor.selection.paragraphFormat.textAlignment&&t.classList(this.justify,["e-btn-toggle"],[])}this.setLineSpacing(),this.isRetrieving=!1},e.prototype.destroy=function(){this.container=void 0,this.lineSpacing&&(this.lineSpacing.destroy(),this.lineSpacing=void 0),this.style&&(this.style.destroy(),this.style=void 0),this.bulletListBtn&&(this.bulletListBtn.destroy(),this.bulletListBtn=void 0),this.numberedListBtn&&(this.numberedListBtn.destroy(),this.numberedListBtn=void 0)},e}(),Yi=function(){function e(e,t,i,n){this.isInitial=!0,this.container=e,this.text=new Ki(e,n),this.paragraph=new Xi(e),this.initializeTextProperties(t,i,n),this.wireEvents()}return Object.defineProperty(e.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),e.prototype.enableDisableElements=function(e){e?t.classList(this.element,[],["e-de-overlay"]):t.classList(this.element,["e-de-overlay"],[])},e.prototype.updateStyles=function(){this.paragraph.updateStyleNames()},Object.defineProperty(e.prototype,"appliedHighlightColor",{get:function(){return this.text.appliedHighlightColor},set:function(e){this.text.appliedHighlightColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"appliedBulletStyle",{get:function(){return this.paragraph.appliedBulletStyle},set:function(e){this.paragraph.appliedBulletStyle=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"appliedNumberingStyle",{get:function(){return this.paragraph.appliedNumberingStyle},set:function(e){this.paragraph.appliedNumberingStyle=e},enumerable:!0,configurable:!0}),e.prototype.showTextProperties=function(e){e&&this.onSelectionChange(),!e&&"none"===this.element.style.display||e&&"block"===this.element.style.display||(this.element.style.display=e?"block":"none",this.documentEditor.resize())},e.prototype.initializeTextProperties=function(e,i,n){this.element=t.createElement("div",{id:e+"id_"+this.generateUniqueID(),className:"e-de-prop-pane"}),this.text.initializeTextPropertiesDiv(this.element,n),this.paragraph.initializeParagraphPropertiesDiv(this.element,n),this.paragraph.updateStyleNames(),i||this.container.propertiesPaneContainer.appendChild(this.element)},e.prototype.generateUniqueID=function(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)},e.prototype.wireEvents=function(){this.text.wireEvent(),this.paragraph.wireEvent()},e.prototype.onSelectionChange=function(){this.text.onSelectionChange(),this.paragraph.onSelectionChange()},e.prototype.destroy=function(){this.text&&(this.text.destroy(),this.text=void 0),this.paragraph&&(this.paragraph.destroy(),this.paragraph=void 0)},e}(),Ji=function(){function e(e,t){this.isHeaderTopApply=!1,this.isFooterTopApply=!1,this.container=e,this.isRtl=t,this.initHeaderFooterPane(),this.wireEvents()}return Object.defineProperty(e.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"toolbar",{get:function(){return this.container.toolbarModule},enumerable:!0,configurable:!0}),e.prototype.enableDisableElements=function(e){e?t.classList(this.element,[],["e-de-overlay"]):t.classList(this.element,["e-de-overlay"],[])},e.prototype.initHeaderFooterPane=function(){this.initializeHeaderFooter(),this.element.style.display="none",this.container.propertiesPaneContainer.appendChild(this.element)},e.prototype.showHeaderFooterPane=function(e){e&&(this.toolbar&&this.toolbar.enableDisablePropertyPaneButton(!1),this.onSelectionChange()),!e&&"none"===this.element.style.display||e&&"block"===this.element.style.display||(this.element.style.display=e?"block":"none",this.documentEditor.resize())},e.prototype.initializeHeaderFooter=function(){var e=this,i=new t.L10n("documenteditorcontainer",this.container.defaultLocale,this.container.locale),n="header_footer_properties";this.element=t.createElement("div",{id:this.documentEditor.element.id+n,className:"e-de-prop-pane"});var o=this.createDivTemplate("_header_footer",this.element,"padding-bottom:0");t.classList(o,["e-de-cntr-pane-padding"],[]);var s=t.createElement("label",{className:"e-de-prop-header-label"});s.innerHTML=i.getConstant("Header And Footer");var l;l=this.isRtl?"float:left;":"float:right;";var d=t.createElement("span",{id:"_header_footer_close",className:"e-de-ctnr-close e-de-close-icon e-icons",styles:"display:inline-block;cursor:pointer;"+l});d.addEventListener("click",function(){e.onClose()}),o.appendChild(s),o.appendChild(d);var h=this.createDivTemplate(n+"_options",this.element);t.classList(h,["e-de-cntr-pane-padding","e-de-prop-separator-line"],[]);var c=t.createElement("label",{className:"e-de-ctnr-prop-label",styles:"height:20px;"});c.innerHTML=i.getConstant("Options"),h.appendChild(c);var p=this.createDivTemplate(n+"_optionsDiv",h),g=this.createDivTemplate(n+"_firstPageDiv",p);t.classList(g,["e-de-hdr-ftr-frst-div"],[]);var u=t.createElement("input",{id:"firstPage",className:"e-de-prop-sub-label"});g.appendChild(u),this.firstPage=new r.CheckBox({label:i.getConstant("Different First Page"),change:this.changeFirstPageOptions.bind(this),cssClass:"e-de-prop-sub-label",enableRtl:this.isRtl}),this.firstPage.appendTo(u),g.children[0].setAttribute("title",i.getConstant("Different header and footer for first page"));var m=this.createDivTemplate(n+"_oddOrEvenDiv",p),f=t.createElement("input",{id:"oddOrEven",className:"e-de-sub-prop-label"});m.appendChild(f),this.oddOrEven=new r.CheckBox({label:i.getConstant("Different Odd And Even Pages"),change:this.changeoddOrEvenOptions.bind(this),cssClass:"e-de-prop-sub-label",enableRtl:this.isRtl}),this.oddOrEven.appendTo(f),m.children[0].setAttribute("title",i.getConstant("Different header and footer for odd and even pages"));var v=this.createDivTemplate(n+"_positionLabelDiv",this.element);t.classList(v,["e-de-cntr-pane-padding","e-de-prop-separator-line"],[]);var y=t.createElement("label",{className:"e-de-ctnr-prop-label",styles:"height:20px;"});y.innerHTML=i.getConstant("Position"),v.appendChild(y);var b=this.createDivTemplate(n+"_positionDiv",v),w=this.createDivTemplate(n+"_headerTopDiv",b);t.classList(w,["e-de-hdr-ftr-top-div"],[]);var C=t.createElement("label",{className:"e-de-prop-sub-label",styles:"display:block"});C.innerHTML=i.getConstant("Header from Top"),w.appendChild(C);var x=t.createElement("input",{id:this.documentEditor.element.id+"_headerFromTop",className:"e-de-prop-sub-label"});w.appendChild(x),this.headerFromTop=new a.NumericTextBox({value:36,cssClass:"e-de-prop-header-numeric",showSpinButton:!1,format:"n0",decimals:2,max:1584,min:0,enableRtl:this.isRtl}),this.headerFromTop.appendTo(x),this.headerFromTop.element.parentElement.setAttribute("title",i.getConstant("Distance from top of the page to top of the header"));var F=this.createDivTemplate(n+"_footerBottomDiv",b),P=t.createElement("label",{className:"e-de-prop-sub-label",styles:"display:block"});P.innerHTML=i.getConstant("Footer from Bottom"),F.appendChild(P);var T=t.createElement("input",{id:this.documentEditor.element.id+"_footerFromTop",className:"e-de-prop-sub-label"});F.appendChild(T),this.footerFromTop=new a.NumericTextBox({value:36,cssClass:"e-de-prop-header-numeric",showSpinButton:!1,format:"n0",decimals:2,max:1584,min:0,enableRtl:this.isRtl}),this.footerFromTop.appendTo(T),this.footerFromTop.element.parentElement.setAttribute("title",i.getConstant("Distance from bottom of the page to bottom of the footer"))},e.prototype.createDivTemplate=function(e,i,n){var r;return r=n?t.createElement("div",{id:e,styles:n}):t.createElement("div",{id:e}),i.appendChild(r),r},e.prototype.wireEvents=function(){var e=this;this.headerFromTop.element.addEventListener("click",function(){e.isHeaderTopApply=!0}),this.footerFromTop.element.addEventListener("click",function(){e.isFooterTopApply=!0}),this.headerFromTop.element.addEventListener("keydown",this.onHeaderValue.bind(this)),this.footerFromTop.element.addEventListener("keydown",this.onFooterValue.bind(this)),this.headerFromTop.element.addEventListener("blur",function(){e.changeHeaderValue(),e.isHeaderTopApply=!1}),this.footerFromTop.element.addEventListener("blur",function(){e.changeFooterValue(),e.isFooterTopApply=!1})},e.prototype.onClose=function(){this.container.showHeaderProperties=!0,this.container.documentEditor.selection.closeHeaderFooter()},e.prototype.changeFirstPageOptions=function(){var e=this;this.documentEditor.isReadOnly||(this.documentEditor.selection.sectionFormat.differentFirstPage=this.firstPage.checked,setTimeout(function(){e.documentEditor.focusIn()},10))},e.prototype.changeoddOrEvenOptions=function(){var e=this;this.documentEditor.isReadOnly||(this.documentEditor.selection.sectionFormat.differentOddAndEvenPages=this.oddOrEven.checked,setTimeout(function(){e.documentEditor.focusIn()},10))},e.prototype.changeHeaderValue=function(){if(this.isHeaderTopApply&&!this.documentEditor.isReadOnly){var e=this.headerFromTop.value;e>this.headerFromTop.max&&(e=this.headerFromTop.max),this.documentEditor.selection.sectionFormat.headerDistance=e}},e.prototype.onHeaderValue=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.changeHeaderValue(),t.isHeaderTopApply=!1},30)},e.prototype.onFooterValue=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.changeFooterValue(),t.isFooterTopApply=!1},30)},e.prototype.changeFooterValue=function(){if(this.isFooterTopApply&&!this.documentEditor.isReadOnly){var e=this.footerFromTop.value;e>this.footerFromTop.max&&(e=this.footerFromTop.max),this.documentEditor.selection.sectionFormat.footerDistance=e}},e.prototype.onSelectionChange=function(){this.headerFromTop.value=this.documentEditor.selection.sectionFormat.headerDistance,this.footerFromTop.value=this.documentEditor.selection.sectionFormat.footerDistance,this.documentEditor.selection.sectionFormat.differentFirstPage?this.firstPage.checked=!0:this.firstPage.checked=!1,this.documentEditor.selection.sectionFormat.differentOddAndEvenPages?this.oddOrEven.checked=!0:this.oddOrEven.checked=!1},e.prototype.destroy=function(){this.headerFromTop&&(this.headerFromTop.destroy(),this.headerFromTop=void 0),this.footerFromTop&&(this.footerFromTop.destroy(),this.footerFromTop=void 0)},e}(),Zi=function(){function e(e,t){this.isWidthApply=!1,this.isHeightApply=!1,this.container=e,this.elementId=this.documentEditor.element.id,this.isMaintainAspectRatio=!1,this.isRtl=t,this.initializeImageProperties()}return Object.defineProperty(e.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),e.prototype.enableDisableElements=function(e){e?t.classList(this.element,[],["e-de-overlay"]):t.classList(this.element,["e-de-overlay"],[])},e.prototype.initializeImageProperties=function(){this.element=t.createElement("div",{id:this.elementId+"_imageProperties",className:"e-de-prop-pane"}),this.element.style.display="none",this.container.propertiesPaneContainer.appendChild(this.element),this.initImageProp(),this.wireEvents()},e.prototype.initImageProp=function(){var e=new t.L10n("documenteditorcontainer",this.container.defaultLocale,this.container.locale),i=t.createElement("div",{id:this.elementId+"_imageDiv",className:"e-de-cntr-pane-padding",styles:"border:0px"});this.element.appendChild(i);var n=t.createElement("label",{className:"e-de-ctnr-prop-label"});n.textContent=e.getConstant("Image"),i.appendChild(n);var o=t.createElement("div");i.appendChild(o),this.widthElement=this.createImagePropertiesDiv("_widthDiv",o,"_widthInput",e.getConstant("W"),e.getConstant("Width")),this.widthNumericBox=new a.NumericTextBox({min:0,max:23500,cssClass:"e-de-image-property",showSpinButton:!1,format:"n0",decimals:2}),this.widthNumericBox.appendTo(this.widthElement),this.heightElement=this.createImagePropertiesDiv("_heightDiv",o,"_heightInput",e.getConstant("H"),e.getConstant("Height")),this.heightNumericBox=new a.NumericTextBox({min:0,max:23500,cssClass:"e-de-image-property",showSpinButton:!1,format:"n0",decimals:2}),this.heightNumericBox.appendTo(this.heightElement);var s=t.createElement("div",{id:this.elementId+"_aspectRatioDiv"});s.setAttribute("title",e.getConstant("Aspect ratio")),o.appendChild(s);var l=t.createElement("input",{id:this.elementId+"_aspectRatio",className:"e-de-ctnr-prop-label"});s.appendChild(l),this.aspectRatioBtn=new r.CheckBox({label:e.getConstant("Aspect ratio"),enableRtl:this.isRtl},l)},e.prototype.createImagePropertiesDiv=function(e,i,n,r,o){var s=t.createElement("div",{id:this.elementId+e,styles:"position: relative;width: 100%;",className:"e-de-ctnr-segment"});s.setAttribute("title",o),i.appendChild(s);var a=t.createElement("input",{id:this.elementId+n,className:"e-textbox",styles:"width:100%;"});s.appendChild(a);var l=t.createElement("span",{className:"e-de-img-prty-span"});return l.textContent=r,s.appendChild(l),a},e.prototype.wireEvents=function(){var e=this;this.aspectRatioBtn.element.addEventListener("change",this.onAspectRatioBtnClick.bind(this)),this.widthNumericBox.element.addEventListener("click",function(){e.isWidthApply=!0}),this.heightNumericBox.element.addEventListener("click",function(){e.isHeightApply=!0}),this.widthNumericBox.element.addEventListener("keydown",this.onImageWidth.bind(this)),this.heightNumericBox.element.addEventListener("keydown",this.onImageHeight.bind(this)),this.widthNumericBox.element.addEventListener("blur",function(){e.applyImageWidth(),e.isWidthApply=!1}),this.heightNumericBox.element.addEventListener("blur",function(){e.applyImageHeight(),e.isHeightApply=!1})},e.prototype.onImageWidth=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyImageWidth(),t.isWidthApply=!1},30)},e.prototype.onImageHeight=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyImageHeight(),t.isHeightApply=!1},30)},e.prototype.applyImageWidth=function(){if(this.isMaintainAspectRatio){if(this.isMaintainAspectRatio){(i=this.widthNumericBox.value)>this.widthNumericBox.max&&(i=this.widthNumericBox.max);var e=i/this.documentEditor.selection.imageFormat.width,t=this.heightNumericBox.value*e;this.heightNumericBox.value=t,null!==i&&null!==t&&this.documentEditor.selection.imageFormat.resize(i,t)}}else{var i=this.widthNumericBox.value,t=this.heightNumericBox.value;i>this.widthNumericBox.max&&(i=this.widthNumericBox.max),t>this.heightNumericBox.max&&(t=this.heightNumericBox.max),null!==i&&null!==t&&this.documentEditor.selection.imageFormat.resize(i,t)}},e.prototype.applyImageHeight=function(){if(this.isMaintainAspectRatio){if(this.isMaintainAspectRatio){var e=(i=this.heightNumericBox.value)/this.documentEditor.selection.imageFormat.height,t=this.widthNumericBox.value*e;this.widthNumericBox.value=t,null!==t&&null!==i&&this.documentEditor.selection.imageFormat.resize(t,i)}}else{var t=this.widthNumericBox.value,i=this.heightNumericBox.value;null!==t&&null!==i&&this.documentEditor.selection.imageFormat.resize(t,i)}},e.prototype.onAspectRatioBtnClick=function(){this.isMaintainAspectRatio?this.isMaintainAspectRatio=!1:this.isMaintainAspectRatio=!0},e.prototype.showImageProperties=function(e){"block"===this.element.style.display&&this.updateImageProperties(),!e&&"none"===this.element.style.display||e&&"block"===this.element.style.display||(this.element.style.display=e?"block":"none",this.documentEditor.resize())},e.prototype.updateImageProperties=function(){this.widthNumericBox.value=this.documentEditor.selection.imageFormat.width,this.heightNumericBox.value=this.documentEditor.selection.imageFormat.height},e.prototype.destroy=function(){this.container=void 0,this.widthNumericBox&&(this.widthNumericBox.destroy(),this.widthNumericBox=void 0),this.heightNumericBox&&(this.heightNumericBox.destroy(),this.heightNumericBox=void 0)},e}(),Qi=function(){function e(e,t){this.container=e,this.elementId=this.documentEditor.element.id,this.isRtl=t,this.initializeTocPane()}return Object.defineProperty(e.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"toolbar",{get:function(){return this.container.toolbarModule},enumerable:!0,configurable:!0}),e.prototype.enableDisableElements=function(e){e?t.classList(this.element,[],["e-de-overlay"]):t.classList(this.element,["e-de-overlay"],[])},e.prototype.initializeTocPane=function(){this.localObj=new t.L10n("documenteditorcontainer",this.container.defaultLocale,this.container.locale),this.element=t.createElement("div",{id:this.elementId+"_tocProperties",className:"e-de-prop-pane"});var e=t.createElement("div",{className:"e-de-cntr-pane-padding e-de-prop-separator-line"});this.tocHeaderDiv(e),this.initTemplates(e),e=t.createElement("div",{className:"e-de-cntr-pane-padding"}),this.tocOptionsDiv(e),this.contentStylesDropdown(e),this.checkboxContent(e),this.buttonDiv(e),this.wireEvents(),this.updateTocProperties(),this.container.propertiesPaneContainer.appendChild(this.element)},e.prototype.updateTocProperties=function(){this.rightalignPageNumber.checked=!0,this.showPageNumber.checked=!0,this.hyperlink.checked=!0},e.prototype.wireEvents=function(){var e=this;this.cancelBtn.element.addEventListener("click",function(){e.onClose()}),this.updateBtn.element.addEventListener("click",this.onInsertToc.bind(this)),this.closeButton.addEventListener("click",function(){e.onClose()})},e.prototype.onClose=function(){this.container.showPropertiesPane&&"TableOfContents"!==this.container.previousContext?this.container.showPropertiesPaneOnSelection():(this.showTocPane(!1),this.toolbar&&this.toolbar.enableDisablePropertyPaneButton(!1),this.container.showPropertiesPane=!1)},e.prototype.tocHeaderDiv=function(e){var i,n;this.isRtl?(i="float:left;",n="margin-left:7px;"):(i="float:right;",n="margin-right:7px;");var r=t.createElement("div",{id:this.elementId+"toc_id",styles:"display: block;"});e.appendChild(r),this.element.appendChild(e);var o=t.createElement("label",{className:"e-de-ctnr-prop-label"});o.textContent=this.localObj.getConstant("Table of Contents"),r.appendChild(o),this.closeButton=t.createElement("span",{className:"e-de-ctnr-close e-icons",styles:"cursor: pointer;display:inline-block;color: #4A4A4A;"+i+n}),r.appendChild(this.closeButton)},e.prototype.initTemplates=function(e){this.template1(e)},e.prototype.template1=function(e){this.template1Div=t.createElement("div",{className:"e-de-toc-template1"}),this.isRtl&&this.template1Div.classList.add("e-de-rtl"),e.appendChild(this.template1Div);var i=t.createElement("div",{className:"e-de-toc-template1-content1"});i.textContent=this.localObj.getConstant("HEADING - - - - 1"),this.template1Div.appendChild(i);var n=t.createElement("div",{className:"e-de-toc-template1-content2"});n.textContent=this.localObj.getConstant("HEADING - - - - 2"),this.template1Div.appendChild(n);var r=t.createElement("div",{className:"e-de-toc-template1-content3"});r.textContent=this.localObj.getConstant("HEADING - - - - 3"),this.template1Div.appendChild(r)},e.prototype.tocOptionsDiv=function(e){var i=t.createElement("div");e.appendChild(i),this.element.appendChild(e),this.isRtl&&i.classList.add("e-de-rtl");var n=t.createElement("label",{className:"e-de-ctnr-prop-label"});n.textContent=this.localObj.getConstant("Options"),i.appendChild(n)},e.prototype.createDropDownButton=function(e,i,n,r,o){var a=t.createElement("input",{id:e});return i.appendChild(a),new s.DropDownList({index:o,dataSource:r,popupHeight:"150px",cssClass:"e-de-prop-font-button"},a)},e.prototype.contentStylesDropdown=function(e){var i=this;this.isRtl;var n=t.createElement("div",{id:"contentstyle_div"});n.setAttribute("title",this.localObj.getConstant("Number of heading or outline levels to be shown in table of contents")),e.appendChild(n),this.isRtl;var r=t.createElement("label",{className:"e-de-prop-sub-label",styles:"display:block"});r.textContent=this.localObj.getConstant("Levels"),n.appendChild(r),e.appendChild(n);var o=["1","2","3","4","5","6","7","8","9"];this.borderLevelStyle=this.createDropDownButton(this.elementId+"_borderLevelDiv",n,"",o,2),this.borderLevelStyle.change=function(e){i.borderLevelStyle.value=e.item.value},e.appendChild(n)},e.prototype.checkboxContent=function(e){this.isRtl;var i=t.createElement("div",{id:"toc_checkboxDiv",styles:"margin-bottom:36px;"});e.appendChild(i);var n=t.createElement("div",{className:"e-de-toc-checkbox1"});n.setAttribute("title",this.localObj.getConstant("Show page numbers in table of contents")),i.appendChild(n);var o=t.createElement("input",{id:"showpagenumber",styles:"width:12px;height:12px;margin-bottom:8px",className:"e-de-prop-sub-label"});n.appendChild(o),this.showPageNumber=new r.CheckBox({label:this.localObj.getConstant("Show page numbers"),enableRtl:this.isRtl}),this.showPageNumber.appendTo(o);var s=t.createElement("div",{className:"e-de-toc-checkbox2"});s.setAttribute("title",this.localObj.getConstant("Right align page numbers in table of contents")),i.appendChild(s);var a=t.createElement("input",{id:"rightalignpagenumber",styles:"width:12px;height:12px",className:"e-de-prop-sub-label"});s.appendChild(a),this.rightalignPageNumber=new r.CheckBox({label:this.localObj.getConstant("Right align page numbers"),enableRtl:this.isRtl}),this.rightalignPageNumber.appendTo(a);var l=t.createElement("div",{className:"e-de-toc-checkbox3"});l.setAttribute("title",this.localObj.getConstant("Use hyperlinks instead of page numbers")),i.appendChild(l);var d=t.createElement("input",{id:"hyperlinkdiv",styles:"width:12px;height:12px",className:"e-de-prop-sub-label"});l.appendChild(d),this.hyperlink=new r.CheckBox({label:this.localObj.getConstant("Use hyperlinks"),enableRtl:this.isRtl}),this.hyperlink.appendTo(d)},e.prototype.buttonDiv=function(e){var i;i=this.isRtl?"float:left":"float:right";var n=t.createElement("div",{id:"footerDiv",styles:i});e.appendChild(n);var o=t.createElement("button",{id:"footerupdatebuttonDiv",attrs:{type:"button"}});n.appendChild(o),this.updateBtn=new r.Button({content:this.localObj.getConstant("Update"),cssClass:"btn-update",isPrimary:!0}),this.updateBtn.appendTo(o);var s=t.createElement("button",{id:"footercancelbuttonDiv",attrs:{type:"button"}});n.appendChild(s),this.cancelBtn=new r.Button({content:this.localObj.getConstant("Cancel"),cssClass:this.isRtl?"e-de-btn-cancel-rtl":"e-de-btn-cancel"}),this.cancelBtn.appendTo(s)},e.prototype.showTocPane=function(e,t){!e&&"none"===this.element.style.display||e&&"block"===this.element.style.display||(this.element.style.display=e?"block":"none",this.updateBtn.content="TableOfContents"===this.documentEditor.selection.contextType?this.localObj.getConstant("Update"):this.localObj.getConstant("Insert"),this.prevContext=this.documentEditor.selection.contextType,this.documentEditor.resize(),e&&this.updateBtn.element.focus())},e.prototype.onInsertToc=function(){var e={startLevel:1,endLevel:parseInt(this.borderLevelStyle.value,0),includeHyperlink:this.hyperlink.checked,includePageNumber:this.showPageNumber.checked,rightAlign:this.rightalignPageNumber.checked};e.rightAlign&&(e.tabLeader="Dot"),this.documentEditor.editor.insertTableOfContents(e)},e.prototype.destroy=function(){this.container=void 0,this.showPageNumber&&(this.showPageNumber.destroy(),this.showPageNumber=void 0),this.rightalignPageNumber&&(this.rightalignPageNumber.destroy(),this.rightalignPageNumber=void 0),this.borderBtn&&(this.borderBtn.destroy(),this.borderBtn=void 0),this.borderLevelStyle&&(this.borderLevelStyle.destroy(),this.borderLevelStyle=void 0)},e}(),$i=function(){function e(e,t,i,n){this.isTopMarginApply=!1,this.isRightMarginApply=!1,this.isBottomMarginApply=!1,this.isLeftMarginApply=!1,this.borderColor="#000000",this.groupButtonClass="e-de-ctnr-group-btn e-btn-group",this.container=e,this.isRtl=n,this.isRtl&&(this.groupButtonClass="e-rtl "+this.groupButtonClass),this.tableTextProperties=new Yi(e,"textProperties",!0,this.isRtl),this.imageProperty=t,this.elementId=this.documentEditor.element.id,this.initializeTablePropPane(),this.prevContext=this.documentEditor.selection.contextType,this.textProperties=i}return Object.defineProperty(e.prototype,"documentEditor",{get:function(){return this.container.documentEditor},enumerable:!0,configurable:!0}),e.prototype.initializeTablePropPane=function(){this.localObj=new t.L10n("documenteditorcontainer",this.container.defaultLocale,this.container.locale),this.tableProperties=t.createElement("div",{id:this.elementId+"_tableProperties"}),this.initFillColorDiv(),this.initBorderStylesDiv(),this.initCellDiv(),this.initInsertOrDelCell(),this.initCellMargin(),this.initAlignText(),this.addTablePropertyTab(),this.wireEvent()},e.prototype.enableDisableElements=function(e){this.textProperties.enableDisableElements(e),e?t.classList(this.element,[],["e-de-overlay"]):t.classList(this.element,["e-de-overlay"],[])},e.prototype.addTablePropertyTab=function(){var e=t.createElement("div",{innerHTML:this.localObj.getConstant("Table")}),n=t.createElement("div",{innerHTML:this.localObj.getConstant("Text")});this.parentElement=t.createElement("div",{styles:"height:100%;overflow:auto;display:none",className:"e-de-prop-pane"}),this.element=t.createElement("div",{id:this.elementId+"_propertyTabDiv",className:"e-de-property-tab"});var r=[{header:{text:e},content:this.tableProperties},{header:{text:n},content:this.tableTextProperties.element}];this.propertiesTab=new i.Tab({items:r,animation:{previous:{effect:"None"},next:{effect:"None"}},selected:this.onTabSelection.bind(this)}),this.propertiesTab.isStringTemplate=!0,this.propertiesTab.appendTo(this.element),this.parentElement.appendChild(this.element),this.container.propertiesPaneContainer.appendChild(this.parentElement)},e.prototype.onTabSelection=function(){this.documentEditor.resize()},e.prototype.wireEvent=function(){var e=this;this.shadingBtn.addEventListener("change",this.changeBackgroundColor.bind(this)),this.borderBtn.addEventListener("change",function(t){setTimeout(function(){e.borderColor=t.currentValue.hex,e.tableOutlineBorder.element.focus()},10)}),this.tableOutlineBorder.element.addEventListener("click",this.onOutlineBorder.bind(this)),this.tableAllBorder.element.addEventListener("click",this.onAllBorder.bind(this)),this.tableCenterBorder.element.addEventListener("click",this.onInsideBorder.bind(this)),this.tableLeftBorder.element.addEventListener("click",this.onLeftBorder.bind(this)),this.tableCenterVerticalBorder.element.addEventListener("click",this.onVerticalBorder.bind(this)),this.tableRightBorder.element.addEventListener("click",this.onRightBorder.bind(this)),this.tableTopBorder.element.addEventListener("click",this.onTopBorder.bind(this)),this.tableCenterHorizontalBorder.element.addEventListener("click",this.onHorizontalBorder.bind(this)),this.tableBottomBorder.element.addEventListener("click",this.onBottomBorder.bind(this)),this.insertRowAbove.element.addEventListener("click",this.onInsertRowAbove.bind(this)),this.insertRowBelow.element.addEventListener("click",this.onInsertRowBelow.bind(this)),this.insertColumnLeft.element.addEventListener("click",this.onInsertColumnLeft.bind(this)),this.insertColumnRight.element.addEventListener("click",this.onInsertColumnRight.bind(this)),this.deleteRow.element.addEventListener("click",this.onDeleteRow.bind(this)),this.deleteColumn.element.addEventListener("click",this.onDeleteColumn.bind(this)),this.horizontalMerge.element.addEventListener("click",this.onMergeCell.bind(this)),this.alignTop.element.addEventListener("click",this.applyAlignTop.bind(this)),this.alignBottom.element.addEventListener("click",this.applyAlignBottom.bind(this)),this.alignCenterHorizontal.element.addEventListener("click",this.applyAlignCenterHorizontal.bind(this)),this.topMargin.element.addEventListener("click",function(){e.isTopMarginApply=!0}),this.rightMargin.element.addEventListener("click",function(){e.isRightMarginApply=!0}),this.leftMargin.element.addEventListener("click",function(){e.isLeftMarginApply=!0}),this.bottomMargin.element.addEventListener("click",function(){e.isBottomMarginApply=!0}),this.topMargin.element.addEventListener("keydown",this.onTopMargin.bind(this)),this.rightMargin.element.addEventListener("keydown",this.onRightMargin.bind(this)),this.leftMargin.element.addEventListener("keydown",this.onLeftMargin.bind(this)),this.bottomMargin.element.addEventListener("keydown",this.onBottomMargin.bind(this)),this.topMargin.element.addEventListener("blur",function(){e.applyTopMargin(),e.isTopMarginApply=!1}),this.rightMargin.element.addEventListener("blur",function(){e.applyRightMargin(),e.isRightMarginApply=!1}),this.leftMargin.element.addEventListener("blur",function(){e.applyLeftMargin(),e.isLeftMarginApply=!1}),this.bottomMargin.element.addEventListener("blur",function(){e.applyBottomMargin(),e.isBottomMarginApply=!1})},e.prototype.getBorder=function(e){var t=this.borderSize.content.indexOf("No Border")>=0?0:parseInt(this.borderSize.content,10),i=0===t?"Cleared":"Single";return{type:e,borderColor:this.borderColor,lineWidth:t,borderStyle:i}},e.prototype.onOutlineBorder=function(){this.documentEditor.editor.applyBorders(this.getBorder("OutsideBorders"))},e.prototype.onAllBorder=function(){this.documentEditor.editor.applyBorders(this.getBorder("AllBorders"))},e.prototype.onInsideBorder=function(){this.documentEditor.editor.applyBorders(this.getBorder("InsideBorders"))},e.prototype.onLeftBorder=function(){this.documentEditor.editor.applyBorders(this.getBorder("LeftBorder"))},e.prototype.onVerticalBorder=function(){this.documentEditor.editor.applyBorders(this.getBorder("InsideVerticalBorder"))},e.prototype.onRightBorder=function(){this.documentEditor.editor.applyBorders(this.getBorder("RightBorder"))},e.prototype.onTopBorder=function(){this.documentEditor.editor.applyBorders(this.getBorder("TopBorder"))},e.prototype.onHorizontalBorder=function(){this.documentEditor.editor.applyBorders(this.getBorder("InsideHorizontalBorder"))},e.prototype.onBottomBorder=function(){this.documentEditor.editor.applyBorders(this.getBorder("BottomBorder"))},e.prototype.onTopMargin=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyTopMargin(),t.isTopMarginApply=!1},30)},e.prototype.onBottomMargin=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyBottomMargin(),t.isBottomMarginApply=!1},30)},e.prototype.onLeftMargin=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyLeftMargin(),t.isLeftMarginApply=!1},30)},e.prototype.onRightMargin=function(e){var t=this;13===e.keyCode&&setTimeout(function(){t.applyRightMargin(),t.isRightMarginApply=!1},30)},e.prototype.applyTopMargin=function(){this.isTopMarginApply&&(this.documentEditor.selection.cellFormat.topMargin=this.topMargin.value>this.topMargin.max?this.topMargin.max:this.topMargin.value)},e.prototype.applyBottomMargin=function(){this.isBottomMarginApply&&(this.documentEditor.selection.cellFormat.bottomMargin=this.bottomMargin.value>this.bottomMargin.max?this.bottomMargin.max:this.bottomMargin.value)},e.prototype.applyLeftMargin=function(){this.isLeftMarginApply&&(this.documentEditor.selection.cellFormat.leftMargin=this.leftMargin.value>this.leftMargin.max?this.leftMargin.max:this.leftMargin.value)},e.prototype.applyRightMargin=function(){this.isRightMarginApply&&(this.documentEditor.selection.cellFormat.rightMargin=this.rightMargin.value>this.rightMargin.max?this.rightMargin.max:this.rightMargin.value)},e.prototype.applyAlignTop=function(){this.documentEditor.selection.cellFormat.verticalAlignment="Top"},e.prototype.applyAlignBottom=function(){this.documentEditor.selection.cellFormat.verticalAlignment="Bottom"},e.prototype.applyAlignCenterHorizontal=function(){this.documentEditor.selection.cellFormat.verticalAlignment="Center"},e.prototype.onMergeCell=function(){this.documentEditor.editor.mergeCells()},e.prototype.onInsertRowAbove=function(){this.documentEditor.editor.insertRow(!0)},e.prototype.onInsertRowBelow=function(){this.documentEditor.editor.insertRow(!1)},e.prototype.onInsertColumnLeft=function(){this.documentEditor.editor.insertColumn(!0)},e.prototype.onInsertColumnRight=function(){this.documentEditor.editor.insertColumn(!1)},e.prototype.onDeleteRow=function(){this.documentEditor.editor.deleteRow()},e.prototype.onDeleteColumn=function(){this.documentEditor.editor.deleteColumn()},e.prototype.onSelectionChange=function(){this.documentEditor.selection&&(this.documentEditor.editor&&this.documentEditor.editor.canMergeCells()?this.horizontalMerge.disabled=!1:this.horizontalMerge.disabled=!0,"TableText"!==this.documentEditor.selection.contextType&&"TableImage"!==this.documentEditor.selection.contextType||(this.shadingBtn.value=this.documentEditor.selection.cellFormat.background?this.documentEditor.selection.cellFormat.background:""),this.topMargin.value=this.documentEditor.selection.cellFormat.topMargin?this.documentEditor.selection.cellFormat.topMargin:0,this.bottomMargin.value=this.documentEditor.selection.cellFormat.bottomMargin?this.documentEditor.selection.cellFormat.bottomMargin:0,this.rightMargin.value=this.documentEditor.selection.cellFormat.rightMargin?this.documentEditor.selection.cellFormat.rightMargin:0,this.leftMargin.value=this.documentEditor.selection.cellFormat.leftMargin?this.documentEditor.selection.cellFormat.leftMargin:0)},e.prototype.changeBackgroundColor=function(e){var t=this;this.documentEditor.isReadOnly||(this.documentEditor.selection.cellFormat.background=e.currentValue.hex,setTimeout(function(){t.documentEditor.focusIn()},10))},e.prototype.initFillColorDiv=function(){var e=t.createElement("div",{id:this.elementId+"_fillColorDiv",className:"e-de-property-div-padding de-tbl-fill-clr"});this.tableProperties.appendChild(e);var i=t.createElement("label",{className:"e-de-prop-sub-label"});i.classList.add("e-de-prop-fill-label"),this.isRtl&&i.classList.add("e-de-rtl"),i.textContent=this.localObj.getConstant("Fill"),e.appendChild(i),this.shadingBtn=this.createColorPickerTemplate(this.elementId+"_tableShading",e,this.localObj.getConstant("Fill color"),!1),t.classList(e.lastElementChild.lastElementChild.lastElementChild.firstChild,["e-de-ctnr-cellbg-clr-picker"],["e-caret"])},e.prototype.initBorderStylesDiv=function(){var e=t.createElement("div",{className:"e-de-property-div-padding"});this.tableProperties.appendChild(e);var i=t.createElement("label",{className:"e-de-ctnr-prop-label"});i.classList.add("e-de-table-prop-label"),i.textContent=this.localObj.getConstant("Border Style"),e.appendChild(i);var n=t.createElement("div",{id:this.elementId+"_borderStyleDiv",className:"e-de-border-style-div",styles:"display:inline-flex;"}),r=t.createElement("div",{styles:"width:126px;height:126px",className:"e-de-grp-btn-ctnr"}),o=t.createElement("div",{className:this.groupButtonClass+" e-de-ctnr-group-btn-top"});r.appendChild(o);var s=t.createElement("div",{className:this.groupButtonClass+" e-de-ctnr-group-btn-middle"});r.appendChild(s);var a=t.createElement("div",{className:this.groupButtonClass+" e-de-ctnr-group-btn-bottom"});r.appendChild(a),this.isRtl&&(o.classList.add("e-de-rtl"),a.classList.add("e-de-rtl"),n.classList.add("e-de-rtl"),i.classList.add("e-de-rtl"));this.tableOutlineBorder=this.createButtonTemplate(this.elementId+"_tableOutlineBorder","e-de-ctnr-outsideborder e-icons",o,"e-de-prop-font-button","",this.localObj.getConstant("Outside borders")),this.tableAllBorder=this.createButtonTemplate(this.elementId+"_tableAllBorder","e-de-ctnr-allborders e-icons",o,"e-de-prop-font-button","",this.localObj.getConstant("All borders")),this.tableCenterBorder=this.createButtonTemplate(this.elementId+"_tableCenterBorder","e-de-ctnr-insideborders e-icons",o,"e-de-prop-font-button","",this.localObj.getConstant("Inside borders")),this.tableLeftBorder=this.createButtonTemplate(this.elementId+"_tableLeftBorder","e-de-ctnr-leftborders e-icons",s,"e-de-prop-font-button","",this.localObj.getConstant("Left border")),this.tableCenterVerticalBorder=this.createButtonTemplate(this.elementId+"_tableCenterVBorder","e-de-ctnr-insideverticalborder e-icons",s,"e-de-prop-font-button","",this.localObj.getConstant("Inside vertical border")),this.tableRightBorder=this.createButtonTemplate(this.elementId+"_tableRightBorder","e-de-ctnr-rightborder e-icons",s,"e-de-prop-font-button","",this.localObj.getConstant("Right border")),this.tableTopBorder=this.createButtonTemplate(this.elementId+"_tableTopBorder","e-de-ctnr-topborder e-icons",a,"e-de-prop-font-button","",this.localObj.getConstant("Top border")),this.tableCenterHorizontalBorder=this.createButtonTemplate(this.elementId+"_tableCenterHBorder","e-de-ctnr-insidehorizondalborder e-icons",a,"e-de-prop-font-button","",this.localObj.getConstant("Inside horizontal border")),this.tableBottomBorder=this.createButtonTemplate(this.elementId+"_tableBottomBorder","e-de-ctnr-bottomborder e-icons",a,"e-de-prop-font-button","",this.localObj.getConstant("Bottom border")),n.appendChild(r);var l=t.createElement("div",{className:"de-tbl-fill-clr"});this.isRtl?l.classList.add("e-de-stylediv-rtl"):l.classList.add("e-de-stylediv"),this.borderBtn=this.createColorPickerTemplate(this.elementId+"_tableBorderColor",l,this.localObj.getConstant("Border color"),!0),this.borderBtn.value="#000000",l.firstElementChild.lastElementChild.lastElementChild.style.width="30px",l.firstElementChild.lastElementChild.firstElementChild.firstElementChild.style.width="100%",t.classList(l.lastElementChild.lastElementChild.lastElementChild.firstChild,["e-de-ctnr-highlightcolor"],["e-caret"]);var d=t.createElement("button",{id:this.elementId+"_tableBorderSize",className:"e-de-border-size-button",styles:"font-size:10px;padding:0px;",attrs:{type:"button"}});l.appendChild(d),this.borderSize=this.createBorderSizeDropDown("e-de-ctnr-strokesize e-icons",d),n.appendChild(l),this.borderSizeColorElement=document.getElementsByClassName("e-de-border-width"),e.appendChild(n)},e.prototype.initCellDiv=function(){var e=t.createElement("div",{className:"e-de-property-div-padding"});this.tableProperties.appendChild(e);var i=t.createElement("label",{className:"e-de-ctnr-prop-label"});i.classList.add("e-de-table-prop-label"),i.textContent=this.localObj.getConstant("Cell"),e.appendChild(i);var n=t.createElement("div",{className:"e-de-ctnr-group-btn"});n.classList.add("e-de-cell-div"),this.isRtl&&(n.classList.add("e-de-rtl"),i.classList.add("e-de-rtl"));this.horizontalMerge=this.createButtonTemplate(this.elementId+"_tableOutlineBorder","e-de-ctnr-mergecell e-icons",n,"e-de-prop-font-button","width:38px;","Merge cells"),e.appendChild(n)},e.prototype.initInsertOrDelCell=function(){var e=t.createElement("div",{className:"e-de-property-div-padding"});this.tableProperties.appendChild(e);var i=t.createElement("label",{className:"e-de-ctnr-prop-label"});i.classList.add("e-de-table-prop-label"),i.textContent=this.localObj.getConstant("Insert Or Delete"),e.appendChild(i);var n=t.createElement("div",{className:"e-de-insert-del-cell",styles:"display:inline-flex"}),r=t.createElement("div",{className:this.groupButtonClass});n.appendChild(r);var o=t.createElement("div",{className:this.groupButtonClass});this.isRtl?(o.style.marginRight="12px",n.classList.add("e-de-rtl"),i.classList.add("e-de-rtl")):o.style.marginLeft="12px",n.appendChild(o);var s="width:38px;";this.insertColumnLeft=this.createButtonTemplate(this.elementId+"_insertColumnLeft","e-de-ctnr-insertleft e-icons",r,"e-de-prop-font-button",s,this.localObj.getConstant("Insert columns to the left")),this.insertColumnRight=this.createButtonTemplate(this.elementId+"_insertColumnRight","e-de-ctnr-insertright e-icons",r,"e-de-prop-font-button",s,this.localObj.getConstant("Insert columns to the right")),this.insertRowAbove=this.createButtonTemplate(this.elementId+"_insertRowAbove","e-de-ctnr-insertabove e-icons",r,"e-de-prop-font-button",s,this.localObj.getConstant("Insert rows above")),this.insertRowBelow=this.createButtonTemplate(this.elementId+"_insertRowBelow","e-de-ctnr-insertbelow e-icons",r,"e-de-prop-font-button",s,this.localObj.getConstant("Insert rows below")),this.deleteRow=this.createButtonTemplate(this.elementId+"_deleteRow","e-de-ctnr-deleterows e-icons",o,"e-de-prop-font-button",s,this.localObj.getConstant("Delete rows")),this.deleteColumn=this.createButtonTemplate(this.elementId+"_deleteColumn","e-de-ctnr-deletecolumns e-icons",o,"e-de-prop-font-button",s,this.localObj.getConstant("Delete columns")),e.appendChild(n)},e.prototype.initCellMargin=function(){var e=t.createElement("div",{className:"e-de-property-div-padding e-de-cellmargin-text"});this.tableProperties.appendChild(e);var i=t.createElement("label",{className:"e-de-ctnr-prop-label"});i.classList.add("e-de-table-prop-label"),i.textContent=this.localObj.getConstant("Cell Margin"),e.appendChild(i);var n=t.createElement("div",{className:"e-de-cell-margin",styles:"height: 60px;display:inline-flex"});this.isRtl&&i.classList.add("e-de-rtl");this.topMargin=this.createCellMarginTextBox(this.localObj.getConstant("Top"),this.elementId+"_topMargin",n,"width:48px","width:50px;float:left;",500,"Top margin"),this.bottomMargin=this.createCellMarginTextBox(this.localObj.getConstant("Bottom"),this.elementId+"_bottomMargin",n,"width:48px","width:50px;float:left;",500,"Bottom margin"),this.leftMargin=this.createCellMarginTextBox(this.localObj.getConstant("Left"),this.elementId+"_leftMargin",n,"width:48px","width:50px;float:left;",500,"Left margin"),this.rightMargin=this.createCellMarginTextBox(this.localObj.getConstant("Right"),this.elementId+"_rightMargin",n,"width:48px","width:50px;float:left;",500,"Right margin"),e.appendChild(n)},e.prototype.initAlignText=function(){var e=t.createElement("div",{className:"e-de-property-div-padding",styles:"border-bottom-width:0px"});this.tableProperties.appendChild(e);var i=t.createElement("label",{className:"e-de-ctnr-prop-label"});i.classList.add("e-de-table-prop-label"),i.textContent=this.localObj.getConstant("Align Text"),e.appendChild(i);var n=t.createElement("div",{className:"e-de-align-text",styles:"margin-bottom: 10px;"});this.isRtl&&(n.classList.add("e-de-rtl"),i.classList.add("e-de-rtl"));var r=t.createElement("div",{className:this.groupButtonClass});n.appendChild(r);this.alignTop=this.createButtonTemplate(this.elementId+"_alignTop","e-de-ctnr-aligntop e-icons",r,"e-de-prop-font-button","width:38px;",this.localObj.getConstant("Align top")),this.alignBottom=this.createButtonTemplate(this.elementId+"_alignBottom","e-de-ctnr-alignbottom e-icons",r,"e-de-prop-font-button","width:38px;",this.localObj.getConstant("Align bottom")),this.alignCenterHorizontal=this.createButtonTemplate(this.elementId+"_alignCenterHorizontal","e-de-ctnr-aligncenter-table e-icons",r,"e-de-prop-font-button","width:38px;",this.localObj.getConstant("Align center")),this.alignCenterHorizontal.addEventListener("click",this.applyAlignCenterHorizontal.bind(this)),e.appendChild(n)},e.prototype.createCellMarginTextBox=function(e,i,n,r,o,s,l){var d=t.createElement("div",{styles:o});d.classList.add("e-de-cell-text-box");var h=t.createElement("label",{className:"e-de-prop-sub-label"});h.textContent=e,d.appendChild(h);var c=t.createElement("input",{className:"e-textbox",id:i,styles:r});d.appendChild(c);var p=new a.NumericTextBox({showSpinButton:!1,min:0,format:"n0",max:s,enableRtl:this.isRtl},c);return n.appendChild(d),c.setAttribute("title",l),p},e.prototype.createBorderSizeDropDown=function(e,i){var n=this,r=t.createElement("div",{id:"borderSizeTarget",styles:"display:none"}),o=t.createElement("ul",{styles:"display: block; outline: 0px; width: 126px; height: auto;",id:"borderSizeListMenu"});r.appendChild(o),this.createDropdownOption(o,this.localObj.getConstant("No Border")).addEventListener("click",function(){n.onBorderSizeChange("No Border")}),this.createDropdownOption(o,"1px").addEventListener("click",function(){n.onBorderSizeChange("1px")}),this.createDropdownOption(o,"1.5px").addEventListener("click",function(){n.onBorderSizeChange("1.5px")}),this.createDropdownOption(o,"2px").addEventListener("click",function(){n.onBorderSizeChange("2px")}),this.createDropdownOption(o,"3px").addEventListener("click",function(){n.onBorderSizeChange("3px")}),this.createDropdownOption(o,"4px").addEventListener("click",function(){n.onBorderSizeChange("4px")}),this.createDropdownOption(o,"5px").addEventListener("click",function(){n.onBorderSizeChange("5px")});var s={target:r,iconCss:e,cssClass:"e-de-prop-bordersize",enableRtl:this.isRtl,content:"1.5px"},a=new d.DropDownButton(s);return a.beforeOpen=function(){r.style.display="block";for(var e=0;e<n.borderSizeColorElement.length;e++)n.borderSizeColorElement[e].style.borderBottomColor=n.borderColor},a.beforeClose=function(){r.style.display="none"},a.appendTo(i),a.element.setAttribute("title",this.localObj.getConstant("Border width")),a},e.prototype.onBorderSizeChange=function(e){var t=this;this.borderSize.content=e,setTimeout(function(){t.tableOutlineBorder.element.focus()},10)},e.prototype.createDropdownOption=function(e,i){var n=t.createElement("li",{styles:"display:block",className:"e-de-floating-menuitem e-de-floating-menuitem-md e-de-list-items e-de-list-item-size"});e.appendChild(n);var r;r="No Border"===i?"<div>"+i+"</div>":"1.5px"===i?"<div>"+i+'<span class="e-de-list-line e-de-border-width" style="margin-left:10px;border-bottom-width:'+i+';"></span></div>':"<div>"+i+'<span class="e-de-list-line e-de-border-width" style="margin-left:20px;border-bottom-width:'+i+';"></span></div>';var o=t.createElement("div",{className:"e-de-list-header-presetmenu",innerHTML:r});return n.appendChild(o),n},e.prototype.createDropDownButton=function(e,i,n,r,o,s,a){var l=t.createElement("button",{id:e,styles:i,attrs:{type:"button"}});n.appendChild(l);var h="e-de-prop-splitbutton";this.isRtl&&(h="e-rtl "+h);var c=new d.DropDownButton({iconCss:r,content:o,enableRtl:this.isRtl,cssClass:h},l);return s&&(c.items=s),a&&(c.target=a),c},e.prototype.createButtonTemplate=function(e,i,n,o,s,a,l,d){var h=t.createElement("Button",{id:e,styles:s,attrs:{type:"button"}});n.appendChild(h);var c=new r.Button({cssClass:o,iconCss:i,enableRtl:this.isRtl,iconPosition:d||"Left",content:l||""});return c.appendTo(h),h.setAttribute("title",a),c},e.prototype.createColorPickerTemplate=function(e,i,n,r){var o=t.createElement("input",{id:e});i.appendChild(o);var s="e-de-prop-font-button e-de-prop-font-colorpicker";r&&(s+=" e-de-border-clr-picker");var l=new a.ColorPicker({showButtons:!0,cssClass:s,enableRtl:this.isRtl,locale:this.container.locale},o);return o.parentElement.setAttribute("title",n),l},e.prototype.showTableProperties=function(e){e&&(this.prevContext!==this.documentEditor.selection.contextType&&(this.propertiesTab.selectedItem=0,this.tableTextProperties.appliedHighlightColor=this.textProperties.appliedHighlightColor,this.tableTextProperties.appliedBulletStyle=this.textProperties.appliedBulletStyle,this.tableTextProperties.appliedNumberingStyle=this.textProperties.appliedNumberingStyle),this.onSelectionChange(),this.tableTextProperties.onSelectionChange(),this.textProperties.appliedHighlightColor=this.tableTextProperties.appliedHighlightColor,this.textProperties.appliedBulletStyle=this.tableTextProperties.appliedBulletStyle,this.textProperties.appliedNumberingStyle=this.tableTextProperties.appliedNumberingStyle),!e&&"none"===this.parentElement.style.display||e&&"block"===this.parentElement.style.display||(this.parentElement.style.display=e?"block":"none",this.documentEditor.resize(),this.prevContext=this.documentEditor.selection.contextType)},e.prototype.destroy=function(){this.container=void 0,this.shadingBtn&&(this.shadingBtn.destroy(),this.shadingBtn=void 0),this.borderBtn&&(this.borderBtn.destroy(),this.borderBtn=void 0),this.borderSize&&(this.borderSize.destroy(),this.borderSize=void 0),this.topMargin&&(this.topMargin.destroy(),this.topMargin=void 0),this.bottomMargin&&(this.bottomMargin.destroy(),this.bottomMargin=void 0),this.leftMargin&&(this.leftMargin.destroy(),this.leftMargin=void 0),this.rightMargin&&(this.rightMargin.destroy(),this.rightMargin=void 0),this.tableTextProperties&&(this.tableTextProperties.destroy(),this.tableTextProperties=void 0),this.propertiesTab&&(this.propertiesTab.destroy(),this.propertiesTab=void 0)},e}(),en=function(){function e(e,t){this.startPage=1,this.statusBarDiv=e,this.container=t,this.initializeStatusBar(),this.wireEvents()}return Object.defineProperty(e.prototype,"documentEditor",{get:function(){return this.container?this.container.documentEditor:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editorPageCount",{get:function(){return this.documentEditor?this.documentEditor.pageCount:1},enumerable:!0,configurable:!0}),e.prototype.initializeStatusBar=function(){var e=this,i=this.container.enableRtl;this.documentEditor.enableSpellCheck=!!this.container.enableSpellCheck,this.localObj=new t.L10n("documenteditorcontainer",this.container.defaultLocale,this.container.locale);var n=i?"padding-right:16px":"padding-left:16px",r=t.createElement("div",{className:this.container.enableSpellCheck?"e-de-ctnr-pg-no":"e-de-ctnr-pg-no-spellout",styles:n});this.statusBarDiv.appendChild(r);var o=t.createElement("label");o.textContent=this.localObj.getConstant("Page")+" ",r.appendChild(o),this.pageNumberInput=t.createElement("input",{styles:"text-transform:capitalize;white-space:pre;overflow:hidden;user-select:none;cursor:text",attrs:{type:"text"},className:"e-de-pagenumber-input"}),this.editablePageNumber=t.createElement("div",{styles:"display: inline-flex",className:"e-input e-de-pagenumber-text"}),this.editablePageNumber.appendChild(this.pageNumberInput),i?(o.style.marginLeft="6px",this.editablePageNumber.style.marginLeft="6px"):(o.style.marginRight="6px",this.editablePageNumber.style.marginRight="6px"),this.updatePageNumber(),r.appendChild(this.editablePageNumber),this.editablePageNumber.setAttribute("title",this.localObj.getConstant("Current Page Number"));var s=t.createElement("label",{styles:"width:16px"});if(s.textContent=" "+this.localObj.getConstant("of")+" ",r.appendChild(s),this.pageCount=t.createElement("label"),r.appendChild(this.pageCount),this.updatePageCount(),this.documentEditor.enableSpellCheck){var a=t.createElement("div",{className:"e-de-statusbar-separator"});this.statusBarDiv.appendChild(a);var l=this.addSpellCheckElement();this.spellCheckButton.appendTo(l)}this.pageButton=this.createButtonTemplate(this.container.enableSpellCheck?"e-de-statusbar-pageweb e-btn-pageweb-spellcheck":"e-de-statusbar-pageweb","e-de-printlayout e-icons",this.localObj.getConstant("Print layout"),this.statusBarDiv,this.pageButton,"Pages"===this.documentEditor.layoutType),this.webButton=this.createButtonTemplate("e-de-statusbar-pageweb","e-de-weblayout e-icons",this.localObj.getConstant("Web layout"),this.statusBarDiv,this.webButton,"Continuous"===this.documentEditor.layoutType),this.pageButton.addEventListener("click",function(){e.documentEditor.layoutType="Pages",e.addRemoveClass(e.pageButton,e.webButton)}),this.webButton.addEventListener("click",function(){e.documentEditor.layoutType="Continuous",e.addRemoveClass(e.webButton,e.pageButton)});var h=t.createElement("button",{className:"e-de-statusbar-zoom",attrs:{type:"button"}});this.statusBarDiv.appendChild(h),h.setAttribute("title","Zoom level. Click or tap to open the Zoom options.");var c=[{text:"200%"},{text:"175%"},{text:"150%"},{text:"125%"},{text:"100%"},{text:"75%"},{text:"50%"},{text:"25%"},{separator:!0},{text:this.localObj.getConstant("Fit one page")},{text:this.localObj.getConstant("Fit page width")}];this.zoom=new d.DropDownButton({content:"100%",items:c,enableRtl:this.container.enableRtl,select:this.onZoom.bind(this)}),this.zoom.isStringTemplate=!0,this.zoom.appendTo(h)},e.prototype.addSpellCheckElement=function(){var e=this,i=t.createElement("button",{className:"e-de-statusbar-spellcheck"});this.statusBarDiv.appendChild(i),i.setAttribute("title","Spell Checker options");var n=[{text:this.localObj.getConstant("Spell Check")},{text:this.localObj.getConstant("Underline errors")}];return this.spellCheckButton=new d.DropDownButton({content:"Spelling",items:n,enableRtl:this.container.enableRtl,select:this.onSpellCheck.bind(this),beforeItemRender:function(i){i.element.innerHTML="<span></span>"+i.item.text,t.isNullOrUndefined(e.currentLanguage)&&(e.currentLanguage=e.documentEditor.spellChecker.languageID),t.isNullOrUndefined(e.allowSuggestion)&&(e.allowSuggestion=e.documentEditor.spellChecker.allowSpellCheckAndSuggestion);var n=i.element.children[0];i.item.text===e.localObj.getConstant("Spell Check")&&e.documentEditor.enableSpellCheck&&e.documentEditor.spellChecker.enableSpellCheck?(n.style.marginRight="10px",n.setAttribute("class","e-de-selected-spellcheck-item")):i.item.text===e.localObj.getConstant("Underline errors")&&e.documentEditor.enableSpellCheck&&e.documentEditor.spellChecker.enableSpellCheck&&!e.documentEditor.spellChecker.removeUnderline?(n.style.marginRight="10px",n.setAttribute("class","e-de-selected-underline-item")):(n.style.marginRight="25px",i.element.children[0].classList.remove("e-de-selected-spellcheck-item"),i.element.children[0].classList.remove("e-de-selected-underline-item"))}}),i},e.prototype.onZoom=function(e){this.setZoomValue(e.item.text),this.updateZoomContent()},e.prototype.onSpellCheck=function(e){this.setSpellCheckValue(e.item.text)},e.prototype.updateZoomContent=function(){this.zoom.content=Math.round(100*this.documentEditor.zoomFactor)+"%"},e.prototype.setSpellCheckValue=function(e){var t=this;this.spellCheckButton.content="Spelling",e.match(this.localObj.getConstant("Spell Check"))?(this.documentEditor.spellChecker.enableSpellCheck=!this.documentEditor.spellChecker.enableSpellCheck,setTimeout(function(){t.documentEditor.enableSpellCheck&&t.documentEditor.spellChecker.enableSpellCheck&&(t.documentEditor.documentHelper.triggerElementsOnLoading=!0,t.documentEditor.documentHelper.triggerSpellCheck=!0)},50),this.documentEditor.documentHelper.triggerSpellCheck=!1,this.documentEditor.documentHelper.triggerElementsOnLoading=!1):e.match(this.localObj.getConstant("Underline errors"))&&this.documentEditor.enableSpellCheck&&this.documentEditor.spellChecker.enableSpellCheck&&(this.documentEditor.spellChecker.removeUnderline=!this.documentEditor.spellChecker.removeUnderline)},e.prototype.setZoomValue=function(e){e.match(this.localObj.getConstant("Fit one page"))?this.documentEditor.fitPage("FitOnePage"):e.match(this.localObj.getConstant("Fit page width"))?this.documentEditor.fitPage("FitPageWidth"):this.documentEditor.zoomFactor=parseInt(e,10)/100},e.prototype.updatePageCount=function(){this.pageCount.textContent=this.editorPageCount.toString()},e.prototype.updatePageNumber=function(){this.pageNumberInput.value=this.startPage.toString(),this.updatePageNumberWidth()},e.prototype.updatePageNumberOnViewChange=function(e){this.documentEditor.selection&&this.documentEditor.selection.startPage>=e.startPage&&this.documentEditor.selection.startPage<=e.endPage?this.startPage=this.documentEditor.selection.startPage:this.startPage=e.startPage,this.updatePageNumber(),this.updatePageCount()},e.prototype.wireEvents=function(){var e=this;this.pageNumberInput.addEventListener("keydown",function(t){13===t.which&&(t.preventDefault(),parseInt(e.pageNumberInput.value,10)>e.editorPageCount?e.updatePageNumber():e.documentEditor.selection?e.documentEditor.selection.goToPage(parseInt(e.pageNumberInput.value,10)):e.documentEditor.scrollToPage(parseInt(e.pageNumberInput.value,10)),e.pageNumberInput.contentEditable="false",""===e.pageNumberInput.value&&e.updatePageNumber()),t.which>64&&t.preventDefault()}),this.pageNumberInput.addEventListener("keyup",function(){e.updatePageNumberWidth()}),this.pageNumberInput.addEventListener("blur",function(){(""===e.pageNumberInput.value||parseInt(e.pageNumberInput.value,10)>e.editorPageCount)&&e.updatePageNumber(),e.pageNumberInput.contentEditable="false"}),this.pageNumberInput.addEventListener("focus",function(){e.pageNumberInput.select()})},e.prototype.updatePageNumberWidth=function(){this.pageNumberInput&&(this.pageNumberInput.style.width=this.pageNumberInput.value.length>=3?"30px":"22px")},e.prototype.toggleWebLayout=function(){this.addRemoveClass(this.pageButton,this.webButton)},e.prototype.addRemoveClass=function(e,t){e.classList.add("e-btn-toggle"),t.classList.contains("e-btn-toggle")&&t.classList.remove("e-btn-toggle")},e.prototype.createButtonTemplate=function(e,i,n,o,s,a){s=t.createElement("Button",{className:e,attrs:{type:"button"}}),o.appendChild(s);var l=new r.Button({cssClass:e,iconCss:i,enableRtl:this.container.enableRtl});return!0===a&&s.classList.add("e-btn-toggle"),l.appendTo(s),s.setAttribute("title",n),s},e.prototype.destroy=function(){this.container=void 0,this.zoom&&(this.zoom.destroy(),this.zoom=void 0),this.spellCheckButton&&(this.spellCheckButton.destroy(),this.spellCheckButton=void 0),this.pageButton&&(this.pageButton=void 0),this.webButton&&(this.webButton=void 0)},e}(),tn=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),nn=function(e,t,i,n){var r,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},rn=function(e){function i(t,i){var n=e.call(this,t,i)||this;return n.previousContext="",n.showHeaderProperties=!0,n.defaultLocale={New:"New","Insert Footnote":"Insert Footnote","Insert Endnote":"Insert Endnote","Footnote Tooltip":"Insert Footnote (Alt+Ctrl+F).","Endnote Tooltip":"Insert Endnote (Alt+Ctrl+D).",Open:"Open",Undo:"Undo",Redo:"Redo",Image:"Image",Table:"Table",Link:"Link",Bookmark:"Bookmark","Table of Contents":"Table of Contents","HEADING - - - - 1":"HEADING - - - - 1","HEADING - - - - 2":"HEADING - - - - 2","HEADING - - - - 3":"HEADING - - - - 3",Header:"Header",Footer:"Footer","Page Setup":"Page Setup","Page Number":"Page Number",Break:"Break",Find:"Find","Local Clipboard":"Local Clipboard","Restrict Editing":"Restrict Editing","Upload from computer":"Upload from computer","By URL":"By URL","Page Break":"Page Break","Show properties pane":"Show properties pane","Hide properties pane":"Hide properties pane","Section Break":"Section Break","Header And Footer":"Header & Footer",Options:"Options",Levels:"Levels","Different First Page":"Different First Page","Different header and footer for odd and even pages":"Different header and footer for odd and even pages.","Different Odd And Even Pages":"Different Odd & Even Pages","Different header and footer for first page":"Different header and footer for first page.",Position:"Position","Header from Top":"Header from Top","Footer from Bottom":"Footer from Bottom","Distance from top of the page to top of the header":"Distance from top of the page to top of the header.","Distance from bottom of the page to bottom of the footer":"Distance from bottom of the page to bottom of the footer.","Aspect ratio":"Aspect ratio",W:"W",H:"H",Width:"Width",Height:"Height",Text:"Text",Paragraph:"Paragraph",Fill:"Fill","Fill color":"Fill color","Border Style":"Border Style","Outside borders":"Outside borders","All borders":"All borders","Inside borders":"Inside borders","Left border":"Left border","Inside vertical border":"Inside vertical border","Right border":"Right border","Top border":"Top border","Inside horizontal border":"Inside horizontal border","Bottom border":"Bottom border","Border color":"Border color","Border width":"Border width",Cell:"Cell","Merge cells":"Merge cells","Insert Or Delete":"Insert / Delete","Insert columns to the left":"Insert columns to the left","Insert columns to the right":"Insert columns to the right","Insert rows above":"Insert rows above","Insert rows below":"Insert rows below","Delete rows":"Delete rows","Delete columns":"Delete columns","Cell Margin":"Cell Margin",Top:"Top",Bottom:"Bottom",Left:"Left",Right:"Right","Align Text":"Align Text","Align top":"Align top","Align bottom":"Align bottom","Align center":"Align center","Number of heading or outline levels to be shown in table of contents":"Number of heading or outline levels to be shown in table of contents.","Show page numbers":"Show page numbers","Show page numbers in table of contents":"Show page numbers in table of contents.","Right align page numbers":"Right align page numbers","Right align page numbers in table of contents":"Right align page numbers in table of contents.","Use hyperlinks":"Use hyperlinks","Use hyperlinks instead of page numbers":"Use hyperlinks instead of page numbers.",Font:"Font","Font Size":"Font Size","Font color":"Font color","Text highlight color":"Text highlight color","Clear all formatting":"Clear all formatting","Bold Tooltip":"Bold (Ctrl+B)","Italic Tooltip":"Italic (Ctrl+I)","Underline Tooltip":"Underline (Ctrl+U)",Strikethrough:"Strikethrough","Superscript Tooltip":"Superscript (Ctrl+Shift++)","Subscript Tooltip":"Subscript (Ctrl+=)","Align left Tooltip":"Align left (Ctrl+L)","Center Tooltip":"Center (Ctrl+E)","Align right Tooltip":"Align right (Ctrl+R)","Justify Tooltip":"Justify (Ctrl+J)","Decrease indent":"Decrease indent","Increase indent":"Increase indent","Line spacing":"Line spacing",Bullets:"Bullets",Numbering:"Numbering",Styles:"Styles","Manage Styles":"Manage Styles",Page:"Page",of:"of","Fit one page":"Fit one page","Spell Check":"Spell Check","Underline errors":"Underline errors","Fit page width":"Fit page width",Update:"Update",Cancel:"Cancel",Insert:"Insert","No Border":"No Border","Create a new document":"Create a new document.","Open a document":"Open a document.","Undo Tooltip":"Undo the last operation (Ctrl+Z).","Redo Tooltip":"Redo the last operation (Ctrl+Y).","Insert inline picture from a file":"Insert inline picture from a file.","Insert a table into the document":"Insert a table into the document","Create Hyperlink":"Create a link in your document for quick access to web pages and files (Ctrl+K).","Insert a bookmark in a specific place in this document":"Insert a bookmark in a specific place in this document.","Provide an overview of your document by adding a table of contents":"Provide an overview of your document by adding a table of contents.","Add or edit the header":"Add or edit the header.","Add or edit the footer":"Add or edit the footer.","Open the page setup dialog":"Open the page setup dialog.","Add page numbers":"Add page numbers.","Find Text":"Find text in the document (Ctrl+F).","Toggle between the internal clipboard and system clipboard":"Toggle between the internal clipboard and system clipboard.</br>Access to system clipboard through script is denied due to browsers security policy. Instead, </br> 1. You can enable internal clipboard to cut, copy and paste within the component.</br> 2. You can use the keyboard shortcuts (Ctrl+X, Ctrl+C and Ctrl+V) to cut, copy and paste with system clipboard.","Current Page Number":"The current page number in the document. Click or tap to navigate specific page.","Read only":"Read only",Protections:"Protections","Error in establishing connection with web server":"Error in establishing connection with web server",Single:"Single",Double:"Double","New comment":"New comment",Comments:"Comments","Print layout":"Print layout","Web layout":"Web layout","Form Fields":"Form Fields","Text Form":"Text Form","Check Box":"Check Box",DropDown:"Drop-Down","Update Fields":"Update Fields","Update cross reference fields":"Update cross reference fields","Track Changes":"Keep track of the changes made in the document",TrackChanges:"Track Changes",AllCaps:"AllCaps","Change case Tooltip":"Change case",UPPERCASE:"UPPERCASE"},n}return tn(i,e),Object.defineProperty(i.prototype,"documentEditor",{get:function(){return this.documentEditorInternal},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"toolbar",{get:function(){return this.toolbarModule},enumerable:!0,configurable:!0}),i.prototype.getModuleName=function(){return"DocumentEditorContainer"},i.prototype.onPropertyChanged=function(e,i){for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"restrictEditing":this.restrictEditingToggleHelper(e.restrictEditing);break;case"showPropertiesPane":this.showHidePropertiesPane(e.showPropertiesPane);break;case"enableTrackChanges":this.documentEditor&&(this.documentEditor.enableTrackChanges=e.enableTrackChanges,this.documentEditor.showRevisions=e.enableTrackChanges,this.toolbarModule&&this.toolbarModule.toggleTrackChanges(e.enableTrackChanges),this.documentEditor.enableTrackChanges&&(this.documentEditor.documentHelper.showRevision=!0),this.documentEditor.resize());break;case"enableLocalPaste":this.documentEditor&&(this.documentEditor.enableLocalPaste=e.enableLocalPaste);break;case"serviceUrl":this.documentEditor&&(this.documentEditor.serviceUrl=e.serviceUrl);break;case"serverActionSettings":this.documentEditor&&this.setserverActionSettings();break;case"zIndex":this.documentEditor&&(this.documentEditor.zIndex=e.zIndex);break;case"headers":this.documentEditor&&(this.documentEditor.headers=e.headers);break;case"locale":case"enableRtl":this.refresh();break;case"enableComment":this.documentEditor&&(this.documentEditor.enableComment=e.enableComment),this.toolbarModule&&this.toolbarModule.enableDisableInsertComment(e.enableComment);break;case"enableSpellCheck":this.documentEditor&&(this.documentEditor.enableSpellCheck=e.enableSpellCheck);break;case"documentEditorSettings":this.documentEditor&&this.customizeDocumentEditorSettings();break;case"toolbarItems":this.toolbarModule&&this.toolbarModule.reInitToolbarItems(e.toolbarItems);break;case"currentUser":this.documentEditor&&(this.documentEditor.currentUser=e.currentUser);break;case"userColor":this.documentEditor&&(this.documentEditor.userColor=e.userColor);break;case"layoutType":this.documentEditor&&(this.documentEditor.layoutType=e.layoutType);break;case"enableToolbar":this.createToolbarContainer(this.enableRtl,!0),e.enableToolbar&&this.toolbarModule&&(this.toolbarModule.initToolBar(this.toolbarItems),this.toolbarModule.enableDisableInsertComment(this.enableComment),this.toolbarModule.toggleTrackChanges(this.enableTrackChanges)),this.documentEditor&&this.documentEditor.resize();break;case"height":this.element.style.height=t.formatUnit(this.height),this.documentEditor&&this.documentEditor.resize();break;case"width":this.element.style.width=t.formatUnit(this.width),this.documentEditor&&this.documentEditor.resize()}},i.prototype.preRender=function(){this.localObj=new t.L10n("documenteditorcontainer",this.defaultLocale,this.locale),this.initContainerElement()},i.prototype.render=function(){this.toolbarModule&&(this.toolbarModule.initToolBar(this.toolbarItems),this.toolbarModule.enableDisableInsertComment(this.enableComment)),""!==this.height&&(this.element.style.height=t.formatUnit(this.height)),""!==this.width&&(this.element.style.width=t.formatUnit(this.width)),this.element.style.minHeight="320px",this.initializeDocumentEditor(),this.restrictEditing&&this.restrictEditingToggleHelper(this.restrictEditing),this.textProperties=new Yi(this,this.element.id,!1,this.enableRtl),this.headerFooterProperties=new Ji(this,this.enableRtl),this.imageProperties=new Zi(this,this.enableRtl),this.tocProperties=new Qi(this,this.enableRtl),this.tableProperties=new $i(this,this.imageProperties,this.textProperties,this.enableRtl),this.statusBar=new en(this.statusBarElement,this),n.createSpinner({target:this.containerTarget,cssClass:"e-spin-overlay"}),this.setserverActionSettings(),this.customizeDocumentEditorSettings(),this.renderComplete()},i.prototype.restrictEditingToggleHelper=function(e){this.documentEditor.isReadOnly=e,this.toolbarModule&&this.toolbarModule.enableDisableToolBarItem(!e,!1),this.showPropertiesPane=!e,this.showHidePropertiesPane(!e),this.documentEditor.trackChangesPane.enableDisableButton(!e)},i.prototype.setFormat=function(){this.characterFormat&&this.documentEditor.setDefaultCharacterFormat(this.characterFormat),this.paragraphFormat&&this.documentEditor.setDefaultParagraphFormat(this.paragraphFormat),this.sectionFormat&&this.documentEditor.setDefaultSectionFormat(this.sectionFormat)},i.prototype.setserverActionSettings=function(){this.serviceUrl&&(this.documentEditor.serviceUrl=this.serviceUrl),this.serverActionSettings.spellCheck&&(this.documentEditor.serverActionSettings.spellCheck=this.serverActionSettings.spellCheck),this.serverActionSettings.restrictEditing&&(this.documentEditor.serverActionSettings.restrictEditing=this.serverActionSettings.restrictEditing),this.serverActionSettings.systemClipboard&&(this.documentEditor.serverActionSettings.systemClipboard=this.serverActionSettings.systemClipboard),this.headers&&(this.documentEditor.headers=this.headers)},i.prototype.customizeDocumentEditorSettings=function(){if(this.documentEditorSettings.formFieldSettings){var e=this.documentEditorSettings.formFieldSettings,i=this.documentEditor;t.isNullOrUndefined(e.applyShading)||(i.documentEditorSettings.formFieldSettings.applyShading=e.applyShading),t.isNullOrUndefined(e.formFillingMode)||(i.documentEditorSettings.formFieldSettings.formFillingMode=e.formFillingMode),t.isNullOrUndefined(e.formattingExceptions)||(i.documentEditorSettings.formFieldSettings.formattingExceptions=e.formattingExceptions),t.isNullOrUndefined(e.selectionColor)||(i.documentEditorSettings.formFieldSettings.selectionColor=e.selectionColor),t.isNullOrUndefined(e.shadingColor)||(i.documentEditorSettings.formFieldSettings.shadingColor=e.shadingColor)}this.documentEditorSettings.searchHighlightColor&&(this.documentEditor.documentEditorSettings.searchHighlightColor=this.documentEditorSettings.searchHighlightColor),this.documentEditorSettings.fontFamilies&&(this.documentEditor.documentEditorSettings.fontFamilies=this.documentEditorSettings.fontFamilies),this.documentEditorSettings.collaborativeEditingSettings&&(this.documentEditor.documentEditorSettings.collaborativeEditingSettings=this.documentEditorSettings.collaborativeEditingSettings),this.documentEditorSettings.printDevicePixelRatio&&(this.documentEditor.documentEditorSettings.printDevicePixelRatio=this.documentEditorSettings.printDevicePixelRatio)},i.prototype.getPersistData=function(){return"documenteditor-container"},i.prototype.requiredModules=function(){var e=[];return this.enableToolbar&&e.push({member:"toolbar",args:[this]}),e},i.prototype.initContainerElement=function(){var e=this.enableRtl;this.containerTarget=this.createElement("div",{className:"e-de-ctn"}),this.createToolbarContainer(e);var t;t=e?"e-de-pane-rtl":"e-de-pane",this.propertiesPaneContainer=this.createElement("div",{className:t,styles:"display:none"}),this.editorContainer.appendChild(this.propertiesPaneContainer),this.containerTarget.appendChild(this.editorContainer),this.statusBarElement=this.createElement("div",{className:"e-de-status-bar"}),e&&(this.statusBarElement.style.direction="rtl"),this.containerTarget.appendChild(this.statusBarElement),this.element.appendChild(this.containerTarget)},i.prototype.createToolbarContainer=function(e,i){t.isNullOrUndefined(this.editorContainer)&&(this.editorContainer=this.createElement("div",{className:"e-de-tool-ctnr-properties-pane"+(e?" e-de-ctnr-rtl":"")})),this.enableToolbar?(this.toolbarContainer=this.createElement("div",{className:"e-de-ctnr-toolbar"+(e?" e-de-ctnr-rtl":"")}),i?this.containerTarget.insertBefore(this.toolbarContainer,this.containerTarget.firstChild):this.containerTarget.appendChild(this.toolbarContainer),this.editorContainer.classList.remove("e-de-ctnr-properties-pane"),this.editorContainer.classList.add("e-de-tool-ctnr-properties-pane")):(this.editorContainer.classList.remove("e-de-tool-ctnr-properties-pane"),this.editorContainer.classList.add("e-de-ctnr-properties-pane"))},i.prototype.initializeDocumentEditor=function(){var e=this.element.id+"_editor",t=this.createElement("div",{id:e,styles:"width:100%;height:100%"});this.documentEditorInternal=new Ui({isReadOnly:!1,enableRtl:this.enableRtl,selectionChange:this.onSelectionChange.bind(this),contentChange:this.onContentChange.bind(this),documentChange:this.onDocumentChange.bind(this),requestNavigate:this.onRequestNavigate.bind(this),viewChange:this.onViewChange.bind(this),customContextMenuSelect:this.onCustomContextMenuSelect.bind(this),customContextMenuBeforeOpen:this.onCustomContextMenuBeforeOpen.bind(this),beforePaneSwitch:this.onBeforePaneSwitch.bind(this),commentBegin:this.onCommentBegin.bind(this),commentEnd:this.onCommentEnd.bind(this),commentDelete:this.onCommentDelete.bind(this),beforeCommentAction:this.onCommentAction.bind(this),trackChange:this.onTrackChange.bind(this),serviceFailure:this.fireServiceFailure.bind(this),locale:this.locale,acceptTab:!0,zIndex:this.zIndex,enableLocalPaste:this.enableLocalPaste,layoutType:this.layoutType,pageOutline:"#E0E0E0",currentUser:this.currentUser,userColor:this.userColor,height:"100%",width:"100%",enableTrackChanges:this.enableTrackChanges,showRevisions:this.enableTrackChanges,enableLockAndEdit:this.enableLockAndEdit}),this.wireEvents(),this.documentEditor.enableAllModules(),this.documentEditor.enableComment=this.enableComment,this.editorContainer.insertBefore(t,this.editorContainer.firstChild),this.setFormat(),this.documentEditor.appendTo(t),this.documentEditor.resize()},i.prototype.wireEvents=function(){this.documentEditor.on("internalZoomFactorChange",this.onZoomFactorChange,this)},i.prototype.unWireEvents=function(){this.documentEditor.off("internalZoomFactorChange",this.onZoomFactorChange)},i.prototype.onCommentBegin=function(){this.toolbarModule&&this.toolbarModule.enableDisableInsertComment(!1)},i.prototype.onCommentEnd=function(){this.toolbarModule&&this.toolbarModule.enableDisableInsertComment(this.enableComment)},i.prototype.onCommentDelete=function(e){this.trigger("commentDelete",e)},i.prototype.onCommentAction=function(e){this.trigger("beforeCommentAction",e)},i.prototype.onTrackChange=function(e){this.trigger("trackChange",e),this.toolbarModule&&this.toolbarModule.toggleTrackChanges(e.isTrackChangesEnabled)},i.prototype.onBeforePaneSwitch=function(e){this.trigger("beforePaneSwitch",e)},i.prototype.fireServiceFailure=function(e){this.trigger("serviceFailure",e)},i.prototype.showHidePropertiesPane=function(e){this.showPropertiesPane&&this.showPropertiesPaneOnSelection(),this.propertiesPaneContainer.style.display=e?"block":"none",this.toolbarModule&&(this.toolbarModule.propertiesPaneButton.element.style.opacity=e?"1":"0.5"),this.documentEditor.resize()},i.prototype.resize=function(e,i){this.element&&(t.isNullOrUndefined(i)&&this.element&&this.element.parentElement&&(i=this.element.parentElement.clientHeight),t.isNullOrUndefined(e)&&this.element&&this.element.parentElement&&(e=this.element.parentElement.clientWidth),!t.isNullOrUndefined(e)&&e>200&&(this.width=e.toString(),this.element.style.width=e+"px"),!t.isNullOrUndefined(i)&&i>200&&(this.height=i.toString(),this.element.style.height=i+"px"),this.documentEditor&&this.documentEditor.resize(),this.toolbarModule&&this.toolbarModule.toolbar.refreshOverflow())},i.prototype.onContentChange=function(){this.toolbarModule&&this.toolbarModule.enableDisableUndoRedo(),this.statusBar&&this.statusBar.updatePageCount();var e={source:t.isBlazor()?null:this};this.trigger("contentChange",e)},i.prototype.onDocumentChange=function(){this.enableTrackChanges=this.documentEditor.enableTrackChanges,this.toolbarModule&&(this.toolbarModule.isCommentEditing=!1,this.toolbarModule.enableDisableInsertComment(!0),this.toolbarModule.enableDisableUndoRedo()),this.textProperties&&this.textProperties.updateStyles(),this.statusBar&&this.statusBar.updatePageCount();var e={source:t.isBlazor()?null:this};this.trigger("documentChange",e)},i.prototype.onSelectionChange=function(){var e=this;setTimeout(function(){e.showPropertiesPaneOnSelection();var i={source:t.isBlazor()?null:e};e.trigger("selectionChange",i)})},i.prototype.onZoomFactorChange=function(){this.statusBar&&this.statusBar.updateZoomContent()},i.prototype.onRequestNavigate=function(e){if("Bookmark"!==e.linkType){var t=e.navigationLink;e.localReference.length>0&&(t+="#"+e.localReference),window.open(t),e.isHandled=!0}},i.prototype.onViewChange=function(e){this.statusBar&&this.statusBar.updatePageNumberOnViewChange(e)},i.prototype.onCustomContextMenuSelect=function(e){this.trigger("customContextMenuSelect",e)},i.prototype.onCustomContextMenuBeforeOpen=function(e){this.trigger("customContextMenuBeforeOpen",e)},i.prototype.showPropertiesPaneOnSelection=function(){if(!this.restrictEditing&&void 0!==this.textProperties||this.showPropertiesPane){var e="NoProtection"!==this.documentEditor.documentHelper.protectionType,t=e&&this.documentEditor.documentHelper.restrictFormatting,i=this.documentEditor.editor.restrictEditing;if(e)this.toolbarModule&&this.toolbarModule.enableDisableToolBarItem(!i,!0),this.textProperties.enableDisableElements(!t&&!i),this.tableProperties.enableDisableElements(!t&&!i),this.tocProperties.enableDisableElements(!i),this.headerFooterProperties.enableDisableElements(!i),this.imageProperties.enableDisableElements(!i);else{var n=!this.documentEditor.isReadOnly;this.toolbarModule&&this.toolbarModule.enableDisableToolBarItem(n,!0),this.textProperties.enableDisableElements(n||this.showPropertiesPane),this.tableProperties.enableDisableElements(!0),this.tocProperties.enableDisableElements(!0),this.headerFooterProperties.enableDisableElements(!0),this.imageProperties.enableDisableElements(!0)}var r=this.documentEditor.selection.contextType,o=r.indexOf("Header")>=0||r.indexOf("Footer")>=0;o||(this.showHeaderProperties=!0),this.showPropertiesPane?(this.propertiesPaneContainer.style.display="block",o&&this.showHeaderProperties?this.showProperties("headerfooter"):r.indexOf("List")>=0||r.indexOf("Text")>=0&&r.indexOf("Table")<0?this.showProperties("text"):r.indexOf("Image")>=0?this.showProperties("image"):r.indexOf("TableOfContents")>=0?this.showProperties("toc"):r.indexOf("Table")>=0&&this.showProperties("table")):(this.showHidePropertiesPane(!1),this.propertiesPaneContainer.style.display="none"),this.previousContext=this.documentEditor.selection.contextType,this.toolbarModule&&this.toolbarModule.toolbar&&this.toolbarModule.enableDisableInsertComment(!this.documentEditor.enableHeaderAndFooter&&this.enableComment&&!this.documentEditor.isReadOnlyMode)}},i.prototype.showProperties=function(e){this.toolbarModule&&"headerfooter"!==e&&"toc"!==e&&this.toolbarModule.enableDisablePropertyPaneButton(!0),this.textProperties.showTextProperties("text"===e),this.tableProperties.showTableProperties("table"===e),this.imageProperties.showImageProperties("image"===e),this.headerFooterProperties.showHeaderFooterPane("headerfooter"===e),this.tocProperties.showTocPane("toc"===e)},i.prototype.setDefaultCharacterFormat=function(e){this.characterFormat=e},i.prototype.setDefaultParagraphFormat=function(e){this.paragraphFormat=e},i.prototype.setDefaultSectionFormat=function(e){this.sectionFormat=e},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.element&&(this.element.innerHTML=""),this.refreshing||(this.element.classList.remove("e-documenteditorcontainer"),this.element=void 0),this.toolbarContainer&&this.toolbarContainer.parentElement&&(this.toolbarContainer.innerHTML="",this.toolbarContainer.parentElement.removeChild(this.toolbarContainer)),this.toolbarContainer=void 0,this.documentEditorInternal&&this.documentEditorInternal.destroy(),this.documentEditorInternal=void 0,this.textProperties&&this.textProperties.destroy(),this.textProperties=void 0,this.headerFooterProperties&&this.headerFooterProperties.destroy(),this.headerFooterProperties=void 0,this.imageProperties&&this.imageProperties.destroy(),this.imageProperties=void 0,this.tocProperties&&this.tocProperties.destroy(),this.tocProperties=void 0,this.tableProperties&&this.tableProperties.destroy(),this.tableProperties=void 0,this.statusBar&&this.statusBar.destroy(),this.propertiesPaneContainer&&this.editorContainer.parentElement&&(this.propertiesPaneContainer.innerHTML="",this.propertiesPaneContainer.parentElement.removeChild(this.propertiesPaneContainer)),this.propertiesPaneContainer=void 0,this.editorContainer&&this.editorContainer.parentElement&&(this.editorContainer.innerHTML="",this.editorContainer.parentElement.removeChild(this.editorContainer)),this.statusBarElement&&this.statusBarElement.parentElement&&(this.statusBarElement.innerHTML="",this.statusBarElement.parentElement.removeChild(this.statusBarElement)),this.containerTarget&&this.containerTarget.parentElement&&(this.containerTarget.innerHTML="",this.containerTarget.parentElement.removeChild(this.containerTarget)),this.containerTarget=void 0,this.statusBarElement=void 0,this.editorContainer=void 0,this.unWireEvents()},nn([t.Property(!0)],i.prototype,"showPropertiesPane",void 0),nn([t.Property(!0)],i.prototype,"enableToolbar",void 0),nn([t.Property(!1)],i.prototype,"restrictEditing",void 0),nn([t.Property(!1)],i.prototype,"enableSpellCheck",void 0),nn([t.Property(!1)],i.prototype,"enableTrackChanges",void 0),nn([t.Property("Pages")],i.prototype,"layoutType",void 0),nn([t.Property("")],i.prototype,"currentUser",void 0),nn([t.Property("#FFFF00")],i.prototype,"userColor",void 0),nn([t.Property(!1)],i.prototype,"enableLocalPaste",void 0),nn([t.Property()],i.prototype,"serviceUrl",void 0),nn([t.Property(2e3)],i.prototype,"zIndex",void 0),nn([t.Property(!1)],i.prototype,"enableCsp",void 0),nn([t.Property(!0)],i.prototype,"enableComment",void 0),nn([t.Property("100%")],i.prototype,"width",void 0),nn([t.Property("320px")],i.prototype,"height",void 0),nn([t.Property(!1)],i.prototype,"enableLockAndEdit",void 0),nn([t.Event()],i.prototype,"created",void 0),nn([t.Event()],i.prototype,"destroyed",void 0),nn([t.Event()],i.prototype,"contentChange",void 0),nn([t.Event()],i.prototype,"selectionChange",void 0),nn([t.Event()],i.prototype,"documentChange",void 0),nn([t.Event()],i.prototype,"toolbarClick",void 0),nn([t.Event()],i.prototype,"customContextMenuSelect",void 0),nn([t.Event()],i.prototype,"customContextMenuBeforeOpen",void 0),nn([t.Event()],i.prototype,"beforePaneSwitch",void 0),nn([t.Event()],i.prototype,"commentDelete",void 0),nn([t.Event()],i.prototype,"beforeCommentAction",void 0),nn([t.Event()],i.prototype,"serviceFailure",void 0),nn([t.Event()],i.prototype,"trackChange",void 0),nn([t.Event()],i.prototype,"contentControl",void 0),nn([t.Complex({},Mi)],i.prototype,"documentEditorSettings",void 0),nn([t.Property({import:"Import",systemClipboard:"SystemClipboard",spellCheck:"SpellCheck",restrictEditing:"RestrictEditing",canLock:"CanLock",getPendingActions:"GetPendingActions"})],i.prototype,"serverActionSettings",void 0),nn([t.Property(["New","Open","Separator","Undo","Redo","Separator","Image","Table","Hyperlink","Bookmark","TableOfContents","Separator","Header","Footer","PageSetup","PageNumber","Break","InsertFootnote","InsertEndnote","Separator","Find","Separator","Comments","TrackChanges","Separator","LocalClipboard","RestrictEditing","Separator","FormFields","UpdateFields"])],i.prototype,"toolbarItems",void 0),nn([t.Property([])],i.prototype,"headers",void 0),i=nn([t.NotifyPropertyChanges],i)}(t.Component);return Ui.Inject(C,ci,di,hi,Dt,_t,ri,ii,jt,Ft,oi,pi,gi,ui,mi,fi,vi,bi,wi,Ii,Ci,xi,Fi,Pi,Ti,Si,Oi,Ni,li),rn.Inject(Gi),e.Dictionary=u,e.WUniqueFormat=m,e.WUniqueFormats=f,e.XmlHttpRequestHandler=v,e.internalZoomFactorChange="internalZoomFactorChange",e.contentChangeEvent="contentChange",e.documentChangeEvent="documentChange",e.selectionChangeEvent="selectionChange",e.zoomFactorChangeEvent="zoomFactorChange",e.beforeFieldFillEvent="beforeFieldFill",e.afterFieldFillEvent="afterFieldFill",e.afterFormFieldFillEvent=y,e.beforeFormFieldFillEvent=b,e.serviceFailureEvent="serviceFailure",e.viewChangeEvent="viewChange",e.customContextMenuSelectEvent="customContextMenuSelect",e.customContextMenuBeforeOpenEvent="customContextMenuBeforeOpen",e.contentControlEvent="contentControl",e.commentBeginEvent="commentBegin",e.commentEndEvent="commentEnd",e.beforeCommentActionEvent="beforeCommentAction",e.commentDeleteEvent="commentDelete",e.beforePaneSwitchEvent="beforePaneSwitch",e.requestNavigateEvent="requestNavigate",e.actionCompleteEvent="actionComplete",e.trackChangeEvent="trackChange",e.searchResultsChangeEvent="searchResultsChange",e.keyDownEvent=w,e.toolbarClickEvent="toolbarClick",e.beforeFileOpenEvent="beforeFileOpen",e.Print=C,e.ContextMenu=Ft,e.WSectionFormat=x,e.WStyle=M,e.WParagraphStyle=U,e.WCharacterStyle=z,e.WStyles=V,e.WCharacterFormat=k,e.WListFormat=T,e.WTabStop=S,e.WParagraphFormat=I,e.WTableFormat=j,e.WRowFormat=H,e.WCellFormat=q,e.WBorder=N,e.WBorders=E,e.WShading=_,e.WList=P,e.WAbstractList=G,e.WListLevel=K,e.WLevelOverride=F,e.DocumentHelper=se,e.LayoutViewer=ae,e.PageLayoutViewer=le,e.WebLayoutViewer=de,e.Rect=ce,e.Padding=pe,e.Margin=ge,e.Widget=ue,e.BlockContainer=me,e.BodyWidget=fe,e.HeaderFooterWidget=ve,e.BlockWidget=ye,e.FootNoteWidget=be,e.ParagraphWidget=we,e.TablePosition=Ce,e.TableWidget=xe,e.TableRowWidget=Fe,e.TableCellWidget=Pe,e.LineWidget=Te,e.ElementBox=Se,e.FieldElementBox=Ie,e.FormField=Ne,e.TextFormField=Ee,e.CheckBoxFormField=He,e.DropDownFormField=We,e.TextElementBox=Oe,e.Footnote=ke,e.FootnoteElementBox=Le,e.ErrorTextElementBox=Re,e.FieldTextElementBox=Be,e.TabElementBox=De,e.BookmarkElementBox=Ae,e.ContentControl=Me,e.ContentControlProperties=Ue,e.ContentControlListItems=ze,e.CheckBoxState=Ve,e.XmlMapping=_e,e.CustomXmlPart=je,e.ShapeCommon=qe,e.ShapeBase=Ge,e.ShapeElementBox=Ke,e.TextFrame=Xe,e.LineFormat=Ye,e.FillFormat=Je,e.ImageElementBox=Ze,e.ListTextElementBox=Qe,e.EditRangeEndElementBox=$e,e.EditRangeStartElementBox=et,e.ChartElementBox=tt,e.ChartArea=it,e.ChartCategory=nt,e.ChartData=rt,e.ChartLegend=ot,e.ChartSeries=st,e.ChartErrorBar=at,e.ChartSeriesFormat=lt,e.ChartDataLabels=dt,e.ChartTrendLines=ht,e.ChartTitleArea=ct,e.ChartDataFormat=pt,e.ChartFill=gt,e.ChartLayout=ut,e.ChartCategoryAxis=mt,e.ChartDataTable=ft,e.CommentCharacterElementBox=vt,e.CommentElementBox=yt,e.Page=bt,e.WTableHolder=wt,e.WColumn=Ct,e.ColumnSizeInfo=xt,e.Layout=X,e.Renderer=Y,e.SfdtReader=Pt,e.TextHelper=J,e.Zoom=Z,e.Selection=Dt,e.SelectionCharacterFormat=Tt,e.SelectionParagraphFormat=St,e.SelectionSectionFormat=It,e.SelectionTableFormat=Nt,e.SelectionCellFormat=Et,e.SelectionRowFormat=Ht,e.SelectionImageFormat=Wt,e.TextPosition=kt,e.SelectionWidgetInfo=Lt,e.Hyperlink=Rt,e.ImageInfo=Bt,e.Search=_t,e.OptionsPane=jt,e.TextSearch=At,e.SearchWidgetInfo=Mt,e.TextSearchResult=Ut,e.TextSearchResults=zt,e.Editor=ri,e.ImageResizer=oi,e.ImageResizingPoints=si,e.SelectedImageInfo=ai,e.TableResizer=ni,e.HelperMethods=L,e.Point=R,e.Base64=B,e.WrapPosition=D,e.CollaborativeEditing=li,e.EditorHistory=ii,e.BaseHistoryInfo=$t,e.HistoryInfo=ti,e.ModifiedLevel=qt,e.ModifiedParagraphFormat=Gt,e.RowHistoryFormat=Kt,e.TableHistoryInfo=Xt,e.TableFormatHistoryInfo=Yt,e.RowFormatHistoryInfo=Jt,e.CellFormatHistoryInfo=Zt,e.CellHistoryFormat=Qt,e.WordExport=di,e.TextExport=hi,e.SfdtExport=ci,e.HtmlExport=Ot,e.HyperlinkDialog=pi,e.TableDialog=gi,e.BookmarkDialog=ui,e.TableOfContentsDialog=mi,e.PageSetupDialog=fi,e.ParagraphDialog=vi,e.ListDialog=bi,e.StyleDialog=wi,e.BulletsAndNumberingDialog=Ci,e.FontDialog=xi,e.TablePropertiesDialog=Fi,e.BordersAndShadingDialog=Pi,e.TableOptionsDialog=Ti,e.CellOptionsDialog=Si,e.StylesDialog=Ii,e.SpellCheckDialog=Ni,e.CheckBoxFormFieldDialog=Ei,e.TextFormFieldDialog=Hi,e.DropDownFormFieldDialog=Wi,e.FormFieldPopUp=ie,e.SpellChecker=Oi,e.AddUserDialog=Q,e.EnforceProtectionDialog=$,e.UnProtectDocumentDialog=ee,e.RestrictEditing=te,e.CommentReviewPane=ki,e.CommentPane=Li,e.CommentView=Ri,e.Revision=W,e.RevisionCollection=O,e.TrackChangesPane=ne,e.ChangesSingleView=re,e.DocumentEditorSettings=Mi,e.DocumentEditor=Ui,e.ServerActionSettings=zi,e.FormFieldSettings=Vi,e.CollaborativeEditingSettings=_i,e.ContainerServerActionSettings=ji,e.Toolbar=Gi,e.DocumentEditorContainer=rn,e}({},ej.base,ej.navigations,ej.popups,ej.buttons,ej.lists,ej.dropdowns,ej.inputs,ej.calendars,ej.splitbuttons,ej.officechart,ej.compression,ej.fileutils,ej.data),this.ejs=ej;
|